// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movl %edi, %r15d
movb $0x0, 0x303070(%rip)    # 0x32c835
leaq 0x1ff6ec(%rip), %rax    # 0x228eb8
cmpq $0x0, (%rax)
je 0x297dc
leaq 0x2ffb07(%rip), %rax    # 0x3292e0
movb $0x0, (%rax)
leaq 0x2ffafd(%rip), %rdi    # 0x3292e0
callq 0x9120
movb %al, 0x303048(%rip)     # 0x32c836
leaq 0x2ffe13(%rip), %rax    # 0x329608
movw %r15w, (%rax)
movl %r15d, %eax
cmpl $0xff, %r15d
jg 0x2980d
movl %r15d, %edi
callq 0x9580
leaq 0x1ff744(%rip), %rcx    # 0x228f58
movl %eax, (%rcx)
leaq 0x1d8fbb(%rip), %rax    # 0x2027d8
cmpl $0x0, (%rax)
je 0x29829
callq 0xe7d9
jmp 0x2982e
callq 0xe7aa
leaq 0x2ffdd7(%rip), %r12    # 0x32960c
movl (%r12), %edi
leaq 0x2ffdd0(%rip), %rax    # 0x329610
movl (%rax), %esi
pushq $0xb
popq %rdx
movq %r14, %rcx
callq 0xe2d2
movl (%r12), %eax
movq %rax, -0x38(%rbp)
addl $0x2, %eax
movl %eax, -0x2c(%rbp)
movl %eax, 0x302fdb(%rip)    # 0x32c83c
cmpl $0x160, %r15d           # imm = 0x160
je 0x29870
cmpl $0x67, %r15d
jne 0x298cb
leaq 0x2ffd99(%rip), %rax    # 0x329610
movl (%rax), %ebx
movq %r14, %rdi
callq 0x9120
movq %rax, %r14
addl %ebx, %r14d
pushq $0x1
popq %r15
leaq 0x2fc98e(%rip), %r13    # 0x326220
leaq 0xe2cac(%rip), %rbx     # 0x10c545
cmpl $0x10, %r15d
je 0x298cb
movq %r13, %rdi
movq %rbx, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x9060
movl (%r12), %edi
movzbl %r15b, %edx
movl %r14d, %esi
movq %r13, %rcx
callq 0xe2d2
incl %r15d
addl $0x3, %r14d
jmp 0x29899
movq -0x38(%rbp), %rdi
incl %edi
leaq 0x2ffd08(%rip), %rbx    # 0x3295e0
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x29902
leaq 0x2ffd29(%rip), %r14    # 0x329610
movl (%r14), %esi
pushq $0xb
popq %rdx
callq 0xe2d2
incl 0x302f44(%rip)          # 0x32c83c
andq $0x0, (%rbx)
movl -0x2c(%rbp), %r15d
jmp 0x2990c
movl %edi, %r15d
leaq 0x2ffd04(%rip), %r14    # 0x329610
leaq 0x2ffcd5(%rip), %rbx    # 0x3295e8
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x29936
movl (%r14), %esi
pushq $0xb
popq %rdx
movl %r15d, %edi
callq 0xe2d2
incl 0x302f0d(%rip)          # 0x32c83c
incl %r15d
andq $0x0, (%rbx)
leaq 0x2ffcb3(%rip), %rbx    # 0x3295f0
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x29960
movl (%r14), %esi
pushq $0xb
popq %rdx
movl %r15d, %edi
callq 0xe2d2
incl 0x302ee3(%rip)          # 0x32c83c
incl %r15d
andq $0x0, (%rbx)
leaq 0x2ffc91(%rip), %rbx    # 0x3295f8
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2998a
movl (%r14), %esi
pushq $0xb
popq %rdx
movl %r15d, %edi
callq 0xe2d2
incl 0x302eb9(%rip)          # 0x32c83c
incl %r15d
andq $0x0, (%rbx)
leaq 0x2ffc6f(%rip), %rbx    # 0x329600
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x299b1
movl (%r14), %esi
pushq $0xb
popq %rdx
movl %r15d, %edi
callq 0xe2d2
incl 0x302e8f(%rip)          # 0x32c83c
andq $0x0, (%rbx)
movb $0x1, 0x302e7c(%rip)    # 0x32c834
xorl %edi, %edi
callq 0x290b2
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq