// File: /workspace/github_c_makefile_star2_O2/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, (%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x102dc
leaq 0x2828(%r14), %rbx
leaq 0x1a50(%r14), %rax
movq %rax, 0x18(%rsp)
leaq 0x20(%r14), %rax
movq %rax, 0x10(%rsp)
movq %r14, 0x20(%rsp)
leaq 0x2cd0(%r14), %rax
movq %rax, 0x8(%rsp)
leaq 0x40(%rsp), %rbp
xorl %r14d, %r14d
cmpq 0x28(%rsp), %r14
jge 0x18d28
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq (%rax,%r14,8), %r13
cmpb $0x1, (%rcx,%r14)
jne 0x18cbb
cmpb $0x2e, (%r13)
jne 0x18c7f
cmpb $0x0, 0x1(%r13)
je 0x18cbb
cmpb $0x2e, 0x1(%r13)
jne 0x18c7f
cmpb $0x0, 0x2(%r13)
je 0x18cbb
movl $0x400, %esi            # imm = 0x400
movq %rbp, %rdi
leaq 0x1394d(%rip), %rdx     # 0x2c5db
movq %r12, %rcx
pushq $0x2f
popq %r8
movq %r13, %r9
xorl %eax, %eax
pushq $0x2e
pushq $0x2f
callq 0xd260
popq %rcx
popq %rdx
movq %rbp, %rdi
movq %r15, %rsi
movq 0x20(%rsp), %rdx
movq (%rsp), %rcx
callq 0x18be3
jmp 0x18d20
movq %r13, %rdi
movq %r15, %rsi
callq 0xd390
testl %eax, %eax
jne 0x18d20
movl $0x400, %esi            # imm = 0x400
movq %rbp, %rdi
leaq 0x11bd6(%rip), %rdx     # 0x2a8af
movq %r12, %rcx
pushq $0x2f
popq %r8
movq %r13, %r9
xorl %eax, %eax
callq 0xd260
movq %rbx, %r13
movq %rbx, %rdi
movq (%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
pushq $0x1
popq %r8
movq %rbp, %r9
callq 0x10fbd
testq %rax, %rax
je 0x18d20
movq (%r13), %rax
movq (%rax), %rsi
movq 0x8(%rsp), %rdi
callq 0x14cd5
incq %r14
jmp 0x18c43
leaq 0x28(%rsp), %rdi
callq 0x1039b
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq