LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: ce_vim_verb_open_above
bool ce_vim_verb_open_above(CeVim_t* vim, const CeVimAction_t* action, CeRange_t motion_range, CeView_t* view,
                            CePoint_t* cursor, CeVimVisualData_t* visual, CeVimBufferData_t* buffer_data,
                            const CeConfigOptions_t* config_options){
     // insert newline on next line
     char* insert_string = strdup("\n");
     motion_range.start.x = 0;

     if(!ce_buffer_insert_string_change(view->buffer, insert_string, motion_range.start, cursor, *cursor,
                                        false)){
          return false;
     }

     // TODO: compress what we can with open_below
     // calc indentation
     CePoint_t indentation_point = {0, motion_range.start.y};
     CePoint_t cursor_end = {0, indentation_point.y};
     int64_t indentation = ce_vim_get_indentation(view->buffer, indentation_point, config_options->tab_width);
     if(indentation > 0){
          cursor_end.x = indentation;

          // build indentation string
          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;
          }
     }else{
          *cursor = cursor_end;
     }

     vim->chain_undo = true;
     ce_vim_insert_mode(vim);
     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rdi, %rbx
leaq 0x73e8(%rip), %rdi      # 0x2fef5
callq 0xd640
movq $0x0, 0x60(%rsp)
movq 0x40(%r12), %rdi
movq 0x68(%rsp), %r15
movups (%r14), %xmm0
movups %xmm0, (%rsp)
xorl %r13d, %r13d
movq %rax, %rsi
xorl %edx, %edx
movq %r15, %rcx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xfa43
testb %al, %al
je 0x28c03
movq 0x80(%rsp), %rax
movq $0x0, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq 0x40(%r12), %rdi
movq 0x8(%rax), %rcx
xorl %esi, %esi
movq %r15, %rdx
callq 0x24e16
testq %rax, %rax
jle 0x28bd2
movq %rax, %r13
movq %rax, 0x18(%rsp)
movq %rax, %rdi
incq %rdi
callq 0xd4c0
movq %rax, %rbp
movq %rax, %rdi
movl $0x20, %esi
movq %r13, %rdx
callq 0xd2a0
movb $0x0, (%rbp,%r13)
movq 0x40(%r12), %rdi
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
xorl %r13d, %r13d
movq %rbp, %rsi
xorl %edx, %edx
movq %r15, %rcx
movq %r14, %r8
movl $0x1, %r9d
callq 0xfa43
testb %al, %al
jne 0x28bdb
jmp 0x28c03
movups 0x18(%rsp), %xmm0
movups %xmm0, (%r14)
movb $0x1, 0x19d8(%rbx)
movl $0x1, (%rbx)
movb $0x1, %r13b
cmpb $0x0, 0x19d9(%rbx)
jne 0x28c03
addq $0x19c8, %rbx           # imm = 0x19C8
movq %rbx, %rdi
callq 0x10370
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: ce_vim_verb_open_below
bool ce_vim_verb_open_below(CeVim_t* vim, const CeVimAction_t* action, CeRange_t motion_range, CeView_t* view,
                            CePoint_t* cursor, CeVimVisualData_t* visual, CeVimBufferData_t* buffer_data,
                            const CeConfigOptions_t* config_options){
     // insert newline at the end of the current line
     char* insert_string = strdup("\n");
     motion_range.start.x = ce_utf8_strlen(view->buffer->lines[motion_range.start.y]);
     if(!ce_buffer_insert_string_change(view->buffer, insert_string, motion_range.start, cursor, *cursor, false)){
          return false;
     }

     // calc indentation
     CePoint_t indentation_point = {0, motion_range.start.y + 1};
     int64_t indentation = ce_vim_get_indentation(view->buffer, indentation_point, config_options->tab_width);
     CePoint_t cursor_end = {0, indentation_point.y};
     if(indentation > 0){
          cursor_end.x = indentation;

          // build indentation string
          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;
          }
     }else{
          *cursor = cursor_end;
     }

     vim->chain_undo = true;
     ce_vim_insert_mode(vim);
     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rdi, %rbx
