// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_vim.c
// Function: insert_mode_handle_key
CeVimParseResult_t insert_mode_handle_key(CeVim_t* vim, CeView_t* view, CePoint_t* cursor, CeVimVisualData_t* visual,
                                          CeRune_t key, const CeConfigOptions_t* config_options){
     switch(key){
     default:
          if(_is_print(key) || key == CE_NEWLINE){
               if(ce_buffer_insert_rune(view->buffer, key, *cursor)){
                    const char str[2] = {key, 0};
                    CePoint_t save_cursor = *cursor;
                    CePoint_t new_cursor = ce_buffer_advance_point(view->buffer, *cursor, 1);

                    // TODO: convenience function
                    CeBufferChange_t change = {};
                    change.chain = vim->chain_undo;
                    change.insertion = true;
                    change.string = strdup(str);
                    change.location = *cursor;
                    change.cursor_before = *cursor;
                    change.cursor_after = new_cursor;
                    ce_buffer_change(view->buffer, &change);

                    *cursor = new_cursor;
                    vim->chain_undo = true;

                    // indent after newline
                    if(key == CE_NEWLINE && !vim->pasting){
                         // calc indentation
                         CePoint_t indentation_point = {0, cursor->y};
                         int64_t indentation = ce_vim_get_indentation(view->buffer, save_cursor, config_options->tab_width);
                         CePoint_t cursor_end = {indentation, indentation_point.y};

                         if(indentation > 0){
                              // build indentation string
                              char* insert_string = malloc(indentation + 1);
                              memset(insert_string, ' ', indentation);
                              insert_string[indentation] = 0;

                              if(!ce_buffer_insert_string_change(view->buffer, insert_string, indentation_point,
                                                                 cursor, cursor_end, true)){
                                   return false;
                              }
                         }

                         *cursor = cursor_end;

                         // check if previous line was all whitespace, if so, remove it
                         CePoint_t remove_loc = {0, save_cursor.y};
                         if(string_is_whitespace(view->buffer->lines[save_cursor.y])){
                              int64_t remove_len = strlen(view->buffer->lines[save_cursor.y]);
                              ce_buffer_remove_string_change(view->buffer, remove_loc, remove_len, cursor,
                                                             *cursor, true);
                         }
                    }
               }
          }else if(key == CE_TAB){
               // build a string to insert
               char* insert_string = NULL;
               if(config_options->insert_spaces_on_tab && !vim->pasting){
                    int64_t insert_len = config_options->tab_width;
                    insert_string = malloc(insert_len + 1);
                    memset(insert_string, ' ', insert_len);
                    insert_string[insert_len] = 0;
               }else{
                    insert_string = malloc(2);
                    insert_string[0] = key;
                    insert_string[1] = 0;
               }

               if(!ce_buffer_insert_string_change_at_cursor(view->buffer, insert_string, cursor, vim->chain_undo)){
                    break;
               }

               vim->chain_undo = true;
          }else{
               return CE_VIM_PARSE_KEY_NOT_HANDLED;
          }
          break;
     case '}':
     {
          if(!vim->pasting && string_is_whitespace(view->buffer->lines[cursor->y])){
               int64_t remove_len = strlen(view->buffer->lines[cursor->y]);
               CePoint_t remove_loc = {0, cursor->y};
               ce_buffer_remove_string_change(view->buffer, remove_loc, remove_len, cursor, remove_loc, true);

               // calc indentation
               CePoint_t indentation_point = {0, cursor->y};
               int64_t indentation = ce_vim_get_indentation(view->buffer, *cursor, config_options->tab_width);
               if(indentation > 0) indentation -= config_options->tab_width;
               if(indentation < 0) indentation = 0;
               CePoint_t cursor_end = {indentation, indentation_point.y};

               if(indentation > 0){
                   // build indentation string
                    char* insert_string = malloc(indentation + 1);
                    memset(insert_string, ' ', indentation);
                    insert_string[indentation] = 0;

                    if(!ce_buffer_insert_string_change(view->buffer, insert_string, indentation_point,
                                                       cursor, cursor_end, true)){
                         break;
                    }
               }
          }

          if(!ce_buffer_insert_rune(view->buffer, key, *cursor)) break;

          const char str[2] = {key, 0};
          CePoint_t new_cursor = ce_buffer_advance_point(view->buffer, *cursor, 1);

          // TODO: convenience function
          CeBufferChange_t change = {};
          change.chain = vim->chain_undo;
          change.insertion = true;
          change.string = strdup(str);
          change.location = *cursor;
          change.cursor_before = *cursor;
          change.cursor_after = new_cursor;
          ce_buffer_change(view->buffer, &change);

          *cursor = new_cursor;
          vim->chain_undo = true;

     } break;
     case KEY_ONLY_BACKSPACE:
          if(!ce_points_equal(*cursor, (CePoint_t){0, 0})){
               CePoint_t remove_point;
               CePoint_t end_cursor;
               int64_t remove_len = 1;

               if(cursor->x == 0){
                    int64_t line = cursor->y - 1;
                    end_cursor = (CePoint_t){ce_utf8_strlen(view->buffer->lines[line]), line};
                    ce_vim_join_next_line(view->buffer, cursor->y - 1, *cursor, vim->chain_undo);
               }else{
                    remove_point = ce_buffer_advance_point(view->buffer, *cursor, -1);
                    end_cursor = remove_point;
                    ce_buffer_remove_string_change(view->buffer, remove_point, remove_len, cursor,
                                                   end_cursor, vim->chain_undo);
               }

               *cursor = end_cursor;
               vim->chain_undo = true;
          }
          break;
     case KEY_DELETE:
          ce_buffer_remove_string_change(view->buffer, *cursor, 1, cursor,
                                         *cursor, vim->chain_undo);
          vim->chain_undo = true;
          break;
     case KEY_LEFT_ARROW:
          *cursor = ce_buffer_move_point(view->buffer, *cursor, (CePoint_t){-1, 0},
                                         config_options->tab_width, CE_CLAMP_X_ON);
          vim->chain_undo = false;
          break;
     case KEY_DOWN_ARROW:
          *cursor = ce_buffer_move_point(view->buffer, *cursor, (CePoint_t){0, 1},
                                         config_options->tab_width, CE_CLAMP_X_ON);
          vim->chain_undo = false;
          break;
     case KEY_UP_ARROW:
          *cursor = ce_buffer_move_point(view->buffer, *cursor, (CePoint_t){0, -1},
                                        config_options->tab_width, CE_CLAMP_X_ON);
          vim->chain_undo = false;
          break;
     case KEY_RIGHT_ARROW:
          *cursor = ce_buffer_move_point(view->buffer, *cursor, (CePoint_t){1, 0},
                                         config_options->tab_width, CE_CLAMP_X_ON);
          vim->chain_undo = false;
          break;
     case KEY_ESCAPE: // escape
     {
          if(!vim->insert_rune_head &&
             (vim->current_action.verb.function == ce_vim_verb_insert_mode ||
              vim->current_action.verb.function == ce_vim_verb_append ||
              vim->current_action.verb.function == ce_vim_verb_append_at_end_of_line)){
               // pass
          }else if(!vim->verb_last_action){
               vim->last_action = vim->current_action;
               if(vim->last_insert_rune_head){
                   ce_rune_node_free(&vim->last_insert_rune_head);
               }
               vim->last_insert_rune_head = vim->insert_rune_head;
               vim->insert_rune_head = NULL;
          }

          // check if previous line was all whitespace, if so, remove it
          CePoint_t remove_loc = {0, cursor->y};
          if(string_is_whitespace(view->buffer->lines[cursor->y])){
               int64_t remove_len = strlen(view->buffer->lines[cursor->y]);
               ce_buffer_remove_string_change(view->buffer, remove_loc, remove_len, cursor, remove_loc, true);
          }

          if(!ce_points_equal(visual->block_top_left, visual->block_bottom_right)){
               CePoint_t visual_top_left = visual->block_top_left;
               CePoint_t visual_bottom_right = visual->block_bottom_right;

               // adjust range because we've already inserted text the line the cursor is on
               CePoint_t cursor_end = *cursor;
               if(visual_top_left.y == cursor->y){
                    visual_top_left.y++;
               }else{
                    visual_bottom_right.y--;
               }

               visual->block_top_left = (CePoint_t){0, 0};
               visual->block_bottom_right = (CePoint_t){0, 0};

               CeRune_t* rune_string = ce_rune_node_string(vim->last_insert_rune_head);

               if(view->buffer->change_node) view->buffer->change_node->change.chain = true;
               vim->chain_undo = true;

               for(int64_t i = visual_top_left.y; i <= visual_bottom_right.y; i++){
                    *cursor = (CePoint_t){visual_top_left.x, i};
                    CeRune_t* itr = rune_string;
                    while(*itr){
                         insert_mode_handle_key(vim, view, cursor, visual, *itr, config_options);
                         itr++;
                    }
               }

               free(rune_string);
               *cursor = cursor_end;

               if(view->buffer->change_node) view->buffer->change_node->change.cursor_after = *cursor;
          }

          vim->mode = CE_VIM_MODE_NORMAL;
          vim->chain_undo = false;

          if(cursor->x > 0){
               *cursor = ce_buffer_advance_point(view->buffer, *cursor, -1);
          }
     } break;
     case KEY_REDO:
     {
          CeVimYank_t* yank = vim->yanks + ce_vim_register_index('"');
          if(yank->type == CE_VIM_YANK_TYPE_NONE ||
             yank->type == CE_VIM_YANK_TYPE_BLOCK) break;

          vim->chain_undo = false;
          if(!ce_buffer_insert_string_change_at_cursor(view->buffer, strdup(yank->text),
                                                       cursor, vim->chain_undo)){
               break;
          }
     } break;
#if defined(DISPLAY_GUI)
     case KEY_CTRL_SHIFT_V:
     {
          CePoint_t resulting_cursor = ce_paste_clipboard_into_buffer(view->buffer,
                                                                      view->cursor);
          if(resulting_cursor.x >= 0){
               view->cursor = resulting_cursor;
          }
     } break;
#endif
     }

     return CE_VIM_PARSE_COMPLETE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq %r9, -0x38(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x324(%rbp)
subl $0x1b, %eax
je 0x32ff8
jmp 0x323f7
movl -0x324(%rbp), %eax
subl $0x7d, %eax
je 0x3287c
jmp 0x32408
movl -0x324(%rbp), %eax
subl $0x102, %eax            # imm = 0x102
je 0x32e3f
jmp 0x3241b
movl -0x324(%rbp), %eax
subl $0x103, %eax            # imm = 0x103
je 0x32ed2
jmp 0x3242e
movl -0x324(%rbp), %eax
subl $0x104, %eax            # imm = 0x104
je 0x32dac
jmp 0x32441
movl -0x324(%rbp), %eax
subl $0x105, %eax            # imm = 0x105
je 0x32f65
jmp 0x32454
movl -0x324(%rbp), %eax
subl $0x107, %eax            # imm = 0x107
je 0x32b8f
jmp 0x32467
movl -0x324(%rbp), %eax
subl $0x14a, %eax            # imm = 0x14A
je 0x32d57
jmp 0x3247a
movl -0x324(%rbp), %eax
subl $0x173, %eax            # imm = 0x173
je 0x33432
jmp 0x3248d
movl -0x2c(%rbp), %eax
movsbl %al, %edi
callq 0x334f0
testb $0x1, %al
jne 0x324a6
cmpl $0xa, -0x2c(%rbp)
jne 0x32784
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movl -0x2c(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
callq 0xffa0
testb $0x1, %al
jne 0x324ca
jmp 0x3277f
movl -0x2c(%rbp), %eax
movb %al, -0x3a(%rbp)
movb $0x0, -0x39(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl $0x1, %ecx
callq 0xfaf0
movq %rax, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0xd290
movq -0x10(%rbp), %rax
movb 0x19d8(%rax), %al
andb $0x1, %al
movb %al, -0xa0(%rbp)
movb $0x1, -0x9f(%rbp)
leaq -0x3a(%rbp), %rdi
callq 0xd620
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x80(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x10e90
movq -0x20(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x19d8(%rax)
cmpl $0xa, -0x2c(%rbp)
jne 0x3277d
movq -0x10(%rbp), %rax
testb $0x1, 0x19da(%rax)
jne 0x3277d
movq $0x0, -0xb0(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x33520
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0xb8(%rbp)
jle 0x326cf
movq -0xb8(%rbp), %rdi
addq $0x1, %rdi
callq 0xd4a0
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rdi
movq -0xb8(%rbp), %rdx
movl $0x20, %esi
callq 0xd290
movq -0xd0(%rbp), %rax
movq -0xb8(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0xd0(%rbp), %rsi
movq -0x20(%rbp), %r8
movq -0xb0(%rbp), %rdx
movq -0xa8(%rbp), %rcx
leaq -0xc8(%rbp), %rax
movl $0x1, %r9d
movq (%rax), %r10
movq %r10, (%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x10da0
testb $0x1, %al
jne 0x326cd
movl $0x0, -0x4(%rbp)
jmp 0x334da
jmp 0x326cf
movq -0x20(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq $0x0, -0xe0(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x33840
testb $0x1, %al
jne 0x3271c
jmp 0x3277b
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xd200
movq %rax, -0xe8(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0xe8(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x20(%rbp), %rax
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movl $0x1, %r9d
movq (%rax), %r10
movq %r10, (%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x110a0
jmp 0x3277d
jmp 0x3277f
jmp 0x32877
cmpl $0x9, -0x2c(%rbp)
jne 0x32869
movq $0x0, -0xf0(%rbp)
movq -0x38(%rbp), %rax
testb $0x1, 0x20(%rax)
je 0x32802
movq -0x10(%rbp), %rax
testb $0x1, 0x19da(%rax)
jne 0x32802
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rdi
addq $0x1, %rdi
callq 0xd4a0
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rdi
movq -0xf8(%rbp), %rdx
movl $0x20, %esi
callq 0xd290
movq -0xf0(%rbp), %rax
movq -0xf8(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x3282c
movl $0x2, %edi
callq 0xd4a0
movq %rax, -0xf0(%rbp)
movl -0x2c(%rbp), %eax
movb %al, %cl
movq -0xf0(%rbp), %rax
movb %cl, (%rax)
movq -0xf0(%rbp), %rax
movb $0x0, 0x1(%rax)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0xf0(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movb 0x19d8(%rax), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x10f90
testb $0x1, %al
jne 0x3285c
jmp 0x334d3
movq -0x10(%rbp), %rax
movb $0x1, 0x19d8(%rax)
jmp 0x32875
movl $0x1, -0x4(%rbp)
jmp 0x334da
jmp 0x32877
jmp 0x334d3
movq -0x10(%rbp), %rax
testb $0x1, 0x19da(%rax)
jne 0x32a66
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x33840
testb $0x1, %al
jne 0x328b2
jmp 0x32a66
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xd200
movq %rax, -0x100(%rbp)
movq $0x0, -0x110(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x108(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x100(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
leaq -0x110(%rbp), %rax
movl $0x1, %r9d
movq (%rax), %r10
movq %r10, (%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x110a0
movq $0x0, -0x120(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x118(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x33520
movq %rax, -0x128(%rbp)
cmpq $0x0, -0x128(%rbp)
jle 0x32996
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x128(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x128(%rbp)
cmpq $0x0, -0x128(%rbp)
jge 0x329ab
movq $0x0, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0x130(%rbp)
cmpq $0x0, -0x128(%rbp)
jle 0x32a64
movq -0x128(%rbp), %rdi
addq $0x1, %rdi
callq 0xd4a0
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rdi
movq -0x128(%rbp), %rdx
movl $0x20, %esi
callq 0xd290
movq -0x140(%rbp), %rax
movq -0x128(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x140(%rbp), %rsi
movq -0x20(%rbp), %r8
movq -0x120(%rbp), %rdx
movq -0x118(%rbp), %rcx
leaq -0x138(%rbp), %rax
movl $0x1, %r9d
movq (%rax), %r10
movq %r10, (%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x10da0
testb $0x1, %al
jne 0x32a62
jmp 0x334d3
jmp 0x32a64
jmp 0x32a66
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movl -0x2c(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
callq 0xffa0
testb $0x1, %al
jne 0x32a8a
jmp 0x334d3
movl -0x2c(%rbp), %eax
movb %al, -0x142(%rbp)
movb $0x0, -0x141(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl $0x1, %ecx
callq 0xfaf0
movq %rax, -0x158(%rbp)
movq %rdx, -0x150(%rbp)
leaq -0x198(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0xd290
movq -0x10(%rbp), %rax
movb 0x19d8(%rax), %al
andb $0x1, %al
movb %al, -0x198(%rbp)
movb $0x1, -0x197(%rbp)
leaq -0x142(%rbp), %rdi
callq 0xd620
movq %rax, -0x190(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x188(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x180(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x178(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x170(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
leaq -0x198(%rbp), %rsi
callq 0x10e90
movq -0x20(%rbp), %rax
movq -0x158(%rbp), %rcx
movq %rcx, (%rax)
movq -0x150(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x19d8(%rax)
jmp 0x334d3
movq -0x20(%rbp), %rax
movq $0x0, -0x1a8(%rbp)
movq $0x0, -0x1a0(%rbp)
movq (%rax), %rdi
movq 0x8(%rax), %rsi
movq -0x1a8(%rbp), %rdx
movq -0x1a0(%rbp), %rcx
callq 0xfec0
testb $0x1, %al
jne 0x32d52
movq $0x1, -0x1d0(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x32c7c
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
subq $0x1, %rax
movq %rax, -0x1d8(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xea70
movq %rax, -0x1e8(%rbp)
movq -0x1d8(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x1e8(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
subq $0x1, %rsi
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movb 0x19d8(%rax), %al
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
andb $0x1, %al
movzbl %al, %r8d
callq 0x338c0
jmp 0x32d2e
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq $-0x1, %rcx
callq 0xfaf0
movq %rax, -0x1f8(%rbp)
movq %rdx, -0x1f0(%rbp)
movq -0x1f8(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x1f0(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x1b8(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x1b0(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x1d0(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x10(%rbp), %rax
movb 0x19d8(%rax), %al
movq -0x1b8(%rbp), %rsi
movq -0x1b0(%rbp), %rdx
leaq -0x1c8(%rbp), %r9
andb $0x1, %al
movq (%r9), %r10
movq %r10, (%rsp)
movq 0x8(%r9), %r9
movq %r9, 0x8(%rsp)
movzbl %al, %r9d
callq 0x110a0
movq -0x20(%rbp), %rax
movq -0x1c8(%rbp), %rcx
movq %rcx, (%rax)
movq -0x1c0(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x19d8(%rax)
jmp 0x334d3
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x20(%rbp), %r9
movq -0x10(%rbp), %rax
movb 0x19d8(%rax), %al
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
movl $0x1, %ecx
andb $0x1, %al
movq (%r9), %r10
movq %r10, (%rsp)
movq 0x8(%r9), %r9
movq %r9, 0x8(%rsp)
movzbl %al, %r9d
callq 0x110a0
movq -0x10(%rbp), %rax
movb $0x1, 0x19d8(%rax)
jmp 0x334d3
movq -0x20(%rbp), %rax
movq %rax, -0x330(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rax
movq $-0x1, -0x218(%rbp)
movq $0x0, -0x210(%rbp)
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %r9
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq -0x218(%rbp), %rcx
movq -0x210(%rbp), %r8
movl $0x1, (%rsp)
callq 0xf740
movq %rax, %rcx
movq -0x330(%rbp), %rax
movq %rcx, -0x208(%rbp)
movq %rdx, -0x200(%rbp)
movq -0x208(%rbp), %rcx
movq %rcx, (%rax)
movq -0x200(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x19d8(%rax)
jmp 0x334d3
movq -0x20(%rbp), %rax
movq %rax, -0x338(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rax
movq $0x0, -0x238(%rbp)
movq $0x1, -0x230(%rbp)
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %r9
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq -0x238(%rbp), %rcx
movq -0x230(%rbp), %r8
movl $0x1, (%rsp)
callq 0xf740
movq %rax, %rcx
movq -0x338(%rbp), %rax
movq %rcx, -0x228(%rbp)
movq %rdx, -0x220(%rbp)
movq -0x228(%rbp), %rcx
movq %rcx, (%rax)
movq -0x220(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x19d8(%rax)
jmp 0x334d3
movq -0x20(%rbp), %rax
movq %rax, -0x340(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rax
movq $0x0, -0x258(%rbp)
movq $-0x1, -0x250(%rbp)
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %r9
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq -0x258(%rbp), %rcx
movq -0x250(%rbp), %r8
movl $0x1, (%rsp)
callq 0xf740
movq %rax, %rcx
movq -0x340(%rbp), %rax
movq %rcx, -0x248(%rbp)
movq %rdx, -0x240(%rbp)
movq -0x248(%rbp), %rcx
movq %rcx, (%rax)
movq -0x240(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x19d8(%rax)
jmp 0x334d3
movq -0x20(%rbp), %rax
movq %rax, -0x348(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rax
movq $0x1, -0x278(%rbp)
movq $0x0, -0x270(%rbp)
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %r9
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq -0x278(%rbp), %rcx
movq -0x270(%rbp), %r8
movl $0x1, (%rsp)
callq 0xf740
movq %rax, %rcx
movq -0x348(%rbp), %rax
movq %rcx, -0x268(%rbp)
movq %rdx, -0x260(%rbp)
movq -0x268(%rbp), %rcx
movq %rcx, (%rax)
movq -0x260(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x19d8(%rax)
jmp 0x334d3
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19c8(%rax)
jne 0x33044
movq -0x10(%rbp), %rax
leaq 0x94f(%rip), %rcx       # 0x33960
cmpq %rcx, 0x19a8(%rax)
je 0x33042
movq -0x10(%rbp), %rax
leaq 0x97b(%rip), %rcx       # 0x339a0
cmpq %rcx, 0x19a8(%rax)
je 0x33042
movq -0x10(%rbp), %rax
leaq 0x9e7(%rip), %rcx       # 0x33a20
cmpq %rcx, 0x19a8(%rax)
jne 0x33044
jmp 0x330b6
movq -0x10(%rbp), %rax
testb $0x1, 0x19d9(%rax)
jne 0x330b4
movq -0x10(%rbp), %rdi
addq $0x1938, %rdi           # imm = 0x1938
movq -0x10(%rbp), %rsi
addq $0x1980, %rsi           # imm = 0x1980
movl $0x48, %edx
callq 0xd400
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19d0(%rax)
je 0x3308f
movq -0x10(%rbp), %rdi
addq $0x19d0, %rdi           # imm = 0x19D0
callq 0x11f10
movq -0x10(%rbp), %rax
movq 0x19c8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x19d0(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x19c8(%rax)
jmp 0x330b6
movq $0x0, -0x288(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x280(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x33840
testb $0x1, %al
jne 0x330f2
jmp 0x33158
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xd200
movq %rax, -0x290(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x290(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x288(%rbp), %rsi
movq -0x280(%rbp), %rdx
leaq -0x288(%rbp), %rax
movl $0x1, %r9d
movq (%rax), %r10
movq %r10, (%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x110a0
movq -0x28(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0x10(%rcx), %rdi
movq 0x18(%rcx), %rsi
movq 0x20(%rax), %rdx
movq 0x28(%rax), %rcx
callq 0xfec0
testb $0x1, %al
jne 0x333b7
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x2a0(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x298(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rcx
movq %rcx, -0x2b0(%rbp)
movq 0x28(%rax), %rax
movq %rax, -0x2a8(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x2c0(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x2b8(%rbp)
movq -0x298(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x331ef
movq -0x298(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x298(%rbp)
jmp 0x33201
movq -0x2a8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x2a8(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, -0x2d0(%rbp)
movq $0x0, -0x2c8(%rbp)
movq -0x2d0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x2c8(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movq $0x0, -0x2e0(%rbp)
movq $0x0, -0x2d8(%rbp)
movq -0x2e0(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0x2d8(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x19d0(%rax), %rdi
callq 0x11e50
movq %rax, -0x2e8(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
cmpq $0x0, 0x40(%rax)
je 0x33296
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x40(%rax), %rax
movb $0x1, (%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x19d8(%rax)
movq -0x298(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movq -0x2f0(%rbp), %rax
cmpq -0x2a8(%rbp), %rax
jg 0x33362
movq -0x20(%rbp), %rax
movq -0x2a0(%rbp), %rcx
movq %rcx, -0x300(%rbp)
movq -0x2f0(%rbp), %rcx
movq %rcx, -0x2f8(%rbp)
movq -0x300(%rbp), %rcx
movq %rcx, (%rax)
movq -0x2f8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x2e8(%rbp), %rax
movq %rax, -0x308(%rbp)
movq -0x308(%rbp), %rax
cmpl $0x0, (%rax)
je 0x33349
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x308(%rbp), %rax
movl (%rax), %r8d
movq -0x38(%rbp), %r9
callq 0x323c0
movq -0x308(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x308(%rbp)
jmp 0x33306
jmp 0x3334b
movq -0x2f0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2f0(%rbp)
jmp 0x332af
movq -0x2e8(%rbp), %rdi
callq 0xd090
movq -0x20(%rbp), %rax
movq -0x2c0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x2b8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
cmpq $0x0, 0x40(%rax)
je 0x333b5
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x40(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x30(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x38(%rax)
jmp 0x333b7
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x19d8(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jle 0x3342d
movq -0x20(%rbp), %rax
movq %rax, -0x350(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq $-0x1, %rcx
callq 0xfaf0
movq %rax, %rcx
movq -0x350(%rbp), %rax
movq %rcx, -0x318(%rbp)
movq %rdx, -0x310(%rbp)
movq -0x318(%rbp), %rcx
movq %rcx, (%rax)
movq -0x310(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x334d3
movq -0x10(%rbp), %rax
addq $0x1050, %rax           # imm = 0x1050
movq %rax, -0x358(%rbp)
movl $0x22, %edi
callq 0x33a80
movq %rax, %rcx
movq -0x358(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x320(%rbp)
movq -0x320(%rbp), %rax
cmpl $0x0, (%rax)
je 0x3347d
movq -0x320(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x3347f
jmp 0x334d3
movq -0x10(%rbp), %rax
movb $0x0, 0x19d8(%rax)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x360(%rbp)
movq -0x320(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xd620
movq -0x360(%rbp), %rdi
movq %rax, %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movb 0x19d8(%rax), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x10f90
testb $0x1, %al
jne 0x334d1
jmp 0x334d3
jmp 0x334d3
movl $0x5, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
nopw %cs:(%rax,%rax)