// File: /workspace/github_cpp_makefile_star2_O3/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, 0x31687f(%rip)    # 0x342835
leaq 0x212efb(%rip), %rax    # 0x23eeb8
cmpq $0x0, (%rax)
je 0x2bfcd
leaq 0x313316(%rip), %rax    # 0x33f2e0
movb $0x0, (%rax)
leaq 0x31330c(%rip), %rdi    # 0x33f2e0
callq 0x9120
movb %al, 0x316857(%rip)     # 0x342836
leaq 0x313622(%rip), %rax    # 0x33f608
movw %r15w, (%rax)
movl %r15d, %eax
cmpl $0xff, %r15d
jg 0x2bffe
movl %r15d, %edi
callq 0x9580
leaq 0x212f53(%rip), %rcx    # 0x23ef58
movl %eax, (%rcx)
leaq 0x1ec7ca(%rip), %rax    # 0x2187d8
cmpl $0x0, (%rax)
je 0x2c01a
callq 0xeceb
jmp 0x2c01f
callq 0xecb9
leaq 0x3135e6(%rip), %r12    # 0x33f60c
movl (%r12), %edi
leaq 0x3135df(%rip), %rax    # 0x33f610
movl (%rax), %esi
movl $0xb, %edx
movq %r14, %rcx
callq 0xe787
movl (%r12), %eax
movq %rax, -0x38(%rbp)
addl $0x2, %eax
movl %eax, -0x2c(%rbp)
movl %eax, 0x3167e8(%rip)    # 0x34283c
cmpl $0x160, %r15d           # imm = 0x160
je 0x2c063
cmpl $0x67, %r15d
jne 0x2c0be
leaq 0x3135a6(%rip), %rax    # 0x33f610
movl (%rax), %ebx
movq %r14, %rdi
callq 0x9120
movq %rax, %r14
addl %ebx, %r14d
movl $0x1, %r15d
leaq 0x310199(%rip), %r13    # 0x33c220
leaq 0xf656f(%rip), %rbx     # 0x1225fd
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 0xe787
incl %r15d
addl $0x3, %r14d
cmpl $0x10, %r15d
jne 0x2c08e
movq -0x38(%rbp), %rdi
incl %edi
leaq 0x313515(%rip), %rbx    # 0x33f5e0
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2c0fa
leaq 0x313536(%rip), %r14    # 0x33f610
movl (%r14), %esi
movl $0xb, %edx
callq 0xe787
incl 0x31674f(%rip)          # 0x34283c
movq $0x0, (%rbx)
movl -0x2c(%rbp), %r15d
jmp 0x2c104
movl %edi, %r15d
leaq 0x31350c(%rip), %r14    # 0x33f610
leaq 0x3134dd(%rip), %rbx    # 0x33f5e8
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2c133
movl (%r14), %esi
movl %r15d, %edi
movl $0xb, %edx
callq 0xe787
incl %r15d
incl 0x316710(%rip)          # 0x34283c
movq $0x0, (%rbx)
leaq 0x3134b6(%rip), %rbx    # 0x33f5f0
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2c162
movl (%r14), %esi
movl %r15d, %edi
movl $0xb, %edx
callq 0xe787
incl %r15d
incl 0x3166e1(%rip)          # 0x34283c
movq $0x0, (%rbx)
leaq 0x31348f(%rip), %rbx    # 0x33f5f8
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2c191
movl (%r14), %esi
movl %r15d, %edi
movl $0xb, %edx
callq 0xe787
incl %r15d
incl 0x3166b2(%rip)          # 0x34283c
movq $0x0, (%rbx)
leaq 0x313468(%rip), %rbx    # 0x33f600
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2c1bd
movl (%r14), %esi
movl %r15d, %edi
movl $0xb, %edx
callq 0xe787
incl 0x316686(%rip)          # 0x34283c
movq $0x0, (%rbx)
movb $0x1, 0x316670(%rip)    # 0x342834
xorl %edi, %edi
callq 0x2b879
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq