// File: /workspace/github_c_makefile_star2_O1/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 0x1ef9f(%rip), %r13     # 0x29fc0
movq (%r13), %r14
callq 0xeb2f
leaq 0x15899(%rip), %rsi     # 0x208ca
leaq 0x158c5(%rip), %rcx     # 0x208fd
movq %r14, %rdi
movq %rax, %rdx
movl %ebp, %r8d
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x1fc56(%rip), %r12     # 0x2aca8
movq (%r12), %r14
testq %r14, %r14
je 0xb081
callq 0xeb2f
leaq 0x15863(%rip), %rsi     # 0x208ca
leaq 0x1588f(%rip), %rcx     # 0x208fd
movq %r14, %rdi
movq %rax, %rdx
movl %ebp, %r8d
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x2dc2(%rip), %rdx      # 0xde4a
movl $0x1a, %edi
movl $0x2f, %esi
xorl %ecx, %ecx
callq 0xda86
movq %rax, %r14
movb %bpl, 0x10(%rax)
movzwl %bx, %edi
callq 0xef6c
movzwl %ax, %eax
movl %eax, 0x14(%r14)
leaq 0x15847(%rip), %rcx     # 0x208fd
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0x7530, %edx           # imm = 0x7530
callq 0xa317
movl %eax, %ebx
testl %eax, %eax
sets %al
movq (%r15), %rbp
testq %rbp, %rbp
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xb13c
movq (%r13), %r14
callq 0xeb2f
leaq 0x15695(%rip), %rsi     # 0x20785
leaq 0x15806(%rip), %rcx     # 0x208fd
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
movq (%r12), %r14
testq %r14, %r14
je 0xb1e6
callq 0xeb2f
leaq 0x15665(%rip), %rsi     # 0x20785
leaq 0x157d6(%rip), %rcx     # 0x208fd
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
jmp 0xb1e6
movzwl 0x10(%rbp), %edi
callq 0xef61
testw %ax, %ax
jne 0xb15c
movzwl 0x12(%rbp), %edi
callq 0xef61
testw %ax, %ax
je 0xb1f7
movzwl 0x12(%rbp), %edi
callq 0xef61
movl %eax, %ebx
movq (%r13), %r14
callq 0xeb2f
movq %rax, %r15
movzwl 0x10(%rbp), %edi
callq 0xef61
movzwl %ax, %r8d
movzwl %bx, %ebx
leaq 0x1560d(%rip), %rsi     # 0x20797
leaq 0x1576c(%rip), %rcx     # 0x208fd
movq %r14, %rdi
movq %r15, %rdx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
movq (%r12), %r14
testq %r14, %r14
je 0xb1dd
callq 0xeb2f
movq %rax, %r15
movzwl 0x10(%rbp), %edi
callq 0xef61
movzwl %ax, %r8d
leaq 0x155d1(%rip), %rsi     # 0x20797
leaq 0x15730(%rip), %rcx     # 0x208fd
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 0xb1e6