LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_select_adjacent_tab
CeCommandStatus_t command_select_adjacent_tab(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;

     if(strcmp(command->args[0].string, "left") == 0){
          if(app->tab_list_layout->tab_list.tab_count == 1){
               ce_app_message(app, "cannot select adjacent tab, there is only 1 tab");
               return CE_COMMAND_NO_ACTION;
          }

          if(select_tab_left(app)){
               app->message_mode = false;
               return CE_COMMAND_SUCCESS;
          }

          return CE_COMMAND_NO_ACTION;
     }else if(strcmp(command->args[0].string, "right") == 0){
          if(app->tab_list_layout->tab_list.tab_count == 1){
               ce_app_message(app, "cannot select adjacent tab, there is only 1 tab");
               return CE_COMMAND_NO_ACTION;
          }

          if(select_tab_right(app)){
               app->message_mode = false;
               return CE_COMMAND_SUCCESS;
          }

          return CE_COMMAND_NO_ACTION;
     }

     return CE_COMMAND_PRINT_HELP;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl $0x2, %ebp
cmpq $0x1, 0x208(%rdi)
jne 0x178ff
movq 0x200(%rdi), %rax
cmpl $0x2, (%rax)
jne 0x178ff
movq %rsi, %rbx
movq 0x8(%rax), %r14
leaq 0x18f08(%rip), %rsi     # 0x30790
movq %r14, %rdi
callq 0xd390
testl %eax, %eax
je 0x178bf
leaq 0x18edb(%rip), %rsi     # 0x30776
movq %r14, %rdi
callq 0xd390
testl %eax, %eax
jne 0x178ff
movq 0x2818(%rbx), %rax
cmpq $0x1, 0x18(%rax)
je 0x178cd
movq %rbx, %rdi
callq 0x177f6
jmp 0x178ed
movq 0x2818(%rbx), %rax
cmpq $0x1, 0x18(%rax)
jne 0x178e5
leaq 0x17ac4(%rip), %rsi     # 0x2f398
movq %rbx, %rdi
xorl %eax, %eax
callq 0x122dd
movl $0x3, %ebp
jmp 0x178ff
movq %rbx, %rdi
callq 0x1779f
movl $0x3, %ebp
testb %al, %al
je 0x178ff
movb $0x0, 0x2800(%rbx)
xorl %ebp, %ebp
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_search
CeCommandStatus_t command_search(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;
     CommandContext_t command_context = {};

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

     if(strcmp(command->args[0].string, "forward") == 0){
          ce_app_input(app, "Search", search_input_complete_func);
          app->vim.search_mode = CE_VIM_SEARCH_MODE_FORWARD;
          app->search_start = command_context.view->cursor;
     }else if(strcmp(command->args[0].string, "backward") == 0){
          ce_app_input(app, "Reverse Search", search_input_complete_func);
          app->vim.search_mode = CE_VIM_SEARCH_MODE_BACKWARD;
          app->search_start = command_context.view->cursor;
     }else{
          return CE_COMMAND_PRINT_HELP;
     }

     app->highlight_search = true;
     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x1, 0x208(%rdi)
jne 0x179e1
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x200(%rdi), %rcx
cmpl $0x2, (%rcx)
jne 0x179d6
movq %rsi, %rbx
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
jne 0x179d6
movq 0x2818(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
xorl %r12d, %r12d
cmpl $0x0, (%rax)
leaq 0x8(%rax), %r15
cmovneq %r12, %r15
movq 0x8(%rcx), %r14
leaq 0x18e33(%rip), %rsi     # 0x307a2
movq %r14, %rdi
callq 0xd390
testl %eax, %eax
je 0x179a4
leaq 0x18e35(%rip), %rsi     # 0x307b7
movq %r14, %rdi
callq 0xd390
movl %eax, %ecx
movl $0x2, %eax
testl %ecx, %ecx
jne 0x179d6
movl $0x1, %r12d
leaq 0x17d5a(%rip), %rsi     # 0x2f6fc
jmp 0x179ab
leaq 0x17d59(%rip), %rsi     # 0x2f704
leaq -0x3888(%rip), %rdx     # 0x1412a
movq %rbx, %rdi
callq 0x12487
movl %r12d, 0x19fc(%rbx)
movups 0x30(%r15), %xmm0
movups %xmm0, 0x2c40(%rbx)
movb $0x1, 0x2c79(%rbx)
xorl %eax, %eax
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_regex_search
CeCommandStatus_t command_regex_search(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;
     CommandContext_t command_context = {};

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

     if(strcmp(command->args[0].string, "forward") == 0){
          ce_app_input(app, "Regex Search", search_input_complete_func);
          app->vim.search_mode = CE_VIM_SEARCH_MODE_REGEX_FORWARD;
          app->search_start = command_context.view->cursor;
     }else if(strcmp(command->args[0].string, "backward") == 0){
          ce_app_input(app, "Reverse Regex Search", search_input_complete_func);
          app->vim.search_mode = CE_VIM_SEARCH_MODE_REGEX_BACKWARD;
          app->search_start = command_context.view->cursor;
     }else{
          return CE_COMMAND_PRINT_HELP;
     }

     app->highlight_search = true;
     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x1, 0x208(%rdi)
jne 0x17b0b
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x200(%rdi), %rcx
cmpl $0x2, (%rcx)
jne 0x17b01
movq %rsi, %rbx
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
jne 0x17b01
movq 0x2818(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
xorl %edx, %edx
cmpl $0x0, (%rax)
leaq 0x8(%rax), %r15
cmovneq %rdx, %r15
movq 0x8(%rcx), %r14
leaq 0x18d0b(%rip), %rsi     # 0x307a2
movq %r14, %rdi
callq 0xd390
testl %eax, %eax
je 0x17acb
leaq 0x18d0d(%rip), %rsi     # 0x307b7
movq %r14, %rdi
callq 0xd390
movl %eax, %ecx
movl $0x2, %eax
testl %ecx, %ecx
jne 0x17b01
movl $0x3, %ebp
leaq 0x178ff(%rip), %rsi     # 0x2f3c8
jmp 0x17ad7
movl $0x2, %ebp
leaq 0x178f9(%rip), %rsi     # 0x2f3d0
leaq -0x39b4(%rip), %rdx     # 0x1412a
movq %rbx, %rdi
callq 0x12487
movl %ebp, 0x19fc(%rbx)
movups 0x30(%r15), %xmm0
movups %xmm0, 0x2c40(%rbx)
movb $0x1, 0x2c79(%rbx)
xorl %eax, %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_command
CeCommandStatus_t command_command(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;

     if(command_context.view){
          ce_app_input(app, "Run Command", command_input_complete_func);
          ce_app_init_command_completion(app, &app->input_complete);
          build_complete_list(app->complete_list_buffer, &app->input_complete);
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl $0x2, %ebx
cmpq $0x0, 0x208(%rdi)
jne 0x17b7f
movq %rsi, %r14
movl $0x3, %ebx
cmpq $0x0, 0x27f8(%rsi)
jne 0x17b7f
movq 0x2818(%r14), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
xorl %ebx, %ebx
cmpl $0x0, (%rax)
jne 0x17b7f
leaq 0x1788e(%rip), %rsi     # 0x2f3dd
leaq -0x3e5d(%rip), %rdx     # 0x13cf9
movq %r14, %rdi
callq 0x12487
leaq 0x28a0(%r14), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x12212
movq 0x2860(%r14), %rdi
movq %r15, %rsi
callq 0x11c24
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_switch_buffer
CeCommandStatus_t command_switch_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;

     ce_app_input(app, "Switch Buffer", switch_buffer_input_complete_func);

     int64_t buffer_count = 0;
     CeBufferNode_t* itr = app->buffer_node_head;
     while(itr){
          buffer_count++;
          itr = itr->next;
     }

     char** filenames = malloc(buffer_count * sizeof(*filenames));

     int64_t index = 0;
     itr = app->buffer_node_head;
     while(itr){
          filenames[index] = strdup(itr->buffer->name);
          index++;
          itr = itr->next;
     }

     ce_complete_init(&app->input_complete, (const char**)filenames, NULL, buffer_count);
     build_complete_list(app->complete_list_buffer, &app->input_complete);

     for(int64_t i = 0; i < buffer_count; i++){
          free(filenames[i]);
     }
     free(filenames);

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0x2, %r12d
cmpq $0x0, 0x208(%rdi)
jne 0x17c7c
movq %rsi, %rbx
movl $0x3, %r12d
cmpq $0x0, 0x27f8(%rsi)
jne 0x17c7c
leaq 0x17827(%rip), %rsi     # 0x2f3e9
leaq -0x390f(%rip), %rdx     # 0x142ba
movq %rbx, %rdi
callq 0x12487
movq 0x2828(%rbx), %r12
testq %r12, %r12
je 0x17c26
xorl %edi, %edi
movq %r12, %rax
xorl %r14d, %r14d
incq %r14
movq 0x8(%rax), %rax
addq $0x8, %rdi
testq %rax, %rax
jne 0x17be5
callq 0xd4c0
movq %rax, %r15
testq %r12, %r12
je 0x17c33
movq %r15, %r13
movq (%r12), %rax
movq 0x10(%rax), %rdi
callq 0xd640
movq %rax, (%r13)
movq 0x8(%r12), %r12
addq $0x8, %r13
testq %r12, %r12
jne 0x17c05
jmp 0x17c33
xorl %r14d, %r14d
xorl %edi, %edi
callq 0xd4c0
movq %rax, %r15
leaq 0x28a0(%rbx), %r13
xorl %r12d, %r12d
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x1994c
movq 0x2860(%rbx), %rdi
movq %r13, %rsi
callq 0x11c24
testq %r14, %r14
je 0x17c74
xorl %ebx, %ebx
movq (%r15,%rbx,8), %rdi
callq 0xd090
incq %rbx
cmpq %rbx, %r14
jne 0x17c63
movq %r15, %rdi
callq 0xd090
movl %r12d, %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_goto_destination_in_line
CeCommandStatus_t command_goto_destination_in_line(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;

     if(command_context.view->buffer->line_count == 0) return CE_COMMAND_NO_ACTION;

     CeDestination_t destination = scan_line_for_destination(command_context.view->buffer->lines[command_context.view->cursor.y]);
     if(destination.point.x < 0 || destination.point.y < 0){
          ce_app_message(app, "failed to determine file destination at %s:%d", command_context.view->buffer->name, command_context.view->cursor.y);
          return CE_COMMAND_NO_ACTION;
     }

     CeAppBufferData_t* buffer_data = command_context.view->buffer->app_data;
     buffer_data->last_goto_destination = command_context.view->cursor.y;

     char* base_directory = buffer_base_directory(command_context.view->buffer);
     CeBuffer_t* buffer = load_destination_into_view(&app->buffer_node_head, command_context.view, &app->config_options, &app->vim,
                                                     true, base_directory, &destination);
     free(base_directory);
     if(!buffer) return CE_COMMAND_NO_ACTION;
     ce_clangd_file_open(&app->clangd, app->buffer_node_head->buffer);

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x0, 0x208(%rdi)
je 0x17cad
retq
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rsi, %rbx
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
jne 0x17dac
movq 0x2818(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
leaq 0x8(%rcx), %rdx
xorl %r14d, %r14d
cmpl $0x0, (%rcx)
cmoveq %rdx, %r14
movq 0x40(%r14), %rcx
cmpq $0x0, 0x8(%rcx)
je 0x17dac
movq (%rcx), %rax
movq 0x38(%r14), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x11dde
cmpq $0x0, (%r15)
movq 0x38(%r14), %rcx
movq 0x40(%r14), %rdi
js 0x17d92
cmpq $0x0, 0x10(%rsp)
js 0x17d92
movq 0x58(%rdi), %rax
movq %rcx, 0x5f8(%rax)
callq 0x11a2b
movq %rax, %r12
leaq 0x2828(%rbx), %rdi
leaq 0x1a50(%rbx), %rdx
leaq 0x20(%rbx), %rcx
movq %r15, (%rsp)
movq %r14, %rsi
movl $0x1, %r8d
movq %rax, %r9
callq 0x139a8
movq %rax, %r14
movq %r12, %rdi
callq 0xd090
testq %r14, %r14
je 0x17da7
movq 0x2828(%rbx), %rax
addq $0x2cd0, %rbx           # imm = 0x2CD0
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x15667
xorl %eax, %eax
jmp 0x17dac
movq 0x10(%rdi), %rdx
leaq 0x1765a(%rip), %rsi     # 0x2f3f7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x122dd
movl $0x3, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_goto_prev_buffer_in_view
CeCommandStatus_t command_goto_prev_buffer_in_view(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;

     if(!ce_app_switch_to_prev_buffer_in_view(app, command_context.view, false)){
          return CE_COMMAND_NO_ACTION;
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x0, 0x208(%rdi)
je 0x181df
retq
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
jne 0x181de
pushq %rax
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rcx
leaq 0x8(%rcx), %rax
xorl %edx, %edx
cmpl $0x0, (%rcx)
cmovneq %rdx, %rax
movq %rsi, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x114f5
xorb $0x1, %al
movzbl %al, %eax
leal (%rax,%rax,2), %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_replace_all
CeCommandStatus_t command_replace_all(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(command->arg_count == 1 && command->args[0].type == CE_COMMAND_ARG_STRING){
          int64_t index = ce_vim_register_index(CE_PATH_SEPARATOR);
          CeVimYank_t* yank = app->vim.yanks + index;
          if(yank->text){
               replace_all(command_context.view, &app->vim_visual_save, yank->text, command->args[0].string);
          }else{
               ce_app_message(app, "only 1 argument used for replace_all, but search yank register is empty");
               return CE_COMMAND_NO_ACTION;
          }
     }else if(command->arg_count == 2 && command->args[0].type == CE_COMMAND_ARG_STRING && command->args[1].type == CE_COMMAND_ARG_STRING){
          replace_all(command_context.view, &app->vim_visual_save, command->args[0].string, command->args[1].string);
     }else{
          return CE_COMMAND_PRINT_HELP;
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
je 0x18235
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x8(%rax), %rcx
xorl %r14d, %r14d
cmpl $0x0, (%rax)
cmoveq %rcx, %r14
movq 0x208(%rdi), %rcx
movl $0x2, %eax
cmpq $0x2, %rcx
je 0x182b4
cmpq $0x1, %rcx
jne 0x182fa
movq 0x200(%r15), %rcx
cmpl $0x2, (%rcx)
jne 0x182fa
movl $0x2f, %edi
callq 0x25108
leaq (%rax,%rax,2), %rax
movq 0x1078(%rbx,%rax,8), %rdx
testq %rdx, %rdx
je 0x182e4
addq $0x1a08, %rbx           # imm = 0x1A08
movq 0x200(%r15), %rax
movq 0x8(%rax), %rcx
jmp 0x182d5
movq 0x200(%r15), %rcx
cmpl $0x2, (%rcx)
jne 0x182fa
cmpl $0x2, 0x10(%rcx)
jne 0x182fa
addq $0x1a08, %rbx           # imm = 0x1A08
movq 0x8(%rcx), %rdx
movq 0x18(%rcx), %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18300
xorl %eax, %eax
jmp 0x182fa
leaq 0x1713a(%rip), %rsi     # 0x2f425
movq %rbx, %rdi
xorl %eax, %eax
callq 0x122dd
movl $0x3, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: replace_all
void replace_all(CeView_t* view, CeVimVisualSave_t* vim_visual_save, const char* match, const char* replace){
     CePoint_t start;
     CePoint_t end;
     if(vim_visual_save->mode == CE_VIM_MODE_VISUAL){
          if(ce_point_after(view->cursor, vim_visual_save->visual_point)){
               start = vim_visual_save->visual_point;
               end = view->cursor;
          }else{
               start = view->cursor;
               end = vim_visual_save->visual_point;
          }
     }else if(vim_visual_save->mode == CE_VIM_MODE_VISUAL_LINE){
          if(ce_point_after(view->cursor, vim_visual_save->visual_point)){
               start = (CePoint_t){0, vim_visual_save->visual_point.y};
               end = (CePoint_t){ce_utf8_last_index(view->buffer->lines[view->cursor.y]), view->cursor.y};
          }else{
               start = (CePoint_t){0, view->cursor.y};
               end = (CePoint_t){ce_utf8_last_index(view->buffer->lines[vim_visual_save->visual_point.y]), vim_visual_save->visual_point.y};
          }
     }else{
          start = view->cursor;
          end = ce_buffer_end_point(view->buffer);
     }

     if(ce_point_after(end, start)){
          buffer_replace_all(view->buffer, view->cursor, match, replace, start, end, false);
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movl (%rsi), %eax
cmpl $0x3, %eax
je 0x1835a
leaq 0x30(%r15), %r13
cmpl $0x2, %eax
jne 0x183a2
leaq 0x8(%r12), %rbp
movq 0x30(%r15), %rdi
movq 0x38(%r15), %rsi
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rcx
callq 0xec71
testb %al, %al
je 0x183c1
movups (%rbp), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%r13), %xmm0
jmp 0x183cf
movq 0x30(%r15), %rdi
movq 0x38(%r15), %rsi
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rcx
callq 0xec71
testb %al, %al
je 0x183d6
movq 0x10(%r12), %rax
movq $0x0, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq 0x38(%r15), %rax
movq 0x40(%r15), %rcx
movq (%rcx), %rcx
movq (%rcx,%rax,8), %rdi
callq 0xe8d0
movq 0x38(%r15), %rcx
jmp 0x18402
movups (%r13), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x40(%r15), %rdi
callq 0xda40
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
jmp 0x1840c
movups (%r13), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rbp), %xmm0
movaps %xmm0, 0x20(%rsp)
jmp 0x1840c
movq 0x38(%r15), %rax
movq $0x0, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq 0x40(%r15), %rax
movq (%rax), %rax
movq 0x10(%r12), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xe8d0
movq 0x10(%r12), %rcx
movq %rax, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
callq 0xec71
testb %al, %al
je 0x18456
movq 0x40(%r15), %rdi
movq 0x30(%r15), %rsi
movq 0x38(%r15), %rdx
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rcx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0x19082
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_reload_file
CeCommandStatus_t command_reload_file(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 file_backed = false;

#if defined(PLATFORM_WINDOWS)
     file_backed = (_access(command_context.view->buffer->name, 0) == 0);
#else
     file_backed = (access(command_context.view->buffer->name, F_OK) == 0);
#endif

     if(!file_backed){
          ce_app_message(app, "buffer '%s' is not file backed, unable to reload\n", command_context.view->buffer->name);
          return CE_COMMAND_NO_ACTION;
     }

     char* filename = strdup(command_context.view->buffer->name);
     CeAppBufferData_t* buffer_data = command_context.view->buffer->app_data;
     ce_buffer_free(command_context.view->buffer);
     command_context.view->buffer->app_data = buffer_data; // NOTE: not great that I need to save user data and reset it
     ce_buffer_load_file(command_context.view->buffer, filename);
     free(filename);

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0x2, %ebx
cmpq $0x0, 0x208(%rdi)
jne 0x18510
movq %rsi, %r14
movl $0x3, %ebx
cmpq $0x0, 0x27f8(%rsi)
jne 0x18510
movq 0x2818(%r14), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x8(%rax), %r12
xorl %ecx, %ecx
cmpl $0x0, (%rax)
cmovneq %rcx, %r12
movq 0x40(%r12), %rax
movq 0x10(%rax), %rdi
xorl %esi, %esi
callq 0xd5a0
movq 0x40(%r12), %r15
movq 0x10(%r15), %rdx
testl %eax, %eax
je 0x184de
leaq 0x16f9b(%rip), %rsi     # 0x2f46d
movq %r14, %rdi
xorl %eax, %eax
callq 0x122dd
jmp 0x18510
movq %rdx, %rdi
callq 0xd640
movq %rax, %rbx
movq 0x58(%r15), %r14
movq %r15, %rdi
callq 0xdea8
movq 0x40(%r12), %rdi
movq %r14, 0x58(%rdi)
movq %rbx, %rsi
callq 0xdf5f
movq %rbx, %rdi
callq 0xd090
xorl %ebx, %ebx
movl %ebx, %eax
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_reload_config
CeCommandStatus_t command_reload_config(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;
     CeApp_t* app = user_data;
#if defined(PLATFORM_WINDOWS)
     if(app->user_config.library_instance == NULL) return CE_COMMAND_NO_ACTION;
#else
     if(!app->user_config.handle) return CE_COMMAND_NO_ACTION;
#endif

     if(app->command_entries) free(app->command_entries);
     ce_app_init_default_commands(app);
     char* config_path = strdup(app->user_config.filepath);
     user_config_free(&app->user_config);
     if(user_config_init(&app->user_config, config_path)){
          app->user_config.init_func(app);
     }else{
          ce_app_message(app, "failed to reload config: '%s', see log for details", config_path);
          return CE_COMMAND_FAILURE;
     }
     free(config_path);
     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x0, 0x208(%rdi)
je 0x1852e
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
cmpq $0x0, 0x2c80(%rsi)
je 0x1859b
leaq 0x2c80(%rbx), %r15
movq 0x2830(%rbx), %rdi
testq %rdi, %rdi
je 0x18558
callq 0xd090
movq %rbx, %rdi
callq 0x121c2
movq 0x2c88(%rbx), %rdi
callq 0xd640
movq %rax, %r14
movq %r15, %rdi
callq 0x1212d
movq %r15, %rdi
movq %r14, %rsi
callq 0x12070
testb %al, %al
je 0x185a2
movq %rbx, %rdi
callq *0x2c90(%rbx)
movq %r14, %rdi
callq 0xd090
xorl %eax, %eax
jmp 0x185bb
movl $0x3, %eax
jmp 0x185bb
leaq 0x16ef6(%rip), %rsi     # 0x2f49f
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x122dd
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_new_buffer
CeCommandStatus_t command_new_buffer(CeCommand_t* command, void* user_data){
     if(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;

     const char* buffer_name = "unnamed";
     if(command->arg_count == 1 && command->args[0].type == CE_COMMAND_ARG_STRING) buffer_name = command->args[0].string;

     CeBuffer_t* buffer = new_buffer();
     ce_buffer_alloc(buffer, 1, buffer_name);
     command_context.view->buffer = buffer;
     command_context.view->cursor = (CePoint_t){0, 0};
     ce_buffer_node_insert(&app->buffer_node_head, buffer);

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x208(%rdi), %rax
movl $0x2, %r14d
cmpq $0x1, %rax
jg 0x187c5
movq %rsi, %rbx
movl $0x3, %r14d
cmpq $0x0, 0x27f8(%rsi)
jne 0x187c5
movq 0x2818(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
leaq 0x8(%rcx), %r13
xorl %r14d, %r14d
cmpl $0x0, (%rcx)
cmovneq %r14, %r13
leaq 0x16d71(%rip), %r15     # 0x2f4e8
cmpq $0x1, %rax
jne 0x1878d
movq 0x200(%rdi), %rax
cmpl $0x2, (%rax)
jne 0x1878d
movq 0x8(%rax), %r15
xorl %eax, %eax
callq 0x11995
movq %rax, %r12
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rdx
callq 0xddf2
movq %r12, 0x40(%r13)
addq $0x2828, %rbx           # imm = 0x2828
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r13)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x108b8
movl %r14d, %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_rename_buffer
CeCommandStatus_t command_rename_buffer(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;
     CommandContext_t command_context = {};

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

     free(command_context.view->buffer->name);
     command_context.view->buffer->name = strdup(command->args[0].string);
     if(command_context.view->buffer->status == CE_BUFFER_STATUS_NONE) command_context.view->buffer->status = CE_BUFFER_STATUS_MODIFIED;

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x1, 0x208(%rdi)
jne 0x1884d
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x200(%rdi), %rcx
cmpl $0x2, (%rcx)
jne 0x18846
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
jne 0x18846
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %r14
movq 0x48(%r14), %rax
movq 0x10(%rax), %rdi
callq 0xd090
movq 0x200(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0xd640
movq 0x48(%r14), %rcx
movq %rax, 0x10(%rcx)
xorl %eax, %eax
cmpl $0x0, 0x18(%rcx)
jne 0x18846
movl $0x1, 0x18(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_line_number
CeCommandStatus_t command_line_number(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;
     if(strcmp(command->args[0].string, "none") == 0){
          app->config_options.line_number = CE_LINE_NUMBER_NONE;
     }else if(strcmp(command->args[0].string, "absolute") == 0){
          app->config_options.line_number = CE_LINE_NUMBER_ABSOLUTE;
     }else if(strcmp(command->args[0].string, "relative") == 0){
          app->config_options.line_number = CE_LINE_NUMBER_RELATIVE;
     }else if(strcmp(command->args[0].string, "both") == 0){
          app->config_options.line_number = CE_LINE_NUMBER_ABSOLUTE_AND_RELATIVE;
     }else{
          return CE_COMMAND_PRINT_HELP;
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x1, 0x208(%rdi)
jne 0x18b0e
pushq %r14
pushq %rbx
pushq %rax
movq 0x200(%rdi), %rcx
cmpl $0x2, (%rcx)
jne 0x18b07
movq %rsi, %rbx
movq 0x8(%rcx), %r14
leaq 0x16a52(%rip), %rsi     # 0x2f4f0
movq %r14, %rdi
callq 0xd390
xorl %ecx, %ecx
testl %eax, %eax
je 0x18aff
leaq 0x16a42(%rip), %rsi     # 0x2f4f5
movq %r14, %rdi
callq 0xd390
testl %eax, %eax
je 0x18af3
leaq 0x15c95(%rip), %rsi     # 0x2e75b
movq %r14, %rdi
callq 0xd390
testl %eax, %eax
je 0x18afa
leaq 0x16a25(%rip), %rsi     # 0x2f4fe
movq %r14, %rdi
callq 0xd390
movl %eax, %ecx
movl $0x2, %eax
testl %ecx, %ecx
jne 0x18b07
movl $0x3, %ecx
jmp 0x18aff
movl $0x1, %ecx
jmp 0x18aff
movl $0x2, %ecx
movl %ecx, 0x1a50(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_man_page_on_word_under_cursor
CeCommandStatus_t command_man_page_on_word_under_cursor(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;

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

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

     CeRange_t range = ce_vim_find_little_word_boundaries(command_context.view->buffer, command_context.view->cursor); // returns -1
     char* word = ce_buffer_dupe_string(command_context.view->buffer, range.start, (range.end.x - range.start.x) + 1);
     if(!word) return CE_COMMAND_NO_ACTION;
     char cmd[128];
     snprintf(cmd, 128, "man %s", word);
     free(word);
     ce_app_run_shell_command(app, cmd, command_context.tab_layout, command_context.view, false);

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl $0x2, %ebx
cmpq $0x0, 0x208(%rdi)
jne 0x18be4
movq %rsi, %r14
movl $0x3, %ebx
cmpq $0x0, 0x27f8(%rsi)
jne 0x18be4
movq 0x2818(%r14), %rax
movq 0x10(%rax), %r15
movq 0x10(%r15), %rax
leaq 0x8(%rax), %r12
xorl %ebx, %ebx
cmpl $0x0, (%rax)
cmovneq %rbx, %r12
movq 0x40(%r12), %rsi
movq 0x30(%r12), %rdx
movq 0x38(%r12), %rcx
movq %rsp, %r13
movq %r13, %rdi
callq 0x26c69
movq 0x40(%r12), %rdi
movq 0x10(%r13), %rcx
movq (%r13), %rsi
movq 0x8(%r13), %rdx
subq %rsi, %rcx
incq %rcx
callq 0xf60a
testq %rax, %rax
je 0x18bdf
movq %rax, %r13
leaq 0x16959(%rip), %rdx     # 0x2f503
leaq 0x20(%rsp), %rbp
movl $0x80, %esi
movq %rbp, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0xd260
movq %r13, %rdi
callq 0xd090
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x1452c
jmp 0x18be4
movl $0x3, %ebx
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_shell_command
CeCommandStatus_t command_shell_command(CeCommand_t* command, void* user_data){
     if(command->arg_count < 1) return CE_COMMAND_PRINT_HELP;

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

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

     char* command_args = build_string_from_command_args(command);

     if(!ce_app_run_shell_command(app, command_args, command_context.tab_layout, command_context.view, false)){
          free(command_args);
          return CE_COMMAND_FAILURE;
     }

     free(command_args);
     return CE_COMMAND_SUCCESS;
}

// Assembly:
cmpq $0x0, 0x208(%rdi)
jle 0x18c70
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
jne 0x18c64
movq 0x2818(%rbx), %rax
movq 0x10(%rax), %r14
movq 0x10(%r14), %rax
leaq 0x8(%rax), %r15
xorl %ecx, %ecx
cmpl $0x0, (%rax)
cmovneq %rcx, %r15
callq 0x18c76
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x1452c
movl %eax, %ebx
movq %r12, %rdi
callq 0xd090
xorb $0x1, %bl
movzbl %bl, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x2, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: build_string_from_command_args
static char* build_string_from_command_args(CeCommand_t* command){
     char buffer[256];
     int64_t buffer_consumed = 0;

     char* result = NULL;
     for(int64_t i = 0; i < command->arg_count; i++){
          int rc = 0;

          switch(command->args[i].type){
          default:
              return result;
          case CE_COMMAND_ARG_INTEGER:
               rc = snprintf(buffer + buffer_consumed, 256 - buffer_consumed, "%" PRId64 " ", command->args[i].integer);
               break;
          case CE_COMMAND_ARG_DECIMAL:
               rc = snprintf(buffer + buffer_consumed, 256 - buffer_consumed, "%f ", command->args[i].decimal);
               break;
          case CE_COMMAND_ARG_STRING:
               rc = snprintf(buffer + buffer_consumed, 256 - buffer_consumed, "%s ", command->args[i].string);
               break;
          }

          if(rc < 0){
               ce_log("snprintf() failed: %s\n", strerror(errno));
               return result;
          }

          buffer_consumed += rc;
     }

     result = strdup(buffer);

     // strip off extra space at the end
     size_t len = strlen(result);
     if(len >= 1) result[len - 1] = 0;

     return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
cmpq $0x0, 0x208(%rdi)
jle 0x18d3d
movq %rdi, %rbx
movl $0x8, %r13d
leaq 0x1691b(%rip), %r15     # 0x2f5c0
leaq 0x15f76(%rip), %r12     # 0x2ec22
xorl %ebp, %ebp
xorl %r14d, %r14d
movq 0x200(%rbx), %rax
movl -0x8(%rax,%r13), %ecx
cmpl $0x2, %ecx
je 0x18d02
cmpl $0x1, %ecx
je 0x18ce4
testl %ecx, %ecx
jne 0x18d7d
leaq (%rsp,%r14), %rdi
movl $0x100, %esi            # imm = 0x100
subq %r14, %rsi
movq (%rax,%r13), %rcx
movq %r12, %rdx
jmp 0x18d19
leaq (%rsp,%r14), %rdi
movl $0x100, %esi            # imm = 0x100
subq %r14, %rsi
movsd (%rax,%r13), %xmm0
movq %r15, %rdx
movb $0x1, %al
callq 0xd260
jmp 0x18d20
leaq (%rsp,%r14), %rdi
movl $0x100, %esi            # imm = 0x100
subq %r14, %rsi
movq (%rax,%r13), %rcx
leaq 0x169cd(%rip), %rdx     # 0x2f6e6
xorl %eax, %eax
callq 0xd260
testl %eax, %eax
js 0x18d5c
movl %eax, %eax
addq %rax, %r14
incq %rbp
addq $0x10, %r13
cmpq 0x208(%rbx), %rbp
jl 0x18cb1
movq %rsp, %rdi
callq 0xd640
movq %rax, %rbx
movq %rax, %rdi
callq 0xd210
testq %rax, %rax
je 0x18d7f
movb $0x0, -0x1(%rbx,%rax)
jmp 0x18d7f
callq 0xd0a0
movl (%rax), %edi
callq 0xd650
leaq 0x16855(%rip), %rdi     # 0x2f5c4
xorl %ebx, %ebx
movq %rax, %rsi
xorl %eax, %eax
callq 0xd954
jmp 0x18d7f
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_shell_command_relative
CeCommandStatus_t command_shell_command_relative(CeCommand_t* command, void* user_data){
     if(command->arg_count < 1) return CE_COMMAND_PRINT_HELP;

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

     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;
#if defined(PLATFORM_WINDOWS)
     ce_app_message(app, "shell_command_relative not yet supported on windows. Please use shell_command.");
     return CE_COMMAND_FAILURE;
#else
     char* command_args = build_string_from_command_args(command);

     if(!ce_app_run_shell_command(app, command_args, command_context.tab_layout, command_context.view, true)){
          free(command_args);
          return CE_COMMAND_FAILURE;
     }

     free(command_args);
     return CE_COMMAND_SUCCESS;
#endif
}

// Assembly:
cmpq $0x0, 0x208(%rdi)
jle 0x18e10
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
jne 0x18e04
movq 0x2818(%rbx), %rax
movq 0x10(%rax), %r14
movq 0x10(%r14), %rax
leaq 0x8(%rax), %rcx
xorl %r15d, %r15d
cmpl $0x0, (%rax)
cmoveq %rcx, %r15
callq 0x18c76
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
movq %r15, %rcx
movl $0x1, %r8d
callq 0x1452c
movl %eax, %ebx
movq %r12, %rdi
callq 0xd090
xorb $0x1, %bl
movzbl %bl, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x2, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_paste_clipboard
CeCommandStatus_t command_paste_clipboard(CeCommand_t* command, void* user_data) {
     if(command->arg_count >= 1) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = (CeApp_t*)(user_data);
     CommandContext_t command_context = {};
     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;

     CePoint_t resulting_cursor = ce_paste_clipboard_into_buffer(command_context.view->buffer,
                                                                 command_context.view->cursor);
     if(resulting_cursor.x <= 0){
          return CE_COMMAND_FAILURE;
     }

     command_context.view->cursor = resulting_cursor;
     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x2, %eax
cmpq $0x0, 0x208(%rdi)
jle 0x18e48
retq
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
jne 0x18e47
pushq %rbx
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rbx
movq 0x48(%rbx), %rdi
movq 0x38(%rbx), %rsi
movq 0x40(%rbx), %rdx
callq 0x14d46
testq %rax, %rax
jle 0x18e89
movq %rax, 0x38(%rbx)
movq %rdx, 0x40(%rbx)
xorl %eax, %eax
jmp 0x18e8e
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_clang_goto_def
CeCommandStatus_t command_clang_goto_def(CeCommand_t* command, void* user_data){
     CeApp_t* app = (CeApp_t*)(user_data);
     CommandContext_t command_context = {};
     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;

     if(!ce_clangd_request_goto_def(&app->clangd,
                                    command_context.view->buffer,
                                    command_context.view->cursor)){
         return CE_COMMAND_FAILURE;
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
je 0x18ea0
retq
pushq %rax
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rcx
addq $0x2cd0, %rsi           # imm = 0x2CD0
movq 0x48(%rcx), %rax
movq 0x38(%rcx), %rdx
movq 0x40(%rcx), %rcx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x15cc9
xorb $0x1, %al
movzbl %al, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_clang_goto_decl
CeCommandStatus_t command_clang_goto_decl(CeCommand_t* command, void* user_data){
     CeApp_t* app = (CeApp_t*)(user_data);
     CommandContext_t command_context = {};
     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;

     if(!ce_clangd_request_goto_decl(&app->clangd,
                                     command_context.view->buffer,
                                     command_context.view->cursor)){
         return CE_COMMAND_FAILURE;
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
je 0x18ee8
retq
pushq %rax
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rcx
addq $0x2cd0, %rsi           # imm = 0x2CD0
movq 0x48(%rcx), %rax
movq 0x38(%rcx), %rdx
movq 0x40(%rcx), %rcx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x15d1a
xorb $0x1, %al
movzbl %al, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_clang_goto_type_def
CeCommandStatus_t command_clang_goto_type_def(CeCommand_t* command, void* user_data){
     CeApp_t* app = (CeApp_t*)(user_data);
     CommandContext_t command_context = {};
     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;

     if(!ce_clangd_request_goto_type_def(&app->clangd,
                                         command_context.view->buffer,
                                         command_context.view->cursor)){
         return CE_COMMAND_FAILURE;
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
je 0x18f30
retq
pushq %rax
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rcx
addq $0x2cd0, %rsi           # imm = 0x2CD0
movq 0x48(%rcx), %rax
movq 0x38(%rcx), %rdx
movq 0x40(%rcx), %rcx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x15ac8
xorb $0x1, %al
movzbl %al, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_clang_find_references
CeCommandStatus_t command_clang_find_references(CeCommand_t* command, void* user_data){
     CeApp_t* app = (CeApp_t*)(user_data);
     CommandContext_t command_context = {};
     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;

     if(!ce_clangd_request_find_references(&app->clangd,
                                           command_context.view->buffer,
                                           command_context.view->cursor)){
         return CE_COMMAND_FAILURE;
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
je 0x18f78
retq
pushq %rax
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rcx
addq $0x2cd0, %rsi           # imm = 0x2CD0
movq 0x48(%rcx), %rax
movq 0x38(%rcx), %rdx
movq 0x40(%rcx), %rcx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x15dbc
xorb $0x1, %al
movzbl %al, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_clang_format
CeCommandStatus_t command_clang_format(CeCommand_t* command, void* user_data){
     CeApp_t* app = (CeApp_t*)(user_data);
     CommandContext_t command_context = {};
     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;
     if(strlen(app->config_options.clang_format_path) == 0){
         ce_app_message(app, "clang format binary/executable path not configured");
         return CE_COMMAND_FAILURE;
     }
     // Skip attempting to format non c files.
     CeAppBufferData_t* buffer_data = command_context.view->buffer->app_data;
     if(buffer_data->syntax_function != ce_syntax_highlight_c &&
        buffer_data->syntax_function != ce_syntax_highlight_cpp){
         ce_app_message(app, "Attempted to clang format non c/c++ buffer");
         return CE_COMMAND_FAILURE;
     }
     if(app->vim.mode == CE_VIM_MODE_VISUAL ||
        app->vim.mode == CE_VIM_MODE_VISUAL_LINE ||
        app->vim.mode == CE_VIM_MODE_VISUAL_BLOCK){
         if(!ce_clang_format_selection(app->config_options.clang_format_path, command_context.view,
                                       app->vim.mode, &app->visual)){
             return CE_COMMAND_FAILURE;
         }
         app->vim.mode = CE_VIM_MODE_NORMAL;
     }else{
         if(!ce_clang_format_buffer(app->config_options.clang_format_path, command_context.view->buffer,
                                    command_context.view->cursor)){
             return CE_COMMAND_FAILURE;
         }
     }
     return CE_COMMAND_SUCCESS;
}

// Assembly:
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
je 0x18fc0
retq
pushq %rbx
movq %rsi, %rbx
movq 0x2818(%rsi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x8(%rax), %rcx
xorl %esi, %esi
cmpl $0x0, (%rax)
cmoveq %rcx, %rsi
cmpb $0x0, 0x22f4(%rbx)
je 0x19042
movq 0x40(%rsi), %rax
movq 0x58(%rax), %rcx
movq 0x600(%rcx), %rcx
cmpq 0x20f61(%rip), %rcx     # 0x39f60
sete %dl
cmpq 0x20f4f(%rip), %rcx     # 0x39f58
sete %cl
orb %dl, %cl
je 0x1904b
leaq 0x22f4(%rbx), %rdi
movl 0x20(%rbx), %edx
leal -0x2(%rdx), %ecx
cmpl $0x2, %ecx
ja 0x19063
leaq 0x1a20(%rbx), %rcx
callq 0x14b80
movl %eax, %ecx
movl $0x1, %eax
testb %cl, %cl
je 0x19061
movl $0x0, 0x20(%rbx)
jmp 0x1907e
leaq 0x164c1(%rip), %rsi     # 0x2f50a
jmp 0x19052
leaq 0x164eb(%rip), %rsi     # 0x2f53d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x122dd
movl $0x1, %eax
popq %rbx
retq
movq 0x30(%rsi), %rdx
movq 0x38(%rsi), %rcx
movq %rax, %rsi
callq 0x14aa9
movl %eax, %ecx
movl $0x1, %eax
testb %cl, %cl
je 0x19061
xorl %eax, %eax
jmp 0x19061
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_vim_e
CeCommandStatus_t command_vim_e(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;
     CommandContext_t command_context = {};

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

     if(load_file_into_view(&app->buffer_node_head, command_context.view, &app->config_options, &app->vim,
                         true, command->args[0].string)){
          ce_clangd_file_open(&app->clangd, app->buffer_node_head->buffer);
     }else{
          return CE_COMMAND_FAILURE;
     }

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl $0x2, %ebp
cmpq $0x1, 0x208(%rdi)
jne 0x192bd
movq 0x200(%rdi), %rax
cmpl $0x2, (%rax)
jne 0x192bd
movq %rsi, %rbx
movl $0x3, %ebp
cmpq $0x0, 0x27f8(%rsi)
jne 0x192bd
movq 0x2818(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
leaq 0x8(%rcx), %rsi
xorl %edx, %edx
cmpl $0x0, (%rcx)
cmovneq %rdx, %rsi
leaq 0x2828(%rbx), %rdi
leaq 0x1a50(%rbx), %rdx
leaq 0x20(%rbx), %rcx
movq 0x8(%rax), %r9
movl $0x1, %ebp
movl $0x1, %r8d
callq 0x1169d
testq %rax, %rax
je 0x192bd
movq 0x2828(%rbx), %rax
addq $0x2cd0, %rbx           # imm = 0x2CD0
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x15667
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_vim_q
CeCommandStatus_t command_vim_q(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;
     if(app->tab_list_layout->tab_list.tab_count == 1 &&
        ce_layout_tab_get_layout_count(app->tab_list_layout->tab_list.current) == 1){
          return command_quit(command, user_data);
     }

     if(!delete_layout(user_data)) return CE_COMMAND_FAILURE;

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x2, %eax
cmpq $0x0, 0x208(%rdi)
jne 0x19320
movq %rsi, %rbx
movq 0x2818(%rsi), %rax
cmpq $0x1, 0x18(%rax)
jne 0x19313
movq %rdi, %r14
movq 0x10(%rax), %rdi
callq 0x1f29c
cmpq $0x1, %rax
jne 0x19313
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x16567
movq %rbx, %rdi
callq 0x16d00
xorb $0x1, %al
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_vim_q_exclam
CeCommandStatus_t command_vim_q_exclam(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;
     if(app->tab_list_layout->tab_list.tab_count == 1 &&
        ce_layout_tab_get_layout_count(app->tab_list_layout->tab_list.current) == 1){
          app->quit = true;
          return command_quit(command, user_data);
     }

     if(!delete_layout(user_data)) return CE_COMMAND_FAILURE;

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x2, %eax
cmpq $0x0, 0x208(%rdi)
jne 0x19384
movq %rsi, %rbx
movq 0x2818(%rsi), %rax
cmpq $0x1, 0x18(%rax)
jne 0x19377
movq %rdi, %r14
movq 0x10(%rax), %rdi
callq 0x1f29c
cmpq $0x1, %rax
jne 0x19377
movb $0x1, 0x2c78(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x16567
movq %rbx, %rdi
callq 0x16d00
xorb $0x1, %al
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: command_vim_wq
CeCommandStatus_t command_vim_wq(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);

     if(app->tab_list_layout->tab_list.tab_count == 1 &&
        ce_layout_tab_get_layout_count(app->tab_list_layout->tab_list.current) == 1){
          return command_quit(command, user_data);
     }

     if(!delete_layout(user_data)) return CE_COMMAND_FAILURE;
     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x2, %eax
cmpq $0x0, 0x208(%rdi)
jne 0x19425
movq %rsi, %rbx
movl $0x3, %eax
cmpq $0x0, 0x27f8(%rsi)
jne 0x19425
movq %rdi, %r14
movq 0x2818(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x48(%rax), %rsi
movq %rbx, %rdi
callq 0x16893
movq 0x2818(%rbx), %rax
cmpq $0x1, 0x18(%rax)
jne 0x19418
movq 0x10(%rax), %rdi
callq 0x1f29c
cmpq $0x1, %rax
jne 0x19418
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x16567
movq %rbx, %rdi
callq 0x16d00
xorb $0x1, %al
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq