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

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ error_handling(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int sock;
  struct sockaddr_in serv_addr;
  char message[1024];
  int str_len;
  int recv_len, recv_cnt;
  if (argc != 3) {
    printf("Usage : %s <IP> <port>\n", argv[0]);
    exit(1);
  }
  sock = socket(PF_INET, SOCK_STREAM, 0);
  if (sock == -1) {
    error_handling("socket() error");
  }
  memset(&serv_addr, 0, sizeof(serv_addr));
  serv_addr.sin_family = AF_INET;
  serv_addr.sin_addr.s_addr = inet_addr(argv[1]);
  serv_addr.sin_port = htons(atoi(argv[2]));
  if (connect(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) == -1) {
    error_handling("connect() error!");
  } else {
    puts("Connected Success!!!");
  }
  while (1) {
    fputs("Input message(Q to quit): ", stdout);
    fgets(message, 1024, stdin);
    if (!strcmp(message, "q\n") || !strcmp(message, "Q\n"))
      break;
    str_len = write(sock, message, strlen(message));
    recv_len = 0;
    while (recv_len < str_len) {
      recv_cnt = read(sock, &message[recv_len], 1024 - 1);
      if (recv_cnt == -1) {
        error_handling("read() error!");
      }
      recv_len += recv_cnt;
    }
    message[recv_len] = 0;
    printf("Message from server : %s \n", message);
  }
  close(sock);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1250 <main+0x40>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdbf(%rip),%rdi
call   1070 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    0x2d71(%rip),%rax
mov    (%rax),%edi
mov    0x2d70(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1282 <main+0x72>
lea    0xd9b(%rip),%rdi
call   10f0 <error_handling@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1090 <memset@plt>
mov    0x2d4f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <inet_addr@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1060 <htons@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0xc,%edx
call   1120 <connect@plt>
cmp    $0xffffffff,%eax
jne    12f0 <main+0xe0>
lea    0xd41(%rip),%rdi
call   10f0 <error_handling@plt>
jmp    12fc <main+0xec>
lea    0xd41(%rip),%rdi
call   1030 <puts@plt>
jmp    1301 <main+0xf1>
mov    0x2cb8(%rip),%rax
mov    (%rax),%esi
lea    0xd3c(%rip),%rdi
call   1080 <fputs@plt>
lea    -0x420(%rbp),%rdi
mov    0x2cbc(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   10c0 <fgets@plt>
lea    -0x420(%rbp),%rdi
lea    0xd2a(%rip),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%eax
je     1368 <main+0x158>
lea    -0x420(%rbp),%rdi
lea    0xd11(%rip),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%eax
jne    136d <main+0x15d>
jmp    1441 <main+0x231>
mov    -0x14(%rbp),%eax
mov    %eax,-0x43c(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x438(%rbp)
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x43c(%rbp),%edi
mov    -0x438(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %eax,-0x424(%rbp)
movl   $0x0,-0x428(%rbp)
mov    -0x428(%rbp),%eax
cmp    -0x424(%rbp),%eax
jge    141a <main+0x20a>
mov    -0x14(%rbp),%edi
movslq -0x428(%rbp),%rax
lea    -0x420(%rbp),%rsi
add    %rax,%rsi
mov    $0x3ff,%edx
call   10b0 <read@plt>
mov    %eax,-0x42c(%rbp)
cmpl   $0xffffffff,-0x42c(%rbp)
jne    1403 <main+0x1f3>
lea    0xc70(%rip),%rdi
call   10f0 <error_handling@plt>
mov    -0x42c(%rbp),%eax
add    -0x428(%rbp),%eax
mov    %eax,-0x428(%rbp)
jmp    13b4 <main+0x1a4>
movslq -0x428(%rbp),%rax
movb   $0x0,-0x420(%rbp,%rax,1)
lea    -0x420(%rbp),%rsi
lea    0xc45(%rip),%rdi
call   1070 <printf@plt>
jmp    1301 <main+0xf1>
mov    -0x14(%rbp),%edi
call   10a0 <close@plt>
xor    %eax,%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %rsi,%r14
cmp    $0x3,%edi
jne    1400 <main+0x200>
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
mov    0x2da3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1249 <main+0x49>
lea    0xdd4(%rip),%rdi
call   10e0 <error_handling@plt>
mov    %rsp,%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1090 <memset@plt>
mov    0x2d86(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x8(%r14),%rdi
call   10d0 <inet_addr@plt>
mov    %eax,0x4(%rsp)
mov    0x10(%r14),%rdi
call   10f0 <atoi@plt>
mov    %eax,%edi
call   1060 <htons@plt>
mov    %eax,(%rsp)
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0xc,%edx
call   1110 <connect@plt>
cmp    $0xffffffff,%eax
je     12aa <main+0xaa>
lea    0xd95(%rip),%rdi
call   1030 <puts@plt>
jmp    12b6 <main+0xb6>
lea    0xd76(%rip),%rdi
call   10e0 <error_handling@plt>
mov    0x2d03(%rip),%rax
mov    (%rax),%esi
lea    0xd87(%rip),%rdi
call   1080 <fputs@plt>
mov    0x2d0e(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rdi
mov    $0x400,%esi
call   10c0 <fgets@plt>
mov    $0xa71,%ecx
mov    0x10(%rsp),%eax
xor    %ecx,%eax
movzbl 0x12(%rsp),%ecx
or     %ax,%cx
je     13e5 <main+0x1e5>
lea    0x10(%rsp),%r14
lea    0xd66(%rip),%r15
jmp    136a <main+0x16a>
nopw   0x0(%rax,%rax,1)
xor    %r13d,%r13d
movslq %r13d,%rax
movb   $0x0,0x10(%rsp,%rax,1)
lea    0xd5a(%rip),%rdi
mov    %r14,%rsi
call   1070 <printf@plt>
mov    0x2c8f(%rip),%rax
mov    (%rax),%esi
lea    0xd13(%rip),%rdi
call   1080 <fputs@plt>
mov    0x2c9a(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    $0x400,%esi
call   10c0 <fgets@plt>
mov    0x10(%rsp),%eax
mov    $0xa71,%ecx
xor    %ecx,%eax
movzbl 0x12(%rsp),%ecx
or     %ax,%cx
je     13e5 <main+0x1e5>
mov    0x10(%rsp),%eax
mov    $0xa51,%ecx
xor    %ecx,%eax
movzbl 0x12(%rsp),%ecx
or     %ax,%cx
je     13e5 <main+0x1e5>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <write@plt>
test   %eax,%eax
jle    1310 <main+0x110>
mov    %eax,%ebp
xor    %r13d,%r13d
jmp    13bc <main+0x1bc>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %r12d,%r13d
cmp    %ebp,%r13d
jge    1313 <main+0x113>
movslq %r13d,%rax
lea    (%rsp,%rax,1),%rsi
add    $0x10,%rsi
mov    %ebx,%edi
mov    $0x3ff,%edx
call   10b0 <read@plt>
mov    %eax,%r12d
cmp    $0xffffffff,%eax
jne    13b0 <main+0x1b0>
mov    %r15,%rdi
call   10e0 <error_handling@plt>
jmp    13b0 <main+0x1b0>
mov    %ebx,%edi
call   10a0 <close@plt>
xor    %eax,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%r14),%rsi
lea    0xbf6(%rip),%rdi
call   1070 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [24 x i8] c"Usage : %s <IP> <port>\0A\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [15 x i8] c"socket() error\00"
@AF_INET = global i32 0
@.str.2 = [17 x i8] c"connect() error!\00"
@.str.3 = [21 x i8] c"Connected Success!!!\00"
@.str.4 = [27 x i8] c"Input message(Q to quit): \00"
@stdout = global i32 0
@stdin = global i32 0
@.str.5 = [3 x i8] c"q\0A\00"
@.str.6 = [3 x i8] c"Q\0A\00"
@.str.7 = [14 x i8] c"read() error!\00"
@.str.8 = [27 x i8] c"Message from server : %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 [1024 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
%21 = load i32, i32* @PF_INET
%22 = load i32, i32* @SOCK_STREAM
%23 = call i32 @socket(i32 %21, i32 %22, i32 0)
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %28
26: ; preds = %20
%27 = call i32 @error_handling(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %20
%29 = call i32 @memset(%struct.sockaddr_in* %7, i32 0, i32 12)
%30 = load i32, i32* @AF_INET
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i32 %30, i32* %31
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32 @inet_addr(i8* %34)
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
%37 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %36, i32 0, i32 0
store i32 %35, i32* %37
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
%42 = call i32 @htons(i32 %41)
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
store i32 %42, i32* %43
%44 = load i32, i32* %6
%45 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%46 = call i32 @connect(i32 %44, %struct.sockaddr* %45, i32 12)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %50
48: ; preds = %28
%49 = call i32 @error_handling(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %52
50: ; preds = %28
%51 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %52
52: ; preds = %50, %48
br label %53
53: ; preds = %52, %91
%54 = load i32, i32* @stdout
%55 = call i32 @fputs(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %54)
%56 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%57 = load i32, i32* @stdin
%58 = call i32 @fgets(i8* %56, i32 1024, i32 %57)
%59 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%60 = call i32 @strcmp(i8* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %53
%63 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%64 = call i32 @strcmp(i8* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%65 = icmp ne i32 %64, 0
br i1 %65, label %67, label %66
66: ; preds = %62, %53
br label %97
67: ; preds = %62
%68 = load i32, i32* %6
%69 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%71 = call i32 @strlen(i8* %70)
%72 = call i32 @write(i32 %68, i8* %69, i32 %71)
store i32 %72, i32* %9
store i32 0, i32* %10
br label %73
73: ; preds = %87, %67
%74 = load i32, i32* %10
%75 = load i32, i32* %9
%76 = icmp slt i32 %74, %75
br i1 %76, label %77, label %91
77: ; preds = %73
%78 = load i32, i32* %6
%79 = load i32, i32* %10
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %80
%82 = call i32 @read(i32 %78, i8* %81, i32 1023)
store i32 %82, i32* %11
%83 = load i32, i32* %11
%84 = icmp eq i32 %83, -1
br i1 %84, label %85, label %87
85: ; preds = %77
%86 = call i32 @error_handling(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %87
87: ; preds = %85, %77
%88 = load i32, i32* %11
%89 = load i32, i32* %10
%90 = add nsw i32 %89, %88
store i32 %90, i32* %10
br label %73
91: ; preds = %73
%92 = load i32, i32* %10
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %93
store i8 0, i8* %94
%95 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%96 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8* %95)
br label %53
97: ; preds = %66
%98 = load i32, i32* %6
%99 = call i32 @close(i32 %98)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [24 x i8] c"Usage : %s <IP> <port>\0A\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [15 x i8] c"socket() error\00"
@AF_INET = global i32 0
@.str.2 = [17 x i8] c"connect() error!\00"
@.str.3 = [21 x i8] c"Connected Success!!!\00"
@.str.4 = [27 x i8] c"Input message(Q to quit): \00"
@stdout = global i32 0
@stdin = global i32 0
@.str.5 = [3 x i8] c"q\0A\00"
@.str.6 = [3 x i8] c"Q\0A\00"
@.str.7 = [14 x i8] c"read() error!\00"
@.str.8 = [27 x i8] c"Message from server : %s \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [1024 x i8]
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 3
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i32, i32* @PF_INET
%14 = load i32, i32* @SOCK_STREAM
%15 = tail call i32 @socket(i32 %13, i32 %14, i32 0)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = tail call i32 @error_handling(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %12
%20 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 12)
%21 = load i32, i32* @AF_INET
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %21, i32* %22
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @inet_addr(i8* %24)
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %25, i32* %26
%27 = getelementptr inbounds i8*, i8** %1, i64 2
%28 = load i8*, i8** %27
%29 = call i32 @atoi(i8* %28)
%30 = call i32 @htons(i32 %29)
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %30, i32* %31
%32 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%33 = call i32 @connect(i32 %15, %struct.sockaddr* %32, i32 12)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %37
35: ; preds = %19
%36 = call i32 @error_handling(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %39
37: ; preds = %19
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
%40 = load i32, i32* @stdout
%41 = call i32 @fputs(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %40)
%42 = load i32, i32* @stdin
%43 = call i32 @fgets(i8* %6, i32 1024, i32 %42)
%44 = call i32 @bcmp(i8* dereferenceable(3) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 3)
%45 = icmp eq i32 %44, 0
br i1 %45, label %75, label %46
46: ; preds = %39, %64
%47 = call i32 @bcmp(i8* dereferenceable(3) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i64 3)
%48 = icmp eq i32 %47, 0
br i1 %48, label %75, label %49
49: ; preds = %46
%50 = call i32 @strlen(i8* %6)
%51 = call i32 @write(i32 %15, i8* %6, i32 %50)
%52 = icmp sgt i32 %51, 0
br i1 %52, label %53, label %64
53: ; preds = %49, %61
%54 = phi i32 [ %62, %61 ], [ 0, %49 ]
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %55
%57 = call i32 @read(i32 %15, i8* %56, i32 1023)
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %61
59: ; preds = %53
%60 = call i32 @error_handling(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %61
61: ; preds = %59, %53
%62 = add nsw i32 %57, %54
%63 = icmp slt i32 %62, %51
br i1 %63, label %53, label %64
64: ; preds = %61, %49
%65 = phi i32 [ 0, %49 ], [ %62, %61 ]
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %66
store i8 0, i8* %67
%68 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%69 = load i32, i32* @stdout
%70 = call i32 @fputs(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %69)
%71 = load i32, i32* @stdin
%72 = call i32 @fgets(i8* %6, i32 1024, i32 %71)
%73 = call i32 @bcmp(i8* dereferenceable(3) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 3)
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %46
75: ; preds = %46, %64, %39
%76 = call i32 @close(i32 %15)
ret i32 0
}