// File: /workspace/github_c_makefile_star2_O2/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, -0x40(%rbp)
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r12
pushq $0x1
popq %r14
pushq $0x48
popq %rsi
movq %r14, %rdi
callq 0x21b0
testq %rax, %rax
je 0x7433
movq %rax, %rbx
movq 0x7f76(%rip), %rax      # 0xf240
incq %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rcx, %rax
cmoveq %r14, %rax
movq %rax, 0x7f5b(%rip)      # 0xf240
movq %rax, (%rbx)
movb $0x1, 0x8(%rbx)
movq %r12, %rdi
callq 0x2340
movq %rax, 0x10(%rbx)
movq %r13, %rdi
callq 0x2340
movq %rax, 0x18(%rbx)
movq %r15, -0x30(%rbp)
movq %r15, %rdi
callq 0x372f
testq %rax, %rax
je 0x73ff
movq %rax, %r14
movq %rax, %rdi
callq 0x4987
testl %eax, %eax
jne 0x7338
movq %r14, %rdi
callq 0x499b
testl %eax, %eax
je 0x73f7
movq %r13, -0x38(%rbp)
callq 0x44bb
movq %rax, %r12
movq %r14, %r13
addq $0x10, %r13
pushq $0x1
popq %r15
movq (%r13), %r13
testq %r13, %r13
je 0x7370
movq %r13, %rdi
movl %r15d, %esi
callq 0x4727
movq %r12, %rdi
movq %rax, %rsi
callq 0x3ebb
jmp 0x734f
movq %r14, %rdi
callq 0x3060
movq %r12, %rdi
callq 0x3832
movq %rax, %r14
movq %rax, %rdi
callq 0x6994
movq %rax, %r12
movq %r14, %rdi
callq 0x23a0
testq %r12, %r12
movq -0x40(%rbp), %r15
movq -0x38(%rbp), %r13
je 0x73ff
movl $0x3, 0x28(%rbx)
pushq $0x3
popq %rdi
pushq $0x8
popq %rsi
callq 0x21b0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x7452
movq %rax, %r14
movq %r13, %rdi
callq 0x2340
movq %rax, (%r14)
movq %r12, 0x10(%r14)
testq %r15, %r15
je 0x73e5
movq %r15, %rdi
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 %r14, %rdi
callq 0x3060
movq 0x7bf2(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x27aa(%rip), %rsi      # 0x9bba
leaq 0x27e1(%rip), %rcx      # 0x9bf8
leaq 0x2733(%rip), %r8       # 0x9b51
xorl %ebx, %ebx
movq -0x30(%rbp), %rdx
movl $0x189, %r9d            # imm = 0x189
xorl %eax, %eax
callq 0x21e0
jmp 0x73e5
leaq 0x3046(%rip), %rdi      # 0xa480
leaq 0x2710(%rip), %rsi      # 0x9b51
leaq 0x2717(%rip), %rcx      # 0x9b5f
movl $0x17f, %edx            # imm = 0x17F
callq 0x2150
leaq 0x27b0(%rip), %rdi      # 0x9c09
leaq 0x26f1(%rip), %rsi      # 0x9b51
leaq 0x26f8(%rip), %rcx      # 0x9b5f
movl $0x18f, %edx            # imm = 0x18F
callq 0x2150