// File: /workspace/github_c_makefile_star2_O3/goghcrow[P]dubbo_ab/dubbo_codec.c
// Function: dubbo_req_create
struct dubbo_req *dubbo_req_create(const char *service, const char *method, const char *json_args, const char *json_attach)
{
    struct dubbo_req *req = calloc(1, sizeof(*req));
    assert(req);
    req->reqid = next_reqid();
    req->is_twoway = true;
    req->is_evt = false;
    req->service = strdup(service);
    req->method = strdup(method);

    char *args = rebuild_json_args(json_args);
    if (args == NULL)
    {
        LOG_ERROR("invalid json args %s", json_args);
        return NULL;
    }

    req->argc = DUBBO_GENERIC_METHOD_ARGC;
    req->argv = calloc(3, sizeof(void *));
    assert(req->argv);
    req->argv[DUBBO_GENERIC_METHOD_ARGV_METHOD_IDX] = strdup(method);
    req->argv[DUBBO_GENERIC_METHOD_ARGV_TYPES_IDX] = NULL;
    req->argv[DUBBO_GENERIC_METHOD_ARGV_ARGS_IDX] = args;

    // fixme 要处理成 hessian map
    if (json_attach)
    {
        req->attach = strdup(json_attach);
    }

    return req;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, -0x38(%rbp)
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r14
movl $0x1, %r15d
movl $0x1, %edi
movl $0x48, %esi
callq 0x21b0
testq %rax, %rax
je 0x8647
movq %rax, %rbx
movq 0x7d55(%rip), %rax      # 0x10240
incq %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rcx, %rax
cmoveq %r15, %rax
movq %rax, 0x7d3a(%rip)      # 0x10240
movq %rax, (%rbx)
movb $0x1, 0x8(%rbx)
movq %r14, %rdi
callq 0x2340
movq %rax, 0x10(%rbx)
movq %r12, %rdi
callq 0x2340
movq %rax, 0x18(%rbx)
movq %r13, -0x30(%rbp)
movq %r13, %rdi
callq 0x40c3
testq %rax, %rax
je 0x8613
movq %rax, %r13
movq %rax, %rdi
callq 0x5847
testl %eax, %eax
jne 0x8559
movq %r13, %rdi
callq 0x585b
testl %eax, %eax
je 0x860b
callq 0x5149
movq %rax, %r15
movq 0x10(%r13), %r14
testq %r14, %r14
je 0x8587
movq %r14, %rdi
movl $0x1, %esi
callq 0x5567
movq %r15, %rdi
movq %rax, %rsi
callq 0x494f
movq (%r14), %r14
jmp 0x8565
movq %r13, %rdi
callq 0x3a9a
movq %r15, %rdi
callq 0x41e0
movq %rax, %r14
movq %rax, %rdi
callq 0x7b9c
movq %rax, %r15
movq %r14, %rdi
callq 0x23a0
testq %r15, %r15
je 0x8613
movl $0x3, 0x28(%rbx)
movl $0x3, %edi
movl $0x8, %esi
callq 0x21b0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x8666
movq %rax, %r14
movq %r12, %rdi
callq 0x2340
movq %rax, (%r14)
movq %r15, 0x10(%r14)
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x85f9
callq 0x2340
movq %rax, 0x30(%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x3a9a
movq 0x79de(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x2446(%rip), %rsi      # 0xaa6a
leaq 0x247d(%rip), %rcx      # 0xaaa8
leaq 0x23cf(%rip), %r8       # 0xaa01
xorl %ebx, %ebx
movq -0x30(%rbp), %rdx
movl $0x189, %r9d            # imm = 0x189
xorl %eax, %eax
callq 0x21e0
jmp 0x85f9
leaq 0x2ce2(%rip), %rdi      # 0xb330
leaq 0x23ac(%rip), %rsi      # 0xaa01
leaq 0x23b3(%rip), %rcx      # 0xaa0f
movl $0x17f, %edx            # imm = 0x17F
callq 0x2150
leaq 0x244c(%rip), %rdi      # 0xaab9
leaq 0x238d(%rip), %rsi      # 0xaa01
leaq 0x2394(%rip), %rcx      # 0xaa0f
movl $0x18f, %edx            # imm = 0x18F
callq 0x2150