// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_commands.c
// Function: open_file_in_dir_recursively
static void open_file_in_dir_recursively(char* path, char* match, CeApp_t* app, CeView_t* view){
     CeListDirResult_t list_dir_result = ce_list_dir(path);

#if defined(PLATFORM_WINDOWS)
     int64_t path_len = strnlen(path, MAX_PATH_LEN);
     if(path_len > 0 && path_len < MAX_PATH_LEN){
         if(path[path_len - 1] == CE_CURRENT_DIR_SEARCH){
             path[path_len - 1] = '.';
         }
     }
#endif

     for(int64_t i = 0; i < list_dir_result.count; i++){
          if(list_dir_result.is_directories[i] &&
             strcmp(list_dir_result.filenames[i], ".") != 0 &&
             strcmp(list_dir_result.filenames[i], "..") != 0){
               char next_dir[MAX_PATH_LEN];
               snprintf(next_dir, MAX_PATH_LEN, "%s%c%s%c%c", path, CE_PATH_SEPARATOR, list_dir_result.filenames[i],
                        CE_PATH_SEPARATOR, CE_CURRENT_DIR_SEARCH);
               open_file_in_dir_recursively(next_dir, match, app, view);
          }else if(strcmp(list_dir_result.filenames[i], match) == 0){
               char full_path[MAX_PATH_LEN];
               snprintf(full_path, MAX_PATH_LEN, "%s%c%s", path, CE_PATH_SEPARATOR, list_dir_result.filenames[i]);
               if(load_file_into_view(&app->buffer_node_head, view, &app->config_options, &app->vim,
                                   true, full_path)){
                    ce_clangd_file_open(&app->clangd, app->buffer_node_head->buffer);
               }
          }
     }
     ce_free_list_dir_result(&list_dir_result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %rcx, %rbx
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x1077f
cmpq $0x0, (%r13)
jle 0x1991b
movq (%rsp), %rax
leaq 0x2828(%rax), %rcx
movq %rcx, 0x20(%rsp)
leaq 0x1a50(%rax), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x20(%rax), %rcx
movq %rcx, 0x10(%rsp)
addq $0x2cd0, %rax           # imm = 0x2CD0
movq %rax, 0x8(%rsp)
leaq 0x40(%rsp), %rbp
xorl %r14d, %r14d
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq (%rax,%r14,8), %r13
cmpb $0x1, (%rcx,%r14)
jne 0x198a3
cmpb $0x2e, (%r13)
jne 0x19865
cmpb $0x0, 0x1(%r13)
je 0x198a3
cmpb $0x2e, 0x1(%r13)
jne 0x19865
cmpb $0x0, 0x2(%r13)
je 0x198a3
movl $0x400, %esi            # imm = 0x400
movq %rbp, %rdi
leaq 0x15d67(%rip), %rdx     # 0x2f5db
movq %r12, %rcx
movl $0x2f, %r8d
movq %r13, %r9
xorl %eax, %eax
pushq $0x2e
pushq $0x2f
callq 0xd260
addq $0x10, %rsp
movq %rbp, %rdi
movq %r15, %rsi
movq (%rsp), %rdx
movq %rbx, %rcx
callq 0x197c3
jmp 0x1990d
movq %r13, %rdi
movq %r15, %rsi
callq 0xd390
testl %eax, %eax
jne 0x1990d
movl $0x400, %esi            # imm = 0x400
movq %rbp, %rdi
leaq 0x13fee(%rip), %rdx     # 0x2d8af
movq %r12, %rcx
movl $0x2f, %r8d
movq %r13, %r9
xorl %eax, %eax
callq 0xd260
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
movl $0x1, %r8d
movq %rbp, %r9
callq 0x1169d
testq %rax, %rax
je 0x1990d
movq (%r13), %rax
movq (%rax), %rsi
movq 0x8(%rsp), %rdi
callq 0x15667
incq %r14
cmpq 0x28(%rsp), %r14
jl 0x19834
leaq 0x28(%rsp), %rdi
callq 0x1086a
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq