#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__ {
  scalar_t__ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ fromAddr;
typedef int /*<<< orphan*/ echoServAddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ DieWithError(char *);
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
unsigned short atoi(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ htons(unsigned short);
scalar_t__ inet_addr(char *);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *,
             unsigned int *);
int sendto(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int strlen(char *);
int main(int argc, char *argv[]) {
  int sock;
  struct sockaddr_in echoServAddr;
  struct sockaddr_in fromAddr;
  unsigned short echoServPort;
  unsigned int fromSize;
  char *servIP;
  char *echoString;
  char echoBuffer[255 + 1];
  int echoStringLen;
  int respStringLen;
  if ((argc < 3) || (argc > 4)) {
    fprintf(stderr, "Usage: %s <Server IP> <Echo Word> [<Echo Port>]\n",
            argv[0]);
    exit(1);
  }
  servIP = argv[1];
  echoString = argv[2];
  if ((echoStringLen = strlen(echoString)) > 255)
    DieWithError("Echo word too long");
  if (argc == 4)
    echoServPort = atoi(argv[3]);
  else
    echoServPort = 7;
  if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
    DieWithError("socket() failed");
  memset(&echoServAddr, 0, sizeof(echoServAddr));
  echoServAddr.sin_family = AF_INET;
  echoServAddr.sin_addr.s_addr = inet_addr(servIP);
  echoServAddr.sin_port = htons(echoServPort);
  if (sendto(sock, echoString, echoStringLen, 0,
             (struct sockaddr *)&echoServAddr,
             sizeof(echoServAddr)) != echoStringLen)
    DieWithError("sendto() sent a different number of bytes than expected");
  fromSize = sizeof(fromAddr);
  if ((respStringLen = recvfrom(sock, echoBuffer, 255, 0,
                                (struct sockaddr *)&fromAddr, &fromSize)) !=
      echoStringLen)
    DieWithError("recvfrom() failed");
  if (echoServAddr.sin_addr.s_addr != fromAddr.sin_addr.s_addr) {
    fprintf(stderr, "Error: received a packet from unknown source.\n");
    exit(1);
  }
  echoBuffer[respStringLen] = '\0';
  printf("Received: %s\n", echoBuffer);
  close(sock);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     11fd <main+0x2d>
cmpl   $0x4,-0x8(%rbp)
jle    1225 <main+0x55>
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdec(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x154(%rbp)
cmp    $0xff,%eax
jle    1263 <main+0x93>
lea    0xdd3(%rip),%rdi
call   10c0 <DieWithError@plt>
cmpl   $0x4,-0x8(%rbp)
jne    1283 <main+0xb3>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <atoi@plt>
mov    %ax,-0x3a(%rbp)
jmp    1289 <main+0xb9>
movw   $0x7,-0x3a(%rbp)
mov    0x2d38(%rip),%rax
mov    (%rax),%edi
mov    0x2d47(%rip),%rax
mov    (%rax),%esi
mov    0x2d16(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    12c1 <main+0xf1>
lea    0xd88(%rip),%rdi
call   10c0 <DieWithError@plt>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1060 <memset@plt>
mov    0x2d10(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x48(%rbp),%rdi
call   1090 <inet_addr@plt>
mov    %rax,-0x28(%rbp)
movzwl -0x3a(%rbp),%edi
call   1040 <htons@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x50(%rbp),%rsi
mov    -0x154(%rbp),%edx
lea    -0x28(%rbp),%r8
xor    %ecx,%ecx
mov    $0x10,%r9d
call   1070 <sendto@plt>
cmp    -0x154(%rbp),%eax
je     132c <main+0x15c>
lea    0xd2d(%rip),%rdi
call   10c0 <DieWithError@plt>
movl   $0x10,-0x40(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x150(%rbp),%rsi
lea    -0x38(%rbp),%r8
mov    $0xff,%edx
xor    %ecx,%ecx
lea    -0x40(%rbp),%r9
call   10b0 <recvfrom@plt>
mov    %eax,-0x158(%rbp)
cmp    -0x154(%rbp),%eax
je     136f <main+0x19f>
lea    0xd22(%rip),%rdi
call   10c0 <DieWithError@plt>
mov    -0x28(%rbp),%rax
cmp    -0x38(%rbp),%rax
je     139e <main+0x1ce>
mov    0x2c4c(%rip),%rax
mov    (%rax),%edi
lea    0xd11(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movslq -0x158(%rbp),%rax
movb   $0x0,-0x150(%rbp,%rax,1)
lea    -0x150(%rbp),%rsi
lea    0xd12(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x138,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
lea    -0x5(%rbx),%eax
cmp    $0xfffffffd,%eax
ja     1213 <main+0x43>
mov    0x2ddb(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xdfe(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    0x8(%rbp),%r15
mov    0x10(%rbp),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%r13d
cmp    $0x100,%eax
jl     1239 <main+0x69>
lea    0xdfd(%rip),%rdi
call   10c0 <DieWithError@plt>
mov    $0x7,%r12w
cmp    $0x4,%ebx
jne    124f <main+0x7f>
mov    0x18(%rbp),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r12d
mov    0x2d72(%rip),%rax
mov    (%rax),%edi
mov    0x2d81(%rip),%rax
mov    (%rax),%esi
mov    0x2d50(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1281 <main+0xb1>
lea    0xdc8(%rip),%rdi
call   10c0 <DieWithError@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1060 <memset@plt>
mov    0x2d4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
mov    %r15,%rdi
call   1090 <inet_addr@plt>
mov    %rax,0x10(%rsp)
movzwl %r12w,%edi
call   1040 <htons@plt>
mov    %eax,0x18(%rsp)
mov    %ebp,%edi
mov    %r14,%rsi
mov    %r13d,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    $0x10,%r9d
call   1070 <sendto@plt>
cmp    %r13d,%eax
je     12e5 <main+0x115>
lea    0xd74(%rip),%rdi
call   10c0 <DieWithError@plt>
movl   $0x10,0xc(%rsp)
lea    0x30(%rsp),%rsi
lea    0x20(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %ebp,%edi
mov    $0xff,%edx
xor    %ecx,%ecx
call   10b0 <recvfrom@plt>
mov    %eax,%ebx
cmp    %r13d,%eax
je     131d <main+0x14d>
lea    0xd74(%rip),%rdi
call   10c0 <DieWithError@plt>
mov    0x10(%rsp),%rax
cmp    0x20(%rsp),%rax
jne    1350 <main+0x180>
movslq %ebx,%rax
movb   $0x0,0x30(%rsp,%rax,1)
lea    0xd95(%rip),%rdi
lea    0x30(%rsp),%rsi
call   1050 <printf@plt>
mov    %ebp,%edi
call   1080 <close@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    0x2c79(%rip),%rax
mov    (%rax),%edi
lea    0xd3e(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i64 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [49 x i8] c"Usage: %s <Server IP> <Echo Word> [<Echo Port>]\0A\00"
@.str.1 = [19 x i8] c"Echo word too long\00"
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str.2 = [16 x i8] c"socket() failed\00"
@AF_INET = global i32 0
@.str.3 = [56 x i8] c"sendto() sent a different number of bytes than expected\00"
@.str.4 = [18 x i8] c"recvfrom() failed\00"
@.str.5 = [47 x i8] c"Error: received a packet from unknown source.\0A\00"
@.str.6 = [14 x i8] c"Received: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.sockaddr_in
%8 = alloca %struct.sockaddr_in
%9 = alloca i16
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca [256 x i8]
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 3
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %4
%20 = icmp sgt i32 %19, 4
br i1 %20, label %21, label %28
21: ; preds = %18, %2
%22 = load i32, i32* @stderr
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 0
%25 = load i8*, i8** %24
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %25)
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %18
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
store i8* %31, i8** %11
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
store i8* %34, i8** %12
%35 = load i8*, i8** %12
%36 = call i32 @strlen(i8* %35)
store i32 %36, i32* %14
%37 = icmp sgt i32 %36, 255
br i1 %37, label %38, label %40
38: ; preds = %28
%39 = call i32 @DieWithError(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %40
40: ; preds = %38, %28
%41 = load i32, i32* %4
%42 = icmp eq i32 %41, 4
br i1 %42, label %43, label %48
43: ; preds = %40
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 3
%46 = load i8*, i8** %45
%47 = call zeroext i16 @atoi(i8* %46)
store i16 %47, i16* %9
br label %49
48: ; preds = %40
store i16 7, i16* %9
br label %49
49: ; preds = %48, %43
%50 = load i32, i32* @PF_INET
%51 = load i32, i32* @SOCK_DGRAM
%52 = load i32, i32* @IPPROTO_UDP
%53 = call i32 @socket(i32 %50, i32 %51, i32 %52)
store i32 %53, i32* %6
%54 = icmp slt i32 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %49
%56 = call i32 @DieWithError(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %57
57: ; preds = %55, %49
%58 = call i32 @memset(%struct.sockaddr_in* %7, i32 0, i32 16)
%59 = load i32, i32* @AF_INET
%60 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i32 %59, i32* %60
%61 = load i8*, i8** %11
%62 = call i64 @inet_addr(i8* %61)
%63 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%64 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %63, i32 0, i32 0
store i64 %62, i64* %64
%65 = load i16, i16* %9
%66 = call i32 @htons(i16 zeroext %65)
%67 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
store i32 %66, i32* %67
%68 = load i32, i32* %6
%69 = load i8*, i8** %12
%70 = load i32, i32* %14
%71 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%72 = call i32 @sendto(i32 %68, i8* %69, i32 %70, i32 0, %struct.sockaddr* %71, i32 16)
%73 = load i32, i32* %14
%74 = icmp ne i32 %72, %73
br i1 %74, label %75, label %77
75: ; preds = %57
%76 = call i32 @DieWithError(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
br label %77
77: ; preds = %75, %57
store i32 16, i32* %10
%78 = load i32, i32* %6
%79 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%80 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%81 = call i32 @recvfrom(i32 %78, i8* %79, i32 255, i32 0, %struct.sockaddr* %80, i32* %10)
store i32 %81, i32* %15
%82 = load i32, i32* %14
%83 = icmp ne i32 %81, %82
br i1 %83, label %84, label %86
84: ; preds = %77
%85 = call i32 @DieWithError(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %86
86: ; preds = %84, %77
%87 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%88 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %87, i32 0, i32 0
%89 = load i64, i64* %88
%90 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
%91 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %90, i32 0, i32 0
%92 = load i64, i64* %91
%93 = icmp ne i64 %89, %92
br i1 %93, label %94, label %98
94: ; preds = %86
%95 = load i32, i32* @stderr
%96 = call i32 (i32, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0))
%97 = call i32 @exit(i32 1)
unreachable
98: ; preds = %86
%99 = load i32, i32* %15
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 %100
store i8 0, i8* %101
%102 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%103 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %102)
%104 = load i32, i32* %6
%105 = call i32 @close(i32 %104)
%106 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i64 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [49 x i8] c"Usage: %s <Server IP> <Echo Word> [<Echo Port>]\0A\00"
@.str.1 = [19 x i8] c"Echo word too long\00"
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str.2 = [16 x i8] c"socket() failed\00"
@AF_INET = global i32 0
@.str.3 = [56 x i8] c"sendto() sent a different number of bytes than expected\00"
@.str.4 = [18 x i8] c"recvfrom() failed\00"
@.str.5 = [47 x i8] c"Error: received a packet from unknown source.\0A\00"
@.str.6 = [14 x i8] c"Received: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [256 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 [256 x i8], [256 x i8]* %6, i64 0, i64 0
%11 = add i32 %0, -5
%12 = icmp ult i32 %11, -2
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %1
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32 @strlen(i8* %22)
%24 = icmp sgt i32 %23, 255
br i1 %24, label %25, label %27
25: ; preds = %18
%26 = tail call i32 @DieWithError(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %25, %18
%28 = icmp eq i32 %0, 4
br i1 %28, label %29, label %33
29: ; preds = %27
%30 = getelementptr inbounds i8*, i8** %1, i64 3
%31 = load i8*, i8** %30
%32 = tail call zeroext i16 @atoi(i8* %31)
br label %33
33: ; preds = %27, %29
%34 = phi i16 [ %32, %29 ], [ 7, %27 ]
%35 = load i32, i32* @PF_INET
%36 = load i32, i32* @SOCK_DGRAM
%37 = load i32, i32* @IPPROTO_UDP
%38 = tail call i32 @socket(i32 %35, i32 %36, i32 %37)
%39 = icmp slt i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %33
%41 = tail call i32 @DieWithError(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %40, %33
%43 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 16)
%44 = load i32, i32* @AF_INET
%45 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %44, i32* %45
%46 = call i64 @inet_addr(i8* %20)
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0, i32 0
store i64 %46, i64* %47
%48 = call i32 @htons(i16 zeroext %34)
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i32 %48, i32* %49
%50 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%51 = call i32 @sendto(i32 %38, i8* %22, i32 %23, i32 0, %struct.sockaddr* %50, i32 16)
%52 = icmp eq i32 %51, %23
br i1 %52, label %55, label %53
53: ; preds = %42
%54 = call i32 @DieWithError(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
br label %55
55: ; preds = %53, %42
store i32 16, i32* %5
%56 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%57 = call i32 @recvfrom(i32 %38, i8* %10, i32 255, i32 0, %struct.sockaddr* %56, i32* %5)
%58 = icmp eq i32 %57, %23
br i1 %58, label %61, label %59
59: ; preds = %55
%60 = call i32 @DieWithError(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %61
61: ; preds = %59, %55
%62 = load i64, i64* %47
%63 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0, i32 0
%64 = load i64, i64* %63
%65 = icmp eq i64 %62, %64
br i1 %65, label %70, label %66
66: ; preds = %61
%67 = load i32, i32* @stderr
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0))
%69 = call i32 @exit(i32 1)
unreachable
70: ; preds = %61
%71 = sext i32 %57 to i64
%72 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %71
store i8 0, i8* %72
%73 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %10)
%74 = call i32 @close(i32 %38)
%75 = call i32 @exit(i32 0)
unreachable
}