#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 {
  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);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ copy(char *, int, char *);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ getfile(char *, char *);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ makefile(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ system(char *);
int write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int sockfd, portno, no_of_bytes;
  struct sockaddr_in serveraddr;
  struct hostent *server;
  char buffer[500], temp[500];
  if (argc < 3) {
    printf("usage %s hostname port\n", argv[0]);
    exit(0);
  }
  portno = atoi(argv[2]);
  server = gethostbyname(argv[1]);
  if (server == NULL) {
    printf("ERROR, no such host\n");
    exit(0);
  }
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sockfd < 0)
    error("Error in socket");
  bzero((char *)&serveraddr, sizeof(serveraddr));
  serveraddr.sin_family = AF_INET;
  bcopy((char *)server->h_addr, (char *)&serveraddr.sin_addr.s_addr,
        sizeof(server->h_addr));
  serveraddr.sin_port = htons(portno);
  if (connect(sockfd, (struct sockaddr *)&serveraddr, sizeof(serveraddr)) < 0)
    error("Error in connecting the socket");
  while (1) {
    bzero(buffer, 500);
    printf("768/IT/11_ftp-client> ");
    fgets(buffer, 500 - 1, stdin);
    if (strcmp(buffer, "quit\n") == 0) {
      close(sockfd);
      return 0;
    } else if (strcmp(buffer, "c_pwd\n") == 0) {
      printf("Message from Server:\n\n");
      system("pwd");
      printf("\n");
    } else if (strcmp(buffer, "c_ls\n") == 0) {
      printf("Message from Server:\n\n");
      system("ls");
      printf("\n");
    } else {
      no_of_bytes = write(sockfd, buffer, strlen(buffer));
      if (no_of_bytes < 0) {
        error("Error in writing");
        return 1;
      }
      if (strncmp(buffer, "put", 3) == 0) {
        bzero(temp, 500);
        copy(buffer, 4, temp);
        getfile(buffer, temp);
        no_of_bytes = write(sockfd, buffer, strlen(buffer));
        if (no_of_bytes < 0) {
          error("Error in writing");
          return 1;
        }
        printf("Message from Server:\n\n");
        bzero(buffer, 500);
        no_of_bytes = read(sockfd, buffer, 500 - 1);
        if (no_of_bytes < 0) {
          error("Error in reading");
          break;
        }
        printf("%s\n", buffer);
      } else if (strncmp(buffer, "get", 3) == 0) {
        bzero(temp, 500);
        copy(buffer, 4, temp);
        printf("Message from Server:\n\n");
        bzero(buffer, 500);
        no_of_bytes = read(sockfd, buffer, 500 - 1);
        if (no_of_bytes < 0) {
          error("Error in reading");
          break;
        }
        if (strcmp(buffer, "No such file in Server Directory\n") != 0) {
          makefile(buffer, temp);
          bzero(buffer, 500);
          printf("File created in Client directory.\n");
        } else {
          bzero(buffer, 500);
          printf("No such file in Server Directory.\n");
        }
      } else {
        printf("Message from Server:\n\n");
        bzero(buffer, 500);
        no_of_bytes = read(sockfd, buffer, 500 - 1);
        if (no_of_bytes < 0) {
          error("Error in reading");
          break;
        }
        printf("%s\n", buffer);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    128f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   1140 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1130 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10e0 <gethostbyname@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    12d0 <main+0x80>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   1140 <exit@plt>
mov    0x2d11(%rip),%rax
mov    (%rax),%edi
mov    0x2cf0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1170 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1302 <main+0xb2>
lea    0xd30(%rip),%rdi
call   1110 <error@plt>
lea    -0x28(%rbp),%rdi
mov    $0xc,%esi
call   1120 <bzero@plt>
mov    0x2cd1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
lea    -0x28(%rbp),%rsi
add    $0x4,%rsi
mov    $0x8,%edx
call   1100 <bcopy@plt>
mov    -0x18(%rbp),%edi
call   1070 <htons@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   1150 <connect@plt>
cmp    $0x0,%rax
jge    1367 <main+0x117>
lea    0xcdb(%rip),%rdi
call   1110 <error@plt>
jmp    136c <main+0x11c>
lea    -0x230(%rbp),%rdi
mov    $0x1f4,%esi
call   1120 <bzero@plt>
lea    0xcd8(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x230(%rbp),%rdi
mov    0x2c47(%rip),%rax
mov    (%rax),%edx
mov    $0x1f3,%esi
call   10b0 <fgets@plt>
lea    -0x230(%rbp),%rdi
lea    0xcc0(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    13d6 <main+0x186>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
movl   $0x0,-0x4(%rbp)
jmp    177e <main+0x52e>
lea    -0x230(%rbp),%rdi
lea    0xc95(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1420 <main+0x1d0>
lea    0xc86(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xc8f(%rip),%rdi
call   1060 <system@plt>
lea    0xc81(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1774 <main+0x524>
lea    -0x230(%rbp),%rdi
lea    0xc6d(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    146a <main+0x21a>
lea    0xc3c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xc4f(%rip),%rdi
call   1060 <system@plt>
lea    0xc37(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    176f <main+0x51f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x43c(%rbp)
lea    -0x230(%rbp),%rax
mov    %rax,-0x438(%rbp)
lea    -0x230(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x43c(%rbp),%edi
mov    -0x438(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    14c6 <main+0x276>
lea    0xbef(%rip),%rdi
call   1110 <error@plt>
movl   $0x1,-0x4(%rbp)
jmp    177e <main+0x52e>
lea    -0x230(%rbp),%rdi
lea    0xbe1(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    15eb <main+0x39b>
lea    -0x430(%rbp),%rdi
mov    $0x1f4,%esi
call   1120 <bzero@plt>
lea    -0x230(%rbp),%rdi
lea    -0x430(%rbp),%rdx
mov    $0x4,%esi
call   10c0 <copy@plt>
lea    -0x230(%rbp),%rdi
lea    -0x430(%rbp),%rsi
call   1160 <getfile@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x44c(%rbp)
lea    -0x230(%rbp),%rax
mov    %rax,-0x448(%rbp)
lea    -0x230(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x44c(%rbp),%edi
mov    -0x448(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1580 <main+0x330>
lea    0xb35(%rip),%rdi
call   1110 <error@plt>
movl   $0x1,-0x4(%rbp)
jmp    177e <main+0x52e>
lea    0xaf9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x230(%rbp),%rdi
mov    $0x1f4,%esi
call   1120 <bzero@plt>
mov    -0x14(%rbp),%edi
lea    -0x230(%rbp),%rsi
mov    $0x1f3,%edx
call   10a0 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    15d1 <main+0x381>
lea    0xaf2(%rip),%rdi
call   1110 <error@plt>
jmp    177e <main+0x52e>
lea    -0x230(%rbp),%rsi
lea    0xaeb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    176a <main+0x51a>
lea    -0x230(%rbp),%rdi
lea    0xad5(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    16ff <main+0x4af>
lea    -0x430(%rbp),%rdi
mov    $0x1f4,%esi
call   1120 <bzero@plt>
lea    -0x230(%rbp),%rdi
lea    -0x430(%rbp),%rdx
mov    $0x4,%esi
call   10c0 <copy@plt>
lea    0xa43(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x230(%rbp),%rdi
mov    $0x1f4,%esi
call   1120 <bzero@plt>
mov    -0x14(%rbp),%edi
lea    -0x230(%rbp),%rsi
mov    $0x1f3,%edx
call   10a0 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1687 <main+0x437>
lea    0xa3c(%rip),%rdi
call   1110 <error@plt>
jmp    177e <main+0x52e>
lea    -0x230(%rbp),%rdi
lea    0xa3d(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     16db <main+0x48b>
lea    -0x230(%rbp),%rdi
lea    -0x430(%rbp),%rsi
call   10f0 <makefile@plt>
lea    -0x230(%rbp),%rdi
mov    $0x1f4,%esi
call   1120 <bzero@plt>
lea    0xa25(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    16fa <main+0x4aa>
lea    -0x230(%rbp),%rdi
mov    $0x1f4,%esi
call   1120 <bzero@plt>
lea    0xa24(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1765 <main+0x515>
lea    0x97a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x230(%rbp),%rdi
mov    $0x1f4,%esi
call   1120 <bzero@plt>
mov    -0x14(%rbp),%edi
lea    -0x230(%rbp),%rsi
mov    $0x1f3,%edx
call   10a0 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1750 <main+0x500>
lea    0x973(%rip),%rdi
call   1110 <error@plt>
jmp    177e <main+0x52e>
lea    -0x230(%rbp),%rsi
lea    0x96c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    176a <main+0x51a>
jmp    176f <main+0x51f>
jmp    1774 <main+0x524>
jmp    1779 <main+0x529>
jmp    136c <main+0x11c>
mov    -0x4(%rbp),%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jle    163e <main+0x3de>
mov    0x10(%rbx),%rdi
call   1140 <atoi@plt>
mov    %eax,%r14d
mov    0x8(%rbx),%rdi
call   1100 <gethostbyname@plt>
test   %rax,%rax
je     1656 <main+0x3f6>
mov    %rax,%rbp
mov    0x2d43(%rip),%rax
mov    (%rax),%edi
mov    0x2d22(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1180 <socket@plt>
mov    %eax,%r12d
test   %eax,%eax
jns    12ca <main+0x6a>
lea    0xd53(%rip),%rdi
call   1120 <error@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1130 <bzero@plt>
mov    0x0(%rbp),%rax
mov    (%rax),%rax
mov    %rax,0x4(%rsp)
mov    %r14d,%edi
call   1090 <htons@plt>
mov    %eax,(%rsp)
mov    %r12d,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   1160 <connect@plt>
test   %rax,%rax
jns    1312 <main+0xb2>
lea    0xd1b(%rip),%rdi
call   1120 <error@plt>
lea    0x210(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1f4,%esi
call   1130 <bzero@plt>
lea    0xd19(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x2ca4(%rip),%r14
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x1f3,%esi
call   10d0 <fgets@plt>
lea    0xd0b(%rip),%rsi
mov    %rbx,%rdi
call   10f0 <strcmp@plt>
test   %rax,%rax
je     1601 <main+0x3a1>
lea    0xcf9(%rip),%r15
lea    0x210(%rsp),%rbp
lea    0xccd(%rip),%rbx
lea    0xcdd(%rip),%r13
jmp    13ed <main+0x18d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xd71(%rip),%rdi
call   1050 <puts@plt>
lea    0xcc8(%rip),%rdi
call   1080 <system@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbp,%rdi
mov    $0x1f4,%esi
call   1130 <bzero@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    (%r14),%edx
mov    %rbp,%rdi
mov    $0x1f3,%esi
call   10d0 <fgets@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
call   10f0 <strcmp@plt>
test   %rax,%rax
je     1601 <main+0x3a1>
mov    %rbp,%rdi
mov    %r15,%rsi
call   10f0 <strcmp@plt>
test   %rax,%rax
je     1390 <main+0x130>
mov    %rbp,%rdi
lea    0xc68(%rip),%rsi
call   10f0 <strcmp@plt>
test   %rax,%rax
je     14b0 <main+0x250>
mov    %rbp,%rdi
call   1070 <strlen@plt>
mov    %r12d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <write@plt>
test   %eax,%eax
js     161d <main+0x3bd>
mov    %rbp,%rdi
lea    0xc4d(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     14c8 <main+0x268>
mov    %rbp,%rdi
lea    0xc49(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     154b <main+0x2eb>
lea    0xc99(%rip),%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
mov    $0x1f4,%esi
call   1130 <bzero@plt>
mov    %r12d,%edi
mov    %rbp,%rsi
mov    $0x1f3,%edx
call   10c0 <read@plt>
test   %eax,%eax
js     1630 <main+0x3d0>
mov    %rbp,%rdi
call   1050 <puts@plt>
jmp    13b2 <main+0x152>
cs nopw 0x0(%rax,%rax,1)
lea    0xc51(%rip),%rdi
call   1050 <puts@plt>
lea    0xbb2(%rip),%rdi
jmp    13a3 <main+0x143>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1f4,%esi
call   1130 <bzero@plt>
mov    %rbp,%rdi
mov    $0x4,%esi
mov    %rbx,%rdx
call   10e0 <copy@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1170 <getfile@plt>
mov    %rbp,%rdi
call   1070 <strlen@plt>
mov    %r12d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <write@plt>
test   %eax,%eax
js     161d <main+0x3bd>
lea    0xbef(%rip),%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
mov    $0x1f4,%esi
call   1130 <bzero@plt>
mov    %r12d,%edi
mov    %rbp,%rsi
mov    $0x1f3,%edx
call   10c0 <read@plt>
test   %eax,%eax
js     1630 <main+0x3d0>
mov    %rbp,%rdi
jmp    15f0 <main+0x390>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1f4,%esi
call   1130 <bzero@plt>
mov    %rbp,%rdi
mov    $0x4,%esi
mov    %rbx,%rdx
call   10e0 <copy@plt>
lea    0xb94(%rip),%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
mov    $0x1f4,%esi
call   1130 <bzero@plt>
mov    %r12d,%edi
mov    %rbp,%rsi
mov    $0x1f3,%edx
call   10c0 <read@plt>
test   %eax,%eax
js     1630 <main+0x3d0>
mov    %rbp,%rdi
lea    0xafa(%rip),%rsi
call   10f0 <strcmp@plt>
mov    %rbp,%rdi
test   %rax,%rax
je     15d5 <main+0x375>
lea    0x10(%rsp),%rsi
call   1110 <makefile@plt>
mov    %rbp,%rdi
mov    $0x1f4,%esi
call   1130 <bzero@plt>
lea    0xb13(%rip),%rdi
jmp    15f0 <main+0x390>
mov    $0x1f4,%esi
call   1130 <bzero@plt>
lea    0xade(%rip),%rdi
cs nopw 0x0(%rax,%rax,1)
call   1050 <puts@plt>
lea    0xa4b(%rip),%rbx
jmp    13b2 <main+0x152>
mov    %r12d,%edi
call   10b0 <close@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa54(%rip),%rdi
call   1120 <error@plt>
mov    $0x1,%eax
jmp    160b <main+0x3ab>
lea    0xa56(%rip),%rdi
call   1120 <error@plt>
jmp    1609 <main+0x3a9>
mov    (%rbx),%rsi
lea    0x9b8(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
xor    %edi,%edi
call   1150 <exit@plt>
lea    0xac1(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   1150 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i64 }
%struct.sockaddr = type { i32 }
@.str = [24 x i8] c"usage %s hostname port\0A\00"
@.str.1 = [21 x i8] c"ERROR, no such host\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.2 = [16 x i8] c"Error in socket\00"
@.str.3 = [31 x i8] c"Error in connecting the socket\00"
@.str.4 = [23 x i8] c"768/IT/11_ftp-client> \00"
@stdin = global i32 0
@.str.5 = [6 x i8] c"quit\0A\00"
@.str.6 = [7 x i8] c"c_pwd\0A\00"
@.str.7 = [23 x i8] c"Message from Server:\0A\0A\00"
@.str.8 = [4 x i8] c"pwd\00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [6 x i8] c"c_ls\0A\00"
@.str.11 = [3 x i8] c"ls\00"
@.str.12 = [17 x i8] c"Error in writing\00"
@.str.13 = [4 x i8] c"put\00"
@.str.14 = [17 x i8] c"Error in reading\00"
@.str.15 = [4 x i8] c"%s\0A\00"
@.str.16 = [4 x i8] c"get\00"
@.str.17 = [34 x i8] c"No such file in Server Directory\0A\00"
@.str.18 = [35 x i8] c"File created in Client directory.\0A\00"
@.str.19 = [35 x i8] c"No such file in Server Directory.\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 %struct.sockaddr_in
%10 = alloca %struct.hostent*
%11 = alloca [500 x i8]
%12 = alloca [500 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
store i32 %25, i32* %7
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call %struct.hostent* @gethostbyname(i8* %28)
store %struct.hostent* %29, %struct.hostent** %10
%30 = load %struct.hostent*, %struct.hostent** %10
%31 = icmp eq %struct.hostent* %30, null
br i1 %31, label %32, label %35
32: ; preds = %21
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%34 = call i32 @exit(i32 0)
unreachable
35: ; preds = %21
%36 = load i32, i32* @AF_INET
%37 = load i32, i32* @SOCK_STREAM
%38 = call i32 @socket(i32 %36, i32 %37, i32 0)
store i32 %38, i32* %6
%39 = load i32, i32* %6
%40 = icmp slt i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %35
%42 = call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %43
43: ; preds = %41, %35
%44 = bitcast %struct.sockaddr_in* %9 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* %9, i32 0, i32 2
store i32 %46, i32* %47
%48 = load %struct.hostent*, %struct.hostent** %10
%49 = getelementptr inbounds %struct.hostent, %struct.hostent* %48, i32 0, i32 0
%50 = load i64, i64* %49
%51 = inttoptr i64 %50 to i8*
%52 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, 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 = call i32 @bcopy(i8* %51, i8* %54, i32 8)
%56 = load i32, i32* %7
%57 = call i32 @htons(i32 %56)
%58 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
store i32 %57, i32* %58
%59 = load i32, i32* %6
%60 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%61 = call i64 @connect(i32 %59, %struct.sockaddr* %60, i32 12)
%62 = icmp slt i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %43
%64 = call i32 @error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %65
65: ; preds = %63, %43
br label %66
66: ; preds = %65, %195
%67 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%68 = call i32 @bzero(i8* %67, i32 500)
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%70 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%71 = load i32, i32* @stdin
%72 = call i32 @fgets(i8* %70, i32 499, i32 %71)
%73 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%74 = call i64 @strcmp(i8* %73, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %79
76: ; preds = %66
%77 = load i32, i32* %6
%78 = call i32 @close(i32 %77)
store i32 0, i32* %3
br label %196
79: ; preds = %66
%80 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %87
83: ; preds = %79
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%85 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %194
87: ; preds = %79
%88 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%89 = call i64 @strcmp(i8* %88, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %95
91: ; preds = %87
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%93 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %193
95: ; preds = %87
%96 = load i32, i32* %6
%97 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%98 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%99 = call i32 @strlen(i8* %98)
%100 = call i32 @write(i32 %96, i8* %97, i32 %99)
store i32 %100, i32* %8
%101 = load i32, i32* %8
%102 = icmp slt i32 %101, 0
br i1 %102, label %103, label %105
103: ; preds = %95
%104 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
store i32 1, i32* %3
br label %196
105: ; preds = %95
%106 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%107 = call i64 @strncmp(i8* %106, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i32 3)
%108 = icmp eq i64 %107, 0
br i1 %108, label %109, label %141
109: ; preds = %105
%110 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%111 = call i32 @bzero(i8* %110, i32 500)
%112 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%113 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%114 = call i32 @copy(i8* %112, i32 4, i8* %113)
%115 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%116 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%117 = call i32 @getfile(i8* %115, i8* %116)
%118 = load i32, i32* %6
%119 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%120 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%121 = call i32 @strlen(i8* %120)
%122 = call i32 @write(i32 %118, i8* %119, i32 %121)
store i32 %122, i32* %8
%123 = load i32, i32* %8
%124 = icmp slt i32 %123, 0
br i1 %124, label %125, label %127
125: ; preds = %109
%126 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
store i32 1, i32* %3
br label %196
127: ; preds = %109
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%129 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%130 = call i32 @bzero(i8* %129, i32 500)
%131 = load i32, i32* %6
%132 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%133 = call i32 @read(i32 %131, i8* %132, i32 499)
store i32 %133, i32* %8
%134 = load i32, i32* %8
%135 = icmp slt i32 %134, 0
br i1 %135, label %136, label %138
136: ; preds = %127
%137 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
br label %196
138: ; preds = %127
%139 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* %139)
br label %192
141: ; preds = %105
%142 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%143 = call i64 @strncmp(i8* %142, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 3)
%144 = icmp eq i64 %143, 0
br i1 %144, label %145, label %177
145: ; preds = %141
%146 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%147 = call i32 @bzero(i8* %146, i32 500)
%148 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%149 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%150 = call i32 @copy(i8* %148, i32 4, i8* %149)
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%152 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%153 = call i32 @bzero(i8* %152, i32 500)
%154 = load i32, i32* %6
%155 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%156 = call i32 @read(i32 %154, i8* %155, i32 499)
store i32 %156, i32* %8
%157 = load i32, i32* %8
%158 = icmp slt i32 %157, 0
br i1 %158, label %159, label %161
159: ; preds = %145
%160 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
br label %196
161: ; preds = %145
%162 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%163 = call i64 @strcmp(i8* %162, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.17, i64 0, i64 0))
%164 = icmp ne i64 %163, 0
br i1 %164, label %165, label %172
165: ; preds = %161
%166 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%167 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%168 = call i32 @makefile(i8* %166, i8* %167)
%169 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%170 = call i32 @bzero(i8* %169, i32 500)
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.18, i64 0, i64 0))
br label %176
172: ; preds = %161
%173 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%174 = call i32 @bzero(i8* %173, i32 500)
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.19, i64 0, i64 0))
br label %176
176: ; preds = %172, %165
br label %191
177: ; preds = %141
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%179 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%180 = call i32 @bzero(i8* %179, i32 500)
%181 = load i32, i32* %6
%182 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%183 = call i32 @read(i32 %181, i8* %182, i32 499)
store i32 %183, i32* %8
%184 = load i32, i32* %8
%185 = icmp slt i32 %184, 0
br i1 %185, label %186, label %188
186: ; preds = %177
%187 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
br label %196
188: ; preds = %177
%189 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* %189)
br label %191
191: ; preds = %188, %176
br label %192
192: ; preds = %191, %138
br label %193
193: ; preds = %192, %91
br label %194
194: ; preds = %193, %83
br label %195
195: ; preds = %194
br label %66
196: ; preds = %76, %103, %125, %186, %159, %136
%197 = load i32, i32* %3
ret i32 %197
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i64 }
%struct.sockaddr = type { i32 }
@.str = [24 x i8] c"usage %s hostname port\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.2 = [16 x i8] c"Error in socket\00"
@.str.3 = [31 x i8] c"Error in connecting the socket\00"
@.str.4 = [23 x i8] c"768/IT/11_ftp-client> \00"
@stdin = global i32 0
@.str.5 = [6 x i8] c"quit\0A\00"
@.str.6 = [7 x i8] c"c_pwd\0A\00"
@.str.8 = [4 x i8] c"pwd\00"
@.str.10 = [6 x i8] c"c_ls\0A\00"
@.str.11 = [3 x i8] c"ls\00"
@.str.12 = [17 x i8] c"Error in writing\00"
@.str.13 = [4 x i8] c"put\00"
@.str.14 = [17 x i8] c"Error in reading\00"
@.str.16 = [4 x i8] c"get\00"
@.str.17 = [34 x i8] c"No such file in Server Directory\0A\00"
@str.21 = [34 x i8] c"No such file in Server Directory.\00"
@str.22 = [34 x i8] c"File created in Client directory.\00"
@str.25 = [22 x i8] c"Message from Server:\0A\00"
@str.26 = [20 x i8] c"ERROR, no such host\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [500 x i8]
%5 = alloca [500 x i8]
%6 = bitcast %struct.sockaddr_in* %3 to i8*
%7 = getelementptr inbounds [500 x i8], [500 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 0
%9 = icmp slt i32 %0, 3
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = tail call i32 @exit(i32 0)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = tail call %struct.hostent* @gethostbyname(i8* %19)
%21 = icmp eq %struct.hostent* %20, null
br i1 %21, label %22, label %25
22: ; preds = %14
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.26, i64 0, i64 0))
%24 = tail call i32 @exit(i32 0)
unreachable
25: ; preds = %14
%26 = load i32, i32* @AF_INET
%27 = load i32, i32* @SOCK_STREAM
%28 = tail call i32 @socket(i32 %26, i32 %27, i32 0)
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = tail call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %30, %25
%33 = call i32 @bzero(i8* %6, i32 12)
%34 = getelementptr inbounds %struct.hostent, %struct.hostent* %20, i64 0, i32 0
%35 = load i64, i64* %34
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
%37 = inttoptr i64 %35 to i64*
%38 = bitcast i32* %36 to i64*
%39 = load i64, i64* %37
store i64 %39, i64* %38
%40 = tail call i32 @htons(i32 %17)
%41 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %40, i32* %41
%42 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%43 = call i64 @connect(i32 %28, %struct.sockaddr* %42, i32 12)
%44 = icmp slt i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %32
%46 = call i32 @error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %47
47: ; preds = %45, %32
%48 = call i32 @bzero(i8* %7, i32 500)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%50 = load i32, i32* @stdin
%51 = call i32 @fgets(i8* %7, i32 499, i32 %50)
%52 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %128, %47
%55 = call i32 @close(i32 %28)
br label %135
56: ; preds = %47, %128
%57 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %63
59: ; preds = %56
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.25, i64 0, i64 0))
%61 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%62 = call i32 @putchar(i32 10)
br label %128
63: ; preds = %56
%64 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %63
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.25, i64 0, i64 0))
%68 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%69 = call i32 @putchar(i32 10)
br label %128
70: ; preds = %63
%71 = call i32 @strlen(i8* %7)
%72 = call i32 @write(i32 %28, i8* %7, i32 %71)
%73 = icmp slt i32 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %70
%75 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
br label %135
76: ; preds = %70
%77 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i32 3)
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %97
79: ; preds = %76
%80 = call i32 @bzero(i8* %8, i32 500)
%81 = call i32 @copy(i8* %7, i32 4, i8* %8)
%82 = call i32 @getfile(i8* %7, i8* %8)
%83 = call i32 @strlen(i8* %7)
%84 = call i32 @write(i32 %28, i8* %7, i32 %83)
%85 = icmp slt i32 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %79
%87 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
br label %135
88: ; preds = %79
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.25, i64 0, i64 0))
%90 = call i32 @bzero(i8* %7, i32 500)
%91 = call i32 @read(i32 %28, i8* %7, i32 499)
%92 = icmp slt i32 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %88
%94 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
br label %135
95: ; preds = %88
%96 = call i32 @puts(i8* %7)
br label %128
97: ; preds = %76
%98 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 3)
%99 = icmp eq i64 %98, 0
br i1 %99, label %100, label %119
100: ; preds = %97
%101 = call i32 @bzero(i8* %8, i32 500)
%102 = call i32 @copy(i8* %7, i32 4, i8* %8)
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.25, i64 0, i64 0))
%104 = call i32 @bzero(i8* %7, i32 500)
%105 = call i32 @read(i32 %28, i8* %7, i32 499)
%106 = icmp slt i32 %105, 0
br i1 %106, label %107, label %109
107: ; preds = %100
%108 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
br label %135
109: ; preds = %100
%110 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.17, i64 0, i64 0))
%111 = icmp eq i64 %110, 0
br i1 %111, label %116, label %112
112: ; preds = %109
%113 = call i32 @makefile(i8* %7, i8* %8)
%114 = call i32 @bzero(i8* %7, i32 500)
%115 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.22, i64 0, i64 0))
br label %128
116: ; preds = %109
%117 = call i32 @bzero(i8* %7, i32 500)
%118 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.21, i64 0, i64 0))
br label %128
119: ; preds = %97
%120 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.25, i64 0, i64 0))
%121 = call i32 @bzero(i8* %7, i32 500)
%122 = call i32 @read(i32 %28, i8* %7, i32 499)
%123 = icmp slt i32 %122, 0
br i1 %123, label %124, label %126
124: ; preds = %119
%125 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
br label %135
126: ; preds = %119
%127 = call i32 @puts(i8* %7)
br label %128
128: ; preds = %59, %95, %112, %116, %126, %66
%129 = call i32 @bzero(i8* %7, i32 500)
%130 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%131 = load i32, i32* @stdin
%132 = call i32 @fgets(i8* %7, i32 499, i32 %131)
%133 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%134 = icmp eq i64 %133, 0
br i1 %134, label %54, label %56
135: ; preds = %93, %107, %124, %86, %74, %54
%136 = phi i32 [ 0, %54 ], [ 1, %74 ], [ 1, %86 ], [ 0, %124 ], [ 0, %107 ], [ 0, %93 ]
ret i32 %136
}