// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movq 0x1f041(%rip), %r13     # 0x29fc0
movq (%r13), %r14
callq 0xea3b
leaq 0x15937(%rip), %rsi     # 0x208c6
leaq 0x15963(%rip), %rcx     # 0x208f9
movq %r14, %rdi
movq %rax, %rdx
movl %ebp, %r8d
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x1fcf8(%rip), %r12     # 0x2aca8
movq (%r12), %r14
testq %r14, %r14
je 0xafdf
callq 0xea3b
leaq 0x15901(%rip), %rsi     # 0x208c6
leaq 0x1592d(%rip), %rcx     # 0x208f9
movq %r14, %rdi
movq %rax, %rdx
movl %ebp, %r8d
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x2d6d(%rip), %rdx      # 0xdd53
movl $0x1a, %edi
movl $0x2f, %esi
xorl %ecx, %ecx
callq 0xd9a2
movq %rax, %r14
movb %bpl, 0x10(%rax)
movzwl %bx, %edi
callq 0xee7e
movzwl %ax, %eax
movl %eax, 0x14(%r14)
leaq 0x158e5(%rip), %rcx     # 0x208f9
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0x7530, %edx           # imm = 0x7530
callq 0xa273
movl %eax, %ebx
testl %eax, %eax
sets %al
movq (%r15), %rbp
testq %rbp, %rbp
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xb09a
movq (%r13), %r14
callq 0xea3b
leaq 0x15733(%rip), %rsi     # 0x20781
leaq 0x158a4(%rip), %rcx     # 0x208f9
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
movq (%r12), %r14
testq %r14, %r14
je 0xb144
callq 0xea3b
leaq 0x15703(%rip), %rsi     # 0x20781
leaq 0x15874(%rip), %rcx     # 0x208f9
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
jmp 0xb144
movzwl 0x10(%rbp), %edi
callq 0xee73
testw %ax, %ax
jne 0xb0ba
movzwl 0x12(%rbp), %edi
callq 0xee73
testw %ax, %ax
je 0xb155
movzwl 0x12(%rbp), %edi
callq 0xee73
movl %eax, %ebx
movq (%r13), %r14
callq 0xea3b
movq %rax, %r15
movzwl 0x10(%rbp), %edi
callq 0xee73
movzwl %ax, %r8d
movzwl %bx, %ebx
leaq 0x156ab(%rip), %rsi     # 0x20793
leaq 0x1580a(%rip), %rcx     # 0x208f9
movq %r14, %rdi
movq %r15, %rdx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
movq (%r12), %r14
testq %r14, %r14
je 0xb13b
callq 0xea3b
movq %rax, %r15
movzwl 0x10(%rbp), %edi
callq 0xee73
movzwl %ax, %r8d
leaq 0x1566f(%rip), %rsi     # 0x20793
leaq 0x157ce(%rip), %rcx     # 0x208f9
movq %r14, %rdi
movq %r15, %rdx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
movq (%rsp), %rdi
callq 0x5040
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rdi
callq 0x5040
xorl %ebx, %ebx
jmp 0xb144