LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: split_layout
CeLayout_t* split_layout(CeApp_t* app, bool vertical){
     CeLayout_t* tab_layout = app->tab_list_layout->tab_list.current;
     bool always_add_last = false;
     CeLayout_t* new_layout = ce_layout_split(tab_layout, vertical, always_add_last);

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

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

               }
          }
     }

     return new_layout;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq 0x2818(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x18(%rbp), %rdi
movb -0x9(%rbp), %cl
movb -0x19(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %esi
movzbl %al, %edx
callq 0x27cf0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1d069
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
movq -0x8(%rbp), %rax
movq 0x1a60(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x1a68(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x1a58(%rax), %rcx
callq 0x116a0
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x281b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1d067
movq -0x30(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x1d067
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x1d065
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
movq -0x8(%rbp), %rax
movq 0x1a60(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x1a68(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x1a58(%rax), %rcx
callq 0x116a0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1d007
jmp 0x1d067
jmp 0x1d069
movq -0x28(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_split_layout
CeCommandStatus_t command_split_layout(CeCommand_t* command, void* user_data){
     if(command->arg_count != 1) return CE_COMMAND_PRINT_HELP;
     if(command->args[0].type != CE_COMMAND_ARG_STRING) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;
     bool vertical = false;

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

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

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
je 0x1d10a
movl $0x2, -0x4(%rbp)
jmp 0x1d1b1
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
je 0x1d126
movl $0x2, -0x4(%rbp)
jmp 0x1d1b1
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x2710c(%rip), %rsi     # 0x44254
callq 0xd370
cmpl $0x0, %eax
jne 0x1d158
movb $0x1, -0x21(%rbp)
jmp 0x1d185
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x270ef(%rip), %rsi     # 0x4425d
callq 0xd370
cmpl $0x0, %eax
jne 0x1d17a
jmp 0x1d183
movl $0x2, -0x4(%rbp)
jmp 0x1d1b1
jmp 0x1d185
movq -0x20(%rbp), %rdi
movb -0x21(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x1cf50
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x1d1aa
movl $0x1, -0x4(%rbp)
jmp 0x1d1b1
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_select_parent_layout
CeCommandStatus_t command_select_parent_layout(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;

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

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

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
je 0x1d417
movl $0x2, -0x4(%rbp)
jmp 0x1d475
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x2818(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x281b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1d45c
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x1d46e
movq -0x20(%rbp), %rdi
leaq 0x26e0f(%rip), %rsi     # 0x44276
movb $0x0, %al
callq 0x159f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_open_popup_view
CeCommandStatus_t command_open_popup_view(CeCommand_t* command, void* user_data){
     if(command->arg_count < 0 || command->arg_count > 1) return CE_COMMAND_PRINT_HELP;
     if(command->arg_count == 1 &&
        command->args[0].type != CE_COMMAND_ARG_STRING){
         return CE_COMMAND_PRINT_HELP;
     }
     CeApp_t* app = user_data;
     CeBuffer_t* buffer = app->shell_command_buffer;
     if(command->arg_count == 0){
         if(app->last_popup_buffer){
             buffer = app->last_popup_buffer;
         }
     }else{
         CeBufferNode_t* itr = app->buffer_node_head;
         while(itr){
              if(strcmp(itr->buffer->name, command->args[0].string) == 0){
                  buffer = itr->buffer;
                  break;
              }
              itr = itr->next;
         }
     }
     if(!ce_app_open_popup_view(app, buffer)) return CE_COMMAND_FAILURE;
     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
jl 0x1d76c
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
jle 0x1d778
movl $0x2, -0x4(%rbp)
jmp 0x1d85e
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
jne 0x1d7a2
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
je 0x1d7a2
movl $0x2, -0x4(%rbp)
jmp 0x1d85e
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x2880(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
jne 0x1d7e6
movq -0x20(%rbp), %rax
cmpq $0x0, 0x2dd0(%rax)
je 0x1d7e4
movq -0x20(%rbp), %rax
movq 0x2dd0(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x1d83d
movq -0x20(%rbp), %rax
movq 0x2828(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1d83b
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rsi
callq 0xd370
cmpl $0x0, %eax
jne 0x1d82d
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x1d83b
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x1d7f5
jmp 0x1d83d
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x17c50
testb $0x1, %al
jne 0x1d857
movl $0x1, -0x4(%rbp)
jmp 0x1d85e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_close_popup_view
CeCommandStatus_t command_close_popup_view(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;
     CeApp_t* app = user_data;
     if(!ce_app_close_popup_view(app)) return CE_COMMAND_FAILURE;
     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
je 0x1d897
movl $0x2, -0x4(%rbp)
jmp 0x1d8bc
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x19af0
testb $0x1, %al
jne 0x1d8b5
movl $0x1, -0x4(%rbp)
jmp 0x1d8bc
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_create_file
CeCommandStatus_t command_create_file(CeCommand_t* command, void* user_data){
     if(command->arg_count < 0 || command->arg_count > 1) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
jl 0x1d8fc
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
jle 0x1d908
movl $0x2, -0x4(%rbp)
jmp 0x1d991
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
je 0x1d929
movl $0x2, -0x4(%rbp)
jmp 0x1d991
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x26954(%rip), %rsi     # 0x44293
callq 0xd590
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1d981
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0xd0a0
movl (%rax), %edi
callq 0xd630
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x26925(%rip), %rsi     # 0x44296
movb $0x0, %al
callq 0x159f0
movl $0x1, -0x4(%rbp)
jmp 0x1d991
movq -0x28(%rbp), %rdi
callq 0xd1e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_rename_file
CeCommandStatus_t command_rename_file(CeCommand_t* command, void* user_data){
     if(command->arg_count < 0 || command->arg_count != 2) return CE_COMMAND_PRINT_HELP;

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

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

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
jl 0x1d9cc
movq -0x10(%rbp), %rax
cmpq $0x2, 0x208(%rax)
je 0x1d9d8
movl $0x2, -0x4(%rbp)
jmp 0x1da64
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
je 0x1d9f1
movl $0x2, -0x4(%rbp)
jmp 0x1da64
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, 0x10(%rax)
je 0x1da0b
movl $0x2, -0x4(%rbp)
jmp 0x1da64
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x18(%rax), %rsi
callq 0xd5b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1da5d
callq 0xd0a0
movl (%rax), %edi
callq 0xd630
movq %rax, %rsi
leaq 0x26863(%rip), %rdi     # 0x442b0
movb $0x0, %al
callq 0xd8f0
movl $0x1, -0x4(%rbp)
jmp 0x1da64
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_remove_file
CeCommandStatus_t command_remove_file(CeCommand_t* command, void* user_data){
     if(command->arg_count < 0 || command->arg_count > 1) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
jl 0x1da9c
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
jle 0x1daa5
movl $0x2, -0x4(%rbp)
jmp 0x1db1c
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
je 0x1dac6
movl $0x2, -0x4(%rbp)
jmp 0x1db1c
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
callq 0xd0c0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x1db15
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0xd0a0
movl (%rax), %edi
callq 0xd630
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x267c0(%rip), %rsi     # 0x442c5
movb $0x0, %al
callq 0x159f0
movl $0x1, -0x4(%rbp)
jmp 0x1db1c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_load_discovered_file
CeCommandStatus_t command_load_discovered_file(CeCommand_t* command, void* user_data){
    CeApp_t* app = user_data;
    CommandContext_t command_context = {};

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

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

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

    return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c5d0
testb $0x1, %al
jne 0x1e7e2
movl $0x3, -0x4(%rbp)
jmp 0x1e85c
movq -0x20(%rbp), %rax
cmpq $0x0, 0x2cb0(%rax)
jg 0x1e7f9
movl $0x3, -0x4(%rbp)
jmp 0x1e85c
movq -0x20(%rbp), %rdi
leaq 0x25b05(%rip), %rsi     # 0x44309
leaq -0x61bb(%rip), %rdx     # 0x18650
callq 0x15c60
movq -0x20(%rbp), %rdi
addq $0x28a0, %rdi           # imm = 0x28A0
movq -0x20(%rbp), %rax
movq 0x2cb8(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x2cb0(%rax), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x220d0
movq -0x20(%rbp), %rax
movq 0x2860(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x28a0, %rsi           # imm = 0x28A0
callq 0x14d80
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_new_tab
CeCommandStatus_t command_new_tab(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;

     CeApp_t* app = user_data;

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

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
je 0x1e897
movl $0x2, -0x4(%rbp)
jmp 0x1e8dd
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x2818(%rax), %rdi
callq 0x277f0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1e8c3
movl $0x3, -0x4(%rbp)
jmp 0x1e8dd
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x2818(%rax), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: select_tab_left
bool select_tab_left(CeApp_t* app){
     for(int64_t i = 0; i < app->tab_list_layout->tab_list.tab_count; i++){
          if(app->tab_list_layout->tab_list.current == app->tab_list_layout->tab_list.tabs[i]){
               if(i > 0){
                    app->tab_list_layout->tab_list.current = app->tab_list_layout->tab_list.tabs[i - 1];
                    return true;
               }else{
                    // wrap around
                    app->tab_list_layout->tab_list.current = app->tab_list_layout->tab_list.tabs[app->tab_list_layout->tab_list.tab_count - 1];
                    return true;
               }
               break;
          }
     }
     return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x2818(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jge 0x1e9c6
movq -0x10(%rbp), %rax
movq 0x2818(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x2818(%rcx), %rcx
movq 0x8(%rcx), %rcx
movq -0x18(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
jne 0x1e9b3
cmpq $0x0, -0x18(%rbp)
jle 0x1e978
movq -0x10(%rbp), %rax
movq 0x2818(%rax), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movq 0x2818(%rax), %rax
movq %rcx, 0x10(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1e9ca
movq -0x10(%rbp), %rax
movq 0x2818(%rax), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x2818(%rcx), %rcx
movq 0x18(%rcx), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movq 0x2818(%rax), %rax
movq %rcx, 0x10(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1e9ca
jmp 0x1e9b5
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1e900
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: select_tab_right
bool select_tab_right(CeApp_t* app){
     for(int64_t i = 0; i < app->tab_list_layout->tab_list.tab_count; i++){
          if(app->tab_list_layout->tab_list.current == app->tab_list_layout->tab_list.tabs[i]){
               if(i < (app->tab_list_layout->tab_list.tab_count - 1)){
                    app->tab_list_layout->tab_list.current = app->tab_list_layout->tab_list.tabs[i + 1];
                    return true;
               }else{
                    // wrap around
                    app->tab_list_layout->tab_list.current = app->tab_list_layout->tab_list.tabs[0];
                    return true;
               }
               break;
          }
     }
     return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x2818(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jge 0x1eab4
movq -0x10(%rbp), %rax
movq 0x2818(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x2818(%rcx), %rcx
movq 0x8(%rcx), %rcx
movq -0x18(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
jne 0x1eaa1
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x2818(%rcx), %rcx
movq 0x18(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jge 0x1ea7a
movq -0x10(%rbp), %rax
movq 0x2818(%rax), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movq 0x2818(%rax), %rax
movq %rcx, 0x10(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1eab8
movq -0x10(%rbp), %rax
movq 0x2818(%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x2818(%rax), %rax
movq %rcx, 0x10(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1eab8
jmp 0x1eaa3
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1e9f0
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
je 0x1eaea
movl $0x2, -0x4(%rbp)
jmp 0x1ec12
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
je 0x1eb06
movl $0x2, -0x4(%rbp)
jmp 0x1ec12
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x26e3f(%rip), %rsi     # 0x45963
callq 0xd370
cmpl $0x0, %eax
jne 0x1eb90
movq -0x20(%rbp), %rax
movq 0x2818(%rax), %rax
cmpq $0x1, 0x18(%rax)
jne 0x1eb5e
movq -0x20(%rbp), %rdi
leaq 0x257d3(%rip), %rsi     # 0x4431e
movb $0x0, %al
callq 0x159f0
movl $0x3, -0x4(%rbp)
jmp 0x1ec12
movq -0x20(%rbp), %rdi
callq 0x1e8f0
testb $0x1, %al
jne 0x1eb6d
jmp 0x1eb84
movq -0x20(%rbp), %rax
movb $0x0, 0x2800(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x1ec12
movl $0x3, -0x4(%rbp)
jmp 0x1ec12
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x26da3(%rip), %rsi     # 0x45949
callq 0xd370
cmpl $0x0, %eax
jne 0x1ec09
movq -0x20(%rbp), %rax
movq 0x2818(%rax), %rax
cmpq $0x1, 0x18(%rax)
jne 0x1ebdd
movq -0x20(%rbp), %rdi
leaq 0x25751(%rip), %rsi     # 0x4431e
movb $0x0, %al
callq 0x159f0
movl $0x3, -0x4(%rbp)
jmp 0x1ec12
movq -0x20(%rbp), %rdi
callq 0x1e9e0
testb $0x1, %al
jne 0x1ebec
jmp 0x1ec00
movq -0x20(%rbp), %rax
movb $0x0, 0x2800(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x1ec12
movl $0x3, -0x4(%rbp)
jmp 0x1ec12
jmp 0x1ec0b
movl $0x2, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
je 0x1ec4a
movl $0x2, -0x4(%rbp)
jmp 0x1ed82
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
je 0x1ec66
movl $0x2, -0x4(%rbp)
jmp 0x1ed82
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c5d0
testb $0x1, %al
jne 0x1ec9b
movl $0x3, -0x4(%rbp)
jmp 0x1ed82
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x26cc4(%rip), %rsi     # 0x45975
callq 0xd370
cmpl $0x0, %eax
jne 0x1ed00
movq -0x20(%rbp), %rdi
leaq 0x25932(%rip), %rsi     # 0x445f8
leaq -0x652d(%rip), %rdx     # 0x187a0
callq 0x15c60
movq -0x20(%rbp), %rax
movl $0x0, 0x19fc(%rax)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x30(%rcx), %rdx
movq %rdx, 0x2c40(%rax)
movq 0x38(%rcx), %rcx
movq %rcx, 0x2c48(%rax)
jmp 0x1ed70
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x26c74(%rip), %rsi     # 0x4598a
callq 0xd370
cmpl $0x0, %eax
jne 0x1ed65
movq -0x20(%rbp), %rdi
leaq 0x258c5(%rip), %rsi     # 0x445f0
leaq -0x6592(%rip), %rdx     # 0x187a0
callq 0x15c60
movq -0x20(%rbp), %rax
movl $0x1, 0x19fc(%rax)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x30(%rcx), %rdx
movq %rdx, 0x2c40(%rax)
movq 0x38(%rcx), %rcx
movq %rcx, 0x2c48(%rax)
jmp 0x1ed6e
movl $0x2, -0x4(%rbp)
jmp 0x1ed82
jmp 0x1ed70
movq -0x20(%rbp), %rax
movb $0x1, 0x2c79(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_noh
CeCommandStatus_t command_noh(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;
     CeApp_t* app = user_data;
     app->highlight_search = false;
     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
je 0x1edb3
movl $0x2, -0x4(%rbp)
jmp 0x1edcd
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x0, 0x2c79(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_setpaste
CeCommandStatus_t command_setpaste(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;
     CeApp_t* app = user_data;
     app->vim.pasting = true;
     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
je 0x1ee03
movl $0x2, -0x4(%rbp)
jmp 0x1ee1d
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x1, 0x19fa(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_setnopaste
CeCommandStatus_t command_setnopaste(CeCommand_t* command, void* user_data){
     if(command->arg_count != 0) return CE_COMMAND_PRINT_HELP;
     CeApp_t* app = user_data;
     app->vim.pasting = false;
     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
je 0x1ee53
movl $0x2, -0x4(%rbp)
jmp 0x1ee6d
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x0, 0x19fa(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
je 0x1eeaa
movl $0x2, -0x4(%rbp)
jmp 0x1efe2
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
je 0x1eec6
movl $0x2, -0x4(%rbp)
jmp 0x1efe2
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c5d0
testb $0x1, %al
jne 0x1eefb
movl $0x3, -0x4(%rbp)
jmp 0x1efe2
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x26a64(%rip), %rsi     # 0x45975
callq 0xd370
cmpl $0x0, %eax
jne 0x1ef60
movq -0x20(%rbp), %rdi
leaq 0x25430(%rip), %rsi     # 0x44356
leaq -0x678d(%rip), %rdx     # 0x187a0
callq 0x15c60
movq -0x20(%rbp), %rax
movl $0x2, 0x19fc(%rax)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x30(%rcx), %rdx
movq %rdx, 0x2c40(%rax)
movq 0x38(%rcx), %rcx
movq %rcx, 0x2c48(%rax)
jmp 0x1efd0
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x26a14(%rip), %rsi     # 0x4598a
callq 0xd370
cmpl $0x0, %eax
jne 0x1efc5
movq -0x20(%rbp), %rdi
leaq 0x253c3(%rip), %rsi     # 0x4434e
leaq -0x67f2(%rip), %rdx     # 0x187a0
callq 0x15c60
movq -0x20(%rbp), %rax
movl $0x3, 0x19fc(%rax)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x30(%rcx), %rdx
movq %rdx, 0x2c40(%rax)
movq 0x38(%rcx), %rcx
movq %rcx, 0x2c48(%rax)
jmp 0x1efce
movl $0x2, -0x4(%rbp)
jmp 0x1efe2
jmp 0x1efd0
movq -0x20(%rbp), %rax
movb $0x1, 0x2c79(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
je 0x1f01a
movl $0x2, -0x4(%rbp)
jmp 0x1f0a0
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c5d0
testb $0x1, %al
jne 0x1f04c
movl $0x3, -0x4(%rbp)
jmp 0x1f0a0
cmpq $0x0, -0x28(%rbp)
je 0x1f099
movq -0x20(%rbp), %rdi
leaq 0x25305(%rip), %rsi     # 0x44363
leaq -0x6ed5(%rip), %rdx     # 0x18190
callq 0x15c60
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x28a0, %rsi           # imm = 0x28A0
callq 0x158b0
movq -0x20(%rbp), %rax
movq 0x2860(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x28a0, %rsi           # imm = 0x28A0
callq 0x14d80
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
je 0x1f0da
movl $0x2, -0x4(%rbp)
jmp 0x1f23e
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c5d0
testb $0x1, %al
jne 0x1f10f
movl $0x3, -0x4(%rbp)
jmp 0x1f23e
movq -0x20(%rbp), %rdi
leaq 0x25255(%rip), %rsi     # 0x4436f
leaq -0x67f1(%rip), %rdx     # 0x18930
callq 0x15c60
movq $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x2828(%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x1f15e
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x1f13d
movq -0x38(%rbp), %rdi
shlq $0x3, %rdi
callq 0xd4a0
movq %rax, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq 0x2828(%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x1f1c6
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
callq 0xd620
movq %rax, %rdx
movq -0x48(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x1f186
movq -0x20(%rbp), %rdi
addq $0x28a0, %rdi           # imm = 0x28A0
movq -0x48(%rbp), %rsi
movq -0x38(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x220d0
movq -0x20(%rbp), %rax
movq 0x2860(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x28a0, %rsi           # imm = 0x28A0
callq 0x14d80
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x38(%rbp), %rax
jge 0x1f22e
movq -0x48(%rbp), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xd090
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1f205
movq -0x48(%rbp), %rdi
callq 0xd090
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
je 0x1fa17
movl $0x2, -0x4(%rbp)
jmp 0x1fa6c
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c5d0
testb $0x1, %al
jne 0x1fa49
movl $0x3, -0x4(%rbp)
jmp 0x1fa6c
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x140c0
testb $0x1, %al
jne 0x1fa65
movl $0x3, -0x4(%rbp)
jmp 0x1fa6c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c5d0
testb $0x1, %al
jne 0x1fac5
movl $0x3, -0x4(%rbp)
jmp 0x1fbd9
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
jne 0x1fb64
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
jne 0x1fb64
movl $0x2f, %edi
callq 0x33a80
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
addq $0x20, %rax
addq $0x1050, %rax           # imm = 0x1050
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1fb47
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x1a08, %rsi           # imm = 0x1A08
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rcx
callq 0x1fbf0
jmp 0x1fb62
movq -0x20(%rbp), %rdi
leaq 0x24859(%rip), %rsi     # 0x443ab
movb $0x0, %al
callq 0x159f0
movl $0x3, -0x4(%rbp)
jmp 0x1fbd9
jmp 0x1fbd2
movq -0x10(%rbp), %rax
cmpq $0x2, 0x208(%rax)
jne 0x1fbc7
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
jne 0x1fbc7
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, 0x10(%rax)
jne 0x1fbc7
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x1a08, %rsi           # imm = 0x1A08
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x18(%rax), %rcx
callq 0x1fbf0
jmp 0x1fbd0
movl $0x2, -0x4(%rbp)
jmp 0x1fbd9
jmp 0x1fbd2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
je 0x1fe6a
movl $0x2, -0x4(%rbp)
jmp 0x1ff51
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c5d0
testb $0x1, %al
jne 0x1fe9f
movl $0x3, -0x4(%rbp)
jmp 0x1ff51
movb $0x0, -0x31(%rbp)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rdi
xorl %esi, %esi
callq 0xd580
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movb %al, -0x31(%rbp)
testb $0x1, -0x31(%rbp)
jne 0x1feee
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rdx
leaq 0x24515(%rip), %rsi     # 0x443f3
movb $0x0, %al
callq 0x159f0
movl $0x3, -0x4(%rbp)
jmp 0x1ff51
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rdi
callq 0xd620
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x58(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0xe160
movq -0x48(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq %rcx, 0x58(%rax)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0xe270
movq -0x40(%rbp), %rdi
callq 0xd090
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
je 0x1ff8a
movl $0x2, -0x4(%rbp)
jmp 0x20053
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x2c80(%rax)
jne 0x1ffac
movl $0x3, -0x4(%rbp)
jmp 0x20053
movq -0x20(%rbp), %rax
cmpq $0x0, 0x2830(%rax)
je 0x1ffca
movq -0x20(%rbp), %rax
movq 0x2830(%rax), %rdi
callq 0xd090
movq -0x20(%rbp), %rdi
callq 0x157d0
movq -0x20(%rbp), %rax
movq 0x2c88(%rax), %rdi
callq 0xd620
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
addq $0x2c80, %rdi           # imm = 0x2C80
callq 0x15690
movq -0x20(%rbp), %rdi
addq $0x2c80, %rdi           # imm = 0x2C80
movq -0x28(%rbp), %rsi
callq 0x15550
testb $0x1, %al
jne 0x20011
jmp 0x20024
movq -0x20(%rbp), %rax
movq 0x2c90(%rax), %rax
movq -0x20(%rbp), %rdi
callq *%rax
jmp 0x20043
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x243f2(%rip), %rsi     # 0x44425
movb $0x0, %al
callq 0x159f0
movl $0x1, -0x4(%rbp)
jmp 0x20053
movq -0x28(%rbp), %rdi
callq 0xd090
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
jle 0x2031a
movl $0x2, -0x4(%rbp)
jmp 0x203f3
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c5d0
testb $0x1, %al
jne 0x2034f
movl $0x3, -0x4(%rbp)
jmp 0x203f3
leaq 0x24118(%rip), %rax     # 0x4446e
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
jne 0x2038b
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
jne 0x2038b
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movb $0x0, %al
callq 0x148d0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0x1, %esi
callq 0xe050
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x28(%rbp), %rax
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x50(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x38(%rax)
movq -0x20(%rbp), %rdi
addq $0x2828, %rdi           # imm = 0x2828
movq -0x40(%rbp), %rsi
callq 0x12c10
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
je 0x2042a
movl $0x2, -0x4(%rbp)
jmp 0x204d0
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
je 0x20446
movl $0x2, -0x4(%rbp)
jmp 0x204d0
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c5d0
testb $0x1, %al
jne 0x20478
movl $0x3, -0x4(%rbp)
jmp 0x204d0
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rdi
callq 0xd090
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rdi
callq 0xd620
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
cmpl $0x0, 0x18(%rax)
jne 0x204c9
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movl $0x1, 0x18(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)