// File: /workspace/github_c_makefile_star2_O0/goghcrow[P]dubbo_ab/dubbo_client.c
// Function: cli_create
static struct dubbo_client *cli_create(struct dubbo_args *args, struct dubbo_async_args *async_args)
{
    struct dubbo_client *cli = calloc(1, sizeof(*cli));
    assert(cli);
    cli->el = async_args->el;

    cli->verbos = async_args->verbos;

    cli->rcv_buf = buf_create(CLI_INIT_BUF_SZ);
    cli->snd_buf = buf_create(CLI_INIT_BUF_SZ);

    cli->req_n = async_args->req_n;
    cli->req_left = async_args->req_n;

    cli->pipe_n = async_args->pipe_n;
    if (cli->pipe_n > cli->req_n)
    {
        cli->pipe_n = cli->req_n;
    }
    cli->pipe_left = async_args->pipe_n;

    cli->run = false;
    cli->ok_n = 0;
    cli->ko_n = 0;

    cli->timeout_ms = args->timeout.tv_sec * 1000;
    cli->timerid = AE_NOMORE;

    cli->args = args;
    cli_reset(cli);

    if (!sa_resolve(cli->args->host, &cli->addr))
    {
        PANIC("%s DNS解析失败", cli->args->host);
    }

    cli->addr.v4.sin_port = htons(atoi(cli->args->port));
    return cli;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, %edi
movl $0x90, %esi
callq 0x21f0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xcf7c
jmp 0xcf9b
leaq 0x3ae2(%rip), %rdi      # 0x10a65
leaq 0x3550(%rip), %rsi      # 0x104da
movl $0x64, %edx
leaq 0x3ad3(%rip), %rcx      # 0x10a69
callq 0x2170
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movb 0x10(%rax), %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x6e(%rax)
movl $0x400, %edi            # imm = 0x400
movl $0x8, %esi
callq 0x8140
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movl $0x400, %edi            # imm = 0x400
movl $0x8, %esi
callq 0x8140
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x18(%rbp), %rax
movl 0x50(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x58(%rcx), %eax
jle 0xd036
movq -0x18(%rbp), %rax
movl 0x58(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x54(%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x6d(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x60(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x64(%rax)
movq -0x8(%rbp), %rax
imulq $0x3e8, 0x30(%rax), %rcx # imm = 0x3E8
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq $-0x1, 0x38(%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rdi
callq 0xded0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x10, %rsi
callq 0xaa90
testb $0x1, %al
jne 0xd0f4
movq 0x7f3e(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdx
leaq 0x39ea(%rip), %rsi      # 0x10ab9
leaq 0x3a1f(%rip), %rcx      # 0x10af5
leaq 0x33fd(%rip), %r8       # 0x104da
movl $0x82, %r9d
movb $0x0, %al
callq 0x2220
movl $0x1, %edi
callq 0x2360
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x2330
movzwl %ax, %edi
callq 0x2100
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x12(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)