// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_load_file
CeCommandStatus_t command_load_file(CeCommand_t* command, void* user_data){
     if(command->arg_count < 0 || command->arg_count > 1) return CE_COMMAND_PRINT_HELP;

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

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

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

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

     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x208(%rax)
jl 0x1db5c
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
jle 0x1db68
movl $0x2, -0x4(%rbp)
jmp 0x1dce7
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 0x1db9d
movl $0x3, -0x4(%rbp)
jmp 0x1dce7
movq -0x10(%rbp), %rax
cmpq $0x1, 0x208(%rax)
jne 0x1dc6f
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
cmpl $0x2, (%rax)
je 0x1dbcb
movl $0x2, -0x4(%rbp)
jmp 0x1dce7
movq -0x20(%rbp), %rdi
addq $0x2828, %rdi           # imm = 0x2828
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq $0x1a50, %rdx           # imm = 0x1A50
movq -0x20(%rbp), %rcx
addq $0x20, %rcx
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %r9
movl $0x1, %r8d
callq 0x14420
cmpq $0x0, %rax
jne 0x1dc4f
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x200(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
callq 0xd0a0
movl (%rax), %edi
callq 0xd630
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq %rax, %rcx
leaq 0x26699(%rip), %rsi     # 0x442df
movb $0x0, %al
callq 0x159f0
jmp 0x1dc6d
movq -0x20(%rbp), %rdi
addq $0x2cd0, %rdi           # imm = 0x2CD0
movq -0x20(%rbp), %rax
movq 0x2828(%rax), %rax
movq (%rax), %rsi
callq 0x1a760
jmp 0x1dce0
movq -0x20(%rbp), %rdi
leaq 0x26682(%rip), %rsi     # 0x442fc
leaq -0x5831(%rip), %rdx     # 0x18450
callq 0x15c60
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x149f0
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
addq $0x28a0, %rdi           # imm = 0x28A0
movq -0x20(%rbp), %rax
movq 0x2748(%rax), %rax
movq (%rax), %rax
movq (%rax), %rsi
movq -0x38(%rbp), %rdx
callq 0x14a50
movq -0x38(%rbp), %rdi
callq 0xd090
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 $0x50, %rsp
popq %rbp
retq