// File: /workspace/github_c_makefile_star2_O2/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 0x1e47f(%rip), %r13     # 0x28fb8
movq (%r13), %r14
callq 0xe343
leaq 0x13d7d(%rip), %rsi     # 0x1e8c6
leaq 0x13da9(%rip), %rcx     # 0x1e8f9
movq %r14, %rdi
movq %rax, %rdx
movl %ebp, %r8d
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x1f13e(%rip), %r12     # 0x29ca8
movq (%r12), %r14
testq %r14, %r14
je 0xab99
callq 0xe343
leaq 0x13d47(%rip), %rsi     # 0x1e8c6
leaq 0x13d73(%rip), %rcx     # 0x1e8f9
movq %r14, %rdi
movq %rax, %rdx
movl %ebp, %r8d
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x2d1e(%rip), %rdx      # 0xd8be
pushq $0x1a
popq %rdi
pushq $0x2f
popq %rsi
xorl %ecx, %ecx
callq 0xd53c
movq %rax, %r14
movb %bpl, 0x10(%rax)
movzwl %bx, %edi
callq 0xe749
movzwl %ax, %eax
movl %eax, 0x14(%r14)
leaq 0x13d2f(%rip), %rcx     # 0x1e8f9
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0x7530, %edx           # imm = 0x7530
callq 0x9e8b
movl %eax, %ebx
testl %eax, %eax
sets %al
movq (%r15), %rbp
testq %rbp, %rbp
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xac50
movq (%r13), %r14
callq 0xe343
leaq 0x13b7d(%rip), %rsi     # 0x1e781
leaq 0x13cee(%rip), %rcx     # 0x1e8f9
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
movq (%r12), %r14
testq %r14, %r14
je 0xacfa
callq 0xe343
leaq 0x13b4d(%rip), %rsi     # 0x1e781
leaq 0x13cbe(%rip), %rcx     # 0x1e8f9
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
jmp 0xacfa
movzwl 0x10(%rbp), %edi
callq 0xe73e
testw %ax, %ax
jne 0xac70
movzwl 0x12(%rbp), %edi
callq 0xe73e
testw %ax, %ax
je 0xad0b
movzwl 0x12(%rbp), %edi
callq 0xe73e
movl %eax, %ebx
movq (%r13), %r14
callq 0xe343
movq %rax, %r15
movzwl 0x10(%rbp), %edi
callq 0xe73e
movzwl %ax, %r8d
movzwl %bx, %ebx
leaq 0x13af5(%rip), %rsi     # 0x1e793
leaq 0x13c54(%rip), %rcx     # 0x1e8f9
movq %r14, %rdi
movq %r15, %rdx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
movq (%r12), %r14
testq %r14, %r14
je 0xacf1
callq 0xe343
movq %rax, %r15
movzwl 0x10(%rbp), %edi
callq 0xe73e
movzwl %ax, %r8d
leaq 0x13ab9(%rip), %rsi     # 0x1e793
leaq 0x13c18(%rip), %rcx     # 0x1e8f9
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 0xacfa