about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-11-18 00:17:29 -0800
committerKartik Agaram <vc@akkartik.com>2018-11-18 00:17:29 -0800
commitb31455f81d8b7cecd66f577a0ce545dfe66d705b (patch)
treeccbb6c84395c3860748f1a1bdf73375508cbc274
parent3d9108130ff1f17865d6468976d66a0a7a8fe48d (diff)
downloadmu-b31455f81d8b7cecd66f577a0ce545dfe66d705b.tar.gz
4747 - subx: 'read' primitive
-rw-r--r--subx/010---vm.cc2
-rw-r--r--subx/056write.subx37
-rw-r--r--subx/058read.subx362
-rwxr-xr-xsubx/apps/crenshaw2-1bin3378 -> 4171 bytes
-rwxr-xr-xsubx/apps/factorialbin3395 -> 4188 bytes
5 files changed, 385 insertions, 16 deletions
diff --git a/subx/010---vm.cc b/subx/010---vm.cc
index 8a19d818..a71d431f 100644
--- a/subx/010---vm.cc
+++ b/subx/010---vm.cc
@@ -112,7 +112,7 @@ SF = ZF = OF = false;
 //:: simulated RAM
 
 :(before "End Types")
-const uint32_t INITIAL_SEGMENT_SIZE = 0x1000 - 1;
+const uint32_t INITIAL_SEGMENT_SIZE = 0x1000000 - 1;
 // Subtract one just so we can start the first segment at address 1 without
 // overflowing the first segment. Other segments will learn to adjust.
 
diff --git a/subx/056write.subx b/subx/056write.subx
index e750c12d..015f9f69 100644
--- a/subx/056write.subx
+++ b/subx/056write.subx
@@ -15,20 +15,6 @@
 #   write: int  # index at which writes go
 #   data: (array byte)  # prefixed by length as usual
 
-== data
-
-# In-memory stream for tests to write() to.
-# Also illustrates the layout of streams.
-_test-stream:
-  # current write index
-  00 00 00 00
-  # current read index
-  00 00 00 00
-  # length (= 8)
-  08 00 00 00
-  # data
-  00 00 00 00 00 00 00 00  # 8 bytes
-
 == code
 
 # instruction                     effective address                                                   operand     displacement    immediate
@@ -97,7 +83,7 @@ $write:end:
   5d/pop-to-EBP
   c3/return
 
-clear-stream:  # f : (address stream)
+clear-stream:  # f : (address stream) -> <void>
   # prolog
   55/push-EBP
   89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
@@ -151,6 +137,15 @@ test-write-single:
   e8/call  write/disp32
     # discard args
   81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+  # check-ints-equal(EAX, 2)
+    # push args
+  68/push  "F - test-read-single: return EAX"/imm32
+  68/push  2/imm32
+  50/push-EAX
+    # call
+  e8/call  check-ints-equal/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
   # check-ints-equal(*_test-stream.data, 41/A 62/b 00 00, msg)
     # push args
   68/push  "F - test-write-single"/imm32
@@ -202,3 +197,15 @@ test-write-appends:
   81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
   # end
   c3/return
