// File: /workspace/github_c_makefile_star2_O0/System-Glitch[P]ESGILinter-C/src/fileloader.c
// Function: search_files
void search_files(arraylist_t *conf, arraylist_t *files, char *path){
    if(!conf) return;

    struct dirent *read;
    DIR *rep;
    char *ext = NULL;
    char *name;

    rep = opendir(path);
    while ((read = readdir(rep))) {
        if(read->d_type == 8){
            ext = strsubstr(read->d_name, strlen(read->d_name)-2,2);
            if((strcmp(ext,".c") == 0 || strcmp(ext,".h") == 0) && is_excluded(conf, read->d_name) == 0){
                name = malloc(sizeof(char) * 1048);
                if(strcmp(path, ".") == 0){
                    strcpy(name,read->d_name);
                }else{
                    strcpy(name, path);
                    strcat(name,"/");
                    strcat(name, read->d_name);
                }
                arraylist_add(files, name);
            }
            free(ext);
            ext = NULL;
        }else if(read->d_type == 4 && strcmp(read->d_name,".") != 0 && strcmp(read->d_name,"..") != 0 && is_recursive(conf) != 0){

            if(strcmp(path, ".") == 0){
                strcpy(path, read->d_name);
            }else{
                strcat(path, "/");
                strcat(path, read->d_name);
            }
            search_files(conf, files, path);
        }
    }
    if(strindexof(path, '/') != -1){
        ext = strsubstr(path, 0, strlastindexof(path, '/'));
        strcpy(path, ext);
        free(ext);

    }else{
        strcpy(path,".");
    }
    closedir(rep);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x2a50
jmp 0x2caa
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2080
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2100
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x2c3f
movq -0x20(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x8, %eax
jne 0x2b89
movq -0x20(%rbp), %rax
addq $0x13, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
addq $0x13, %rdi
callq 0x2090
movq -0x40(%rbp), %rdi
subq $0x2, %rax
movl %eax, %esi
movl $0x2, %edx
callq 0xa5e0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x10e3f(%rip), %rsi     # 0x13908
callq 0x20f0
cmpl $0x0, %eax
je 0x2aec
movq -0x30(%rbp), %rdi
leaq 0x10550(%rip), %rsi     # 0x1302e
callq 0x20f0
cmpl $0x0, %eax
jne 0x2b73
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x13, %rsi
callq 0x74b0
cmpl $0x0, %eax
jne 0x2b73
movl $0x418, %edi            # imm = 0x418
callq 0x2110
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x11961(%rip), %rsi     # 0x1447c
callq 0x20f0
cmpl $0x0, %eax
jne 0x2b38
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x13, %rsi
callq 0x2060
jmp 0x2b66
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2060
movq -0x38(%rbp), %rdi
leaq 0x1111f(%rip), %rsi     # 0x13c6f
callq 0x2150
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x13, %rsi
callq 0x2150
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x8730
movq -0x30(%rbp), %rdi
callq 0x2030
movq $0x0, -0x30(%rbp)
jmp 0x2c3a
movq -0x20(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x4, %eax
jne 0x2c38
movq -0x20(%rbp), %rdi
addq $0x13, %rdi
leaq 0x118d3(%rip), %rsi     # 0x1447c
callq 0x20f0
cmpl $0x0, %eax
je 0x2c38
movq -0x20(%rbp), %rdi
addq $0x13, %rdi
leaq 0x118b5(%rip), %rsi     # 0x1447b
callq 0x20f0
cmpl $0x0, %eax
je 0x2c38
movq -0x8(%rbp), %rdi
callq 0x7350
cmpl $0x0, %eax
je 0x2c38
movq -0x18(%rbp), %rdi
leaq 0x11893(%rip), %rsi     # 0x1447c
callq 0x20f0
cmpl $0x0, %eax
jne 0x2c06
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x13, %rsi
callq 0x2060
jmp 0x2c27
movq -0x18(%rbp), %rdi
leaq 0x1105e(%rip), %rsi     # 0x13c6f
callq 0x2150
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x13, %rsi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2a30
jmp 0x2c3a
jmp 0x2a65
movq -0x18(%rbp), %rdi
movl $0x2f, %esi
callq 0xa8d0
cmpl $-0x1, %eax
je 0x2c91
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2f, %esi
callq 0xa940
movq -0x48(%rbp), %rdi
movl %eax, %edx
xorl %esi, %esi
callq 0xa5e0
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2060
movq -0x30(%rbp), %rdi
callq 0x2030
jmp 0x2ca1
movq -0x18(%rbp), %rdi
leaq 0x117e0(%rip), %rsi     # 0x1447c
callq 0x2060
movq -0x28(%rbp), %rdi
callq 0x20d0
addq $0x50, %rsp
popq %rbp
retq