// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rdi, %r14
movl $0x1, %r12d
movl $0x1, %edi
movl $0x48, %esi
callq 0x21b0
testq %rax, %rax
je 0x8786
movq %rax, %rbx
movq 0x7c1d(%rip), %rax      # 0x10240
incq %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rcx, %rax
cmoveq %r12, %rax
movq %rax, 0x7c02(%rip)      # 0x10240
movq %rax, (%rbx)
movw $0x1, 0x8(%rbx)
movq %r14, %rdi
callq 0x2340
movq %rax, 0x10(%rbx)
movq %r15, %rdi
callq 0x2340
movq %rax, 0x18(%rbx)
movq %r13, -0x30(%rbp)
movq %r13, %rdi
callq 0x4160
testq %rax, %rax
je 0x86e9
movq %rax, %r13
movq %rax, %rdi
callq 0x5906
testl %eax, %eax
jne 0x868b
movq %r13, %rdi
callq 0x591a
testl %eax, %eax
je 0x86e1
callq 0x51a1
movq %rax, %r12
movq 0x10(%r13), %r14
testq %r14, %r14
je 0x86b9
movq %r14, %rdi
movl $0x1, %esi
callq 0x5635
movq %r12, %rdi
movq %rax, %rsi
callq 0x49e6
movq (%r14), %r14
jmp 0x8697
movq %r13, %rdi
callq 0x3af0
movq %r12, %rdi
callq 0x428c
movq %rax, %r14
movq %rax, %rdi
callq 0x7ce4
movq %rax, %r13
movq %r14, %rdi
callq 0x23a0
jmp 0x86ec
movq %r13, %rdi
callq 0x3af0
xorl %r13d, %r13d
testq %r13, %r13
je 0x8752
movl $0x3, 0x28(%rbx)
movl $0x3, %edi
movl $0x8, %esi
callq 0x21b0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x87a5
movq %rax, %r14
movq %r15, %rdi
callq 0x2340
movq %rax, (%r14)
movq $0x0, 0x8(%r14)
movq %r13, 0x10(%r14)
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8740
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 0x789f(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x2307(%rip), %rsi      # 0xaa6a
leaq 0x233e(%rip), %rcx      # 0xaaa8
leaq 0x2290(%rip), %r8       # 0xaa01
xorl %ebx, %ebx
movq -0x30(%rbp), %rdx
movl $0x189, %r9d            # imm = 0x189
xorl %eax, %eax
callq 0x21e0
jmp 0x8740
leaq 0x2ba3(%rip), %rdi      # 0xb330
leaq 0x226d(%rip), %rsi      # 0xaa01
leaq 0x2274(%rip), %rcx      # 0xaa0f
movl $0x17f, %edx            # imm = 0x17F
callq 0x2150
leaq 0x230d(%rip), %rdi      # 0xaab9
leaq 0x224e(%rip), %rsi      # 0xaa01
leaq 0x2255(%rip), %rcx      # 0xaa0f
movl $0x18f, %edx            # imm = 0x18F
callq 0x2150