// File: brianbbsu[P]TCP-Ping/src/client.cpp
// Function: finalize(int)
void finalize(int sig){
    for(target &t:targets){
        if(t.ping_send == 0)continue;
        std::cout<<"\n--- " + t.to_string(0) + " (" + t.ip + ") statistics ---"<<std::endl;
        std::cout<< t.ping_send << " pings sent, " << t.pong_recv << " pongs received, " << std::fixed 
            << std::setprecision(2) << (t.ping_send - t.pong_recv) / double(t.ping_send) * 100 << "% ping loss" <<std::endl;
        if(t.pong_recv > 0)std::cout<< "RTT average = " << std::fixed << std::setprecision(2) << t.rtt_tt / t.pong_recv << " msec" << std::endl;
    }
    exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movl %edi, -0x4(%rbp)
leaq 0x2414b(%rip), %rax     # 0x2d570
movq %rax, -0x10(%rbp)
leaq 0x24140(%rip), %rdi     # 0x2d570
callq 0xac30
movq %rax, -0x18(%rbp)
leaq 0x24130(%rip), %rdi     # 0x2d570
callq 0xac60
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xac90
testb $0x1, %al
jne 0x945f
jmp 0x976d
leaq -0x18(%rbp), %rdi
callq 0xacd0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, 0x48(%rax)
jne 0x947b
jmp 0x975f
movq -0x28(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
xorl %edx, %edx
callq 0xa7e0
movq -0xe8(%rbp), %rdx
leaq 0x14ddd(%rip), %rsi     # 0x1e27f
leaq -0xa8(%rbp), %rdi
callq 0xa690
jmp 0x94b0
leaq 0x14c31(%rip), %rdx     # 0x1e0e8
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xa4a0
jmp 0x94cc
movq -0x28(%rbp), %rdx
addq $0x28, %rdx
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xa640
jmp 0x94e6
leaq 0x14d98(%rip), %rdx     # 0x1e285
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xa4a0
jmp 0x94fc
movq 0x23aad(%rip), %rdi     # 0x2cfb0
leaq -0x48(%rbp), %rsi
callq 0x73e0
movq %rax, -0xf0(%rbp)
jmp 0x9515
movq -0xf0(%rbp), %rdi
movq 0x23a45(%rip), %rsi     # 0x2cf68
callq 0x7490
jmp 0x952a
leaq -0x48(%rbp), %rdi
callq 0x78b8
leaq -0x68(%rbp), %rdi
callq 0x78b8
leaq -0x88(%rbp), %rdi
callq 0x78b8
leaq -0xa8(%rbp), %rdi
callq 0x78b8
leaq -0xc8(%rbp), %rdi
callq 0x78b8
movq -0x28(%rbp), %rax
movl 0x48(%rax), %esi
movq 0x23a42(%rip), %rdi     # 0x2cfb0
callq 0x7780
movq %rax, %rdi
leaq 0x14d19(%rip), %rsi     # 0x1e296
callq 0x7420
movq %rax, %rdi
movq -0x28(%rbp), %rax
movl 0x4c(%rax), %esi
callq 0x7780
movq %rax, %rdi
leaq 0x14d09(%rip), %rsi     # 0x1e2a4
callq 0x7420
movq %rax, %rdi
leaq 0x1746(%rip), %rsi      # 0xacf0
callq 0x7150
movq %rax, -0xf8(%rbp)
movl $0x2, %edi
callq 0xad20
movq -0xf8(%rbp), %rdi
movl %eax, -0xd8(%rbp)
movl -0xd8(%rbp), %esi
callq 0x76c0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movl 0x48(%rax), %eax
movq -0x28(%rbp), %rcx
subl 0x4c(%rcx), %eax
cvtsi2sd %eax, %xmm0
movq -0x28(%rbp), %rax
cvtsi2sdl 0x48(%rax), %xmm1
divsd %xmm1, %xmm0
movsd 0x14a0e(%rip), %xmm1    # 0x1e010
mulsd %xmm1, %xmm0
callq 0x7820
movq %rax, %rdi
leaq 0x14ca1(%rip), %rsi     # 0x1e2b6
callq 0x7420
movq %rax, %rdi
movq 0x23944(%rip), %rsi     # 0x2cf68
callq 0x7490
movq -0x28(%rbp), %rax
cmpl $0x0, 0x4c(%rax)
jle 0x975d
movq 0x23972(%rip), %rdi     # 0x2cfb0
leaq 0x14c7d(%rip), %rsi     # 0x1e2c2
callq 0x7420
movq %rax, %rdi
leaq 0x169c(%rip), %rsi      # 0xacf0
callq 0x7150
movq %rax, -0x100(%rbp)
movl $0x2, %edi
callq 0xad20
movq -0x100(%rbp), %rdi
movl %eax, -0xdc(%rbp)
movl -0xdc(%rbp), %esi
callq 0x76c0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movsd 0x50(%rax), %xmm0
movq -0x28(%rbp), %rax
cvtsi2sdl 0x4c(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x7820
movq %rax, %rdi
leaq 0x14ad6(%rip), %rsi     # 0x1e180
callq 0x7420
movq %rax, %rdi
movq 0x238af(%rip), %rsi     # 0x2cf68
callq 0x7490
jmp 0x975d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x974f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x9743
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x9737
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x972e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x78b8
leaq -0x68(%rbp), %rdi
callq 0x78b8
leaq -0x88(%rbp), %rdi
callq 0x78b8
leaq -0xa8(%rbp), %rdi
callq 0x78b8
leaq -0xc8(%rbp), %rdi
callq 0x78b8
jmp 0x9774
jmp 0x975f
leaq -0x18(%rbp), %rdi
callq 0xad40
jmp 0x9449
xorl %edi, %edi
callq 0x7530
movq -0xd0(%rbp), %rdi
callq 0x77a0