#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 */

/* Type definitions */
struct msghdr {
  int msg_iovlen;
  char *msg_control;
  int msg_controllen;
  struct iovec *msg_iov;
  scalar_t__ msg_namelen;
  int /*<<< orphan*/ *msg_name;
};
struct iphdr {
  int ihl;
};
struct ip {
  int ip_hl;
  int /*<<< orphan*/ ip_src;
};
struct iovec {
  char *iov_base;
  int iov_len;
};
struct icmphdr {
  int dummy;
};
struct icmp {
  int icmp_id;
  scalar_t__ icmp_code;
  int /*<<< orphan*/ icmp_type;
};
struct addrinfo {
  char *ai_canonname;
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
};
typedef int /*<<< orphan*/ icmph;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ ICMP_ECHO;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getaddrinfo(char *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, struct addrinfo **);
char *inet_ntoa(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ sendto(int, char *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                  int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int);
int main(int argc, char *argv[]) {
  char sendbuf[1500], recvbuf[1500], controlbuf[1500];
  struct icmp *icmp;
  struct ip *ip;
  int sockfd;
  int packet_len, recv_len, ip_len, data_len;
  struct addrinfo *ai;
  struct iovec iov;
  struct msghdr msg;
  struct iphdr *iph = (struct iphdr *)sendbuf;
  unsigned short iphdrlen = iph->ihl * 4;
  struct icmphdr *icmph = (struct icmphdr *)(sendbuf + iphdrlen);
  sendbuf[iphdrlen + sizeof(icmph) + 4] = 'H';
  sendbuf[iphdrlen + sizeof(icmph) + 5] = 'O';
  sendbuf[iphdrlen + sizeof(icmph) + 6] = 'L';
  sendbuf[iphdrlen + sizeof(icmph) + 7] = 'A';
  sendbuf[iphdrlen + sizeof(icmph) + 8] = 'M';
  sendbuf[iphdrlen + sizeof(icmph) + 9] = 'U';
  sendbuf[iphdrlen + sizeof(icmph) + 10] = 'N';
  sendbuf[iphdrlen + sizeof(icmph) + 11] = 'D';
  sendbuf[iphdrlen + sizeof(icmph) + 12] = 'O';
  getaddrinfo(argv[1], NULL, NULL, &ai);
  printf("Dest: %s\n", ai->ai_canonname ? ai->ai_canonname : argv[1]);
  if ((sockfd = socket(AF_INET, SOCK_RAW, 1)) < 0) {
    perror("socket");
    exit(1);
  }
  icmp = (struct icmp *)sendbuf;
  icmp->icmp_type = ICMP_ECHO;
  icmp->icmp_code = 0;
  icmp->icmp_id = 42;
  packet_len = sizeof(struct icmp);
  if (sendto(sockfd, sendbuf, packet_len, 0, ai->ai_addr, ai->ai_addrlen) < 0) {
    perror("sendto");
    exit(1);
  }
  iov.iov_base = recvbuf;
  iov.iov_len = 1500;
  msg.msg_name = NULL;
  msg.msg_namelen = 0;
  msg.msg_iov = &iov;
  msg.msg_iovlen = 1;
  msg.msg_control = controlbuf;
  msg.msg_controllen = 1500;
  printf("%d\n", recv_len);
  ip = (struct ip *)recvbuf;
  ip_len = ip->ip_hl << 2;
  icmp = (struct icmp *)(recvbuf + ip_len);
  data_len = (recv_len - ip_len);
  printf("%d bytes from %s\n", data_len, inet_ntoa(ip->ip_src));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1250,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x5f0(%rbp),%rax
mov    %rax,-0x1228(%rbp)
mov    -0x1228(%rbp),%rax
mov    (%rax),%eax
shl    $0x2,%eax
mov    %ax,-0x122a(%rbp)
lea    -0x5f0(%rbp),%rax
movzwl -0x122a(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x1238(%rbp)
movzwl -0x122a(%rbp),%eax
movb   $0x48,-0x5e4(%rbp,%rax,1)
48
movzwl -0x122a(%rbp),%eax
movb   $0x4f,-0x5e3(%rbp,%rax,1)
4f
movzwl -0x122a(%rbp),%eax
movb   $0x4c,-0x5e2(%rbp,%rax,1)
4c
movzwl -0x122a(%rbp),%eax
movb   $0x41,-0x5e1(%rbp,%rax,1)
movzwl -0x122a(%rbp),%eax
movb   $0x4d,-0x5e0(%rbp,%rax,1)
4d
movzwl -0x122a(%rbp),%eax
movb   $0x55,-0x5df(%rbp,%rax,1)
55
movzwl -0x122a(%rbp),%eax
movb   $0x4e,-0x5de(%rbp,%rax,1)
4e
movzwl -0x122a(%rbp),%eax
movb   $0x44,-0x5dd(%rbp,%rax,1)
44
movzwl -0x122a(%rbp),%eax
movb   $0x4f,-0x5dc(%rbp,%rax,1)
4f
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%edx
lea    -0x11e0(%rbp),%rcx
mov    %rdx,%rsi
call   1080 <getaddrinfo@plt>
mov    -0x11e0(%rbp),%rax
cmpq   $0x0,(%rax)
je     128e <main+0x11e>
mov    -0x11e0(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x1240(%rbp)
jmp    129d <main+0x12d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x1240(%rbp)
mov    -0x1240(%rbp),%rsi
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d2f(%rip),%rax
mov    (%rax),%edi
mov    0x2d1e(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1090 <socket@plt>
mov    %eax,-0x11c4(%rbp)
cmp    $0x0,%eax
jge    12f3 <main+0x183>
lea    0xd26(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
lea    -0x5f0(%rbp),%rax
mov    %rax,-0x11b8(%rbp)
mov    0x2cc8(%rip),%rax
mov    (%rax),%ecx
mov    -0x11b8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x11b8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x11b8(%rbp),%rax
movl   $0x2a,(%rax)
movl   $0x18,-0x11c8(%rbp)
mov    -0x11c4(%rbp),%edi
lea    -0x5f0(%rbp),%rsi
mov    -0x11c8(%rbp),%edx
mov    -0x11e0(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x11e0(%rbp),%rax
mov    0x8(%rax),%r9d
xor    %ecx,%ecx
call   1050 <sendto@plt>
cmp    $0x0,%rax
jge    138a <main+0x21a>
lea    0xc96(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
lea    -0xbd0(%rbp),%rax
mov    %rax,-0x11f0(%rbp)
movl   $0x5dc,-0x11e8(%rbp)
movq   $0x0,-0x11f8(%rbp)
movq   $0x0,-0x1200(%rbp)
lea    -0x11f0(%rbp),%rax
mov    %rax,-0x1208(%rbp)
movl   $0x1,-0x1220(%rbp)
lea    -0x11b0(%rbp),%rax
mov    %rax,-0x1218(%rbp)
movl   $0x5dc,-0x1210(%rbp)
mov    -0x11cc(%rbp),%esi
lea    0xc23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xbd0(%rbp),%rax
mov    %rax,-0x11c0(%rbp)
mov    -0x11c0(%rbp),%rax
mov    (%rax),%eax
shl    $0x2,%eax
mov    %eax,-0x11d0(%rbp)
lea    -0xbd0(%rbp),%rax
movslq -0x11d0(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x11b8(%rbp)
mov    -0x11cc(%rbp),%eax
sub    -0x11d0(%rbp),%eax
mov    %eax,-0x11d4(%rbp)
mov    -0x11d4(%rbp),%eax
mov    %eax,-0x1244(%rbp)
mov    -0x11c0(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <inet_ntoa@plt>
mov    -0x1244(%rbp),%esi
mov    %rax,%rdx
lea    0xbab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x5f0,%rsp
mov    %rsi,%rbx
movb   $0x4f,0x24(%rsp)
mov    0x8(%rsi),%rdi
lea    0x8(%rsp),%rcx
xor    %esi,%esi
xor    %edx,%edx
call   1080 <getaddrinfo@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%rsi
test   %rsi,%rsi
jne    11a3 <main+0x33>
mov    0x8(%rbx),%rsi
lea    0xe56(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
mov    0x2e1f(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1090 <socket@plt>
test   %eax,%eax
js     1243 <main+0xd3>
mov    0x2df8(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x20(%rsp)
movq   $0x0,0x18(%rsp)
movl   $0x2a,0x10(%rsp)
mov    0x8(%rsp),%rcx
mov    0x8(%rcx),%r9d
mov    0xc(%rcx),%r8d
lea    0x10(%rsp),%rsi
mov    %eax,%edi
mov    $0x18,%edx
xor    %ecx,%ecx
call   1050 <sendto@plt>
test   %rax,%rax
js     124c <main+0xdc>
lea    0xdfd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
call   1030 <inet_ntoa@plt>
lea    0xdee(%rip),%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x5f0,%rsp
pop    %rbx
ret
lea    0xdc0(%rip),%rdi
jmp    1253 <main+0xe3>
lea    0xdbe(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
%struct.icmp = type { i32, i64, i32 }
%struct.ip = type { i32, i32 }
%struct.addrinfo = type { i8*, i32, i32 }
%struct.iovec = type { i8*, i32 }
%struct.msghdr = type { i32, i8*, i32, %struct.iovec*, i64, i32* }
%struct.iphdr = type { i32 }
%struct.icmphdr = type { i32 }
@.str = [10 x i8] c"Dest: %s\0A\00"
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@.str.1 = [7 x i8] c"socket\00"
@ICMP_ECHO = global i32 0
@.str.2 = [7 x i8] c"sendto\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [18 x i8] c"%d bytes from %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1500 x i8]
%7 = alloca [1500 x i8]
%8 = alloca [1500 x i8]
%9 = alloca %struct.icmp*
%10 = alloca %struct.ip*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca %struct.addrinfo*
%17 = alloca %struct.iovec
%18 = alloca %struct.msghdr
%19 = alloca %struct.iphdr*
%20 = alloca i16
%21 = alloca %struct.icmphdr*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 0
%23 = bitcast i8* %22 to %struct.iphdr*
store %struct.iphdr* %23, %struct.iphdr** %19
%24 = load %struct.iphdr*, %struct.iphdr** %19
%25 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %24, i32 0, i32 0
%26 = load i32, i32* %25
%27 = mul nsw i32 %26, 4
%28 = trunc i32 %27 to i16
store i16 %28, i16* %20
%29 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 0
%30 = load i16, i16* %20
%31 = zext i16 %30 to i32
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %29, i64 %32
%34 = bitcast i8* %33 to %struct.icmphdr*
store %struct.icmphdr* %34, %struct.icmphdr** %21
%35 = load i16, i16* %20
%36 = zext i16 %35 to i64
%37 = add i64 %36, 8
%38 = add i64 %37, 4
%39 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 %38
store i8 72, i8* %39
%40 = load i16, i16* %20
%41 = zext i16 %40 to i64
%42 = add i64 %41, 8
%43 = add i64 %42, 5
%44 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 %43
store i8 79, i8* %44
%45 = load i16, i16* %20
%46 = zext i16 %45 to i64
%47 = add i64 %46, 8
%48 = add i64 %47, 6
%49 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 %48
store i8 76, i8* %49
%50 = load i16, i16* %20
%51 = zext i16 %50 to i64
%52 = add i64 %51, 8
%53 = add i64 %52, 7
%54 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 %53
store i8 65, i8* %54
%55 = load i16, i16* %20
%56 = zext i16 %55 to i64
%57 = add i64 %56, 8
%58 = add i64 %57, 8
%59 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 %58
store i8 77, i8* %59
%60 = load i16, i16* %20
%61 = zext i16 %60 to i64
%62 = add i64 %61, 8
%63 = add i64 %62, 9
%64 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 %63
store i8 85, i8* %64
%65 = load i16, i16* %20
%66 = zext i16 %65 to i64
%67 = add i64 %66, 8
%68 = add i64 %67, 10
%69 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 %68
store i8 78, i8* %69
%70 = load i16, i16* %20
%71 = zext i16 %70 to i64
%72 = add i64 %71, 8
%73 = add i64 %72, 11
%74 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 %73
store i8 68, i8* %74
%75 = load i16, i16* %20
%76 = zext i16 %75 to i64
%77 = add i64 %76, 8
%78 = add i64 %77, 12
%79 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 %78
store i8 79, i8* %79
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 1
%82 = load i8*, i8** %81
%83 = call i32 @getaddrinfo(i8* %82, i32* null, i32* null, %struct.addrinfo** %16)
%84 = load %struct.addrinfo*, %struct.addrinfo** %16
%85 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %84, i32 0, i32 0
%86 = load i8*, i8** %85
%87 = icmp ne i8* %86, null
br i1 %87, label %88, label %92
88: ; preds = %2
%89 = load %struct.addrinfo*, %struct.addrinfo** %16
%90 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %89, i32 0, i32 0
%91 = load i8*, i8** %90
br label %96
92: ; preds = %2
%93 = load i8**, i8*** %5
%94 = getelementptr inbounds i8*, i8** %93, i64 1
%95 = load i8*, i8** %94
br label %96
96: ; preds = %92, %88
%97 = phi i8* [ %91, %88 ], [ %95, %92 ]
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %97)
%99 = load i32, i32* @AF_INET
%100 = load i32, i32* @SOCK_RAW
%101 = call i32 @socket(i32 %99, i32 %100, i32 1)
store i32 %101, i32* %11
%102 = icmp slt i32 %101, 0
br i1 %102, label %103, label %106
103: ; preds = %96
%104 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%105 = call i32 @exit(i32 1)
unreachable
106: ; preds = %96
%107 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 0
%108 = bitcast i8* %107 to %struct.icmp*
store %struct.icmp* %108, %struct.icmp** %9
%109 = load i32, i32* @ICMP_ECHO
%110 = load %struct.icmp*, %struct.icmp** %9
%111 = getelementptr inbounds %struct.icmp, %struct.icmp* %110, i32 0, i32 2
store i32 %109, i32* %111
%112 = load %struct.icmp*, %struct.icmp** %9
%113 = getelementptr inbounds %struct.icmp, %struct.icmp* %112, i32 0, i32 1
store i64 0, i64* %113
%114 = load %struct.icmp*, %struct.icmp** %9
%115 = getelementptr inbounds %struct.icmp, %struct.icmp* %114, i32 0, i32 0
store i32 42, i32* %115
store i32 24, i32* %12
%116 = load i32, i32* %11
%117 = getelementptr inbounds [1500 x i8], [1500 x i8]* %6, i64 0, i64 0
%118 = load i32, i32* %12
%119 = load %struct.addrinfo*, %struct.addrinfo** %16
%120 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %119, i32 0, i32 2
%121 = load i32, i32* %120
%122 = load %struct.addrinfo*, %struct.addrinfo** %16
%123 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %122, i32 0, i32 1
%124 = load i32, i32* %123
%125 = call i64 @sendto(i32 %116, i8* %117, i32 %118, i32 0, i32 %121, i32 %124)
%126 = icmp slt i64 %125, 0
br i1 %126, label %127, label %130
127: ; preds = %106
%128 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%129 = call i32 @exit(i32 1)
unreachable
130: ; preds = %106
%131 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 0
%132 = getelementptr inbounds %struct.iovec, %struct.iovec* %17, i32 0, i32 0
store i8* %131, i8** %132
%133 = getelementptr inbounds %struct.iovec, %struct.iovec* %17, i32 0, i32 1
store i32 1500, i32* %133
%134 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %18, i32 0, i32 5
store i32* null, i32** %134
%135 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %18, i32 0, i32 4
store i64 0, i64* %135
%136 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %18, i32 0, i32 3
store %struct.iovec* %17, %struct.iovec** %136
%137 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %18, i32 0, i32 0
store i32 1, i32* %137
%138 = getelementptr inbounds [1500 x i8], [1500 x i8]* %8, i64 0, i64 0
%139 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %18, i32 0, i32 1
store i8* %138, i8** %139
%140 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %18, i32 0, i32 2
store i32 1500, i32* %140
%141 = load i32, i32* %13
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %141)
%143 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 0
%144 = bitcast i8* %143 to %struct.ip*
store %struct.ip* %144, %struct.ip** %10
%145 = load %struct.ip*, %struct.ip** %10
%146 = getelementptr inbounds %struct.ip, %struct.ip* %145, i32 0, i32 0
%147 = load i32, i32* %146
%148 = shl i32 %147, 2
store i32 %148, i32* %14
%149 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 0
%150 = load i32, i32* %14
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i8, i8* %149, i64 %151
%153 = bitcast i8* %152 to %struct.icmp*
store %struct.icmp* %153, %struct.icmp** %9
%154 = load i32, i32* %13
%155 = load i32, i32* %14
%156 = sub nsw i32 %154, %155
store i32 %156, i32* %15
%157 = load i32, i32* %15
%158 = load %struct.ip*, %struct.ip** %10
%159 = getelementptr inbounds %struct.ip, %struct.ip* %158, i32 0, i32 1
%160 = load i32, i32* %159
%161 = call i8* @inet_ntoa(i32 %160)
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %157, i8* %161)
ret i32 0
}

LLVM IR (-O2):
%struct.addrinfo = type { i8*, i32, i32 }
%struct.iovec = type { i8*, i32 }
%struct.ip = type { i32, i32 }
%struct.icmp = type { i32, i64, i32 }
@.str = [10 x i8] c"Dest: %s\0A\00"
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@.str.1 = [7 x i8] c"socket\00"
@ICMP_ECHO = global i32 0
@.str.2 = [7 x i8] c"sendto\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [18 x i8] c"%d bytes from %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1500 x i8]
%4 = alloca %struct.addrinfo*
%5 = getelementptr inbounds [1500 x i8], [1500 x i8]* %3, i64 0, i64 0
%6 = bitcast %struct.addrinfo** %4 to i8*
%7 = bitcast [1500 x i8]* %3 to i32*
%8 = getelementptr inbounds [1500 x i8], [1500 x i8]* %3, i64 0, i64 16
%9 = getelementptr inbounds [1500 x i8], [1500 x i8]* %3, i64 0, i64 20
store i8 79, i8* %9
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @getaddrinfo(i8* %11, i32* null, i32* null, %struct.addrinfo** %4)
%13 = load %struct.addrinfo*, %struct.addrinfo** %4
%14 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %13, i64 0, i32 0
%15 = load i8*, i8** %14
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = load i8*, i8** %10
br label %19
19: ; preds = %2, %17
%20 = phi i8* [ %18, %17 ], [ %15, %2 ]
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = load i32, i32* @AF_INET
%23 = load i32, i32* @SOCK_RAW
%24 = call i32 @socket(i32 %22, i32 %23, i32 1)
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %19
%27 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %19
%30 = load i32, i32* @ICMP_ECHO
%31 = bitcast i8* %8 to i32*
store i32 %30, i32* %31
%32 = getelementptr inbounds [1500 x i8], [1500 x i8]* %3, i64 0, i64 8
%33 = bitcast i8* %32 to i64*
store i64 0, i64* %33
store i32 42, i32* %7
%34 = load %struct.addrinfo*, %struct.addrinfo** %4
%35 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %34, i64 0, i32 2
%36 = load i32, i32* %35
%37 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %34, i64 0, i32 1
%38 = load i32, i32* %37
%39 = call i64 @sendto(i32 %24, i8* %5, i32 24, i32 0, i32 %36, i32 %38)
%40 = icmp slt i64 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %29
%42 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %29
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 undef)
%46 = call i8* @inet_ntoa(i32 undef)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 undef, i8* %46)
ret i32 0
}