// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathui.cpp
// Function: do_kbd(int)
int do_kbd(int c)
{
int fix_flag;
int old_lwa;
int old_rpn;

   // This routine processes a keystroke character.
   //
   // If variable "first_key" is set, this key stroke is the second keystroke
   // of the two character command that started with character "first_key".


   if(sound_alarm) {    // any keystroke turns off alarm clock
      if(sound_alarm & ALARM_DATE) {  // date specifed, so reset alarm
         alarm_time = alarm_date = 0;
         alarm_jd = 0.0;
         egg_timer = egg_val = 0;
         repeat_egg = 0;
      }

      reset_alarm();   // reset the alarm
      sound_alarm = 0;
      return 0;
   }

   if(disable_kbd > 1) return 0;  // nothing gets by

   fix_flag = 0;
   if(plot_lla || lla_showing) fix_flag = 1;

   if((zoom_screen == 'K') || last_null_key) {  // ZOOM_KBD touchscreen keyboard active
      // oh, the crap we have to do in order to make the zoomed calculator
      // touch screen keyboard work...

      if(((c == 0x0D) || (c == ESC_CHAR)) && last_zoom_calc) {  // exit touch keyboard to zoomed calc mode
         last_zoom_calc = 0;
         change_zoom_config(-666);
         cancel_zoom(666);
         config_screen(128);
         erase_screen();
         no_redraw = 0;

         if((c == 0x0D) && (edit_buffer[0] == ' ') && (edit_buffer[1] == 0)) {
            add_kbd(0x0D);
            start_calc_zoom(12);
            last_null_key = 0;
            return 0;
         }
         else if((c == 0x0D) && (edit_buffer[0] == ' ')) {
            add_kbd(0x0D);
            add_kbd(0x0D);
            start_calc_zoom(13);
            last_null_key = 0;
            return 0;
         }
         else if(1 && (c == ESC_CHAR) && (edit_buffer[0] == ' ') && (edit_buffer[1] == 0)) {
            add_kbd(0x0D);
            zoom_screen = '`';
            show_rpn_help = 0;
         }
         else if(0 && (c == ESC_CHAR) && edit_buffer[0]) {
            add_kbd(0x0D);
            zoom_screen = '`';
            show_rpn_help = 0;
         }
         add_kbd(0x0D);
         add_kbd(0x0D);
         start_calc_zoom(14);
         last_null_key = 0;
         return 0;
      }
      else if(last_null_key) {  // keyboard exit via touching a null key
         if(edit_buffer[0] == ' ') {
            add_kbd(0x0D);
            edit_buffer[0] = 0;
            edit_buffer[1] = 0;
            zoom_screen = '`';
            show_rpn_help = 0;
         }
         start_calc_zoom(15);
         last_null_key = 0;
         return 0;
      }
      else if((c == 0x0D) && edit_err_flag) {
         edit_err_flag = 0;
      }
      last_null_key = 0;
   }
   else if(zoom_screen == '`') {  //  touchscreen keyboard active for zoomed calculator
   }
   else if((zoom_screen || (un_zoom == ZOOM_ADEVS)) && (first_key == 0)) {  // any keystroke restores zoomed screen
      if((zoom_screen == 'P') && scroll_char(c)) ;
      else if(((zoom_screen == 'H') || (zoom_screen == 'O')) && (c == ' ')) {
         pause_monitor ^= 1;
         set_term_header(monitor_port);
         show_term_screen(monitor_port);
         return 0;
      }
      else if((zoom_screen == 'Q') && isdigit(c)) {  // set adjustment value
         cal_adjust = (cal_adjust*10) + (c-'0');
         if(cal_adjust >= 10000) cal_adjust = 0;
         return 0;
      }
      else if((zoom_screen == 'Q') && (c == '+')) {  // go forward a month
         if(cal_adjust) {
            cal_year += cal_adjust / 12;
            cal_month += (cal_adjust % 12);
         }
         else ++cal_month;
         if(cal_month > 12) {
            cal_month = 1;
            ++cal_year;
         }
         cal_adjust = 0;
         return 0;
      }
      else if((zoom_screen == 'Q') && (c == '-')) {  // go back a month
         if(cal_adjust) {
            cal_year -= cal_adjust / 12;
            cal_month -= (cal_adjust % 12);
         }
         else --cal_month;
         if(cal_month < 1) {
            cal_month = 12;
            --cal_year;
         }
         cal_adjust = 0;
         return 0;
      }
      else if((zoom_screen == 'Q') && (c == '>')) {  // go forward a year
         if(cal_adjust) cal_year += cal_adjust;
         else ++cal_year;
         cal_adjust = 0;
         return 0;
      }
      else if((zoom_screen == 'Q') && (c == '<')) {  // go back a year
         if(cal_adjust) cal_year -= cal_adjust;
         else --cal_year;
         cal_adjust = 0;
         return 0;
      }
      else if(c != '\\') {     // unless it is one of these keys
         if(zoom_screen == 'L') {
            fix_flag = zoom_fixes;
         }

         if(zoom_screen) {
            change_zoom_config(-108);
            cancel_zoom(18);     //zkzk
         }
         if(un_zoom == ZOOM_ADEVS) {
            if(rcvr_type == TICC_RCVR) all_adevs = ALL_CHANS;
            else                       all_adevs = SINGLE_ADEVS;
            plot_adev_data = old_plot_adevs;
            if(plot_adev_data == 0) adev_decades_shown = 0;
            un_zoom = UN_ZOOM;
         }

         show_fixes = 0;
         if(rcvr_type != NO_RCVR) show_fixes = zoom_fixes;  // zzzzzz
         if(fix_flag) {
            show_fixes = plot_lla = 1;
         }
         change_fix_config(show_fixes);
         plot_lla = 0;
         if(fix_flag) {
            plot_lla = 1;
         }

         no_redraw = 1;
         if((c == ' ') || (c == 0x0D) || (c == ESC_CHAR)) {
            no_redraw = 0;
         }
         config_screen(128);
         erase_screen();
         no_redraw = 0;

         if((c == ' ') || (c == 0x0D) || (c == ESC_CHAR)) { // don't bring up help screen
            return 0;
         }
      }
   }

   if(disable_kbd) {         // most of the keyboard is disabled
      last_was_mark = 0;
      if((first_key == 0) && (c != ESC_CHAR)) {
         BEEP(317);
         return 0;
      }
      else if((first_key == ESC_CHAR) && (c == '!')) {
         disable_kbd = 0;
         return sure_exit();
      }

      if((c >= 0x0100) || (c == '[') || (c == ']')) {  // cursor movement keys, etc
         c = 0;
         do_review(c, 2);       // stop review
         return sure_exit(); // prevents spurious scroll mode header
      }
   }

   if(rpn_mode < 0) {  // keep calculator mode active
      show_version_header();
      old_rpn = rpn_mode;
      rpn_mode = 0;
      if((c == 0x0D) || (c == ESC_CHAR) || (c == '`')) {
         if(zoom_screen) remove_zoom();
         show_version_header();
         return 0;
      }

      edit_buffer[0] = c;
      edit_buffer[1] = 0;
      start_calc(13);
   }

   if(c == 0) {
   }
   else if(getting_string) { // we are currently building a parameter value string
      last_was_mark = 0;
      return build_string(c);  // add the keystroke to the line
   }
   else if(getting_plot) {  // we are in the plot control sub-menu
      if(change_plot_param(c, 0)) return 0;
   }
   else if((c >= F1_CHAR) && (c <= F10_CHAR)) {  // F1..F10 - open script file
      if(first_key) return help_exit(c, 99); // xxxxxx
      sprintf(out, "f%d.scr", c-F1_CHAR+1);
      open_script(out);
   }
   else if((c >= 0x0100) || (c == '<') || (c == '>') || (c == '[') || (c == ']') || (c == '@')) {
      // cursor movement keys, etc
      // @ command - zoom to marked queue entry (invoked from mouse click or keyboard)
      last_was_mark = 0;
      if((first_key == 0) && (text_mode == 0)) {
         if(c == '@') {
            goto_mark(0);  // center plot on marked place
            hide_kbd(23);
         }
         else do_review(c, 3);  // scrolling around in the plot data
      }
      else if(first_key) {
         return help_exit(c, 99); // xxxxxx
      }
      else {
         if(c >= 0x0100) cmd_error(0);  //!!!!
         else            cmd_error(c);
      }
      if(c < 0x0100) last_plot_key = c;
      hide_kbd(8);  // no_unzoom
   }
   else if(c == ESC_CHAR) {  // ESC key exits program or aborts key sequence
      last_was_mark = 0;
      if(osc_params && (first_key != '&')) {  // ESC exits osc param display
         osc_params = 0;
         need_redraw = 8989;
      }
      else if(review_mode && (pause_data == 0)) {
         if(text_mode == 2) {  // displaying full screen help
            text_mode = 0;
            no_x_margin = no_y_margin = 0;
            need_redraw = 6677;
         }
         else {
            c = 0;
            old_lwa = last_was_adev;
            do_review(c, 4);  // stop review
            last_was_adev = old_lwa;
         }
      }
      else if(first_key == ESC_CHAR) {
         if(esc_esc_exit && (disable_kbd == 0)) {  // allow ESC ESC to end the program
            kbd_exit();
            return 1;
         }
      }
      else {
         if(are_you_sure(c) != c) return 0;
      }
   }
   else if((first_key == 0) && (c >= '0') && (c <= '9')) {  // plot markers
      kbd_marker(c);
      hide_kbd(20);
   }
   else {  // normal keystroke command
      if(c < 0x0100) c = tolower(c);
      if((c != '-') && (c != '+')) last_was_mark = 0;
      last_plot_key = 0;

      // break up the keyboard processing big 'if' statement
      // into two parts so the compiler heap does not overflow
      last_was_adev = 0;
      lwa = 13;
      if((c >= 'a') && (c <= 'o')) c = kbd_a_to_o(c);
      else                         c = kbd_other(c);
      return c;
   }

   return sure_exit();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x2c7614(%rip), %rbx    # 0x30df48
movb (%rbx), %al
testb %al, %al
je 0x46989
testb $0x1, %al
je 0x4697a
leaq 0x2c75e7(%rip), %rax    # 0x30df2c
xorl %ecx, %ecx
movl %ecx, (%rax)
leaq 0x2c75cc(%rip), %rax    # 0x30df1c
movl %ecx, (%rax)
leaq 0x2c75e7(%rip), %rax    # 0x30df40
movq %rcx, (%rax)
leaq 0x2c75ad(%rip), %rax    # 0x30df10
movq %rcx, (%rax)
leaq 0x2c759b(%rip), %rax    # 0x30df08
movq %rcx, (%rax)
leaq 0x2c75a1(%rip), %rax    # 0x30df18
movb $0x0, (%rax)
callq 0xe2532
movb $0x0, (%rbx)
xorl %ebx, %ebx
jmp 0x46fd3
leaq 0x1d488c(%rip), %rsi    # 0x21b21c
xorl %ebx, %ebx
cmpb $0x1, (%rsi)
ja 0x46fd3
movl %edi, %r14d
leaq 0x2f490b(%rip), %rax    # 0x33b2b0
cmpb $0x0, (%rax)
setne %r9b
leaq 0x2f490d(%rip), %rax    # 0x33b2c0
cmpl $0x0, (%rax)
setne %r15b
leaq 0x2c5de7(%rip), %rdi    # 0x30c7a8
movb (%rdi), %r12b
cmpb $0x4b, %r12b
sete %cl
leaq 0x1d4852(%rip), %r13    # 0x21b224
movl (%r13), %eax
testl %eax, %eax
setne %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x46a8b
cmpl $0xd, %r14d
setne %cl
cmpl $0x1b, %r14d
setne %dl
testb %dl, %cl
jne 0x46b3b
leaq 0x2c5db1(%rip), %rcx    # 0x30c7b4
cmpl $0x0, (%rcx)
je 0x46b3b
cmpl $0xd, %r14d
sete %r12b
xorl %ebx, %ebx
movl %ebx, (%rcx)
movq %rdi, %r15
movl $0xfffffd66, %edi       # imm = 0xFFFFFD66
callq 0x27724
movb $0x0, (%r15)
leaq 0x2f4dfc(%rip), %r15    # 0x33b82c
movl %ebx, (%r15)
movl $0x69, %edi
callq 0xd846f
movl $0x80, %edi
callq 0xcf81
callq 0xed5e
leaq 0x1d1df5(%rip), %rax    # 0x218848
movl %ebx, (%rax)
leaq 0x2f8884(%rip), %rcx    # 0x33f2e0
movb (%rcx), %al
movb 0x1(%rcx), %cl
cmpb $0x20, %al
sete %dl
andb %r12b, %dl
testb %cl, %cl
sete %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x46b95
movl $0xd, %edi
callq 0xd4e7
jmp 0x46b74
cmpb $0x60, %r12b
je 0x46c24
testb %r12b, %r12b
setne %al
leaq 0x2c5d0e(%rip), %r8     # 0x30c7b0
cmpl $0x4, (%r8)
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x46c24
leaq 0x1f849d(%rip), %rax    # 0x23ef58
cmpl $0x0, (%rax)
jne 0x46c24
cmpb $0x50, %r12b
jne 0x46af5
movl %r14d, %edi
movl %r9d, %r13d
callq 0x468db
leaq 0x2c5cd4(%rip), %r8     # 0x30c7b0
movl %r13d, %r9d
leaq 0x2c5cc2(%rip), %rdi    # 0x30c7a8
leaq 0x1d472f(%rip), %rsi    # 0x21b21c
testl %eax, %eax
jne 0x46c24
cmpb $0x48, %r12b
sete %al
cmpb $0x4f, %r12b
sete %cl
cmpl $0x20, %r14d
jne 0x46d1c
orb %cl, %al
je 0x46d1c
leaq 0x1f7920(%rip), %rax    # 0x23e43c
xorb $0x1, (%rax)
leaq 0x2c77aa(%rip), %r14    # 0x30e2d0
movl (%r14), %edi
callq 0x1efea
movl (%r14), %edi
callq 0x1ed16
jmp 0x46fd3
testl %eax, %eax
je 0x46c03
leaq 0x2f8796(%rip), %r14    # 0x33f2e0
cmpb $0x20, (%r14)
jne 0x46b74
movq %rdi, %r15
movl $0xd, %edi
callq 0xd4e7
movw $0x0, (%r14)
movb $0x60, (%r15)
leaq 0x2f4cbe(%rip), %rax    # 0x33b82c
movl $0x0, (%rax)
movl $0x7a, %edi
callq 0xd4e7
movl $0x60, %edi
callq 0xd4e7
movl $0x0, (%r13)
jmp 0x46fd3
testb %dl, %dl
jne 0x46bce
testb %cl, %cl
sete %cl
cmpb $0x20, %al
sete %al
cmpl $0x1b, %r14d
sete %dl
andb %al, %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x46bce
movl $0xd, %edi
callq 0xd4e7
leaq 0x2c5be4(%rip), %rax    # 0x30c7a8
movb $0x60, (%rax)
movl $0x0, (%r15)
movl $0xd, %edi
callq 0xd4e7
movl $0xd, %edi
callq 0xd4e7
movl $0x7a, %edi
callq 0xd4e7
movl $0x60, %edi
callq 0xd4e7
movl $0x0, (%r13)
jmp 0x46982
cmpl $0xd, %r14d
jne 0x46c1c
cmpl $0x0, 0x2fbc28(%rip)    # 0x342838
je 0x46c1c
movl $0x0, 0x2fbc1c(%rip)    # 0x342838
movl $0x0, (%r13)
cmpb $0x0, (%rsi)
je 0x46c9d
leaq 0x1d46d0(%rip), %rax    # 0x21b300
movl $0x0, (%rax)
leaq 0x1f831b(%rip), %rax    # 0x23ef58
movl (%rax), %eax
testl %eax, %eax
setne %cl
cmpl $0x1b, %r14d
sete %dl
orb %cl, %dl
jne 0x46c5e
movl $0x13d, %edi            # imm = 0x13D
callq 0x9d80
jmp 0x46fd3
xorl $0x1b, %eax
movl %r14d, %ecx
xorl $0x21, %ecx
orl %eax, %ecx
jne 0x46c70
movb $0x0, (%rsi)
jmp 0x46c93
cmpl $0xff, %r14d
jg 0x46c85
cmpl $0x5d, %r14d
je 0x46c85
cmpl $0x5b, %r14d
jne 0x46c9d
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x2, %esi
callq 0x1c791
callq 0x2781b
jmp 0x46fd3
leaq 0x2f4b84(%rip), %r15    # 0x33b828
cmpl $0x0, (%r15)
js 0x46cde
testl %r14d, %r14d
je 0x470a1
leaq 0x2f894e(%rip), %rax    # 0x33f608
cmpw $0x0, (%rax)
je 0x46d52
leaq 0x1d4635(%rip), %rax    # 0x21b300
movl $0x0, (%rax)
movl %r14d, %edi
callq 0x2be95
jmp 0x46fd3
movq %rdi, %r13
movq %rsi, %r12
callq 0x727c3
movl $0x0, (%r15)
cmpl $0xd, %r14d
je 0x46d06
cmpl $0x60, %r14d
je 0x46d06
cmpl $0x1b, %r14d
jne 0x46dc9
cmpb $0x0, (%r13)
je 0x46d12
callq 0x23ad7
callq 0x727c3
jmp 0x46fd3
cmpb $0x51, %r12b
setne %cl
leal -0x30(%r14), %eax
cmpl $0xa, %eax
setae %dl
orb %cl, %dl
jne 0x46d78
movl 0x2fbc31(%rip), %ecx    # 0x342968
leal (%rcx,%rcx,4), %ecx
leal (%rax,%rcx,2), %eax
xorl %ebx, %ebx
cmpl $0x2710, %eax           # imm = 0x2710
cmovgel %ebx, %eax
movl %eax, 0x2fbc1b(%rip)    # 0x342968
jmp 0x46fd3
cmpl $0x0, 0x2fbbe3(%rip)    # 0x34293c
je 0x46de4
xorl %ebx, %ebx
movl %r14d, %edi
xorl %esi, %esi
callq 0x39fe6
testl %eax, %eax
jne 0x46fd3
jmp 0x470a1
cmpb $0x51, %r12b
setne %al
cmpl $0x2b, %r14d
setne %cl
orb %al, %cl
jne 0x46e33
movl 0x2fbbd4(%rip), %eax    # 0x342968
testl %eax, %eax
je 0x46f35
leaq 0x2c6789(%rip), %rcx    # 0x30d52c
movslq %eax, %rdx
imulq $0x2aaaaaab, %rdx, %rdx # imm = 0x2AAAAAAB
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x21, %rdx
addl %esi, %edx
addl %edx, (%rcx)
shll $0x2, %edx
leal (%rdx,%rdx,2), %ecx
subl %ecx, %eax
jmp 0x46f3a
leaq 0x2f8510(%rip), %rax    # 0x33f2e0
movb %r14b, (%rax)
movb $0x0, 0x1(%rax)
callq 0x20ef0
movq %r12, %rsi
jmp 0x46caa
leal -0x13b(%r14), %eax
cmpl $0x9, %eax
ja 0x46ea1
leaq 0x1f815d(%rip), %rax    # 0x23ef58
cmpl $0x0, (%rax)
jne 0x46f63
addl $0xfffffec6, %r14d      # imm = 0xFFFFFEC6
leaq 0x2f540e(%rip), %rbx    # 0x33c220
leaq 0xd6e94(%rip), %rsi     # 0x11dcad
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
callq 0x1cf23
jmp 0x470a1
cmpb $0x51, %r12b
setne %al
cmpl $0x2d, %r14d
setne %cl
orb %al, %cl
jne 0x46f0e
movl 0x2fbb19(%rip), %eax    # 0x342968
testl %eax, %eax
je 0x46fa2
movslq %eax, %rcx
imulq $-0x2aaaaaab, %rcx, %rdx # imm = 0xD5555555
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x21, %rdx
addl %esi, %edx
leaq 0x2c66b7(%rip), %rsi    # 0x30d52c
addl %edx, (%rsi)
imulq $0x2aaaaaab, %rcx, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x21, %rcx
addl %edx, %ecx
shll $0x2, %ecx
leal (%rcx,%rcx,2), %ecx
leaq 0x2c6690(%rip), %rdx    # 0x30d528
subl %eax, %ecx
addl (%rdx), %ecx
jmp 0x46fad
cmpl $0xff, %r14d
jg 0x46ecb
leal -0x3c(%r14), %eax
cmpl $0x21, %eax
ja 0x4702a
movabsq $0x280000015, %rcx      # imm = 0x280000015
btq %rax, %rcx
jae 0x4702a
leaq 0x1d442e(%rip), %rax    # 0x21b300
movl $0x0, (%rax)
leaq 0x1f8079(%rip), %rax    # 0x23ef58
movl (%rax), %eax
leaq 0x1d18f0(%rip), %rcx    # 0x2187d8
movl (%rcx), %ecx
orl %eax, %ecx
jne 0x46f5b
cmpl $0x40, %r14d
jne 0x46fe4
xorl %edi, %edi
callq 0x1b3a7
movl $0x17, %edi
callq 0xfd83
jmp 0x47084
cmpb $0x51, %r12b
setne %al
cmpl $0x3e, %r14d
setne %cl
orb %al, %cl
jne 0x46f6d
movl 0x2fba42(%rip), %eax    # 0x342968
leaq 0x2c65ff(%rip), %rcx    # 0x30d52c
cmpl $0x1, %eax
adcl $0x0, %eax
jmp 0x46f9e
movl $0x1, %eax
leaq 0x2c65e7(%rip), %rcx    # 0x30d528
addl (%rcx), %eax
movl %eax, (%rcx)
cmpl $0xd, %eax
jl 0x46fc9
movl $0x1, (%rcx)
leaq 0x2c65d5(%rip), %rax    # 0x30d52c
incl (%rax)
jmp 0x46fc9
testl %eax, %eax
je 0x4701d
movl %r14d, %edi
callq 0x39634
jmp 0x46fd3
cmpb $0x51, %r12b
setne %al
cmpl $0x3c, %r14d
setne %cl
orb %al, %cl
jne 0x46ff6
movl 0x2fb9e3(%rip), %eax    # 0x342968
leaq 0x2c65a0(%rip), %rcx    # 0x30d52c
movl %eax, %edx
negl %edx
xorl %ebx, %ebx
cmpl $0x1, %eax
movl $0x0, %eax
sbbl %eax, %eax
orl %edx, %eax
addl %eax, (%rcx)
jmp 0x46fc9
leaq 0x2c657f(%rip), %rax    # 0x30d528
movl (%rax), %ecx
decl %ecx
leaq 0x2c6574(%rip), %rax    # 0x30d528
movl %ecx, (%rax)
testl %ecx, %ecx
jg 0x46fc9
movl $0xc, (%rax)
leaq 0x2c6565(%rip), %rax    # 0x30d52c
decl (%rax)
movl $0x0, 0x2fb995(%rip)    # 0x342968
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, %edi
movl $0x3, %esi
callq 0x1c791
jmp 0x47084
cmpl $0x5c, %r14d
je 0x46c24
cmpb $0x4c, %r12b
jne 0x470d7
leaq 0x2c579b(%rip), %rax    # 0x30c7ac
cmpl $0x0, (%rax)
setne %r9b
jmp 0x470da
cmpl $0x100, %r14d           # imm = 0x100
jl 0x4707c
xorl %edi, %edi
jmp 0x4707f
cmpl $0x1b, %r14d
jne 0x470ab
movq %rsi, %rdi
leaq 0x1d42c6(%rip), %rax    # 0x21b300
leaq 0x2c60ab(%rip), %rcx    # 0x30d0ec
cmpb $0x0, (%rcx)
movl $0x0, (%rax)
setne %dl
leaq 0x1f7f04(%rip), %rax    # 0x23ef58
movl (%rax), %eax
cmpl $0x26, %eax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x47272
movb $0x0, (%rcx)
leaq 0x1d17d0(%rip), %rax    # 0x218844
movl $0x231d, (%rax)         # imm = 0x231D
jmp 0x470a1
movl %r14d, %edi
callq 0x27a1f
cmpl $0xff, %r14d
jg 0x47097
leaq 0x1d418c(%rip), %rax    # 0x21b220
movl %r14d, (%rax)
movl $0x8, %edi
callq 0xfd83
callq 0x2781b
jmp 0x46982
leal -0x30(%r14), %eax
cmpl $0x9, %eax
ja 0x47213
leaq 0x1f7e99(%rip), %rax    # 0x23ef58
cmpl $0x0, (%rax)
jne 0x47213
movl %r14d, %edi
callq 0x3a9b1
movl $0x14, %edi
jmp 0x4709c
orb %r15b, %r9b
movq %r8, %r15
movl %r9d, %r13d
testb %r12b, %r12b
je 0x47110
movl $0xffffff94, %edi       # imm = 0xFFFFFF94
callq 0x27724
leaq 0x2c56b2(%rip), %rax    # 0x30c7a8
movb $0x0, (%rax)
leaq 0x2f472c(%rip), %rax    # 0x33b82c
movl $0x0, (%rax)
movl $0x69, %edi
callq 0xd846f
cmpl $0x4, (%r15)
movl %r13d, %edx
jne 0x47162
leaq 0x1d17b0(%rip), %rax    # 0x2188d0
xorl %ecx, %ecx
cmpq $0x10000, (%rax)        # imm = 0x10000
sete %cl
leal (%rcx,%rcx,4), %eax
leaq 0x1f5c08(%rip), %rcx    # 0x23cd3e
movb %al, (%rcx)
leaq 0x1d429b(%rip), %rax    # 0x21b3da
movb (%rax), %al
leaq 0x1d4291(%rip), %rcx    # 0x21b3d9
movb %al, (%rcx)
testb %al, %al
jne 0x4715b
leaq 0x1d166f(%rip), %rax    # 0x2187c4
movl $0x0, (%rax)
movl $0x0, (%r15)
leaq 0x2f416b(%rip), %rax    # 0x33b2d4
movb $0x0, (%rax)
leaq 0x1d175d(%rip), %rcx    # 0x2188d0
cmpq $0x400, (%rcx)          # imm = 0x400
je 0x47187
leaq 0x2c5629(%rip), %rcx    # 0x30c7ac
movb (%rcx), %cl
movb %cl, (%rax)
testb %dl, %dl
je 0x47198
movb $0x1, %cl
leaq 0x2f411c(%rip), %rdx    # 0x33b2b0
movb %cl, (%rdx)
movb %cl, (%rax)
movzbl (%rax), %edi
callq 0x3aabf
leaq 0x2f4109(%rip), %rax    # 0x33b2b0
movb %r13b, (%rax)
movl $0x1, %eax
movl %r14d, %r15d
movabsq $0x108002000, %r12      # imm = 0x108002000
cmpl $0x20, %r14d
ja 0x471ca
btq %r15, %r12
jae 0x471ca
xorl %eax, %eax
leaq 0x1d1677(%rip), %r13    # 0x218848
movl %eax, (%r13)
movl $0x80, %edi
callq 0xcf81
callq 0xed5e
movl $0x0, (%r13)
cmpl $0x20, %r14d
leaq 0x1d4025(%rip), %rsi    # 0x21b21c
leaq 0x2c55aa(%rip), %rdi    # 0x30c7a8
ja 0x46c24
btq %r15, %r12
jb 0x46fd3
jmp 0x46c24
movl %r14d, %edi
callq 0x9580
cmpl $0x2b, %eax
je 0x47232
cmpl $0x2d, %eax
je 0x47232
leaq 0x1d40d4(%rip), %rcx    # 0x21b300
movl $0x0, (%rcx)
leaq 0x1d3fe7(%rip), %rcx    # 0x21b220
xorl %edx, %edx
movl %edx, (%rcx)
leaq 0x1d40c0(%rip), %rcx    # 0x21b304
movl %edx, (%rcx)
leaq 0x1d40bb(%rip), %rcx    # 0x21b308
movl $0xd, (%rcx)
movl %eax, %ecx
addl $-0x61, %ecx
movl %eax, %edi
addq $0x8, %rsp
cmpl $0xe, %ecx
ja 0x472c6
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3b654
leaq 0x1f5ac7(%rip), %rcx    # 0x23cd40
cmpb $0x0, (%rcx)
je 0x472d5
leaq 0x1d3faf(%rip), %rcx    # 0x21b234
cmpb $0x0, (%rcx)
jne 0x472d5
leaq 0x1d1547(%rip), %rax    # 0x2187d8
cmpl $0x2, (%rax)
jne 0x4731a
movl $0x0, (%rax)
leaq 0x1d15b4(%rip), %rax    # 0x21885b
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x1d15a8(%rip), %rax    # 0x21885a
movb %cl, (%rax)
leaq 0x1d1589(%rip), %rax    # 0x218844
movl $0x1a15, (%rax)         # imm = 0x1A15
jmp 0x470a1
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x414a1
cmpl $0x1b, %eax
jne 0x47302
leaq 0x1d3f50(%rip), %rax    # 0x21b231
cmpb $0x0, (%rax)
je 0x470a1
cmpb $0x0, (%rdi)
jne 0x470a1
callq 0x395f2
movl $0x1, %ebx
jmp 0x46fd3
movl $0x1b, %edi
callq 0x27a1f
cmpl $0x1b, %eax
jne 0x46fd3
jmp 0x470a1
leaq 0x1d3fe3(%rip), %rbx    # 0x21b304
movl (%rbx), %r14d
xorl %edi, %edi
movl $0x4, %esi
callq 0x1c791
movl %r14d, (%rbx)
jmp 0x470a1