#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
};
struct sockaddr {
  int dummy;
};
struct iphdr {
  int ihl;
  int /*<<< orphan*/ check;
  scalar_t__ protocol;
  scalar_t__ ttl;
  scalar_t__ frag_off;
  int /*<<< orphan*/ id;
  int /*<<< orphan*/ tot_len;
  scalar_t__ tos;
  scalar_t__ version;
  int /*<<< orphan*/ daddr;
  int /*<<< orphan*/ saddr;
};
struct ethhdr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_PACKET;
int /*<<< orphan*/ ETH_P_ALL;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
char *inet_ntoa(TYPE_1__);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int /*<<< orphan*/ sleep(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  struct sockaddr_in s_addr, d_addr;
  int rsfd, n, len;
  char buf[65536];
  char addr[32];
  rsfd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
  if (rsfd < 0) {
    perror("socket() ");
    exit(1);
  }
  len = sizeof s_addr;
  struct iphdr *iph;
  unsigned short iphdrlen;
  while (1) {
    n = recvfrom(rsfd, buf, 65536, 0, (struct sockaddr *)&s_addr, &len);
    if (n < 0) {
      perror("recvfrom() ");
    }
    iph = (struct iphdr *)(buf + sizeof(struct ethhdr));
    memset((char *)&s_addr, 0, sizeof s_addr);
    memset((char *)&d_addr, 0, sizeof d_addr);
    s_addr.sin_addr.s_addr = iph->saddr;
    d_addr.sin_addr.s_addr = iph->daddr;
    iphdrlen = iph->ihl * 4;
    printf("------------- IP Header ------------\n");
    printf("|%4d|%4d|%8d|%16d|\n", (unsigned int)iph->version,
           (unsigned int)iph->ihl, (unsigned int)iph->tos, ntohs(iph->tot_len));
    printf("------------------------------------\n");
    printf("|%13d|R|D|M|%13d|\n", ntohs(iph->id), (unsigned int)iph->frag_off);
    printf("------------------------------------\n");
    printf("|%8d|%8d|%16d|\n", (unsigned int)iph->ttl,
           (unsigned int)iph->protocol, ntohs(iph->check));
    printf("------------------------------------\n");
    printf("%s\n", inet_ntoa(s_addr.sin_addr));
    printf("------------------------------------\n");
    printf("%s\n", inet_ntoa(d_addr.sin_addr));
    printf("------------------------------------\n");
    sleep(2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10080,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e10(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10064(%rbp)
mov    0x2e19(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10060(%rbp)
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
call   1040 <htons@plt>
mov    -0x10064(%rbp),%edi
mov    -0x10060(%rbp),%esi
mov    %eax,%edx
call   10c0 <socket@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    121b <main+0x7b>
lea    0xdf4(%rip),%rdi
call   1090 <perror@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
movl   $0x4,-0x2c(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x10030(%rbp),%rsi
lea    -0x18(%rbp),%r8
mov    $0x10000,%edx
xor    %ecx,%ecx
lea    -0x2c(%rbp),%r9
call   1070 <recvfrom@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jge    1259 <main+0xb9>
lea    0xdb6(%rip),%rdi
call   1090 <perror@plt>
lea    -0x10030(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10058(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
mov    -0x10058(%rbp),%rax
mov    0x3c(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10058(%rbp),%rax
mov    0x38(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10058(%rbp),%rax
mov    (%rax),%eax
shl    $0x2,%eax
mov    %ax,-0x1005a(%rbp)
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10058(%rbp),%rax
mov    0x30(%rax),%rax
mov    %eax,-0x10078(%rbp)
mov    -0x10058(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10074(%rbp)
mov    -0x10058(%rbp),%rax
mov    0x28(%rax),%rax
mov    %eax,-0x10070(%rbp)
mov    -0x10058(%rbp),%rax
mov    0x24(%rax),%edi
call   1080 <ntohs@plt>
mov    -0x10078(%rbp),%esi
mov    -0x10074(%rbp),%edx
mov    -0x10070(%rbp),%ecx
mov    %eax,%r8d
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd20(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10058(%rbp),%rax
mov    0x20(%rax),%edi
call   1080 <ntohs@plt>
mov    %eax,%esi
mov    -0x10058(%rbp),%rax
mov    0x18(%rax),%rax
mov    %eax,%edx
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10058(%rbp),%rax
mov    0x10(%rax),%rax
mov    %eax,-0x1006c(%rbp)
mov    -0x10058(%rbp),%rax
mov    0x8(%rax),%rax
mov    %eax,-0x10068(%rbp)
mov    -0x10058(%rbp),%rax
mov    0x4(%rax),%edi
call   1080 <ntohs@plt>
mov    -0x1006c(%rbp),%esi
mov    -0x10068(%rbp),%edx
mov    %eax,%ecx
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc8b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rsi
lea    0xcbb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rsi
lea    0xc94(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x2,%edi
call   10b0 <sleep@plt>
jmp    1222 <main+0x82>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10028,%rsp
mov    0x2e08(%rip),%rax
mov    (%rax),%ebx
mov    0x2e17(%rip),%rax
mov    (%rax),%ebp
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
call   1050 <htons@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   10d0 <socket@plt>
mov    %eax,0x18(%rsp)
test   %eax,%eax
js     1360 <main+0x1b0>
movl   $0x4,0x1c(%rsp)
lea    0x10(%rsp),%rbx
lea    0xe66(%rip),%r15
jmp    132a <main+0x17a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
mov    0x5c(%rsp),%eax
mov    0x60(%rsp),%ecx
mov    %ecx,0x10(%rsp)
mov    %eax,0x8(%rsp)
lea    0xdf6(%rip),%rdi
call   1030 <puts@plt>
mov    0x54(%rsp),%r14d
mov    0x4c(%rsp),%r13d
mov    0x24(%rsp),%r12d
mov    0x48(%rsp),%edi
call   1090 <ntohs@plt>
lea    0xd9b(%rip),%rdi
mov    %r14d,%esi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    0x44(%rsp),%edi
call   1090 <ntohs@plt>
mov    0x3c(%rsp),%edx
lea    0xd80(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    0x34(%rsp),%ebp
mov    0x28(%rsp),%edi
mov    %rbx,%r14
mov    0x2c(%rsp),%ebx
call   1090 <ntohs@plt>
lea    0xd67(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r14,%rbx
mov    %eax,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   10c0 <sleep@plt>
mov    0x18(%rsp),%edi
lea    0x20(%rsp),%rsi
mov    $0x10000,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
lea    0x1c(%rsp),%r9
call   1080 <recvfrom@plt>
test   %eax,%eax
jns    1220 <main+0x70>
lea    0xcb4(%rip),%rdi
call   10a0 <perror@plt>
jmp    1220 <main+0x70>
lea    0xc99(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
%struct.iphdr = type { i32, i32, i64, i64, i64, i32, i32, i64, i64, i32, i32 }
%struct.sockaddr = type { i32 }
@AF_PACKET = global i32 0
@SOCK_RAW = global i32 0
@ETH_P_ALL = global i32 0
@.str = [10 x i8] c"socket() \00"
@.str.1 = [12 x i8] c"recvfrom() \00"
@.str.2 = [38 x i8] c"------------- IP Header ------------\0A\00"
@.str.3 = [20 x i8] c"|%4d|%4d|%8d|%16d|\0A\00"
@.str.4 = [38 x i8] c"------------------------------------\0A\00"
@.str.5 = [19 x i8] c"|%13d|R|D|M|%13d|\0A\00"
@.str.6 = [16 x i8] c"|%8d|%8d|%16d|\0A\00"
@.str.7 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_in
%7 = alloca %struct.sockaddr_in
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [65536 x i8]
%12 = alloca [32 x i8]
%13 = alloca %struct.iphdr*
%14 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* @AF_PACKET
%16 = load i32, i32* @SOCK_RAW
%17 = load i32, i32* @ETH_P_ALL
%18 = call i32 @htons(i32 %17)
%19 = call i32 @socket(i32 %15, i32 %16, i32 %18)
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %2
%23 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %2
store i32 4, i32* %10
br label %26
26: ; preds = %25, %35
%27 = load i32, i32* %8
%28 = getelementptr inbounds [65536 x i8], [65536 x i8]* %11, i64 0, i64 0
%29 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%30 = call i32 @recvfrom(i32 %27, i8* %28, i32 65536, i32 0, %struct.sockaddr* %29, i32* %10)
store i32 %30, i32* %9
%31 = load i32, i32* %9
%32 = icmp slt i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %26
%34 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %33, %26
%36 = getelementptr inbounds [65536 x i8], [65536 x i8]* %11, i64 0, i64 0
%37 = getelementptr inbounds i8, i8* %36, i64 4
%38 = bitcast i8* %37 to %struct.iphdr*
store %struct.iphdr* %38, %struct.iphdr** %13
%39 = bitcast %struct.sockaddr_in* %6 to i8*
%40 = call i32 @memset(i8* %39, i32 0, i32 4)
%41 = bitcast %struct.sockaddr_in* %7 to i8*
%42 = call i32 @memset(i8* %41, i32 0, i32 4)
%43 = load %struct.iphdr*, %struct.iphdr** %13
%44 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %43, i32 0, i32 10
%45 = load i32, i32* %44
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%47 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %46, i32 0, i32 0
store i32 %45, i32* %47
%48 = load %struct.iphdr*, %struct.iphdr** %13
%49 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %48, i32 0, i32 9
%50 = load i32, i32* %49
%51 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%52 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %51, i32 0, i32 0
store i32 %50, i32* %52
%53 = load %struct.iphdr*, %struct.iphdr** %13
%54 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %53, i32 0, i32 0
%55 = load i32, i32* %54
%56 = mul nsw i32 %55, 4
%57 = trunc i32 %56 to i16
store i16 %57, i16* %14
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%59 = load %struct.iphdr*, %struct.iphdr** %13
%60 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %59, i32 0, i32 8
%61 = load i64, i64* %60
%62 = trunc i64 %61 to i32
%63 = load %struct.iphdr*, %struct.iphdr** %13
%64 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %63, i32 0, i32 0
%65 = load i32, i32* %64
%66 = load %struct.iphdr*, %struct.iphdr** %13
%67 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %66, i32 0, i32 7
%68 = load i64, i64* %67
%69 = trunc i64 %68 to i32
%70 = load %struct.iphdr*, %struct.iphdr** %13
%71 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %70, i32 0, i32 6
%72 = load i32, i32* %71
%73 = call i32 @ntohs(i32 %72)
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %62, i32 %65, i32 %69, i32 %73)
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%76 = load %struct.iphdr*, %struct.iphdr** %13
%77 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %76, i32 0, i32 5
%78 = load i32, i32* %77
%79 = call i32 @ntohs(i32 %78)
%80 = load %struct.iphdr*, %struct.iphdr** %13
%81 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %80, i32 0, i32 4
%82 = load i64, i64* %81
%83 = trunc i64 %82 to i32
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %79, i32 %83)
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%86 = load %struct.iphdr*, %struct.iphdr** %13
%87 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %86, i32 0, i32 3
%88 = load i64, i64* %87
%89 = trunc i64 %88 to i32
%90 = load %struct.iphdr*, %struct.iphdr** %13
%91 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %90, i32 0, i32 2
%92 = load i64, i64* %91
%93 = trunc i64 %92 to i32
%94 = load %struct.iphdr*, %struct.iphdr** %13
%95 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %94, i32 0, i32 1
%96 = load i32, i32* %95
%97 = call i32 @ntohs(i32 %96)
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %89, i32 %93, i32 %97)
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%100 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%101 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %100, i32 0, i32 0
%102 = load i32, i32* %101
%103 = call i8* @inet_ntoa(i32 %102)
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %103)
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%106 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%107 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %106, i32 0, i32 0
%108 = load i32, i32* %107
%109 = call i8* @inet_ntoa(i32 %108)
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %109)
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%112 = call i32 @sleep(i32 2)
br label %26
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_PACKET = global i32 0
@SOCK_RAW = global i32 0
@ETH_P_ALL = global i32 0
@.str = [10 x i8] c"socket() \00"
@.str.1 = [12 x i8] c"recvfrom() \00"
@.str.3 = [20 x i8] c"|%4d|%4d|%8d|%16d|\0A\00"
@.str.5 = [19 x i8] c"|%13d|R|D|M|%13d|\0A\00"
@.str.6 = [16 x i8] c"|%8d|%8d|%16d|\0A\00"
@str = [37 x i8] c"------------- IP Header ------------\00"
@str.12 = [37 x i8] c"------------------------------------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [65536 x i8]
%7 = bitcast %struct.sockaddr_in* %3 to i8*
%8 = bitcast %struct.sockaddr_in* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%11 = load i32, i32* @AF_PACKET
%12 = load i32, i32* @SOCK_RAW
%13 = load i32, i32* @ETH_P_ALL
%14 = tail call i32 @htons(i32 %13)
%15 = tail call i32 @socket(i32 %11, i32 %12, i32 %14)
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %2
store i32 4, i32* %5
%21 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%22 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 4
%23 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 64
%24 = bitcast i8* %23 to i32*
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0, i32 0
%26 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 60
%27 = bitcast i8* %26 to i32*
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0, i32 0
%29 = bitcast i8* %22 to i32*
%30 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 52
%31 = bitcast i8* %30 to i64*
%32 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 44
%33 = bitcast i8* %32 to i64*
%34 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 40
%35 = bitcast i8* %34 to i32*
%36 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 36
%37 = bitcast i8* %36 to i32*
%38 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 28
%39 = bitcast i8* %38 to i64*
%40 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 20
%41 = bitcast i8* %40 to i64*
%42 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 12
%43 = bitcast i8* %42 to i64*
%44 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 8
%45 = bitcast i8* %44 to i32*
br label %46
46: ; preds = %51, %20
%47 = call i32 @recvfrom(i32 %15, i8* %10, i32 65536, i32 0, %struct.sockaddr* %21, i32* %5)
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %51
51: ; preds = %49, %46
%52 = call i32 @memset(i8* %7, i32 0, i32 4)
%53 = call i32 @memset(i8* %8, i32 0, i32 4)
%54 = load i32, i32* %24
store i32 %54, i32* %25
%55 = load i32, i32* %27
store i32 %55, i32* %28
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%57 = load i64, i64* %31
%58 = trunc i64 %57 to i32
%59 = load i32, i32* %29
%60 = load i64, i64* %33
%61 = trunc i64 %60 to i32
%62 = load i32, i32* %35
%63 = call i32 @ntohs(i32 %62)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %58, i32 %59, i32 %61, i32 %63)
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.12, i64 0, i64 0))
%66 = load i32, i32* %37
%67 = call i32 @ntohs(i32 %66)
%68 = load i64, i64* %39
%69 = trunc i64 %68 to i32
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %67, i32 %69)
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.12, i64 0, i64 0))
%72 = load i64, i64* %41
%73 = trunc i64 %72 to i32
%74 = load i64, i64* %43
%75 = trunc i64 %74 to i32
%76 = load i32, i32* %45
%77 = call i32 @ntohs(i32 %76)
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %73, i32 %75, i32 %77)
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.12, i64 0, i64 0))
%80 = load i32, i32* %25
%81 = call i8* @inet_ntoa(i32 %80)
%82 = call i32 @puts(i8* dereferenceable(1) %81)
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.12, i64 0, i64 0))
%84 = load i32, i32* %28
%85 = call i8* @inet_ntoa(i32 %84)
%86 = call i32 @puts(i8* dereferenceable(1) %85)
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.12, i64 0, i64 0))
%88 = call i32 @sleep(i32 2)
br label %46
}