leaq 0x72c2(%rip), %rdi      # 0x2fef5
callq 0xd640
movq %rax, %rbp
movq 0x40(%r12), %rax
movq (%rax), %rax
movq 0x68(%rsp), %r15
movq (%rax,%r15,8), %rdi
callq 0xe485
movq %rax, 0x60(%rsp)
movq 0x40(%r12), %rdi
movups (%r14), %xmm0
movups %xmm0, (%rsp)
xorl %r13d, %r13d
movq %rbp, %rsi
movq %rax, %rdx
movq %r15, %rcx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xfa43
testb %al, %al
je 0x28d45
movq 0x80(%rsp), %rax
incq %r15
movq 0x40(%r12), %rdi
movq 0x8(%rax), %rcx
xorl %esi, %esi
movq %r15, %rdx
callq 0x24e16
movq $0x0, 0x18(%rsp)
movq %r15, 0x20(%rsp)
testq %rax, %rax
jle 0x28d0c
movq %rax, %r13
movq %rax, 0x18(%rsp)
movq %rax, %rdi
incq %rdi
callq 0xd4c0
movq %rax, %rbp
movq %rax, %rdi
movl $0x20, %esi
movq %r13, %rdx
callq 0xd2a0
movb $0x0, (%rbp,%r13)
movq 0x40(%r12), %rdi
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
xorl %r13d, %r13d
movq %rbp, %rsi
xorl %edx, %edx
movq %r15, %rcx
movq %r14, %r8
movl $0x1, %r9d
callq 0xfa43
testb %al, %al
jne 0x28d1d
jmp 0x28d45
movq 0x18(%rsp), %rax
movq %rax, (%r14)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%r14)
movb $0x1, 0x19d8(%rbx)
movl $0x1, (%rbx)
movb $0x1, %r13b
cmpb $0x0, 0x19d9(%rbx)
jne 0x28d45
addq $0x19c8, %rbx           # imm = 0x19C8
movq %rbx, %rdi
callq 0x10370
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: ce_vim_verb_join
bool ce_vim_verb_join(CeVim_t* vim, const CeVimAction_t* action, CeRange_t motion_range, CeView_t* view,
                      CePoint_t* cursor, CeVimVisualData_t* visual, CeVimBufferData_t* buffer_data,
                      const CeConfigOptions_t* config_options){
     if(cursor->y < 0) return false;
     if(cursor->y >= (view->buffer->line_count - 1)) return false;

     // delete up to the soft beginning of the line
     CePoint_t beginning_of_next_line = {0, cursor->y + 1};
     int64_t whitespace_len = ce_vim_soft_begin_line(view->buffer, beginning_of_next_line.y);
     if(whitespace_len > 0){
          ce_buffer_remove_string_change(view->buffer, beginning_of_next_line, whitespace_len, cursor, *cursor, false);
     }

     bool insert_space = (strlen(view->buffer->lines[cursor->y + 1]) > 0);
     CePoint_t point = {ce_utf8_strlen(view->buffer->lines[cursor->y]), cursor->y};
     ce_vim_join_next_line(view->buffer, cursor->y, *cursor, true);

     if(insert_space){
          char* space_str = strdup(" ");
          CePoint_t end_cursor = (CePoint_t){point.x + 1, point.y};
          ce_buffer_insert_string_change(view->buffer, space_str, point, cursor, end_cursor, true);
     }

     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x8(%rcx), %r15
testq %r15, %r15
js 0x28e57
movq %rdx, %r14
movq 0x40(%rdx), %rdi
movq 0x8(%rdi), %rax
decq %rax
cmpq %rax, %r15
jge 0x28e57
movq %rcx, %rbx
incq %r15
movq %r15, %rsi
callq 0x260e5
testq %rax, %rax
jle 0x28dd2
movq 0x40(%r14), %rdi
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
xorl %esi, %esi
movq %r15, %rdx
movq %rax, %rcx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0xfc21
movq 0x40(%r14), %rax
movq (%rax), %rax
movq 0x8(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x8(%rax,%rcx,8), %rax
movb (%rax), %r13b
callq 0xe485
movq %rax, %r15
movq (%rbx), %rdx
movq 0x8(%rbx), %r12
movq 0x40(%r14), %rdi
movq %r12, %rsi
movq %r12, %rcx
movl $0x1, %r8d
callq 0x2504c
movb $0x1, %bpl
testb %r13b, %r13b
je 0x28e59
leaq 0x793d(%rip), %rdi      # 0x30759
callq 0xd640
movq %r15, %rcx
incq %rcx
movq %rcx, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movq 0x40(%r14), %rdi
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %rbx, %r8
movl $0x1, %r9d
callq 0xfa43
jmp 0x28e59
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: ce_vim_verb_last_action
bool ce_vim_verb_last_action(CeVim_t* vim, const CeVimAction_t* action, CeRange_t motion_range, CeView_t* view,
                             CePoint_t* cursor, CeVimVisualData_t* visual, CeVimBufferData_t* buffer_data,
                             const CeConfigOptions_t* config_options){
     CeBufferChangeNode_t* change_node = view->buffer->change_node;

     vim->verb_last_action = true;
     assert(vim->last_action.verb.function != ce_vim_verb_last_action);
     if(!ce_vim_apply_action(vim, &vim->last_action, view, cursor, visual, buffer_data, config_options)){
          vim->verb_last_action = false;
          return false;
     }

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

          while(*itr){
               ce_vim_handle_key(vim, view, cursor, visual, *itr, buffer_data, config_options);
               itr++;
          }

          free(rune_string);
     }

     if(change_node && change_node->next) change_node->next->change.chain = false;

     vim->verb_last_action = false;
     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x40(%rdx), %rax
movq 0x40(%rax), %rbp
movb $0x1, 0x19d9(%rdi)
leaq -0x24(%rip), %rax       # 0x28e6a
cmpq %rax, 0x1960(%rdi)
je 0x28f8d
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %rbx
movq 0x80(%rsp), %rax
leaq 0x1938(%rdi), %rsi
movq %rax, (%rsp)
callq 0x256ea
testb %al, %al
je 0x28f77
movq 0x19d0(%rbx), %rdi
testq %rdi, %rdi
je 0x28f66
movb %al, 0xf(%rsp)
movq %rbp, 0x18(%rsp)
callq 0x10317
movq %rax, 0x10(%rsp)
movl (%rax), %r8d
testl %r8d, %r8d
movq 0x80(%rsp), %rax
je 0x28f53
movq 0x10(%rsp), %rbp
addq $0x4, %rbp
movq %rbx, 0x20(%rsp)
movq %rax, (%rsp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r9
movq %r13, %rbx
movq %r12, %r13
movq %r15, %r12
movq %r14, %r15
movq %rax, %r14
callq 0x25194
movq %r14, %rax
movq %r15, %r14
movq %r12, %r15
movq %r13, %r12
movq %rbx, %r13
movq 0x20(%rsp), %rbx
movl (%rbp), %r8d
addq $0x4, %rbp
testl %r8d, %r8d
jne 0x28f0b
movq 0x10(%rsp), %rdi
callq 0xd090
movq 0x18(%rsp), %rbp
movb 0xf(%rsp), %al
testq %rbp, %rbp
je 0x28f77
movq 0x40(%rbp), %rcx
testq %rcx, %rcx
je 0x28f77
movb $0x0, (%rcx)
movb $0x0, 0x19d9(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8356(%rip), %rdi      # 0x312ea
leaq 0x827c(%rip), %rsi      # 0x31217
leaq 0x8382(%rip), %rcx      # 0x31324
movl $0xcf8, %edx            # imm = 0xCF8
callq 0xd280
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: ce_vim_verb_z_command
bool ce_vim_verb_z_command(CeVim_t* vim, const CeVimAction_t* action, CeRange_t motion_range, CeView_t* view,
                           CePoint_t* cursor, CeVimVisualData_t* visual, CeVimBufferData_t* buffer_data,
                           const CeConfigOptions_t* config_options){
     switch(action->verb.integer){
     default:
          break;
     case 'z':
     {
          ce_view_center(view);
     } break;
     case 'b':
     {
          ce_view_scroll_to(view, (CePoint_t){0, cursor->y - view->rect.bottom + config_options->vertical_scroll_off});
     } break;
     case 't':
     {
          ce_view_scroll_to(view, (CePoint_t){0, cursor->y - config_options->vertical_scroll_off});
     } break;
     }

     return false;
}

// Assembly:
pushq %rax
movq 0x30(%rsp), %rdi
movl 0x30(%rsi), %eax
cmpl $0x62, %eax
je 0x28fd8
cmpl $0x74, %eax
je 0x28fce
cmpl $0x7a, %eax
jne 0x28ff1
movq %rdx, %rdi
callq 0x100c2
jmp 0x28ff1
movq 0x8(%rcx), %rax
subq 0x18(%rdi), %rax
jmp 0x28fe4
movq 0x8(%rcx), %rax
subq 0x18(%rdx), %rax
addq 0x18(%rdi), %rax
movq %rdx, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x1009e
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: ce_vim_verb_g_command
bool ce_vim_verb_g_command(CeVim_t* vim, const CeVimAction_t* action, CeRange_t motion_range, CeView_t* view,
                           CePoint_t* cursor, CeVimVisualData_t* visual, CeVimBufferData_t* buffer_data,
                           const CeConfigOptions_t* config_options){
     if(action->multiplier > 1){
          if(action->multiplier > view->buffer->line_count) return false;
          cursor->y = action->multiplier - 1;
          cursor->x = ce_vim_soft_begin_line(view->buffer, cursor->y);
          ce_view_follow_cursor(view, config_options->horizontal_scroll_off,
                                config_options->vertical_scroll_off,
                                config_options->tab_width);
          return true;
     }

     switch(action->verb.integer){
     default:
          break;
     case 'g':
          motion_range.end = (CePoint_t){0, 0};
          return ce_vim_verb_motion(vim, action, motion_range, view, cursor, visual, buffer_data, config_options);
     case 'v':
          visual->point = *cursor;
          vim->mode = CE_VIM_MODE_VISUAL_BLOCK;
          return true;
     }

     return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq (%rsi), %rax
cmpq $0x2, %rax
jl 0x29044
movq 0x40(%rbx), %rdi
cmpq 0x8(%rdi), %rax
jg 0x29076
movq 0x70(%rsp), %r15
decq %rax
movq %rax, 0x8(%r14)
movq %rax, %rsi
callq 0x260e5
movq %rax, (%r14)
movq 0x8(%r15), %rcx
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdx
movq %rbx, %rdi
callq 0xff34
jmp 0x29088
movl 0x30(%rsi), %eax
cmpl $0x76, %eax
je 0x2907a
cmpl $0x67, %eax
jne 0x29076
leaq 0x50(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdx
movq %r14, %rcx
callq 0x25c31
jmp 0x29088
xorl %eax, %eax
jmp 0x2908a
movups (%r14), %xmm0
movups %xmm0, (%r8)
movl $0x4, (%rdi)
movb $0x1, %al
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: ce_vim_verb_set_paste_clipboard_to_highlighted
bool ce_vim_verb_set_paste_clipboard_to_highlighted(CeVim_t* vim, const CeVimAction_t* action, CeRange_t motion_range, CeView_t* view,
                                                    CePoint_t* cursor, CeVimVisualData_t* visual, CeVimBufferData_t* buffer_data,
                                                    const CeConfigOptions_t* config_options){
     CePoint_t highlight_start = {};
     CePoint_t highlight_end = {};
     if(!ce_vim_get_selection_range(vim->mode, visual, view, &highlight_start, &highlight_end)){
          return false;
     }
     return ce_set_clipboard_from_buffer(view->buffer, highlight_start, highlight_end);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %r8, %rsi
movq %rdx, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rcx
movaps %xmm0, (%rcx)
movq %rsp, %r8
movaps %xmm0, (%r8)
movl (%rdi), %edi
callq 0x2a02d
testb %al, %al
je 0x29622
movq 0x40(%rbx), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq (%rsp), %rcx
movq 0x8(%rsp), %r8
addq $0x20, %rsp
popq %rbx
jmp 0x1507b
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: motion_direction
static CeVimMotionResult_t motion_direction(const CeView_t* view, CePoint_t delta, const CeConfigOptions_t* config_options,
                                            CeRange_t* motion_range){
     CePoint_t destination = ce_buffer_move_point(view->buffer, motion_range->end, delta, config_options->tab_width, CE_CLAMP_X_INSIDE);
     if(destination.x < 0) return CE_VIM_MOTION_RESULT_FAIL;
     motion_range->end = destination;
     return CE_VIM_MOTION_RESULT_SUCCESS;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movq %rdx, %r8
movq %rsi, %rax
movq 0x40(%rdi), %rdi
movq 0x8(%rcx), %r9
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movl $0x2, (%rsp)
movq %rax, %rcx
callq 0xee2d
testq %rax, %rax
js 0x2966b
movq %rax, 0x10(%rbx)
movq %rdx, 0x18(%rbx)
movl $0x1, %eax
jmp 0x2966d
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: vim_motion_find
static CeVimMotionResult_t vim_motion_find(CeVim_t* vim, CeVimAction_t* action, const CeView_t* view, const CeConfigOptions_t* config_options,
                                           CeRange_t* motion_range, bool inside){
     CePoint_t start = motion_range->start;
     int multiplier = (action->multiplier * action->motion.multiplier) - 1;
     CeRange_t new_range = ce_vim_find_pair(view->buffer, motion_range->end, action->motion.integer, inside, multiplier);
     if(new_range.start.x < 0) return CE_VIM_MOTION_RESULT_FAIL;
     if(ce_points_equal(start, new_range.end)){
          action->exclude_end = true;
     }
     *motion_range = new_range;
     return CE_VIM_MOTION_RESULT_SUCCESS_NO_MULTIPLY;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %ecx, %r9d
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdx), %r15
movq 0x8(%rdx), %r12
movl 0x8(%rdi), %eax
imull (%rdi), %eax
decl %eax
movq 0x40(%rsi), %rsi
movl 0x18(%rdi), %r8d
movq 0x10(%rdx), %rdx
movq 0x18(%rbx), %rcx
movl %eax, (%rsp)
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x27173
cmpq $0x0, (%r13)
js 0x296f5
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq %r15, %rdi
movq %r12, %rsi
callq 0xf1d6
testb %al, %al
je 0x296dd
movb $0x1, 0x3e(%r14)
movups 0x10(%rsp), %xmm0
movups 0x20(%rsp), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movl $0x2, %eax
jmp 0x296f7
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: search_word
static void search_word(CeVim_t* vim, CeVimAction_t* action, const CeView_t* view, const CePoint_t* cursor, CeRange_t* motion_range){
     CeVimYank_t* yank = vim->yanks + ce_vim_register_index('/');
     ce_vim_yank_free(yank);
     *motion_range = ce_vim_find_pair(view->buffer, *cursor, 'w', true, 0);
     int64_t word_len = ce_buffer_range_len(view->buffer, motion_range->start, motion_range->end);
     char* word = ce_buffer_dupe_string(view->buffer, motion_range->start, word_len);
     int64_t search_len = word_len + 4;
     yank->text = malloc(search_len + 1);
     snprintf(yank->text, search_len + 1, "\\b%s\\b", word); // TODO: this doesn't work on other platforms like macos
     yank->text[search_len] = 0;
     free(word);
     yank->type = CE_VIM_YANK_TYPE_STRING;
     vim->search_mode = CE_VIM_SEARCH_MODE_REGEX_FORWARD;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
addq $0x11b8, %rdi           # imm = 0x11B8
callq 0x243a6
movq 0x40(%r15), %rsi
movq (%r12), %rdx
movq 0x8(%r12), %rcx
movl $0x0, (%rsp)
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movl $0x77, %r8d
movl $0x1, %r9d
callq 0x27173
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movq 0x40(%r15), %rdi
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rcx
movq 0x18(%r14), %r8
callq 0xecb5
movq %rax, %r12
movq 0x40(%r15), %rdi
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rax, %rcx
callq 0xf79a
movq %rax, %r14
leaq 0x5(%r12), %r15
movq %r15, %rdi
callq 0xd4c0
movq %rax, 0x11c0(%rbx)
leaq 0x7c18(%rip), %rdx      # 0x313cd
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0xd260
movq 0x11c0(%rbx), %rax
movb $0x0, 0x4(%rax,%r12)
movq %r14, %rdi
callq 0xd090
movl $0x1, 0x11b8(%rbx)
movl $0x2, 0x19dc(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: string_is_blank
static bool string_is_blank(const char* string){
     while(*string){
          if(!isblank((int)(*string))) return false;
          string++;
     }
     return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movsbq (%rdi), %r14
testq %r14, %r14
sete %bpl
je 0x29836
movq %rdi, %rbx
callq 0xd720
movq (%rax), %rax
testb $0x1, (%rax,%r14,2)
je 0x29836
incq %rbx
movsbq (%rbx), %rcx
testq %rcx, %rcx
sete %bpl
je 0x29836
incq %rbx
testb $0x1, (%rax,%rcx,2)
jne 0x29820
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: change_character
static bool change_character(CeView_t* view, CePoint_t* cursor, CePoint_t point, CeRune_t new_rune, bool chain_undo){
     int64_t rune_len = 0;

     // delete current rune
     ce_buffer_remove_string_change(view->buffer, point, 1, cursor, *cursor, chain_undo);

     // insert new rune
     char* current_string = malloc(5);
     ce_utf8_encode(new_rune, current_string, 5, &rune_len);
     current_string[rune_len] = 0;

     if(!ce_buffer_insert_string_change(view->buffer, current_string, point,
                                        cursor, *cursor, true)){
          return false;
     }

     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
leaq 0x10(%rsp), %rax
movq $0x0, (%rax)
movq 0x40(%rdi), %rdi
movups (%rsi), %xmm0
movups %xmm0, (%rsp)
movl $0x1, %ecx
movq %rdx, %rsi
movq %rbx, %rdx
movq %r14, %r8
callq 0xfc21
movl $0x5, %edi
callq 0xd4c0
movq %rax, %r13
movl $0x5, %edx
movl %ebp, %edi
movq %rax, %rsi
leaq 0x10(%rsp), %rbp
movq %rbp, %rcx
callq 0xf298
movq (%rbp), %rax
movb $0x0, (%r13,%rax)
movq 0x40(%r12), %rdi
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movq %r14, %r8
movl $0x1, %r9d
callq 0xfa43
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: ce_vim_get_selection_range
bool ce_vim_get_selection_range(CeVimMode_t vim_mode, CeVimVisualData_t* visual, CeView_t* view,
                                CePoint_t* highlight_start, CePoint_t* highlight_end){
     if(vim_mode != CE_VIM_MODE_VISUAL &&
        vim_mode != CE_VIM_MODE_VISUAL_LINE){
         return false;
     }

     *highlight_start = visual->point;
     *highlight_end = view->cursor;
     if(ce_point_after(*highlight_start, *highlight_end)){
         CePoint_t tmp = *highlight_start;
         *highlight_start = *highlight_end;
         *highlight_end = tmp;
     }

     if(vim_mode == CE_VIM_MODE_VISUAL_LINE){
         highlight_start->x = 0;
         highlight_end->x = ce_buffer_line_len(view->buffer, highlight_end->y);
     }
     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edi, %r12d
andl $-0x2, %r12d
cmpl $0x2, %r12d
jne 0x2a0a8
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r14
movl %edi, %ebp
movups (%rsi), %xmm0
movups %xmm0, (%rcx)
movups 0x30(%rdx), %xmm0
movups %xmm0, (%r8)
movq (%rcx), %rdi
movq 0x8(%rcx), %rsi
movq (%r8), %rdx
movq 0x8(%r8), %rcx
callq 0xedfb
testb %al, %al
je 0x2a08c
movups (%r15), %xmm0
movaps %xmm0, (%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%r15)
movaps (%rsp), %xmm0
movups %xmm0, (%rbx)
cmpl $0x3, %ebp
jne 0x2a0a8
movq $0x0, (%r15)
movq 0x40(%r14), %rdi
movq 0x8(%rbx), %rsi
callq 0xee0e
movq %rax, (%rbx)
cmpl $0x2, %r12d
sete %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/main.c
// Function: scroll_to_and_center_if_offscreen
void scroll_to_and_center_if_offscreen(CeView_t* view, CePoint_t point, CeConfigOptions_t* config_options){
     view->cursor = point;
     CePoint_t before_follow = view->scroll;
     ce_view_follow_cursor(view, config_options->horizontal_scroll_off,
                           config_options->vertical_scroll_off, config_options->tab_width);
     if(!ce_points_equal(before_follow, view->scroll)){
          ce_view_center(view);
     }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq %rsi, 0x30(%rdi)
movq %rdx, 0x38(%rdi)
movq 0x20(%rdi), %r14
movq 0x28(%rdi), %r15
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rsi
movq 0x18(%rcx), %rdx
movq %rax, %rcx
callq 0xff34
movq 0x20(%rbx), %rdx
movq 0x28(%rbx), %rcx
movq %r14, %rdi
movq %r15, %rsi
callq 0xf1d6
testb %al, %al
je 0x2a106
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x100c2
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/main.c
// Function: handle_input_history_key
bool handle_input_history_key(int key, CeHistory_t* history, CeBuffer_t* input_buffer, CePoint_t* cursor){
     if(key == KEY_UP_ARROW){
          char* prev = ce_history_previous(history);
          if(prev){
               ce_buffer_remove_string(input_buffer, (CePoint_t){0, 0}, ce_utf8_strlen(input_buffer->lines[0]));
               ce_buffer_insert_string(input_buffer, prev, (CePoint_t){0, 0});
          }
          cursor->x = ce_utf8_strlen(input_buffer->lines[0]);
          return true;
     }

     if(key == KEY_DOWN_ARROW){
          char* next = ce_history_next(history);
          ce_buffer_remove_string(input_buffer, (CePoint_t){0, 0}, ce_utf8_strlen(input_buffer->lines[0]));
          if(next){
               ce_buffer_insert_string(input_buffer, next, (CePoint_t){0, 0});
          }
          cursor->x = ce_utf8_strlen(input_buffer->lines[0]);
          return true;
     }

     return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
cmpl $0x102, %edi            # imm = 0x102
je 0x2a15a
cmpl $0x103, %edi            # imm = 0x103
jne 0x2a1a5
movq %rsi, %rdi
callq 0x10c62
testq %rax, %rax
je 0x2a193
movq %rax, %r15
movq (%r14), %rax
movq (%rax), %rdi
callq 0xe485
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %rax, %rcx
callq 0xf36b
jmp 0x2a184
movq %rsi, %rdi
callq 0x10cae
movq %rax, %r15
movq (%r14), %rax
movq (%rax), %rdi
callq 0xe485
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %rax, %rcx
callq 0xf36b
testq %r15, %r15
je 0x2a193
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xda6e
movq (%r14), %rax
movq (%rax), %rdi
callq 0xe485
movq %rax, (%rbx)
movb $0x1, %al
jmp 0x2a1a7
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/main.c
// Function: check_filename
int check_filename(const char* filename) {
  if (strlen(filename) > FILENAME_SIZE-1 || strlen(filename) == 0)
    return 0;

  if (filename[0] == '.')
    return 0;

  struct stat s;
  int ret_code = stat(filename, &s);
  return (ret_code != -1 && !(S_ISDIR(s.st_mode)));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
callq 0x1080
movq %rax, %rcx
addq $-0x200, %rcx           # imm = 0xFE00
xorl %eax, %eax
cmpq $-0x1ff, %rcx           # imm = 0xFE01
jb 0x28e5
cmpb $0x2e, (%rbx)
je 0x28e5
leaq -0xa0(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10e0
cmpl $-0x1, %eax
setne %al
movl 0x18(%r14), %ecx
andl $0xf000, %ecx           # imm = 0xF000
cmpl $0x4000, %ecx           # imm = 0x4000
setne %cl
andb %al, %cl
movzbl %cl, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/beargit.c
// Function: beargit_init
int beargit_init(void) {
  fs_mkdir(".beargit");
  FILE* findex = fopen(".beargit/.index", "w");
  fclose(findex);
  FILE* fbranches = fopen(".beargit/.branches", "w");
  fprintf(fbranches, "%s\n", "master");
  fclose(fbranches);
  write_string_to_file(".beargit/.prev", "0000000000000000000000000000000000000000");
  write_string_to_file(".beargit/.current_branch", "master");
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x1a5a(%rip), %rdi      # 0x46f8
callq 0x2d1f
leaq 0x14be(%rip), %rdi      # 0x4168
leaq 0x14c7(%rip), %rbx      # 0x4178
movq %rbx, %rsi
callq 0x1120
movq %rax, %rdi
callq 0x1070
leaq 0x14b2(%rip), %rdi      # 0x417a
movq %rbx, %rsi
callq 0x1120
movq %rax, %rbx
leaq 0x15cc(%rip), %rsi      # 0x42a6
leaq 0x14ac(%rip), %r14      # 0x418d
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10d0
movq %rbx, %rdi
callq 0x1070
leaq 0x1497(%rip), %rdi      # 0x4194
leaq 0x149f(%rip), %rsi      # 0x41a3
callq 0x2d63
leaq 0x14bc(%rip), %rdi      # 0x41cc
movq %r14, %rsi
callq 0x2d63
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/./util.h
// Function: fs_mkdir
static void fs_mkdir(const char* dirname) {
  ASSERT_ERROR_MESSAGE(dirname != NULL, "dirname is not a valid string");
  ASSERT_ERROR_MESSAGE(is_sane_path(dirname), "dirname is not a valid path within .beargit");
  int ret = mkdir(dirname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
  ASSERT_ERROR_MESSAGE(ret == 0, "creating directory failed");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2d4e
movq %rdi, %rbx
callq 0x3ee4
testl %eax, %eax
je 0x2d53
movq %rbx, %rdi
movl $0x1fd, %esi            # imm = 0x1FD
callq 0x1050
testl %eax, %eax
jne 0x2d5b
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x1567
movq %rbx, %rdi
callq 0x142a
movq %rbx, %rdi
callq 0x12ed
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/./util.h
// Function: write_string_to_file
static void write_string_to_file(const char* filename, const char* str) {
  FILE* fout = fopen(filename, "w");
  ASSERT_ERROR_MESSAGE(fout != NULL, "couldn't open file");
  fwrite(str, 1, strlen(str)+1, fout);
  fclose(fout);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x13fe(%rip), %rsi      # 0x4178
callq 0x1120
testq %rax, %rax
je 0x2db5
movq %rax, %r14
movq %rbx, %rdi
callq 0x1080
leaq 0x1(%rax), %rdx
movl $0x1, %esi
movq %rbx, %rdi
movq %r14, %rcx
callq 0x1190
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1070
movq %r15, %rdi
callq 0x1669
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/beargit.c
// Function: beargit_add
int beargit_add(const char* filename) {
  FILE* findex = fopen(".beargit/.index", "r");
  FILE *fnewindex = fopen(".beargit/.newindex", "w");
  char line[FILENAME_SIZE];
  while(fgets(line, sizeof(line), findex)) {
    strtok(line, "\n");
    if (strcmp(line, filename) == 0) {
      fprintf(stderr, "ERROR: File %s already added\n", filename);
      fclose(findex);
      fclose(fnewindex);
      fs_rm(".beargit/.newindex");
      return 3;
    }
    fprintf(fnewindex, "%s\n", line);
  }
  fprintf(fnewindex, "%s\n", filename);
  fclose(findex);
  fclose(fnewindex);
  fs_mv(".beargit/.newindex", ".beargit/.index");
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
leaq 0x138d(%rip), %rdi      # 0x4168
leaq 0x13b0(%rip), %rsi      # 0x4192
callq 0x1120
movq %rax, %r14
leaq 0x13f4(%rip), %rdi      # 0x41e5
leaq 0x1380(%rip), %rsi      # 0x4178
callq 0x1120
movq %rax, %r15
leaq -0x230(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdx
callq 0x10b0
testq %rax, %rax
je 0x2e6a
leaq -0x230(%rbp), %r13
leaq 0x147f(%rip), %r12      # 0x42a6
movq %r13, %rdi
leaq 0x1583(%rip), %rsi      # 0x43b4
callq 0x1130
movq %r13, %rdi
movq %rbx, %rsi
callq 0x10c0
testl %eax, %eax
je 0x2eab
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x10d0
movq %r13, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdx
callq 0x10b0
testq %rax, %rax
jne 0x2e27
leaq 0x1435(%rip), %rsi      # 0x42a6
xorl %r12d, %r12d
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
callq 0x1070
movq %r15, %rdi
callq 0x1070
callq 0x2f00
movl %r12d, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x17a6
movl $0x3, %r12d
jmp 0x2e96
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/./util.h
// Function: fs_rm
static void fs_rm(const char* filename) {
  ASSERT_ERROR_MESSAGE(filename != NULL, "filename is not a valid string");
  ASSERT_ERROR_MESSAGE(is_sane_path(filename), "filename is not a valid path within .beargit");
  int ret = unlink(filename);
  ASSERT_ERROR_MESSAGE(ret == 0, "deleting/unlinking file failed");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2eeb
movq %rdi, %rbx
callq 0x3ee4
testl %eax, %eax
je 0x2ef0
movq %rbx, %rdi
callq 0x1040
testl %eax, %eax
jne 0x2ef8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x1a69
movq %rbx, %rdi
callq 0x192c
movq %rbx, %rdi
callq 0x17ef
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/./util.h
// Function: fs_mv
static void fs_mv(const char* src, const char* dst) {
  ASSERT_ERROR_MESSAGE(src != NULL, "src is not a valid string");
  ASSERT_ERROR_MESSAGE(dst != NULL, "dst is not a valid string");
  ASSERT_ERROR_MESSAGE(is_sane_path(src), "src is not a valid path within .beargit");
  ASSERT_ERROR_MESSAGE(is_sane_path(dst), "dst is not a valid path within .beargit");
  int ret = rename(src, dst);
  ASSERT_ERROR_MESSAGE(ret == 0, "renaming file failed");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x12da(%rip), %rdi      # 0x41e5
callq 0x3ee4
testl %eax, %eax
je 0x2f3d
leaq 0x124d(%rip), %rdi      # 0x4168
callq 0x3ee4
testl %eax, %eax
je 0x2f42
leaq 0x12ba(%rip), %rdi      # 0x41e5
leaq 0x1236(%rip), %rsi      # 0x4168
callq 0x1140
testl %eax, %eax
jne 0x2f47
popq %rbp
retq
callq 0x1e15
callq 0x1cc0
callq 0x1b6b
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/beargit.c
// Function: beargit_rm
int beargit_rm(const char* filename) {
 FILE* findex = fopen(".beargit/.index", "r");
 FILE *fnewindex = fopen(".beargit/.newindex", "w");
 char line[FILENAME_SIZE];
 int checker;
 checker = 0;
 while(fgets(line, sizeof(line), findex)) {
  strtok(line, "\n");
  if (strcmp(line, filename) != 0) {
    fprintf(fnewindex, "%s\n", line);
  } else {
    checker = 5;
  }
}
if (checker == 5) {
  fclose(findex);
  fclose(fnewindex);
  fs_mv(".beargit/.newindex", ".beargit/.index");
  return 0;
} else {
    fprintf(stderr, "ERROR: File %s not tracked\n", filename);
    fclose(findex);
    fclose(fnewindex);
    return 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
leaq 0x11fe(%rip), %rdi      # 0x4168
leaq 0x1221(%rip), %rsi      # 0x4192
callq 0x1120
movq %rax, %r14
leaq 0x1265(%rip), %rdi      # 0x41e5
leaq 0x11f1(%rip), %rsi      # 0x4178
callq 0x1120
movq %rax, -0x30(%rbp)
leaq -0x230(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdx
callq 0x10b0
testq %rax, %rax
je 0x303a
leaq 0x1400(%rip), %r12      # 0x43b4
leaq -0x230(%rbp), %r13
xorl %r15d, %r15d
movq %r13, %rdi
movq %r12, %rsi
callq 0x1130
movq %r13, %rdi
movq %rbx, %rsi
callq 0x10c0
testl %eax, %eax
je 0x2fef
movq -0x30(%rbp), %rdi
leaq 0x12c3(%rip), %rsi      # 0x42a6
movq %r13, %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x2ff5
movl $0x5, %r15d
movq %r13, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdx
callq 0x10b0
testq %rax, %rax
jne 0x2fbe
cmpl $0x5, %r15d
jne 0x303a
movq %r14, %rdi
callq 0x1070
movq -0x30(%rbp), %rdi
callq 0x1070
callq 0x2f00
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3fb7(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x11cb(%rip), %rsi      # 0x4216
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
callq 0x1070
movq -0x30(%rbp), %rdi
callq 0x1070
movl $0x1, %eax
jmp 0x3028
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/beargit.c
// Function: is_commit_msg_ok
int is_commit_msg_ok(const char* msg) {
  int pointMSG = 0, pointConst = 0;
  while (msg[pointMSG] != '\0') {
    if (go_bears[pointConst] == msg[pointMSG]) {
      pointConst ++;
      pointMSG ++;
    } else {
      if (pointMSG != 0 && pointConst != 0)
        pointConst = 0;
     else {
        pointConst = 0;
        pointMSG++;
      }
    }
    if (pointConst == 9) 
      return 5;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
movq 0x4066(%rip), %rcx      # 0x70e0
xorl %edx, %edx
xorl %esi, %esi
movl %edx, %r8d
movb (%rdi,%r8), %r8b
testb %r8b, %r8b
je 0x30bf
movslq %esi, %r9
cmpb %r8b, (%rcx,%r9)
jne 0x309d
incl %esi
movl $0x1, %r8d
jmp 0x30b2
testl %edx, %edx
sete %r8b
testl %esi, %esi
sete %sil
orb %r8b, %sil
movzbl %sil, %r8d
xorl %esi, %esi
addl %r8d, %edx
cmpl $0x9, %esi
jne 0x307e
movl $0x5, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/./util.h
// Function: read_string_from_file
static void read_string_from_file(const char* filename, char* str, int size) {
  FILE* fin = fopen(filename, "r");
  ASSERT_ERROR_MESSAGE(fin != NULL, "couldn't open file");
  fread(str, 1, size, fin);
  fclose(fin);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r12
leaq 0xe8f(%rip), %rsi       # 0x4192
callq 0x1120
testq %rax, %rax
je 0x3333
movq %rax, %r14
movl %r15d, %edx
movl $0x1, %esi
movq %rbx, %rdi
movq %rax, %rcx
callq 0x1060
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1070
movq %r12, %rdi
callq 0x1f8e
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/beargit.c
// Function: next_commit_id
void next_commit_id(char* commit_id) {
  char current_branch[BRANCHNAME_SIZE];
  read_string_from_file(".beargit/.current_branch", current_branch, BRANCHNAME_SIZE);
  int n = get_branch_number(current_branch);
  for (int i = 0; i < COMMIT_ID_BRANCH_BYTES; i++) {
    commit_id[i] = digits[n%3];
    n /= 3;
  }
  next_commit_id_hw1(commit_id + COMMIT_ID_BRANCH_BYTES);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq 0xe79(%rip), %rdi       # 0x41cc
leaq -0x90(%rbp), %r14
movq %r14, %rsi
movl $0x80, %edx
callq 0x32e8
movq %r14, %rdi
callq 0x3797
xorl %ecx, %ecx
movq 0x3d70(%rip), %rdx      # 0x70e8
movslq %eax, %rsi
imulq $0x55555556, %rsi, %rax # imm = 0x55555556
movq %rax, %rdi
shrq $0x3f, %rdi
shrq $0x20, %rax
addl %edi, %eax
leal (%rax,%rax,2), %edi
subl %edi, %esi
movslq %esi, %rsi
movb (%rdx,%rsi), %dl
movb %dl, (%rbx,%rcx)
incq %rcx
cmpq $0xa, %rcx
jne 0x3371
addq $0xa, %rbx
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x30c1
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/./util.h
// Function: fs_cp
static void fs_cp(const char* src, const char* dst) {
  ASSERT_ERROR_MESSAGE(src != NULL, "src is not a valid string");
  ASSERT_ERROR_MESSAGE(dst != NULL, "dst is not a valid string");
  ASSERT_ERROR_MESSAGE(is_sane_path(dst), "dst is not a valid path within .beargit");

  FILE* fin = fopen(src, "r");
  ASSERT_ERROR_MESSAGE(fin != NULL, "couldn't open source file");
  FILE* fout = fopen(dst, "w");
  ASSERT_ERROR_MESSAGE(fout != NULL, "couldn't open destination file");

  char buffer[4096];
  int size;

  while ((size = fread(buffer, 1, 4096, fin)) > 0) {
    fwrite(buffer, 1, size, fout);
  }

  fclose(fin);
  fclose(fout);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
testq %rdi, %rdi
je 0x34a1
movq %rsi, %r15
movq %rdi, %r12
testq %rsi, %rsi
je 0x34a6
movq %r15, %rdi
callq 0x3ee4
testl %eax, %eax
je 0x34ae
leaq 0xd94(%rip), %rsi       # 0x4192
movq %r12, %rdi
callq 0x1120
testq %rax, %rax
je 0x34b9
movq %rax, %rbx
leaq 0xd5f(%rip), %rsi       # 0x4178
movq %r15, %rdi
callq 0x1120
testq %rax, %rax
je 0x34c4
movq %rax, %r14
leaq -0x1020(%rbp), %rdi
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rcx
callq 0x1060
testl %eax, %eax
jle 0x3482
leaq -0x1020(%rbp), %r15
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %esi
movq %r15, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0x1190
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1060
testl %eax, %eax
jg 0x3451
movq %rbx, %rdi
callq 0x1070
movq %r14, %rdi
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1070
callq 0x25f1
movq %r12, %rdi
callq 0x24cd
movq %r12, %rdi
movq %r15, %rsi
callq 0x2377
movq %r12, %rdi
movq %r15, %rsi
callq 0x2221
movq %r12, %rdi
movq %r15, %rsi
callq 0x20cb
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/beargit.c
// Function: beargit_status
int beargit_status() {
  FILE* findex = fopen(".beargit/.index", "r");
  char line[FILENAME_SIZE];
  int counter = 0;
  fprintf(stdout, "%s\n", "Tracked files:");
  while (fgets(line, sizeof(line), findex)) {
    counter++;
    strtok(line, "\n");
    printf("\n");
    fprintf(stdout, "%s", "  ");
    fprintf(stdout, "%s", line);
  }
  fprintf(stdout, "\n\n");
  fprintf(stdout, "%d", counter);
  fprintf(stdout, "%s", " ");
  fprintf(stdout, "%s\n", "files total");
  fclose(findex);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
leaq 0xc7e(%rip), %rdi       # 0x4168
leaq 0xca1(%rip), %rsi       # 0x4192
callq 0x1120
movq %rax, %rbx
movq 0x3ad8(%rip), %r15      # 0x6fd8
movq (%r15), %rdi
leaq 0xd9c(%rip), %rsi       # 0x42a6
leaq 0xd57(%rip), %rdx       # 0x4268
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x10d0
leaq -0x230(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdx
callq 0x10b0
testq %rax, %rax
je 0x358c
xorl %r14d, %r14d
leaq -0x230(%rbp), %r12
leaq 0xd32(%rip), %r13       # 0x4277
incl %r14d
movq %r12, %rdi
leaq 0xe62(%rip), %rsi       # 0x43b4
callq 0x1130
movl $0xa, %edi
callq 0x1030
movq (%r15), %rsi
movq %r13, %rdi
callq 0x1090
movq (%r15), %rsi
movq %r12, %rdi
callq 0x1090
movq %r12, %rdi
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdx
callq 0x10b0
testq %rax, %rax
jne 0x3545
movq (%r15), %rcx
leaq 0xe1d(%rip), %rdi       # 0x43b3
movl $0x2, %esi
movl $0x1, %edx
callq 0x1190
movq (%r15), %rdi
leaq 0xccb(%rip), %rsi       # 0x427a
movl %r14d, %edx
xorl %eax, %eax
callq 0x10d0
movq (%r15), %rsi
leaq 0xcb5(%rip), %rdi       # 0x4278
callq 0x1090
movq (%r15), %rdi
leaq 0xcd4(%rip), %rsi       # 0x42a6
leaq 0xca4(%rip), %rdx       # 0x427d
xorl %eax, %eax
callq 0x10d0
movq %rbx, %rdi
callq 0x1070
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/beargit.c
// Function: beargit_log
int beargit_log() {
  char last_commit[COMMIT_ID_SIZE]; 
  int index = 0;
  int checker = 10; 
  read_string_from_file(".beargit/.prev", last_commit, COMMIT_ID_SIZE);
  while (strcmp(last_commit, "0000000000000000000000000000000000000000") != 0) {
    char content[100];
    fprintf(stdout, "\ncommit %s", last_commit);
    checker = 50;
    sprintf(content, "%s%s%s", ".beargit/", last_commit, "/.msg");
    read_string_from_file(content, content, 120);
    char lastSource[100];
    fprintf(stdout, "\n    %s\n", content);
    sprintf(lastSource, "%s%s%s", ".beargit/", last_commit,  "/.prev");
    read_string_from_file(lastSource, last_commit, COMMIT_ID_SIZE);
  }
  if (checker == 10) {
    fprintf(stderr, "ERROR: There are no commits!\n");
    return 1;
  }
  if (checker == 50)
    fprintf(stdout, "\n");
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
leaq 0xb7d(%rip), %rdi       # 0x4194
leaq -0x60(%rbp), %rbx
movq %rbx, %rsi
movl $0x29, %edx
callq 0x32e8
leaq 0xb74(%rip), %rsi       # 0x41a3
movl $0x29, %edx
movq %rbx, %rdi
callq 0x1100
testl %eax, %eax
je 0x3730
movl %eax, -0x2c(%rbp)
movq 0x398a(%rip), %r12      # 0x6fd8
leaq -0x60(%rbp), %r15
movq (%r12), %rdi
leaq 0xc2c(%rip), %rsi       # 0x4289
movq %r15, %rdx
xorl %eax, %eax
callq 0x10d0
leaq -0x140(%rbp), %r14
movq %r14, %rdi
leaq 0xc1c(%rip), %r13       # 0x4294
movq %r13, %rsi
leaq 0xbdc(%rip), %rbx       # 0x425e
movq %rbx, %rdx
movq %r15, %rcx
leaq 0xc0c(%rip), %r8        # 0x429b
xorl %eax, %eax
callq 0x1170
movq %r14, %rdi
movq %r14, %rsi
movl $0x78, %edx
callq 0x32e8
movq (%r12), %rdi
leaq 0xbf0(%rip), %rsi       # 0x42a1
movq %r14, %rdx
xorl %eax, %eax
callq 0x10d0
leaq -0xd0(%rbp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
leaq 0xac7(%rip), %r8        # 0x419c
xorl %eax, %eax
callq 0x1170
movq %r14, %rdi
movq %r15, %rsi
movl $0x29, %edx
callq 0x32e8
movl $0x29, %edx
movq %r15, %rdi
leaq 0xaa8(%rip), %rsi       # 0x41a3
callq 0x1100
testl %eax, %eax
jne 0x3652
cmpl $0x0, -0x2c(%rbp)
je 0x3730
movq (%r12), %rsi
movl $0xa, %edi
callq 0x10a0
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x26f3
movl $0x1, %eax
jmp 0x371e
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/beargit.c
// Function: beargit_commit
int beargit_commit(const char* msg) {
  char current_branch[BRANCHNAME_SIZE];
  read_string_from_file(".beargit/.current_branch", current_branch, BRANCHNAME_SIZE);
  if (strlen(current_branch) == 0) {
    fprintf(stderr, "ERROR: Need to be on HEAD of a branch to commit\n");
    return 1;
  }
  return beargit_commit_hw1(msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq 0xa78(%rip), %rdi       # 0x41cc
leaq -0x90(%rbp), %r14
movq %r14, %rsi
movl $0x80, %edx
callq 0x32e8
cmpb $0x0, (%r14)
je 0x3781
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x3127
callq 0x2715
movl $0x1, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MicBrain[P]Git-Sample/beargit.c
// Function: get_branch_number
int get_branch_number(const char* branch_name) {
  FILE* fbranches = fopen(".beargit/.branches", "r");
  int branch_index = -1;
  int counter = 0;
  char line[FILENAME_SIZE];
  while(fgets(line, sizeof(line), fbranches)) {
    strtok(line, "\n");
    if (strcmp(line, branch_name) == 0) {
      branch_index = counter;
    }
    counter++;
  }
  fclose(fbranches);
  return branch_index;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
leaq 0x9c5(%rip), %rdi       # 0x417a
leaq 0x9d6(%rip), %rsi       # 0x4192
callq 0x1120
movq %rax, %r14
leaq -0x230(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
movq %rax, %rdx
callq 0x10b0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x3825
xorl %r12d, %r12d
leaq -0x230(%rbp), %r13
movq %r13, %rdi
leaq 0xbbd(%rip), %rsi       # 0x43b4
callq 0x1130
movq %r13, %rdi
movq %rbx, %rsi
callq 0x10c0
testl %eax, %eax
cmovel %r12d, %r15d
incl %r12d
movq %r13, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdx
callq 0x10b0
testq %rax, %rax
jne 0x37ed
movq %r14, %rdi
callq 0x1070
movl %r15d, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq