LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_app.c
// Function: buffer_modified_outside_editor_complete_func
bool buffer_modified_outside_editor_complete_func(CeApp_t* app, CeBuffer_t* input_buffer){
     if(strcmp(app->input_view.buffer->lines[0], "y") == 0 ||
        strcmp(app->input_view.buffer->lines[0], "Y") == 0){
          CeLayout_t* tab_layout = app->tab_list_layout->tab_list.current;
          CeView_t* view = NULL;

          if(tab_layout->tab.current->type == CE_LAYOUT_TYPE_VIEW){
               view = &tab_layout->tab.current->view;
          }else{
               return false;
          }

          ce_buffer_save(view->buffer);
     }

     return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x2748(%rdi), %rax
movq (%rax), %rax
movq (%rax), %r14
leaq 0x1cbb8(%rip), %rsi     # 0x30acd
movq %r14, %rdi
callq 0xd390
testl %eax, %eax
je 0x13f38
leaq 0x1bdcb(%rip), %rsi     # 0x2fcf3
movq %r14, %rdi
callq 0xd390
movl %eax, %ecx
movb $0x1, %al
testl %ecx, %ecx
jne 0x13f5b
movq 0x2818(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
cmpl $0x0, (%rax)
je 0x13f50
xorl %eax, %eax
jmp 0x13f5b
movq 0x48(%rax), %rdi
callq 0xe2f2
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_app.c
// Function: load_project_file_input_complete_func
bool load_project_file_input_complete_func(CeApp_t* app, CeBuffer_t* input_buffer){
     // TODO: compress with code above
     CeLayout_t* tab_layout = app->tab_list_layout->tab_list.current;
     if(tab_layout->tab.current->type != CE_LAYOUT_TYPE_VIEW) return false;
     CeView_t* view = &tab_layout->tab.current->view;

     for(int64_t i = 0; i < input_buffer->line_count; i++){
          if(!load_file_into_view(&app->buffer_node_head, view, &app->config_options, &app->vim,
                                  true, input_buffer->lines[i])){
               ce_app_message(app, "failed to load file '%s': '%s'", input_buffer->lines[i], strerror(errno));
               errno = 0;
               return false;
          }else{
               if(!ce_clangd_file_open(&app->clangd, app->buffer_node_head->buffer)){
                    return false;
               }
          }
     }

     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x2818(%rdi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %r15
cmpl $0x0, (%r15)
je 0x14301
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r14
movq %rdi, (%rsp)
cmpq $0x0, 0x8(%rsi)
setle %r13b
jle 0x142ef
addq $0x8, %r15
movq (%rsp), %rax
leaq 0x2828(%rax), %r12
leaq 0x1a50(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x20(%rax), %rbp
addq $0x2cd0, %rax           # imm = 0x2CD0
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
movq (%r14), %rax
movq (%rax,%rbx,8), %r9
movq %r12, %rdi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
movq %rbp, %rcx
movl $0x1, %r8d
callq 0x118b2
testq %rax, %rax
je 0x1438f
movq (%r12), %rax
movq (%rax), %rsi
movq 0x8(%rsp), %rdi
callq 0x159ff
testb %al, %al
je 0x142ec
incq %rbx
cmpq 0x8(%r14), %rbx
setge %r13b
jl 0x1433f
jmp 0x142ef
movq (%r14), %rax
movq (%rax,%rbx,8), %rbx
callq 0xd0a0
movq %rax, %r14
movl (%rax), %edi
callq 0xd650
leaq 0x1b985(%rip), %rsi     # 0x2fd31
xorl %r13d, %r13d
movq (%rsp), %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x12502
movl $0x0, (%r14)
jmp 0x142ef
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_app.c
// Function: search_input_complete_func
bool search_input_complete_func(CeApp_t* app, CeBuffer_t* input_buffer){
     // TODO: compress with code above
     CeLayout_t* tab_layout = app->tab_list_layout->tab_list.current;
     if(tab_layout->tab.current->type != CE_LAYOUT_TYPE_VIEW) return false;
     CeView_t* view = &tab_layout->tab.current->view;

     ce_history_insert(&app->search_history, app->input_view.buffer->lines[0]);

     // update yanks
     CeVimYank_t* yank = app->vim.yanks + ce_vim_register_index('/');
     free(yank->text);
     yank->text = strdup(app->input_view.buffer->lines[0]);
     yank->type = CE_VIM_YANK_TYPE_STRING;

     // clear input buffer
     app->input_view.buffer->lines[0][0] = 0;

     // insert jump
     CeAppViewData_t* view_data = view->user_data;
     CeJumpList_t* jump_list = &view_data->jump_list;
     CeDestination_t destination = {};
     destination.point = view->cursor;
     strncpy(destination.filepath, view->buffer->name, MAX_PATH_LEN);
     ce_jump_list_insert(jump_list, destination);
     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x820, %rsp            # imm = 0x820
movq 0x2818(%rdi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %r15
movl (%r15), %ebp
testl %ebp, %ebp
jne 0x1455e
movq %rdi, %rbx
addq $0x28d0, %rdi           # imm = 0x28D0
movq 0x2748(%rbx), %rax
movq (%rax), %rax
movq (%rax), %rsi
callq 0x10b75
testq %rax, %rax
je 0x14421
movq $0x0, 0x28d8(%rbx)
movl $0x2f, %edi
callq 0x2517f
leaq (%rax,%rax,2), %r14
movq 0x1078(%rbx,%r14,8), %rdi
callq 0xd090
movq 0x2748(%rbx), %r12
movq (%r12), %rax
movq (%rax), %rdi
callq 0xd640
movq %rax, 0x1078(%rbx,%r14,8)
movl $0x1, 0x1070(%rbx,%r14,8)
movq (%r12), %rax
movq (%rax), %rax
movb $0x0, (%rax)
movq 0x50(%r15), %rbx
leaq 0x10(%rsp), %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0xd2a0
movups 0x38(%r15), %xmm0
movaps %xmm0, -0x10(%r14)
movq 0x48(%r15), %rax
movq 0x10(%rax), %rsi
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
callq 0xd0b0
leaq 0x410(%rsp), %rdi
movq %rsp, %rsi
movl $0x410, %edx            # imm = 0x410
callq 0xd420
movq 0x4100(%rbx), %rax
cmpq $0x10, %rax
jge 0x14507
testq %rax, %rax
jle 0x144e3
movq 0x4108(%rbx), %rax
incq %rax
movq %rax, 0x4108(%rbx)
movq %rax, 0x4110(%rbx)
imulq $0x410, 0x4108(%rbx), %rdi # imm = 0x410
addq %rbx, %rdi
movq %rsp, %rsi
movl $0x410, %edx            # imm = 0x410
callq 0xd580
incq 0x4100(%rbx)
jmp 0x1455e
movq 0x4108(%rbx), %rax
testq %rax, %rax
jle 0x1453f
xorl %r15d, %r15d
movq %rbx, %rdi
leaq 0x410(%rdi), %r14
movl $0x410, %edx            # imm = 0x410
movq %r14, %rsi
callq 0xd420
movq 0x4108(%rbx), %rax
incq %r15
movq %r14, %rdi
cmpq %r15, %rax
jg 0x14519
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rbx
leaq 0x410(%rsp), %rsi
movl $0x410, %edx            # imm = 0x410
movq %rbx, %rdi
callq 0xd420
testl %ebp, %ebp
sete %al
addq $0x820, %rsp            # imm = 0x820
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_app.c
// Function: switch_buffer_input_complete_func
bool switch_buffer_input_complete_func(CeApp_t* app, CeBuffer_t* input_buffer){
     // TODO: compress with code above
     CeLayout_t* tab_layout = app->tab_list_layout->tab_list.current;
     if(tab_layout->tab.current->type != CE_LAYOUT_TYPE_VIEW) return false;
     CeView_t* view = &tab_layout->tab.current->view;

     CeAppViewData_t* view_data = view->user_data;
     CeJumpList_t* jump_list = &view_data->jump_list;
     CeBufferNode_t* itr = app->buffer_node_head;
     while(itr){
          if(strcmp(itr->buffer->name, app->input_view.buffer->lines[0]) == 0){
               ce_view_switch_buffer(view, itr->buffer, &app->vim, &app->config_options,
                                     jump_list);
               break;
          }
          itr = itr->next;
     }

     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x2818(%rdi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %r14
movl (%r14), %ebp
testl %ebp, %ebp
je 0x145a8
testl %ebp, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
movq 0x2828(%rdi), %r13
testq %r13, %r13
je 0x14594
movq 0x50(%r14), %rax
movq %rax, (%rsp)
addq $0x8, %r14
movq 0x2748(%rbx), %rax
movq (%rax), %rax
movq (%rax), %r12
movq (%r13), %r15
movq 0x10(%r15), %rdi
movq %r12, %rsi
callq 0xd390
testl %eax, %eax
je 0x145ef
movq 0x8(%r13), %r13
testq %r13, %r13
jne 0x145d0
jmp 0x14594
leaq 0x20(%rbx), %rdx
addq $0x1a50, %rbx           # imm = 0x1A50
xorl %r8d, %r8d
cmpq $0x0, (%rsp)
setne %r8b
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x112df
jmp 0x14594
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_app.c
// Function: replace_all_input_complete_func
bool replace_all_input_complete_func(CeApp_t* app, CeBuffer_t* input_buffer){
     // TODO: compress with code above
     CeLayout_t* tab_layout = app->tab_list_layout->tab_list.current;
     if(tab_layout->tab.current->type != CE_LAYOUT_TYPE_VIEW) return false;
     CeView_t* view = &tab_layout->tab.current->view;

     int64_t index = ce_vim_register_index('/');
     CeVimYank_t* yank = app->vim.yanks + index;
     if(yank->text){
          replace_all(view, &app->vim_visual_save, yank->text, app->input_view.buffer->lines[0]);
     }
     return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x2818(%rdi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %r14
movl (%r14), %ebp
testl %ebp, %ebp
jne 0x14674
movq %rdi, %rbx
movl $0x2f, %edi
callq 0x2517f
leaq (%rax,%rax,2), %rax
movq 0x1078(%rbx,%rax,8), %rdx
testq %rdx, %rdx
je 0x14674
addq $0x8, %r14
movq 0x2748(%rbx), %rax
addq $0x1a08, %rbx           # imm = 0x1A08
movq (%rax), %rax
movq (%rax), %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x187a0
testl %ebp, %ebp
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_app.c
// Function: edit_macro_input_complete_func
bool edit_macro_input_complete_func(CeApp_t* app, CeBuffer_t* input_buffer){
     CeRune_t* rune_string = ce_char_string_to_rune_string(app->input_view.buffer->lines[0]);
     if(rune_string){
          ce_rune_node_free(app->macros.rune_head + app->edit_register);
          CeRune_t* itr = rune_string;
          while(*itr){
               ce_rune_node_insert(app->macros.rune_head + app->edit_register, *itr);
               itr++;
          }

          free(rune_string);
     }
     return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x2748(%rdi), %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0x105cf
testq %rax, %rax
je 0x146f5
movq %rax, %r14
movsbq 0x2938(%rbx), %rax
leaq (%rbx,%rax,8), %rdi
addq $0x2940, %rdi           # imm = 0x2940
callq 0x10370
movl (%r14), %esi
testl %esi, %esi
je 0x146ed
leaq 0x2940(%rbx), %r15
movq %r14, %r12
addq $0x4, %r12
movsbq 0x2938(%rbx), %rax
leaq (%r15,%rax,8), %rdi
callq 0x102e7
movl (%r12), %esi
addq $0x4, %r12
testl %esi, %esi
jne 0x146d0
movq %r14, %rdi
callq 0xd090
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_app.c
// Function: edit_yank_input_complete_func
bool edit_yank_input_complete_func(CeApp_t* app, CeBuffer_t* input_buffer){
     CeVimYank_t* yank = app->vim.yanks + app->edit_register;
     CeVimYankType_t yank_type = yank->type;
     ce_vim_yank_free(yank);
     if(yank_type == CE_VIM_YANK_TYPE_BLOCK){
          yank->block_line_count = app->input_view.buffer->line_count;
          yank->block = malloc(yank->block_line_count * sizeof(*yank->block));
          for(int64_t i = 0; i < app->input_view.buffer->line_count; i++){
               if(strlen(app->input_view.buffer->lines[i])){
                    yank->block[i] = strdup(app->input_view.buffer->lines[i]);
               }else{
                    yank->block[i] = NULL;
               }
          }
          yank->type = yank_type;
     }else{
          yank->text = ce_buffer_dupe(app->input_view.buffer);
          yank->type = yank_type;
     }
     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movsbq 0x2938(%rdi), %rax
leaq (%rax,%rax,2), %rax
leaq (%rdi,%rax,8), %rbx
addq $0x1070, %rbx           # imm = 0x1070
movl (%rbx), %ebp
movq %rbx, %rdi
callq 0x243a6
movq 0x2748(%r14), %rdi
cmpl $0x3, %ebp
jne 0x14794
movq 0x8(%rdi), %rdi
movq %rdi, 0x10(%rbx)
shlq $0x3, %rdi
callq 0xd4c0
movq %rax, 0x8(%rbx)
movq 0x2748(%r14), %rax
movl $0x3, %ebp
cmpq $0x0, 0x8(%rax)
jle 0x1479d
xorl %r15d, %r15d
movq (%rax), %rax
movq (%rax,%r15,8), %rdi
cmpb $0x0, (%rdi)
je 0x14778
callq 0xd640
jmp 0x1477a
xorl %eax, %eax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movq 0x2748(%r14), %rax
cmpq 0x8(%rax), %r15
jl 0x14765
jmp 0x1479d
callq 0xf9e0
movq %rax, 0x8(%rbx)
movl %ebp, (%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_app.c
// Function: run_shell_command_cleanup
void run_shell_command_cleanup(void* data){
     RunShellCommandCleanup_t* cleanup = (RunShellCommandCleanup_t*)(data);

     *cleanup->shell_command_data->should_scroll = false;

     if(cleanup->shell_command_data){
          free(cleanup->shell_command_data->command);
          free(cleanup->shell_command_data);
     }

     if(cleanup->subprocess){
          // kill the subprocess and wait for it to be cleaned up
#if !defined(PLATFORM_WINDOWS)
          ce_subprocess_kill(cleanup->subprocess, SIGKILL);
          ce_subprocess_close(cleanup->subprocess);
#endif
     }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x10(%rax), %rcx
movb $0x0, (%rcx)
testq %rax, %rax
je 0x147d0
movq 0x8(%rax), %rdi
callq 0xd090
movq (%rbx), %rdi
callq 0xd090
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x147ed
movl $0x9, %esi
callq 0x1f747
movq 0x8(%rbx), %rdi
popq %rbx
jmp 0x1f783
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_app.c
// Function: ce_clang_format_buffer
bool ce_clang_format_buffer(char* clang_format_exe, CeBuffer_t* buffer, CePoint_t cursor){
    char* buffer_str = ce_buffer_dupe(buffer);
    int64_t buffer_str_len = ce_utf8_strlen(buffer_str);
    ClangFormatResult_t result = _clang_format_string(clang_format_exe, buffer_str, buffer_str_len);
    free(buffer_str);
    if(!result.success){
        return false;
    }

    bool removed = ce_buffer_remove_string_change(buffer, (CePoint_t){0, 0}, buffer_str_len,
                                                  &cursor, cursor, false);
    if(!removed){
        ce_log("Failed to clear buffer %s to insert clang format results\n", buffer->name);
        free(result.bytes);
        return false;
    }
    bool inserted = ce_buffer_insert_string_change(buffer, result.bytes, (CePoint_t){0, 0}, &cursor,
                                                   cursor, true);
    if(!inserted){
        ce_log("Failed to insert clang format results into %s\n", buffer->name);
        free(result.bytes);
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
movq %rsi, %rdi
callq 0xf9e0
movq %rax, %r15
movq %rax, %rdi
callq 0xe485
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x14c76
movl %eax, %ebp
movq %rdx, %r14
movq %r15, %rdi
callq 0xd090
testb $0x1, %bpl
je 0x14e6b
leaq 0x10(%rsp), %r8
movups (%r8), %xmm0
movups %xmm0, (%rsp)
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %r12, %rcx
xorl %r9d, %r9d
callq 0xfc21
testb %al, %al
je 0x14e70
leaq 0x10(%rsp), %r8
movups (%r8), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0xfa43
movl %eax, %r15d
testb %al, %al
jne 0x14e8a
leaq 0x1afc8(%rip), %rdi     # 0x2fe31
jmp 0x14e77
xorl %r15d, %r15d
jmp 0x14e8a
leaq 0x1af80(%rip), %rdi     # 0x2fdf7
movq 0x10(%rbx), %rsi
xorl %eax, %eax
callq 0xd954
movq %r14, %rdi
callq 0xd090
movl %r15d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_app.c
// Function: ce_app_close_popup_view
bool ce_app_close_popup_view(CeApp_t* app){
     CeLayout_t* tab_layout = app->tab_list_layout->tab_list.current;
     CeLayout_t* current_layout = tab_layout->tab.current;
     CeLayout_t* popup_layout = ce_layout_find_popup(app->tab_list_layout);
     if(popup_layout == NULL){
         return false;
     }
     // Save a point in the popup layout.
     CePoint_t popup_point = {};
     if(popup_layout->type == CE_LAYOUT_TYPE_VIEW){
         popup_point.x = popup_layout->view.rect.left;
         popup_point.y = popup_layout->view.rect.top;
     }
     bool result = ce_layout_delete(app->tab_list_layout, popup_layout);
     // Find the layout that is where the popup layout used to be, and make it the current one if
     // the delete was successful.
     if(result && current_layout == popup_layout){
          CeLayout_t* select_layout = ce_layout_find_at(tab_layout, popup_point);
          if(select_layout){
              tab_layout->tab.current = select_layout;
          }
     }
     return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x2818(%rdi), %rdi
movq 0x10(%rdi), %rbx
movq 0x10(%rbx), %r12
callq 0x1ee5d
testq %rax, %rax
je 0x15019
movq %rax, %r14
cmpl $0x0, (%rax)
je 0x1501d
movq $0x0, (%rsp)
xorl %r13d, %r13d
jmp 0x15029
xorl %ebp, %ebp
jmp 0x1505b
movq 0x8(%r14), %rax
movq %rax, (%rsp)
movq 0x18(%r14), %r13
movq 0x2818(%r15), %rdi
movq %r14, %rsi
callq 0x1eeec
movl %eax, %ebp
testb %al, %al
je 0x1505b
cmpq %r14, %r12
jne 0x1505b
movq %rbx, %rdi
movq (%rsp), %rsi
movq %r13, %rdx
callq 0x1ed8e
testq %rax, %rax
je 0x1505b
movq %rax, 0x10(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_clangd.c
// Function: send_json_obj
static bool _send_json_obj(CeJsonObj_t* obj, CeSubprocess_t* subprocess){
     // Build the message boyd
     char* message_body = malloc(DEFAULT_MESSAGE_SIZE);
     ce_json_obj_to_string(obj, message_body, DEFAULT_MESSAGE_SIZE - 1, 1);
     uint64_t message_len = strlen(message_body);

     // Prepend the header.
     char* header = malloc(DEFAULT_HEADER_SIZE);
     int64_t header_len = snprintf(header, DEFAULT_HEADER_SIZE, "Content-Length: %" PRId64 "\r\n\r\n",
                                             message_len);

     int64_t bytes_written = ce_subprocess_write_stdin(subprocess, header, header_len);
     free(header);
     if(bytes_written < 0){
          free(message_body);
          return false;
     }
     bytes_written = ce_subprocess_write_stdin(subprocess, message_body, message_len);
     free(message_body);
     if(bytes_written < 0){
          return false;
     }
     return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1000000, %edi        # imm = 0x1000000
callq 0xd4c0
movq %rax, %rbx
movl $0xffffff, %edx         # imm = 0xFFFFFF
movl $0x1, %ecx
movq %r15, %rdi
movq %rax, %rsi
callq 0x1c34b
movq %rbx, %rdi
callq 0xd210
movq %rax, %r15
movl $0x400, %edi            # imm = 0x400
callq 0xd4c0
movq %rax, %r12
leaq 0x1a7fe(%rip), %rdx     # 0x30198
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0xd260
movslq %eax, %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x1f8a6
movq %rax, %r13
movq %r12, %rdi
callq 0xd090
testq %r13, %r13
js 0x159eb
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x1f8a6
movq %rax, %r14
movq %rbx, %rdi
callq 0xd090
testq %r14, %r14
setns %al
jmp 0x159f5
movq %rbx, %rdi
callq 0xd090
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1a4cb(%rip), %rdx     # 0x3006a
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_O1/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 0x15cc6
movq 0x58(%rsi), %rax
movq 0x600(%rax), %rax
cmpq 0x25371(%rip), %rax     # 0x3af60
setne %cl
cmpq 0x2535f(%rip), %rax     # 0x3af58
setne %al
testb %al, %cl
jne 0x15cc6
movq %rdi, %rbx
movq 0x10(%rsi), %rdi
leaq 0x30(%rsp), %r12
movq %r12, %rsi
callq 0x15b87
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r14
movaps %xmm0, (%r14)
leaq 0x1a41e(%rip), %rsi     # 0x30049
leaq 0x1a41f(%rip), %rdx     # 0x30051
movq %r14, %rdi
callq 0x1c108
leaq 0x1a07d(%rip), %rsi     # 0x2fcbe
leaq 0x1a4a0(%rip), %rdx     # 0x300e8
movq %r14, %rdi
callq 0x1c108
leaq 0x10(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
leaq 0x19f9e(%rip), %rsi     # 0x2fc01
movq %r15, %rdi
movq %r12, %rdx
callq 0x1c108
movq %rsp, %r12
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
leaq 0x1a45b(%rip), %rsi     # 0x300db
movq %r12, %rdi
movq %r15, %rdx
callq 0x1be07
leaq 0x19f68(%rip), %rsi     # 0x2fbfa
movq %r14, %rdi
movq %r12, %rdx
callq 0x1be07
addq $0x8, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1594a
movl %eax, %ebp
movq %r12, %rdi
callq 0x1c2e8
movq %r15, %rdi
callq 0x1c2e8
movq %r14, %rdi
callq 0x1c2e8
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_O1/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 0x15ea9
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
incq 0x30(%rdi)
leaq 0x19d9e(%rip), %r13     # 0x2fc25
movq %r13, %rsi
callq 0x15eac
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x15f0c
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %r14
movq 0x10(%rsi), %rdi
leaq 0x40(%rsp), %rsi
callq 0x15b87
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rbx
movaps %xmm0, (%rbx)
leaq 0x1a100(%rip), %rsi     # 0x30049
leaq 0x1a101(%rip), %rdx     # 0x30051
movq %rbx, %rdi
callq 0x1c108
xorps %xmm0, %xmm0
cvtsi2sdq 0x30(%r14), %xmm0
leaq 0x1b0ba(%rip), %rsi     # 0x31022
movq %rbx, %rdi
callq 0x1c186
leaq 0x19d47(%rip), %rsi     # 0x2fcbe
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1c108
leaq 0x20(%rsp), %r15
xorpd %xmm0, %xmm0
movapd %xmm0, (%r15)
leaq 0x10(%rsp), %r13
movapd %xmm0, (%r13)
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
leaq 0x18d11(%rip), %rsi     # 0x2ecbb
movq %r13, %rdi
callq 0x1c186
xorps %xmm0, %xmm0
cvtsi2sd %rbp, %xmm0
leaq 0x19c2f(%rip), %rsi     # 0x2fbf0
movq %r13, %rdi
callq 0x1c186
leaq 0x1a1e0(%rip), %rsi     # 0x301b0
movq %r15, %rdi
movq %r13, %rdx
callq 0x1be07
movq %rsp, %r12
xorpd %xmm0, %xmm0
movapd %xmm0, (%r12)
leaq 0x19c12(%rip), %rsi     # 0x2fc01
movq %r12, %rdi
leaq 0x40(%rsp), %rdx
callq 0x1c108
leaq 0x1a0d8(%rip), %rsi     # 0x300db
movq %r15, %rdi
movq %r12, %rdx
callq 0x1be07
leaq 0x19be5(%rip), %rsi     # 0x2fbfa
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1be07
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1594a
movl %eax, %ebp
movq %r12, %rdi
callq 0x1c2e8
movq %r13, %rdi
callq 0x1c2e8
movq %r15, %rdi
callq 0x1c2e8
movq %rbx, %rdi
callq 0x1c2e8
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_O1/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_request_goto_def
bool ce_clangd_request_goto_def(CeClangD_t* clangd, CeBuffer_t* buffer, CePoint_t point){
     if(clangd->buffer == NULL){
          return true;
     }
     const char* method = "textDocument/definition";
     clangd->current_request_id++;
     _clangd_track_request(clangd, method);
     return _clangd_request_goto(clangd, buffer, point, method);
}

// Assembly:
cmpq $0x0, 0x28(%rdi)
je 0x160b1
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
incq 0x30(%rdi)
leaq 0x19bb5(%rip), %r13     # 0x2fc41
movq %r13, %rsi
callq 0x15eac
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x15f0c
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x16100
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
incq 0x30(%rdi)
leaq 0x19b7e(%rip), %r13     # 0x2fc59
movq %r13, %rsi
callq 0x15eac
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x15f0c
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1614f
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
incq 0x30(%rdi)
leaq 0x19b64(%rip), %r13     # 0x2fc8e
movq %r13, %rsi
callq 0x15eac
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x15f0c
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1619e
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
incq 0x30(%rdi)
leaq 0x19b2d(%rip), %r13     # 0x2fca6
movq %r13, %rsi
callq 0x15eac
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x15f0c
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x16241
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 0x16254
leaq 0x19f4c(%rip), %r15     # 0x30135
movl %eax, %edi
callq 0xd650
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xd954
movq 0x70(%r14), %r15
testq %r15, %r15
jle 0x16300
movq 0x78(%r14), %rdx
movq (%rbx), %rsi
movl $0x10, %eax
movq $-0x1, %rcx
cmpq %rsi, -0x8(%rdx,%rax)
je 0x162ba
addq $0x10, %rax
leaq (%r15,%rcx), %rdi
decq %rdi
decq %rcx
cmpq $-0x1, %rdi
jne 0x1621d
jmp 0x16300
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
jmp 0x16300
movq 0x38(%r14), %r13
testq %r13, %r13
je 0x161fd
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 0x161fd
leaq 0x19eb1(%rip), %r15     # 0x30166
jmp 0x161e9
movq -0x10(%rdx,%rax), %rdx
movq %rdx, 0x10(%rbx)
negq %rcx
cmpq %r15, %rcx
jge 0x162e5
movq 0x78(%r14), %rdx
movups (%rdx,%rax), %xmm0
movups %xmm0, -0x10(%rdx,%rax)
incq %rcx
movq 0x70(%r14), %r15
addq $0x10, %rax
jmp 0x162c6
decq %r15
movq 0x78(%r14), %rdi
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_O1/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 0x1635c
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rdi
movl $0x2, %esi
callq 0x1f747
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_O1/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 0x16382
callq 0x1c2e8
movq 0x8(%rbx), %rdi
callq 0xd090
movq 0x10(%rbx), %rdi
popq %rbx
jmp 0xd090
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_diag_add
void ce_clangd_diag_add(CeClangDDiagnostics_t* diags, CeClangDDiagnostic_t* elem){
    int64_t new_count = diags->count + 1;
    diags->elements = realloc(diags->elements, new_count * sizeof(diags->elements[0]));
    memcpy(diags->elements + diags->count, elem, sizeof(diags->elements[0]));
    diags->elements[diags->count].message = strdup(elem->message);
    diags->count = new_count;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x8(%r14), %r12
leaq 0x8(,%r12,8), %rax
incq %r12
leaq (%rax,%rax,4), %rsi
callq 0xd520
movq %rax, %r15
movq %rax, (%r14)
movq 0x8(%r14), %rax
leaq (%rax,%rax,4), %r13
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm0, (%r15,%r13,8)
movups %xmm1, 0x10(%r15,%r13,8)
movq 0x20(%rbx), %rax
movq %rax, 0x20(%r15,%r13,8)
movq 0x20(%rbx), %rdi
callq 0xd640
movq %rax, 0x20(%r15,%r13,8)
movq %r12, 0x8(%r14)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x16424
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 0x1640b
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
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 0x166a7
callq 0xd720
movq (%rax), %rax
movsbq %bpl, %rcx
testb $0x1, (%rax,%rcx,2)
je 0x166a7
movb 0x1(%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0x16691
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x166dc
incq %rdi
xorl %eax, %eax
movb -0x1(%rdi), %dl
testb %dl, %dl
je 0x166db
movq %rdi, %rcx
incq %rdi
cmpb $0x5c, %dl
je 0x166bb
cmpb $0x22, (%rcx)
jne 0x166bb
xorl %eax, %eax
cmpb $0x0, (%rdi)
cmovneq %rdi, %rax
retq
movl $0x20, %esi
jmp 0xd230
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movb (%rsi), %bpl
testb %bpl, %bpl
je 0x167d5
movq %rsi, %r14
movq %rdi, %rbx
movb (%rsi), %r15b
testb %r15b, %r15b
je 0x16754
callq 0xd720
movq (%rax), %rdx
movb $0x1, %al
xorl %ecx, %ecx
xorl %esi, %esi
movl %ecx, %edi
movsbq %r15b, %rcx
testb $0x8, 0x1(%rdx,%rcx,2)
jne 0x1673c
cmpb $0x2b, %r15b
je 0x1673c
movzbl %r15b, %r8d
cmpl $0x2d, %r8d
je 0x1673c
movb $0x1, %cl
cmpl $0x2e, %r8d
je 0x1673e
xorl %eax, %eax
movl %edi, %ecx
movb 0x1(%r14,%rsi), %r15b
incq %rsi
testb %r15b, %r15b
jne 0x16715
cmpq $0x1, %rsi
setne %dl
jmp 0x1675a
movb $0x1, %dl
xorl %ecx, %ecx
movb $0x1, %al
movl %ecx, %esi
andb %al, %sil
notb %sil
orb %dl, %sil
andb %al, %sil
testb $0x1, %sil
je 0x16788
testb $0x1, %cl
je 0x167c1
movl $0x1, (%rbx)
movq %r14, %rdi
callq 0xd190
movsd %xmm0, 0x8(%rbx)
jmp 0x167d5
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 0x167d5
movb $0x0, -0x1(%r14,%rax)
jmp 0x167d5
movl $0x0, (%rbx)
movq %r14, %rdi
callq 0xd5f0
cltq
movq %rax, 0x8(%rbx)
testb %bpl, %bpl
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
cmpq $0x0, 0x208(%rbx)
jle 0x16835
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x200(%rbx), %rax
cmpl $0x2, -0x8(%rax,%r14)
jne 0x16825
movq (%rax,%r14), %rdi
callq 0xd090
incq %r15
addq $0x10, %r14
cmpq 0x208(%rbx), %r15
jl 0x1680d
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_O1/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 0x199ac(%rip), %rdi     # 0x30219
movq %rbx, %rsi
xorl %eax, %eax
callq 0xd954
cmpq $0x0, 0x208(%rbx)
jle 0x168f1
movl $0x8, %r13d
leaq 0x199b1(%rip), %r14     # 0x3023f
leaq 0x199a4(%rip), %r15     # 0x30239
leaq 0x19996(%rip), %r12     # 0x30232
xorl %ebp, %ebp
movq 0x200(%rbx), %rax
movl -0x8(%rax,%r13), %ecx
cmpl $0x2, %ecx
je 0x168d3
cmpl $0x1, %ecx
je 0x168c1
testl %ecx, %ecx
jne 0x168e1
movq (%rax,%r13), %rsi
movq %r12, %rdi
jmp 0x168da
movsd (%rax,%r13), %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0xd954
jmp 0x168e1
movq (%rax,%r13), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0xd954
incq %rbp
addq $0x10, %r13
cmpq 0x208(%rbx), %rbp
jl 0x1689e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_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 0x16913
retq
pushq %rbx
movq %rsi, %rbx
movq 0x27f8(%rsi), %rcx
testq %rcx, %rcx
je 0x16927
xorl %edi, %edi
jmp 0x16943
movq 0x2818(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x8(%rax), %rdx
xorl %edi, %edi
cmpl $0x0, (%rax)
cmoveq %rdx, %rdi
movl $0x3, %eax
testq %rcx, %rcx
jne 0x169af
movq 0x2828(%rbx), %rax
testq %rax, %rax
je 0x16971
movq (%rax), %rcx
cmpl $0x1, 0x18(%rcx)
jne 0x1696b
cmpq 0x2748(%rbx), %rcx
jne 0x1697a
movq 0x8(%rax), %rax
jmp 0x16954
movb $0x1, 0x2c78(%rbx)
jmp 0x169ad
movq 0x2848(%rbx), %rsi
leaq 0x20(%rbx), %rdx
leaq 0x1a50(%rbx), %rcx
movl $0x1, %r8d
callq 0x112df
leaq 0x198a9(%rip), %rsi     # 0x30247
leaq -0x2af6(%rip), %rdx     # 0x13eaf
movq %rbx, %rdi
callq 0x126ac
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x16c42
retq
movq 0x27f8(%rsi), %rcx
testq %rcx, %rcx
je 0x16c52
xorl %edx, %edx
jmp 0x16c6e
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x8(%rax), %rdi
xorl %edx, %edx
cmpl $0x0, (%rax)
cmoveq %rdi, %rdx
movl $0x3, %eax
testq %rcx, %rcx
jne 0x16c41
pushq %rax
movq 0x40(%rdx), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x16c8f
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x16cdf
movq 0x60(%rsp), %rax
cmpq 0x68(%rbx), %rax
jle 0x16cdf
leaq 0x198cd(%rip), %rsi     # 0x30590
leaq -0x2dd0(%rip), %rdx     # 0x13efa
movq %r14, %rdi
callq 0x126ac
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
retq
movq 0x2ca0(%r14), %rax
testq %rax, %rax
je 0x16cf3
movq %r14, %rdi
movq %rbx, %rsi
callq *%rax
movq %rbx, %rdi
addq $0x98, %rsp
popq %rbx
popq %r14
jmp 0xe2f2
// File: /workspace/github_c_makefile_star2_O1/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 0x16d1f
popq %rbx
popq %r14
popq %r15
retq
movq %rsi, %rbx
movq %rdi, %r14
movq 0x2828(%rsi), %r15
testq %r15, %r15
je 0x16d4c
movq (%r15), %rsi
cmpl $0x1, 0x18(%rsi)
jne 0x16d46
movq %rbx, %rdi
callq 0x16c8f
testb %al, %al
je 0x16d5c
movq 0x8(%r15), %r15
jmp 0x16d2c
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x16903
xorl %eax, %eax
jmp 0x16d19