// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_receiver.c
// Function: each_round_transfer_init
static bool each_round_transfer_init(shoit_core_t *receiver)
{
    if(receiver->runing ==  false) return false;//CLOSE sig
    if (receiver->bucketSize % receiver->payloadSize == 0)                                                                           
    {                                                                                                                                
        receiver->totalNumberOfPackets = receiver->bucketSize/receiver->payloadSize;                                                 
        receiver->lastPayloadSize = receiver->payloadSize;                                                                           
    }                                                                                                                                
    else                                                                                                                             
    {                                                                                                                                
        receiver->totalNumberOfPackets = receiver->bucketSize/receiver->payloadSize + 1; /* the last packet is not full */           
        receiver->lastPayloadSize = receiver->bucketSize - receiver->payloadSize * (receiver->totalNumberOfPackets - 1);             
    }                                                                                                                                
                                                                                                                                     
    receiver->receivedNumberOfPackets = 0;                                                                                           
    receiver->remainNumberOfPackets = receiver->totalNumberOfPackets;                                                                
    receiver->sizeofErrorBitmap = receiver->totalNumberOfPackets/8 + 2;                                                              
    receiver->isFirstBlast = true;                                                                                                   
    /* Initialize the hash table */                                                                                                  
    for (uint64_t i=0; i<receiver->totalNumberOfPackets; i++)                                                                        
    {                                                                                                                                
        receiver->hashTable[i] = i;                                                                                                  
    }                                                                                                                                
    shoit_init_error_bitmap(receiver); 

    return true;
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1a8(%rax)
jne 0x75a5
movl $0x0, -0x4(%rbp)
jmp 0x76cc
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x2c(%rcx), %ecx
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0x75ee
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x2c(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x763c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x2c(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
addq $0x1, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x2c(%rcx), %ecx
movq -0x10(%rbp), %rdx
movq 0x38(%rdx), %rdx
subq $0x1, %rdx
imulq %rdx, %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rcx
shrq $0x3, %rcx
addq $0x2, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0xe0(%rax)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x76bc
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x7689
movq -0x10(%rbp), %rdi
callq 0x2c20
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)