#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;
};
struct hostent {
  int /*<<< orphan*/ h_length;
  scalar_t__ h_addr;
};
typedef int /*<<< orphan*/ serverAddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int atoi(char *);
int /*<<< orphan*/ bcopy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ help(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (argc != 4) {
    help(argv[0]);
    exit(1);
  }
  int sockfd;
  int port;
  int chk;
  char buf[256];
  struct sockaddr_in serverAddr;
  struct hostent *server;
  port = atoi(argv[2]);
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sockfd < 0)
    error("ERROR socket open failed");
  server = gethostbyname(argv[1]);
  if (server == NULL) {
    fprintf(stderr, "ERROR no host");
    exit(0);
  }
  bzero((char *)&serverAddr, sizeof(serverAddr));
  serverAddr.sin_family = AF_INET;
  bcopy((char *)server->h_addr, (char *)&serverAddr.sin_addr.s_addr,
        server->h_length);
  serverAddr.sin_port = htons(port);
  chk = connect(sockfd, (struct sockaddr *)&serverAddr, sizeof(serverAddr));
  if (chk < 0)
    error("ERROR connection failed");
  while (1) {
    bzero(buf, 256);
    printf("you => ");
    fgets(buf, 255, stdin);
    if (!strncmp(buf, "qq", 2)) {
      printf("quit commander\n");
      break;
    }
    chk = write(sockfd, buf, strlen(buf));
    if (chk < 0)
      error("ERROR on writing");
    bzero(buf, 256);
    chk = read(sockfd, buf, 255);
    if (chk < 0)
      error("ERROR on reading");
    printf("%s\n", buf);
  }
  close(sockfd);
  printf("connection close\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1259 <main+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1100 <help@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1110 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    0x2d78(%rip),%rax
mov    (%rax),%edi
mov    0x2d4f(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1140 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    129b <main+0x7b>
lea    0xd6a(%rip),%rdi
call   10e0 <error@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <gethostbyname@plt>
mov    %rax,-0x138(%rbp)
cmpq   $0x0,-0x138(%rbp)
jne    12d9 <main+0xb9>
mov    0x2d0c(%rip),%rax
mov    (%rax),%edi
lea    0xd4c(%rip),%rsi
call   10c0 <fprintf@plt>
xor    %edi,%edi
call   1120 <exit@plt>
lea    -0x130(%rbp),%rdi
mov    $0xc,%esi
call   10f0 <bzero@plt>
mov    0x2cf7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x128(%rbp)
mov    -0x138(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x130(%rbp),%rsi
add    $0x4,%rsi
mov    -0x138(%rbp),%rax
mov    (%rax),%edx
call   10d0 <bcopy@plt>
mov    -0x18(%rbp),%edi
call   1060 <htons@plt>
mov    %eax,-0x130(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x130(%rbp),%rsi
mov    $0xc,%edx
call   1130 <connect@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1358 <main+0x138>
lea    0xcd4(%rip),%rdi
call   10e0 <error@plt>
jmp    135d <main+0x13d>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   10f0 <bzero@plt>
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x120(%rbp),%rdi
mov    0x2c56(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   10a0 <fgets@plt>
lea    -0x120(%rbp),%rdi
lea    0xca3(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    13ca <main+0x1aa>
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1472 <main+0x252>
mov    -0x14(%rbp),%eax
mov    %eax,-0x144(%rbp)
lea    -0x120(%rbp),%rax
mov    %rax,-0x140(%rbp)
lea    -0x120(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x144(%rbp),%edi
mov    -0x140(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    141a <main+0x1fa>
lea    0xc45(%rip),%rdi
call   10e0 <error@plt>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   10f0 <bzero@plt>
mov    -0x14(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0xff,%edx
call   1090 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1458 <main+0x238>
lea    0xc18(%rip),%rdi
call   10e0 <error@plt>
lea    -0x120(%rbp),%rsi
lea    0xc16(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    135d <main+0x13d>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
lea    0xbff(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rsi,%rbx
cmp    $0x4,%edi
jne    142b <main+0x1fb>
mov    0x10(%rbx),%rdi
call   1120 <atoi@plt>
mov    %eax,%r14d
mov    0x2d88(%rip),%r12
mov    (%r12),%edi
mov    0x2d5d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1150 <socket@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1286 <main+0x56>
lea    0xd7f(%rip),%rdi
call   10f0 <error@plt>
mov    0x8(%rbx),%rdi
call   10c0 <gethostbyname@plt>
test   %rax,%rax
je     143d <main+0x20d>
mov    %rax,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0xc,%esi
call   1100 <bzero@plt>
mov    (%r12),%eax
mov    %eax,0x8(%rsp)
mov    0x8(%rbx),%rsi
lea    0x4(%rsp),%rdi
mov    (%rbx),%edx
call   10e0 <memmove@plt>
mov    %r14d,%edi
call   1070 <htons@plt>
mov    %eax,(%rsp)
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0xc,%edx
call   1140 <connect@plt>
test   %eax,%eax
jns    12ed <main+0xbd>
lea    0xd3f(%rip),%rdi
call   10f0 <error@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1100 <bzero@plt>
lea    0xd39(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2ccc(%rip),%r14
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0xff,%esi
call   10b0 <fgets@plt>
lea    0xd1c(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13f8 <main+0x1c8>
lea    0x10(%rsp),%rbx
lea    0xd0f(%rip),%r15
lea    0xcec(%rip),%r12
lea    0xced(%rip),%r13
jmp    13a3 <main+0x173>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1100 <bzero@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0xff,%esi
call   10b0 <fgets@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13f8 <main+0x1c8>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
test   %eax,%eax
jns    13c7 <main+0x197>
lea    0xc88(%rip),%rdi
call   10f0 <error@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1100 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xff,%edx
call   10a0 <read@plt>
test   %eax,%eax
jns    1360 <main+0x130>
mov    %r15,%rdi
call   10f0 <error@plt>
jmp    1360 <main+0x130>
lea    0xc6d(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
call   1090 <close@plt>
lea    0xc69(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rdi
call   1110 <help@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
mov    0x2b8c(%rip),%rax
mov    (%rax),%edi
lea    0xbcc(%rip),%rsi
call   10d0 <fprintf@plt>
xor    %edi,%edi
call   1130 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [25 x i8] c"ERROR socket open failed\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"ERROR no host\00"
@.str.2 = [24 x i8] c"ERROR connection failed\00"
@.str.3 = [8 x i8] c"you => \00"
@stdin = global i32 0
@.str.4 = [3 x i8] c"qq\00"
@.str.5 = [16 x i8] c"quit commander\0A\00"
@.str.6 = [17 x i8] c"ERROR on writing\00"
@.str.7 = [17 x i8] c"ERROR on reading\00"
@.str.8 = [4 x i8] c"%s\0A\00"
@.str.9 = [18 x i8] c"connection close\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [256 x i8]
%10 = alloca %struct.sockaddr_in
%11 = alloca %struct.hostent*
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, 4
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 @help(i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i32 @atoi(i8* %23)
store i32 %24, i32* %7
%25 = load i32, i32* @AF_INET
%26 = load i32, i32* @SOCK_STREAM
%27 = call i32 @socket(i32 %25, i32 %26, i32 0)
store i32 %27, i32* %6
%28 = load i32, i32* %6
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %20
%31 = call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %32
32: ; preds = %30, %20
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call %struct.hostent* @gethostbyname(i8* %35)
store %struct.hostent* %36, %struct.hostent** %11
%37 = load %struct.hostent*, %struct.hostent** %11
%38 = icmp eq %struct.hostent* %37, null
br i1 %38, label %39, label %43
39: ; preds = %32
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%42 = call i32 @exit(i32 0)
unreachable
43: ; preds = %32
%44 = bitcast %struct.sockaddr_in* %10 to i8*
%45 = call i32 @bzero(i8* %44, i32 12)
%46 = load i32, i32* @AF_INET
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 2
store i32 %46, i32* %47
%48 = load %struct.hostent*, %struct.hostent** %11
%49 = getelementptr inbounds %struct.hostent, %struct.hostent* %48, i32 0, i32 1
%50 = load i64, i64* %49
%51 = inttoptr i64 %50 to i8*
%52 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 1
%53 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %52, i32 0, i32 0
%54 = bitcast i32* %53 to i8*
%55 = load %struct.hostent*, %struct.hostent** %11
%56 = getelementptr inbounds %struct.hostent, %struct.hostent* %55, i32 0, i32 0
%57 = load i32, i32* %56
%58 = call i32 @bcopy(i8* %51, i8* %54, i32 %57)
%59 = load i32, i32* %7
%60 = call i32 @htons(i32 %59)
%61 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 0
store i32 %60, i32* %61
%62 = load i32, i32* %6
%63 = bitcast %struct.sockaddr_in* %10 to %struct.sockaddr*
%64 = call i32 @connect(i32 %62, %struct.sockaddr* %63, i32 12)
store i32 %64, i32* %8
%65 = load i32, i32* %8
%66 = icmp slt i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %43
%68 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %69
69: ; preds = %67, %43
br label %70
70: ; preds = %69, %102
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%72 = call i32 @bzero(i8* %71, i32 256)
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%74 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%75 = load i32, i32* @stdin
%76 = call i32 @fgets(i8* %74, i32 255, i32 %75)
%77 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%78 = call i32 @strncmp(i8* %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%79 = icmp ne i32 %78, 0
br i1 %79, label %82, label %80
80: ; preds = %70
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %105
82: ; preds = %70
%83 = load i32, i32* %6
%84 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%85 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%86 = call i32 @strlen(i8* %85)
%87 = call i32 @write(i32 %83, i8* %84, i32 %86)
store i32 %87, i32* %8
%88 = load i32, i32* %8
%89 = icmp slt i32 %88, 0
br i1 %89, label %90, label %92
90: ; preds = %82
%91 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %92
92: ; preds = %90, %82
%93 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%94 = call i32 @bzero(i8* %93, i32 256)
%95 = load i32, i32* %6
%96 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%97 = call i32 @read(i32 %95, i8* %96, i32 255)
store i32 %97, i32* %8
%98 = load i32, i32* %8
%99 = icmp slt i32 %98, 0
br i1 %99, label %100, label %102
100: ; preds = %92
%101 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
br label %102
102: ; preds = %100, %92
%103 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %103)
br label %70
105: ; preds = %80
%106 = load i32, i32* %6
%107 = call i32 @close(i32 %106)
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [25 x i8] c"ERROR socket open failed\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"ERROR no host\00"
@.str.2 = [24 x i8] c"ERROR connection failed\00"
@.str.3 = [8 x i8] c"you => \00"
@stdin = global i32 0
@.str.4 = [3 x i8] c"qq\00"
@.str.6 = [17 x i8] c"ERROR on writing\00"
@.str.7 = [17 x i8] c"ERROR on reading\00"
@str = [15 x i8] c"quit commander\00"
@str.10 = [17 x i8] c"connection close\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca %struct.sockaddr_in
%5 = icmp eq i32 %0, 4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @help(i8* %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%12 = bitcast %struct.sockaddr_in* %4 to i8*
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i32 @atoi(i8* %14)
%16 = load i32, i32* @AF_INET
%17 = load i32, i32* @SOCK_STREAM
%18 = tail call i32 @socket(i32 %16, i32 %17, i32 0)
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %10
%21 = tail call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %10
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = tail call %struct.hostent* @gethostbyname(i8* %24)
%26 = icmp eq %struct.hostent* %25, null
br i1 %26, label %27, label %31
27: ; preds = %22
%28 = load i32, i32* @stderr
%29 = tail call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%30 = tail call i32 @exit(i32 0)
unreachable
31: ; preds = %22
%32 = call i32 @bzero(i8* %12, i32 12)
%33 = load i32, i32* @AF_INET
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %33, i32* %34
%35 = getelementptr inbounds %struct.hostent, %struct.hostent* %25, i64 0, i32 1
%36 = load i64, i64* %35
%37 = inttoptr i64 %36 to i8*
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
%39 = bitcast i32* %38 to i8*
%40 = getelementptr inbounds %struct.hostent, %struct.hostent* %25, i64 0, i32 0
%41 = load i32, i32* %40
%42 = tail call i32 @htons(i32 %15)
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
store i32 %42, i32* %43
%44 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%45 = call i32 @connect(i32 %18, %struct.sockaddr* %44, i32 12)
%46 = icmp slt i32 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %31
%48 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %49
49: ; preds = %47, %31
%50 = call i32 @bzero(i8* %11, i32 256)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%52 = load i32, i32* @stdin
%53 = call i32 @fgets(i8* %11, i32 255, i32 %52)
%54 = call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %60
56: ; preds = %72, %49
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%58 = call i32 @close(i32 %18)
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.10, i64 0, i64 0))
ret i32 0
60: ; preds = %49, %72
%61 = call i32 @strlen(i8* %11)
%62 = call i32 @write(i32 %18, i8* %11, i32 %61)
%63 = icmp slt i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %60
%65 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %66
66: ; preds = %64, %60
%67 = call i32 @bzero(i8* %11, i32 256)
%68 = call i32 @read(i32 %18, i8* %11, i32 255)
%69 = icmp slt i32 %68, 0
br i1 %69, label %70, label %72
70: ; preds = %66
%71 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
br label %72
72: ; preds = %70, %66
%73 = call i32 @puts(i8* %11)
%74 = call i32 @bzero(i8* %11, i32 256)
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%76 = load i32, i32* @stdin
%77 = call i32 @fgets(i8* %11, i32 255, i32 %76)
%78 = call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%79 = icmp eq i32 %78, 0
br i1 %79, label %56, label %60
}