#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;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ sin;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ htons(unsigned short);
int /*<<< orphan*/ inet_addr(char *);
char *inet_ntoa(TYPE_1__);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
scalar_t__ send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int strlen(char *);
int main(int argc, char **argv) {
  int sock;
  struct sockaddr_in sin;
  char *serv_addr;
  unsigned short serv_port = 2222;
  char message[] = "Hello, Net!\n";
  char buffer[256];
  int n, k;
  if (argc != 2) {
    printf("Usage: tcp-client <server-ip-address>\n");
    return 1;
  }
  serv_addr = argv[1];
  sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
  if (sock < 0) {
    printf("Error creating socket, aborted\n");
    return 1;
  }
  memset(&sin, 0, sizeof(sin));
  sin.sin_family = AF_INET;
  sin.sin_addr.s_addr = inet_addr(serv_addr);
  sin.sin_port = htons(serv_port);
  printf("Client started, connecting to %s\n", inet_ntoa(sin.sin_addr));
  if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
    printf("Error connecting, aborted\n");
    return 1;
  }
  if (send(sock, message, strlen(message) + 1, 0) < 0) {
    printf("Error writing to socket");
    return 1;
  }
  k = 0;
  printf("Received: ");
  while (k < strlen(message) + 1) {
    n = recv(sock, buffer, 256, 0);
    if (n <= 0) {
      if (n < 0)
        printf("<Error reading from socket>");
      break;
    }
    buffer[n] = 0;
    printf("%s", buffer);
    k += n;
  }
  printf("\nClient finished\n");
  close(sock);
  return 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)
movw   $0x8ae,-0x2a(%rbp)
mov    0xe2a(%rip),%rax
mov    %rax,-0x37(%rbp)
mov    0xe28(%rip),%eax
mov    %eax,-0x2f(%rbp)
mov    0xe23(%rip),%al
mov    %al,-0x2b(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1210 <main+0x60>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1420 <main+0x270>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
mov    0x2da4(%rip),%rax
mov    (%rax),%esi
mov    0x2dab(%rip),%rax
mov    (%rax),%edx
call   10d0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1263 <main+0xb3>
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1420 <main+0x270>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1090 <memset@plt>
mov    0x2d6e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x28(%rbp),%rdi
call   10b0 <inet_addr@plt>
mov    %eax,-0x20(%rbp)
movzwl -0x2a(%rbp),%edi
call   1060 <htons@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%rsi
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0xc,%edx
call   10c0 <connect@plt>
cmp    $0x0,%rax
jge    12e5 <main+0x135>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1420 <main+0x270>
mov    -0x14(%rbp),%eax
mov    %eax,-0x154(%rbp)
lea    -0x37(%rbp),%rax
mov    %rax,-0x150(%rbp)
lea    -0x37(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x154(%rbp),%edi
mov    -0x150(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0x0,%rax
jge    133f <main+0x18f>
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1420 <main+0x270>
movl   $0x0,-0x148(%rbp)
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x148(%rbp),%eax
mov    %eax,-0x158(%rbp)
lea    -0x37(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x158(%rbp),%eax
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1403 <main+0x253>
mov    -0x14(%rbp),%edi
lea    -0x140(%rbp),%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x144(%rbp)
cmpl   $0x0,-0x144(%rbp)
jg     13c8 <main+0x218>
cmpl   $0x0,-0x144(%rbp)
jge    13c3 <main+0x213>
lea    0xcf8(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1403 <main+0x253>
movslq -0x144(%rbp),%rax
movb   $0x0,-0x140(%rbp,%rax,1)
lea    -0x140(%rbp),%rsi
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x144(%rbp),%eax
add    -0x148(%rbp),%eax
mov    %eax,-0x148(%rbp)
jmp    1357 <main+0x1a7>
lea    0xcc9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x14(%rbp),%edi
call   10a0 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
movabs $0xa2174654e202c,%rax
mov    %rax,0x15(%rsp)
movabs $0x4e202c6f6c6c6548,%rax
2c 20 4e
mov    %rax,0x10(%rsp)
cmp    $0x2,%edi
jne    132c <main+0x16c>
mov    0x8(%rsi),%rbx
mov    0x2dc5(%rip),%rax
mov    (%rax),%edi
mov    0x2dc4(%rip),%rax
mov    (%rax),%esi
mov    0x2dcb(%rip),%rax
mov    (%rax),%edx
call   10e0 <socket@plt>
test   %eax,%eax
js     1335 <main+0x175>
mov    %eax,%r12d
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10a0 <memset@plt>
mov    0x2da8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    %rbx,%rdi
call   10c0 <inet_addr@plt>
mov    %eax,(%rsp)
mov    $0x8ae,%edi
call   1070 <htons@plt>
mov    %eax,0x4(%rsp)
mov    (%rsp),%edi
call   1050 <inet_ntoa@plt>
lea    0xd9f(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r12d,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   10d0 <connect@plt>
test   %rax,%rax
js     133e <main+0x17e>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
lea    0x1(%rax),%edx
mov    %r12d,%edi
mov    %rbx,%rsi
xor    %ecx,%ecx
call   1080 <send@plt>
test   %rax,%rax
js     1361 <main+0x1a1>
lea    0xd89(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x10(%rsp),%rdi
call   1060 <strlen@plt>
test   %eax,%eax
js     1381 <main+0x1c1>
lea    0x20(%rsp),%r13
lea    0xd8b(%rip),%r14
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r12d,%edi
mov    %r13,%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
jle    1371 <main+0x1b1>
mov    %eax,%ebp
mov    %eax,%eax
movb   $0x0,0x20(%rsp,%rax,1)
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
add    %ebp,%ebx
mov    %r15,%rdi
call   1060 <strlen@plt>
cmp    %eax,%ebx
jle    12f0 <main+0x130>
jmp    1381 <main+0x1c1>
lea    0xd88(%rip),%rdi
jmp    1345 <main+0x185>
lea    0xd60(%rip),%rdi
jmp    1345 <main+0x185>
lea    0xd3d(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcc7(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    134a <main+0x18a>
jns    1381 <main+0x1c1>
lea    0xcd8(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xce9(%rip),%rdi
call   1040 <puts@plt>
mov    %r12d,%edi
call   10b0 <close@plt>
xor    %eax,%eax
jmp    134f <main+0x18f>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@__const.main.message = [13 x i8] c"Hello, Net!\0A\00"
@.str = [39 x i8] c"Usage: tcp-client <server-ip-address>\0A\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str.1 = [32 x i8] c"Error creating socket, aborted\0A\00"
@AF_INET = global i32 0
@.str.2 = [34 x i8] c"Client started, connecting to %s\0A\00"
@.str.3 = [27 x i8] c"Error connecting, aborted\0A\00"
@.str.4 = [24 x i8] c"Error writing to socket\00"
@.str.5 = [11 x i8] c"Received: \00"
@.str.6 = [28 x i8] c"<Error reading from socket>\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [18 x i8] c"\0AClient finished\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 i8*
%9 = alloca i16
%10 = alloca [13 x i8]
%11 = alloca [256 x i8]
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i16 2222, i16* %9
%14 = bitcast [13 x i8]* %10 to i8*
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 2
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %96
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
store i8* %22, i8** %8
%23 = load i32, i32* @PF_INET
%24 = load i32, i32* @SOCK_STREAM
%25 = load i32, i32* @IPPROTO_TCP
%26 = call i32 @socket(i32 %23, i32 %24, i32 %25)
store i32 %26, i32* %6
%27 = load i32, i32* %6
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %19
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %96
31: ; preds = %19
%32 = call i32 @memset(%struct.sockaddr_in* %7, i32 0, i32 12)
%33 = load i32, i32* @AF_INET
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i32 %33, i32* %34
%35 = load i8*, i8** %8
%36 = call i32 @inet_addr(i8* %35)
%37 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%38 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %37, i32 0, i32 0
store i32 %36, i32* %38
%39 = load i16, i16* %9
%40 = call i32 @htons(i16 zeroext %39)
%41 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
store i32 %40, i32* %41
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%43 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %42, i32 0, i32 0
%44 = load i32, i32* %43
%45 = call i8* @inet_ntoa(i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %45)
%47 = load i32, i32* %6
%48 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%49 = call i64 @connect(i32 %47, %struct.sockaddr* %48, i32 12)
%50 = icmp slt i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %31
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %96
53: ; preds = %31
%54 = load i32, i32* %6
%55 = getelementptr inbounds [13 x i8], [13 x i8]* %10, i64 0, i64 0
%56 = getelementptr inbounds [13 x i8], [13 x i8]* %10, i64 0, i64 0
%57 = call i32 @strlen(i8* %56)
%58 = add nsw i32 %57, 1
%59 = call i64 @send(i32 %54, i8* %55, i32 %58, i32 0)
%60 = icmp slt i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %53
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %96
63: ; preds = %53
store i32 0, i32* %13
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %65
65: ; preds = %83, %63
%66 = load i32, i32* %13
%67 = getelementptr inbounds [13 x i8], [13 x i8]* %10, i64 0, i64 0
%68 = call i32 @strlen(i8* %67)
%69 = add nsw i32 %68, 1
%70 = icmp slt i32 %66, %69
br i1 %70, label %71, label %92
71: ; preds = %65
%72 = load i32, i32* %6
%73 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%74 = call i32 @recv(i32 %72, i8* %73, i32 256, i32 0)
store i32 %74, i32* %12
%75 = load i32, i32* %12
%76 = icmp sle i32 %75, 0
br i1 %76, label %77, label %83
77: ; preds = %71
%78 = load i32, i32* %12
%79 = icmp slt i32 %78, 0
br i1 %79, label %80, label %82
80: ; preds = %77
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
br label %82
82: ; preds = %80, %77
br label %92
83: ; preds = %71
%84 = load i32, i32* %12
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %85
store i8 0, i8* %86
%87 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %87)
%89 = load i32, i32* %12
%90 = load i32, i32* %13
%91 = add nsw i32 %90, %89
store i32 %91, i32* %13
br label %65
92: ; preds = %82, %65
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%94 = load i32, i32* %6
%95 = call i32 @close(i32 %94)
store i32 0, i32* %3
br label %96
96: ; preds = %92, %61, %51, %29, %17
%97 = load i32, i32* %3
ret i32 %97
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@__const.main.message = [13 x i8] c"Hello, Net!\0A\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@AF_INET = global i32 0
@.str.2 = [34 x i8] c"Client started, connecting to %s\0A\00"
@.str.4 = [24 x i8] c"Error writing to socket\00"
@.str.5 = [11 x i8] c"Received: \00"
@.str.6 = [28 x i8] c"<Error reading from socket>\00"
@.str.7 = [3 x i8] c"%s\00"
@str = [17 x i8] c"\0AClient finished\00"
@str.9 = [26 x i8] c"Error connecting, aborted\00"
@str.10 = [31 x i8] c"Error creating socket, aborted\00"
@str.11 = [38 x i8] c"Usage: tcp-client <server-ip-address>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [13 x i8]
%5 = alloca [256 x i8]
%6 = bitcast %struct.sockaddr_in* %3 to i8*
%7 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32 %0, 2
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.11, i64 0, i64 0))
br label %67
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = load i32, i32* @PF_INET
%16 = load i32, i32* @SOCK_STREAM
%17 = load i32, i32* @IPPROTO_TCP
%18 = tail call i32 @socket(i32 %15, i32 %16, i32 %17)
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %12
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.10, i64 0, i64 0))
br label %67
22: ; preds = %12
%23 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 12)
%24 = load i32, i32* @AF_INET
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %24, i32* %25
%26 = call i32 @inet_addr(i8* %14)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0, i32 0
store i32 %26, i32* %27
%28 = call i32 @htons(i16 zeroext 2222)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i32 %28, i32* %29
%30 = load i32, i32* %27
%31 = call i8* @inet_ntoa(i32 %30)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %31)
%33 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%34 = call i64 @connect(i32 %18, %struct.sockaddr* %33, i32 12)
%35 = icmp slt i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %22
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.9, i64 0, i64 0))
br label %67
38: ; preds = %22
%39 = call i32 @strlen(i8* %7)
%40 = add nsw i32 %39, 1
%41 = call i64 @send(i32 %18, i8* %7, i32 %40, i32 0)
%42 = icmp slt i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %38
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %67
45: ; preds = %38
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%47 = call i32 @strlen(i8* %7)
%48 = icmp slt i32 %47, 0
br i1 %48, label %64, label %49
49: ; preds = %45, %57
%50 = phi i32 [ %61, %57 ], [ 0, %45 ]
%51 = call i32 @recv(i32 %18, i8* %8, i32 256, i32 0)
%52 = icmp slt i32 %51, 1
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = icmp slt i32 %51, 0
br i1 %54, label %55, label %64
55: ; preds = %53
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
br label %64
57: ; preds = %49
%58 = zext i32 %51 to i64
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %58
store i8 0, i8* %59
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %8)
%61 = add nsw i32 %51, %50
%62 = call i32 @strlen(i8* %7)
%63 = icmp sgt i32 %61, %62
br i1 %63, label %64, label %49
64: ; preds = %57, %45, %53, %55
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%66 = call i32 @close(i32 %18)
br label %67
67: ; preds = %64, %43, %36, %20, %10
%68 = phi i32 [ 1, %10 ], [ 1, %20 ], [ 1, %36 ], [ 1, %43 ], [ 0, %64 ]
ret i32 %68
}