// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: load_file_into_view
CeBuffer_t* load_file_into_view(CeBufferNode_t** buffer_node_head, CeView_t* view,
                                CeConfigOptions_t* config_options, CeVim_t* vim,
                                bool insert_into_jump_list, const char* filepath){
    char load_path[MAX_PATH_LEN + 1];
#if defined(PLATFORM_WINDOWS)
     char* res = NULL;
     if(filepath[0] != 0 &&
        filepath[1] == ':'){
          res = strdup(filepath);
     }else{
          res = _fullpath(NULL, filepath, MAX_PATH_LEN);
     }
#else
     char* res = realpath(filepath, NULL);
#endif
     if(!res) return NULL;

     char cwd[MAX_PATH_LEN + 1];
     if(ce_get_cwd(cwd, MAX_PATH_LEN)){
          size_t cwd_len = strlen(cwd);
          // append a path separator so it looks like a path
          if(cwd_len < MAX_PATH_LEN){
               cwd[cwd_len] = CE_PATH_SEPARATOR;
               cwd_len++;
               cwd[cwd_len] = 0;
          }
          // if the file is in our current directory, only show part of the path
          if(strncmp(cwd, res, cwd_len) == 0){
               strncpy(load_path, res + cwd_len, MAX_PATH_LEN);
          }else{
               strncpy(load_path, res, MAX_PATH_LEN);
          }
     }else{
          strncpy(load_path, res, MAX_PATH_LEN);
     }

     free(res);

     CeBuffer_t* already_loaded_buffer = find_already_loaded_file(*buffer_node_head, load_path);
     if(already_loaded_buffer){
         ce_view_switch_buffer(view, already_loaded_buffer, vim, config_options, insert_into_jump_list);
         return already_loaded_buffer;
     }

     // load file
     CeBuffer_t* buffer = new_buffer();
     if(ce_buffer_load_file(buffer, load_path)){
          ce_buffer_node_insert(buffer_node_head, buffer);
          ce_view_switch_buffer(view, buffer, vim, config_options, insert_into_jump_list);
          determine_buffer_syntax(buffer);
     }else{
          free(buffer);
          return NULL;
     }

     return buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x828, %rsp            # imm = 0x828
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
movq %r9, %rdi
xorl %esi, %esi
callq 0xd410
testq %rax, %rax
je 0x110e9
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x110fe
movq %rbx, %rsi
testb %al, %al
je 0x1104c
leaq 0x10(%rsp), %rdi
callq 0xd210
movq %rax, %r13
cmpq $0x3ff, %rax            # imm = 0x3FF
ja 0x1102e
movw $0x2f, 0x10(%rsp,%r13)
incq %r13
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0xd0d0
xorl %ecx, %ecx
testl %eax, %eax
cmoveq %r13, %rcx
movq %rbx, %rsi
addq %rcx, %rsi
leaq 0x420(%rsp), %r13
movl $0x400, %edx            # imm = 0x400
movq %r13, %rdi
callq 0xd0b0
movq %rbx, %rdi
callq 0xd090
movq (%r12), %rdi
movq %r13, %rsi
callq 0x10f43
testq %rax, %rax
je 0x11096
movq %rax, %r13
movzbl %bpl, %r8d
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
callq 0x10bc9
jmp 0x110e9
callq 0x1129e
movq %rax, %r13
leaq 0x420(%rsp), %rsi
movq %rax, %rdi
callq 0xdec5
testb %al, %al
je 0x110de
movq %r12, %rdi
movq %r13, %rsi
callq 0x103e0
movzbl %bpl, %r8d
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
callq 0x10bc9
movq %r13, %rdi
callq 0x1110f
jmp 0x110e9
movq %r13, %rdi
callq 0xd090
xorl %r13d, %r13d
movq %r13, %rax
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq