LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/mruby-zest[P]osc-bridge/test/mock-test.c
// Function: test_pvolume
void test_pvolume(schema_t schema, bridge_t *bridge)
{
    //Add a view to /part0/Pvolume
    printf("#Grabbing Pvolume Handle On Schema...\n");
    uri_t uri = "/part0/Pvolume";
    schema_handle_t handle = sm_get(schema, uri);

    assert_true(sm_valid(handle), "A valid handle is obtained", __LINE__);

    //printf("Obtained Handle for <%s>...\n", uri);
    assert_str_eq("Pvolume", sm_get_name(handle),
            "The name of the parameter is available", __LINE__);
    assert_str_eq("Vol", sm_get_short(handle),
            "The abbreviated name is available", __LINE__);
    assert_str_eq("Part Volume", sm_get_tooltip(handle),
            "The tooltip is available", __LINE__);
    assert_str_eq("", sm_get_units(handle),
            "Optional units have some return value", __LINE__);

    void **v1_ = malloc(sizeof(void*));
    void **v2_ = malloc(sizeof(void*));
    *v1_ = &v1;
    *v2_ = &v2;

    br_add_callback(bridge, uri, print_response, v1_);
    br_add_callback(bridge, uri, print_response, v2_);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
leaq 0x1d2d(%rip), %rdi      # 0xa1a4
callq 0x2080
movq 0x20(%rbp), %rax
movq %rax, 0x10(%rsp)
movaps 0x10(%rbp), %xmm0
movups %xmm0, (%rsp)
leaq 0x1992(%rip), %r14      # 0x9e26
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6388
movl $0xb, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x6645
leaq 0x19ee(%rip), %rsi      # 0x9eab
movl %eax, %edi
movl $0x61, %edx
callq 0x7c6c
movl $0xb, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x65da
leaq 0x194a(%rip), %rdi      # 0x9e2d
leaq 0x19dc(%rip), %rdx      # 0x9ec6
movq %rax, %rsi
movl $0x65, %ecx
callq 0x7ce1
movl $0xb, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x65f2
leaq 0x19dc(%rip), %rdi      # 0x9eed
leaq 0x19d9(%rip), %rdx      # 0x9ef1
movq %rax, %rsi
movl $0x67, %ecx
callq 0x7ce1
movl $0xb, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x660a
leaq 0x19d4(%rip), %rdi      # 0x9f13
leaq 0x19d9(%rip), %rdx      # 0x9f1f
movq %rax, %rsi
movl $0x69, %ecx
callq 0x7ce1
movl $0xb, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x6622
leaq 0xe3f(%rip), %rdi       # 0x93ac
leaq 0x19c4(%rip), %rdx      # 0x9f38
movq %rax, %rsi
movl $0x6b, %ecx
callq 0x7ce1
movl $0x8, %edi
callq 0x21f0
movq %rax, %r15
movl $0x8, %edi
callq 0x21f0
movq %rax, %r12
leaq 0x4bee(%rip), %rax      # 0xd190
movq %rax, (%r15)
leaq 0x4be8(%rip), %rax      # 0xd194
movq %rax, (%r12)
leaq -0x21a(%rip), %r13      # 0x839d
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x3487
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x3487
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mruby-zest[P]osc-bridge/test/mock-test.c
// Function: test_enable
void test_enable(schema_t schema, bridge_t *bridge)
{
    printf("#Grabbing Penabled Handle On Schema...\n");
    uri_t uri = "/part0/Penabled";
    schema_handle_t handle = sm_get(schema, uri);

    assert_true(sm_valid(handle), "A valid handle is obtained", __LINE__);
    assert_str_eq("Penabled", sm_get_name(handle),
            "The name of the parameter is available", __LINE__);
    assert_str_eq("enable", sm_get_short(handle),
            "The abbreviated name is available", __LINE__);
    assert_str_eq("Part enable", sm_get_tooltip(handle),
            "The tooltip is available", __LINE__);
    assert_str_eq("", sm_get_units(handle),
            "Optional units have some return value", __LINE__);

    void **v3_ = malloc(sizeof(void*));
    *v3_ = &v3;

    br_add_callback(bridge, uri, print_response, v3_);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
leaq 0x1bc5(%rip), %rdi      # 0xa1ca
callq 0x2080
movq 0x20(%rbp), %rax
movq %rax, 0x10(%rsp)
movaps 0x10(%rbp), %xmm0
movups %xmm0, (%rsp)
leaq 0x1813(%rip), %r14      # 0x9e35
leaq -0x70(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6388
movl $0xb, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x6645
leaq 0x1860(%rip), %rsi      # 0x9eab
movl %eax, %edi
movl $0x7c, %edx
callq 0x7c6c
movl $0xb, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x65da
leaq 0x17cb(%rip), %rdi      # 0x9e3c
leaq 0x184e(%rip), %rdx      # 0x9ec6
movq %rax, %rsi
movl $0x7e, %ecx
callq 0x7ce1
movl $0xb, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x65f2
leaq 0x18c4(%rip), %rdi      # 0x9f63
leaq 0x184b(%rip), %rdx      # 0x9ef1
movq %rax, %rsi
movl $0x80, %ecx
callq 0x7ce1
movl $0xb, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x660a
leaq 0x1891(%rip), %rdi      # 0x9f5e
leaq 0x184b(%rip), %rdx      # 0x9f1f
movq %rax, %rsi
movl $0x82, %ecx
callq 0x7ce1
movl $0xb, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x6622
leaq 0xcb1(%rip), %rdi       # 0x93ac
leaq 0x1836(%rip), %rdx      # 0x9f38
movq %rax, %rsi
movl $0x84, %ecx
callq 0x7ce1
movl $0x8, %edi
callq 0x21f0
leaq 0x50b8(%rip), %rcx      # 0xd7d8
movq %rcx, (%rax)
leaq -0x38d(%rip), %rdx      # 0x839d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rcx
callq 0x3487
addq $0xb8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mruby-zest[P]osc-bridge/test/mock-test.c
// Function: test_options
void test_options(schema_t schema, bridge_t *bridge)
{
    (void) bridge;
    printf("#Grabbing filter type...\n"); 
    uri_t uri = "/part3/kit8/adpars/VoicePar3/FMSmp/Pfiltertype";
    schema_handle_t handle = sm_get(schema, uri);

    assert_true(sm_valid(handle), "A valid handle is obtained", __LINE__);
    assert_int_eq(14, handle.opts->num_opts, "All Options are recorded", __LINE__);
    assert_int_eq(7, handle.opts->ids[7], "The Option Id is recorded", __LINE__);
    assert_str_eq("hp2", handle.opts->labels[7], "The Option label is recorded", __LINE__);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xb8, %rsp
leaq 0x1a98(%rip), %rdi      # 0xa1f1
callq 0x2080
movq 0x20(%rbp), %rax
movq %rax, 0x10(%rsp)
movaps 0x10(%rbp), %xmm0
movups %xmm0, (%rsp)
leaq 0x17f4(%rip), %rsi      # 0x9f6a
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
callq 0x6388
movl $0xb, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x6645
leaq 0x170f(%rip), %rsi      # 0x9eab
movl %eax, %edi
movl $0x93, %edx
callq 0x7c6c
movq 0x8(%rbx), %rax
movl 0x10(%rax), %esi
leaq 0x17e3(%rip), %rdx      # 0x9f99
movl $0xe, %edi
movl $0x94, %ecx
callq 0x7b78
movq 0x8(%rbx), %rax
movq (%rax), %rax
movl 0x1c(%rax), %esi
leaq 0x17dc(%rip), %rdx      # 0x9fb2
movl $0x7, %edi
movl $0x95, %ecx
callq 0x7b78
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rsi
leaq 0x17d4(%rip), %rdi      # 0x9fcc
leaq 0x17d1(%rip), %rdx      # 0x9fd0
movl $0x96, %ecx
callq 0x7ce1
addq $0xb8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mruby-zest[P]osc-bridge/test/mock-test.c
// Function: test_vector_functionality
void test_vector_functionality(bridge_t *br)
{
    char buffer[1024];
    rtosc_message(buffer, sizeof(buffer), "/vector/test", "ffff", 1.1, 2.2, 3.3, 4.4);
    br_recv(br, buffer);
    br_recv(br, buffer);
    void **v1_ = malloc(sizeof(void*));
    *v1_ = &v1;

    br_add_callback(br, "/vector/test", print_response, v1_);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
leaq 0x15ea(%rip), %r14      # 0x9e47
leaq 0x1789(%rip), %rcx      # 0x9fed
leaq -0x420(%rbp), %r15
movsd 0x13ed(%rip), %xmm0     # 0x9c60
movsd 0x13ed(%rip), %xmm1     # 0x9c68
movsd 0x13ed(%rip), %xmm2     # 0x9c70
movsd 0x13ed(%rip), %xmm3     # 0x9c78
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
movq %r14, %rdx
movb $0x4, %al
callq 0x6730
movq %rbx, %rdi
movq %r15, %rsi
callq 0x24de
movq %rbx, %rdi
movq %r15, %rsi
callq 0x24de
movl $0x8, %edi
callq 0x21f0
leaq 0x48cc(%rip), %rcx      # 0xd190
movq %rcx, (%rax)
leaq -0x531(%rip), %rdx      # 0x839d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rcx
callq 0x3487
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/fsstat.c
// Function: main
int main(int argc, char * argv[]) {
    struct _fst * fst = fst_create(); 

    const char * ifilename = NULL; 
    FILE * fin = stdin;

    if (argc > 1)
        ifilename = argv[1];

    if (ifilename) {
        if (( fin = fopen(ifilename, "rb")) == NULL ) {
            fprintf(stderr, "Error opening file: %s", ifilename);
            exit(EXIT_FAILURE);
        }
    }

    fst_read(fst, fin);

    printf("states:\t\t%"PRIu32"\n", fst->n_states);
    printf("arcs:\t\t%"PRIu32"\n", fst_get_n_arcs(fst));
    printf("sorted input:\t%d\n", fst->flags & ISORT ? 1 : 0);
    printf("sorted output:\t%d\n", fst->flags & OSORT ? 1 : 0);
    printf("start state:\t%"PRIu32"\n", fst->start);

    fst_remove(fst);
    
    if (fin != stdout) {
        fclose(fin);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movl %edi, %r12d
xorl %eax, %eax
callq 0x20c0
movq %rax, %rbx
movq 0x3d7a(%rip), %rax      # 0x8fd8
movq (%rax), %r14
cmpl $0x2, %r12d
jl 0x528b
movq 0x8(%r15), %r15
testq %r15, %r15
je 0x528b
leaq 0xe57(%rip), %rsi       # 0x60ce
movq %r15, %rdi
callq 0x1190
movq %rax, %r14
testq %rax, %rax
je 0x5322
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2389
movl 0x4(%rbx), %esi
leaq 0x14d6(%rip), %rdi      # 0x6776
xorl %eax, %eax
callq 0x10b0
movq %rbx, %rdi
callq 0x25b3
leaq 0x14cd(%rip), %rdi      # 0x6783
movl %eax, %esi
xorl %eax, %eax
callq 0x10b0
movzbl 0xd(%rbx), %esi
andl $0x1, %esi
leaq 0x14c1(%rip), %rdi      # 0x678e
xorl %eax, %eax
callq 0x10b0
movzbl 0xd(%rbx), %esi
shrl %esi
andl $0x1, %esi
leaq 0x14bc(%rip), %rdi      # 0x67a0
xorl %eax, %eax
callq 0x10b0
movl (%rbx), %esi
leaq 0x14bf(%rip), %rdi      # 0x67b3
xorl %eax, %eax
callq 0x10b0
movq %rbx, %rdi
callq 0x21cb
movq 0x3cc6(%rip), %rax      # 0x8fd0
cmpq (%rax), %r14
je 0x5317
movq %r14, %rdi
callq 0x1090
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x12cd
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/test-parse-reg.c
// Function: reg_expected
void reg_expected(sam_hdr_t *hdr, const char *reg, int flags,
                 char *reg_exp, int tid_exp, hts_pos_t beg_exp, hts_pos_t end_exp) {
    const char *reg_out;
    int tid_out = -1;
    hts_pos_t beg_out = -1, end_out = -1;

    reg_out = sam_parse_region(hdr, reg, &tid_out, &beg_out, &end_out, flags);

    if ((reg_out != NULL) != (reg_exp != NULL) ||
        (reg_out && reg_exp && strcmp(reg_out, reg_exp) != 0) ||
        (reg_exp && tid_out != tid_exp) ||
        (reg_exp && beg_out != beg_exp) ||
        (reg_exp && end_out != end_exp)) {
        fprintf(stderr, "Parsing \"%s\" expected return \"%s\", %d:%"PRIhts_pos"-%"PRIhts_pos", "
                "but got \"%s\", %d:%"PRIhts_pos"-%"PRIhts_pos"\n",
                reg,
                reg_exp?reg_exp:"(null)", tid_exp, beg_exp, end_exp,
                reg_out?reg_out:"(null)", tid_out, beg_out, end_out);
        exit(1);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movl %r8d, %ebp
movq %rcx, %r14
movl %edx, %r9d
movq %rsi, %r15
movq 0x50(%rsp), %r13
leaq 0x4(%rsp), %rdx
movl $0xffffffff, (%rdx)     # imm = 0xFFFFFFFF
movq $-0x1, %rax
leaq 0x10(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x8(%rsp), %r8
movq %rax, (%r8)
callq 0x164a8
movq %rax, %r12
testq %rax, %rax
setne %al
testq %r14, %r14
setne %cl
xorb %al, %cl
jne 0x63f9
testq %r14, %r14
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x63c7
movq %r12, %rdi
movq %r14, %rsi
callq 0x46c0
testl %eax, %eax
jne 0x63f9
testq %r14, %r14
je 0x63d2
cmpl %ebp, 0x4(%rsp)
jne 0x63f9
testq %r14, %r14
je 0x63de
cmpq %rbx, 0x10(%rsp)
jne 0x63f9
testq %r14, %r14
je 0x63ea
cmpq %r13, 0x8(%rsp)
jne 0x63f9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r14, %r14
leaq 0x88c4a(%rip), %r10     # 0x8f04d
cmoveq %r10, %r14
testq %r12, %r12
movq 0xa9bcf(%rip), %rax     # 0xaffe0
movq (%rax), %rdi
cmovneq %r12, %r10
movl 0x4(%rsp), %r11d
subq $0x8, %rsp
leaq 0x88bdc(%rip), %rsi     # 0x8f004
movq %r15, %rdx
movq %r14, %rcx
movl %ebp, %r8d
movq %rbx, %r9
xorl %eax, %eax
pushq 0x10(%rsp)
pushq 0x20(%rsp)
pushq %r11
pushq %r10
pushq %r13
callq 0x4700
addq $0x30, %rsp
movl $0x1, %edi
callq 0x45e0
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/test-parse-reg.c
// Function: main
int main(int argc, char **argv) {
    sam_hdr_t *hdr;
    samFile *fp;
    int flags = 0;

    while (argc > 1) {
        if (strcmp(argv[1], "-m") == 0) {
            flags |= HTS_PARSE_LIST;
            argc--; argv++;
            continue;
        }

        if (strcmp(argv[1], "-c") == 0) {
            flags |= HTS_PARSE_ONE_COORD;
            argc--; argv++;
            continue;
        }

        // Automatic mode for test harness
        if (strcmp(argv[1], "-t") == 0)
            reg_test(argv[2]);

        break;
    }

    // Interactive mode for debugging
    if (argc != 3) {
        fprintf(stderr, "Usage: test-parse-reg [-m] [-c] region[,region]...\n");
        exit(1);
    }

    if (!(fp = sam_open(argv[1], "r"))) {
        perror(argv[1]);
        exit(1);
    }

    if (!(hdr = sam_hdr_read(fp))) {
        fprintf(stderr, "Couldn't read header\n");
        exit(1);
    }

    const char *reg = argv[2];
    while (*reg) {
        int tid;
        hts_pos_t beg, end;
        reg = sam_parse_region(hdr, reg, &tid, &beg, &end, flags);
        if (!reg) {
            fprintf(stderr, "Failed to parse region\n");
            exit(1);
        }
        printf("%-20s %12"PRIhts_pos" %12"PRIhts_pos"\n",
               tid == -1 ? "*" : hdr->target_name[tid],
               beg, end);
    }

    sam_hdr_destroy(hdr);
    sam_close(fp);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x2, %edi
jl 0x65d5
movq %rsi, %r14
movl %edi, %ebp
incl %ebp
addq $0x8, %r14
xorl %ebx, %ebx
movq (%r14), %rax
cmpb $0x2d, (%rax)
jne 0x6502
cmpb $0x6d, 0x1(%rax)
jne 0x64c3
cmpb $0x0, 0x2(%rax)
je 0x64e6
cmpb $0x63, 0x1(%rax)
jne 0x64ed
movl $0x2, %ecx
cmpb $0x0, 0x2(%rax)
jne 0x64ed
orl %ecx, %ebx
decl %ebp
addq $0x8, %r14
cmpl $0x2, %ebp
jg 0x64af
jmp 0x65d5
movl $0x4, %ecx
jmp 0x64d4
cmpb $0x74, 0x1(%rax)
jne 0x6502
cmpb $0x0, 0x2(%rax)
jne 0x6502
movq 0x8(%r14), %rdi
callq 0x6457
cmpl $0x4, %ebp
jne 0x65d5
movq (%r14), %rdi
leaq 0x8bba7(%rip), %rsi     # 0x920bc
callq 0x9710
testq %rax, %rax
je 0x65da
movq %rax, 0x10(%rsp)
movq %rax, %rdi
callq 0x192a1
testq %rax, %rax
je 0x65e2
movq %rax, %r12
movq 0x8(%r14), %r15
cmpb $0x0, (%r15)
je 0x65ad
leaq 0x18(%rsp), %rbp
leaq 0x8bd36(%rip), %r13     # 0x92288
leaq 0x88cda(%rip), %r14     # 0x8f233
movq %r12, %rdi
movq %r15, %rsi
leaq 0xc(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
movl %ebx, %r9d
callq 0x164a8
testq %rax, %rax
je 0x65d0
movq %rax, %r15
movslq 0xc(%rsp), %rax
movq %r13, %rsi
cmpq $-0x1, %rax
je 0x6593
movq 0x20(%r12), %rcx
movq (%rcx,%rax,8), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x4060
cmpb $0x0, (%r15)
jne 0x6559
movq %r12, %rdi
callq 0x15b82
movq 0x10(%rsp), %rdi
callq 0xa972
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4ebd
callq 0x4f18
movq %r14, %rdi
callq 0x4f07
callq 0x4ee2
nop
// File: /workspace/github_c_makefile_star2_O3/CSerxzm[P]WindowstoLinuxInterface/src/REN.c
// Function: main
int main(int argc, char** argv){
    char lines[argc+1][255];
    predealLine(argc, argv, lines);
    if((strcmp("ren",lines[0])==0)||(strcmp("rename",lines[0])==0)){
        struct stat dir_stat;
        if((access(lines[1],F_OK)!=0)){
            perror("Don't exist DIR1\n");
            return 0;
        }
        else if(stat(lines[1], &dir_stat)<0){
            perror("Stat error!\n");
            return 0;
        }
        else if(rename(lines[1],lines[2])<0){
            perror("Rename error!\n");
        }
		else{
			printf("rename %s to %s \n",lines[1],lines[2]);
		}
    }
    else{
        perror("error after lines\n");
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
leal 0x1(%rdi), %eax
movq %rax, %rcx
shlq $0x8, %rcx
subq %rax, %rcx
addq $0xf, %rcx
movabsq $0x1fffffffff0, %rax    # imm = 0x1FFFFFFFFF0
andq %rcx, %rax
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
movq %rbx, %rdx
callq 0x11bc
leaq 0xd03(%rip), %rdi       # 0x2004
movq %rbx, %rsi
callq 0x1050
testl %eax, %eax
je 0x1320
leaq 0xcf4(%rip), %rdi       # 0x2008
movq %rbx, %rsi
callq 0x1050
testl %eax, %eax
jne 0x1398
leaq 0xff(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x1070
testl %eax, %eax
jne 0x137d
leaq -0xa0(%rbp), %rsi
movq %r14, %rdi
callq 0x1060
testl %eax, %eax
js 0x1386
addq $0x1fe, %rbx            # imm = 0x1FE
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1090
testl %eax, %eax
js 0x138f
leaq 0xcd8(%rip), %rdi       # 0x203d
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1040
xorl %eax, %eax
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xc8b(%rip), %rdi       # 0x200f
jmp 0x139f
leaq 0xc94(%rip), %rdi       # 0x2021
jmp 0x139f
leaq 0xc98(%rip), %rdi       # 0x202e
jmp 0x139f
leaq 0xcb0(%rip), %rdi       # 0x204f
callq 0x1080
jmp 0x1372
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/http-parser/http_parser.c
// Function: http_message_needs_eof
int
http_message_needs_eof (const http_parser *parser)
{
  if (parser->type == HTTP_REQUEST) {
    return 0;
  }

  /* See RFC 2616 section 4.4 */
  if (parser->status_code / 100 == 1 || /* 1xx e.g. Continue */
      parser->status_code == 204 ||     /* No Content */
      parser->status_code == 304 ||     /* Not Modified */
      parser->flags & F_SKIPBODY) {     /* response to a HEAD request */
    return 0;
  }

  /* RFC 7230 3.3.3, see `s_headers_almost_done` */
  if ((parser->uses_transfer_encoding == 1) &&
      (parser->flags & F_CHUNKED) == 0) {
    return 1;
  }

  if ((parser->flags & F_CHUNKED) || parser->content_length != ULLONG_MAX) {
    return 0;
  }

  return 1;
}

// Assembly:
movl (%rdi), %ecx
xorl %eax, %eax
testb $0x3, %cl
je 0x7621
btl $0x8, %ecx
jb 0x7621
movzwl 0x14(%rdi), %edx
cmpl $0x130, %edx            # imm = 0x130
je 0x7621
cmpl $0xcc, %edx
je 0x7621
addl $0xffffff38, %edx       # imm = 0xFFFFFF38
cmpl $-0x65, %edx
ja 0x7621
movl %ecx, %edx
andl $0x4, %edx
shrl $0x2, %edx
andl $0x20000004, %ecx       # imm = 0x20000004
cmpl $0x20000000, %ecx       # imm = 0x20000000
sete %al
orb %al, %dl
jne 0x7621
cmpq $-0x1, 0x8(%rdi)
sete %al
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel.c
// Function: channel_create
int channel_create(
	channel_t** pctx,
	const char* name,
    const char* args,
	const config_t* conf,
	const proxy_t* proxies,
	const int proxy_num,
	const chnroute_ctx chnr,
	const chnroute_ctx blacklist,
	void* data)
{
	channel_info_t* info;
	char chname[20] = {0};
	char *dot;

	dot = strchr(name, '.');
	if (dot) {
		memcpy(chname, name, MIN(dot - name, sizeof(chname) - 1));
	}
	else {
		strncpy(chname, name, sizeof(chname) - 1);
	}

	info = _infos;
	while (info) {

		if (strcmp(info->name, chname) == 0) {
			return info->create(pctx,
				name, args, conf,
				proxies, proxy_num,
				chnr, blacklist,
				data);
		}

		info++;
	}
	return CHANNEL_NO_EXIST;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0xc(%rsp)
movq %r8, 0x30(%rsp)
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movl $0x0, 0x20(%rsp)
movq %rsi, %rdi
movl $0x2e, %esi
callq 0x3150
testq %rax, %rax
je 0x8089
subq %r13, %rax
cmpq $0x13, %rax
movl $0x13, %edx
cmovbq %rax, %rdx
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x32b0
jmp 0x809b
leaq 0x10(%rsp), %rdi
movl $0x13, %edx
movq %r13, %rsi
callq 0x31d0
leaq 0x24bae(%rip), %r14     # 0x2cc50
leaq 0x10(%rsp), %rbx
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x34e0
addq $0x10, %r14
testl %eax, %eax
jne 0x80a7
subq $0x8, %rsp
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq 0x38(%rsp), %r8
movl 0x14(%rsp), %r9d
pushq 0x88(%rsp)
pushq 0x88(%rsp)
pushq 0x88(%rsp)
callq *-0x8(%r14)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_cache.c
// Function: cache_get
const ns_msg_t *cache_get(channel_t *ctx, const char *key)
{
	cache_t *c = (cache_t*)ctx;
	cache_item_t *item;
	struct rbnode_t *rbn;

	if (!key) {
		loge("invalid arguments\n");
		return NULL;
	}

	rbn = rbtree_lookup(&c->dic, key);
	if (!rbn) {
		loge("item not exists - %s\n", key);
		return NULL;
	}

	item = rbtree_container_of(rbn, cache_item_t, node);
	return item->msg;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x834e
movq %rsi, %r14
addq $0x68, %rdi
callq 0x39f8
testq %rax, %rax
je 0x8386
movq 0x38(%rax), %rbx
jmp 0x83bf
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x83bf
leaq 0x1a299(%rip), %rsi     # 0x225fc
leaq 0x1a2a6(%rip), %rdx     # 0x22610
leaq 0x1a2a9(%rip), %r8      # 0x2261a
xorl %ebx, %ebx
movl $0x3, %edi
movl $0xc8, %ecx
xorl %eax, %eax
callq 0x1771e
jmp 0x83bf
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x83bf
leaq 0x1a261(%rip), %rsi     # 0x225fc
leaq 0x1a26e(%rip), %rdx     # 0x22610
leaq 0x1a284(%rip), %r8      # 0x2262d
xorl %ebx, %ebx
movl $0x3, %edi
movl $0xce, %ecx
movq %r14, %r9
xorl %eax, %eax
callq 0x1771e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_cache.c
// Function: cache_remove
int cache_remove(channel_t *ctx, const char *key)
{
	cache_t *c = (cache_t*)ctx;
	cache_item_t *item;
	struct rbnode_t *rbn;

	if (!key) {
		loge("invalid arguments\n");
		return -1;
	}

	rbn = rbtree_lookup(&c->dic, key);
	if (!rbn) {
		loge("item not exists - %s\n", key);
		return -1;
	}

	item = rbtree_container_of(rbn, cache_item_t, node);
	dllist_remove(&item->entry);
	rbtree_remove(&c->dic, &item->node);
	cache_item_destroy(item);
	logi("cache removed: %s\n", key);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x844b
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %r14
movq %r14, %rdi
callq 0x39f8
testq %rax, %rax
je 0x8484
movq %rax, %r15
movq 0x28(%rax), %rax
movq 0x30(%r15), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3a34
movq %r15, %rdi
callq 0x84cb
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x176e5
cmpl $0x6, (%rax)
jl 0x84be
leaq 0x1a1cd(%rip), %rsi     # 0x225fc
leaq 0x1a20d(%rip), %rdx     # 0x22643
leaq 0x1a213(%rip), %r8      # 0x22650
xorl %ebp, %ebp
movl $0x6, %edi
movl $0xeb, %ecx
jmp 0x84b4
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0x84be
leaq 0x1a199(%rip), %rsi     # 0x225fc
leaq 0x1a1d9(%rip), %rdx     # 0x22643
leaq 0x1a1a9(%rip), %r8      # 0x2261a
movl $0x3, %edi
movl $0xdd, %ecx
xorl %eax, %eax
callq 0x1771e
jmp 0x84be
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0x84be
leaq 0x1a160(%rip), %rsi     # 0x225fc
leaq 0x1a1a0(%rip), %rdx     # 0x22643
leaq 0x1a183(%rip), %r8      # 0x2262d
movl $0x3, %edi
movl $0xe3, %ecx
movq %rbx, %r9
xorl %eax, %eax
callq 0x1771e
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_cache.c
// Function: cache_item_destroy
static void cache_item_destroy(cache_item_t* item)
{
	if (item) {
		free(item->node.key);
		ns_msg_free(item->msg);
		free(item->msg);
		free(item);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x84f7
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x3450
movq 0x38(%rbx), %rdi
callq 0x19ae0
movq 0x38(%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
popq %rbx
jmp 0x3450
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_cache.c
// Function: cache_item_add
static void cache_item_add(cache_t* c, cache_item_t* item)
{
	dlitem_t* cur, * nxt;
	cache_item_t* p;

	/* TODO: Use Heap Data Structure, see https://en.wikipedia.org/wiki/Heap_(data_structure) */
	dllist_foreach(&c->items, cur, nxt,
		cache_item_t, p, entry) {
		
		if (p->expire >= item->expire) {
			dllist_add_before(&p->entry, &item->entry);
			return;
		}
	}

	dllist_add(&c->items, &item->entry);
}

// Assembly:
leaq 0x58(%rdi), %rcx
movq %rcx, %rax
movq (%rax), %rax
cmpq %rcx, %rax
je 0x87f8
movq 0x18(%rax), %rdx
cmpq 0x40(%rsi), %rdx
jl 0x87ce
leaq 0x28(%rsi), %rcx
movq %rax, 0x28(%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsi)
movq %rcx, (%rdx)
movq %rcx, 0x8(%rax)
retq
leaq 0x28(%rsi), %rax
movq %rcx, 0x28(%rsi)
movq 0x60(%rdi), %rcx
movq %rcx, 0x30(%rsi)
movq %rax, (%rcx)
movq %rax, 0x60(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_cache.c
// Function: cache_load_cachedbs
int cache_load_cachedbs(channel_t *ctx, const char *filenames, int override)
{
	char *s, *p, *saveptr = NULL;
	struct stat fstat = {0};

	if (!filenames || !*filenames) {
		loge("Invalid filenames: %s\n", filenames);
		return -1;
	}

	s = strdup(filenames);

	for (p = strtok_r(s, ",", &saveptr);
		p && *p;
		p = strtok_r(NULL, ",", &saveptr)) {

		if (stat(p, &fstat)) {
			logw("Failed to load cache: Failed to open the file - \"%s\"\n", p);
		}
		else if (cache_load_cachedb(ctx, p, override) == -1) {
			free(s);
			return -1;
		}
	}

	free(s);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movl $0x90, %edx
xorl %esi, %esi
callq 0x31e0
testq %r15, %r15
je 0x95a9
cmpb $0x0, (%r15)
je 0x95a9
movq %r15, %rdi
callq 0x3610
leaq 0x1937f(%rip), %rsi     # 0x22878
leaq 0x10(%rsp), %rdx
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x3600
testq %rax, %rax
je 0x959b
movq %rax, %r15
leaq 0x18(%rsp), %r12
leaq 0x19355(%rip), %r13     # 0x22878
leaq 0x10(%rsp), %rbp
cmpb $0x0, (%r15)
je 0x959b
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
testl %eax, %eax
je 0x9574
xorl %eax, %eax
callq 0x176e5
cmpl $0x4, (%rax)
jl 0x9586
movl $0x4, %edi
leaq 0x190a7(%rip), %rsi     # 0x225fc
leaq 0x192f1(%rip), %rdx     # 0x2284d
movl $0x269, %ecx            # imm = 0x269
leaq 0x19312(%rip), %r8      # 0x2287a
movq %r15, %r9
xorl %eax, %eax
callq 0x1771e
jmp 0x9586
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x8fa2
cmpl $-0x1, %eax
je 0x95f7
xorl %edi, %edi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x3600
movq %rax, %r15
testq %rax, %rax
jne 0x9528
movq 0x8(%rsp), %rdi
callq 0x3450
xorl %ebx, %ebx
jmp 0x95e3
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0x95e3
leaq 0x1903b(%rip), %rsi     # 0x225fc
leaq 0x19285(%rip), %rdx     # 0x2284d
leaq 0x19292(%rip), %r8      # 0x22861
movl $0x3, %edi
movl $0x25e, %ecx            # imm = 0x25E
movq %r15, %r9
xorl %eax, %eax
callq 0x1771e
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
callq 0x3450
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x95e3
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_cache.c
// Function: cache_create
int cache_create(
	channel_t** pctx,
	const char* name,
	const char* args,
	const config_t* conf,
	const proxy_t* proxies,
	const int proxy_num,
	const chnroute_ctx chnr,
	const chnroute_ctx blacklist,
	void* data)
{
	cache_t* ctx;

	ctx = (cache_t*)malloc(sizeof(cache_t));
	if (!ctx) {
		loge("alloc\n");
		return CHANNEL_ALLOC;
	}

	memset(ctx, 0, sizeof(cache_t));

	dllist_init(&ctx->items);
	rbtree_init(&ctx->dic, rbkeycmp);

	ctx->name = name;
	ctx->conf = conf;
	ctx->proxies = proxies;
	ctx->proxy_num = proxy_num;
	ctx->chnr = chnr;
	ctx->blacklist = blacklist;
	ctx->data = data;

	ctx->fdset = fdset;
	ctx->step = step;
	ctx->query = query;
	ctx->destroy = destroy;

	if (args) {
		struct cb_querystring_state_t st[1] = {{
			.ctx = ctx, .override = FALSE,
		}};
		if (parse_querystring(args, cb_querystring, st)) {
			loge("invalid args: %s\n", args);
			return CHANNEL_WRONG_ARG;
		}
	}

	*pctx = (channel_t*)ctx;

	return CHANNEL_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebp
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movl $0x1, %edi
movl $0x78, %esi
callq 0x3240
testq %rax, %rax
je 0x9724
movq %rax, %r15
movq 0x70(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0x60(%rsp), %rdx
movq %r15, %rsi
addq $0x58, %rsi
movq %rsi, 0x58(%r15)
movq %rsi, 0x60(%r15)
leaq 0x102(%rip), %rsi       # 0x976c
movq %rsi, 0x70(%r15)
movq %r14, (%r15)
movq %r13, 0x8(%r15)
movq %r12, 0x10(%r15)
movl %ebp, 0x18(%r15)
movq %rdx, 0x20(%r15)
movq %rcx, 0x28(%r15)
movq %rax, 0x50(%r15)
leaq 0xe1(%rip), %rax        # 0x9771
movq %rax, 0x30(%r15)
leaq 0xd9(%rip), %rax        # 0x9774
movq %rax, 0x38(%r15)
leaq 0x18a(%rip), %rax       # 0x9830
movq %rax, 0x40(%r15)
leaq 0x254(%rip), %rax       # 0x9905
movq %rax, 0x48(%r15)
testq %rbx, %rbx
je 0x9718
leaq 0x10(%rsp), %rdx
movq %r15, (%rdx)
movl $0x0, 0x8(%rdx)
leaq 0x276(%rip), %rsi       # 0x9946
movq %rbx, %rdi
callq 0x1e02d
testl %eax, %eax
je 0x9718
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x9711
leaq 0x18f0d(%rip), %rsi     # 0x225fc
leaq 0x191ba(%rip), %rdx     # 0x228b0
leaq 0x191c0(%rip), %r8      # 0x228bd
movl $0x3, %edi
movl $0x2b3, %ecx            # imm = 0x2B3
movq %rbx, %r9
xorl %eax, %eax
callq 0x1771e
movl $0x2, %ebx
jmp 0x975b
movq 0x8(%rsp), %rax
movq %r15, (%rax)
xorl %ebx, %ebx
jmp 0x975b
xorl %eax, %eax
callq 0x176e5
movl $0x3, %ebx
cmpl $0x3, (%rax)
jl 0x975b
leaq 0x18ec0(%rip), %rsi     # 0x225fc
leaq 0x1916d(%rip), %rdx     # 0x228b0
leaq 0x1a169(%rip), %r8      # 0x238b3
movl $0x3, %edi
movl $0x298, %ecx            # imm = 0x298
xorl %eax, %eax
callq 0x1771e
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_cache.c
// Function: step
static int step(channel_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	cache_t* c = (cache_t*)ctx;
	if (c->conf->cache_timeout != CACHE_TIMEOUT_NEVEL_EXPIRE) {
		cache_check_expire(c);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
cmpl $0x0, 0x8c(%rax)
je 0x981f
movq %rdi, %rbx
xorl %edi, %edi
callq 0x3310
leaq 0x58(%rbx), %r15
movq 0x58(%rbx), %r12
cmpq %r15, %r12
je 0x981f
movq %rax, %r14
addq $0x68, %rbx
cmpq %r14, 0x18(%r12)
jg 0x981f
leaq -0x28(%r12), %rbp
movq (%r12), %r13
xorl %eax, %eax
callq 0x176e5
cmpl $0x6, (%rax)
jl 0x97f4
movq (%rbp), %r9
movl $0x6, %edi
leaq 0x18e22(%rip), %rsi     # 0x225fc
leaq 0x1916c(%rip), %rdx     # 0x2294d
movl $0x5e, %ecx
leaq 0x19173(%rip), %r8      # 0x22960
xorl %eax, %eax
callq 0x1771e
movq (%r12), %rax
movq 0x8(%r12), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3a34
movq %rbp, %rdi
callq 0x84cb
movq %r13, %r12
cmpq %r15, %r13
jne 0x97ae
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_cache.c
// Function: query
static int query(channel_t* ctx,
	const ns_msg_t* msg,
	channel_query_cb callback, void* state)
{
	cache_t* c = (cache_t*)ctx;
	const char* key;
	struct rbnode_t* rbn;
	cache_item_t* item;

	key = msg_key(msg);

	rbn = rbtree_lookup(&c->dic, key);
	if (!rbn) {
		goto error;
	}

	item = rbtree_container_of(rbn, cache_item_t, node);

	logi("hit cache: %s - %s\n", key, msg_answers(item->msg));

	if (callback)
		callback(ctx, 0, item->msg, TRUE, TRUE, state);

	return 0;

error:
	if (callback)
		callback(ctx, -1, NULL, TRUE, FALSE, state);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r15
testq %rsi, %rsi
je 0x9865
cmpw $0x0, 0x4(%rsi)
je 0x9865
movq 0x10(%rsi), %rdi
testq %rdi, %rdi
je 0x9865
callq 0x19ba4
movq %rax, %r12
jmp 0x9868
xorl %r12d, %r12d
leaq 0x68(%r15), %rdi
movq %r12, %rsi
callq 0x39f8
testq %rax, %rax
je 0x98d9
movq %rax, %r13
xorl %eax, %eax
callq 0x176e5
cmpl $0x6, (%rax)
jl 0x98be
movq 0x38(%r13), %rdi
callq 0x19df7
movq %rax, (%rsp)
leaq 0x18d60(%rip), %rsi     # 0x225fc
leaq 0x19440(%rip), %rdx     # 0x22ce3
leaq 0x190ca(%rip), %r8      # 0x22974
movl $0x6, %edi
movl $0x99, %ecx
movq %r12, %r9
xorl %eax, %eax
callq 0x1771e
testq %rbx, %rbx
je 0x98f5
movq 0x38(%r13), %rdx
movq %r15, %rdi
xorl %esi, %esi
movl $0x1, %ecx
movl $0x1, %r8d
jmp 0x98f0
testq %rbx, %rbx
je 0x98f5
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
movq %r14, %r9
callq *%rbx
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_cache.c
// Function: destroy
static void destroy(channel_t* ctx)
{
	cache_t* c = (cache_t*)ctx;
	dlitem_t* cur, * nxt;
	cache_item_t* item;
	dllist_foreach(&c->items, cur, nxt,
		cache_item_t, item, entry) {
		dllist_remove(&item->entry);
		cache_item_destroy(item);
	}
	c->dic.root = NULL;
	free(ctx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x58(%rdi), %r14
movq 0x58(%rdi), %rax
cmpq %r14, %rax
je 0x9939
leaq -0x28(%rax), %rdi
movq (%rax), %r15
movq 0x8(%rax), %rax
movq %r15, (%rax)
movq %rax, 0x8(%r15)
callq 0x84cb
movq %r15, %rax
cmpq %r14, %r15
jne 0x991a
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3450
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_cache.c
// Function: cache_item_new
static cache_item_t* cache_item_new(const ns_msg_t* msg, const char *key)
{
	cache_item_t* item;

	item = (cache_item_t*)malloc(sizeof(cache_item_t));
	if (!item) {
		loge("alloc\n");
		return NULL;
	}

	memset(item, 0, sizeof(cache_item_t));

	item->msg = ns_msg_clone(msg);
	if (!item->msg) {
		loge("ns_msg_clone() error\n");
		return NULL;
	}

	item->node.key = strdup(key);

	return item;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x48, %esi
callq 0x3240
testq %rax, %rax
je 0x99c6
movq %rax, %rbx
movq %r15, %rdi
callq 0x19992
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x99f7
movq %r14, %rdi
callq 0x3610
movq %rax, (%rbx)
jmp 0x9a2d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x9a2d
leaq 0x18c21(%rip), %rsi     # 0x225fc
leaq 0x18f5c(%rip), %rdx     # 0x2293e
leaq 0x19eca(%rip), %r8      # 0x238b3
xorl %ebx, %ebx
movl $0x3, %edi
movl $0x27, %ecx
jmp 0x9a26
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x9a2d
leaq 0x18bf0(%rip), %rsi     # 0x225fc
leaq 0x18f2b(%rip), %rdx     # 0x2293e
leaq 0x18c9c(%rip), %r8      # 0x226b6
xorl %ebx, %ebx
movl $0x3, %edi
movl $0x2f, %ecx
xorl %eax, %eax
callq 0x1771e
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: fdset
static sock_t fdset(channel_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	channel_chndoh_t* c = (channel_chndoh_t*)ctx;
	sock_t maxfd = 0, fd;

	if (c->chndoh.channel == CH_DOH) {
		if (c->chndoh.http) {
			fd = http_fdset(c->chndoh.http, readset, writeset, errorset);
			if (fd < 0) return -1;
			maxfd = MAX(maxfd, fd);
		}
	}
	else if (c->chndoh.chctx) {
		fd = c->chndoh.chctx->fdset(c->chndoh.chctx, readset, writeset, errorset);
		if (fd < 0) return -1;
		maxfd = MAX(maxfd, fd);
	}

	if (c->frndoh.channel == CH_DOH) {
		if (c->frndoh.http) {
			fd = http_fdset(c->frndoh.http, readset, writeset, errorset);
			if (fd < 0) return -1;
			maxfd = MAX(maxfd, fd);
		}
	}
	else if (c->frndoh.chctx) {
		fd = c->frndoh.chctx->fdset(c->frndoh.chctx, readset, writeset, errorset);
		if (fd < 0) return -1;
		maxfd = MAX(maxfd, fd);
	}

	return maxfd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
cmpl $0x1, 0x630(%rdi)
movq 0x638(%rdi), %rdi
jne 0xa3e6
testq %rdi, %rdi
je 0xa3ff
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x14fa5
jmp 0xa3f7
testq %rdi, %rdi
je 0xa3ff
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq *0x30(%rdi)
testl %eax, %eax
js 0xa443
movl %eax, %ebx
jmp 0xa401
xorl %ebx, %ebx
cmpl $0x1, 0xc00(%r13)
movq 0xc08(%r13), %rdi
jne 0xa427
testq %rdi, %rdi
je 0xa448
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x14fa5
jmp 0xa438
testq %rdi, %rdi
je 0xa448
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq *0x30(%rdi)
testl %eax, %eax
js 0xa443
cmpl %eax, %ebx
cmoval %ebx, %eax
jmp 0xa44a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: step
static int step(channel_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	channel_chndoh_t* c = (channel_chndoh_t*)ctx;
	int r;

	if (is_auto_relolve(&c->chndoh)) {
		query_doh_addr(c, &c->chndoh);
	}

	if (is_auto_relolve(&c->frndoh)) {
		query_doh_addr(c, &c->frndoh);
	}

	if (c->chndoh.channel == CH_DOH) {
		if (c->chndoh.http) {
			http_step(c->chndoh.http, readset, writeset, errorset);
		}
	}
	else if (c->chndoh.chctx) {
		r = c->chndoh.chctx->step(c->chndoh.chctx, readset, writeset, errorset);
		if (r) return -1;
	}

	if (c->frndoh.channel == CH_DOH) {
		if (c->frndoh.http) {
			http_step(c->frndoh.http, readset, writeset, errorset);
		}
	}
	else if (c->frndoh.chctx) {
		r = c->frndoh.chctx->step(c->frndoh.chctx, readset, writeset, errorset);
		if (r) return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
cmpl $0x1, 0x630(%rdi)
jne 0xa4a2
cmpl $0x0, 0x648(%r12)
je 0xa4a2
leaq 0x80(%r12), %r13
movq (%r13), %rbp
xorl %edi, %edi
callq 0x3310
cmpq %rax, %rbp
jge 0xa4a2
movq %r12, %rdi
movq %r13, %rsi
callq 0xab86
cmpl $0x1, 0xc00(%r12)
jne 0xa4db
cmpl $0x0, 0xc18(%r12)
je 0xa4db
leaq 0x650(%r12), %r13
movq (%r13), %rbp
xorl %edi, %edi
callq 0x3310
cmpq %rax, %rbp
jge 0xa4db
movq %r12, %rdi
movq %r13, %rsi
callq 0xab86
cmpl $0x1, 0x630(%r12)
movq 0x638(%r12), %rdi
jne 0xa503
testq %rdi, %rdi
je 0xa51f
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x15018
jmp 0xa51f
testq %rdi, %rdi
je 0xa51f
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq *0x38(%rdi)
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xa565
cmpl $0x1, 0xc00(%r12)
movq 0xc08(%r12), %rdi
jne 0xa547
testq %rdi, %rdi
je 0xa563
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x15018
jmp 0xa563
testq %rdi, %rdi
je 0xa563
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq *0x38(%rdi)
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xa565
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: query
static int query(channel_t* ctx,
	const ns_msg_t* msg,
	channel_query_cb callback, void* state)
{
	channel_chndoh_t* c = (channel_chndoh_t*)ctx;
	channel_req_t* req;

	if (c->req_count > MAX_QUEUE_SIZE) {
		loge("request queue is full\n");
		return -1;
	}

	req = myreq_new(c, msg, callback, state);
	if (!req)
		return -1;

	dllist_add(&c->reqs, &req->entry);
	rbtree_insert(&c->reqdic, &req->rbn);
	c->req_count++;

	if (doh_query(req)) {
		loge("doh_query() error\n");
		dllist_remove(&req->entry);
		rbtree_remove(&c->reqdic, &req->rbn);
		c->req_count--;
		myreq_destroy(req);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpl $0x7531, 0x78(%rdi)     # imm = 0x7531
jl 0xa5c6
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xa67c
leaq 0x1840e(%rip), %rsi     # 0x229b0
leaq 0x1873a(%rip), %rdx     # 0x22ce3
leaq 0x18a22(%rip), %r8      # 0x22fd2
movl $0x3, %edi
movl $0x3fa, %ecx            # imm = 0x3FA
xorl %eax, %eax
callq 0x1771e
jmp 0xa67c
movq %rdi, %r14
callq 0xad0e
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xa67c
movq %rax, %r15
leaq 0x58(%r14), %rax
leaq 0x28(%r15), %rcx
movq %rax, 0x28(%r15)
movq 0x60(%r14), %rax
movq %rax, 0x30(%r15)
movq %rcx, (%rax)
movq %rcx, 0x60(%r14)
leaq 0x68(%r14), %r12
movq %r15, %r13
addq $0x38, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x379c
incl 0x78(%r14)
movq %r15, %rdi
callq 0xafa0
testl %eax, %eax
je 0xa67a
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xa652
leaq 0x1837d(%rip), %rsi     # 0x229b0
leaq 0x186a9(%rip), %rdx     # 0x22ce3
leaq 0x18651(%rip), %r8      # 0x22c92
movl $0x3, %edi
movl $0x407, %ecx            # imm = 0x407
xorl %eax, %eax
callq 0x1771e
movq 0x28(%r15), %rax
movq 0x30(%r15), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x3a34
decl 0x78(%r14)
movq %r15, %rdi
callq 0xb0a7
jmp 0xa67c
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: destroy
static void destroy(channel_t* ctx)
{
	channel_chndoh_t* c = (channel_chndoh_t*)ctx;
	dlitem_t* cur, * nxt;
	channel_req_t* req;

	dllist_foreach(&c->reqs, cur, nxt,
		channel_req_t, req, entry) {
		dllist_remove(&req->entry);
		if (req->callback)
			req->callback(ctx, -1, NULL, FALSE, FALSE, req->cb_state);
		myreq_destroy(req);
	}

	free(c->chndoh.name);
	free(c->chndoh.addrstr);
	free(c->chndoh.host);
	free(c->chndoh.path);
	free(c->chndoh.net.name);
	free(c->chndoh.net6.name);
	if (c->chndoh.channel == CH_DOH && c->chndoh.http) {
		http_destroy(c->chndoh.http);
		c->chndoh.http = NULL;
	}
	else if (c->chndoh.chctx) {
		c->chndoh.chctx->destroy(c->chndoh.chctx);
		c->chndoh.chctx = NULL;
	}

	free(c->frndoh.name);
	free(c->frndoh.addrstr);
	free(c->frndoh.host);
	free(c->frndoh.path);
	free(c->frndoh.net.name);
	free(c->frndoh.net6.name);
	if (c->frndoh.channel == CH_DOH && c->frndoh.http) {
		http_destroy(c->frndoh.http);
		c->frndoh.http = NULL;
	}
	else if (c->frndoh.chctx) {
		c->frndoh.chctx->destroy(c->frndoh.chctx);
		c->frndoh.chctx = NULL;
	}

	free(c);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x58(%rdi), %r15
movq 0x58(%rdi), %r14
cmpq %r15, %r14
je 0xa6e1
movq (%r14), %r12
movq 0x8(%r14), %rax
movq %r12, (%rax)
movq %rax, 0x8(%r12)
movq -0x10(%r14), %rax
testq %rax, %rax
je 0xa6cd
movq -0x8(%r14), %r9
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq *%rax
addq $-0x28, %r14
movq %r14, %rdi
callq 0xb0a7
movq %r12, %r14
cmpq %r15, %r12
jne 0xa6a0
movq 0x4d0(%rbx), %rdi
callq 0x3450
movq 0x4d8(%rbx), %rdi
callq 0x3450
movq 0x4e0(%rbx), %rdi
callq 0x3450
movq 0x4e8(%rbx), %rdi
callq 0x3450
movq 0x508(%rbx), %rdi
callq 0x3450
movq 0x5a0(%rbx), %rdi
callq 0x3450
leaq 0x638(%rbx), %r14
cmpl $0x1, 0x630(%rbx)
movq 0x638(%rbx), %rdi
jne 0xa74c
testq %rdi, %rdi
je 0xa75b
callq 0x14ea3
jmp 0xa754
testq %rdi, %rdi
je 0xa75b
callq *0x48(%rdi)
movq $0x0, (%r14)
movq 0xaa0(%rbx), %rdi
callq 0x3450
movq 0xaa8(%rbx), %rdi
callq 0x3450
movq 0xab0(%rbx), %rdi
callq 0x3450
movq 0xab8(%rbx), %rdi
callq 0x3450
movq 0xad8(%rbx), %rdi
callq 0x3450
movq 0xb70(%rbx), %rdi
callq 0x3450
cmpl $0x1, 0xc00(%rbx)
movq 0xc08(%rbx), %rdi
jne 0xa7bf
testq %rdi, %rdi
je 0xa7c7
callq 0x14ea3
jmp 0xa7c7
testq %rdi, %rdi
je 0xa7c7
callq *0x48(%rdi)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3450
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: create_upstream_chctx
static int create_upstream_chctx(doh_server_t* doh, channel_chndoh_t* c)
{
	if (doh->channel == CH_UDP) {
		char args[2048];
		int n;
		n = snprintf(args, sizeof(args),
			"upstream=%s&proxy=%d&timeout=%d",
			doh->addrstr,
			doh->use_proxy,
			doh->timeout);
		if (n <= 0 || n >= sizeof(args))
			return -1;
		doh->query = channel_udp_query;
		return channel_udp_create(&doh->chctx,
			"udp", args,
			c->conf,
			c->proxies,
			c->proxy_num,
			c->chnr,
			c->blacklist,
			doh);
	}
	else if (doh->channel == CH_TCP) {
		char args[2048];
		int n;
		n = snprintf(args, sizeof(args),
			"upstream=%s&proxy=%d&timeout=%d",
			doh->addrstr,
			doh->use_proxy,
			doh->timeout);
		if (n <= 0 || n >= sizeof(args))
			return -1;
		doh->query = channel_tcp_query;
		return channel_tcp_create(&doh->chctx,
			"tcp", args,
			c->conf,
			c->proxies,
			c->proxy_num,
			c->chnr,
			c->blacklist,
			doh);
	}
	else if (doh->channel == CH_DOH) {
		doh->http = http_create(
			c->proxies,
			c->proxy_num,
			doh->keep_alive);
		if (!doh->http)
			return -1;
		return 0;
	}
	return -1;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x828, %rsp            # imm = 0x828
movq %rsi, %r14
movq %rdi, %rbx
movl 0x5b0(%rdi), %ecx
cmpl $0x1, %ecx
je 0xa925
cmpl $0x3, %ecx
je 0xa89e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x2, %ecx
jne 0xa94a
movq 0x458(%rbx), %rcx
movl 0x474(%rbx), %r8d
movl 0x47c(%rbx), %r9d
leaq 0x187bd(%rip), %rdx     # 0x22fe9
leaq 0x20(%rsp), %rdi
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
callq 0x3590
movl %eax, %ecx
addl $0xfffff800, %ecx       # imm = 0xFFFFF800
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0xfffff801, %ecx       # imm = 0xFFFFF801
jb 0xa94a
leaq 0x5d2b(%rip), %rax      # 0x10588
movq %rax, 0x5c0(%rbx)
movq 0x8(%r14), %rcx
movq 0x10(%r14), %r8
movl 0x18(%r14), %r9d
movups 0x20(%r14), %xmm0
movq %rbx, 0x10(%rsp)
addq $0x5b8, %rbx            # imm = 0x5B8
movups %xmm0, (%rsp)
leaq 0x17d5b(%rip), %rsi     # 0x225e7
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x109d2
jmp 0xa94a
movq 0x458(%rbx), %rcx
movl 0x474(%rbx), %r8d
movl 0x47c(%rbx), %r9d
leaq 0x1872f(%rip), %rdx     # 0x22fe9
leaq 0x20(%rsp), %rdi
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
callq 0x3590
movl %eax, %ecx
addl $0xfffff800, %ecx       # imm = 0xFFFFF800
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0xfffff801, %ecx       # imm = 0xFFFFF801
jb 0xa94a
leaq 0x3d75(%rip), %rax      # 0xe65c
movq %rax, 0x5c0(%rbx)
movq 0x8(%r14), %rcx
movq 0x10(%r14), %r8
movl 0x18(%r14), %r9d
movups 0x20(%r14), %xmm0
movq %rbx, 0x10(%rsp)
addq $0x5b8, %rbx            # imm = 0x5B8
movups %xmm0, (%rsp)
leaq 0x17cd5(%rip), %rsi     # 0x225eb
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0xed93
jmp 0xa94a
movq 0x10(%r14), %rdi
movl 0x18(%r14), %esi
movl 0x470(%rbx), %edx
callq 0x14db7
movq %rax, %rcx
movq %rax, 0x5b8(%rbx)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r14
retq