// File: /workspace/github_c_makefile_star2_O0/niuyuling[P]CProxy/conf.c
// Function: read_conf
void read_conf(char *filename, conf * configure)
{
    char *buff, *global_content, *http_content, *https_content, *httpdns_content, *httpudp_content;
    FILE *file;
    long file_size;

    file = fopen(filename, "r");
    if (file == NULL) {
        perror("cannot open config file.");
        exit(-1);
    }
    fseek(file, 0, SEEK_END);
    file_size = ftell(file);
    buff = (char *)alloca(file_size + 1);
    if (buff == NULL)
        perror("out of memory.");
    rewind(file);
    if (fread(buff, file_size, 1, file) < 1) {
        perror("fread");
    }
    fclose(file);
    buff[file_size] = '\0';

    if ((global_content = read_module(buff, "global")) == NULL)
        perror("read global module error");
    else
        parse_global_module(global_content, configure);
    free(global_content);

    if ((http_content = read_module(buff, "http")) == NULL)
        perror("read http module error");
    else
        parse_http_module(http_content, configure);
    free(http_content);

    if ((https_content = read_module(buff, "https")) == NULL)
        perror("read https module error");
    else
        parse_https_module(https_content, configure);
    free(https_content);

    if ((httpdns_content = read_module(buff, "httpdns")) == NULL)
        perror("read httpdns module error");
    else
        parse_httpdns_module(httpdns_content, configure);
    free(httpdns_content);

    if ((httpudp_content = read_module(buff, "httpudp")) == NULL)
        perror("read httpdns module error");
    else
        parse_httpudp_module(httpudp_content, configure);
    free(httpudp_content);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x2046(%rip), %rsi      # 0xc5f1
callq 0x2470
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xa5d1
leaq 0x1f59(%rip), %rdi      # 0xc51b
callq 0x2480
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x24e0
movq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x23c0
movq -0x48(%rbp), %rdi
callq 0x22e0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rcx
addq $0x10, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xa61c
leaq 0x1b64(%rip), %rdi      # 0xc17b
callq 0x2480
movq -0x48(%rbp), %rdi
callq 0x2190
movq -0x18(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rcx
movl $0x1, %edx
callq 0x2090
cmpq $0x1, %rax
jae 0xa64d
leaq 0x1eec(%rip), %rdi      # 0xc534
callq 0x2480
movq -0x48(%rbp), %rdi
callq 0x2100
movq -0x18(%rbp), %rax
movq -0x50(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rdi
leaq 0x1ecd(%rip), %rsi      # 0xc53a
callq 0xa7a0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0xa68a
leaq 0x1ebe(%rip), %rdi      # 0xc541
callq 0x2480
jmp 0xa697
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xa930
movq -0x20(%rbp), %rdi
callq 0x2030
movq -0x18(%rbp), %rdi
leaq 0x1d75(%rip), %rsi      # 0xc420
callq 0xa7a0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0xa6c8
leaq 0x1e99(%rip), %rdi      # 0xc55a
callq 0x2480
jmp 0xa6d5
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xaaf0
movq -0x28(%rbp), %rdi
callq 0x2030
movq -0x18(%rbp), %rdi
leaq 0x1e88(%rip), %rsi      # 0xc571
callq 0xa7a0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0xa706
leaq 0x1e78(%rip), %rdi      # 0xc577
callq 0x2480
jmp 0xa713
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xb050
movq -0x30(%rbp), %rdi
callq 0x2030
movq -0x18(%rbp), %rdi
leaq 0x1e68(%rip), %rsi      # 0xc58f
callq 0xa7a0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0xa744
leaq 0x1e5a(%rip), %rdi      # 0xc597
callq 0x2480
jmp 0xa751
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xb5b0
movq -0x38(%rbp), %rdi
callq 0x2030
movq -0x18(%rbp), %rdi
leaq 0x1e4c(%rip), %rsi      # 0xc5b1
callq 0xa7a0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0xa782
leaq 0x1e1c(%rip), %rdi      # 0xc597
callq 0x2480
jmp 0xa78f
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xb6f0
movq -0x40(%rbp), %rdi
callq 0x2030
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax)