// File: /workspace/github_c_makefile_star2_O0/goghcrow[P]dubbo_ab/dubbo_codec.c
// Function: encode_req_data
static bool encode_req_data(struct buffer *buf, const struct dubbo_req *req)
{
    write_hs_str(buf, DUBBO_VER);
    write_hs_str(buf, req->service);
    write_hs_str(buf, DUBBO_GENERIC_METHOD_VER);
    write_hs_str(buf, DUBBO_GENERIC_METHOD_NAME);
    write_hs_str(buf, DUBBO_GENERIC_METHOD_PARA_TYPES);

    // args
    write_hs_str(buf, req->argv[DUBBO_GENERIC_METHOD_ARGV_METHOD_IDX]);
    buf_has_written(buf, hs_encode_null((uint8_t *)buf_beginWrite(buf))); // 方法类型提示 NULL, 不支持重载方法
#ifdef DUBBO_BYTE_CODEC
    const char *args = req->argv[DUBBO_GENERIC_METHOD_ARGV_ARGS_IDX];
    hs_encode_binary(args, strlen(args), buf);
#else
    write_hs_str(buf, req->argv[DUBBO_GENERIC_METHOD_ARGV_ARGS_IDX]);
#endif

    // TODO: fixme :  attach NULL
    buf_has_written(buf, hs_encode_null((uint8_t *)buf_beginWrite(buf)));

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83d0
movq %rax, %rsi
leaq 0x3bd8(%rip), %rdi      # 0x1016b
callq 0xb250
movl %eax, -0x1c(%rbp)
cmpl $-0x1, -0x1c(%rbp)
jne 0xc5aa
movb $0x0, -0x1(%rbp)
jmp 0xc75e
movq -0x10(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x83f0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83d0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0xb250
movl %eax, -0x20(%rbp)
cmpl $-0x1, -0x20(%rbp)
jne 0xc5ea
movb $0x0, -0x1(%rbp)
jmp 0xc75e
movq -0x10(%rbp), %rdi
movslq -0x20(%rbp), %rsi
callq 0x83f0
movq -0x10(%rbp), %rdi
callq 0x83d0
movq %rax, %rsi
leaq 0x3b6f(%rip), %rdi      # 0x10179
callq 0xb250
movl %eax, -0x24(%rbp)
cmpl $-0x1, -0x24(%rbp)
jne 0xc621
movb $0x0, -0x1(%rbp)
jmp 0xc75e
movq -0x10(%rbp), %rdi
movslq -0x24(%rbp), %rsi
callq 0x83f0
movq -0x10(%rbp), %rdi
callq 0x83d0
movq %rax, %rsi
leaq 0x3b3e(%rip), %rdi      # 0x1017f
callq 0xb250
movl %eax, -0x28(%rbp)
cmpl $-0x1, -0x28(%rbp)
jne 0xc658
movb $0x0, -0x1(%rbp)
jmp 0xc75e
movq -0x10(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x83f0
movq -0x10(%rbp), %rdi
callq 0x83d0
movq %rax, %rsi
leaq 0x3b1b(%rip), %rdi      # 0x10193
callq 0xb250
movl %eax, -0x2c(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0xc68f
movb $0x0, -0x1(%rbp)
jmp 0xc75e
movq -0x10(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x83f0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83d0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0xb250
movl %eax, -0x30(%rbp)
cmpl $-0x1, -0x30(%rbp)
jne 0xc6d2
movb $0x0, -0x1(%rbp)
jmp 0xc75e
movq -0x10(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x83f0
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83d0
movq %rax, %rdi
callq 0xaf70
movq -0x60(%rbp), %rdi
movslq %eax, %rsi
callq 0x83f0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rdi
callq 0x20e0
movq -0x58(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rdx
callq 0xb710
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83d0
movq %rax, %rdi
callq 0xaf70
movq -0x50(%rbp), %rdi
movslq %eax, %rsi
callq 0x83f0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)