LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: calculate_filename_uri
static bool _calculate_filename_uri(const char* name, char* uri, size_t size){
#if defined(PLATFORM_WINDOWS)
     char* full_file_path = _fullpath(NULL, name, size);
     strncpy(uri, full_file_path, size);
     free(full_file_path);
     if(!_convert_windows_path_to_uri(uri, size)){
          return false;
     }
#else
     char* full_file_path = realpath(name, NULL);
     snprintf(uri, size, "file://%s", full_file_path);
     free(full_file_path);
#endif
     return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
xorl %esi, %esi
callq 0xd410
movq %rax, %r14
leaq 0x19863(%rip), %rdx     # 0x2f06a
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0xd260
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xd090
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_file_close
bool ce_clangd_file_close(CeClangD_t* clangd, CeBuffer_t* buffer){
     if(clangd->buffer == NULL){
          return true;
     }
     CeAppBufferData_t* buffer_data = buffer->app_data;
     if(buffer_data->syntax_function != ce_syntax_highlight_c &&
        buffer_data->syntax_function != ce_syntax_highlight_cpp){
          return true;
     }
     char file_uri[MAX_PATH_LEN + 1];
     if(!_calculate_filename_uri(buffer->name, file_uri, MAX_PATH_LEN)){
          return false;
     }

     CeJsonObj_t obj = {};
     ce_json_obj_set_string(&obj, "jsonrpc", "2.0");
     ce_json_obj_set_string(&obj, "method", "textDocument/didClose");

     CeJsonObj_t text_document_obj = {};
     ce_json_obj_set_string(&text_document_obj, "uri", file_uri);
     CeJsonObj_t param_obj = {};
     ce_json_obj_set_obj(&param_obj, "textDocument", &text_document_obj);
     ce_json_obj_set_obj(&obj, "params", &param_obj);

     bool result = _send_json_obj(&obj, &clangd->proc);
     ce_json_obj_free(&param_obj);
     ce_json_obj_free(&text_document_obj);
     ce_json_obj_free(&obj);
     return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x440, %rsp            # imm = 0x440
movb $0x1, %bpl
cmpq $0x0, 0x28(%rdi)
je 0x1592e
movq 0x58(%rsi), %rax
movq 0x600(%rax), %rax
cmpq 0x24709(%rip), %rax     # 0x39f60
setne %cl
cmpq 0x246f7(%rip), %rax     # 0x39f58
setne %al
testb %al, %cl
jne 0x1592e
movq %rdi, %rbx
movq 0x10(%rsi), %rdi
leaq 0x30(%rsp), %r12
movq %r12, %rsi
callq 0x157ef
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r14
movaps %xmm0, (%r14)
leaq 0x197b6(%rip), %rsi     # 0x2f049
leaq 0x197b7(%rip), %rdx     # 0x2f051
movq %r14, %rdi
callq 0x1c4b8
leaq 0x19417(%rip), %rsi     # 0x2ecc0
leaq 0x19838(%rip), %rdx     # 0x2f0e8
movq %r14, %rdi
callq 0x1c4b8
leaq 0x10(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
leaq 0x19338(%rip), %rsi     # 0x2ec03
movq %r15, %rdi
movq %r12, %rdx
callq 0x1c4b8
movq %rsp, %r12
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
leaq 0x197f3(%rip), %rsi     # 0x2f0db
movq %r12, %rdi
movq %r15, %rdx
callq 0x1c1a3
leaq 0x19302(%rip), %rsi     # 0x2ebfc
movq %r14, %rdi
movq %r12, %rdx
callq 0x1c1a3
addq $0x8, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x155b2
movl %eax, %ebp
movq %r12, %rdi
callq 0x1c6aa
movq %r15, %rdi
callq 0x1c6aa
movq %r14, %rdi
callq 0x1c6aa
movl %ebp, %eax
addq $0x440, %rsp            # imm = 0x440
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_request_goto_type_def
bool ce_clangd_request_goto_type_def(CeClangD_t* clangd, CeBuffer_t* buffer, CePoint_t point){
     if(clangd->buffer == NULL){
          return true;
     }
     const char* method = "textDocument/typeDefinition";
     clangd->current_request_id++;
     _clangd_track_request(clangd, method);
     return _clangd_request_goto(clangd, buffer, point, method);
}

// Assembly:
cmpq $0x0, 0x28(%rdi)
je 0x15b13
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
incq 0x30(%rdi)
leaq 0x19138(%rip), %r13     # 0x2ec27
movq %r13, %rsi
callq 0x15b16
movq 0x10(%r12), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x15b6e
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: clangd_request_goto
static bool _clangd_request_goto(CeClangD_t* clangd, CeBuffer_t* buffer, CePoint_t point,
                                 const char* method){
     char file_uri[MAX_PATH_LEN + 1];
     if(!_calculate_filename_uri(buffer->name, file_uri, MAX_PATH_LEN)){
          return false;
     }

     CeJsonObj_t obj = {};
     ce_json_obj_set_string(&obj, "jsonrpc", "2.0");
     ce_json_obj_set_number(&obj, "id", clangd->current_request_id);
     ce_json_obj_set_string(&obj, "method", method);

     CeJsonObj_t param_obj = {};

     CeJsonObj_t pos_obj = {};
     ce_json_obj_set_number(&pos_obj, "line", point.y);
     ce_json_obj_set_number(&pos_obj, "character", point.x);
     ce_json_obj_set_obj(&param_obj, "position", &pos_obj);

     CeJsonObj_t text_document_obj = {};
     ce_json_obj_set_string(&text_document_obj, "uri", file_uri);
     ce_json_obj_set_obj(&param_obj, "textDocument", &text_document_obj);

     ce_json_obj_set_obj(&obj, "params", &param_obj);

     bool result = _send_json_obj(&obj, &clangd->proc);
     ce_json_obj_free(&text_document_obj);
     ce_json_obj_free(&pos_obj);
     ce_json_obj_free(&param_obj);
     ce_json_obj_free(&obj);
     return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %rax
movq %rdi, %r14
leaq 0x40(%rsp), %rsi
movq %rax, %rdi
callq 0x157ef
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rbx
movaps %xmm0, (%rbx)
leaq 0x1949c(%rip), %rsi     # 0x2f049
leaq 0x1949d(%rip), %rdx     # 0x2f051
movq %rbx, %rdi
callq 0x1c4b8
xorps %xmm0, %xmm0
cvtsi2sdq 0x30(%r14), %xmm0
leaq 0x1a504(%rip), %rsi     # 0x300d0
movq %rbx, %rdi
callq 0x1c53b
leaq 0x190e5(%rip), %rsi     # 0x2ecc0
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1c4b8
leaq 0x20(%rsp), %r15
xorpd %xmm0, %xmm0
movapd %xmm0, (%r15)
leaq 0x10(%rsp), %r13
movapd %xmm0, (%r13)
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
leaq 0x180af(%rip), %rsi     # 0x2dcbd
movq %r13, %rdi
callq 0x1c53b
xorps %xmm0, %xmm0
cvtsi2sd %rbp, %xmm0
leaq 0x18fcd(%rip), %rsi     # 0x2ebf2
movq %r13, %rdi
callq 0x1c53b
leaq 0x1957c(%rip), %rsi     # 0x2f1b0
movq %r15, %rdi
movq %r13, %rdx
callq 0x1c1a3
movq %rsp, %r12
xorpd %xmm0, %xmm0
movapd %xmm0, (%r12)
leaq 0x18fb0(%rip), %rsi     # 0x2ec03
movq %r12, %rdi
leaq 0x40(%rsp), %rdx
callq 0x1c4b8
leaq 0x19474(%rip), %rsi     # 0x2f0db
movq %r15, %rdi
movq %r12, %rdx
callq 0x1c1a3
leaq 0x18f83(%rip), %rsi     # 0x2ebfc
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1c1a3
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x155b2
movl %eax, %ebp
movq %r12, %rdi
callq 0x1c6aa
movq %r13, %rdi
callq 0x1c6aa
movq %r15, %rdi
callq 0x1c6aa
movq %rbx, %rdi
callq 0x1c6aa
movl %ebp, %eax
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_request_goto_decl
bool ce_clangd_request_goto_decl(CeClangD_t* clangd, CeBuffer_t* buffer, CePoint_t point){
     if(clangd->buffer == NULL){
          return true;
     }
     const char* method = "textDocument/declaration";
     clangd->current_request_id++;
     _clangd_track_request(clangd, method);
     return _clangd_request_goto(clangd, buffer, point, method);
}

// Assembly:
cmpq $0x0, 0x28(%rdi)
je 0x15d68
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
incq 0x30(%rdi)
leaq 0x18f1a(%rip), %r13     # 0x2ec5b
movq %r13, %rsi
callq 0x15b16
movq 0x10(%r12), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x15b6e
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_request_auto_complete
bool ce_clangd_request_auto_complete(CeClangD_t* clangd, CeBuffer_t* buffer, CePoint_t point){
     if(clangd->buffer == NULL){
          return true;
     }
     const char* method = "textDocument/completion";
     clangd->current_request_id++;
     _clangd_track_request(clangd, method);
     return _clangd_request_goto(clangd, buffer, point, method);
}

// Assembly:
cmpq $0x0, 0x28(%rdi)
je 0x15db9
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
incq 0x30(%rdi)
leaq 0x18efe(%rip), %r13     # 0x2ec90
movq %r13, %rsi
callq 0x15b16
movq 0x10(%r12), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x15b6e
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_request_find_references
bool ce_clangd_request_find_references(CeClangD_t* clangd, CeBuffer_t* buffer, CePoint_t point){
     if(clangd->buffer == NULL){
          return true;
     }
     const char* method = "textDocument/references";
     clangd->current_request_id++;
     _clangd_track_request(clangd, method);
     return _clangd_request_goto(clangd, buffer, point, method);
}

// Assembly:
cmpq $0x0, 0x28(%rdi)
je 0x15e0a
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
incq 0x30(%rdi)
leaq 0x18ec5(%rip), %r13     # 0x2eca8
movq %r13, %rsi
callq 0x15b16
movq 0x10(%r12), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x15b6e
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_pop_response
CeClangDResponse_t ce_clangd_pop_response(CeClangD_t* clangd){
     if(clangd->buffer == NULL){
          return (CeClangDResponse_t){};
     }
     CeClangDResponse_t response = _pop_response(&clangd->response_queue);
     for(int64_t i = 0; i < clangd->request_lookup.size; i++){
          if(clangd->request_lookup.requests[i].id == response.request_id){
               response.method = clangd->request_lookup.requests[i].method;
               _remove_clangd_request(&clangd->request_lookup, i);
               return response;
          }
     }
     return response;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x28(%rsi)
je 0x15ead
movq %rsi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x48(%rsi), %r15
movq %r15, %rdi
callq 0xd700
testl %eax, %eax
je 0x15ec0
leaq 0x192e0(%rip), %r15     # 0x2f135
movl %eax, %edi
callq 0xd650
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xd954
movq 0x70(%r14), %r15
testq %r15, %r15
jle 0x15f6f
movq 0x78(%r14), %rdi
movq (%rbx), %rdx
movl $0x10, %eax
movq $-0x1, %rcx
cmpq %rdx, -0x8(%rdi,%rax)
je 0x15f26
addq $0x10, %rax
leaq (%r15,%rcx), %rsi
decq %rsi
decq %rcx
cmpq $-0x1, %rsi
jne 0x15e89
jmp 0x15f6f
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
jmp 0x15f6f
movq 0x38(%r14), %r13
testq %r13, %r13
je 0x15e69
movq 0x40(%r14), %rdi
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
movups (%rdi), %xmm0
movups %xmm0, (%rbx)
leaq 0x18(%rdi), %rsi
leaq -0x8(,%r13,8), %rax
decq %r13
leaq (%rax,%rax,2), %r12
movq %r12, %rdx
callq 0xd580
movq 0x40(%r14), %rdi
movq %r12, %rsi
callq 0xd520
movq %rax, 0x40(%r14)
movq %r13, 0x38(%r14)
movq %r15, %rdi
callq 0xd490
testl %eax, %eax
je 0x15e69
leaq 0x19245(%rip), %r15     # 0x2f166
jmp 0x15e55
movq -0x10(%rdi,%rax), %rdx
movq %rdx, 0x10(%rbx)
negq %rcx
cmpq %r15, %rcx
jae 0x15f58
movq 0x78(%r14), %rdx
movups (%rdx,%rax), %xmm0
movups %xmm0, -0x10(%rdx,%rax)
incq %rcx
movq 0x70(%r14), %r15
addq $0x10, %rax
cmpq %r15, %rcx
jl 0x15f37
movq 0x78(%r14), %rdi
decq %r15
movq %r15, %rsi
shlq $0x4, %rsi
callq 0xd520
movq %rax, 0x78(%r14)
movq %r15, 0x70(%r14)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_free
void ce_clangd_free(CeClangD_t* clangd){
     if(clangd->buffer == NULL){
          return;
     }
#if defined(PLATFORM_WINDOWS)
     ce_subprocess_kill(&clangd->proc, 0);
     CloseHandle(clangd->thread_handle);
#else
     ce_subprocess_kill(&clangd->proc, SIGINT);
#endif

#if defined(PLATFORM_WINDOWS)
     CloseHandle(clangd->thread_handle);
     CloseHandle(clangd->response_queue.mutex);
#else
     pthread_join(clangd->thread, NULL);
     pthread_mutex_destroy(&clangd->response_queue.mutex);
#endif

     memset(clangd, 0, sizeof(*clangd));
}

// Assembly:
cmpq $0x0, 0x28(%rdi)
je 0x15fcb
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rdi
movl $0x2, %esi
callq 0x1f6cf
movq (%rbx), %rdi
xorl %esi, %esi
callq 0xd630
leaq 0x48(%rbx), %rdi
callq 0xd250
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x70(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_response_free
void ce_clangd_response_free(CeClangDResponse_t* response){
     if(response->obj == NULL){
          return;
     }
     ce_json_obj_free(response->obj);
     free(response->obj);
     free(response->method);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x15ff1
callq 0x1c6aa
movq 0x8(%rbx), %rdi
callq 0xd090
movq 0x10(%rbx), %rdi
popq %rbx
jmp 0xd090
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_diag_free
void ce_clangd_diag_free(CeClangDDiagnostics_t* diags){
    for(int64_t i = 0; i < diags->count; i++){
        free(diags->elements[i].message);
    }
    free(diags->elements);
    free(diags->filepath);
    memset(diags, 0, sizeof(*diags));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
jle 0x16093
movl $0x20, %r14d
xorl %r15d, %r15d
movq (%rbx), %rax
movq (%rax,%r14), %rdi
callq 0xd090
incq %r15
addq $0x28, %r14
cmpq 0x8(%rbx), %r15
jl 0x1607a
movq (%rbx), %rdi
callq 0xd090
movq 0x10(%rbx), %rdi
callq 0xd090
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_command.c
// Function: eat_blanks
static const char* eat_blanks(const char* string){
     while(*string){
          if(!isblank((int)(*string))) break;
          string++;
     }

     return string;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x16313
callq 0xd720
movq (%rax), %rax
movsbq %bpl, %rcx
testb $0x1, (%rax,%rcx,2)
je 0x16313
movb 0x1(%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0x162fd
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_command.c
// Function: find_end_of_arg
static const char* find_end_of_arg(const char* string){
     bool quote = (*string == '"');

     if(quote){
          // find the next quote, ignoring backslashed quotes
          char prev = 0;
          while(*string){
               prev = *string;
               string++;
               if(*string == '"' && prev != '\\'){
                    const char* end = string + 1;
                    if(*end) return end;
                    return NULL;
               }
          }
          return NULL;
     }else{
          return strchr(string, ' ');
     }
}

// Assembly:
cmpb $0x22, (%rdi)
jne 0x16350
incq %rdi
movb $0x22, %cl
xorl %eax, %eax
testb %cl, %cl
je 0x1634f
movb (%rdi), %dl
cmpb $0x22, %dl
setne %sil
cmpb $0x5c, %cl
sete %cl
incq %rdi
orb %sil, %cl
movl %edx, %ecx
jne 0x16329
xorl %eax, %eax
cmpb $0x0, (%rdi)
cmovneq %rdi, %rax
retq
movl $0x20, %esi
jmp 0xd230
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_command.c
// Function: parse_arg
static bool parse_arg(CeCommandArg_t* arg, const char* string){
     if(*string == 0) return false;

     int64_t size = 0;
     bool digits_only = true;
     bool decimal = false;
     const char* itr = string;

     while(*itr){
          if(!isdigit((int)(*itr))){
               if(*itr == '.'){
                    decimal = true;
               }else if(*itr == '-' ||
                        *itr == '+'){
                    // ignore
               }else{
                    digits_only = false;
               }
          }
          itr++;
          size++;
     }

     if(decimal && digits_only && size == 1){
         digits_only = false;
     }

     if(digits_only){
          if(decimal){
               arg->type = CE_COMMAND_ARG_DECIMAL;
               arg->decimal = atof(string);
          }else{
               arg->type = CE_COMMAND_ARG_INTEGER;
               arg->integer = atoi(string);
          }
     }else{
          // skip over the first quote if one is there
          if(string[0] == '"') string++;

          arg->type = CE_COMMAND_ARG_STRING;
          arg->string = strdup(string);
          int64_t len = strlen(arg->string);

          // overwrite last quote with null terminator
          if(arg->string[len - 1] == '"') arg->string[len - 1] = 0;
     }

     return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movb (%rsi), %bpl
testb %bpl, %bpl
je 0x16438
movq %rsi, %r14
movq %rdi, %rbx
callq 0xd720
movq (%rax), %rcx
movb $0x1, %al
movl $0x1, %edx
xorl %esi, %esi
movl %ebp, %r8d
movl %esi, %edi
movsbq %r8b, %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
jne 0x163ac
cmpb $0x2b, %r8b
je 0x163ac
movzbl %r8b, %r8d
cmpl $0x2d, %r8d
je 0x163ac
movb $0x1, %sil
cmpl $0x2e, %r8d
je 0x163ae
xorl %eax, %eax
movl %edi, %esi
movb (%r14,%rdx), %r8b
incq %rdx
testb %r8b, %r8b
jne 0x16384
cmpq $0x2, %rdx
setne %cl
movl %esi, %edx
andb %al, %dl
notb %dl
orb %cl, %dl
andb %al, %dl
testb $0x1, %dl
je 0x163eb
testb $0x1, %sil
je 0x16424
movl $0x1, (%rbx)
movq %r14, %rdi
callq 0xd190
movsd %xmm0, 0x8(%rbx)
jmp 0x16438
xorl %eax, %eax
cmpb $0x22, %bpl
sete %al
addq %rax, %r14
movl $0x2, (%rbx)
movq %r14, %rdi
callq 0xd640
movq %rax, %r14
movq %rax, 0x8(%rbx)
movq %rax, %rdi
callq 0xd210
cmpb $0x22, -0x1(%r14,%rax)
jne 0x16438
movb $0x0, -0x1(%r14,%rax)
jmp 0x16438
movl $0x0, (%rbx)
movq %r14, %rdi
callq 0xd5f0
cltq
movq %rax, 0x8(%rbx)
testb %bpl, %bpl
setne %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_command.c
// Function: ce_command_free
void ce_command_free(CeCommand_t* command){
     memset(command, 0, CE_COMMAND_NAME_MAX_LEN);

     for(int64_t i = 0; i < command->arg_count; ++i){
          if(command->args[i].type == CE_COMMAND_ARG_STRING){
               free(command->args[i].string);
          }
     }

     free(command->args);
     command->args = NULL;
     command->arg_count = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0xd2a0
movq 0x208(%rbx), %rax
testq %rax, %rax
jle 0x16497
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x200(%rbx), %rcx
cmpl $0x2, -0x8(%rcx,%r14)
jne 0x1648b
movq (%rcx,%r14), %rdi
callq 0xd090
movq 0x208(%rbx), %rax
incq %r15
addq $0x10, %r14
cmpq %rax, %r15
jl 0x1646c
movq 0x200(%rbx), %rdi
callq 0xd090
xorps %xmm0, %xmm0
movups %xmm0, 0x200(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_command.c
// Function: ce_command_log
void ce_command_log(CeCommand_t* command){
     ce_log("command: '%s', %ld args\n", command->name, command->arg_count);

     for(int64_t i = 0; i < command->arg_count; ++i){
          CeCommandArg_t* arg = command->args + i;
          switch(arg->type){
          default:
               break;
          case CE_COMMAND_ARG_INTEGER:
               ce_log("  %ld\n", arg->integer);
               break;
          case CE_COMMAND_ARG_DECIMAL:
               ce_log("  %f\n", arg->decimal);
               break;
          case CE_COMMAND_ARG_STRING:
               ce_log("  '%s'\n", arg->string);
               break;
          }
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x208(%rdi), %rdx
leaq 0x18d4a(%rip), %rdi     # 0x2f219
movq %rbx, %rsi
xorl %eax, %eax
callq 0xd954
cmpq $0x0, 0x208(%rbx)
jle 0x16553
movl $0x8, %r13d
leaq 0x18d4f(%rip), %r14     # 0x2f23f
leaq 0x18d42(%rip), %r15     # 0x2f239
leaq 0x18d34(%rip), %r12     # 0x2f232
xorl %ebp, %ebp
movq 0x200(%rbx), %rax
movl -0x8(%rax,%r13), %ecx
cmpl $0x2, %ecx
je 0x16535
cmpl $0x1, %ecx
je 0x16523
testl %ecx, %ecx
jne 0x16543
movq (%rax,%r13), %rsi
movq %r12, %rdi
jmp 0x1653c
movsd (%rax,%r13), %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0xd954
jmp 0x16543
movq (%rax,%r13), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0xd954
incq %rbp
addq $0x10, %r13
cmpq 0x208(%rbx), %rbp
jl 0x16500
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_quit
CeCommandStatus_t command_quit(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;
     CommandContext_t command_context = {};

     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;

     bool unsaved_buffers = false;
     CeBufferNode_t* itr = app->buffer_node_head;
     while(itr){
          if(itr->buffer->status == CE_BUFFER_STATUS_MODIFIED && itr->buffer != app->input_view.buffer){
               unsaved_buffers = true;
               break;
          }
          itr = itr->next;
     }

     if(unsaved_buffers){
          ce_view_switch_buffer(command_context.view, app->buffer_list_buffer, &app->vim,
                                &app->config_options, true);
          ce_app_input(app, UNSAVED_BUFFERS_DIALOGUE, unsaved_buffers_input_complete_func);
     }else{
          app->quit = true;
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x0, 0x208(%rdi)
je 0x16577
retq
pushq %rbx
movq %rsi, %rbx
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
jne 0x16608
movq 0x2818(%rbx), %rax
movq 0x2828(%rbx), %rcx
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdx
xorl %eax, %eax
cmpl $0x0, (%rdx)
leaq 0x8(%rdx), %rdi
cmovneq %rax, %rdi
testq %rcx, %rcx
je 0x165ca
movq (%rcx), %rdx
cmpl $0x1, 0x18(%rdx)
jne 0x165c4
cmpq 0x2748(%rbx), %rdx
jne 0x165d3
movq 0x8(%rcx), %rcx
jmp 0x165ad
movb $0x1, 0x2c78(%rbx)
jmp 0x16608
movq 0x2848(%rbx), %rsi
leaq 0x20(%rbx), %rdx
leaq 0x1a50(%rbx), %rcx
movl $0x1, %r8d
callq 0x11135
leaq 0x18c50(%rip), %rsi     # 0x2f247
leaq -0x2977(%rip), %rdx     # 0x13c87
movq %rbx, %rdi
callq 0x12487
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_save_buffer
CeCommandStatus_t command_save_buffer(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;
     CommandContext_t command_context = {};

     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;

     try_save_buffer(app, command_context.view->buffer);

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x0, 0x208(%rdi)
je 0x1685e
retq
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
jne 0x1685d
pushq %rax
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x48(%rax), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x16893
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: try_save_buffer
static bool try_save_buffer(CeApp_t* app, CeBuffer_t* buffer){
     struct stat statbuf;
     if(stat(buffer->name, &statbuf) == 0){
          if(statbuf.st_mtime > buffer->file_modified_time){
               ce_app_input(app, BUFFER_MODIFIED_OUTSIDE_EDITOR, buffer_modified_outside_editor_complete_func);
               return false;
          }
     }
     if(app->user_config.save_func){
         app->user_config.save_func(app, buffer);
     }
     return ce_buffer_save(buffer);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rdi
leaq 0x8(%rsp), %rsi
callq 0xd3f0
testl %eax, %eax
jne 0x168e3
movq 0x60(%rsp), %rax
cmpq 0x68(%rbx), %rax
jle 0x168e3
leaq 0x18cc6(%rip), %rsi     # 0x2f58d
leaq -0x2c1d(%rip), %rdx     # 0x13cb1
movq %r14, %rdi
callq 0x12487
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
retq
movq 0x2ca0(%r14), %rax
testq %rax, %rax
je 0x168f7
movq %r14, %rdi
movq %rbx, %rsi
callq *%rax
movq %rbx, %rdi
addq $0x98, %rsp
popq %rbx
popq %r14
jmp 0xe2af
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_save_all_and_quit
CeCommandStatus_t command_save_all_and_quit(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;

     CeBufferNode_t* itr = app->buffer_node_head;
     while(itr){
          if(itr->buffer->status == CE_BUFFER_STATUS_MODIFIED){
               if(!try_save_buffer(app, itr->buffer)){
                    return CE_COMMAND_SUCCESS;
               }
          }
          itr = itr->next;
     }

     return command_quit(command, user_data);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl $0x2, %eax
cmpq $0x0, 0x208(%rdi)
je 0x16923
popq %rbx
popq %r14
popq %r15
retq
movq %rsi, %rbx
movq %rdi, %r14
movq 0x2828(%rsi), %r15
testq %r15, %r15
je 0x16950
movq (%r15), %rsi
cmpl $0x1, 0x18(%rsi)
jne 0x1694a
movq %rbx, %rdi
callq 0x16893
testb %al, %al
je 0x16960
movq 0x8(%r15), %r15
jmp 0x16930
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x16567
xorl %eax, %eax
jmp 0x1691d
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_show_info_buffer
CeCommandStatus_t command_show_info_buffer(CeCommand_t* command, void* user_data, CeBuffer_t* buffer){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;
     CeApp_t* app = user_data;
     CommandContext_t command_context = {};
     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;
     ce_view_switch_buffer(command_context.view, buffer, &app->vim, &app->config_options, true);
     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbx
movl $0x2, %ebx
cmpq $0x0, 0x208(%rdi)
jne 0x169be
movq %rsi, %rcx
movl $0x3, %ebx
cmpq $0x0, 0x27f8(%rsi)
jne 0x169be
movq 0x2818(%rcx), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x8(%rax), %rdi
xorl %ebx, %ebx
cmpl $0x0, (%rax)
cmovneq %rbx, %rdi
leaq 0x20(%rcx), %rax
addq $0x1a50, %rcx           # imm = 0x1A50
movq %rdx, %rsi
movq %rax, %rdx
movl $0x1, %r8d
callq 0x11135
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: split_layout
CeLayout_t* split_layout(CeApp_t* app, bool vertical){
     CeLayout_t* tab_layout = app->tab_list_layout->tab_list.current;
     bool always_add_last = false;
     CeLayout_t* new_layout = ce_layout_split(tab_layout, vertical, always_add_last);

     if(new_layout){
          ce_view_follow_cursor(&new_layout->view, app->config_options.horizontal_scroll_off,
                                app->config_options.vertical_scroll_off, app->config_options.tab_width);
          tab_layout->tab.current = new_layout;

          CeLayout_t* parent = ce_layout_find_parent(tab_layout, new_layout);
          if(parent && parent->type == CE_LAYOUT_TYPE_LIST){
               for(int64_t i = 0; i < parent->list.layout_count; i++){
                    CeLayout_t* layout = parent->list.layouts[i];
                    ce_view_follow_cursor(&layout->view, app->config_options.horizontal_scroll_off,
                                          app->config_options.vertical_scroll_off, app->config_options.tab_width);

               }
          }
     }

     return new_layout;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x2818(%rdi), %rax
movq 0x10(%rax), %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x1deb4
movq %rax, %r14
testq %rax, %rax
je 0x16a9c
movq %r14, %rdi
addq $0x8, %rdi
movq 0x1a58(%rbx), %rcx
movq 0x1a60(%rbx), %rsi
movq 0x1a68(%rbx), %rdx
callq 0xfdb4
movq %r14, 0x10(%r15)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1e10f
testq %rax, %rax
je 0x16a9c
movq %rax, %r15
cmpl $0x1, (%rax)
jne 0x16a9c
cmpq $0x0, 0x10(%r15)
jle 0x16a9c
xorl %r12d, %r12d
movq 0x8(%r15), %rax
movq (%rax,%r12,8), %rdi
addq $0x8, %rdi
movq 0x1a58(%rbx), %rcx
movq 0x1a60(%rbx), %rsi
movq 0x1a68(%rbx), %rdx
callq 0xfdb4
incq %r12
cmpq 0x10(%r15), %r12
jl 0x16a6d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_split_layout
CeCommandStatus_t command_split_layout(CeCommand_t* command, void* user_data){
     if(command->arg_count != 1) return CE_COMMAND_PRINT_HELP;
     if(command->args[0].type != CE_COMMAND_ARG_STRING) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;
     bool vertical = false;

     if(strcmp(command->args[0].string, "vertical") == 0){
          vertical = true;
     }else if(strcmp(command->args[0].string, "horizontal") == 0){
          // pass
     }else{
          return CE_COMMAND_PRINT_HELP;
     }

     CeLayout_t* new_layout = split_layout(app, vertical);
     if(new_layout == NULL){
         return CE_COMMAND_FAILURE;
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x2, %ebx
cmpq $0x1, 0x208(%rdi)
jne 0x16b3b
movq 0x200(%rdi), %rax
cmpl $0x2, (%rax)
jne 0x16b3b
movq %rsi, %r14
movq 0x8(%rax), %r15
leaq 0x187cf(%rip), %rsi     # 0x2f2d1
movq %r15, %rdi
callq 0xd390
movl %eax, %ebp
testl %eax, %eax
je 0x16b23
leaq 0x187c3(%rip), %rsi     # 0x2f2da
movq %r15, %rdi
callq 0xd390
testl %eax, %eax
jne 0x16b3b
xorl %esi, %esi
testl %ebp, %ebp
sete %sil
movq %r14, %rdi
callq 0x169fe
xorl %ebx, %ebx
testq %rax, %rax
sete %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_resize_layout
CeCommandStatus_t command_resize_layout(CeCommand_t* command, void* user_data){
     if(command->arg_count != 3) return CE_COMMAND_PRINT_HELP;
     if(command->args[0].type != CE_COMMAND_ARG_STRING) return CE_COMMAND_PRINT_HELP;
     if(command->args[1].type != CE_COMMAND_ARG_STRING) return CE_COMMAND_PRINT_HELP;
     if(command->args[2].type != CE_COMMAND_ARG_INTEGER) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;
     CeLayout_t* tab_layout = app->tab_list_layout->tab_list.current;
     CeLayout_t* current_layout = tab_layout->tab.current;
     bool expand = false;
     CeDirection_t direction;

     if(strcmp(command->args[0].string, "expand") == 0){
         expand = true;
     }else if(strcmp(command->args[0].string, "shrink") == 0){
          // pass
     }else{
          return CE_COMMAND_PRINT_HELP;
     }

     if(strcmp(command->args[1].string, "left") == 0){
          direction = CE_LEFT;
     }else if(strcmp(command->args[1].string, "right") == 0){
          direction = CE_RIGHT;
     }else if(strcmp(command->args[1].string, "up") == 0){
          direction = CE_UP;
     }else if(strcmp(command->args[1].string, "down") == 0){
          direction = CE_DOWN;
     }else{
          return CE_COMMAND_PRINT_HELP;
     }

     if(ce_layout_resize_rect(app->tab_list_layout, current_layout, app->terminal_rect, direction, expand, command->args[2].integer)){
          return CE_COMMAND_SUCCESS;
     }

     return CE_COMMAND_FAILURE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl $0x2, %r12d
cmpq $0x3, 0x208(%rdi)
jne 0x16c70
movq 0x200(%rdi), %r15
cmpl $0x2, (%r15)
jne 0x16c70
cmpl $0x2, 0x10(%r15)
jne 0x16c70
cmpl $0x0, 0x20(%r15)
jne 0x16c70
movq %rsi, %rbx
movq 0x2818(%rsi), %r14
movq 0x10(%r14), %rax
movq 0x10(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x8(%r15), %r13
leaq 0x18732(%rip), %rsi     # 0x2f2e5
movq %r13, %rdi
callq 0xd390
movl %eax, %ebp
testl %eax, %eax
je 0x16bd8
leaq 0x18724(%rip), %rsi     # 0x2f2ec
movq %r13, %rdi
callq 0xd390
testl %eax, %eax
jne 0x16c70
movq 0x18(%r15), %r12
leaq 0x19bad(%rip), %rsi     # 0x30790
movq %r12, %rdi
callq 0xd390
testl %eax, %eax
je 0x16c39
leaq 0x19b80(%rip), %rsi     # 0x30776
movq %r12, %rdi
callq 0xd390
testl %eax, %eax
je 0x16c3d
cmpb $0x75, (%r12)
jne 0x16c19
cmpb $0x70, 0x1(%r12)
jne 0x16c19
cmpb $0x0, 0x2(%r12)
je 0x16c82
leaq 0x19b3d(%rip), %rsi     # 0x3075d
movq %r12, %rdi
callq 0xd390
movl $0x2, %r12d
testl %eax, %eax
jne 0x16c70
movl $0x3, %edx
jmp 0x16c42
xorl %edx, %edx
jmp 0x16c42
movl $0x2, %edx
xorl %ecx, %ecx
testl %ebp, %ebp
sete %cl
movq 0x28(%r15), %r8
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r14, %rdi
movq 0x20(%rsp), %rsi
callq 0x1e54b
xorb $0x1, %al
movzbl %al, %r12d
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edx
jmp 0x16c42
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_select_parent_layout
CeCommandStatus_t command_select_parent_layout(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;
     CeLayout_t* tab_layout = app->tab_list_layout->tab_list.current;

     CeLayout_t* layout = ce_layout_find_parent(tab_layout, tab_layout->tab.current);
     if(layout){
          tab_layout->tab.current = layout;
     }else{
          ce_app_message(app, "current layout has no parent");
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl $0x2, %ebp
cmpq $0x0, 0x208(%rdi)
jne 0x16cd6
movq %rsi, %rbx
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %r14
movq 0x10(%r14), %rsi
movq %r14, %rdi
callq 0x1e10f
testq %rax, %rax
je 0x16cc3
movq %rax, 0x10(%r14)
xorl %ebp, %ebp
jmp 0x16cd6
leaq 0x18629(%rip), %rsi     # 0x2f2f3
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0x122dd
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_open_popup_view
CeCommandStatus_t command_open_popup_view(CeCommand_t* command, void* user_data){
     if(command->arg_count < 0 || command->arg_count > 1) return CE_COMMAND_PRINT_HELP;
     if(command->arg_count == 1 &&
        command->args[0].type != CE_COMMAND_ARG_STRING){
         return CE_COMMAND_PRINT_HELP;
     }
     CeApp_t* app = user_data;
     CeBuffer_t* buffer = app->shell_command_buffer;
     if(command->arg_count == 0){
         if(app->last_popup_buffer){
             buffer = app->last_popup_buffer;
         }
     }else{
         CeBufferNode_t* itr = app->buffer_node_head;
         while(itr){
              if(strcmp(itr->buffer->name, command->args[0].string) == 0){
                  buffer = itr->buffer;
                  break;
              }
              itr = itr->next;
         }
     }
     if(!ce_app_open_popup_view(app, buffer)) return CE_COMMAND_FAILURE;
     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x1, 0x208(%rdi)
ja 0x16ed6
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
jne 0x16eaa
movq 0x200(%rdi), %rcx
cmpl $0x2, (%rcx)
jne 0x16ecd
movq 0x2828(%rbx), %r13
movq 0x2880(%rbx), %r12
testq %r13, %r13
je 0x16ea5
movq 0x8(%rcx), %r15
movq (%r13), %r14
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0xd390
testl %eax, %eax
je 0x16ebd
movq 0x8(%r13), %r13
testq %r13, %r13
jne 0x16e88
movq %r12, %r14
jmp 0x16ebd
movq 0x2dd0(%rbx), %r14
testq %r14, %r14
jne 0x16ebd
movq 0x2880(%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x13a6f
xorb $0x1, %al
movzbl %al, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_create_file
CeCommandStatus_t command_create_file(CeCommand_t* command, void* user_data){
     if(command->arg_count < 0 || command->arg_count > 1) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;

     if(command->args[0].type != CE_COMMAND_ARG_STRING) return CE_COMMAND_PRINT_HELP;

     FILE* f = fopen(command->args[0].string, "w+");
     if(f == NULL){
         ce_app_message(app, "Failed to create file: %s", strerror(errno));
         return CE_COMMAND_FAILURE;
     }
     fclose(f);
     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x1, 0x208(%rdi)
ja 0x16f60
pushq %rbx
movq 0x200(%rdi), %rcx
cmpl $0x2, (%rcx)
jne 0x16f5f
movq %rsi, %rbx
movq 0x8(%rcx), %rdi
leaq 0x183ec(%rip), %rsi     # 0x2f310
callq 0xd5b0
testq %rax, %rax
je 0x16f3a
movq %rax, %rdi
callq 0xd1f0
xorl %eax, %eax
jmp 0x16f5f
callq 0xd0a0
movl (%rax), %edi
callq 0xd650
leaq 0x183c6(%rip), %rsi     # 0x2f313
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x122dd
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_rename_file
CeCommandStatus_t command_rename_file(CeCommand_t* command, void* user_data){
     if(command->arg_count < 0 || command->arg_count != 2) return CE_COMMAND_PRINT_HELP;

     if(command->args[0].type != CE_COMMAND_ARG_STRING) return CE_COMMAND_PRINT_HELP;
     if(command->args[1].type != CE_COMMAND_ARG_STRING) return CE_COMMAND_PRINT_HELP;

     int rc = rename(command->args[0].string, command->args[1].string);
     if (rc != 0) {
         ce_log("rename() failed: %s\n", strerror(errno));
         return CE_COMMAND_FAILURE;
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x2, 0x208(%rdi)
jne 0x16fbe
pushq %rax
movq 0x200(%rdi), %rcx
cmpl $0x2, (%rcx)
jne 0x16fba
cmpl $0x2, 0x10(%rcx)
jne 0x16fba
movq 0x8(%rcx), %rdi
movq 0x18(%rcx), %rsi
callq 0xd5d0
testl %eax, %eax
je 0x16fb8
callq 0xd0a0
movl (%rax), %edi
callq 0xd650
leaq 0x18386(%rip), %rdi     # 0x2f32d
movq %rax, %rsi
xorl %eax, %eax
callq 0xd954
movl $0x1, %eax
jmp 0x16fba
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_remove_file
CeCommandStatus_t command_remove_file(CeCommand_t* command, void* user_data){
     if(command->arg_count < 0 || command->arg_count > 1) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;

     if(command->args[0].type != CE_COMMAND_ARG_STRING) return CE_COMMAND_PRINT_HELP;

     int rc = remove(command->args[0].string);
     if(rc != 0){
         ce_app_message(app, "Failed to remove file: %s", strerror(errno));
         return CE_COMMAND_FAILURE;
     }
     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x1, 0x208(%rdi)
ja 0x17015
pushq %rbx
movq 0x200(%rdi), %rcx
cmpl $0x2, (%rcx)
jne 0x17014
movq %rsi, %rbx
movq 0x8(%rcx), %rdi
callq 0xd0c0
testl %eax, %eax
je 0x17012
callq 0xd0a0
movl (%rax), %edi
callq 0xd650
leaq 0x18344(%rip), %rsi     # 0x2f342
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x122dd
movl $0x1, %eax
jmp 0x17014
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_load_file
CeCommandStatus_t command_load_file(CeCommand_t* command, void* user_data){
     if(command->arg_count < 0 || command->arg_count > 1) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;
     CommandContext_t command_context = {};

     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;

     if(command->arg_count == 1){
          if(command->args[0].type != CE_COMMAND_ARG_STRING) return CE_COMMAND_PRINT_HELP;
          if(!load_file_into_view(&app->buffer_node_head, command_context.view, &app->config_options, &app->vim,
                                  true, command->args[0].string)){
               ce_app_message(app, "failed to load file %s: '%s'", command->args[0].string, strerror(errno));
          }else{
               ce_clangd_file_open(&app->clangd, app->buffer_node_head->buffer);
          }
     }else{ // it's 0
          ce_app_input(app, "Load File", load_file_input_complete_func);

          char* base_directory = buffer_base_directory(command_context.view->buffer);
          complete_files(&app->input_complete, app->input_view.buffer->lines[0], base_directory);
          free(base_directory);
          build_complete_list(app->complete_list_buffer, &app->input_complete);
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x208(%rdi), %rax
movl $0x2, %r14d
cmpq $0x1, %rax
ja 0x1712c
movq %rsi, %rbx
movl $0x3, %r14d
cmpq $0x0, 0x27f8(%rsi)
jne 0x1712c
movq 0x2818(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
xorl %r14d, %r14d
cmpl $0x0, (%rcx)
leaq 0x8(%rcx), %r12
cmovneq %r14, %r12
cmpq $0x1, %rax
jne 0x170d3
movq %rdi, %r15
movq 0x200(%rdi), %rax
cmpl $0x2, (%rax)
movl $0x2, %r14d
jne 0x1712c
leaq 0x2828(%rbx), %rdi
leaq 0x1a50(%rbx), %rdx
leaq 0x20(%rbx), %rcx
movq 0x8(%rax), %r9
movq %r12, %rsi
movl $0x1, %r8d
callq 0x1169d
testq %rax, %rax
je 0x1713b
movq 0x2828(%rbx), %rax
addq $0x2cd0, %rbx           # imm = 0x2CD0
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x15667
xorl %r14d, %r14d
jmp 0x1712c
leaq 0x1829f(%rip), %rsi     # 0x2f379
leaq -0x322c(%rip), %rdx     # 0x13eb5
movq %rbx, %rdi
callq 0x12487
movq 0x40(%r12), %rdi
callq 0x11a2b
movq %rax, %r15
leaq 0x28a0(%rbx), %r12
movq 0x2748(%rbx), %rax
movq (%rax), %rax
movq (%rax), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x11a4c
movq %r15, %rdi
callq 0xd090
movq 0x2860(%rbx), %rdi
movq %r12, %rsi
callq 0x11c24
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x200(%r15), %rax
movq 0x8(%rax), %r15
callq 0xd0a0
movl (%rax), %edi
callq 0xd650
leaq 0x18203(%rip), %rsi     # 0x2f35c
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x122dd
jmp 0x1712c
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_load_discovered_file
CeCommandStatus_t command_load_discovered_file(CeCommand_t* command, void* user_data){
    CeApp_t* app = user_data;
    CommandContext_t command_context = {};

    if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;

    if(app->discovered_filepath_count <= 0) return CE_COMMAND_NO_ACTION;

    // setup input and completion
    ce_app_input(app, "Load Discovered File", load_project_file_input_complete_func);
    ce_complete_init(&app->input_complete, (const char**)(app->discovered_filepaths), NULL, app->discovered_filepath_count);
    build_complete_list(app->complete_list_buffer, &app->input_complete);

    return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl $0x3, %r14d
cmpq $0x0, 0x27f8(%rsi)
jne 0x1775b
movq %rsi, %rbx
cmpq $0x0, 0x2cb0(%rsi)
jle 0x1775b
leaq 0x17c68(%rip), %rsi     # 0x2f383
leaq -0x36fb(%rip), %rdx     # 0x14027
movq %rbx, %rdi
callq 0x12487
leaq 0x28a0(%rbx), %r15
movq 0x2cb0(%rbx), %rcx
movq 0x2cb8(%rbx), %rsi
xorl %r14d, %r14d
movq %r15, %rdi
xorl %edx, %edx
callq 0x1994c
movq 0x2860(%rbx), %rdi
movq %r15, %rsi
callq 0x11c24
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_new_tab
CeCommandStatus_t command_new_tab(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;

     CeLayout_t* new_tab_layout = ce_layout_tab_list_add(app->tab_list_layout);
     if(!new_tab_layout) return CE_COMMAND_NO_ACTION;
     app->tab_list_layout->tab_list.current = new_tab_layout;

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x0, 0x208(%rdi)
je 0x17774
retq
pushq %rbx
movq %rsi, %rbx
movq 0x2818(%rsi), %rdi
callq 0x1dbb9
testq %rax, %rax
je 0x17798
movq 0x2818(%rbx), %rcx
movq %rax, 0x10(%rcx)
xorl %eax, %eax
jmp 0x1779d
movl $0x3, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: select_tab_left
bool select_tab_left(CeApp_t* app){
     for(int64_t i = 0; i < app->tab_list_layout->tab_list.tab_count; i++){
          if(app->tab_list_layout->tab_list.current == app->tab_list_layout->tab_list.tabs[i]){
               if(i > 0){
                    app->tab_list_layout->tab_list.current = app->tab_list_layout->tab_list.tabs[i - 1];
                    return true;
               }else{
                    // wrap around
                    app->tab_list_layout->tab_list.current = app->tab_list_layout->tab_list.tabs[app->tab_list_layout->tab_list.tab_count - 1];
                    return true;
               }
               break;
          }
     }
     return false;
}

// Assembly:
movq 0x2818(%rdi), %rcx
movq 0x18(%rcx), %rdx
testq %rdx, %rdx
jle 0x177de
movq 0x8(%rcx), %rsi
movq 0x10(%rcx), %rax
cmpq (%rsi), %rax
je 0x177e1
leaq -0x1(%rdx), %r8
xorl %r9d, %r9d
cmpq %r9, %r8
je 0x177de
leaq 0x1(%r9), %rdi
cmpq 0x8(%rsi,%r9,8), %rax
movq %rdi, %r9
jne 0x177c3
cmpq %rdx, %rdi
setl %al
jmp 0x177e5
xorl %eax, %eax
retq
movb $0x1, %al
xorl %edi, %edi
testq %rdi, %rdi
cmovneq %rdi, %rdx
movq -0x8(%rsi,%rdx,8), %rdx
movq %rdx, 0x10(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: select_tab_right
bool select_tab_right(CeApp_t* app){
     for(int64_t i = 0; i < app->tab_list_layout->tab_list.tab_count; i++){
          if(app->tab_list_layout->tab_list.current == app->tab_list_layout->tab_list.tabs[i]){
               if(i < (app->tab_list_layout->tab_list.tab_count - 1)){
                    app->tab_list_layout->tab_list.current = app->tab_list_layout->tab_list.tabs[i + 1];
                    return true;
               }else{
                    // wrap around
                    app->tab_list_layout->tab_list.current = app->tab_list_layout->tab_list.tabs[0];
                    return true;
               }
               break;
          }
     }
     return false;
}

// Assembly:
movq 0x2818(%rdi), %rcx
movq 0x18(%rcx), %rdx
testq %rdx, %rdx
jle 0x17835
movq 0x8(%rcx), %rsi
movq 0x10(%rcx), %rax
cmpq (%rsi), %rax
je 0x17838
leaq -0x1(%rdx), %r8
xorl %r9d, %r9d
cmpq %r9, %r8
je 0x17835
leaq 0x1(%r9), %rdi
cmpq 0x8(%rsi,%r9,8), %rax
movq %rdi, %r9
jne 0x1781a
cmpq %rdx, %rdi
setl %al
jmp 0x1783c
xorl %eax, %eax
retq
movb $0x1, %al
xorl %edi, %edi
decq %rdx
cmpq %rdx, %rdi
leaq 0x8(%rsi,%rdi,8), %rdx
cmovgeq %rsi, %rdx
movq (%rdx), %rdx
movq %rdx, 0x10(%rcx)
retq