LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_buffer_remove_string_change
bool ce_buffer_remove_string_change(CeBuffer_t* buffer, CePoint_t point, int64_t remove_len, CePoint_t* cursor_before,
                                    CePoint_t cursor_after, bool chain_undo){
     char* remove_string = ce_buffer_dupe_string(buffer, point, remove_len);
     if(!ce_buffer_remove_string(buffer, point, remove_len)){
          free(remove_string);
          return false;
     }

     CeBufferChange_t change = {};
     change.chain = chain_undo;
     change.insertion = false;
     change.string = remove_string;
     change.location = point;
     change.cursor_before = *cursor_before;
     change.cursor_after = cursor_after;
     ce_buffer_change(buffer, &change);

     *cursor_before = cursor_after;
     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, 0x4(%rsp)
movq %r8, %rbx
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
callq 0xf361
movq %rax, %r12
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rbp, %rcx
callq 0xef3b
movl %eax, %ebp
testb %al, %al
je 0xf802
leaq 0x80(%rsp), %rcx
leaq 0x8(%rsp), %rsi
andq $0x0, (%rsi)
movl 0x4(%rsp), %eax
movb %al, (%rsi)
movq %r12, 0x8(%rsi)
movq %r13, 0x10(%rsi)
movq %r15, 0x18(%rsi)
movups (%rbx), %xmm0
movups %xmm0, 0x20(%rsi)
movq %rcx, %r15
movups (%rcx), %xmm0
movups %xmm0, 0x30(%rsi)
movq %r14, %rdi
callq 0xf64d
movups (%r15), %xmm0
movups %xmm0, (%rbx)
jmp 0xf80a
movq %r12, %rdi
callq 0xd090
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_buffer_undo
bool ce_buffer_undo(CeBuffer_t* buffer, CePoint_t* cursor){
     // nothing to undo
     if(!buffer->change_node) return true;
     if(!buffer->change_node->prev) return true;

     CeBufferChange_t* change = &buffer->change_node->change;
     if(change->insertion){
          ce_buffer_remove_string(buffer, change->location, ce_utf8_strlen(change->string));
     }else{
          ce_buffer_insert_string(buffer, change->string, change->location);
     }

     *cursor = change->cursor_before;
     buffer->change_node = buffer->change_node->prev;

     bool success = true;
     if(change->chain) success = ce_buffer_undo(buffer, cursor);

     if(buffer->status == CE_BUFFER_STATUS_MODIFIED && buffer->change_node == buffer->save_at_change_node){
          buffer->status = CE_BUFFER_STATUS_NONE;
     }

     return success;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x40(%rdi), %r15
testq %r15, %r15
je 0xf8ad
cmpq $0x0, 0x48(%r15)
je 0xf8ad
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, 0x1(%r15)
jne 0xf85f
movq 0x8(%r15), %rdi
callq 0xe38c
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdx
movq %rbx, %rdi
movq %rax, %rcx
callq 0xef3b
jmp 0xf873
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rdx
movq 0x18(%r15), %rcx
movq %rbx, %rdi
callq 0xd9ef
movups 0x20(%r15), %xmm0
movups %xmm0, (%r14)
movq 0x40(%rbx), %rax
movq 0x48(%rax), %rax
movq %rax, 0x40(%rbx)
cmpb $0x1, (%r15)
jne 0xf899
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf81b
cmpl $0x1, 0x18(%rbx)
jne 0xf8ad
movq 0x40(%rbx), %rax
cmpq 0x48(%rbx), %rax
jne 0xf8ad
andl $0x0, 0x18(%rbx)
movb $0x1, %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_buffer_redo
bool ce_buffer_redo(CeBuffer_t* buffer, CePoint_t* cursor){
     // nothing to redo
     if(!buffer->change_node) return false;
     if(!buffer->change_node->next) return false;

     buffer->change_node = buffer->change_node->next;

     CeBufferChange_t* change = &buffer->change_node->change;
     if(change->insertion){
          ce_buffer_insert_string(buffer, change->string, change->location);
     }else{
          ce_buffer_remove_string(buffer, change->location, ce_utf8_strlen(change->string));
     }

     *cursor = change->cursor_after;

     if(buffer->change_node->next && buffer->change_node->next->change.chain) return ce_buffer_redo(buffer, cursor);

     if(buffer->status == CE_BUFFER_STATUS_MODIFIED && buffer->change_node == buffer->save_at_change_node){
          buffer->status = CE_BUFFER_STATUS_NONE;
     }

     return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x40(%rdi), %rcx
testq %rcx, %rcx
je 0xf93e
movq 0x40(%rcx), %r15
testq %r15, %r15
je 0xf93e
movq %r15, 0x40(%rbx)
cmpb $0x1, 0x1(%r15)
jne 0xf8f3
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rdx
movq 0x18(%r15), %rcx
movq %rbx, %rdi
callq 0xd9ef
jmp 0xf90f
movq 0x8(%r15), %rdi
callq 0xe38c
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdx
movq %rbx, %rdi
movq %rax, %rcx
callq 0xef3b
movups 0x30(%r15), %xmm0
movups %xmm0, (%r14)
movq 0x40(%rbx), %rcx
movq 0x40(%rcx), %rax
testq %rax, %rax
je 0xf92a
cmpb $0x0, (%rax)
jne 0xf8c4
movb $0x1, %al
cmpl $0x1, 0x18(%rbx)
jne 0xf940
cmpq 0x48(%rbx), %rcx
jne 0xf940
andl $0x0, 0x18(%rbx)
jmp 0xf940
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_move_point_based_on_buffer_changes
CePoint_t ce_move_point_based_on_buffer_changes(CeBuffer_t* buffer, CeBufferChangeNode_t* before, CePoint_t point){
     CeBufferChangeNode_t* itr = buffer->change_node;
     while(itr && itr != before){
          point = move_point_based_on_buffer_change(buffer, itr, point);
          itr = itr->prev;
     }
     return point;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, 0x10(%rsp)
leaq 0x40(%rdi), %rbx
movq %rsi, 0x8(%rsp)
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xfa29
cmpq %rsi, %rbx
je 0xfa29
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0xfa14
movq 0x10(%rbx), %r13
movq 0x18(%rbx), %rbp
cmpq %r15, %rbp
jl 0xf99e
jne 0xfa14
cmpq %r12, %r13
jge 0xfa14
movq %r14, %rdi
callq 0xe1cf
cmpq $0x1, %rax
jne 0xf9df
cmpq %r15, %rbp
jne 0xfa01
movq %r14, %rdi
callq 0xe38c
movq %rax, %rcx
negq %rcx
cmpb $0x0, 0x1(%rbx)
cmovneq %rax, %rcx
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xec3a
movq %rax, %r13
movq %rdx, %rbp
jmp 0xfa07
movq 0x8(%rsp), %rsi
jle 0xfa14
leaq (%rax,%rbp), %rcx
cmpq %r15, %rcx
jg 0xfa1a
cmpb $0x1, 0x1(%rbx)
jne 0xfa0e
leaq (%r15,%rax), %rbp
decq %rbp
movq %r12, %r13
jmp 0xfa1a
movq %r12, %r13
movq %r15, %rbp
movq 0x8(%rsp), %rsi
jmp 0xfa1a
subq %rax, %r15
incq %r15
movq %r12, %r13
movq %r15, %rbp
addq $0x48, %rbx
movq %r13, %r12
movq %rbp, %r15
jmp 0xf968
movq %r12, %rax
movq %r15, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_utf8_strlen_between
int64_t ce_utf8_strlen_between(const char* start, const char* end){
     int64_t len = 0;
     int64_t byte_count = 0;

     while(start <= end){
          if((*start & 0x80) == 0){
               byte_count = 1;
          }else if((*start & 0xE0) == 0xC0){
               byte_count = 2;
          }else if((*start & 0xF0) == 0xE0){
               byte_count = 3;
          }else if((*start & 0xF8) == 0xF0){
               byte_count = 4;
          }else{
               assert(!"unicode character claiming it has more than 4 bytes?!");
               return -1;
          }

          // validate string doesn't early terminate
          for(int64_t i = 0; i < byte_count; i++){
               if(*start == 0) return -1;
               start++;
          }

          len++;
     }

     return len;

}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
xorl %eax, %eax
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
pushq $0x2
popq %r8
pushq $0x3
popq %r9
pushq $0x4
popq %r10
cmpq %rsi, %rdi
ja 0xfc79
movzbl (%rdi), %ebx
movq %rdx, %r11
testb %bl, %bl
jns 0xfc56
movl %ebx, %ebp
andl $-0x20, %ebp
movq %r8, %r11
cmpl $0xc0, %ebp
je 0xfc56
movl %ebx, %ebp
andl $-0x10, %ebp
movq %r9, %r11
cmpl $0xe0, %ebp
je 0xfc56
andl $-0x8, %ebx
movq %r10, %r11
cmpl $0xf0, %ebx
jne 0xfc7e
leaq (%rdi,%r11), %rbx
xorl %r14d, %r14d
cmpq %r14, %r11
je 0xfc6e
cmpb $0x0, (%rdi,%r14)
je 0xfc76
incq %r14
jmp 0xfc5d
incq %rax
movq %rbx, %rdi
jmp 0xfc19
movq %rcx, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1aaa2(%rip), %rdi     # 0x2a727
leaq 0x1a9ec(%rip), %rsi     # 0x2a678
leaq 0x1aaf2(%rip), %rcx     # 0x2a785
movl $0x54f, %edx            # imm = 0x54F
callq 0xd280
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_utf8_decode_reverse
CeRune_t ce_utf8_decode_reverse(const char* string, const char* string_start, int64_t* bytes_consumed){
     if((*string & 0x80) == 0){
          *bytes_consumed = 1;
          return string[0];
     }

     while(string >= string_start){
          if((*string & 0x80) == 0x80){
               string--;
          }else{
               return ce_utf8_decode(string, bytes_consumed);
          }
     }

     return CE_UTF8_INVALID;
}

// Assembly:
cmpb $0x0, (%rdi)
js 0xfd49
movq $0x1, (%rdx)
movsbl (%rdi), %eax
retq
pushq $-0x1
popq %rax
cmpq %rsi, %rdi
jb 0xfd48
cmpb $0x0, (%rdi)
jns 0xfd5b
decq %rdi
jmp 0xfd4c
movq %rdx, %rsi
jmp 0xe53f
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_utf8_rune_len
int64_t ce_utf8_rune_len(CeRune_t u){
     // TODO: optimize based on st's bitmasking
     if(u < 0x80){
          return 1;
     }else if(u < 0x0800){
          return 2;
     }else if(u < 0x10000){
          return 3;
     }else if(u < 0x110000){
          return 4;
     }

     return true;
}

// Assembly:
cmpl $0x80, %edi
jge 0xfd6f
pushq $0x1
jmp 0xfd85
cmpl $0x800, %edi            # imm = 0x800
jae 0xfd7b
pushq $0x2
jmp 0xfd85
cmpl $0x10000, %edi          # imm = 0x10000
jae 0xfd87
pushq $0x3
popq %rax
retq
xorl %eax, %eax
cmpl $0x110000, %edi         # imm = 0x110000
setb %al
leaq (%rax,%rax,2), %rax
incq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_rune_node_insert
bool ce_rune_node_insert(CeRuneNode_t** head, CeRune_t rune){
     CeRuneNode_t* node = malloc(sizeof(*node));
     if(!node) return false;

     // always insert at head
     node->rune = rune;
     node->next = *head;
     *head = node;

     return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0xd4c0
testq %rax, %rax
je 0xfddf
movl %ebp, (%rax)
movq (%rbx), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%rbx)
testq %rax, %rax
setne %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_rune_node_string
CeRune_t* ce_rune_node_string(CeRuneNode_t* head){
     // count nodes
     CeRuneNode_t* itr = head;
     int64_t len = 0;
     while(itr){
          itr = itr->next;
          len++;
     }

     CeRune_t* runes = malloc((len + 1) * sizeof(*runes));

     // copy into string
     int64_t save_len = len;
     itr = head;
     while(itr){
          runes[len - 1] = itr->rune;
          itr = itr->next;
          len--;
     }

     // null terminate
     runes[save_len] = 0;
     return runes;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x4
popq %rbx
movq %rdi, %rax
testq %rax, %rax
je 0xfe08
movq 0x8(%rax), %rax
addq $0x4, %rbx
jmp 0xfdf9
movq %rbx, %rdi
callq 0xd4c0
leaq (%rax,%rbx), %rcx
addq $-0x8, %rcx
testq %r14, %r14
je 0xfe2c
movl (%r14), %edx
movl %edx, (%rcx)
movq 0x8(%r14), %r14
addq $-0x4, %rcx
jmp 0xfe18
andl $0x0, -0x4(%rax,%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_rune_node_free
void ce_rune_node_free(CeRuneNode_t** head){
     CeRuneNode_t* itr = *head;
     while(itr){
          CeRuneNode_t* tmp = itr;
          itr = itr->next;
          free(tmp);
     }

     *head = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xfe56
movq 0x8(%rdi), %r14
callq 0xd090
movq %r14, %rdi
jmp 0xfe43
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_range_sort
bool ce_range_sort(CeRange_t* range){
     if(ce_point_after(range->start, range->end)){
          CePoint_t tmp = range->start;
          range->start = range->end;
          range->end = tmp;
          return true;
     }

     return false;
}

// Assembly:
movq 0x8(%rdi), %rcx
movq 0x18(%rdi), %rdx
cmpq %rcx, %rdx
jl 0x1023c
xorl %eax, %eax
cmpq %rcx, %rdx
jne 0x10258
movq (%rdi), %rcx
cmpq %rcx, 0x10(%rdi)
jge 0x10258
leaq 0x10(%rdi), %rax
movups (%rdi), %xmm0
movaps %xmm0, -0x18(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rdi)
movaps -0x18(%rsp), %xmm0
movups %xmm0, (%rax)
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_count_digits
int64_t ce_count_digits(int64_t n){
     if(n < 0) n = -n;
     if(n == 0) return 1;

     int count = 0;
     while(n > 0){
          n /= 10;
          count++;
     }

     return count;
}

// Assembly:
testq %rdi, %rdi
je 0x1027c
movq %rdi, %rax
negq %rax
cmovsq %rdi, %rax
xorl %ecx, %ecx
pushq $0xa
popq %rsi
testq %rax, %rax
je 0x1027f
xorl %edx, %edx
divq %rsi
incq %rcx
jmp 0x1026d
pushq $0x1
popq %rcx
movq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_line_number_column_width
int64_t ce_line_number_column_width(CeLineNumber_t line_number, int64_t buffer_line_count, int64_t view_top, int64_t view_bottom){
     if(buffer_line_count == 0) return 0;

     int64_t column_width = 0;

     if(line_number == CE_LINE_NUMBER_ABSOLUTE || line_number == CE_LINE_NUMBER_ABSOLUTE_AND_RELATIVE){
          column_width += ce_count_digits(buffer_line_count) + 1;
     }else if(line_number == CE_LINE_NUMBER_RELATIVE){
          int64_t view_height = (view_bottom - view_top) + 1;
          if(view_height > buffer_line_count){
               column_width += ce_count_digits(buffer_line_count - 1) + 1;
          }else{
               column_width += ce_count_digits(view_height - 1) + 1;
          }
     }

     return column_width;
}

// Assembly:
testq %rsi, %rsi
je 0x102b6
movl %edi, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
je 0x102a5
cmpl $0x2, %edi
jne 0x102b6
subq %rdx, %rcx
cmpq %rsi, %rcx
leaq -0x1(%rsi), %rsi
cmovlq %rcx, %rsi
pushq %rax
movq %rsi, %rdi
callq 0x10259
incq %rax
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_list_dir
CeListDirResult_t ce_list_dir(const char* directory) {
     CeListDirResult_t result;
     memset(&result, 0, sizeof(result));

#if defined(PLATFORM_WINDOWS)
     WIN32_FIND_DATA find_files_result;
     memset(&find_files_result, 0, sizeof(find_files_result));

     HANDLE find_files_handle = FindFirstFileA(directory,
                                               &find_files_result);
     if (find_files_handle == INVALID_HANDLE_VALUE) {
          return result;
     }

     do{
         insert_list_dir_result_filename(&result,
                                         find_files_result.cFileName,
                                         find_files_result.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
     }while(FindNextFileA(find_files_handle, &find_files_result));

     FindClose(find_files_handle);
#else
     DIR* os_dir = opendir(directory);
     if(!os_dir){
          return result;
     }

     struct dirent* node = NULL;
     while((node = readdir(os_dir)) != NULL){
          insert_list_dir_result_filename(&result,
                                          node->d_name,
                                          node->d_type == DT_DIR);
     }

     closedir(os_dir);
#endif

     return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, %rdi
callq 0xd200
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x10389
movq %rbx, 0x10(%rsp)
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
callq 0xd470
testq %rax, %rax
je 0x1036f
movq %rax, %r13
addq $0x13, %r13
movb 0x12(%rax), %r14b
leaq 0x1(%rbp), %rbx
leaq 0x8(,%rbp,8), %rsi
movq %r12, %rdi
callq 0xd520
movq %rax, %r12
movq %r13, %rdi
callq 0xd640
movq %rax, (%r12,%rbp,8)
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd520
movq %rax, %r15
cmpb $0x4, %r14b
sete (%rax,%rbp)
movq %rbx, %rbp
jmp 0x10317
movq 0x10(%rsp), %rbx
movq %r12, 0x8(%rbx)
movq %r15, 0x10(%rbx)
movq %rbp, (%rbx)
movq 0x8(%rsp), %rdi
callq 0xd300
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce.c
// Function: ce_free_list_dir_result
void ce_free_list_dir_result(CeListDirResult_t* list_dir_result) {
     for(int64_t i = 0; i < list_dir_result->count; i++){
          free(list_dir_result->filenames[i]);
     }
     free(list_dir_result->filenames);
     free(list_dir_result->is_directories);
     memset(list_dir_result, 0, sizeof(*list_dir_result));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
cmpq (%rbx), %r14
jge 0x103bc
movq (%rdi,%r14,8), %rdi
callq 0xd090
incq %r14
jmp 0x103a5
callq 0xd090
movq 0x10(%rbx), %rdi
callq 0xd090
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_buffer_node_insert
bool ce_buffer_node_insert(CeBufferNode_t** head, CeBuffer_t* buffer){
     CeBufferNode_t* node = malloc(sizeof(*node));
     if(!node) return false;
     node->buffer = buffer;
     node->next = *head;
     *head = node;
     return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0xd4c0
testq %rax, %rax
je 0x10404
movq %r14, (%rax)
movq (%rbx), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%rbx)
testq %rax, %rax
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_buffer_node_unlink
CeBufferNode_t* ce_buffer_node_unlink(CeBufferNode_t** head, CeBuffer_t* buffer){
     CeBufferNode_t* prev = NULL;
     CeBufferNode_t* itr = *head;
     while(itr){
          if(itr->buffer == buffer) break;
          prev = itr;
          itr = itr->next;
     }

     if(!itr) return NULL;

     if(prev){
          prev->next = itr->next;
     }else{
          *head = (*head)->next;
     }

     return itr;
}

// Assembly:
xorl %ecx, %ecx
movq %rdi, %rdx
movq (%rdx), %rax
testq %rax, %rax
je 0x10445
cmpq %rsi, (%rax)
je 0x1042d
leaq 0x8(%rax), %rdx
movq %rax, %rcx
jmp 0x10417
testq %rcx, %rcx
je 0x1043b
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rcx)
retq
movq (%rdi), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: free_buffer_node
static void free_buffer_node(CeBufferNode_t* node){
     CeAppBufferData_t* buffer_data = node->buffer->app_data;
     if(buffer_data) free(buffer_data->base_directory);
     free(node->buffer->app_data);
     ce_buffer_free(node->buffer);
     free(node->buffer);
     free(node);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x58(%rax), %rax
testq %rax, %rax
je 0x1047d
movq 0x608(%rax), %rdi
callq 0xd090
movq (%rbx), %rax
movq 0x58(%rax), %rdi
jmp 0x1047f
xorl %edi, %edi
callq 0xd090
movq (%rbx), %rdi
callq 0xde1c
movq (%rbx), %rdi
callq 0xd090
movq %rbx, %rdi
popq %rbx
jmp 0xd090
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_buffer_node_free
void ce_buffer_node_free(CeBufferNode_t** head){
     CeBufferNode_t* itr = *head;
     while(itr){
          CeBufferNode_t* tmp = itr;
          itr = itr->next;
          free_buffer_node(tmp);
     }
     *head = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x104ba
movq 0x8(%rdi), %r14
callq 0x10458
movq %r14, %rdi
jmp 0x104a7
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_string_node_insert
CeStringNode_t* ce_string_node_insert(CeStringNode_t** head, const char* string){
     CeStringNode_t* tail = *head;
     CeStringNode_t* node;
     if(tail){
          while(tail->next) tail = tail->next;

          // NOTE: we probably don't want this if we want the linked list to be general
          // skip the insertion if the string matches the previous string
          if(strcmp(string, tail->string) == 0) return NULL;

          node = calloc(1, sizeof(*node));
          if(!node) return node;
          node->string = strdup(string);

          tail->next = node;
          node->prev = tail;
     }else{
          node = calloc(1, sizeof(*node));
          if(!node) return node;
          node->string = strdup(string);

          *head = node;
     }

     return node;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x10519
movq %rax, %r15
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x104d6
movq (%r15), %rsi
movq %rbx, %rdi
callq 0xd390
testl %eax, %eax
je 0x1053f
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0xd380
testq %rax, %rax
je 0x1053f
movq %rax, %r14
movq %rbx, %rdi
callq 0xd640
movq %rax, (%r14)
movq %r14, 0x8(%r15)
movq %r15, 0x10(%r14)
jmp 0x10542
movq %rdi, %r15
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0xd380
testq %rax, %rax
je 0x1053f
movq %rax, %r14
movq %rbx, %rdi
callq 0xd640
movq %rax, (%r14)
movq %r14, (%r15)
jmp 0x10542
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_string_node_free
void ce_string_node_free(CeStringNode_t** head){
     CeStringNode_t* itr = *head;
     while(itr){
          CeStringNode_t* tmp = itr;
          itr = itr->next;
          free(tmp->string);
          free(tmp);
     }

     *head = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x10574
movq (%r14), %rdi
movq 0x8(%r14), %r15
callq 0xd090
movq %r14, %rdi
callq 0xd090
movq %r15, %r14
jmp 0x10556
andq $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_history_insert
bool ce_history_insert(CeHistory_t* history, const char* string){
     CeStringNode_t* new_node = ce_string_node_insert(&history->head, string);
     if(!new_node) return false;
     ce_history_reset_current(history);
     return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x104c6
testq %rax, %rax
je 0x10591
andq $0x0, 0x8(%rbx)
testq %rax, %rax
setne %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_history_previous
char* ce_history_previous(CeHistory_t* history){
     if(history->current){
          if(history->current->prev){
               history->current = history->current->prev;
          }

          return history->current->string;
     }else{
          history->current = history->head;
          if(history->current){
               while(history->current->next) history->current = history->current->next;
               return history->current->string;
          }
     }

     return NULL;
}

// Assembly:
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x105bc
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x105b8
movq %rcx, 0x8(%rdi)
movq %rcx, %rax
movq (%rax), %rax
retq
movq (%rdi), %rcx
movq %rcx, 0x8(%rdi)
testq %rcx, %rcx
je 0x105da
movq %rcx, %rax
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
je 0x105b8
movq %rcx, 0x8(%rdi)
jmp 0x105c8
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_convert_bind_defs
void ce_convert_bind_defs(CeKeyBinds_t* binds, CeKeyBindDef_t* bind_defs, int64_t bind_def_count){
     if(binds->count){
          for(int64_t i = 0; i < binds->count; ++i){
               free(binds->binds[i].keys);
          }
          free(binds->binds);
     }

     binds->count = bind_def_count;
     binds->binds = malloc(binds->count * sizeof(*binds->binds));

     for(int64_t i = 0; i < binds->count; ++i){
          ce_command_parse(&binds->binds[i].command, bind_defs[i].command);
          binds->binds[i].key_count = 0;

          for(int k = 0; k < 4; ++k){
               if(bind_defs[i].keys[k] == 0) break;
               binds->binds[i].key_count++;
          }

          if(!binds->binds[i].key_count) continue;

          binds->binds[i].keys = malloc(binds->binds[i].key_count * sizeof(binds->binds[i].keys[0]));

          for(int k = 0; k < binds->binds[i].key_count; ++k){
               binds->binds[i].keys[k] = bind_defs[i].keys[k];
          }
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, (%rsp)
movq %rdi, %r14
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x10648
xorl %ebx, %ebx
xorl %r15d, %r15d
movq (%r14), %rdi
cmpq %rax, %r15
jge 0x10643
movq (%rdi,%rbx), %rdi
callq 0xd090
incq %r15
movq 0x8(%r14), %rax
addq $0x228, %rbx            # imm = 0x228
jmp 0x10622
callq 0xd090
movq %r12, 0x8(%r14)
imulq $0x228, %r12, %rdi      # imm = 0x228
callq 0xd4c0
movq %rax, %r15
movq %rax, (%r14)
xorl %r13d, %r13d
movq (%rsp), %rbp
cmpq %r12, %r13
jge 0x106f1
imulq $0x228, %r13, %rbx      # imm = 0x228
leaq (%r15,%rbx), %rdi
addq $0x10, %rdi
imulq $0x18, %r13, %rax
movq (%rsp), %rcx
movq 0x10(%rcx,%rax), %rsi
callq 0x156d8
movq (%r14), %r15
leaq (%r15,%rbx), %rax
addq $0x8, %rax
andq $0x0, (%rax)
xorl %edi, %edi
xorl %r12d, %r12d
cmpq $0x4, %r12
je 0x106bd
cmpl $0x0, (%rbp,%r12,4)
je 0x106bd
incq %r12
movq %r12, (%rax)
addq $-0x4, %rdi
jmp 0x106a3
testq %r12, %r12
je 0x106e1
negq %rdi
callq 0xd4c0
movq %rax, (%r15,%rbx)
xorl %ecx, %ecx
cmpq %rcx, %r12
je 0x106e1
movl (%rbp,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
jmp 0x106d0
incq %r13
movq 0x8(%r14), %r12
addq $0x18, %rbp
jmp 0x10665
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_set_vim_key_bind
void ce_set_vim_key_bind(CeVimKeyBind_t* key_binds, int64_t* key_bind_count, CeRune_t key, CeVimParseFunc_t* parse_func){
     for(int64_t i = 0; i < *key_bind_count; ++i){
          CeVimKeyBind_t* key_bind = key_binds + i;
          if(key_bind->key == key){
               key_bind->function = parse_func;
               return;
          }
     }

     // we didn't find the key to override it, so we add the binding
     ce_vim_add_key_bind(key_binds, key_bind_count, key, parse_func);
}

// Assembly:
movq (%rsi), %r8
xorl %eax, %eax
testq %r8, %r8
cmovgq %r8, %rax
incq %rax
movq %rdi, %r8
decq %rax
je 0x2056c
leaq 0x10(%r8), %r9
cmpl %edx, (%r8)
movq %r9, %r8
jne 0x10737
movq %rcx, -0x8(%r9)
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_extend_commands
void ce_extend_commands(CeCommandEntry_t** command_entries, int64_t* command_entry_count, CeCommandEntry_t* new_command_entries,
                        int64_t new_command_entry_count){
     int64_t final_command_entry_count = *command_entry_count + new_command_entry_count;
     *command_entries = realloc(*command_entries, final_command_entry_count * sizeof(**command_entries));
     for(int64_t i = 0; i < new_command_entry_count; i++){
          (*command_entries)[i + *command_entry_count] = new_command_entries[i];
     }
     *command_entry_count = final_command_entry_count;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
movq (%rsi), %r13
addq %rcx, %r13
movq (%rdi), %rdi
imulq $0x18, %r13, %rsi
callq 0xd520
movq %rax, (%r12)
xorl %eax, %eax
testq %rbx, %rbx
cmovleq %rax, %rbx
subq $0x1, %rbx
jb 0x107ac
imulq $0x18, (%r14), %rcx
addq (%r12), %rcx
movq 0x10(%r15,%rax), %rdx
movq %rdx, 0x10(%rax,%rcx)
movups (%r15,%rax), %xmm0
movups %xmm0, (%rax,%rcx)
addq $0x18, %rax
jmp 0x10785
movq %r13, (%r14)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_jump_list_insert
void ce_jump_list_insert(CeJumpList_t* jump_list, CeDestination_t destination){
     if(jump_list->count < JUMP_LIST_DESTINATION_COUNT){
          if(jump_list->count > 0){
               jump_list->itr++;
               jump_list->current = jump_list->itr;
          }
          jump_list->destinations[jump_list->itr] = destination;
          jump_list->count++;
          return;
     }

     // shift all destinations down
     for(int i = 1; i <= jump_list->itr; i++){
          jump_list->destinations[i - 1] = jump_list->destinations[i];
     }

     jump_list->destinations[jump_list->itr] = destination;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movq 0x4100(%rdi), %rcx
cmpq $0x10, %rcx
jge 0x10ae8
movq 0x4108(%rbx), %rax
testq %rcx, %rcx
jle 0x10ac8
incq %rax
movq %rax, 0x4108(%rbx)
movq %rax, 0x4110(%rbx)
imulq $0x410, %rax, %rdi      # imm = 0x410
addq %rbx, %rdi
movl $0x410, %edx            # imm = 0x410
movq %r14, %rsi
callq 0xd420
incq 0x4100(%rbx)
jmp 0x10b31
pushq $0x1
popq %r12
movq %rbx, %rdi
movq 0x4108(%rbx), %rax
cmpq %r12, %rax
jl 0x10b17
leaq 0x410(%rdi), %r15
movl $0x410, %edx            # imm = 0x410
movq %r15, %rsi
callq 0xd420
incq %r12
movq %r15, %rdi
jmp 0x10aef
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rbx
movl $0x410, %edx            # imm = 0x410
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd420
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_jump_list_previous
CeDestination_t* ce_jump_list_previous(CeJumpList_t* jump_list){
     if(jump_list->count == 0) return NULL;
     if(jump_list->itr >= (jump_list->count - 1)) return 0;
     jump_list->itr++;
     jump_list->current = jump_list->itr;
     return jump_list->destinations + jump_list->itr;
}

// Assembly:
movq 0x4100(%rdi), %rcx
testq %rcx, %rcx
je 0x10b74
movq 0x4108(%rdi), %rax
decq %rcx
cmpq %rcx, %rax
jge 0x10b74
incq %rax
movq %rax, 0x4108(%rdi)
movq %rax, 0x4110(%rdi)
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rdi, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_jump_list_next
CeDestination_t* ce_jump_list_next(CeJumpList_t* jump_list){
     if(jump_list->count == 0) return NULL;
     if(jump_list->itr < 0) return NULL;
     jump_list->current = jump_list->itr;
     jump_list->itr--;
     return jump_list->destinations + jump_list->current;
}

// Assembly:
cmpq $0x0, 0x4100(%rdi)
je 0x10baa
movq 0x4108(%rdi), %rax
testq %rax, %rax
js 0x10baa
movq %rax, 0x4110(%rdi)
leaq -0x1(%rax), %rcx
movq %rcx, 0x4108(%rdi)
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rdi, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_destination_in_view
bool ce_destination_in_view(CeDestination_t* destination, CeView_t* view){
     if(!view) return false;

     int64_t view_width = ce_view_width(view);
     int64_t view_height = ce_view_height(view);
     CeRect_t view_rect = {view->scroll.x, view->scroll.x + view_width, view->scroll.y, view->scroll.y + view_height};

     return strcmp(destination->filepath, view->buffer->name) == 0 &&
            ce_point_in_rect(destination->point, view_rect);
}

// Assembly:
testq %rsi, %rsi
je 0x10d6d
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xfbf0
movq %rax, %r15
movq %r14, %rdi
callq 0xfbf8
movq 0x20(%r14), %rcx
movq %rcx, 0x20(%rsp)
addq %rcx, %r15
movq %r15, 0x28(%rsp)
movq 0x28(%r14), %rcx
movq %rcx, 0x30(%rsp)
addq %rcx, %rax
movq %rax, 0x38(%rsp)
leaq 0x10(%rbx), %rdi
movq 0x40(%r14), %rax
movq 0x10(%rax), %rsi
callq 0xd390
testl %eax, %eax
je 0x10d70
xorl %eax, %eax
jmp 0x10d8f
xorl %eax, %eax
retq
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movups 0x20(%rsp), %xmm0
movups 0x30(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0xfd9a
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_app_update_terminal_view
void ce_app_update_terminal_view(CeApp_t* app, int width, int height) {
     app->terminal_width = width;
     app->terminal_height = height;
     app->terminal_rect = (CeRect_t){0, app->terminal_width - 1, 0, app->terminal_height - 1};
     ce_layout_distribute_rect(app->tab_list_layout, app->terminal_rect);
}

// Assembly:
subq $0x28, %rsp
movl %esi, 0x2700(%rdi)
movl %edx, 0x2704(%rdi)
decl %esi
movslq %esi, %rax
andq $0x0, (%rdi)
movq %rax, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
decl %edx
movslq %edx, %rax
movq %rax, 0x18(%rdi)
movq 0x2818(%rdi), %rax
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0x1c4ba
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_app_switch_to_prev_buffer_in_view
bool ce_app_switch_to_prev_buffer_in_view(CeApp_t* app, CeView_t* view, bool switch_if_deleted){
     CeAppViewData_t* view_data = view->user_data;
     if(!view_data->prev_buffer) return false;

     bool deleted = true;
     CeBufferNode_t* itr = app->buffer_node_head;
     while(itr){
          if(itr->buffer == view_data->prev_buffer){
               deleted = false;
               break;
          }
          itr = itr->next;
     }

     if(deleted){
          if(switch_if_deleted){
               view_data->prev_buffer = app->buffer_node_head->buffer;
          }else{
               view_data->prev_buffer = NULL;
               return false;
          }
     }

     ce_view_switch_buffer(view, view_data->prev_buffer, &app->vim, &app->config_options, true);
     return true;
}

// Assembly:
pushq %rax
movq %rdi, %rcx
movq 0x48(%rsi), %rdi
movq 0x4118(%rdi), %rax
testq %rax, %rax
je 0x10e84
leaq 0x2828(%rcx), %r8
movq %r8, %r9
movq (%r9), %r10
testq %r10, %r10
je 0x10e4d
leaq 0x8(%r10), %r9
cmpq %rax, (%r10)
jne 0x10e3a
jmp 0x10e5e
testb %dl, %dl
je 0x10e7c
movq (%r8), %rax
movq (%rax), %rax
movq %rax, 0x4118(%rdi)
leaq 0x20(%rcx), %rdx
addq $0x1a50, %rcx           # imm = 0x1A50
pushq $0x1
popq %r8
movq %rsi, %rdi
movq %rax, %rsi
callq 0x10bc9
movb $0x1, %al
jmp 0x10e86
andq $0x0, 0x4118(%rdi)
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: input_view_overlay
void input_view_overlay(CeView_t* input_view, CeView_t* view){
     input_view->rect.left = view->rect.left;
     input_view->rect.right = view->rect.right;
     input_view->rect.bottom = view->rect.bottom;
     int64_t max_height = (view->rect.bottom - view->rect.top) - 1;
     int64_t height = input_view->buffer->line_count;
     if(height <= 0) height = 1;
     if(height > max_height) height = max_height;
     input_view->rect.top = view->rect.bottom - height;
}

// Assembly:
movups (%rsi), %xmm0
movups %xmm0, (%rdi)
movq 0x18(%rsi), %rax
movq %rax, 0x18(%rdi)
movq 0x10(%rsi), %rcx
notq %rcx
addq %rax, %rcx
movq 0x40(%rdi), %rdx
movq 0x8(%rdx), %rdx
cmpq $0x2, %rdx
pushq $0x1
popq %rsi
cmovgeq %rdx, %rsi
cmpq %rcx, %rsi
cmovgeq %rcx, %rsi
subq %rsi, %rax
movq %rax, 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: view_cursor_on_screen
CePoint_t view_cursor_on_screen(CeView_t* view, int64_t tab_width, CeLineNumber_t line_number){
     // move the visual cursor to the right location
     int64_t visible_cursor_x = 0;
     if(ce_buffer_point_is_valid(view->buffer, view->cursor)){
          visible_cursor_x = ce_util_string_index_to_visible_index(view->buffer->lines[view->cursor.y],
                                                                   view->cursor.x, tab_width);
     }

     int64_t line_number_width = 0;
     if(!view->buffer->no_line_numbers){
          line_number_width = ce_line_number_column_width(line_number, view->buffer->line_count, view->rect.top, view->rect.bottom);
     }

     return (CePoint_t){visible_cursor_x - view->scroll.x + view->rect.left + line_number_width,
                        view->cursor.y - view->scroll.y + view->rect.top};
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
movq 0x30(%rbx), %rsi
movq 0x38(%rbx), %rdx
callq 0xe425
testq %rax, %rax
je 0x10f04
movq 0x40(%rbx), %rax
movq (%rax), %rax
movq 0x30(%rbx), %rsi
movq 0x38(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq %r14, %rdx
callq 0xeb75
movq %rax, %r14
jmp 0x10f07
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
cmpb $0x0, 0x50(%rax)
je 0x10f15
xorl %eax, %eax
jmp 0x10f28
movq 0x8(%rax), %rsi
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movl %ebp, %edi
callq 0x10283
addq %r14, %rax
subq 0x20(%rbx), %rax
addq (%rbx), %rax
movq 0x38(%rbx), %rdx
subq 0x28(%rbx), %rdx
addq 0x10(%rbx), %rdx
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: find_already_loaded_file
CeBuffer_t* find_already_loaded_file(CeBufferNode_t* buffer_node_head, const char* filename){
     CeBufferNode_t* itr = buffer_node_head;
     while(itr){
          if(strcmp(itr->buffer->name, filename) == 0){
               return itr->buffer;
          }
          if(strstr(filename, itr->buffer->name) != NULL){
#if defined(PLATFORM_WINDOWS)
               char* buffer_full_path = _fullpath(NULL, itr->buffer->name, MAX_PATH_LEN);
#else
               char* buffer_full_path = realpath(itr->buffer->name, NULL);
#endif
               if(strcmp(buffer_full_path, filename) == 0){
                    free(buffer_full_path);
                    return itr->buffer;
               }
               free(buffer_full_path);
          }
          itr = itr->next;
     }
     return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testq %rbx, %rbx
je 0x10fa9
movq (%rbx), %r12
movq 0x10(%r12), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xd390
testl %eax, %eax
je 0x10fb1
movq %r14, %rdi
movq %r15, %rsi
callq 0xd6f0
testq %rax, %rax
je 0x10fa3
movq %r15, %rdi
xorl %esi, %esi
callq 0xd410
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0xd390
movl %eax, %ebp
movq %r15, %rdi
callq 0xd090
testl %ebp, %ebp
je 0x10fae
movq 0x8(%rbx), %rbx
jmp 0x10f51
xorl %r12d, %r12d
jmp 0x10fb1
movq (%rbx), %r12
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: new_buffer
CeBuffer_t* new_buffer(){
     CeBuffer_t* buffer = calloc(1, sizeof(*buffer));
     if(!buffer) return buffer;
     buffer->app_data = calloc(1, sizeof(CeAppBufferData_t));
     return buffer;
}

// Assembly:
pushq %rbx
pushq $0x1
popq %rdi
pushq $0x70
popq %rsi
callq 0xd380
movq %rax, %rbx
testq %rax, %rax
je 0x112c3
pushq $0x1
popq %rdi
movl $0x628, %esi            # imm = 0x628
callq 0xd380
movq %rax, 0x58(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: string_ends_with
static bool string_ends_with(const char* str, const char* pattern){
     int64_t str_len = strlen(str);
     int64_t pattern_len = strlen(pattern);
     if(str_len < pattern_len) return false;

     return strncmp(str + (str_len - pattern_len), pattern, pattern_len) == 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0xd210
movq %rax, %r15
movq %rbx, %rdi
callq 0xd210
subq %rax, %r15
jge 0x112ec
xorl %eax, %eax
jmp 0x11302
addq %r15, %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xd0d0
testl %eax, %eax
sete %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: directory_from_filename
char* directory_from_filename(const char* filename){
     const char* last_slash = strrchr(filename, CE_PATH_SEPARATOR);
     char* directory = NULL;
     if(last_slash) directory = ce_strndup((char*)(filename), last_slash - filename);
     return directory;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x2f
popq %rsi
callq 0xd270
testq %rax, %rax
je 0x11328
subq %rbx, %rax
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0xf56b
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: build_complete_list
void build_complete_list(CeBuffer_t* buffer, CeComplete_t* complete){
     ce_buffer_empty(buffer);
     buffer->syntax_data = complete;
     char line[256];
     int64_t cursor = 0;
     int max_string_len = 0;
     for(int64_t i = 0; i < complete->count; i++){
          if(complete->elements[i].match){
               int len = strlen(complete->elements[i].string);
               if(len > max_string_len) max_string_len = len;
          }
     }
     for(int64_t i = 0; i < complete->count; i++){
          if(complete->elements[i].match){
               if(i == complete->current) cursor = buffer->line_count;
               if(complete->elements[i].description){
                    snprintf(line, 256, "%-*s : %s", max_string_len, complete->elements[i].string, complete->elements[i].description);
               }else{
                    snprintf(line, 256, "%s", complete->elements[i].string);
               }
               buffer_append_on_new_line(buffer, line);
          }
     }

     // TODO: figure out why we have to account for this case
     if(buffer->line_count == 1 && cursor == 1) cursor = 0;

     buffer->cursor_save = (CePoint_t){0, cursor};
     buffer->status = CE_BUFFER_STATUS_READONLY;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r14
movq %rdi, %rbx
callq 0xe2e2
movq %r14, 0x60(%rbx)
movq 0x8(%r14), %r12
xorl %r15d, %r15d
testq %r12, %r12
movl $0x0, %r13d
cmovgq %r12, %r13
pushq $0x10
popq %rbp
subq $0x1, %r13
jb 0x11578
movq (%r14), %rax
cmpb $0x1, (%rax,%rbp)
jne 0x11572
movq -0x10(%rax,%rbp), %rdi
callq 0xd210
cmpl %eax, %r15d
cmovgl %r15d, %eax
movl %eax, %r15d
addq $0x18, %rbp
jmp 0x1154f
pushq $0x10
popq %rbp
xorl %r13d, %r13d
movq $0x0, 0x8(%rsp)
cmpq %r12, %r13
jge 0x115fc
movq (%r14), %rax
cmpb $0x1, (%rax,%rbp)
jne 0x115f3
cmpq 0x18(%r14), %r13
jne 0x115a4
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rsp)
movq -0x10(%rax,%rbp), %r8
movq -0x8(%rax,%rbp), %r9
testq %r9, %r9
leaq 0x10(%rsp), %r12
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
je 0x115d3
leaq 0x192ef(%rip), %rdx     # 0x2a8b6
movl %r15d, %ecx
xorl %eax, %eax
callq 0xd260
jmp 0x115e4
leaq 0x1c32c(%rip), %rdx     # 0x2d906
movq %r8, %rcx
xorl %eax, %eax
callq 0xd260
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1163b
movq 0x8(%r14), %r12
incq %r13
addq $0x18, %rbp
jmp 0x11587
movq 0x8(%rbx), %rax
xorq $0x1, %rax
movq 0x8(%rsp), %rsi
movq %rsi, %rcx
xorq $0x1, %rcx
xorl %edx, %edx
orq %rax, %rcx
cmovneq %rsi, %rdx
andq $0x0, 0x20(%rbx)
movq %rdx, 0x28(%rbx)
movl $0x2, 0x18(%rbx)
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: buffer_append_on_new_line
bool buffer_append_on_new_line(CeBuffer_t* buffer, const char* string){
     int64_t old_line_count = buffer->line_count;
     if(old_line_count == 1 && strlen(buffer->lines[0]) == 0){
          return ce_buffer_insert_string(buffer, string, (CePoint_t){0, 0});
     }
     int64_t new_line_count = buffer->line_count + 1;
     buffer->lines = realloc(buffer->lines, new_line_count * sizeof(buffer->lines[0]));
     if(buffer->lines == NULL) return false;
     buffer->line_count = new_line_count;
     buffer->lines[old_line_count] = calloc(1, sizeof(buffer->lines[old_line_count]));
     return ce_buffer_insert_string(buffer, string, (CePoint_t){0, old_line_count});
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x8(%r14), %r15
cmpq $0x1, %r15
jne 0x1165e
movq (%rdi), %rax
cmpb $0x0, (%rax)
je 0x1169d
leaq 0x8(,%r15,8), %rsi
callq 0xd520
movq %rax, (%r14)
testq %rax, %rax
je 0x1168f
movq %rax, %r12
leaq 0x1(%r15), %rax
movq %rax, 0x8(%r14)
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
callq 0xd380
movq %rax, (%r12,%r15,8)
jmp 0x116a0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %r15d, %r15d
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r15, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xd9ef
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: istrtol
int64_t istrtol(const CeRune_t* istr, const CeRune_t** end_of_numbers){
     int64_t value = 0;
     const CeRune_t* itr = istr;

     while(*itr){
          if(isdigit(*itr)){
               value *= 10;
               value += *itr - '0';
          }else{
               if(itr != istr) *end_of_numbers = itr;
               break;
          }

          itr++;
     }

     if(!(*itr) && itr != istr) *end_of_numbers = itr;

     return value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
xorl %r15d, %r15d
movslq (%r14,%r12), %r13
testq %r13, %r13
je 0x11a3c
callq 0xd720
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r13,2)
je 0x11a3c
imulq $0xa, %r15, %rax
leaq (%rax,%r13), %r15
addq $-0x30, %r15
addq $0x4, %r12
jmp 0x11a11
testq %r12, %r12
je 0x11a47
addq %r12, %r14
movq %r14, (%rbx)
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: ce_app_init_command_completion
void ce_app_init_command_completion(CeApp_t* app, CeComplete_t* complete){
     const char** commands = malloc(app->command_entry_count * sizeof(*commands));
     const char** descriptions = malloc(app->command_entry_count * sizeof(*descriptions));
     for(int64_t i = 0; i < app->command_entry_count; i++){
          commands[i] = strdup(app->command_entries[i].name);
          descriptions[i] = strdup(app->command_entries[i].description);
     }
     ce_complete_init(complete, commands, descriptions, app->command_entry_count);
     for(int64_t i = 0; i < app->command_entry_count; i++){
          free((char*)(commands[i]));
          free((char*)(descriptions[i]));
     }
     free(commands);
     free(descriptions);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, (%rsp)
movq %rdi, %rbx
movq 0x2838(%rdi), %r12
leaq (,%r12,8), %r15
movq %r15, %rdi
callq 0xd4c0
movq %rax, %r14
movq %r15, %rdi
callq 0xd4c0
movq %rax, %r15
xorl %ebp, %ebp
testq %r12, %r12
movl $0x0, %eax
movq %r12, 0x8(%rsp)
cmovgq %r12, %rax
movq %rax, 0x10(%rsp)
pushq $0x2
popq %r12
cmpq %rbp, 0x10(%rsp)
je 0x11b42
movq 0x2830(%rbx), %r13
movq -0x8(%r13,%r12,8), %rdi
callq 0xd640
movq %rax, (%r14,%rbp,8)
movq (%r13,%r12,8), %rdi
callq 0xd640
movq %rax, (%r15,%rbp,8)
incq %rbp
addq $0x3, %r12
jmp 0x11b0f
movq (%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq 0x8(%rsp), %rcx
callq 0x18d58
xorl %r12d, %r12d
cmpq 0x2838(%rbx), %r12
jge 0x11b79
movq (%r14,%r12,8), %rdi
callq 0xd090
movq (%r15,%r12,8), %rdi
callq 0xd090
incq %r12
jmp 0x11b59
movq %r14, %rdi
callq 0xd090
movq %r15, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd090