// File: /workspace/github_cpp_makefile_star2_O1/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, 0x316bc6(%rip)    # 0x342835
leaq 0x213242(%rip), %rax    # 0x23eeb8
cmpq $0x0, (%rax)
je 0x2bc86
leaq 0x31365d(%rip), %rax    # 0x33f2e0
movb $0x0, (%rax)
leaq 0x313653(%rip), %rdi    # 0x33f2e0
callq 0x9120
movb %al, 0x316b9e(%rip)     # 0x342836
leaq 0x313969(%rip), %rax    # 0x33f608
movw %r15w, (%rax)
movl %r15d, %eax
cmpl $0xff, %r15d
jg 0x2bcb7
movl %r15d, %edi
callq 0x9580
leaq 0x21329a(%rip), %rcx    # 0x23ef58
movl %eax, (%rcx)
leaq 0x1ecb11(%rip), %rax    # 0x2187d8
cmpl $0x0, (%rax)
je 0x2bcd3
callq 0xed5e
jmp 0x2bcd8
callq 0xed2c
leaq 0x31392d(%rip), %r12    # 0x33f60c
movl (%r12), %edi
leaq 0x313926(%rip), %rax    # 0x33f610
movl (%rax), %esi
movl $0xb, %edx
movq %r14, %rcx
callq 0xe7d0
movl (%r12), %eax
movq %rax, -0x38(%rbp)
addl $0x2, %eax
movl %eax, -0x2c(%rbp)
movl %eax, 0x316b2f(%rip)    # 0x34283c
cmpl $0x160, %r15d           # imm = 0x160
je 0x2bd1c
cmpl $0x67, %r15d
jne 0x2bd77
leaq 0x3138ed(%rip), %rax    # 0x33f610
movl (%rax), %ebx
movq %r14, %rdi
callq 0x9120
movq %rax, %r14
addl %ebx, %r14d
movl $0x1, %r15d
leaq 0x3104e0(%rip), %r13    # 0x33c220
leaq 0xf67d6(%rip), %rbx     # 0x12251d
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 0xe7d0
incl %r15d
addl $0x3, %r14d
cmpl $0x10, %r15d
jne 0x2bd47
movq -0x38(%rbp), %rdi
incl %edi
leaq 0x31385c(%rip), %rbx    # 0x33f5e0
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2bdb3
leaq 0x31387d(%rip), %r14    # 0x33f610
movl (%r14), %esi
movl $0xb, %edx
callq 0xe7d0
incl 0x316a96(%rip)          # 0x34283c
movq $0x0, (%rbx)
movl -0x2c(%rbp), %r15d
jmp 0x2bdbd
movl %edi, %r15d
leaq 0x313853(%rip), %r14    # 0x33f610
leaq 0x313824(%rip), %rbx    # 0x33f5e8
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2bdec
movl (%r14), %esi
movl %r15d, %edi
movl $0xb, %edx
callq 0xe7d0
incl %r15d
incl 0x316a57(%rip)          # 0x34283c
movq $0x0, (%rbx)
leaq 0x3137fd(%rip), %rbx    # 0x33f5f0
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2be1b
movl (%r14), %esi
movl %r15d, %edi
movl $0xb, %edx
callq 0xe7d0
incl %r15d
incl 0x316a28(%rip)          # 0x34283c
movq $0x0, (%rbx)
leaq 0x3137d6(%rip), %rbx    # 0x33f5f8
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2be4a
movl (%r14), %esi
movl %r15d, %edi
movl $0xb, %edx
callq 0xe7d0
incl %r15d
incl 0x3169f9(%rip)          # 0x34283c
movq $0x0, (%rbx)
leaq 0x3137af(%rip), %rbx    # 0x33f600
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2be76
movl (%r14), %esi
movl %r15d, %edi
movl $0xb, %edx
callq 0xe7d0
incl 0x3169cd(%rip)          # 0x34283c
movq $0x0, (%rbx)
movb $0x1, 0x3169b7(%rip)    # 0x342834
xorl %edi, %edi
callq 0x2b55b
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq