// File: jkingan[P]ladyheather/heathui.cpp
// Function: start_edit(int, char*)
int start_edit(int c, char *prompt)
{
int i, col;
int row;

   //
   // Start building the text string for command parameter *c*
   //
   // Note that blank input lines are not processed unless allowed by the
   // function ignore_blank_line()
   // Search for function ignore_blank_line()e to add more "blank ok" commands
   //

   insert_mode = 0;
   if(script_file) edit_buffer[0] = 0;
   edit_cursor = strlen(edit_buffer);   // user can prime the buffer with data
   getting_string = c;
   if(c < 0x0100) first_key = tolower(c);
   else           first_key = c;

   if(text_mode) erase_screen();
   else          erase_help();

   // display prompt string for the command
   vidstr(EDIT_ROW, EDIT_COL, PROMPT_COLOR, prompt);

   // special cases for multiple line prompts
   e_row = EDIT_ROW+2;
   row = EDIT_ROW+1;
   if((c == 'g') || (c == PALETTE_CMD)) {  // display color palette selections
      col = EDIT_COL + strlen(prompt);
      for(i=1; i<16; i++) {
         sprintf(out, " %2d", i);
         vidstr(EDIT_ROW, col+((i-1)*3), i, out);
      }
   }

   if(edit_info1) {
      vidstr(row, EDIT_COL, PROMPT_COLOR, edit_info1);
      ++row;
      ++e_row;
      edit_info1 = 0;
   }
   if(edit_info2) {
      vidstr(row, EDIT_COL, PROMPT_COLOR, edit_info2);
      ++row;
      ++e_row;
      edit_info2 = 0;
   }
   if(edit_info3) {
      vidstr(row, EDIT_COL, PROMPT_COLOR, edit_info3);
      ++row;
      ++e_row;
      edit_info3 = 0;
   }
   if(edit_info4) {
      vidstr(row, EDIT_COL, PROMPT_COLOR, edit_info4);
      ++row;
      ++e_row;
      edit_info4 = 0;
   }
   if(edit_info5) {
      vidstr(row, EDIT_COL, PROMPT_COLOR, edit_info5);
      ++row;
      ++e_row;
      edit_info5 = 0;
   }

   first_edit = 1;
   edit_string(0);  // (0) param just prints >_
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, 0x36458f(%rip)    # 0x3a1a15
leaq 0x260c0b(%rip), %rax    # 0x29e098
cmpq $0x0, (%rax)
je 0x3d49d
leaq 0x361026(%rip), %rax    # 0x39e4c0
movb $0x0, (%rax)
leaq 0x36101c(%rip), %rdi    # 0x39e4c0
callq 0x9120
movb %al, 0x364567(%rip)     # 0x3a1a16
movl -0x4(%rbp), %eax
movw %ax, %cx
leaq 0x36132c(%rip), %rax    # 0x39e7e8
movw %cx, (%rax)
cmpl $0x100, -0x4(%rbp)      # imm = 0x100
jge 0x3d4dd
movl -0x4(%rbp), %edi
callq 0x9570
movl %eax, %ecx
leaq 0x260c5f(%rip), %rax    # 0x29e138
movl %ecx, (%rax)
jmp 0x3d4e9
movl -0x4(%rbp), %ecx
leaq 0x260c51(%rip), %rax    # 0x29e138
movl %ecx, (%rax)
leaq 0x23a4c8(%rip), %rax    # 0x2779b8
cmpl $0x0, (%rax)
je 0x3d4fc
callq 0x117e0
jmp 0x3d501
callq 0x117a0
leaq 0x3612e4(%rip), %rax    # 0x39e7ec
movl (%rax), %edi
leaq 0x3612df(%rip), %rax    # 0x39e7f0
movl (%rax), %esi
movq -0x10(%rbp), %rcx
movl $0xb, %edx
callq 0x10ee0
leaq 0x3612c4(%rip), %rax    # 0x39e7ec
movl (%rax), %eax
addl $0x2, %eax
movl %eax, 0x3644e9(%rip)    # 0x3a1a1c
leaq 0x3612b2(%rip), %rax    # 0x39e7ec
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x67, -0x4(%rbp)
je 0x3d551
cmpl $0x160, -0x4(%rbp)      # imm = 0x160
jne 0x3d5d0
leaq 0x361298(%rip), %rax    # 0x39e7f0
movslq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9120
movq %rax, %rcx
movq -0x28(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x18(%rbp)
movl $0x1, -0x14(%rbp)
cmpl $0x10, -0x14(%rbp)
jge 0x3d5ce
movl -0x14(%rbp), %edx
leaq 0x35de74(%rip), %rdi    # 0x39b400
leaq 0x1482fa(%rip), %rsi    # 0x18588d
movb $0x0, %al
callq 0x9060
leaq 0x36124b(%rip), %rax    # 0x39e7ec
movl (%rax), %edi
movl -0x18(%rbp), %esi
movl -0x14(%rbp), %eax
subl $0x1, %eax
imull $0x3, %eax, %eax
addl %eax, %esi
movl -0x14(%rbp), %eax
leaq 0x35de45(%rip), %rcx    # 0x39b400
movzbl %al, %edx
callq 0x10ee0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3d57c
jmp 0x3d5d0
leaq 0x3611e9(%rip), %rax    # 0x39e7c0
cmpq $0x0, (%rax)
je 0x3d623
movl -0x1c(%rbp), %edi
leaq 0x361209(%rip), %rax    # 0x39e7f0
movl (%rax), %esi
leaq 0x3611d0(%rip), %rax    # 0x39e7c0
movq (%rax), %rcx
movl $0xb, %edx
callq 0x10ee0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl 0x364410(%rip), %eax    # 0x3a1a1c
addl $0x1, %eax
movl %eax, 0x364407(%rip)    # 0x3a1a1c
leaq 0x3611a4(%rip), %rax    # 0x39e7c0
movq $0x0, (%rax)
leaq 0x36119e(%rip), %rax    # 0x39e7c8
cmpq $0x0, (%rax)
je 0x3d676
movl -0x1c(%rbp), %edi
leaq 0x3611b6(%rip), %rax    # 0x39e7f0
movl (%rax), %esi
leaq 0x361185(%rip), %rax    # 0x39e7c8
movq (%rax), %rcx
movl $0xb, %edx
callq 0x10ee0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl 0x3643bd(%rip), %eax    # 0x3a1a1c
addl $0x1, %eax
movl %eax, 0x3643b4(%rip)    # 0x3a1a1c
leaq 0x361159(%rip), %rax    # 0x39e7c8
movq $0x0, (%rax)
leaq 0x361153(%rip), %rax    # 0x39e7d0
cmpq $0x0, (%rax)
je 0x3d6c9
movl -0x1c(%rbp), %edi
leaq 0x361163(%rip), %rax    # 0x39e7f0
movl (%rax), %esi
leaq 0x36113a(%rip), %rax    # 0x39e7d0
movq (%rax), %rcx
movl $0xb, %edx
callq 0x10ee0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl 0x36436a(%rip), %eax    # 0x3a1a1c
addl $0x1, %eax
movl %eax, 0x364361(%rip)    # 0x3a1a1c
leaq 0x36110e(%rip), %rax    # 0x39e7d0
movq $0x0, (%rax)
leaq 0x361108(%rip), %rax    # 0x39e7d8
cmpq $0x0, (%rax)
je 0x3d71c
movl -0x1c(%rbp), %edi
leaq 0x361110(%rip), %rax    # 0x39e7f0
movl (%rax), %esi
leaq 0x3610ef(%rip), %rax    # 0x39e7d8
movq (%rax), %rcx
movl $0xb, %edx
callq 0x10ee0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl 0x364317(%rip), %eax    # 0x3a1a1c
addl $0x1, %eax
movl %eax, 0x36430e(%rip)    # 0x3a1a1c
leaq 0x3610c3(%rip), %rax    # 0x39e7d8
movq $0x0, (%rax)
leaq 0x3610bd(%rip), %rax    # 0x39e7e0
cmpq $0x0, (%rax)
je 0x3d76f
movl -0x1c(%rbp), %edi
leaq 0x3610bd(%rip), %rax    # 0x39e7f0
movl (%rax), %esi
leaq 0x3610a4(%rip), %rax    # 0x39e7e0
movq (%rax), %rcx
movl $0xb, %edx
callq 0x10ee0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl 0x3642c4(%rip), %eax    # 0x3a1a1c
addl $0x1, %eax
movl %eax, 0x3642bb(%rip)    # 0x3a1a1c
leaq 0x361078(%rip), %rax    # 0x39e7e0
movq $0x0, (%rax)
movb $0x1, 0x36429e(%rip)    # 0x3a1a14
xorl %edi, %edi
callq 0x3c8e0
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)