// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathui.cpp
// Function: edit_write_cmd()
int edit_write_cmd()
{
int valid;
   // process a file write/delete command
   if(edit_buffer[0]) {
      if(dump_type == 's') {
         reset_first_key(21);
         prot_menu = 0;
         draw_plot(REFRESH_SCREEN);
         draw_maps();
         refresh_page();

         valid = 0;
         if     (strstr(edit_buffer, ".gif")) valid = 1;
         else if(strstr(edit_buffer, ".GIF")) valid = 1;
         else if(strstr(edit_buffer, ".bmp")) valid = 1;
         else if(strstr(edit_buffer, ".BMP")) valid = 1;
         if(valid == 0) {
            first_key = ' ';
            edit_error("Screen dump file type must be .gif or .bmp");
         }
         else if(dump_screen(invert_dump, top_line, edit_buffer) == 0) {
            first_key = ' ';
            edit_error("Could not write screen image file");
         }
      }
      else if(dump_type == 'c') {  // luxor cal .SCR file
         dump_cal_file();
      }
      else if(dump_type == 'd') {   //delete file
         if(path_unlink(edit_buffer)) {
            sprintf(out, "Could not delete file: %s", edit_buffer);
         }
         else {
            sprintf(out, "File %s deleted", edit_buffer);
         }
         edit_error(out);
      }
      else if(dump_type == 'm') {  // MTIE data
         dump_mtie_data();
      }
      else {
         dump_log(edit_buffer, dump_type);
      }
   }
   else {
      edit_error("Missing file name");
   }

   top_line = 0;
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x30bf73(%rip), %rax    # 0x33f2e0
cmpb $0x0, (%rax)
je 0x333cf
leaq 0x20b094(%rip), %rax    # 0x23e40d
movzbl (%rax), %esi
cmpl $0x6c, %esi
jg 0x333ef
cmpl $0x63, %esi
je 0x334d4
cmpl $0x64, %esi
jne 0x334c3
leaq 0x30bf46(%rip), %rbx    # 0x33f2e0
movq %rbx, %rdi
callq 0xa1f6
testl %eax, %eax
leaq 0xe215b(%rip), %rax     # 0x115506
leaq 0xe213a(%rip), %rsi     # 0x1154ec
cmoveq %rax, %rsi
leaq 0x308e63(%rip), %r14    # 0x33c220
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
jmp 0x333d6
leaq 0xe2140(%rip), %rdi     # 0x115516
callq 0x2326e
leaq 0x1e545e(%rip), %rax    # 0x218840
movl $0x0, (%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
cmpl $0x6d, %esi
je 0x334de
cmpl $0x73, %esi
jne 0x334c3
callq 0x27872
leaq 0x1e7d4b(%rip), %rax    # 0x21b158
movb $0x0, (%rax)
movl $0x1, %edi
callq 0x19792
callq 0xf7486
callq 0xab5f
leaq 0x30beb5(%rip), %rdi    # 0x33f2e0
leaq 0xd77ae(%rip), %rsi     # 0x10abe0
callq 0x9090
testq %rax, %rax
jne 0x33484
leaq 0x30be9d(%rip), %rdi    # 0x33f2e0
leaq 0xd6b17(%rip), %rsi     # 0x109f61
callq 0x9090
testq %rax, %rax
jne 0x33484
leaq 0x30be85(%rip), %rdi    # 0x33f2e0
leaq 0xe2063(%rip), %rsi     # 0x1154c5
callq 0x9090
testq %rax, %rax
jne 0x33484
leaq 0x30be6d(%rip), %rdi    # 0x33f2e0
leaq 0xe2020(%rip), %rsi     # 0x11549a
callq 0x9090
testq %rax, %rax
je 0x334e8
leaq 0x1e53a9(%rip), %rax    # 0x218834
movl (%rax), %edi
leaq 0x1e53ac(%rip), %rax    # 0x218840
movl (%rax), %esi
leaq 0x30be43(%rip), %rdx    # 0x33f2e0
callq 0xf82a
testl %eax, %eax
jne 0x333db
leaq 0x20baa7(%rip), %rax    # 0x23ef58
movl $0x20, (%rax)
leaq 0xe200c(%rip), %rdi     # 0x1154ca
jmp 0x333d6
leaq 0x30be16(%rip), %rdi    # 0x33f2e0
callq 0xd1285
jmp 0x333db
callq 0x32fc2
jmp 0x333db
callq 0x33252
jmp 0x333db
leaq 0x20ba69(%rip), %rax    # 0x23ef58
movl $0x20, (%rax)
leaq 0xe1fa3(%rip), %rdi     # 0x11549f
jmp 0x333d6