// File: /workspace/github_c_makefile_star2_O2/pencode-lab[P]Shoit/shoit_receiver.c
// Function: transfer_thread_run
static void transfer_thread_run(void *argv)
{
    shoit_core_t *receiver = (shoit_core_t *)argv;

    if(receiver->runing){
        //create udpserver
        receiver->udpRemotePort = receiver->udpLocalPort + 1;
        receiver->udpSockfd=shoit_network_udp_server_init(&receiver->udpServerAddr,
                                                            receiver->udpLocalPort,
                                                            receiver->remoteHost,
                                                            receiver->udpRemotePort);
        if(receiver->verbose>1) SHOIT_LOG("start udpserver 0.0.0.0:%d <-> %s:%d",
                            receiver->udpLocalPort,receiver->remoteHost,receiver->udpRemotePort);

        if(receiver->udpSockfd==-1){
            receiver->runing=false;
            SHOIT_LOG("start udp server failed.\n");
        }
    }

    while(receiver->runing){
        transfer_data_round_circle(receiver);
    }
    receiver->runing=false; 
    pthread_exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdi, %rbx
cmpl $0x0, 0x1a8(%rdi)
je 0x53a6
movl 0xa0(%rbx), %esi
leal 0x1(%rsi), %ecx
movl %ecx, 0x98(%rbx)
leaq 0xa4(%rbx), %rdi
leaq 0x78(%rbx), %r14
movq %r14, %rdx
callq 0x2ec7
movl %eax, 0x68(%rbx)
cmpl $0x2, 0x5c(%rbx)
jl 0x5385
movq 0xe8(%rbx), %rdi
movl 0x98(%rbx), %r8d
movl 0xa0(%rbx), %edx
leaq 0x18a8(%rip), %rsi      # 0x6c20
movq %r14, %rcx
xorl %eax, %eax
callq 0x34b1
movl 0x68(%rbx), %eax
cmpl $-0x1, %eax
jne 0x53a6
andl $0x0, 0x1a8(%rbx)
movq 0xe8(%rbx), %rdi
leaq 0x18a6(%rip), %rsi      # 0x6c45
xorl %eax, %eax
callq 0x34b1
leaq 0x120(%rbx), %rax
movq %rax, 0x10(%rsp)
pushq $0x40
popq %r13
pushq $0x10
popq %r15
cmpl $0x0, 0x1a8(%rbx)
je 0x5789
movq 0x10(%rsp), %rdi
callq 0x2080
cmpl $0x0, 0x1a8(%rbx)
je 0x5765
movq 0x8(%rbx), %rax
movl 0x2c(%rbx), %esi
xorl %edx, %edx
divq %rsi
xorl %ecx, %ecx
testq %rdx, %rdx
cmovel %esi, %edx
setne %cl
addq %rax, %rcx
movq %rcx, 0x38(%rbx)
movl %edx, 0x30(%rbx)
andq $0x0, 0x48(%rbx)
movq %rcx, 0x40(%rbx)
movq %rcx, %rax
shrq $0x3, %rax
addq $0x2, %rax
movq %rax, 0xd8(%rbx)
movl $0x1, 0xe0(%rbx)
xorl %eax, %eax
cmpq %rcx, %rax
jae 0x543f
movq 0xc8(%rbx), %rcx
movq %rax, (%rcx,%rax,8)
incq %rax
movq 0x38(%rbx), %rcx
jmp 0x5426
movq %rbx, %rdi
callq 0x29bd
movq %rbx, %rdi
pushq $0x3
popq %rsi
callq 0x5a7e
movq 0xd0(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
movups %xmm0, 0xe(%rax)
movq %rax, 0x18(%rsp)
movl $0x5, (%rax)
xorl %ebp, %ebp
testl %ebp, %ebp
leaq 0xe8(%rsp), %rbp
jne 0x573e
cmpl $0x0, 0x1a8(%rbx)
je 0x573e
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
callq 0x2170
movl 0x34(%rbx), %edi
callq 0x22e0
movq %rax, %r14
movl 0x68(%rbx), %ecx
movl 0x140(%rbx), %esi
xorl %eax, %eax
cmpq $0x10, %rax
je 0x54c1
andq $0x0, 0x68(%rsp,%rax,8)
incq %rax
jmp 0x54b0
cmpl %esi, %ecx
movl %esi, %r12d
cmovgl %ecx, %r12d
movl %ecx, %eax
cltd
idivl %r13d
movslq %eax, %rdx
shll $0x6, %eax
subl %eax, %ecx
pushq $0x1
popq %rdi
movq %rdi, %rax
shlq %cl, %rax
orq %rax, 0x68(%rsp,%rdx,8)
movl %esi, %eax
cltd
idivl %r13d
movslq %eax, %rdx
shll $0x6, %eax
subl %eax, %esi
movq %rdi, %rax
movl %esi, %ecx
shlq %cl, %rax
incl %r12d
orq %rax, 0x68(%rsp,%rdx,8)
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0x2170
movq %r14, %rax
addq $0xc, %rax
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x1a8(%rbx)
je 0x5645
movq $0x5, 0x28(%rsp)
andq $0x0, 0x30(%rsp)
movq %r15, %rcx
movq %rbp, %rdi
leaq 0x68(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %r12d, %edi
movq %rbp, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0x28(%rsp), %r8
callq 0x22a0
cmpl $-0x1, %eax
je 0x5628
testl %eax, %eax
jle 0x551c
movl 0x68(%rbx), %edi
movl %edi, %eax
cltd
idivl %r13d
cltq
movq 0xe8(%rsp,%rax,8), %rax
btq %rdx, %rax
jae 0x55ed
movl %r13d, %ebp
movl 0x34(%rbx), %edx
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x2050
movq %rax, %r13
testl %r13d, %r13d
jle 0x5636
movq (%r14), %r15
movl 0x8(%r14), %eax
bswapl %eax
movl 0x2c(%rbx), %edi
imulq %r15, %rdi
addq (%rbx), %rdi
movslq %eax, %rdx
movq 0x20(%rsp), %rsi
callq 0x2280
movq %rbx, %rdi
movq %r15, %rsi
pushq $0x10
popq %r15
callq 0x2a23
incq 0x48(%rbx)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
addq %r13, 0x3d23(%rip)      # 0x9300
movl %ebp, %r13d
leaq 0xe8(%rsp), %rbp
jmp 0x551c
movl 0x140(%rbx), %edi
movl %edi, %eax
cltd
idivl %r13d
cltq
movq 0xe8(%rsp,%rax,8), %rax
btq %rdx, %rax
jae 0x551c
leaq 0xf(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2200
testq %rax, %rax
jns 0x5645
leaq 0x16fc(%rip), %rdi      # 0x6d22
jmp 0x562f
leaq 0x16da(%rip), %rdi      # 0x6d09
callq 0x2390
jmp 0x5645
leaq 0x16d5(%rip), %rdi      # 0x6d12
callq 0x2390
movl %ebp, %r13d
movq %r14, %rdi
callq 0x2040
xorl %r12d, %r12d
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
callq 0x2170
movq %rbx, %rdi
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x2a82
movq %rax, %r14
testq %rax, %rax
je 0x567a
movl 0xd8(%rbx), %r12d
xorl %ebp, %ebp
movl %r12d, %r15d
bswapl %r12d
movq 0x18(%rsp), %rax
movl %r12d, 0x1a(%rax)
movl 0x6c(%rbx), %edi
movq 0xd0(%rbx), %rsi
addq $0x1e, %r15
movq %r15, %rdx
callq 0x325e
cltq
cmpq %r15, %rax
je 0x56d0
movq 0xe8(%rbx), %r15
callq 0x2060
movl (%rax), %edi
callq 0x2450
movq %r15, %rdi
leaq 0x15c9(%rip), %rsi      # 0x6c8c
movq %rax, %rdx
xorl %eax, %eax
callq 0x34b1
pushq $0x1
popq %rbp
testq %r14, %r14
pushq $0x10
popq %r15
jne 0x5471
cmpl $0x0, 0x1a4(%rbx)
je 0x5471
movl 0x2c(%rbx), %eax
movq 0x38(%rbx), %rcx
decq %rcx
imulq %rax, %rcx
movl 0x30(%rbx), %edx
addq %rcx, %rdx
movq 0x1b0(%rbx), %rax
movq (%rbx), %rsi
movq %rbx, %rdi
callq *0x10(%rax)
testq %rax, %rax
jns 0x5471
movq 0xe8(%rbx), %r14
callq 0x2060
movl (%rax), %edi
callq 0x2450
movq %r14, %rdi
leaq 0x157b(%rip), %rsi      # 0x6caf
movq %rax, %rdx
xorl %eax, %eax
callq 0x34b1
cmpl $0x0, 0x1a0(%rbx)
je 0x53ba
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0x53ba
movq (%rbx), %rdi
callq 0x2310
jmp 0x53ba
cmpl $0x2, 0x5c(%rbx)
jl 0x53ba
movq 0xe8(%rbx), %rdi
leaq 0x14e2(%rip), %rsi      # 0x6c5f
xorl %eax, %eax
callq 0x34b1
jmp 0x53ba
xorl %edi, %edi
callq 0x22d0