LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/sa.c
// Function: sa_fromip
union sockaddr_all
sa_fromip(const char *ip, uint16_t port)
{
    union sockaddr_all u;
    memset(&u, 0, sizeof(u));
    u.v4.sin_family = AF_INET;
    if (inet_pton(AF_INET, ip, &(u.v4.sin_addr)) <= 0)
    {
        fprintf(stderr, "ERROR inet_pton %s", ip);
    }
    u.v4.sin_port = htons(port);
    return u;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movups %xmm0, 0xc(%rdi)
movw $0x2, (%rdi)
leaq 0x4(%rdi), %rdx
movl $0x2, %edi
callq 0x2210
testl %eax, %eax
jle 0x792c
rolw $0x8, %bx
movw %bx, 0x2(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x86c5(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x2f22(%rip), %rsi      # 0xa85f
movq %r15, %rdx
xorl %eax, %eax
callq 0x21e0
jmp 0x7915
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/sa.c
// Function: sa_fromipV6
union sockaddr_all
sa_fromipV6(const char *ip, uint16_t port)
{
    union sockaddr_all u;
    memset(&u, 0, sizeof(u));
    u.v6.sin6_family = AF_INET6;
    if (inet_pton(AF_INET6, ip, &(u.v6.sin6_addr)) <= 0)
    {
        fprintf(stderr, "ERROR inet_pton %s", ip);
    }
    u.v6.sin6_port = htons(port);
    return u;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movups %xmm0, 0xc(%rdi)
movw $0xa, (%rdi)
leaq 0x8(%rdi), %rdx
movl $0xa, %edi
callq 0x2210
testl %eax, %eax
jle 0x7993
rolw $0x8, %bx
movw %bx, 0x2(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x865e(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x2ebb(%rip), %rsi      # 0xa85f
movq %r15, %rdx
xorl %eax, %eax
callq 0x21e0
jmp 0x797c
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/sa.c
// Function: sa_toip
void sa_toip(union sockaddr_all *u, char *buf, int size)
{
    // 使用 static变量做成不需要buf与size参数的函数?
    // static __thread char buf[INET6_ADDRSTRLEN];
    assert(size >= INET6_ADDRSTRLEN);
    if (u->s.sa_family == AF_INET)
    {
        inet_ntop(AF_INET, &(u->v4.sin_addr), buf, INET_ADDRSTRLEN);
    }
    else if (u->s.sa_family == AF_INET6)
    {
        inet_ntop(AF_INET6, &(u->v6.sin6_addr), buf, INET6_ADDRSTRLEN);
    }
}

// Assembly:
cmpl $0x2d, %edx
jle 0x79f5
movq %rsi, %rax
movq %rdi, %rsi
movzwl (%rdi), %ecx
cmpl $0xa, %ecx
je 0x79de
cmpl $0x2, %ecx
jne 0x79f4
addq $0x4, %rsi
movl $0x2, %edi
movq %rax, %rdx
movl $0x10, %ecx
jmp 0x2030
addq $0x8, %rsi
movl $0xa, %edi
movq %rax, %rdx
movl $0x2e, %ecx
jmp 0x2030
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x2e72(%rip), %rdi      # 0xa872
leaq 0x2e84(%rip), %rsi      # 0xa88b
leaq 0x2e82(%rip), %rcx      # 0xa890
movl $0x43, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/sa.c
// Function: sa_toipport
void sa_toipport(union sockaddr_all *u, char *buf, int size)
{
    assert(size >= INET6_ADDRSTRLEN);
    sa_toip(u, buf, size);
    size_t end = strlen(buf);
    uint16_t port = ntohs(u->v4.sin_port);
    assert(size > end);
    snprintf(buf + end, size - end, ":%u", port);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x2d, %edx
jle 0x7a6f
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
callq 0x79b0
movq %rbx, %rdi
callq 0x20d0
movl %r15d, %esi
subq %rax, %rsi
jbe 0x7a8e
movzwl 0x2(%r14), %ecx
rolw $0x8, %cx
addq %rax, %rbx
movzwl %cx, %ecx
leaq 0x2ea4(%rip), %rdx      # 0xa8ff
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2110
leaq 0x2dfc(%rip), %rdi      # 0xa872
leaq 0x2e0e(%rip), %rsi      # 0xa88b
leaq 0x2e3c(%rip), %rcx      # 0xa8c0
movl $0x50, %edx
callq 0x2150
leaq 0x2e5f(%rip), %rdi      # 0xa8f4
leaq 0x2def(%rip), %rsi      # 0xa88b
leaq 0x2e1d(%rip), %rcx      # 0xa8c0
movl $0x54, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/sa.c
// Function: sa_resolve
bool sa_resolve(char *hostname, union sockaddr_all *u)
{
    assert(u);
    struct addrinfo hints;
    struct addrinfo *res;
    memset(&hints, 0, sizeof(hints));
    hints.ai_family = PF_INET;
    hints.ai_socktype = SOCK_STREAM;

    int status = getaddrinfo(hostname, NULL, &hints, &res);
    if (status != 0)
    {
        fprintf(stderr, "ERROR getaddrinfo: %s\n", gai_strerror(status));
        return false;
    }

    // FIXME 遍历检测可用??
    // 只获取链表第一个元素 struct addrinfo *p; for(p = res; p != NULL; p = p->ai_next) { }
    if (res == NULL)
    {
        freeaddrinfo(res);
        false;
    }

    u->v4.sin_family = res->ai_family;
    u->v4.sin_addr = ((struct sockaddr_in *)res->ai_addr)->sin_addr;
    #ifdef __APPLE__ 
    u->v4.sin_len = res->ai_addrlen;
    #endif
    freeaddrinfo(res);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
testq %rsi, %rsi
je 0x7b7b
movq %rsi, %rbx
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x4(%rdx)
leaq -0x18(%rbp), %rcx
xorl %esi, %esi
callq 0x2330
movl %eax, %r14d
testl %eax, %eax
jne 0x7b71
movq -0x18(%rbp), %rdi
testq %rdi, %rdi
jne 0x7b4c
xorl %edi, %edi
callq 0x2380
movq -0x18(%rbp), %rdi
movzwl 0x4(%rdi), %eax
movw %ax, (%rbx)
movq 0x18(%rdi), %rax
movl 0x4(%rax), %eax
movl %eax, 0x4(%rbx)
callq 0x2380
testl %r14d, %r14d
sete %al
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl %r14d, %edi
callq 0x244e
jmp 0x7b62
leaq 0x2d7f(%rip), %rdi      # 0xa901
leaq 0x2d02(%rip), %rsi      # 0xa88b
leaq 0x2db6(%rip), %rcx      # 0xa946
movl $0x6a, %edx
callq 0x2150
nop
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_hessian.c
// Function: utf8cpy
int utf8cpy(uint8_t *dst, const uint8_t *src, size_t sz)
{
    int i = 0;
    uint8_t c;

    while (sz--)
    {
        c = src[i];
        if (c <= 0x80)
        {
            i += 1;
        }
        else if ((c & 0xE0) == 0xC0)
        {
            i += 2;
        }
        else if ((c & 0xF0) == 0xE0)
        {
            i += 3;
        }
        else if ((c & 0xF8) == 0xF0)
        {
            i += 4;
        }
        else
        {
            // invalid utf8
            return -1;
        }
    }

    if (i)
    {
        memcpy(dst, src, i);
    }

    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdx, %rdx
je 0x7e1a
movl %ebx, %eax
movzbl (%rsi,%rax), %eax
movl $0x1, %ecx
cmpl $0x81, %eax
jb 0x7e09
movl %eax, %r8d
andl $-0x20, %r8d
movl $0x2, %ecx
cmpl $0xc0, %r8d
je 0x7e09
movl %eax, %r8d
andl $-0x10, %r8d
movl $0x3, %ecx
cmpl $0xe0, %r8d
je 0x7e09
andl $-0x8, %eax
movl $0x4, %ecx
cmpl $0xf0, %eax
jne 0x7e23
decq %rdx
addl %ecx, %ebx
testq %rdx, %rdx
jne 0x7dbe
movl %ebx, %edx
callq 0x2200
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x7e1a
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_hessian.c
// Function: hs_encode_int
int hs_encode_int(int32_t val, uint8_t *out)
{
    if (-0x10 <= val && val <= 0x2f)
    {
        out[0] = val + 0x90;
        return 1;
    }
    else if (-0x800 <= val + 0xc8 && val <= 0x7ff)
    {
        out[1] = val & 0xff;
        out[0] = (val >> 8) + 0xc8;
        return 2;
    }
    else if (-0x40000 <= val && val <= 0x3ffff)
    {
        out[0] = (val >> 16) + 0xd4;
        *(uint16_t *)(out + 1) = htobe16(val & 0xffff);
        return 3;
    }
    else
    {
        out[0] = 'I';
        *(int32_t *)(out + 1) = htobe32(val);
        return 5;
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leal 0x10(%rdi), %eax
cmpl $0x3f, %eax
ja 0x7e68
addb $-0x70, %dil
movb %dil, (%rsi)
movl $0x1, %eax
jmp 0x7ebc
leal 0x8c8(%rdi), %eax
cmpl $0x10c7, %eax           # imm = 0x10C7
ja 0x7e8a
movb %dil, 0x1(%rsi)
shrl $0x8, %edi
addb $-0x38, %dil
movb %dil, (%rsi)
movl $0x2, %eax
jmp 0x7ebc
leal 0x40000(%rdi), %eax
cmpl $0x7ffff, %eax          # imm = 0x7FFFF
ja 0x7eaf
movl %edi, %eax
shrl $0x10, %eax
addb $-0x2c, %al
movb %al, (%rsi)
rolw $0x8, %di
movw %di, 0x1(%rsi)
movl $0x3, %eax
jmp 0x7ebc
movb $0x49, (%rsi)
bswapl %edi
movl %edi, 0x1(%rsi)
movl $0x5, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_hessian.c
// Function: hs_decode_int
bool hs_decode_int(const uint8_t *buf, size_t sz, int32_t *out)
{
    bool r = true;
    uint8_t code = buf[0];
    if (sz >= 1 && code >= 0x80 && code <= 0xbf)
    {
        *out = code - 0x90;
    }
    else if (sz >= 2 && code >= 0xc0 && code <= 0xcf)
    {
        *out = ((code - 0xc8) << 8) + buf[1];
    }
    else if (sz >= 3 && code >= 0xd0 && code <= 0xd7)
    {
        *out = ((code - 0xd4) << 16) + (buf[1] << 8) + buf[2];
    }
    else if (sz >= 5 && code == 'I')
    {
        *out = be32toh(*(uint32_t *)&buf[1]);
    }
    else
    {
        r = false;
    }
    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rdi), %al
testq %rsi, %rsi
setne %cl
movzbl %al, %eax
cmpb $-0x40, %al
setl %r8b
andb %cl, %r8b
cmpb $0x1, %r8b
jne 0x7ee3
addl $0xffffff70, %eax       # imm = 0xFFFFFF70
jmp 0x7f61
cmpq $0x2, %rsi
setae %cl
movl %eax, %r8d
andb $-0x10, %r8b
cmpb $-0x40, %r8b
sete %r8b
andb %cl, %r8b
cmpb $0x1, %r8b
jne 0x7f12
shll $0x8, %eax
movzbl 0x1(%rdi), %ecx
addl %ecx, %eax
addl $0xffff3800, %eax       # imm = 0xFFFF3800
jmp 0x7f61
cmpq $0x3, %rsi
setae %cl
movl %eax, %r8d
andb $-0x8, %r8b
cmpb $-0x30, %r8b
sete %r8b
andb %cl, %r8b
cmpb $0x1, %r8b
jne 0x7f4a
shll $0x10, %eax
movzbl 0x1(%rdi), %ecx
shll $0x8, %ecx
orl %eax, %ecx
movzbl 0x2(%rdi), %eax
addl %ecx, %eax
addl $0xff2c0000, %eax       # imm = 0xFF2C0000
jmp 0x7f61
cmpq $0x5, %rsi
setae %cl
cmpb $0x49, %al
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x7f67
movl 0x1(%rdi), %eax
bswapl %eax
movl %eax, (%rdx)
movb $0x1, %al
popq %rbp
retq
xorl %eax, %eax
jmp 0x7f65
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_hessian.c
// Function: hs_encode_string
int hs_encode_string(const char *str, uint8_t *out)
{
    size_t index = 0;
    int length = strlen(str);

    // TODO
    if (length > 0x8000)
    {
        return -1;
    }

    if (length <= 31)
    {
        out[index++] = (uint8_t)(length);
    }
    else if (length <= 1023)
    {
        out[index++] = (uint8_t)(48 + (length >> 8));
        // Integer overflow and wrapping assumed
        out[index++] = (uint8_t)(length);
    }
    else
    {
        out[index++] = 'S';
        out[index++] = (uint8_t)((length >> 8));
        // Integer overflow and wrapping assumed
        out[index++] = (uint8_t)(length);
    }

    memcpy(out + index, str, length);
    return index + length;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x20d0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpl $0x8000, %eax           # imm = 0x8000
jg 0x7fdf
cmpl $0x1f, %eax
jg 0x7f9d
movb %al, (%rbx)
movl $0x1, %r12d
jmp 0x7fc8
cmpl $0x3ff, %eax            # imm = 0x3FF
ja 0x7fb9
movl %eax, %ecx
shrl $0x8, %ecx
orb $0x30, %cl
movb %cl, (%rbx)
movb %al, 0x1(%rbx)
movl $0x2, %r12d
jmp 0x7fc8
movb $0x53, (%rbx)
movb %ah, 0x1(%rbx)
movb %al, 0x2(%rbx)
movl $0x3, %r12d
addq %r12, %rbx
movslq %eax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2200
addl %r12d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_hessian.c
// Function: hs_decode_string
bool hs_decode_string(const uint8_t *buf, size_t sz, char **out, size_t *out_sz)
{
    short is_last_chunk = 0;
    size_t out_length = 0;
    uint8_t *out_str = (uint8_t *)malloc(sz);
    if (NULL == out_str)
    {
        return false;
    }

    if (internal_decode_string(buf, sz, out_str, &out_length, &is_last_chunk))
    {
        uint8_t *new_out = (uint8_t *)realloc(out_str, out_length);
        if (NULL != new_out)
        {
            out_str = new_out;
        }
        *out = (char *)out_str;
        *out_sz = out_length;
        return true;
    }
    else
    {
        free(out_str);
        return false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movw $0x0, -0x2a(%rbp)
movq $0x0, -0x38(%rbp)
movq %rsi, %rdi
callq 0x23a8
testq %rax, %rax
je 0x8068
movq %rax, %r15
leaq -0x38(%rbp), %rcx
leaq -0x2a(%rbp), %r8
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x8079
testb %al, %al
je 0x8060
movq -0x38(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x23b0
testq %rax, %rax
cmovneq %rax, %r15
movq %r15, (%r14)
movq %r12, (%rbx)
movb $0x1, %al
jmp 0x806a
movq %r15, %rdi
callq 0x23a0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_hessian.c
// Function: hs_encode_binary
void hs_encode_binary(const char *bin, size_t sz, struct buffer *out_buf)
{
    // 不做判断, 最后一块体积填0 ?!
    // int just_right = sz % chunk_max == 0;
    while (sz > BIN_CHUNK_MAX)
    {
        buf_appendInt8(out_buf, 'b');
        buf_appendInt16(out_buf, (uint16_t)BIN_CHUNK_MAX);
        buf_append(out_buf, bin, BIN_CHUNK_MAX);
        bin += BIN_CHUNK_MAX;
        sz -= BIN_CHUNK_MAX;
    }
    buf_appendInt8(out_buf, 'B');
    buf_appendInt16(out_buf, sz);
    if (sz)
    {
        buf_append(out_buf, bin, sz);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
cmpq $0x10001, %rsi          # imm = 0x10001
jb 0x8223
movl $0x10000, %r12d         # imm = 0x10000
movq %r14, %rdi
movl $0x62, %esi
callq 0x691c
movq %r14, %rdi
xorl %esi, %esi
callq 0x68f6
movl $0x10000, %edx          # imm = 0x10000
movq %r14, %rdi
movq %r15, %rsi
callq 0x66e7
addq %r12, %r15
addq $-0x10000, %rbx         # imm = 0xFFFF0000
cmpq %r12, %rbx
ja 0x81ed
movq %r14, %rdi
movl $0x42, %esi
callq 0x691c
movswl %bx, %esi
movq %r14, %rdi
callq 0x68f6
testq %rbx, %rbx
je 0x8256
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x66e7
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_hessian.c
// Function: hs_decode_binary
bool hs_decode_binary(struct buffer *buf, char **out, size_t *out_sz)
{
    uint16_t tag = buf_peekInt8(buf);
    uint16_t sz = 0;
    if (tag >= 0x20 && tag <= 0x2f)
    {
        sz = tag - 0x20;
        buf_retrieveInt8(buf);
        
        small:
        *out_sz = sz;
        *out = malloc(sz + 1);
        if (*out == NULL)
        {
            return false;
        }
        memcpy(*out, buf_peek(buf), sz);
        buf_retrieve(buf, sz);
        return true;
    }
    else if (tag >= 0x34 && tag <= 0x37)
    {
        sz = buf_readInt16(buf);
        sz = sz & 1023; // 10 bit number !!!
        goto small;
    }
    else
    {
        buf_retrieveInt8(buf);

        size_t left = BIN_CHUNK_MAX;
        *out_sz = 0;
        *out = malloc(BIN_CHUNK_MAX + 1);
        if (*out == NULL)
        {
            return false;
        }

        while (tag == 0x41)
        {
            if (!hs_decode_binary_chunk(buf, out, out_sz, &left))
            {
                free(*out);
                *out = NULL;
                return false;
            }
            tag = buf_readInt8(buf);
        }

        assert(tag == 'B');
        if (!hs_decode_binary_chunk(buf, out, out_sz, &left))
        {
            free(*out);
            *out = NULL;
            return false;
        }
    }
    (*out)[*out_sz] = '\0';
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
callq 0x6c10
movsbl %al, %r13d
movl %r13d, %eax
andb $-0x10, %al
cmpb $0x20, %al
jne 0x829a
movswl %r13w, %r12d
addl $-0x20, %r12d
movq %r14, %rdi
callq 0x65df
jmp 0x82b5
movl %r13d, %eax
andb $-0x4, %al
movq %r14, %rdi
cmpb $0x34, %al
jne 0x82fd
callq 0x6d8b
movl %eax, %r12d
andl $0x3ff, %r12d           # imm = 0x3FF
movzwl %r12w, %r12d
movq %r12, (%r15)
leaq 0x1(%r12), %rdi
callq 0x23a8
movq %rax, (%rbx)
testq %rax, %rax
je 0x838e
movq %rax, %r15
movq %r14, %rdi
callq 0x631e
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x2200
movq %r14, %rdi
movq %r12, %rsi
callq 0x64f9
movb $0x1, %al
jmp 0x8390
callq 0x65df
movq $0x10000, -0x30(%rbp)   # imm = 0x10000
movq $0x0, (%r15)
movl $0x10001, %edi          # imm = 0x10001
callq 0x23a8
movq %rax, (%rbx)
testq %rax, %rax
je 0x838e
leaq -0x30(%rbp), %r12
cmpw $0x41, %r13w
jne 0x8351
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x83be
testb %al, %al
je 0x837f
movq %r14, %rdi
callq 0x6db2
movsbl %al, %r13d
jmp 0x8327
movzwl %r13w, %eax
cmpl $0x42, %eax
jne 0x839f
leaq -0x30(%rbp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x83be
testb %al, %al
je 0x837f
movq (%rbx), %rax
movq (%r15), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x82f6
movq (%rbx), %rdi
callq 0x23a0
movq $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x25ff(%rip), %rdi      # 0xa9a5
leaq 0x25cf(%rip), %rsi      # 0xa97c
leaq 0x25fc(%rip), %rcx      # 0xa9b0
movl $0x245, %edx            # imm = 0x245
callq 0x2150
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_hessian.c
// Function: hs_decode_binary_chunk
static bool hs_decode_binary_chunk(struct buffer *buf, char **out, size_t *out_sz, size_t *left)
{
    int sz = buf_readInt16(buf);
    if (*left < sz)
    {
        char *new_out = realloc(*out, *out_sz + BIN_CHUNK_MAX + 1);
        if (new_out == NULL)
        {
            return false;
        }
        *out = new_out;
        *left = BIN_CHUNK_MAX;
    }

    memcpy(*out + *out_sz, buf_peek(buf), sz);
    *out_sz += sz;
    *left -= sz;
    buf_retrieve(buf, sz);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
callq 0x6d8b
movswq %ax, %r12
movq %r13, -0x38(%rbp)
movq (%r13), %r13
movq %r15, -0x30(%rbp)
cmpq %r12, (%r15)
jae 0x8421
movl $0x10001, %esi          # imm = 0x10001
addq (%rbx), %rsi
movq %r13, %rdi
callq 0x23b0
testq %rax, %rax
je 0x8460
movq %rax, %r13
movq -0x38(%rbp), %rax
movq %r13, (%rax)
movq -0x30(%rbp), %r15
movq $0x10000, (%r15)        # imm = 0x10000
jmp 0x8425
movq -0x30(%rbp), %r15
addq (%rbx), %r13
movq %r14, %rdi
callq 0x631e
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x2200
addq %r12, (%rbx)
subq %r12, (%r15)
movq %r14, %rdi
movq %r12, %rsi
callq 0x64f9
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x8451
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_codec.c
// Function: dubbo_res_release
void dubbo_res_release(struct dubbo_res *res)
{
    if (res->desc)
    {
        free(res->desc);
    }
    if (res->data)
    {
        free(res->data);
    }
    if (res->attach)
    {
        free(res->attach);
    }
    free(res);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x847b
callq 0x23a0
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x8489
callq 0x23a0
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x8497
callq 0x23a0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x23a0
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_codec.c
// Function: dubbo_req_release
void dubbo_req_release(struct dubbo_req *req)
{
    free(req->argv[DUBBO_GENERIC_METHOD_ARGV_METHOD_IDX]);
    // free(req->argv[DUBBO_GENERIC_METHOD_ARGV_TYPES_IDX]);
    free(req->argv[DUBBO_GENERIC_METHOD_ARGV_ARGS_IDX]);
    free(req->argv);
    if (req->attach)
    {
        free(req->attach);
    }
    free(req);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movq (%rax), %rdi
callq 0x23a0
movq 0x20(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x23a0
movq 0x20(%rbx), %rdi
callq 0x23a0
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x86be
callq 0x23a0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x23a0
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_codec.c
// Function: dubbo_encode
struct buffer *dubbo_encode(const struct dubbo_req *req)
{
    struct buffer *buf = buf_create_ex(DUBBO_BUF_LEN, DUBBO_HDR_LEN);
    if (encode_req(buf, req))
    {
        return buf;
    }
    else
    {
        buf_release(buf);
        return NULL;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movl $0x2000, %edi           # imm = 0x2000
movl $0x10, %esi
callq 0x61f0
movq %rax, %rbx
movq (%r15), %r14
movb 0x8(%r15), %r13b
shlb $0x6, %r13b
orb $-0x7e, %r13b
cmpb $0x1, 0x9(%r15)
jne 0x8727
orb $0x20, %r13b
movq 0x38(%r15), %rsi
movq 0x40(%r15), %rdx
movq %rbx, %rdi
callq 0x66e7
jmp 0x8880
movq %rbx, %rdi
callq 0x632b
leaq 0x2502(%rip), %rdi      # 0xac38
movq %rax, %rsi
callq 0x7f6b
cmpl $-0x1, %eax
je 0x88d4
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x6339
movq 0x10(%r15), %r12
movq %rbx, %rdi
callq 0x632b
movq %r12, %rdi
movq %rax, %rsi
callq 0x7f6b
cmpl $-0x1, %eax
je 0x88d4
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x6339
movq %rbx, %rdi
callq 0x632b
leaq 0x24ba(%rip), %rdi      # 0xac46
movq %rax, %rsi
callq 0x7f6b
cmpl $-0x1, %eax
je 0x88d4
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x6339
movq %rbx, %rdi
callq 0x632b
leaq 0x2495(%rip), %rdi      # 0xac4c
movq %rax, %rsi
callq 0x7f6b
cmpl $-0x1, %eax
je 0x88d4
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x6339
movq %rbx, %rdi
callq 0x632b
leaq 0x247e(%rip), %rdi      # 0xac60
movq %rax, %rsi
callq 0x7f6b
cmpl $-0x1, %eax
je 0x88d4
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x6339
movq 0x20(%r15), %rax
movq (%rax), %r12
movq %rbx, %rdi
callq 0x632b
movq %r12, %rdi
movq %rax, %rsi
callq 0x7f6b
cmpl $-0x1, %eax
je 0x88d4
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x6339
movq %rbx, %rdi
callq 0x632b
movq %rax, %rdi
callq 0x7e2a
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x6339
movq 0x20(%r15), %rax
movq 0x10(%rax), %r15
movq %r15, %rdi
callq 0x20d0
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x81ca
movq %rbx, %rdi
callq 0x632b
movq %rax, %rdi
callq 0x7e2a
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x6339
movq %rbx, %rdi
callq 0x62f0
movq %rax, %r15
movq %rbx, %rdi
callq 0x6315
cmpq $0xf, %rax
jbe 0x88db
movq %rbx, %rdi
movl %r15d, %esi
callq 0x69e3
movq %rbx, %rdi
movq %r14, %rsi
callq 0x69a3
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6a62
movsbl %r13b, %esi
movq %rbx, %rdi
callq 0x6a62
movq %rbx, %rdi
movl $0xffffdabb, %esi       # imm = 0xFFFFDABB
callq 0x6a21
jmp 0x88ea
callq 0x247e
jmp 0x88e0
callq 0x24af
movq %rbx, %rdi
callq 0x627d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_codec.c
// Function: is_completed_dubbo_pkt
bool is_completed_dubbo_pkt(const struct buffer *buf, int *remaining)
{
    if (!is_dubbo_pkt(buf))
    {
        return false;
    }

    int32_t body_sz = 0;
    memcpy(&body_sz, buf_peek(buf) + DUBBO_HDR_LEN - sizeof(int32_t), sizeof(int32_t));
    body_sz = be32toh(body_sz);
    if (body_sz <= 0 || body_sz > DUBBO_MAX_PKT_SZ)
    {
        LOG_ERROR("invalid dubbo pkt body size %d", body_sz);
        return false;
    }

    if (remaining)
    {
        *remaining = body_sz + DUBBO_HDR_LEN - buf_readable(buf);
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r12
callq 0x8c4d
testb %al, %al
je 0x8ccf
movq %r12, %rdi
callq 0x631e
movl 0xc(%rax), %r15d
bswapl %r15d
leal -0x1(%r15), %eax
cmpl $0x400000, %eax         # imm = 0x400000
jae 0x8cde
movb $0x1, %r14b
testq %rbx, %rbx
je 0x8cd2
movq %r12, %rdi
callq 0x62f0
subl %eax, %r15d
addl $0x10, %r15d
movl %r15d, (%rbx)
jmp 0x8cd2
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x7313(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x1e5a(%rip), %rsi      # 0xab49
leaq 0x1e9b(%rip), %rcx      # 0xab91
leaq 0x1d04(%rip), %r8       # 0xaa01
xorl %r14d, %r14d
movl %r15d, %edx
movl $0x1f4, %r9d            # imm = 0x1F4
xorl %eax, %eax
callq 0x21e0
jmp 0x8cd2
nop
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_client.c
// Function: cli_connect
bool cli_connect(struct dubbo_client *cli)
{
    int fd = socket_create();
    if (fd < 0)
    {
        return false;
    }
    cli->fd = fd;

    int status = socket_connect(fd, &cli->addr, sizeof(cli->addr.s));
    if (status == 0)
    {
        if (!cli_connected(cli))
        {
            goto close;
        }
    }
    else
    {
        if (errno == EINPROGRESS)
        {
            // 这里 貌似应该 read + write
            if (AE_ERR == aeCreateFileEvent(cli->el, fd, AE_WRITABLE, cli_on_connect, cli))
            {
                goto close;
            }
            cli->timerid = aeCreateTimeEvent(cli->el, cli->timeout_ms, cli_connect_timeout, cli, NULL);
            if (AE_ERR == cli->timerid)
            {
                cli->timerid = AE_NOMORE;
                goto close;
            }
        }
        else
        {
            goto close;
        }
    }
    return true;

close:
    close(fd);
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x750a
testl %eax, %eax
js 0x8dbe
movl %eax, %ebx
movl %eax, 0x68(%r14)
leaq 0x10(%r14), %rsi
movl %eax, %edi
movl $0x10, %edx
callq 0x76ef
testl %eax, %eax
je 0x8da5
callq 0x2050
cmpl $0x73, (%rax)
jne 0x8db4
movq (%r14), %rdi
leaq 0xd8(%rip), %rcx        # 0x8e39
movl %ebx, %esi
movl $0x2, %edx
movq %r14, %r8
callq 0x2f95
cmpl $-0x1, %eax
je 0x8db4
movq (%r14), %rdi
movq 0x30(%r14), %rsi
leaq -0x670e(%rip), %rdx     # 0x2675
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x3156
movq %rax, 0x38(%r14)
movb $0x1, %r15b
cmpq $-0x1, %rax
jne 0x8dbe
movq $-0x1, 0x38(%r14)
jmp 0x8db4
movq %r14, %rdi
callq 0x8dcc
movb $0x1, %r15b
testb %al, %al
jne 0x8dbe
movl %ebx, %edi
callq 0x2160
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_client.c
// Function: cli_connected
static bool cli_connected(struct dubbo_client *cli)
{
    cli->connected = true;
    cli_clear_timer(cli);
    if (AE_ERR == aeCreateFileEvent(cli->el, cli->fd, AE_READABLE, cli_on_read, cli))
    {
        return false;
    }
    cli_pipe_send(cli);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movb $0x1, 0x6c(%rdi)
movq 0x38(%rdi), %rsi
cmpq $-0x1, %rsi
je 0x8df4
movq (%rbx), %rdi
callq 0x3258
movq $-0x1, 0x38(%rbx)
movq (%rbx), %rdi
movl 0x68(%rbx), %esi
leaq 0x521(%rip), %rcx       # 0x9322
movl $0x1, %edx
movq %rbx, %r8
callq 0x2f95
movl %eax, %r14d
cmpl $-0x1, %eax
jne 0x8e20
jmp 0x8e2d
movq %rbx, %rdi
callq 0x9607
subl $0x1, 0x54(%rbx)
jae 0x8e18
movl $0x0, 0x54(%rbx)
cmpl $-0x1, %r14d
setne %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_client.c
// Function: cli_on_connect
static void cli_on_connect(struct aeEventLoop *el, int fd, void *ud, int mask)
{
    struct dubbo_client *cli = (struct dubbo_client *)ud;
    // 注意: ae 将 err 与 hup 转换成 write 事件
    if ((mask & AE_WRITABLE) /* && !(mask & AE_READABLE)*/)
    {
        aeDeleteFileEvent(el, fd, AE_WRITABLE /* | AE_READABLE*/);
        // 所以, 可能出错 !!!
        cli_connected(cli);
    }
    else
    {
        LOG_ERROR("连接失败: %s", strerror(errno));
        cli_reconnect(cli);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
testb $0x2, %cl
je 0x8e5f
movl $0x2, %edx
callq 0x3064
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x8dcc
movq %rbx, %rdi
callq 0x2734
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_client.c
// Function: dubbo_bench_async
bool dubbo_bench_async(struct dubbo_args *args, struct dubbo_async_args *async_args)
{
    struct dubbo_client *cli = cli_create(args, async_args);
    if (cli == NULL)
    {
        return false;
    }
    return cli_start(cli);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movl $0x1, %edi
movl $0x90, %esi
callq 0x21b0
testq %rax, %rax
je 0x8ff1
movq %rax, %rbx
movq (%r15), %rax
movq %rax, (%rbx)
movb 0x10(%r15), %al
movb %al, 0x6e(%rbx)
movl $0x400, %edi            # imm = 0x400
movl $0x8, %esi
callq 0x61f0
movq %rax, 0x40(%rbx)
movl $0x400, %edi            # imm = 0x400
movl $0x8, %esi
callq 0x61f0
movq %rax, 0x48(%rbx)
movl 0xc(%r15), %eax
movl %eax, 0x58(%rbx)
movl %eax, 0x5c(%rbx)
movl 0x8(%r15), %ecx
cmpl %eax, %ecx
cmovll %ecx, %eax
movl %eax, 0x50(%rbx)
movl %ecx, 0x54(%rbx)
imulq $0x3e8, 0x30(%r14), %rax # imm = 0x3E8
movq %rax, 0x30(%rbx)
movq $-0x1, 0x38(%rbx)
movq %r14, 0x8(%rbx)
movq %rbx, %rdi
callq 0x983d
movq 0x8(%rbx), %rax
movq (%rax), %rdi
leaq 0x10(%rbx), %rsi
callq 0x7af3
testb %al, %al
je 0x9010
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x22d0
rolw $0x8, %ax
movw %ax, 0x12(%rbx)
cmpb $0x0, 0x6d(%rbx)
je 0x8f99
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x132(%rip), %rdi      # 0x8e6e
callq 0x9c50
leaq -0x10d(%rip), %r14      # 0x8e9f
movl $0x2, %edi
movq %r14, %rsi
callq 0x21d0
movl $0xf, %edi
movq %r14, %rsi
callq 0x21d0
movq %rbx, %rdi
addq $0x70, %rdi
xorl %esi, %esi
callq 0x2140
movq %rbx, 0x726d(%rip)      # 0x10248
movb $0x1, 0x6d(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8d14
leaq 0x2535(%rip), %rdi      # 0xb52d
leaq 0x1fa3(%rip), %rsi      # 0xafa2
leaq 0x252b(%rip), %rcx      # 0xb531
movl $0x64, %edx
callq 0x2150
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x2869
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_client.c
// Function: cli_send_req
static void cli_send_req(struct dubbo_client *cli)
{
    struct buffer *buf = cli_encode_req(cli);
    if (buf == NULL)
    {
        PANIC("Dubbo 请求失败: 编码失败");
        return;
    }

    buf_append(cli->snd_buf, buf_peek(buf), buf_readable(buf));
    buf_release(buf);
    if (!cli_write(cli))
    {
        cli_reconnect(cli);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdx
movq 0x28(%rax), %rcx
callq 0x84a5
testq %rax, %rax
je 0x96bb
movq %rax, %r14
cmpb $0x1, 0x6e(%rbx)
jne 0x9659
movq %r14, %rdi
callq 0x86cc
leaq 0x1ce5(%rip), %rdi      # 0xb334
movq %rax, %rsi
xorl %eax, %eax
callq 0x2100
movq %r14, %rdi
callq 0x86d5
testq %rax, %rax
je 0x96bb
movq %rax, %r14
movq 0x48(%rbx), %r15
movq %rax, %rdi
callq 0x631e
movq %rax, %r12
movq %r14, %rdi
callq 0x62f0
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x66e7
movq %r14, %rdi
callq 0x627d
movq %rbx, %rdi
callq 0x96c0
testb %al, %al
je 0x96ab
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x26bc
callq 0x29e1
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_client.c
// Function: cli_write
static bool cli_write(struct dubbo_client *cli)
{
    struct buffer *buf = cli->snd_buf;
    if (!buf_readable(buf))
    {
        aeDeleteFileEvent(cli->el, cli->fd, AE_WRITABLE);
        return true;
    }

    int nwritten = 0;
    while (buf_readable(buf))
    {
        nwritten = write(cli->fd, buf_peek(buf), buf_readable(buf));
        if (nwritten <= 0)
        {
            if (errno == EINTR)
            {
                continue;
            }
            break;
        }
        buf_retrieve(buf, nwritten);
    }

    if (nwritten <= 0)
    {
        if (errno == EAGAIN)
        {
            if (AE_ERR == aeCreateFileEvent(cli->el, cli->fd, AE_WRITABLE, cli_on_write, cli))
            {
                LOG_ERROR("Dubbo 请求失败: 创建可写事件失败");
                return false;
            }
            return true;
        }
        else
        {
            LOG_ERROR("Dubbo 发送数据失败: %s", strerror(errno));
            return false;
        }
    }

    if (!buf_readable(buf))
    {
        aeDeleteFileEvent(cli->el, cli->fd, AE_WRITABLE);
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %r14
movq %r14, %rdi
callq 0x62f0
testq %rax, %rax
je 0x9777
movq %r14, %rdi
callq 0x62f0
testq %rax, %rax
je 0x9742
movl 0x68(%rbx), %r15d
movq %r14, %rdi
callq 0x631e
movq %rax, %r12
movq %r14, %rdi
callq 0x62f0
movl %r15d, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x20b0
testl %eax, %eax
jle 0x9738
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %r14, %rdi
movq %rax, %rsi
callq 0x64f9
movq %r14, %rdi
callq 0x62f0
testq %rax, %rax
jne 0x96f0
jmp 0x978c
callq 0x2050
cmpl $0x4, (%rax)
je 0x96e3
callq 0x2050
movl (%rax), %edi
cmpl $0xb, %edi
jne 0x97ae
movq (%rbx), %rdi
movl 0x68(%rbx), %esi
leaq 0x67(%rip), %rcx        # 0x97c2
movl $0x2, %edx
movq %rbx, %r8
callq 0x2f95
movb $0x1, %r14b
cmpl $-0x1, %eax
jne 0x97b6
callq 0x2a5c
jmp 0x97b3
movq (%rbx), %rdi
movl 0x68(%rbx), %esi
movl $0x2, %edx
callq 0x3064
movb $0x1, %r14b
jmp 0x97b6
movq %r14, %rdi
callq 0x62f0
movb $0x1, %r14b
testq %rax, %rax
jne 0x97b6
movq (%rbx), %rdi
movl 0x68(%rbx), %esi
movl $0x2, %edx
callq 0x3064
jmp 0x97b6
callq 0x2a19
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_client.c
// Function: cli_on_write
static void cli_on_write(struct aeEventLoop *el, int fd, void *ud, int mask)
{
    UNUSED(el);
    UNUSED(fd);
    UNUSED(mask);

    struct dubbo_client *cli = (struct dubbo_client *)ud;
    assert(cli->connected);

    if (!cli_write(cli))
    {
        cli_reconnect(cli);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpb $0x0, 0x6c(%rdx)
je 0x97f2
movq %rdx, %rbx
movq %rdx, %rdi
callq 0x96c0
testb %al, %al
je 0x97e4
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x26bc
leaq 0x1878(%rip), %rdi      # 0xb071
leaq 0x17a2(%rip), %rsi      # 0xafa2
leaq 0x1be3(%rip), %rcx      # 0xb3ea
movl $0x17e, %edx            # imm = 0x17E
callq 0x2150
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_client.c
// Function: cli_reset
static void cli_reset(struct dubbo_client *cli)
{
    cli->connected = false;
    cli_clear_timer(cli);
    cli->fd = -1;
    cli->pipe_left = cli->pipe_n;
    buf_retrieveAll(cli->rcv_buf);
    buf_retrieveAll(cli->snd_buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x0, 0x6c(%rdi)
movq 0x38(%rdi), %rsi
cmpq $-0x1, %rsi
je 0x9864
movq (%rbx), %rdi
callq 0x3258
movq $-0x1, 0x38(%rbx)
movl $0xffffffff, 0x68(%rbx) # imm = 0xFFFFFFFF
movl 0x50(%rbx), %eax
movl %eax, 0x54(%rbx)
movq 0x40(%rbx), %rdi
callq 0x653e
movq 0x48(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x653e
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo.c
// Function: trim_opt
static char *trim_opt(char *opt)
{
    char *end;
    if (opt == 0)
    {
        return 0;
    }

    while (isspace((int)*opt) || *opt == '=')
        opt++;

    if (*opt == 0)
    {
        return opt;
    }

    end = opt + strlen(opt) - 1;
    while (end > opt && isspace((int)*end))
        end--;

    *(end + 1) = 0;

    return opt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x9c42
movq %rdi, %rbx
callq 0x2370
movq (%rax), %r14
decq %rbx
movsbq 0x1(%rbx), %rax
incq %rbx
cmpq $0x3d, %rax
je 0x9bf6
movzwl (%r14,%rax,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
jne 0x9bf6
testb %al, %al
je 0x9c44
movq %rbx, %rdi
callq 0x20d0
leaq (%rbx,%rax), %rcx
decq %rcx
movq %rcx, %rax
cmpq %rbx, %rcx
jbe 0x9c3c
movsbq (%rax), %rdx
leaq -0x1(%rax), %rcx
testb $0x20, 0x1(%r14,%rdx,2)
jne 0x9c24
movb $0x0, 0x1(%rax)
jmp 0x9c44
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/dalnefre[P]kernel_abe/abe.c
// Function: test_pre
void
test_pre()
{
/*	char tmp_buf[256]; */

	DBUG_ENTER("test_pre");

	DBUG_PRINT("", ("sizeof(int)=%d", sizeof(int)));
	DBUG_PRINT("", ("sizeof(CONS*)=%d", sizeof(CONS*)));
	DBUG_PRINT("", ("sizeof(BEH)=%d", sizeof(BEH)));
	assert(sizeof(int) == sizeof(CONS*));
	assert(sizeof(BEH) == sizeof(CONS*));

	DBUG_PRINT("", ("NIL=16#%08lx (%p)", NIL, NIL));
	assert(nilp(NIL));
	assert(nilp(NIL) == _nilp(NIL));

	DBUG_PRINT("", ("sizeof(BOOL)=%d", sizeof(BOOL)));
	assert(sizeof(BOOL) == sizeof(CONS*));
	DBUG_PRINT("", ("TRUE=16#%08lx (%p)", TRUE, TRUE));
	DBUG_PRINT("", ("FALSE=16#%08lx (%p)", FALSE, FALSE));
	assert(TRUE);
	assert(!FALSE);
	assert(TRUE == ((BOOL)(0 == 0)));
	assert(FALSE == ((BOOL)(0 != 0)));

#if TYPETAG_USES_3MSB
	DBUG_PRINT("", ("Type tag in MSB[31:29]"));
#endif /* TYPETAG_USES_3MSB */
#if TYPETAG_USES_2LSB
	DBUG_PRINT("", ("Type tag in LSB[1:0]"));
#endif /* TYPETAG_USES_2LSB */
#if TYPETAG_USES_3LSB
	DBUG_PRINT("", ("Type tag in LSB[2/1:0]"));
#endif /* TYPETAG_USES_3LSB */
#if TYPETAG_USES_1LSB_2MSB
	DBUG_PRINT("", ("Type tag in LSB[0]+MSB[31:30]"));
#endif /* TYPETAG_USES_1LSB_2MSB */
	DBUG_PRINT("", ("_Program[]=16#%08lx (%p)", _Program, _Program));
	assert(_Program == MK_PTR(MK_REF(_Program)));

/* FIXME: enable this test when stack allocation is allowed
	DBUG_PRINT("", ("tmp_buf[]=%p", tmp_buf));
	assert(tmp_buf == MK_PTR(MK_REF(tmp_buf)));
*/

	DBUG_PRINT("", ("test_pre()=16#%08lx (%p)", test_pre, test_pre));
	assert(test_pre == MK_BEH(MK_FUNC(test_pre)));

	DBUG_RETURN;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
leaq 0xb908(%rip), %rax      # 0xe004
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x10c05(%rip), %r14     # 0x13310
movq (%r14), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x1c, 0xc(%rdi)
leaq 0xd786(%rip), %rbx      # 0xfeac
movq %rbx, 0x10(%rdi)
leaq 0x109ff(%rip), %rcx     # 0x13130
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd87e
leaq 0x1117b(%rip), %r15     # 0x138c0
cmpl $0x0, (%r15)
je 0x2803
movq (%r14), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0xcfe0
testl %eax, %eax
je 0x2787
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x1e, 0xc(%rax)
leaq 0xb892(%rip), %rdi      # 0xe00d
movl $0x4, %esi
xorl %eax, %eax
callq 0xd8ef
cmpl $0x0, (%r15)
je 0x2803
movq (%r14), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0xcfe0
testl %eax, %eax
je 0x27c5
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x1f, 0xc(%rax)
leaq 0xb863(%rip), %rdi      # 0xe01c
movl $0x8, %esi
xorl %eax, %eax
callq 0xd8ef
cmpl $0x0, (%r15)
je 0x2803
movq (%r14), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0xcfe0
testl %eax, %eax
je 0x2803
movq (%r14), %rax
movq 0x50(%rax), %rax
movl $0x20, 0xc(%rax)
leaq 0xb836(%rip), %rdi      # 0xe02d
movl $0x8, %esi
xorl %eax, %eax
callq 0xd8ef
leaq 0xb832(%rip), %rdi      # 0xe03c
leaq 0xb848(%rip), %rsi      # 0xe059
leaq 0xb847(%rip), %rcx      # 0xe05f
movl $0x21, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O3/dalnefre[P]kernel_abe/sample.c
// Function: tick_init
void
tick_init()
{
	time_t t0;
	time_t t1;

	DBUG_ENTER("tick_init");
	time(&t0);
	do {				/* synchronize timer at boundry */
		time(&t1);
	} while (t0 == t1);
	DBUG_PRINT("", ("t0=%d t1=%d", t0, t1));
	time_base = t0;
	DBUG_RETURN;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
leaq 0xb4d8(%rip), %rax      # 0xe194
leaq 0x18(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x10645(%rip), %r15     # 0x13310
movq (%r15), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x15, 0xc(%rdi)
leaq 0xd1c6(%rip), %rbx      # 0xfeac
movq %rbx, 0x10(%rdi)
leaq 0x10487(%rip), %rcx     # 0x13178
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd87e
leaq 0x8(%rsp), %rdi
callq 0x2180
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x2180
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x2d0d
leaq 0x10b98(%rip), %rax     # 0x138c0
cmpl $0x0, (%rax)
je 0x2d6f
movq (%r15), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0xcfe0
movq 0x8(%rsp), %rsi
testl %eax, %eax
je 0x2d6f
movq (%r15), %rax
movq 0x50(%rax), %rax
movl $0x1a, 0xc(%rax)
movq 0x10(%rsp), %rdx
leaq 0xb43b(%rip), %rdi      # 0xe19e
xorl %eax, %eax
callq 0xd8ef
movq 0x8(%rsp), %rsi
movq %rsi, 0x105fa(%rip)     # 0x13370
leaq 0x18(%rsp), %rdi
movl $0x1c, 0xc(%rdi)
callq 0xda03
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/dalnefre[P]kernel_abe/sample.c
// Function: print_text
BEH_DECL(print_text)
{
	CONS* text;

	DBUG_ENTER("print_text");
	text = map_get(WHAT, ATOM("text"));
	printf("%s", (atomp(text) ? atom_str(text) : cons_to_str(text)));
	DBUG_RETURN;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0xb38b(%rip), %rax      # 0xe1b4
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x104d8(%rip), %rax     # 0x13310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x2d, 0xc(%rdi)
leaq 0xd059(%rip), %rcx      # 0xfeac
movq %rcx, 0x10(%rdi)
leaq 0x1031a(%rip), %rcx     # 0x13178
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd87e
movq 0x30(%rbx), %rdi
callq 0xbb69
movq %rax, %rbx
leaq 0xb33c(%rip), %rdi      # 0xe1ba
callq 0x8f57
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf9e
movl %eax, %ecx
andl $0x3, %ecx
movq %rax, %rdi
cmpl $0x2, %ecx
jne 0x2ea4
callq 0x8fb6
jmp 0x2ea9
callq 0x5a98
leaq 0xbde4(%rip), %rdi      # 0xec94
movq %rax, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x8(%rsp), %rdi
movl $0x30, 0xc(%rdi)
callq 0xda03
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/dalnefre[P]kernel_abe/sample.c
// Function: print_line
BEH_DECL(print_line)
{
	CONS* text;

	DBUG_ENTER("print_line");
	text = map_get(WHAT, ATOM("text"));
	printf("%s", (atomp(text) ? atom_str(text) : cons_to_str(text)));
	putchar('\n');
	DBUG_RETURN;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0xb2df(%rip), %rax      # 0xe1bf
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x10421(%rip), %rax     # 0x13310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x37, 0xc(%rdi)
leaq 0xcfa2(%rip), %rcx      # 0xfeac
movq %rcx, 0x10(%rdi)
leaq 0x10263(%rip), %rcx     # 0x13178
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd87e
movq 0x30(%rbx), %rdi
callq 0xbb69
movq %rax, %rbx
leaq 0xb285(%rip), %rdi      # 0xe1ba
callq 0x8f57
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf9e
movl %eax, %ecx
andl $0x3, %ecx
movq %rax, %rdi
cmpl $0x2, %ecx
jne 0x2f5b
callq 0x8fb6
jmp 0x2f60
callq 0x5a98
leaq 0xbd2d(%rip), %rdi      # 0xec94
movq %rax, %rsi
xorl %eax, %eax
callq 0x20f0
movl $0xa, %edi
callq 0x2040
leaq 0x8(%rsp), %rdi
movl $0x3b, 0xc(%rdi)
callq 0xda03
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/dalnefre[P]kernel_abe/sample.c
// Function: start_ticker
void
start_ticker(CONFIG* cfg, int count)
{
	CONS* actor;
	CONS* state;
	CONS* msg;
	
	DBUG_ENTER("start_ticker");
	DBUG_PRINT("", ("count=%d", count));
	state = map_put(NIL, ATOM("count"), NUMBER(count));
	actor = CFG_ACTOR(cfg, each_second, state);
	
	state = map_put(NIL, ATOM("sec"), actor);
	msg = map_put(NIL, ATOM("time"), tick_time());
	CFG_SEND(cfg, CFG_ACTOR(cfg, time_ticker, state), msg);
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0xab12(%rip), %rax      # 0xe28e
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0xfb85(%rip), %r15      # 0x13310
movq (%r15), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x8a, 0xc(%rdi)
leaq 0xc706(%rip), %r14      # 0xfeac
movq %r14, 0x10(%rdi)
leaq 0xf9c7(%rip), %rcx      # 0x13178
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xd87e
leaq 0x100fb(%rip), %rax     # 0x138c0
cmpl $0x0, (%rax)
je 0x37ff
movq (%r15), %rax
movq 0x50(%rax), %rax
movq %r14, 0x10(%rax)
movq %r14, %rdi
callq 0xcfe0
testl %eax, %eax
je 0x37ff
movq (%r15), %rax
movq 0x50(%rax), %rax
movl $0x8b, 0xc(%rax)
leaq 0xaf2d(%rip), %rdi      # 0xe723
movl %ebp, %esi
xorl %eax, %eax
callq 0xd8ef
leaq 0xaf32(%rip), %rdi      # 0xe738
callq 0x8f57
movslq %ebp, %rcx
leaq 0x3(,%rcx,4), %rdx
leaq 0xfa63(%rip), %r14      # 0x13280
movq %r14, %rdi
movq %rax, %rsi
callq 0xc010
leaq -0x89d(%rip), %rsi      # 0x2f92
movq %rbx, %rdi
movq %rax, %rdx
callq 0x4716
movq %rax, %r15
leaq 0xa9ad(%rip), %rdi      # 0xe1f1
callq 0x8f57
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0xc010
movq %rax, %r15
leaq 0xa94e(%rip), %rdi      # 0xe1af
callq 0x8f57
movq %rax, %r12
callq 0x2d91
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xc010
movq %rax, %r14
leaq -0x647(%rip), %rsi      # 0x323f
movq %rbx, %rdi
movq %r15, %rdx
callq 0x4716
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x47f3
leaq 0x8(%rsp), %rdi
movl $0x92, 0xc(%rdi)
callq 0xda03
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/dalnefre[P]kernel_abe/sample.c
// Function: say_hello
BEH_DECL(say_hello)
{
	CONS* name = map_get(WHAT, ATOM("name"));
	CONS* printer = ACTOR(print_text, NIL);
	CONS* a_text = ATOM("text");

	DBUG_ENTER("say_hello");
	SEND(printer, map_put(NIL, a_text, ATOM("Hello, ")));
	SEND(printer, MINE);
	SEND(printer, map_put(NIL, a_text, ATOM(" from ")));
	SEND(ACTOR(print_line, NIL), map_put(NIL, a_text, name));
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0xbb69
movq %rax, %r14
leaq 0xa9ba(%rip), %rdi      # 0xe29b
callq 0x8f57
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xbf9e
movq %rax, %r14
leaq -0xae3(%rip), %rsi      # 0x2e1a
leaq 0xf97c(%rip), %r15      # 0x13280
movq %rbx, %rdi
movq %r15, %rdx
callq 0x4716
movq %rax, %rbp
leaq 0xa8a1(%rip), %rdi      # 0xe1ba
callq 0x8f57
movq %rax, %r13
leaq 0xa978(%rip), %rax      # 0xe2a0
movq %rsp, %r12
movq %rax, (%r12)
leaq 0xf9da(%rip), %rax      # 0x13310
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%r12)
movl $0x9b, 0xc(%r12)
leaq 0xc557(%rip), %rcx      # 0xfeac
movq %rcx, 0x10(%r12)
leaq 0xf817(%rip), %rcx      # 0x13178
movq %rcx, 0x18(%r12)
movq %rax, 0x20(%r12)
movq %r12, %rdi
callq 0xd87e
leaq 0xa930(%rip), %rdi      # 0xe2aa
callq 0x8f57
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0xc010
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x47f3
movq 0x30(%rbx), %rdi
callq 0xbaca
movq %rax, %rdi
callq 0x3bbd
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x47f3
leaq 0xa8f1(%rip), %rdi      # 0xe2b2
callq 0x8f57
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0xc010
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x47f3
leaq -0xb18(%rip), %rsi      # 0x2ed1
movq %rbx, %rdi
movq %r15, %rdx
callq 0x4716
movq %rax, %rbp
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0xc010
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x47f3
movl $0xa0, 0xc(%r12)
movq %r12, %rdi
callq 0xda03
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq