// File: /workspace/github_c_makefile_star2_O0/Genymobile[P]hiredis/test.c
// Function: main
int main(int argc, char **argv) {
    struct config cfg = {
        .tcp = {
            .host = "127.0.0.1",
            .port = 6379
        },
        .unix = {
            .path = "/tmp/redis.sock"
        }
    };
    int throughput = 1;
    int test_inherit_fd = 1;

    /* Parse command line options. */
    argv++; argc--;
    while (argc) {
        if (argc >= 2 && !strcmp(argv[0],"-h")) {
            argv++; argc--;
            cfg.tcp.host = argv[0];
        } else if (argc >= 2 && !strcmp(argv[0],"-p")) {
            argv++; argc--;
            cfg.tcp.port = atoi(argv[0]);
        } else if (argc >= 2 && !strcmp(argv[0],"-s")) {
            argv++; argc--;
            cfg.unix.path = argv[0];
        } else if (argc >= 1 && !strcmp(argv[0],"--skip-throughput")) {
            throughput = 0;
        } else if (argc >= 1 && !strcmp(argv[0],"--skip-inherit-fd")) {
            test_inherit_fd = 0;
        } else {
            fprintf(stderr, "Invalid argument: %s\n", argv[0]);
            exit(1);
        }
        argv++; argc--;
    }

    test_format_commands();
    test_reply_reader();
    test_blocking_connection_errors();
    test_free_null();

    printf("\nTesting against TCP connection (%s:%d):\n", cfg.tcp.host, cfg.tcp.port);
    cfg.type = CONN_TCP;
    test_blocking_connection(cfg);
    test_blocking_connection_timeouts(cfg);
    test_blocking_io_errors(cfg);
    test_invalid_timeout_errors(cfg);
    test_append_formatted_commands(cfg);
    if (throughput) test_throughput(cfg);

    printf("\nTesting against Unix socket connection (%s):\n", cfg.unix.path);
    cfg.type = CONN_UNIX;
    test_blocking_connection(cfg);
    test_blocking_connection_timeouts(cfg);
    test_blocking_io_errors(cfg);
    if (throughput) test_throughput(cfg);

    if (test_inherit_fd) {
        printf("\nTesting against inherited fd (%s):\n", cfg.unix.path);
        cfg.type = CONN_FD;
        test_blocking_connection(cfg);
    }


    if (fails) {
        printf("*** %d TESTS FAILED ***\n", fails);
        return 1;
    }

    printf("ALL TESTS PASSED\n");
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x40(%rbp), %rdi
leaq 0xf95c(%rip), %rsi      # 0x11dc0
movl $0x30, %edx
callq 0x21d0
movl $0x1, -0x44(%rbp)
movl $0x1, -0x48(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x25fe
cmpl $0x2, -0x8(%rbp)
jl 0x24de
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xab93(%rip), %rsi      # 0xd042
callq 0x21a0
cmpl $0x0, %eax
jne 0x24de
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x25e4
cmpl $0x2, -0x8(%rbp)
jl 0x2525
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xab53(%rip), %rsi      # 0xd045
callq 0x21a0
cmpl $0x0, %eax
jne 0x2525
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2250
movl %eax, -0x30(%rbp)
jmp 0x25e2
cmpl $0x2, -0x8(%rbp)
jl 0x2565
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xab0f(%rip), %rsi      # 0xd048
callq 0x21a0
cmpl $0x0, %eax
jne 0x2565
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x25e0
cmpl $0x1, -0x8(%rbp)
jl 0x258c
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaad2(%rip), %rsi      # 0xd04b
callq 0x21a0
cmpl $0x0, %eax
jne 0x258c
movl $0x0, -0x44(%rbp)
jmp 0x25de
cmpl $0x1, -0x8(%rbp)
jl 0x25b3
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaabd(%rip), %rsi      # 0xd05d
callq 0x21a0
cmpl $0x0, %eax
jne 0x25b3
movl $0x0, -0x48(%rbp)
jmp 0x25dc
movq 0xfa3e(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0xaaa4(%rip), %rsi      # 0xd06f
movb $0x0, %al
callq 0x21b0
movl $0x1, %edi
callq 0x2270
jmp 0x25de
jmp 0x25e0
jmp 0x25e2
jmp 0x25e4
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2491
callq 0x2810
callq 0x36a0
callq 0x3c50
callq 0x3e30
movq -0x38(%rbp), %rsi
movl -0x30(%rbp), %edx
leaq 0xaa65(%rip), %rdi      # 0xd085
movb $0x0, %al
callq 0x20f0
movl $0x0, -0x40(%rbp)
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x3f20
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4640
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4a10
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4d10
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4e60
cmpl $0x0, -0x44(%rbp)
je 0x26ee
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4f70
movq -0x18(%rbp), %rsi
leaq 0xa9b6(%rip), %rdi      # 0xd0af
movb $0x0, %al
callq 0x20f0
movl $0x1, -0x40(%rbp)
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x3f20
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4640
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4a10
cmpl $0x0, -0x44(%rbp)
je 0x2789
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4f70
cmpl $0x0, -0x48(%rbp)
je 0x27c7
movq -0x18(%rbp), %rsi
leaq 0xa944(%rip), %rdi      # 0xd0de
movb $0x0, %al
callq 0x20f0
movl $0x2, -0x40(%rbp)
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x3f20
cmpl $0x0, 0xf9ee(%rip)      # 0x121bc
je 0x27ed
movl 0xf9e6(%rip), %esi      # 0x121bc
leaq 0xa926(%rip), %rdi      # 0xd103
movb $0x0, %al
callq 0x20f0
movl $0x1, -0x4(%rbp)
jmp 0x2802
leaq 0xa928(%rip), %rdi      # 0xd11c
movb $0x0, %al
callq 0x20f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nop