//SCI16's GetDirectory, compiled in isolation with
//some random numbers for the message indices.

(procedure proc_000a
  000a:3e 00c0           link c0 // (var $c0)
  //temp1 is 40 bytes here

        code_000d
  000d:35 01              ldi 1 
  000f:30 00d9            bnt code_00eb 
  0012:7a               push2 

  0013:39 1e            pushi 1e // $1e font
  0015:78               push1 
  0016:8f 01              lsp param1 
  0018:43 46 02         callk StrLen 2 

  001b:36                push 
  001c:35 06              ldi 6 
  001e:02                 add 
  001f:36                push 
  0020:46 03e7 0003 04  calle 3e7 procedure_0003 4 // Max 

  0026:36                push 
  0027:35 0b              ldi b 
  0029:02                 add 
  002a:a4 00bf            sat temp191 
  002d:39 1e            pushi 1e // $1e font
  002f:78               push1 
  0030:7a               push2 
  0031:38 00cd          pushi cd // $cd addText
  0034:39 07            pushi 7 // $7 nsLeft
  0036:78               push1 
  0037:76               push0 
  0038:76               push0 
  0039:78               push1 
  003a:76               push0 
  003b:76               push0 
  003c:78               push1 
  003d:38 00cf          pushi cf // $cf addEdit
  0040:39 05            pushi 5 // $5 underBits
  0042:7a               push2 
  0043:5b 04 01           lea 4 1 
  0046:36                push 
  0047:8f 01              lsp param1 
  0049:43 47 04         callk StrCpy 4 

  004c:36                push 
  004d:8c 00bf            lst temp191 
  0050:76               push0 
  0051:39 14            pushi 14 // $14 name
  0053:8f 01              lsp param1 
  0055:38 00d4          pushi d4 // $d4 addButton
  0058:39 08            pushi 8 // $8 nsBottom
  005a:78               push1 
  005b:39 03            pushi 3 // $3 loop
  005d:76               push0 
  005e:76               push0 
  005f:78               push1 
  0060:76               push0 
  0061:39 22            pushi 22 // $22 max
  0063:78               push1 
  0064:38 00d4          pushi d4 // $d4 addButton
  0067:39 08            pushi 8 // $8 nsBottom
  0069:76               push0 
  006a:76               push0 
  006b:76               push0 
  006c:76               push0 
  006d:78               push1 
  006e:39 32            pushi 32 // $32 b-incr
  0070:39 22            pushi 22 // $22 max
  0072:78               push1 
  0073:39 6e            pushi 6e // $6e init
  0075:76               push0 
  0076:51 14            class Print 
  0078:4a 52             send 52 

  007a:a5 00              sat temp0 
  007c:85 00              lat temp0 
  007e:18                 not 
  007f:31 03              bnt code_0084 
  0081:35 00              ldi 0 
  0083:48                 ret 

        code_0084
  0084:78               push1 
  0085:5b 04 01           lea 4 1 
  0088:36                push 
  0089:43 46 02         callk StrLen 2 

  008c:18                 not 
  008d:31 08              bnt code_0097 
  008f:78               push1 
  0090:5b 04 01           lea 4 1 
  0093:36                push 
  0094:43 5e 02         callk GetCWD 2 


        code_0097
  0097:78               push1 
  0098:5b 04 01           lea 4 1 
  009b:36                push 
  009c:43 60 02         callk ValidPath 2 

  009f:31 0f              bnt code_00b0 
  00a1:7a               push2 
  00a2:8f 01              lsp param1 
  00a4:5b 04 01           lea 4 1 
  00a7:36                push 
  00a8:43 47 04         callk StrCpy 4 

  00ab:35 01              ldi 1 
  00ad:48                 ret 
  00ae:33 38              jmp code_00e8 

        code_00b0
  00b0:39 07            pushi 7 // $7 nsLeft
  00b2:76               push0 
  00b3:78               push1 
  00b4:39 03            pushi 3 // $3 loop
  00b6:76               push0 
  00b7:76               push0 
  00b8:78               push1 
  00b9:5a 0004 008d       lea 4 8d 
  00be:36                push 
  00bf:43 7c 0e         callk Message e 

  00c2:39 03            pushi 3 // $3 loop
  00c4:5b 04 29           lea 4 29 
  00c7:36                push 
  00c8:5a 0004 008d       lea 4 8d 
  00cd:36                push 
  00ce:5b 04 01           lea 4 1 
  00d1:36                push 
  00d2:43 48 06         callk Format 6 

  00d5:39 1e            pushi 1e // $1e font
  00d7:78               push1 
  00d8:7a               push2 
  00d9:38 00cd          pushi cd // $cd addText
  00dc:78               push1 
  00dd:5b 04 29           lea 4 29 
  00e0:36                push 
  00e1:39 6e            pushi 6e // $6e init
  00e3:76               push0 
  00e4:51 14            class Print 
  00e6:4a 10             send 10 


        code_00e8
  00e8:32 ff22            jmp code_000d 

        code_00eb
  00eb:48                 ret 
)