#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 socklen_t;
typedef int /*<<< orphan*/ serverAddr;
typedef int /*<<< orphan*/ clientAddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
int atoi(char *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ help(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
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 != 3) {
    help(argv[0]);
    exit(1);
  }
  int sockfd;
  int newsockfd;
  int port;
  int chk;
  struct sockaddr_in serverAddr;
  struct sockaddr_in clientAddr;
  char buf[256];
  socklen_t clilen;
  printf("socket establishing...\n");
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sockfd < 0)
    error("ERROR socket open failed");
  port = atoi(argv[1]);
  bzero((char *)&serverAddr, sizeof(serverAddr));
  serverAddr.sin_family = AF_INET;
  serverAddr.sin_addr.s_addr = INADDR_ANY;
  serverAddr.sin_port = htons(port);
  chk = bind(sockfd, (struct sockaddr *)&serverAddr, sizeof(serverAddr));
  if (chk < 0)
    error("ERROR bind failed");
  listen(sockfd, 5);
  clilen = sizeof(clientAddr);
  newsockfd = accept(sockfd, (struct sockaddr *)&clientAddr, &clilen);
  printf("connected!\n");
  if (newsockfd < 0)
    error("ERROR acception failed");
  while (1) {
    bzero(buf, 256);
    chk = read(newsockfd, buf, 255);
    if (chk < 0)
      error("ERROR connection failed");
    printf("%s\n", buf);
    printf("you => ");
    bzero(buf, 256);
    fgets(buf, 255, stdin);
    if (!strncmp(buf, "qq", 2)) {
      printf("quit command\n");
      break;
    }
    chk = write(newsockfd, buf, strlen(buf));
    if (chk < 0)
      error("ERROR on writing");
  }
  close(newsockfd);
  close(sockfd);
  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)
cmpl   $0x3,-0x8(%rbp)
je     1249 <main+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1100 <help@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2d8a(%rip),%rax
mov    (%rax),%edi
mov    0x2d61(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1289 <main+0x79>
lea    0xd94(%rip),%rdi
call   10d0 <error@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1110 <atoi@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0xc,%esi
call   10e0 <bzero@plt>
mov    0x2d3a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2d1e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x1c(%rbp),%edi
call   1060 <htons@plt>
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0xc,%edx
call   10c0 <bind@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    12f4 <main+0xe4>
lea    0xd42(%rip),%rdi
call   10d0 <error@plt>
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   10b0 <listen@plt>
movl   $0xc,-0x144(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x40(%rbp),%rsi
lea    -0x144(%rbp),%rdx
call   10f0 <accept@plt>
mov    %eax,-0x18(%rbp)
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
jge    1345 <main+0x135>
lea    0xd0f(%rip),%rdi
call   10d0 <error@plt>
jmp    134a <main+0x13a>
lea    -0x140(%rbp),%rdi
mov    $0x100,%esi
call   10e0 <bzero@plt>
mov    -0x18(%rbp),%edi
lea    -0x140(%rbp),%rsi
mov    $0xff,%edx
call   1090 <read@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1388 <main+0x178>
lea    0xce3(%rip),%rdi
call   10d0 <error@plt>
lea    -0x140(%rbp),%rsi
lea    0xce8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xcde(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x140(%rbp),%rdi
mov    $0x100,%esi
call   10e0 <bzero@plt>
lea    -0x140(%rbp),%rdi
mov    0x2c16(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   10a0 <fgets@plt>
lea    -0x140(%rbp),%rdi
lea    0xca6(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    140a <main+0x1fa>
lea    0xc8f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    145f <main+0x24f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x154(%rbp)
lea    -0x140(%rbp),%rax
mov    %rax,-0x150(%rbp)
lea    -0x140(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x154(%rbp),%edi
mov    -0x150(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    145a <main+0x24a>
lea    0xc46(%rip),%rdi
call   10d0 <error@plt>
jmp    134a <main+0x13a>
mov    -0x18(%rbp),%edi
call   1080 <close@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
xor    %eax,%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    $0x138,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    1314 <main+0xf4>
lea    0xe32(%rip),%rdi
call   1040 <puts@plt>
mov    0x2d98(%rip),%r14
mov    (%r14),%edi
mov    0x2d6e(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1140 <socket@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1275 <main+0x55>
lea    0xd90(%rip),%rdi
call   10e0 <error@plt>
mov    0x8(%rbx),%rdi
call   1120 <atoi@plt>
mov    %eax,%ebx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0xc,%esi
call   10f0 <bzero@plt>
mov    (%r14),%eax
mov    %eax,0x18(%rsp)
mov    0x2d38(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    %ebx,%edi
call   1070 <htons@plt>
mov    %eax,0x10(%rsp)
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0xc,%edx
call   10d0 <bind@plt>
test   %eax,%eax
jns    12d0 <main+0xb0>
lea    0xd4e(%rip),%rdi
call   10e0 <error@plt>
mov    %ebp,%edi
mov    $0x5,%esi
call   10c0 <listen@plt>
movl   $0xc,0xc(%rsp)
lea    0x20(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %ebp,0x8(%rsp)
mov    %ebp,%edi
call   1100 <accept@plt>
mov    %eax,%ebp
lea    0xd8b(%rip),%rdi
call   1040 <puts@plt>
lea    0xd1d(%rip),%rdi
test   %ebp,%ebp
jns    132b <main+0x10b>
jmp    1326 <main+0x106>
mov    (%rbx),%rdi
call   1110 <help@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
call   10e0 <error@plt>
lea    0x30(%rsp),%rbx
lea    0xd0b(%rip),%r12
lea    0xd1c(%rip),%r13
mov    0x2c9b(%rip),%r15
lea    0xd16(%rip),%r14
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x100,%esi
call   10f0 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xff,%edx
call   10a0 <read@plt>
test   %eax,%eax
jns    1378 <main+0x158>
mov    %r12,%rdi
call   10e0 <error@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   10f0 <bzero@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0xff,%esi
call   10b0 <fgets@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13e3 <main+0x1c3>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
test   %eax,%eax
jns    1350 <main+0x130>
lea    0xc87(%rip),%rdi
jmp    1326 <main+0x106>
lea    0xcae(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
call   1090 <close@plt>
mov    0x8(%rsp),%edi
call   1090 <close@plt>
xor    %eax,%eax
add    $0x138,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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