// File: /workspace/github_c_makefile_star2_O1/pencode-lab[P]Shoit/shoit_sender.c
// Function: transfer_thread_run
static void transfer_thread_run(void *argv)
{
    shoit_core_t *sender = (shoit_core_t *)argv; 
    int done = 0;

    if(sender->runing){
        if(!connect_udp_server(sender)){
            SHOIT_LOG("connect udp server failed.\n");
            return;
        }
    }
    sem_wait(&sender->dataSem); /*be wakeup:CONNECT signal*/

    /*
    *here,you can send many bucket data in many round
    *if sendfile and mmap ,only one bucket
    */
    while(!done && sender->runing){
        if(transfer_data_round_circle(sender) == false) break; /*no more*/
    }


    /*send notice to remote:i will close*/
    echo_to_receiver_on_tcp(sender,CLOSE);
    sender->runing=false;

    pthread_exit(0);
   
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x1a8(%rdi)
je 0x441c
cmpl $0x2, 0x5c(%rbx)
jl 0x43d5
movq 0xe8(%rbx), %rdi
movl 0x98(%rbx), %r9d
movl 0xa0(%rbx), %ecx
leaq 0x78(%rbx), %r8
leaq 0x23bc(%rip), %rsi      # 0x6783
leaq 0x23df(%rip), %rdx      # 0x67ad
xorl %eax, %eax
callq 0x3741
leaq 0xa4(%rbx), %rdi
movl 0x98(%rbx), %ecx
movl 0xa0(%rbx), %esi
leaq 0x78(%rbx), %rdx
callq 0x2fee
movl %eax, 0x68(%rbx)
cmpl $-0x1, %eax
jne 0x441c
movq 0xe8(%rbx), %rdi
leaq 0x2360(%rip), %rsi      # 0x6767
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3741
leaq 0x120(%rbx), %rdi
movq %rdi, 0x8(%rsp)
callq 0x2080
leaq 0xa4(%rbx), %rax
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x1a8(%rbx)
je 0x48c0
cmpl $0x2, 0x5c(%rbx)
jl 0x4468
movq 0xe8(%rbx), %rdi
leaq 0x2366(%rip), %rsi      # 0x67c0
leaq 0x236a(%rip), %rdx      # 0x67cb
xorl %eax, %eax
callq 0x3741
cmpl $0x0, 0x1a0(%rbx)
je 0x44d5
movq 0x18(%rbx), %rax
movb $0x1, %bpl
testq %rax, %rax
je 0x4559
movq 0x8(%rbx), %rcx
cmpq %rax, %rcx
movq %rax, %r14
cmovbq %rcx, %r14
movq 0x10(%rbx), %r9
subq %rax, %r9
movq %r9, %rax
xorl %edx, %edx
divq %rcx
subq %rdx, %r9
movl 0xf8(%rbx), %r8d
xorl %edi, %edi
movq %r14, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x20f0
movq %rax, (%rbx)
testq %rax, %rax
je 0x450f
movq %r14, 0x8(%rbx)
movq %r14, 0x20(%rbx)
subq %r14, 0x18(%rbx)
jmp 0x4557
movl 0xf8(%rbx), %edi
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
callq 0x344f
testq %rax, %rax
je 0x4538
cmpq 0x8(%rbx), %rax
je 0x4557
movq %rax, 0x8(%rbx)
movl 0x2c(%rbx), %ecx
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
je 0x453d
incq %rax
movq %rax, 0x38(%rbx)
movl %edx, 0x30(%rbx)
jmp 0x4544
movq 0xe8(%rbx), %r14
callq 0x2060
movl (%rax), %edi
callq 0x2450
movq %r14, %rdi
leaq 0x236d(%rip), %rsi      # 0x6899
movq %rax, %rdx
xorl %eax, %eax
callq 0x3741
jmp 0x4559
movb $0x1, %bpl
jmp 0x4559
movq %rax, 0x38(%rbx)
movl %ecx, 0x30(%rbx)
movq 0x38(%rbx), %rax
shrq $0x3, %rax
addq $0x2, %rax
movq %rax, 0xd8(%rbx)
xorl %ebp, %ebp
movl %ebp, 0x4(%rsp)
testb %bpl, %bpl
je 0x4586
cmpl $0x2, 0x5c(%rbx)
jl 0x48b5
movq 0xe8(%rbx), %rdi
leaq 0x226c(%rip), %rsi      # 0x67e6
xorl %eax, %eax
callq 0x3741
jmp 0x48b5
movq %rbx, %rdi
callq 0x3bb8
movq %rbx, %rdi
movl $0x2, %esi
callq 0x4c81
movq 0x8(%rsp), %rdi
callq 0x2080
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
callq 0x2170
cmpl $0x0, 0x1a8(%rbx)
je 0x48b5
cmpl $0x2, 0x5c(%rbx)
jl 0x45d9
movq 0xe8(%rbx), %rdi
leaq 0x2230(%rip), %rsi      # 0x6802
xorl %eax, %eax
callq 0x3741
movl 0x34(%rbx), %edi
callq 0x22e0
movq %rax, %r14
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
callq 0x2170
movq %r14, %rdi
movq 0x38(%rsp), %r15
movq 0x40(%rsp), %r14
movq %rdi, %rax
addq $0xc, %rax
movq %rax, 0x28(%rsp)
xorl %ebp, %ebp
movq %rdi, 0x30(%rsp)
cmpl $0x0, 0x1a8(%rbx)
je 0x4778
movl 0x34(%rbx), %edx
xorl %esi, %esi
movq %rdi, %r12
callq 0x2190
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x2170
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %r13
subq %r15, %rax
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
subq %r14, %r13
addq %rax, %r13
movl 0x58(%rbx), %eax
imulq %rbp, %rax
cmpq %rax, %r13
jae 0x46b9
leaq 0x10(%rsp), %r12
xorl %eax, %eax
callq 0x3539
movq %rax, %rsi
movl 0x58(%rbx), %ecx
shll $0x3, %ecx
movq %r13, %rax
xorl %edx, %edx
divq %rcx
addq %rax, %rsi
movq %rbx, %rdi
callq 0x2b18
movq %r12, %rdi
xorl %esi, %esi
callq 0x2170
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %r13
subq %r15, %rax
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
subq %r14, %r13
addq %rax, %r13
movl 0x58(%rbx), %eax
imulq %rbp, %rax
cmpq %rax, %r13
jb 0x4661
jmp 0x4769
movq 0xc8(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq %rax, (%r12)
movq 0x38(%rbx), %rcx
decq %rcx
xorl %edx, %edx
cmpq %rcx, %rax
setae %dl
movslq 0x2c(%rbx,%rdx,4), %r13
movl %r13d, %ecx
bswapl %ecx
movl %ecx, 0x8(%r12)
movl 0x2c(%rbx), %esi
imulq %rax, %rsi
addq (%rbx), %rsi
movq 0x28(%rsp), %rdi
movq %r13, %rdx
callq 0x2280
movl 0x68(%rbx), %edi
addq $0xc, %r13
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movq 0x20(%rsp), %r8
movl $0x10, %r9d
callq 0x21a0
testq %rax, %rax
js 0x4738
incq 0x50(%rbx)
addq %r13, 0x4b9c(%rip)      # 0x92c8
incq %rbp
cmpq 0x40(%rbx), %rbp
setb %al
jmp 0x476b
movq 0xe8(%rbx), %r13
callq 0x2060
movl (%rax), %edi
callq 0x2450
movq %r13, %rdi
leaq 0x2155(%rip), %rsi      # 0x68aa
movq %rax, %rdx
xorl %eax, %eax
callq 0x3741
movl $0x0, 0x1a8(%rbx)
movb $0x1, %al
testb %al, %al
movq 0x30(%rsp), %rdi
jne 0x4610
callq 0x2040
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0x2170
cmpl $0x2, 0x5c(%rbx)
jl 0x47a7
movq 0xe8(%rbx), %rdi
movl 0x6c(%rbx), %edx
leaq 0x2076(%rip), %rsi      # 0x6816
xorl %eax, %eax
callq 0x3741
movq %rbx, %rdi
movl $0x4, %esi
callq 0x4c81
testl %eax, %eax
jne 0x47d0
movq 0xe8(%rbx), %rdi
movl 0x6c(%rbx), %edx
leaq 0x206e(%rip), %rsi      # 0x6837
xorl %eax, %eax
callq 0x3741
movq 0x8(%rsp), %rdi
callq 0x2080
movq 0xd0(%rbx), %rax
movb 0x1e(%rax), %bpl
cmpb $0x1, %bpl
jne 0x4815
movq $0x0, 0x40(%rbx)
movq 0x20(%rbx), %rsi
movq 0x38(%rbx), %rax
movq %rax, 0x50(%rbx)
testq %rsi, %rsi
je 0x48ab
movq (%rbx), %rdi
callq 0x2310
jmp 0x48ab
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2c97
movq %rax, 0x40(%rbx)
movq %rax, %xmm1
movq 0x1d1d(%rip), %xmm2     # 0x6550
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x1d21(%rip), %xmm3     # 0x6560
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq 0x38(%rbx), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movl 0x58(%rbx), %eax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
movsd 0x1dc1(%rip), %xmm2     # 0x6640
subsd %xmm0, %xmm2
addsd 0x1dbd(%rip), %xmm2     # 0x6648
divsd %xmm2, %xmm1
cvttsd2si %xmm1, %edx
movl %edx, 0x58(%rbx)
movq 0xe8(%rbx), %rdi
leaq 0x1fba(%rip), %rsi      # 0x685e
movb $0x1, %al
callq 0x3741
cmpb $0x1, %bpl
jne 0x45b1
cmpb $0x0, 0x4(%rsp)
je 0x4439
movq %rbx, %rdi
movl $0x7, %esi
callq 0x4c81
movl $0x0, 0x1a8(%rbx)
xorl %edi, %edi
callq 0x22d0