LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
addq $0x1050, %rax           # imm = 0x1050
movq %rax, -0x78(%rbp)
movl $0x2f, %edi
callq 0x33a80
movq %rax, %rcx
movq -0x78(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x321a0
movq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
leaq -0x50(%rbp), %rdi
movl $0x77, %r8d
movl $0x1, %r9d
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x36ca0
movq -0x70(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, (%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x28(%rbp), %rcx
movq -0x28(%rbp), %rax
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
movq 0x10(%rax), %rcx
movq 0x18(%rax), %r8
callq 0xf510
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x28(%rbp), %rax
movq -0x58(%rbp), %rcx
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x10900
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
addq $0x1, %rdi
callq 0xd4a0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x68(%rbp), %rsi
addq $0x1, %rsi
movq -0x60(%rbp), %rcx
leaq 0xa077(%rip), %rdx      # 0x456ac
movb $0x0, %al
callq 0xd250
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x68(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x60(%rbp), %rdi
callq 0xd090
movq -0x30(%rbp), %rax
movl $0x1, (%rax)
movq -0x8(%rbp), %rax
movl $0x2, 0x19dc(%rax)
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x3b6c7
callq 0xd700
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x3b6b9
movb $0x0, -0x1(%rbp)
jmp 0x3b6cb
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3b68c
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movb %r9b, %al
movq %rdx, -0x18(%rbp)
movq %rcx, -0x10(%rbp)
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
andb $0x1, %al
movb %al, -0x2d(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x28(%rbp), %r8
movq -0x28(%rbp), %r9
movb -0x2d(%rbp), %al
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %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
movl $0x5, %edi
callq 0xd4a0
movq %rax, -0x40(%rbp)
movl -0x2c(%rbp), %edi
movq -0x40(%rbp), %rsi
movl $0x5, %edx
leaq -0x38(%rbp), %rcx
callq 0x10000
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x28(%rbp), %r8
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %r9d
movq (%rax), %r10
movq %r10, (%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x10da0
testb $0x1, %al
jne 0x3b7b7
movb $0x0, -0x1(%rbp)
jmp 0x3b7bb
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpl $0x2, -0x8(%rbp)
je 0x3c330
cmpl $0x3, -0x8(%rbp)
je 0x3c330
movb $0x0, -0x1(%rbp)
jmp 0x3c3ee
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x30(%rcx), %rdx
movq %rdx, (%rax)
movq 0x38(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq (%rcx), %rdi
movq 0x8(%rcx), %rsi
movq (%rax), %rdx
movq 0x8(%rax), %rcx
callq 0xf690
testb $0x1, %al
jne 0x3c37e
jmp 0x3c3ba
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x8(%rax)
cmpl $0x3, -0x8(%rbp)
jne 0x3c3ea
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0xf6e0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rsi, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rcx
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x28(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
callq 0x116a0
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq 0x20(%rax), %rdx
movq 0x28(%rax), %rcx
callq 0xfec0
testb $0x1, %al
jne 0x3c497
movq -0x18(%rbp), %rdi
callq 0x11970
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpl $0x103, -0x8(%rbp)      # imm = 0x103
jne 0x3c55d
movq -0x10(%rbp), %rdi
callq 0x12ff0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x3c53b
movq -0x18(%rbp), %rax
movq %rax, -0x78(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0xea70
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x10190
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq 0xda70
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0xea70
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x3c601
cmpl $0x102, -0x8(%rbp)      # imm = 0x102
jne 0x3c5fd
movq -0x10(%rbp), %rdi
callq 0x130a0
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x80(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0xea70
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x10190
cmpq $0x0, -0x50(%rbp)
je 0x3c5de
movq -0x18(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq $0x0, -0x70(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rcx
callq 0xda70
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0xea70
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x3c601
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/main.c
// Function: int_strneq
static int int_strneq(int* a, int* b, size_t len){
     for(size_t i = 0; i < len; ++i){
          if(!*a) return false;
          if(!*b) return false;
          if(*a != *b) return false;
          a++;
          b++;
     }

     return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x3e763
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x3e714
movl $0x0, -0x4(%rbp)
jmp 0x3e76a
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x3e726
movl $0x0, -0x4(%rbp)
jmp 0x3e76a
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
je 0x3e73d
movl $0x0, -0x4(%rbp)
jmp 0x3e76a
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x3e6f8
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/main.c
// Function: build_mark_list
static void build_mark_list(CeBuffer_t* buffer, CeVimBufferData_t* buffer_data){
     ce_buffer_empty(buffer);
     char line[256];
     buffer_append_on_new_line(buffer, "reg point:\n");
     for(int64_t i = 0; i < CE_ASCII_PRINTABLE_CHARACTERS; i++){
          CePoint_t* point = buffer_data->marks + i;
          if(point->x == 0 && point->y == 0) continue;
          char reg = i + '!';
          snprintf(line, 256, "'%c' %" PRId64 ", %" PRId64 "\n", reg, point->x, point->y);
          buffer_append_on_new_line(buffer, line);
     }

     buffer->status = CE_BUFFER_STATUS_READONLY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xe920
movq -0x8(%rbp), %rdi
leaq 0x412e(%rip), %rsi      # 0x45ca5
callq 0x14fd0
movq $0x0, -0x118(%rbp)
cmpq $0x5f, -0x118(%rbp)
jge 0x41c39
movq -0x10(%rbp), %rax
movq -0x118(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x41bcb
movq -0x120(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x41bcb
jmp 0x41c22
movq -0x118(%rbp), %rax
addq $0x21, %rax
movb %al, -0x121(%rbp)
leaq -0x110(%rbp), %rdi
movsbl -0x121(%rbp), %ecx
movq -0x120(%rbp), %rax
movq (%rax), %r8
movq -0x120(%rbp), %rax
movq 0x8(%rax), %r9
movl $0x100, %esi            # imm = 0x100
leaq 0x40a6(%rip), %rdx      # 0x45cb1
movb $0x0, %al
callq 0xd250
movq -0x8(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x14fd0
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0x41b87
movq -0x8(%rbp), %rax
movl $0x2, 0x18(%rax)
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/main.c
// Function: build_jump_list
static void build_jump_list(CeBuffer_t* buffer, CeJumpList_t* jump_list){
     ce_buffer_empty(buffer);
     char line[256];
     int max_row_digits = -1;
     int max_col_digits = -1;
     for(int64_t i = 0; i < jump_list->count; i++){
          int digits = ce_count_digits(jump_list->destinations[i].point.x);
          if(digits > max_col_digits) max_col_digits = digits;
          digits = ce_count_digits(jump_list->destinations[i].point.y);
          if(digits > max_row_digits) max_row_digits = digits;
     }

     char format_string[128];
     snprintf(format_string, 128, "  %%%dld, %%%dld  %%s", max_col_digits, max_row_digits);
     for(int64_t i = 0; i < jump_list->count; i++){
          if(i == jump_list->current){
               format_string[0] = '*';
          }else{
               format_string[0] = ' ';
          }
          CeDestination_t* dest = jump_list->destinations + i;
          snprintf(line, 256, format_string, dest->point.x, dest->point.y, dest->filepath);
          buffer_append_on_new_line(buffer, line);
     }

     buffer->status = CE_BUFFER_STATUS_READONLY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xe920
movl $0xffffffff, -0x114(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x118(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x120(%rbp)
movq -0x120(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x4100(%rcx), %rax
jge 0x41d31
movq -0x10(%rbp), %rax
imulq $0x410, -0x120(%rbp), %rcx # imm = 0x410
addq %rcx, %rax
movq (%rax), %rdi
callq 0x128d0
movl %eax, -0x124(%rbp)
movl -0x124(%rbp), %eax
cmpl -0x118(%rbp), %eax
jle 0x41cdd
movl -0x124(%rbp), %eax
movl %eax, -0x118(%rbp)
movq -0x10(%rbp), %rax
imulq $0x410, -0x120(%rbp), %rcx # imm = 0x410
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x128d0
movl %eax, -0x124(%rbp)
movl -0x124(%rbp), %eax
cmpl -0x114(%rbp), %eax
jle 0x41d18
movl -0x124(%rbp), %eax
movl %eax, -0x114(%rbp)
jmp 0x41d1a
movq -0x120(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x120(%rbp)
jmp 0x41c8b
leaq -0x1b0(%rbp), %rdi
movl -0x118(%rbp), %ecx
movl -0x114(%rbp), %r8d
movl $0x80, %esi
leaq 0x3f6f(%rip), %rdx      # 0x45cc0
movb $0x0, %al
callq 0xd250
movq $0x0, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x4100(%rcx), %rax
jge 0x41e19
movq -0x1b8(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x4110(%rcx), %rax
jne 0x41d98
movb $0x2a, -0x1b0(%rbp)
jmp 0x41d9f
movb $0x20, -0x1b0(%rbp)
movq -0x10(%rbp), %rax
imulq $0x410, -0x1b8(%rbp), %rcx # imm = 0x410
addq %rcx, %rax
movq %rax, -0x1c0(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x1b0(%rbp), %rdx
movq -0x1c0(%rbp), %rax
movq (%rax), %rcx
movq -0x1c0(%rbp), %rax
movq 0x8(%rax), %r8
movq -0x1c0(%rbp), %r9
addq $0x10, %r9
movl $0x100, %esi            # imm = 0x100
movb $0x0, %al
callq 0xd250
movq -0x8(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x14fd0
movq -0x1b8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1b8(%rbp)
jmp 0x41d63
movq -0x8(%rbp), %rax
movl $0x2, 0x18(%rax)
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/tests/test_openmp.c
// Function: binomial_coefficient
static inline unsigned long binomial_coefficient(unsigned long n, unsigned long k)
{
    /* from http://blog.plover.com/math/choose.html */
    unsigned long r = 1;
    unsigned long d;
    if (k > n) {
        return 0;
    }
    for (d = 1; d <= k; d++) {
        r *= n--;
        r /= d;
    }
    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x1, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jbe 0x29c248
movq $0x0, -0x8(%rbp)
jmp 0x29c299
movq $0x1, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
ja 0x29c291
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x10(%rbp)
imulq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
xorl %edx, %edx
divq %rcx
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x29c250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/tests/test_openmp.c
// Function: k_combination2
static inline void k_combination2(unsigned long pos, unsigned long *a, unsigned long *b)
{
    double s;
    double i = floor(sqrt(2.0 * pos)) - 1.0;
    if (i <= 1.0) {
        i = 1.0;
    }
    s = i * (i - 1.0) / 2.0;
    while (pos - s >= i) {
        s += i;
        i += 1;
    }
    *a = (unsigned long)(pos - s);
    *b = (unsigned long)(i);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movaps 0xacfed5(%rip), %xmm0   # 0xd6c190
movq -0x8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0xacfed4(%rip), %xmm0   # 0xd6c1a0
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0xacfe95(%rip), %xmm0   # 0xd6c178
mulsd %xmm1, %xmm0
callq 0x29b0d0
callq 0x29b1f0
movsd 0xacfe77(%rip), %xmm1   # 0xd6c170
subsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0xacfe66(%rip), %xmm0   # 0xd6c170
ucomisd -0x28(%rbp), %xmm0
jb 0x29c31e
movsd 0xacfe57(%rip), %xmm0   # 0xd6c170
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
movsd 0xacfe40(%rip), %xmm2   # 0xd6c170
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd 0xacfe38(%rip), %xmm1   # 0xd6c178
divsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movaps 0xacfe40(%rip), %xmm1   # 0xd6c190
movq -0x8(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xacfe3f(%rip), %xmm1   # 0xd6c1a0
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
subsd -0x20(%rbp), %xmm0
ucomisd -0x28(%rbp), %xmm0
jb 0x29c39f
movsd -0x28(%rbp), %xmm0
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0xacfddd(%rip), %xmm0   # 0xd6c170
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x29c349
movaps 0xacfdea(%rip), %xmm1   # 0xd6c190
movq -0x8(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xacfde9(%rip), %xmm1   # 0xd6c1a0
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd -0x20(%rbp), %xmm1
subsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
movsd 0xacfd9a(%rip), %xmm2   # 0xd6c180
subsd %xmm2, %xmm0
cvttsd2si %xmm0, %rax
andq %rdx, %rax
orq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movsd -0x28(%rbp), %xmm0
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rax
cvttsd2si %xmm0, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
andq %rdx, %rax
orq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1070
cmpq $0x1ff, %rax            # imm = 0x1FF
ja 0x131f
movq -0x10(%rbp), %rdi
callq 0x1070
cmpq $0x0, %rax
jne 0x1328
movl $0x0, -0x4(%rbp)
jmp 0x138d
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x133d
movl $0x0, -0x4(%rbp)
jmp 0x138d
movq -0x10(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x10d0
movl %eax, -0xa4(%rbp)
xorl %eax, %eax
cmpl $-0x1, -0xa4(%rbp)
movb %al, -0xa5(%rbp)
je 0x137f
movl -0x88(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
sete %al
xorb $-0x1, %al
movb %al, -0xa5(%rbp)
movb -0xa5(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
leaq 0x4f7e(%rip), %rdi      # 0x66fd
callq 0x1810
leaq 0x49dd(%rip), %rdi      # 0x6168
leaq 0x49e6(%rip), %rsi      # 0x6178
callq 0x1100
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1060
leaq 0x49cf(%rip), %rdi      # 0x617a
leaq 0x49c6(%rip), %rsi      # 0x6178
callq 0x1100
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x4ae0(%rip), %rsi      # 0x62a6
leaq 0x49c0(%rip), %rdx      # 0x618d
movb $0x0, %al
callq 0x10c0
movq -0x10(%rbp), %rdi
callq 0x1060
leaq 0x49b0(%rip), %rdi      # 0x6194
leaq 0x49b8(%rip), %rsi      # 0x61a3
callq 0x1f10
leaq 0x49d5(%rip), %rdi      # 0x61cc
leaq 0x498f(%rip), %rsi      # 0x618d
callq 0x1f10
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x10(%rbp)
leaq 0x3f92(%rip), %rdi      # 0x6168
leaq 0x3fb5(%rip), %rsi      # 0x6192
callq 0x1100
movq %rax, -0x18(%rbp)
leaq 0x3ff8(%rip), %rdi      # 0x61e5
leaq 0x3f84(%rip), %rsi      # 0x6178
callq 0x1100
movq %rax, -0x20(%rbp)
leaq -0x220(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x200, %esi            # imm = 0x200
callq 0x10a0
cmpq $0x0, %rax
je 0x22a5
leaq -0x220(%rbp), %rdi
leaq 0x418a(%rip), %rsi      # 0x63b4
callq 0x1110
leaq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x10b0
cmpl $0x0, %eax
jne 0x2287
movq 0x6dad(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3f9f(%rip), %rsi      # 0x61f8
movb $0x0, %al
callq 0x10c0
movq -0x18(%rbp), %rdi
callq 0x1060
movq -0x20(%rbp), %rdi
callq 0x1060
leaq 0x3f6c(%rip), %rdi      # 0x61e5
callq 0x2300
movl $0x3, -0x4(%rbp)
jmp 0x22e7
movq -0x20(%rbp), %rdi
leaq -0x220(%rbp), %rdx
leaq 0x400d(%rip), %rsi      # 0x62a6
movb $0x0, %al
callq 0x10c0
jmp 0x21fd
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3ff2(%rip), %rsi      # 0x62a6
movb $0x0, %al
callq 0x10c0
movq -0x18(%rbp), %rdi
callq 0x1060
movq -0x20(%rbp), %rdi
callq 0x1060
leaq 0x3f11(%rip), %rdi      # 0x61e5
leaq 0x3e8d(%rip), %rsi      # 0x6168
callq 0x29f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x10(%rbp)
leaq 0x2bf2(%rip), %rdi      # 0x6168
leaq 0x2c15(%rip), %rsi      # 0x6192
callq 0x1100
movq %rax, -0x18(%rbp)
leaq 0x2c58(%rip), %rdi      # 0x61e5
leaq 0x2be4(%rip), %rsi      # 0x6178
callq 0x1100
movq %rax, -0x20(%rbp)
movl $0x0, -0x224(%rbp)
leaq -0x220(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x200, %esi            # imm = 0x200
callq 0x10a0
cmpq $0x0, %rax
je 0x3611
leaq -0x220(%rbp), %rdi
leaq 0x2de4(%rip), %rsi      # 0x63b4
callq 0x1110
leaq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x10b0
cmpl $0x0, %eax
je 0x3605
movq -0x20(%rbp), %rdi
leaq -0x220(%rbp), %rdx
leaq 0x2caa(%rip), %rsi      # 0x62a6
movb $0x0, %al
callq 0x10c0
jmp 0x360f
movl $0x5, -0x224(%rbp)
jmp 0x35a7
cmpl $0x5, -0x224(%rbp)
jne 0x3648
movq -0x18(%rbp), %rdi
callq 0x1060
movq -0x20(%rbp), %rdi
callq 0x1060
leaq 0x2bb2(%rip), %rdi      # 0x61e5
leaq 0x2b2e(%rip), %rsi      # 0x6168
callq 0x29f0
movl $0x0, -0x4(%rbp)
jmp 0x367d
movq 0x59a9(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x2bb9(%rip), %rsi      # 0x6216
movb $0x0, %al
callq 0x10c0
movq -0x18(%rbp), %rdi
callq 0x1060
movq -0x20(%rbp), %rdi
callq 0x1060
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x3722
movq 0x5a12(%rip), %rax      # 0x90d0
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movq -0x10(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x36ea
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3711
cmpl $0x0, -0x14(%rbp)
je 0x36ff
cmpl $0x0, -0x18(%rbp)
je 0x36ff
movl $0x0, -0x18(%rbp)
jmp 0x370f
movl $0x0, -0x18(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3711
cmpl $0x9, -0x18(%rbp)
jne 0x3720
movl $0x5, -0x4(%rbp)
jmp 0x3729
jmp 0x36a6
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/MicBrain[P]Git-Sample/beargit.c
// Function: next_commit_id_hw1
void next_commit_id_hw1(char* commit_id) {
  char* final = commit_id;
  int checker = 1;
  while (*commit_id != '\0') {
    switch(*commit_id) {
      case '0':
        if (checker == 0)
          *commit_id = 'c';
        else if (checker == 1) {
          *commit_id = '6';
          checker = 0;
        }
        break;
      case 'c':
        if (checker == 0)
          *commit_id = 'c';
        else if (checker == 1) {
          *commit_id = '6';
          checker = 0;
        }
        break;
      case '1':
        if (checker == 0)
          *commit_id = '1';
        else if (checker == 1) {
          *commit_id = '6';
          checker = 0;
        }
        break;
      case '6':
        if (checker == 0)
          *commit_id = '6';
        else if (checker == 1) {
          *commit_id = 'c';
          checker = 1;
        }
        break;
      default: 
        break;
    }
    commit_id++;
  }
  commit_id = final;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x383c
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x18(%rbp)
subl $0x30, %eax
je 0x378d
jmp 0x3768
movl -0x18(%rbp), %eax
subl $0x31, %eax
je 0x37db
jmp 0x3772
movl -0x18(%rbp), %eax
subl $0x36, %eax
je 0x3802
jmp 0x3780
movl -0x18(%rbp), %eax
subl $0x63, %eax
je 0x37b4
jmp 0x3829
cmpl $0x0, -0x14(%rbp)
jne 0x379c
movq -0x8(%rbp), %rax
movb $0x63, (%rax)
jmp 0x37b2
cmpl $0x1, -0x14(%rbp)
jne 0x37b0
movq -0x8(%rbp), %rax
movb $0x36, (%rax)
movl $0x0, -0x14(%rbp)
jmp 0x37b2
jmp 0x382b
cmpl $0x0, -0x14(%rbp)
jne 0x37c3
movq -0x8(%rbp), %rax
movb $0x63, (%rax)
jmp 0x37d9
cmpl $0x1, -0x14(%rbp)
jne 0x37d7
movq -0x8(%rbp), %rax
movb $0x36, (%rax)
movl $0x0, -0x14(%rbp)
jmp 0x37d9
jmp 0x382b
cmpl $0x0, -0x14(%rbp)
jne 0x37ea
movq -0x8(%rbp), %rax
movb $0x31, (%rax)
jmp 0x3800
cmpl $0x1, -0x14(%rbp)
jne 0x37fe
movq -0x8(%rbp), %rax
movb $0x36, (%rax)
movl $0x0, -0x14(%rbp)
jmp 0x3800
jmp 0x382b
cmpl $0x0, -0x14(%rbp)
jne 0x3811
movq -0x8(%rbp), %rax
movb $0x36, (%rax)
jmp 0x3827
cmpl $0x1, -0x14(%rbp)
jne 0x3825
movq -0x8(%rbp), %rax
movb $0x63, (%rax)
movl $0x1, -0x14(%rbp)
jmp 0x3827
jmp 0x382b
jmp 0x382b
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x3747
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x90(%rbp), %rsi
leaq 0x24ef(%rip), %rdi      # 0x61cc
movl $0x80, %edx
callq 0x3a30
leaq -0x90(%rbp), %rdi
callq 0x4cc0
movl %eax, -0x94(%rbp)
movl $0x0, -0x98(%rbp)
cmpl $0xa, -0x98(%rbp)
jge 0x3d68
movq 0x53c5(%rip), %rax      # 0x90d8
movq %rax, -0xa0(%rbp)
movl -0x94(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movq -0xa0(%rbp), %rax
movslq %edx, %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movslq -0x98(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x94(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, -0x94(%rbp)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x3d03
movq -0x8(%rbp), %rdi
addq $0xa, %rdi
callq 0x3730
addq $0xa0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x220, %rsp            # imm = 0x220
leaq 0x17f6(%rip), %rdi      # 0x6168
leaq 0x1819(%rip), %rsi      # 0x6192
callq 0x1100
movq %rax, -0x8(%rbp)
movl $0x0, -0x214(%rbp)
movq 0x4645(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq 0x1909(%rip), %rsi      # 0x62a6
leaq 0x18c4(%rip), %rdx      # 0x6268
movb $0x0, %al
callq 0x10c0
leaq -0x210(%rbp), %rdi
movq -0x8(%rbp), %rdx
movl $0x200, %esi            # imm = 0x200
callq 0x10a0
cmpq $0x0, %rax
je 0x4a39
movl -0x214(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x214(%rbp)
leaq -0x210(%rbp), %rdi
leaq 0x19d1(%rip), %rsi      # 0x63b4
callq 0x1110
leaq 0x19c5(%rip), %rdi      # 0x63b4
movb $0x0, %al
callq 0x1080
movq 0x45db(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq 0x1719(%rip), %rsi      # 0x6120
leaq 0x1869(%rip), %rdx      # 0x6277
movb $0x0, %al
callq 0x10c0
movq 0x45bc(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq -0x210(%rbp), %rdx
leaq 0x16f3(%rip), %rsi      # 0x6120
movb $0x0, %al
callq 0x10c0
jmp 0x49ab
movq 0x4598(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq 0x1969(%rip), %rsi      # 0x63b3
movb $0x0, %al
callq 0x10c0
movq 0x4580(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
movl -0x214(%rbp), %edx
leaq 0x1812(%rip), %rsi      # 0x627a
movb $0x0, %al
callq 0x10c0
movq 0x4562(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq 0x16a0(%rip), %rsi      # 0x6120
leaq 0x17f1(%rip), %rdx      # 0x6278
movb $0x0, %al
callq 0x10c0
movq 0x4543(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq 0x1807(%rip), %rsi      # 0x62a6
leaq 0x17d7(%rip), %rdx      # 0x627d
movb $0x0, %al
callq 0x10c0
movq -0x8(%rbp), %rdi
callq 0x1060
xorl %eax, %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x110, %rsp            # imm = 0x110
movl $0x0, -0x34(%rbp)
movl $0xa, -0x38(%rbp)
leaq -0x30(%rbp), %rsi
leaq 0x16a0(%rip), %rdi      # 0x6194
movl $0x29, %edx
callq 0x3a30
leaq -0x30(%rbp), %rdi
leaq 0x169a(%rip), %rsi      # 0x61a3
callq 0x10b0
cmpl $0x0, %eax
je 0x4bd9
movq 0x44ba(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq -0x30(%rbp), %rdx
leaq 0x175d(%rip), %rsi      # 0x6289
movb $0x0, %al
callq 0x10c0
movl $0x32, -0x38(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x30(%rbp), %rcx
leaq 0x1748(%rip), %rsi      # 0x6294
leaq 0x170b(%rip), %rdx      # 0x625e
leaq 0x1741(%rip), %r8       # 0x629b
movb $0x0, %al
callq 0x1150
leaq -0xa0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
movl $0x78, %edx
callq 0x3a30
movq 0x4458(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq -0xa0(%rbp), %rdx
leaq 0x1710(%rip), %rsi      # 0x62a1
movb $0x0, %al
callq 0x10c0
leaq -0x110(%rbp), %rdi
leaq -0x30(%rbp), %rcx
leaq 0x16ea(%rip), %rsi      # 0x6294
leaq 0x16ad(%rip), %rdx      # 0x625e
leaq 0x15e4(%rip), %r8       # 0x619c
movb $0x0, %al
callq 0x1150
leaq -0x110(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x29, %edx
callq 0x3a30
jmp 0x4afe
cmpl $0xa, -0x38(%rbp)
jne 0x4c00
movq 0x4412(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x16ba(%rip), %rsi      # 0x62aa
movb $0x0, %al
callq 0x10c0
movl $0x1, -0x4(%rbp)
jmp 0x4c25
cmpl $0x32, -0x38(%rbp)
jne 0x4c1e
movq 0x43cb(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq 0x179d(%rip), %rsi      # 0x63b4
movb $0x0, %al
callq 0x10c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x90(%rbp), %rsi
leaq 0x156f(%rip), %rdi      # 0x61cc
movl $0x80, %edx
callq 0x3a30
leaq -0x90(%rbp), %rdi
callq 0x1070
cmpq $0x0, %rax
jne 0x4c9a
movq 0x4378(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x163e(%rip), %rsi      # 0x62c8
movb $0x0, %al
callq 0x10c0
movl $0x1, -0x4(%rbp)
jmp 0x4ca6
movq -0x10(%rbp), %rdi
callq 0x3850
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x8(%rbp)
leaq 0x14a4(%rip), %rdi      # 0x617a
leaq 0x14b5(%rip), %rsi      # 0x6192
callq 0x1100
movq %rax, -0x10(%rbp)
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x18(%rbp)
leaq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x200, %esi            # imm = 0x200
callq 0x10a0
cmpq $0x0, %rax
je 0x4d48
leaq -0x220(%rbp), %rdi
leaq 0x1697(%rip), %rsi      # 0x63b4
callq 0x1110
leaq -0x220(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x10b0
cmpl $0x0, %eax
jne 0x4d3d
movl -0x18(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4cf4
movq -0x10(%rbp), %rdi
callq 0x1060
movl -0x14(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/MicBrain[P]Git-Sample/beargit.c
// Function: beargit_branch
int beargit_branch() {
  char current_branch[BRANCHNAME_SIZE];
  read_string_from_file(".beargit/.current_branch", current_branch, BRANCHNAME_SIZE);
  FILE* findex = fopen(".beargit/.branches", "r");
  char line[BRANCHNAME_SIZE];
  while (fgets(line, sizeof(line), findex)) {
    strtok(line, "\n");
    if (strcmp(line, current_branch) != 0) {
      fprintf(stdout, "%s", "  ");
      fprintf(stdout, "%s\n", line);
    } else {
      fprintf(stdout, "%s", "* ");
      fprintf(stdout, "%s\n", line);
    }
  }
  fclose(findex);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
leaq -0x80(%rbp), %rsi
leaq 0x1456(%rip), %rdi      # 0x61cc
movl $0x80, %edx
callq 0x3a30
leaq 0x13f3(%rip), %rdi      # 0x617a
leaq 0x1404(%rip), %rsi      # 0x6192
callq 0x1100
movq %rax, -0x88(%rbp)
leaq -0x110(%rbp), %rdi
movq -0x88(%rbp), %rdx
movl $0x80, %esi
callq 0x10a0
cmpq $0x0, %rax
je 0x4e67
leaq -0x110(%rbp), %rdi
leaq 0x15ea(%rip), %rsi      # 0x63b4
callq 0x1110
leaq -0x110(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x10b0
cmpl $0x0, %eax
je 0x4e24
movq 0x41ed(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq 0x132b(%rip), %rsi      # 0x6120
leaq 0x147b(%rip), %rdx      # 0x6277
movb $0x0, %al
callq 0x10c0
movq 0x41ce(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq -0x110(%rbp), %rdx
leaq 0x148b(%rip), %rsi      # 0x62a6
movb $0x0, %al
callq 0x10c0
jmp 0x4e62
movq 0x41ad(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq 0x12eb(%rip), %rsi      # 0x6120
leaq 0x14c1(%rip), %rdx      # 0x62fd
movb $0x0, %al
callq 0x10c0
movq 0x418e(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq -0x110(%rbp), %rdx
leaq 0x144b(%rip), %rsi      # 0x62a6
movb $0x0, %al
callq 0x10c0
jmp 0x4d9a
movq -0x88(%rbp), %rdi
callq 0x1060
xorl %eax, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/MicBrain[P]Git-Sample/beargit.c
// Function: checkout_commit
int checkout_commit(const char* commit_id) {
  if (strcmp(commit_id, "0000000000000000000000000000000000000000") == 0) {
    write_string_to_file(".beargit/.index", "");
  } else {
    FILE* findex = fopen(".beargit/.index", "r");
    char line[BRANCHNAME_SIZE];
    while(fgets(line, sizeof(line), findex)) {
      strtok(line, "\n");
      fs_rm(line);
    }
    fclose(findex);
    char init_loc[150];
    sprintf(init_loc, "%s%s%s", ".beargit/", commit_id, "/.index");
    FILE* last = fopen(init_loc, "r");
    char new_line[BRANCHNAME_SIZE];
    while(fgets(new_line, sizeof(new_line), last)) {
      strtok(new_line, "\n");
      char final_place[200];
      sprintf(final_place, ".beargit/%s/%s", commit_id, new_line);
      fs_cp(final_place, new_line);
    }
    fs_cp(init_loc, ".beargit/.index");
    fclose(last);
  }
  write_string_to_file(".beargit/.prev", commit_id);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x1309(%rip), %rsi      # 0x61a3
callq 0x10b0
cmpl $0x0, %eax
jne 0x4ebc
leaq 0x12bd(%rip), %rdi      # 0x6168
leaq 0x1503(%rip), %rsi      # 0x63b5
callq 0x1f10
jmp 0x4fde
leaq 0x12a5(%rip), %rdi      # 0x6168
leaq 0x12c8(%rip), %rsi      # 0x6192
callq 0x1100
movq %rax, -0x10(%rbp)
leaq -0x90(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x80, %esi
callq 0x10a0
cmpq $0x0, %rax
je 0x4f0f
leaq -0x90(%rbp), %rdi
leaq 0x14b8(%rip), %rsi      # 0x63b4
callq 0x1110
leaq -0x90(%rbp), %rdi
callq 0x2300
jmp 0x4ed3
movq -0x10(%rbp), %rdi
callq 0x1060
leaq -0x130(%rbp), %rdi
movq -0x8(%rbp), %rcx
leaq 0x136a(%rip), %rsi      # 0x6294
leaq 0x132d(%rip), %rdx      # 0x625e
leaq 0x1238(%rip), %r8       # 0x6170
movb $0x0, %al
callq 0x1150
leaq -0x130(%rbp), %rdi
leaq 0x1245(%rip), %rsi      # 0x6192
callq 0x1100
movq %rax, -0x138(%rbp)
leaq -0x1c0(%rbp), %rdi
movq -0x138(%rbp), %rdx
movl $0x80, %esi
callq 0x10a0
cmpq $0x0, %rax
je 0x4fbf
leaq -0x1c0(%rbp), %rdi
leaq 0x142f(%rip), %rsi      # 0x63b4
callq 0x1110
leaq -0x290(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq -0x1c0(%rbp), %rcx
leaq 0x135d(%rip), %rsi      # 0x6300
movb $0x0, %al
callq 0x1150
leaq -0x290(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x3d80
jmp 0x4f59
leaq -0x130(%rbp), %rdi
leaq 0x119b(%rip), %rsi      # 0x6168
callq 0x3d80
movq -0x138(%rbp), %rdi
callq 0x1060
movq -0x8(%rbp), %rsi
leaq 0x11ab(%rip), %rdi      # 0x6194
callq 0x1f10
xorl %eax, %eax
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/MicBrain[P]Git-Sample/beargit.c
// Function: is_it_a_commit_id
int is_it_a_commit_id(const char* commit_id) {
  if (strlen(commit_id) != 40) {
    return 0;
  } else {
    while (*commit_id !='\0') {
      if (*commit_id != '6' && *commit_id != '1' && *commit_id != 'c') {
        return 0;
      }
      commit_id++;
    }
    return 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1070
cmpq $0x28, %rax
je 0x5024
movl $0x0, -0x4(%rbp)
jmp 0x5074
jmp 0x5026
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x506d
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x36, %eax
je 0x505f
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x31, %eax
je 0x505f
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x63, %eax
je 0x505f
movl $0x0, -0x4(%rbp)
jmp 0x5074
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x5026
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/MicBrain[P]Git-Sample/util.c
// Function: fake_print
int fake_print(char* fmt, ...) {
    // append to file
    char data[2048]; // if your line is longer than this, you're doing something wrong
    va_list args;
    va_start(args, fmt);
    vsprintf(data, fmt, args);
    va_end(args);
    FILE *fp = fopen(file_stdout, "a");
    if (fp != NULL) {
        fputs(data, fp);
        fclose(fp);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x8f0, %rsp            # imm = 0x8F0
testb %al, %al
je 0x53a7
movaps %xmm0, -0x8c0(%rbp)
movaps %xmm1, -0x8b0(%rbp)
movaps %xmm2, -0x8a0(%rbp)
movaps %xmm3, -0x890(%rbp)
movaps %xmm4, -0x880(%rbp)
movaps %xmm5, -0x870(%rbp)
movaps %xmm6, -0x860(%rbp)
movaps %xmm7, -0x850(%rbp)
movq %r9, -0x8c8(%rbp)
movq %r8, -0x8d0(%rbp)
movq %rcx, -0x8d8(%rbp)
movq %rdx, -0x8e0(%rbp)
movq %rsi, -0x8e8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0x830(%rbp), %rax
leaq -0x8f0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
leaq -0x810(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq -0x830(%rbp), %rdx
callq 0x10f0
leaq -0x830(%rbp), %rax
movq 0x3cee(%rip), %rdi      # 0x9108
leaq 0xf68(%rip), %rsi       # 0x6389
callq 0x1100
movq %rax, -0x838(%rbp)
cmpq $0x0, -0x838(%rbp)
je 0x5456
leaq -0x810(%rbp), %rdi
movq -0x838(%rbp), %rsi
callq 0x1090
movq -0x838(%rbp), %rdi
callq 0x1060
xorl %eax, %eax
addq $0x8f0, %rsp            # imm = 0x8F0
popq %rbp
retq
nopw %cs:(%rax,%rax)