// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: requestSetLoopBackState
static int requestSetLoopBackState(UCHAR loopback_state, ULONG replication_factor) {
    PQCQMIMSG pRequest;
    PQCQMIMSG pResponse;
    PQMUX_MSG pMUXMsg;
    int err;

    dbg_time("%s(loopback_state=%d, replication_factor=%u)", __func__, loopback_state, replication_factor);
    
    pRequest = ComposeQMUXMsg(QMUX_TYPE_WDS_ADMIN, QMI_WDA_SET_LOOPBACK_CONFIG_REQ, WdaSetLoopBackReq, NULL);
    pRequest->MUXMsg.SetLoopBackReq.loopback_state.TLVVaule = loopback_state;
    pRequest->MUXMsg.SetLoopBackReq.replication_factor.TLVVaule = cpu_to_le16(replication_factor);

    err = QmiThreadSendQMI(pRequest, &pResponse);
    qmi_rsp_check_and_return();

    free(pResponse);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movb %dil, %al
movb %al, -0x5(%rbp)
movl %esi, -0xc(%rbp)
movq 0x29328(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
callq 0x13930
movq -0x38(%rbp), %rdi
movq %rax, %rdx
movzbl -0x5(%rbp), %r8d
movl -0xc(%rbp), %r9d
leaq 0x1fdcb(%rip), %rsi     # 0x2daa6
leaq 0x1fdf7(%rip), %rcx     # 0x2dad9
movb $0x0, %al
callq 0x52c0
leaq 0x2a178(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xdd2e
leaq 0x2a16b(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x40(%rbp)
callq 0x13930
movq -0x40(%rbp), %rdi
movq %rax, %rdx
movzbl -0x5(%rbp), %r8d
movl -0xc(%rbp), %r9d
leaq 0x1fd86(%rip), %rsi     # 0x2daa6
leaq 0x1fdb2(%rip), %rcx     # 0x2dad9
movb $0x0, %al
callq 0x52c0
jmp 0xdd30
movl $0x1a, %edi
movl $0x2f, %esi
leaq 0x3b4f(%rip), %rdx      # 0x11890
xorl %eax, %eax
movl %eax, %ecx
callq 0x11170
movq %rax, -0x18(%rbp)
movb -0x5(%rbp), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x10(%rax)
movl -0xc(%rbp), %eax
movzwl %ax, %edi
callq 0x13ff0
movzwl %ax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x7530, %edx           # imm = 0x7530
leaq 0x1fd58(%rip), %rcx     # 0x2dad9
callq 0xc670
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0xdd9a
cmpq $0x0, -0x20(%rbp)
jne 0xde1c
jmp 0xdd9c
movq 0x2923d(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x48(%rbp)
callq 0x13930
movq -0x48(%rbp), %rdi
movq %rax, %rdx
movl -0x2c(%rbp), %r8d
leaq 0x1fba0(%rip), %rsi     # 0x2d961
leaq 0x1fd11(%rip), %rcx     # 0x2dad9
movb $0x0, %al
callq 0x52c0
leaq 0x2a092(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xde0f
leaq 0x2a085(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x13930
movq -0x50(%rbp), %rdi
movq %rax, %rdx
movl -0x2c(%rbp), %r8d
leaq 0x1fb60(%rip), %rsi     # 0x2d961
leaq 0x1fcd1(%rip), %rcx     # 0x2dad9
movb $0x0, %al
callq 0x52c0
jmp 0xde11
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xdf2e
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x0, %eax
jne 0xde56
movq -0x28(%rbp), %rax
movzwl 0xc(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xdf1c
movq -0x28(%rbp), %rax
movzwl 0xc(%rax), %edi
callq 0x13ed0
movw %ax, -0x2e(%rbp)
movq 0x29172(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x60(%rbp)
callq 0x13930
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x13ed0
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rdx
movzwl %ax, %r8d
movzwl -0x2e(%rbp), %r9d
leaq 0x1fad0(%rip), %rsi     # 0x2d973
leaq 0x1fc2f(%rip), %rcx     # 0x2dad9
movb $0x0, %al
callq 0x52c0
leaq 0x29fb0(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xdf08
leaq 0x29fa3(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x70(%rbp)
callq 0x13930
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x13ed0
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rdx
movzwl %ax, %r8d
movzwl -0x2e(%rbp), %r9d
leaq 0x1fa79(%rip), %rsi     # 0x2d973
leaq 0x1fbd8(%rip), %rcx     # 0x2dad9
movb $0x0, %al
callq 0x52c0
jmp 0xdf0a
movq -0x20(%rbp), %rdi
callq 0x5040
movzwl -0x2e(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xdf2e
jmp 0xdf1e
movq -0x20(%rbp), %rdi
callq 0x5040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)