+
+== data
+
+_test-stream:
+  # current write index
+  00 00 00 00
+  # current read index
+  00 00 00 00
+  # length (= 8)
+  08 00 00 00
+  # data
+  00 00 00 00 00 00 00 00  # 8 bytes
diff --git a/subx/058read.subx b/subx/058read.subx
new file mode 100644
index 00000000..a43a8718
--- /dev/null
+++ b/subx/058read.subx
@@ -0,0 +1,362 @@
+# read: analogously to write, support reading from in-memory streams in
+# addition to file descriptors.
+#
+# We can pass it either a file descriptor or an address to a stream. If a
+# file descriptor is passed in, we _read from it using the right syscall. If a
+# stream is passed in (a fake file descriptor), we read from it instead. This
+# lets us initialize input for tests.
+#
+# A little counter-intuitively, the output of 'read' ends up in.. a stream. So
+# tests end up doing a redundant copy. Why? Well, consider the alternatives:
+#
+#   a) Reading into a string, and returning a pointer to the end of the read
+#   region, or a count of bytes written. Now this count or end pointer must be
+#   managed separately by the caller, which can be error-prone.
+#
+#   b) Having 'read' return a buffer that it allocates. But there's no way to
+#   know in advance how large to make the buffer. If you read less than the
+#   size of the buffer you again end up needing to manage initialized vs
+#   uninitialized memory.
+#
+#   c) Creating more helpful variants like 'read-byte' or 'read-until' which
+#   also can take a file descriptor or stream, just like 'write'. But such
+#   primitives don't exist in the Linux kernel, so we'd be implementing them
+#   somehow, either with more internal buffering or by making multiple
+#   syscalls.
+#
+# Reading into a stream avoids these problems. The buffer is externally
+# provided and the caller has control over where it's allocated, its lifetime,
+# and so on. The buffer's read and write pointers are internal to it so it's
+# easier to keep in a consistent state. And it can now be passed directly to
+# helpers like 'read-byte' or 'read-until' that only need to support streams,
+# never file descriptors.
+#
+# Like with 'write', we assume our data segment will never begin at an address
+# shorter than 0x08000000, so any smaller arguments are assumed to be real
+# file descriptors.
+#
+# As a reminder, a stream looks like this:
+#   write: int  # index at which to write to next
+#   read: int  # index at which to read next
+#   data: (array byte)  # prefixed by length as usual
+
+== code
+
+# instruction                     effective address                                                   operand     displacement    immediate
+# op          subop               mod             rm32          base        index         scale       r32
+# 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes
+
+# main:  (manual test if this is the last file loaded)
+  e8/call  run-tests/disp32  # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.
+  # syscall(exit, Num-test-failures)
+  8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           1/r32/EBX   Num-test-failures/disp32          # copy *Num-test-failures to EBX
+  b8/copy-to-EAX  1/imm32
+  cd/syscall  0x80/imm8
+
+read:  # f : fd or (address stream), s : (address stream) -> num-bytes-read/EAX
+  # prolog
+  55/push-EBP
+  89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
+  ## if (f < 0x08000000) return _read(f, s)  # f can't be a user-mode address, so treat it as a kernel file descriptor
+  81          7/subop/compare     1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           .           8/disp8         0x08000000/imm32  # compare *(EBP+8)
+  7d/jump-if-greater-or-equal  $read:fake/disp8
+    # push args
+  ff          6/subop/push        1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           .           0xc/disp8       .                 # push *(EBP+12)
+  ff          6/subop/push        1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           .           8/disp8         .                 # push *(EBP+8)
+    # call
+  e8/call  _read/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+  # return
+  eb/jump  $read:end/disp8
+$read:fake:
+  ## otherwise, treat 'f' as a stream to scan from
+  # save registers
+  56/push-ESI
+  57/push-EDI
+  # ESI = f
+  8b/copy                         1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none              6/r32/ESI   8/disp8         .                 # copy *(EBP+8) to ESI
+  # EDI = s
+  8b/copy                         1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none              7/r32/EDI   0xc/disp8       .                 # copy *(EBP+12) to ESI
+  # EAX = _append-4(out = &s->data[s->write], outend = &s->data[s->length],
+  #                 in  = &f->data[f->read],  inend =  &f->data[f->write])
+    # push &f->data[f->write]
+  8b/copy                         0/mod/indirect  6/rm32/ESI    .           .             .           0/r32/EAX   .               .                 # copy *ESI to EAX
+  8d/copy-address                 1/mod/*+disp8   4/rm32/sib    6/base/ESI  0/index/EAX   .           0/r32/EAX   0xc/disp8       .                 # copy ESI+EAX+12 to EAX
+  50/push-EAX
+    # push &f->data[f->read]
+  8b/copy                         1/mod/*+disp8   6/rm32/ESI    .           .             .           0/r32/EAX   4/disp8         .                 # copy *(ESI+4) to EAX
+  8d/copy-address                 1/mod/*+disp8   4/rm32/sib    6/base/ESI  0/index/EAX   .           0/r32/EAX   0xc/disp8       .                 # copy ESI+EAX+12 to EAX
+  50/push-EAX
+    # push &s.data[s.length]
+  8b/copy                         1/mod/*+disp8   7/rm32/EDI    .           .             .           0/r32/EAX   8/disp8         .                 # copy *(EDI+8) to EAX
+  8d/copy-address                 1/mod/*+disp8   4/rm32/sib    7/base/EDI  0/index/EAX   .           0/r32/EAX   0xc/disp8       .                 # copy EDI+EAX+12 to EAX
+  50/push-EAX
+    # push &s.data[s.write]
+  8b/copy                         0/mod/indirect  7/rm32/EDI    .           .             .           0/r32/EAX   .               .                 # copy *EDI to EAX
+  8d/copy-address                 1/mod/*+disp8   4/rm32/sib    7/base/EDI  0/index/EAX   .           0/r32/EAX   0xc/disp8       .                 # copy EDI+EAX+12 to EAX
+  50/push-EAX
+    # call
+  e8/call  _append-4/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x10/imm32        # add to ESP
+  # s.write += EAX
+  01/add                          0/mod/indirect  7/rm32/EDI    .           .             .           0/r32/EAX   .               .                 # add EAX to *EDI
+  # f.read += EAX
+  01/add                          1/mod/*+disp8   6/rm32/ESI    .           .             .           0/r32/EAX   4/disp8         .                 # add EAX to *(ESI+4)
+  # restore registers
+  5f/pop-to-EDI
+  5e/pop-to-ESI
+$read:end:
+  # epilog
+  89/copy                         3/mod/direct    4/rm32/ESP    .           .             .           5/r32/EBP   .               .                 # copy EBP to ESP
+  5d/pop-to-EBP
+  c3/return
+
+## helpers
+
+# idea: we could create a clear-if-empty method that clears only if f.read == f.write
+# Unclear how I'd use it, though. Callers seem to need the check anyway.
+# Maybe a better helper would be 'empty-stream?'
+
+_read:  # fd : int, s : (address stream) -> num-bytes-read/EAX
+  # prolog
+  55/push-EBP
+  89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
+  # save registers
+  51/push-ECX
+  52/push-EDX
+  53/push-EBX
+  56/push-ESI
+  # ESI = s
+  8b/copy                         1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           6/r32/ESI   0xc/disp8       .                 # copy *(EBP+12) to ESI
+  # EAX = s.write
+  8b/copy                         0/mod/indirect  6/rm32/ESI    .           .             .           0/r32/EAX   .               .                 # copy *ESI to EAX
+  # EDX = s.length
+  8b/copy                         1/mod/*+disp8   6/rm32/ESI    .           .             .           2/r32/EDX   8/disp8         .                 # copy *(ESI+8) to EDX
+  # syscall(read, fd, &s.data[s.write], s.length - s.write)
+    # fd : EBX
+  8b/copy                         1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           3/r32/EBX   8/disp8         .                 # copy *(EBP+8) to EBX
+    # data : ECX = &s.data[s.write]
+  8d/copy-address                 1/mod/*+disp8   4/rm32/sib    6/base/ESI  0/index/EAX   .           1/r32/ECX   0xc/disp8       .                 # copy ESI+EAX+12 to ECX
+    # size : EDX = s.length - s.write
+  29/subtract                     3/mod/direct    2/rm32/EDX    .           .             .           0/r32/EAX   .               .                 # subtract EAX from EDX
+    # syscall
+  b8/copy-to-EAX  3/imm32/read
+  cd/syscall  0x80/imm8
+  # add the result EAX to s.write
+  01/add                          0/mod/indirect  6/rm32/ESI    .           .             .           0/r32/EAX   .               .                 # add EAX to *ESI
+  # restore registers
+  5e/pop-to-ESI
+  5b/pop-to-EBX
+  5a/pop-to-EDX
+  59/pop-to-ECX
+  # epilog
+  89/copy                         3/mod/direct    4/rm32/ESP    .           .             .           5/r32/EBP   .               .                 # copy EBP to ESP
+  5d/pop-to-EBP
+  c3/return
+
+  # Two options:
+  #   1 (what we have above):
+  #     ECX = s
+  #     EAX = s.write
+  #     EDX = s.length
+  #     # syscall
+  #     ECX = lea ECX+EAX+12
+  #     EDX = sub EDX EAX
+  #
+  #   2:
+  #     ECX = s
+  #     EDX = s.length
+  #     ECX = &s.data
+  #     # syscall
+  #     ECX = add ECX, s.write
+  #     EDX = sub EDX, s.write
+  #
+  # Not much to choose between the two? Option 2 performs a duplicate load to
+  # use one less register, but doesn't increase the amount of spilling (ECX
+  # and EDX must be used, and EAX must be clobbered anyway).
+
+## tests
+
+test-read-single:
+  # clear-stream(_test-stream)
+    # push args
+  68/push  _test-stream/imm32
+    # call
+  e8/call  clear-stream/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
+  # clear-stream(_test-stream-buffer)
+    # push args
+  68/push  _test-stream-buffer/imm32
+    # call
+  e8/call  clear-stream/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
+  # write(_test-stream, "Ab")
+    # push args
+  68/push  "Ab"/imm32
+  68/push  _test-stream/imm32
+    # call
+  e8/call  write/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+  # read(_test-stream, _test-stream-buffer)
+    # push args
+  68/push  _test-stream-buffer/imm32
+  68/push  _test-stream/imm32
+    # call
+  e8/call  read/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+  # check-ints-equal(EAX, 2)
+    # push args
+  68/push  "F - test-read-single: return EAX"/imm32
+  68/push  2/imm32
+  50/push-EAX
+    # call
+  e8/call  check-ints-equal/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
+  # check-ints-equal(*_test-stream-buffer.data, 41/A 62/b 00 00, msg)
+    # push args
+  68/push  "F - test-read-single"/imm32
+  68/push  0x006241/imm32/Ab
+    # push *_test-stream-buffer.data
+  b8/copy-to-EAX  _test-stream-buffer/imm32
+  ff          6/subop/push        1/mod/*+disp8   0/rm32/EAX    .           .             .           .           0xc/disp8       .                 # push *(EAX+12)
+    # call
+  e8/call  check-ints-equal/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
+  # end
+  c3/return
+
+test-read-is-stateful:
+  ## make two consecutive reads, check that their results are appended
+  # clear-stream(_test-stream)
+    # push args
+  68/push  _test-stream/imm32
+    # call
+  e8/call  clear-stream/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
+  # clear-stream(_test-stream-buffer)
+    # push args
+  68/push  _test-stream-buffer/imm32
+    # call
+  e8/call  clear-stream/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
+  # write(_test-stream, "C")
+    # push args
+  68/push  "C"/imm32
+  68/push  _test-stream/imm32
+    # call
+  e8/call  write/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+  # read(_test-stream, _test-stream-buffer)
+    # push args
+  68/push  _test-stream-buffer/imm32
+  68/push  _test-stream/imm32
+    # call
+  e8/call  read/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+  # write(_test-stream, "D")
+    # push args
+  68/push  "D"/imm32
+  68/push  _test-stream/imm32
+    # call
+  e8/call  write/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+  # read(_test-stream, _test-stream-buffer)
+    # push args
+  68/push  _test-stream-buffer/imm32
+  68/push  _test-stream/imm32
+    # call
+  e8/call  read/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+  # check-ints-equal(*_test-stream-buffer.data, 43/C 44/D 00 00, msg)
+    # push args
+  68/push  "F - test-read-is-stateful"/imm32
+  68/push  0x00004443/imm32/C-D
+    # push *_test-stream-buffer.data
+  b8/copy-to-EAX  _test-stream-buffer/imm32
+  ff          6/subop/push        1/mod/*+disp8   0/rm32/EAX    .           .             .           .           0xc/disp8       .                 # push *(EAX+12)
+    # call
+  e8/call  check-ints-equal/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
+  # end
+  c3/return
+
+test-read-returns-0-on-end-of-file:
+  ## read after hitting end-of-file, check that result is 0
+  # clear-stream(_test-stream)
+    # push args
+  68/push  _test-stream/imm32
+    # call
+  e8/call  clear-stream/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
+  # clear-stream(_test-stream-buffer)
+    # push args
+  68/push  _test-stream-buffer/imm32
+    # call
+  e8/call  clear-stream/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
+  # write(_test-stream, "Ab")
+    # push args
+  68/push  "Ab"/imm32
+  68/push  _test-stream/imm32
+    # call
+  e8/call  write/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+  ## first read gets to end-of-file
+  # read(_test-stream, _test-stream-buffer)
+    # push args
+  68/push  _test-stream-buffer/imm32
+  68/push  _test-stream/imm32
+    # call
+  e8/call  read/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+  ## second read
+  # read(_test-stream, _test-stream-buffer)
+    # push args
+  68/push  _test-stream-buffer/imm32
+  68/push  _test-stream/imm32
+    # call
+  e8/call  read/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+  # check-ints-equal(EAX, 0)
+    # push args
+  68/push  "F - test-read-returns-0-on-end-of-file"/imm32
+  68/push  0/imm32
+  50/push-EAX
+    # call
+  e8/call  check-ints-equal/disp32
+    # discard args
+  81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
+  # end
+  c3/return
+
+== data
+
+_test-stream-buffer:
+  # current write index
+  00 00 00 00
+  # current read index
+  00 00 00 00
+  # length (= 8)
+  08 00 00 00
+  # data
+  00 00 00 00 00 00 00 00  # 8 bytes
diff --git a/subx/apps/crenshaw2-1 b/subx/apps/crenshaw2-1
index 18a107ad..a34a0eef 100755
--- a/subx/apps/crenshaw2-1
+++ b/subx/apps/crenshaw2-1
Binary files differdiff --git a/subx/apps/factorial b/subx/apps/factorial
index c5958765..07be8565 100755
--- a/subx/apps/factorial
+++ b/subx/apps/factorial
Binary files differ
K. Agaram <vc@akkartik.com> 2016-05-03 10:15:17 -0700 2894' href='/akkartik/mu/commit/037lookup.cc?h=main&id=dc9afcbd7d7f1dcfae7b9ae659ccea4944b95a29'>dc9afcbd ^
23d3a022 ^
dc9afcbd ^


23d3a022 ^





dc9afcbd ^
23d3a022 ^
dc9afcbd ^









23d3a022 ^





dc9afcbd ^
23d3a022 ^
dc9afcbd ^







fc19980d ^


23d3a022 ^





fc19980d ^
23d3a022 ^
fc19980d ^










dc9afcbd ^


377b00b0 ^
dc9afcbd ^
377b00b0 ^
dc9afcbd ^





23d3a022 ^







dc9afcbd ^
23d3a022 ^



dc9afcbd ^
b9a78a84 ^

23d3a022 ^


b9a78a84 ^
23d3a022 ^
b9a78a84 ^




dc9afcbd ^


23d3a022 ^







dc9afcbd ^
23d3a022 ^
dc9afcbd ^














23d3a022 ^







dc9afcbd ^
23d3a022 ^
dc9afcbd ^


23d3a022 ^








dc9afcbd ^
23d3a022 ^
dc9afcbd ^
fc19980d ^


23d3a022 ^







fc19980d ^
23d3a022 ^
fc19980d ^










88298924 ^

23d3a022 ^




88298924 ^
23d3a022 ^

88298924 ^
dc9afcbd ^













23d3a022 ^







dc9afcbd ^
23d3a022 ^
dc9afcbd ^







23d3a022 ^




dc9afcbd ^
23d3a022 ^

dc9afcbd ^


23d3a022 ^






dc9afcbd ^
23d3a022 ^

dc9afcbd ^


23d3a022 ^






dc9afcbd ^
23d3a022 ^

dc9afcbd ^
















23d3a022 ^


dc9afcbd ^
23d3a022 ^


dc9afcbd ^







23d3a022 ^




dc9afcbd ^
23d3a022 ^

dc9afcbd ^


555d95c1 ^
dc9afcbd ^



9dcbec39 ^
dc9afcbd ^









3473c63a ^
dc9afcbd ^



















3473c63a ^
dc9afcbd ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536