#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*/ serv_addr;

/* 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);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int strlen(char *);
int write(int, char *, int);
int main(int argc, char *argv[]) {
  int sockfd, camNo, n;
  struct sockaddr_in serv_addr;
  struct hostent *server;
  char buffer[256];
  if ((argc < 2) || (strlen(argv[1]) > 1)) {
    printf("Usage: %s [camNo 1-9]\r\n", argv[0]);
    return 0;
  }
  camNo = atoi(argv[1]);
  if ((camNo < 1) || (camNo > 9)) {
    printf("Usage: %s [camNo 1-9]\r\n", argv[0]);
    return 0;
  }
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sockfd < 0) {
    perror("ERROR opening socket");
    exit(1);
  }
  server = gethostbyname("127.0.0.1");
  if (server == NULL) {
    fprintf(stderr, "ERROR, no such host\n");
    exit(0);
  }
  bzero((char *)&serv_addr, sizeof(serv_addr));
  serv_addr.sin_family = AF_INET;
  bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr,
        server->h_length);
  serv_addr.sin_port = htons(7889);
  if (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
    perror("ERROR connecting");
    exit(1);
  }
  printf("Adding timer for camera #%d without flags. ( This utility does not "
         "support setting flags )\r\n",
         camNo);
  bzero(buffer, 256);
  buffer[0] = 'A';
  buffer[1] = camNo + 48;
  buffer[2] = '0';
  buffer[3] = '0';
  buffer[4] = '0';
  buffer[5] = '0';
  n = write(sockfd, buffer, 6);
  if (n < 0) {
    perror("ERROR writing to socket");
    exit(1);
  }
  bzero(buffer, 256);
  n = read(sockfd, buffer, 255);
  if (n < 0) {
    perror("ERROR reading from socket");
    exit(1);
  }
  printf("Response: %s\n", buffer);
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1229 <main+0x39>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jle    124a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1469 <main+0x279>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jl     126e <main+0x7e>
cmpl   $0x9,-0x18(%rbp)
jle    128f <main+0x9f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1469 <main+0x279>
mov    0x2d52(%rip),%rax
mov    (%rax),%edi
mov    0x2d31(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    12cb <main+0xdb>
lea    0xd5c(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xd5b(%rip),%rdi
call   1090 <gethostbyname@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1302 <main+0x112>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
lea    0xd41(%rip),%rsi
call   10a0 <fprintf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
lea    -0x28(%rbp),%rdi
mov    $0xc,%esi
call   10d0 <bzero@plt>
mov    0x2cd1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x28(%rbp),%rsi
add    $0x4,%rsi
mov    -0x30(%rbp),%rax
mov    (%rax),%edx
call   10b0 <bcopy@plt>
mov    $0x1ed1,%edi
call   1050 <htons@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   1100 <connect@plt>
cmp    $0x0,%rax
jge    1375 <main+0x185>
lea    0xce6(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x18(%rbp),%esi
lea    0xcde(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x130(%rbp),%rdi
mov    $0x100,%esi
call   10d0 <bzero@plt>
movb   $0x41,-0x130(%rbp)
mov    -0x18(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x12f(%rbp)
movb   $0x30,-0x12e(%rbp)
movb   $0x30,-0x12d(%rbp)
movb   $0x30,-0x12c(%rbp)
movb   $0x30,-0x12b(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x130(%rbp),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    13fd <main+0x20d>
lea    0xccc(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0x130(%rbp),%rdi
mov    $0x100,%esi
call   10d0 <bzero@plt>
mov    -0x14(%rbp),%edi
lea    -0x130(%rbp),%rsi
mov    $0xff,%edx
call   1080 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1445 <main+0x255>
lea    0xc9c(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0x130(%rbp),%rsi
lea    0xc99(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x110,%rsp
mov    %rsi,%rbp
cmp    $0x2,%edi
jl     1228 <main+0x38>
mov    0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
jge    1228 <main+0x38>
mov    0x8(%rbp),%rdi
call   10e0 <atoi@plt>
mov    %eax,%ebx
lea    -0xa(%rbx),%eax
cmp    $0xfffffff6,%eax
ja     124c <main+0x5c>
mov    0x0(%rbp),%rsi
lea    0xdcd(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d95(%rip),%r12
mov    (%r12),%edi
mov    0x2d72(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
test   %eax,%eax
js     1369 <main+0x179>
mov    %eax,%r14d
lea    0xdb4(%rip),%rdi
call   1090 <gethostbyname@plt>
test   %rax,%rax
je     1372 <main+0x182>
mov    %rax,%rbp
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0xc,%esi
call   10d0 <bzero@plt>
mov    (%r12),%eax
mov    %eax,0x8(%rsp)
mov    0x8(%rbp),%rsi
lea    0x4(%rsp),%rdi
mov    0x0(%rbp),%edx
call   10b0 <memmove@plt>
mov    $0x1ed1,%edi
call   1050 <htons@plt>
mov    %eax,(%rsp)
mov    %r14d,%edi
mov    %r15,%rsi
mov    $0xc,%edx
call   1100 <connect@plt>
test   %rax,%rax
js     138e <main+0x19e>
lea    0xd7d(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x100,%esi
call   10d0 <bzero@plt>
movb   $0x41,0x10(%rsp)
add    $0x30,%bl
mov    %bl,0x11(%rsp)
movl   $0x30303030,0x12(%rsp)
30
mov    %r14d,%edi
mov    %rbp,%rsi
mov    $0x6,%edx
call   1030 <write@plt>
test   %eax,%eax
js     1397 <main+0x1a7>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   10d0 <bzero@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0xff,%edx
call   1080 <read@plt>
test   %eax,%eax
js     13a0 <main+0x1b0>
lea    0xd9c(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14d,%edi
call   1070 <close@plt>
jmp    123a <main+0x4a>
lea    0xca8(%rip),%rdi
jmp    13a7 <main+0x1b7>
mov    0x2c5f(%rip),%rax
mov    (%rax),%edi
lea    0xcb5(%rip),%rsi
call   10a0 <fprintf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
lea    0xcb7(%rip),%rdi
jmp    13a7 <main+0x1b7>
lea    0xd1c(%rip),%rdi
jmp    13a7 <main+0x1b7>
lea    0xd2b(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10f0 <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 }
@.str = [24 x i8] c"Usage: %s [camNo 1-9]\0D\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [21 x i8] c"ERROR opening socket\00"
@.str.2 = [10 x i8] c"127.0.0.1\00"
@stderr = global i32 0
@.str.3 = [21 x i8] c"ERROR, no such host\0A\00"
@.str.4 = [17 x i8] c"ERROR connecting\00"
@.str.5 = [93 x i8] c"Adding timer for camera #%d without flags. ( This utility does not support setting flags )\0D\0A\00"
@.str.6 = [24 x i8] c"ERROR writing to socket\00"
@.str.7 = [26 x i8] c"ERROR reading from socket\00"
@.str.8 = [14 x i8] c"Response: %s\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 [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 2
br i1 %13, label %20, label %14
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strlen(i8* %17)
%19 = icmp sgt i32 %18, 1
br i1 %19, label %20, label %25
20: ; preds = %14, %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %23)
store i32 0, i32* %3
br label %120
25: ; preds = %14
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @atoi(i8* %28)
store i32 %29, i32* %7
%30 = load i32, i32* %7
%31 = icmp slt i32 %30, 1
br i1 %31, label %35, label %32
32: ; preds = %25
%33 = load i32, i32* %7
%34 = icmp sgt i32 %33, 9
br i1 %34, label %35, label %40
35: ; preds = %32, %25
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %38)
store i32 0, i32* %3
br label %120
40: ; preds = %32
%41 = load i32, i32* @AF_INET
%42 = load i32, i32* @SOCK_STREAM
%43 = call i32 @socket(i32 %41, i32 %42, i32 0)
store i32 %43, i32* %6
%44 = load i32, i32* %6
%45 = icmp slt i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %40
%47 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %40
%50 = call %struct.hostent* @gethostbyname(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
store %struct.hostent* %50, %struct.hostent** %10
%51 = load %struct.hostent*, %struct.hostent** %10
%52 = icmp eq %struct.hostent* %51, null
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = load i32, i32* @stderr
%55 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%56 = call i32 @exit(i32 0)
unreachable
57: ; preds = %49
%58 = bitcast %struct.sockaddr_in* %9 to i8*
%59 = call i32 @bzero(i8* %58, i32 12)
%60 = load i32, i32* @AF_INET
%61 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 2
store i32 %60, i32* %61
%62 = load %struct.hostent*, %struct.hostent** %10
%63 = getelementptr inbounds %struct.hostent, %struct.hostent* %62, i32 0, i32 1
%64 = load i64, i64* %63
%65 = inttoptr i64 %64 to i8*
%66 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
%67 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %66, i32 0, i32 0
%68 = bitcast i32* %67 to i8*
%69 = load %struct.hostent*, %struct.hostent** %10
%70 = getelementptr inbounds %struct.hostent, %struct.hostent* %69, i32 0, i32 0
%71 = load i32, i32* %70
%72 = call i32 @bcopy(i8* %65, i8* %68, i32 %71)
%73 = call i32 @htons(i32 7889)
%74 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
store i32 %73, i32* %74
%75 = load i32, i32* %6
%76 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%77 = call i64 @connect(i32 %75, %struct.sockaddr* %76, i32 12)
%78 = icmp slt i64 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %57
%80 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%81 = call i32 @exit(i32 1)
unreachable
82: ; preds = %57
%83 = load i32, i32* %7
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.5, i64 0, i64 0), i32 %83)
%85 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%86 = call i32 @bzero(i8* %85, i32 256)
%87 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
store i8 65, i8* %87
%88 = load i32, i32* %7
%89 = add nsw i32 %88, 48
%90 = trunc i32 %89 to i8
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 1
store i8 %90, i8* %91
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 2
store i8 48, i8* %92
%93 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 3
store i8 48, i8* %93
%94 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 4
store i8 48, i8* %94
%95 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 5
store i8 48, i8* %95
%96 = load i32, i32* %6
%97 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%98 = call i32 @write(i32 %96, i8* %97, i32 6)
store i32 %98, i32* %8
%99 = load i32, i32* %8
%100 = icmp slt i32 %99, 0
br i1 %100, label %101, label %104
101: ; preds = %82
%102 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%103 = call i32 @exit(i32 1)
unreachable
104: ; preds = %82
%105 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%106 = call i32 @bzero(i8* %105, i32 256)
%107 = load i32, i32* %6
%108 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%109 = call i32 @read(i32 %107, i8* %108, i32 255)
store i32 %109, i32* %8
%110 = load i32, i32* %8
%111 = icmp slt i32 %110, 0
br i1 %111, label %112, label %115
112: ; preds = %104
%113 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%114 = call i32 @exit(i32 1)
unreachable
115: ; preds = %104
%116 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %116)
%118 = load i32, i32* %6
%119 = call i32 @close(i32 %118)
store i32 0, i32* %3
br label %120
120: ; preds = %115, %35, %20
%121 = load i32, i32* %3
ret i32 %121
}

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 }
@.str = [24 x i8] c"Usage: %s [camNo 1-9]\0D\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [21 x i8] c"ERROR opening socket\00"
@.str.2 = [10 x i8] c"127.0.0.1\00"
@stderr = global i32 0
@.str.3 = [21 x i8] c"ERROR, no such host\0A\00"
@.str.4 = [17 x i8] c"ERROR connecting\00"
@.str.5 = [93 x i8] c"Adding timer for camera #%d without flags. ( This utility does not support setting flags )\0D\0A\00"
@.str.6 = [24 x i8] c"ERROR writing to socket\00"
@.str.7 = [26 x i8] c"ERROR reading from socket\00"
@.str.8 = [14 x i8] c"Response: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [256 x i8]
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 2
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @strlen(i8* %10)
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %8, %2
%14 = load i8*, i8** %1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %81
16: ; preds = %8
%17 = load i8*, i8** %9
%18 = tail call i32 @atoi(i8* %17)
%19 = add i32 %18, -10
%20 = icmp ult i32 %19, -9
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = load i8*, i8** %1
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %22)
br label %81
24: ; preds = %16
%25 = load i32, i32* @AF_INET
%26 = load i32, i32* @SOCK_STREAM
%27 = tail call i32 @socket(i32 %25, i32 %26, i32 0)
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %24
%30 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%31 = tail call i32 @exit(i32 1)
unreachable
32: ; preds = %24
%33 = tail call %struct.hostent* @gethostbyname(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq %struct.hostent* %33, null
br i1 %34, label %35, label %39
35: ; preds = %32
%36 = load i32, i32* @stderr
%37 = tail call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%38 = tail call i32 @exit(i32 0)
unreachable
39: ; preds = %32
%40 = call i32 @bzero(i8* %5, i32 12)
%41 = load i32, i32* @AF_INET
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %41, i32* %42
%43 = getelementptr inbounds %struct.hostent, %struct.hostent* %33, i64 0, i32 1
%44 = load i64, i64* %43
%45 = inttoptr i64 %44 to i8*
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
%47 = bitcast i32* %46 to i8*
%48 = getelementptr inbounds %struct.hostent, %struct.hostent* %33, i64 0, i32 0
%49 = load i32, i32* %48
%50 = tail call i32 @htons(i32 7889)
%51 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %50, i32* %51
%52 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%53 = call i64 @connect(i32 %27, %struct.sockaddr* %52, i32 12)
%54 = icmp slt i64 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %39
%56 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %39
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @.str.5, i64 0, i64 0), i32 %18)
%60 = call i32 @bzero(i8* %6, i32 256)
store i8 65, i8* %6
%61 = trunc i32 %18 to i8
%62 = add nuw nsw i8 %61, 48
%63 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 1
store i8 %62, i8* %63
%64 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 2
%65 = bitcast i8* %64 to i32*
store i32 808464432, i32* %65
%66 = call i32 @write(i32 %27, i8* %6, i32 6)
%67 = icmp slt i32 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %58
%69 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%70 = call i32 @exit(i32 1)
unreachable
71: ; preds = %58
%72 = call i32 @bzero(i8* %6, i32 256)
%73 = call i32 @read(i32 %27, i8* %6, i32 255)
%74 = icmp slt i32 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %71
%76 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%77 = call i32 @exit(i32 1)
unreachable
78: ; preds = %71
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%80 = call i32 @close(i32 %27)
br label %81
81: ; preds = %78, %21, %13
ret i32 0
}