// File: /workspace/github_c_makefile_star2_O0/orestonce[P]udphole/clientA.c
// Function: server
void server()
{
    int fd ;
    struct sockaddr_in localAddress ;

    fd = socket(AF_INET, SOCK_DGRAM, 0);
    assert(fd >= 0 );

    localAddress.sin_port = htons(SERVER_PORT);
    localAddress.sin_addr.s_addr = INADDR_ANY;
    localAddress.sin_family = AF_INET;

    int ret ;

    ret = bind(fd, (struct sockaddr *)&localAddress, sizeof(localAddress) );
    assert(ret == 0);

    while ( 1 )
    {
        struct sockaddr_in remoteAddr;
        socklen_t remoteAddrLen = sizeof(struct sockaddr_in);
        char bufferRecive[BUFSIZ]="";
        char bufferSend[BUFSIZ]="";

        ssize_t sz= recvfrom(fd, bufferRecive, BUFSIZ, 0,
                 (struct sockaddr *)&remoteAddr,&remoteAddrLen);
        assert(sz > 0);
        const char *ip = inet_ntoa(remoteAddr.sin_addr);
        sprintf(bufferSend, "%s %d\n", ip, ntohs(remoteAddr.sin_port));
        sz = recvfrom(fd, bufferRecive, BUFSIZ, 0,
                 (struct sockaddr *)&remoteAddr,&remoteAddrLen);
        assert(sz >0);
        sendto(fd, bufferSend, BUFSIZ, 0,
               (const struct sockaddr *)&remoteAddr,remoteAddrLen);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4050, %rsp           # imm = 0x4050
movl $0x2, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x1130
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x1284
jmp 0x12a3
leaq 0xd79(%rip), %rdi       # 0x2004
leaq 0xd7a(%rip), %rsi       # 0x200c
movl $0xf, %edx
leaq 0xd78(%rip), %rcx       # 0x2016
callq 0x1060
movl $0x6f7, %edi            # imm = 0x6F7
callq 0x1050
movw %ax, -0x12(%rbp)
movl $0x0, -0x10(%rbp)
movw $0x2, -0x14(%rbp)
movl -0x4(%rbp), %edi
leaq -0x14(%rbp), %rsi
movl $0x10, %edx
callq 0x1100
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x12da
jmp 0x12f9
leaq 0xd43(%rip), %rdi       # 0x2024
leaq 0xd24(%rip), %rsi       # 0x200c
movl $0x18, %edx
leaq 0xd22(%rip), %rcx       # 0x2016
callq 0x1060
jmp 0x12fb
movl $0x10, -0x2c(%rbp)
leaq -0x2030(%rbp), %rdi
xorl %esi, %esi
movl $0x2000, %edx           # imm = 0x2000
callq 0x1070
leaq -0x4030(%rbp), %rdi
xorl %esi, %esi
movl $0x2000, %edx           # imm = 0x2000
callq 0x1070
movl -0x4(%rbp), %edi
leaq -0x2030(%rbp), %rsi
movl $0x2000, %edx           # imm = 0x2000
xorl %ecx, %ecx
leaq -0x28(%rbp), %r8
leaq -0x2c(%rbp), %r9
callq 0x10e0
movq %rax, -0x4038(%rbp)
cmpq $0x0, -0x4038(%rbp)
jle 0x1359
jmp 0x1378
leaq 0xccd(%rip), %rdi       # 0x202d
leaq 0xca5(%rip), %rsi       # 0x200c
movl $0x23, %edx
leaq 0xca3(%rip), %rcx       # 0x2016
callq 0x1060
movl -0x24(%rbp), %edi
callq 0x1040
movq %rax, -0x4040(%rbp)
leaq -0x4030(%rbp), %rax
movq %rax, -0x4050(%rbp)
movq -0x4040(%rbp), %rax
movq %rax, -0x4048(%rbp)
movzwl -0x26(%rbp), %edi
callq 0x10f0
movq -0x4050(%rbp), %rdi
movq -0x4048(%rbp), %rdx
movzwl %ax, %ecx
leaq 0xc70(%rip), %rsi       # 0x2034
movb $0x0, %al
callq 0x1110
movl -0x4(%rbp), %edi
leaq -0x2030(%rbp), %rsi
movl $0x2000, %edx           # imm = 0x2000
xorl %ecx, %ecx
leaq -0x28(%rbp), %r8
leaq -0x2c(%rbp), %r9
callq 0x10e0
movq %rax, -0x4038(%rbp)
cmpq $0x0, -0x4038(%rbp)
jle 0x13fc
jmp 0x141b
leaq 0xc38(%rip), %rdi       # 0x203b
leaq 0xc02(%rip), %rsi       # 0x200c
movl $0x28, %edx
leaq 0xc00(%rip), %rcx       # 0x2016
callq 0x1060
movl -0x4(%rbp), %edi
leaq -0x4030(%rbp), %rsi
movl -0x2c(%rbp), %r9d
movl $0x2000, %edx           # imm = 0x2000
xorl %ecx, %ecx
leaq -0x28(%rbp), %r8
callq 0x1080
jmp 0x12fb
nop