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

/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssocket;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ htons(int);
int inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
char *malloc(int);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
scalar_t__ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strlen(char const *);
int email_send(const char *address, const char *body) {
  int fd;
  int truth = 1;
  struct sockaddr_in ssocket;
  assert(0 <= (fd = socket(AF_INET, SOCK_STREAM, 0)));
  memset(&ssocket, 0, sizeof(struct sockaddr_in));
  ssocket.sin_family = AF_INET;
  ssocket.sin_port = htons(25);
  if (1 != inet_pton(AF_INET, "smtp.tcnj.edu", &ssocket.sin_addr))
    return -1;
  assert(0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &truth, sizeof(int)));
  if (0 != connect(fd, (struct sockaddr *)&ssocket, sizeof(ssocket)))
    return -1;
  char *message = malloc((16 + strlen(address) + strlen(body)) * sizeof(char));
  sprintf(message, "HELO localhost\r\n");
  assert(0 <= send(fd, message, strlen(message), 0));
  sprintf(message, "MAIL FROM: %s\r\n", "admin@tcnj.edu");
  assert(0 <= send(fd, message, strlen(message), 0));
  sprintf(message, "RCPT TO: %s\r\n", address);
  assert(0 <= send(fd, message, strlen(message), 0));
  sprintf(message, "DATA\r\n");
  assert(0 <= send(fd, message, strlen(message), 0));
  sprintf(message, "%s\r\n.\r\n", body);
  assert(0 <= send(fd, message, strlen(message), 0));
  sprintf(message, "QUIT\r\n");
  assert(0 <= send(fd, message, strlen(message), 0));
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<email_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
mov    0x2de6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,%ecx
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1070 <memset@plt>
mov    0x2dc0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    $0x19,%edi
call   1050 <htons@plt>
mov    %eax,-0x2c(%rbp)
mov    0x2da7(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rdx
lea    0xdba(%rip),%rsi
call   10a0 <inet_pton@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1266 <email_send+0xa6>
movl   $0xffffffff,-0x4(%rbp)
jmp    1504 <email_send+0x344>
mov    -0x1c(%rbp),%edi
mov    0x2d78(%rip),%rax
mov    (%rax),%esi
mov    0x2d4f(%rip),%rax
mov    (%rax),%edx
lea    -0x20(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x1c(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0xc,%edx
call   10d0 <connect@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     12ca <email_send+0x10a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1504 <email_send+0x344>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x10,%eax
mov    %eax,-0x98(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x98(%rbp),%eax
add    %ecx,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xd03(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x94(%rbp),%edi
mov    -0x90(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x38(%rbp),%rdi
lea    0xcba(%rip),%rsi
lea    0xcc3(%rip),%rdx
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x84(%rbp),%edi
mov    -0x80(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xc7a(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x74(%rbp),%edi
mov    -0x70(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x38(%rbp),%rdi
lea    0xc3a(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xbef(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x54(%rbp),%edi
mov    -0x50(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x38(%rbp),%rdi
lea    0xba9(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x44(%rbp),%edi
mov    -0x40(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x1c(%rbp),%edi
call   1080 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<email_send>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
movl   $0x1,0x4(%rsp)
mov    0x2dfd(%rip),%rbx
mov    (%rbx),%edi
mov    0x2de4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,%r13d
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1090 <assert@plt>
lea    0x8(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1070 <memset@plt>
mov    (%rbx),%eax
mov    %eax,0x10(%rsp)
mov    $0x19,%edi
call   1050 <htons@plt>
mov    %eax,0xc(%rsp)
mov    (%rbx),%edi
lea    0xdcb(%rip),%rsi
mov    %rbp,%rdx
call   10a0 <inet_pton@plt>
mov    $0xffffffff,%r12d
cmp    $0x1,%eax
jne    140d <email_send+0x24d>
mov    0x2d95(%rip),%rax
mov    (%rax),%esi
mov    0x2d6c(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %r13d,%edi
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1090 <assert@plt>
lea    0x8(%rsp),%rsi
mov    %r13d,%edi
mov    $0xc,%edx
call   10d0 <connect@plt>
test   %rax,%rax
jne    140d <email_send+0x24d>
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rax,%rbp,1),%edi
add    $0x10,%edi
call   10b0 <malloc@plt>
mov    %rax,%rbp
movups 0xd4d(%rip),%xmm0
movups %xmm0,(%rax)
movb   $0x0,0x10(%rax)
mov    %rax,%rdi
call   1040 <strlen@plt>
xor    %r12d,%r12d
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
mov    %eax,%edi
call   1090 <assert@plt>
lea    0xd28(%rip),%rsi
lea    0xd31(%rip),%rdx
mov    %rbp,%rdi
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
mov    %eax,%edi
call   1090 <assert@plt>
lea    0xd0a(%rip),%rsi
mov    %rbp,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
mov    %eax,%edi
call   1090 <assert@plt>
movl   $0x41544144,0x0(%rbp)
movl   $0xa0d41,0x3(%rbp)
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
mov    %eax,%edi
call   1090 <assert@plt>
lea    0xcb3(%rip),%rsi
mov    %rbp,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
mov    %eax,%edi
call   1090 <assert@plt>
movl   $0x54495551,0x0(%rbp)
movl   $0xa0d54,0x3(%rbp)
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
mov    %eax,%edi
call   1090 <assert@plt>
mov    %r13d,%edi
call   1080 <close@plt>
mov    %r12d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [14 x i8] c"smtp.tcnj.edu\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [17 x i8] c"HELO localhost\0D\0A\00"
@.str.2 = [16 x i8] c"MAIL FROM: %s\0D\0A\00"
@.str.3 = [15 x i8] c"admin@tcnj.edu\00"
@.str.4 = [14 x i8] c"RCPT TO: %s\0D\0A\00"
@.str.5 = [7 x i8] c"DATA\0D\0A\00"
@.str.6 = [8 x i8] c"%s\0D\0A.\0D\0A\00"
@.str.7 = [7 x i8] c"QUIT\0D\0A\00"
define i32 @email_send(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.sockaddr_in
%9 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 1, i32* %7
%10 = load i32, i32* @AF_INET
%11 = load i32, i32* @SOCK_STREAM
%12 = call i32 @socket(i32 %10, i32 %11, i32 0)
store i32 %12, i32* %6
%13 = icmp sle i32 0, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i32 @memset(%struct.sockaddr_in* %8, i32 0, i32 12)
%17 = load i32, i32* @AF_INET
%18 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %17, i32* %18
%19 = call i32 @htons(i32 25)
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
store i32 %19, i32* %20
%21 = load i32, i32* @AF_INET
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
%23 = call i32 @inet_pton(i32 %21, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %22)
%24 = icmp ne i32 1, %23
br i1 %24, label %25, label %26
25: ; preds = %2
store i32 -1, i32* %3
br label %114
26: ; preds = %2
%27 = load i32, i32* %6
%28 = load i32, i32* @SOL_SOCKET
%29 = load i32, i32* @SO_REUSEADDR
%30 = call i64 @setsockopt(i32 %27, i32 %28, i32 %29, i32* %7, i32 4)
%31 = icmp eq i64 0, %30
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = load i32, i32* %6
%35 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%36 = call i64 @connect(i32 %34, %struct.sockaddr* %35, i32 12)
%37 = icmp ne i64 0, %36
br i1 %37, label %38, label %39
38: ; preds = %26
store i32 -1, i32* %3
br label %114
39: ; preds = %26
%40 = load i8*, i8** %4
%41 = call i32 @strlen(i8* %40)
%42 = add nsw i32 16, %41
%43 = load i8*, i8** %5
%44 = call i32 @strlen(i8* %43)
%45 = add nsw i32 %42, %44
%46 = sext i32 %45 to i64
%47 = mul i64 %46, 1
%48 = trunc i64 %47 to i32
%49 = call i8* @malloc(i32 %48)
store i8* %49, i8** %9
%50 = load i8*, i8** %9
%51 = call i32 (i8*, i8*, ...) @sprintf(i8* %50, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%52 = load i32, i32* %6
%53 = load i8*, i8** %9
%54 = load i8*, i8** %9
%55 = call i32 @strlen(i8* %54)
%56 = call i64 @send(i32 %52, i8* %53, i32 %55, i32 0)
%57 = icmp sle i64 0, %56
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
%60 = load i8*, i8** %9
%61 = call i32 (i8*, i8*, ...) @sprintf(i8* %60, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%62 = load i32, i32* %6
%63 = load i8*, i8** %9
%64 = load i8*, i8** %9
%65 = call i32 @strlen(i8* %64)
%66 = call i64 @send(i32 %62, i8* %63, i32 %65, i32 0)
%67 = icmp sle i64 0, %66
%68 = zext i1 %67 to i32
%69 = call i32 @assert(i32 %68)
%70 = load i8*, i8** %9
%71 = load i8*, i8** %4
%72 = call i32 (i8*, i8*, ...) @sprintf(i8* %70, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %71)
%73 = load i32, i32* %6
%74 = load i8*, i8** %9
%75 = load i8*, i8** %9
%76 = call i32 @strlen(i8* %75)
%77 = call i64 @send(i32 %73, i8* %74, i32 %76, i32 0)
%78 = icmp sle i64 0, %77
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = load i8*, i8** %9
%82 = call i32 (i8*, i8*, ...) @sprintf(i8* %81, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%83 = load i32, i32* %6
%84 = load i8*, i8** %9
%85 = load i8*, i8** %9
%86 = call i32 @strlen(i8* %85)
%87 = call i64 @send(i32 %83, i8* %84, i32 %86, i32 0)
%88 = icmp sle i64 0, %87
%89 = zext i1 %88 to i32
%90 = call i32 @assert(i32 %89)
%91 = load i8*, i8** %9
%92 = load i8*, i8** %5
%93 = call i32 (i8*, i8*, ...) @sprintf(i8* %91, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %92)
%94 = load i32, i32* %6
%95 = load i8*, i8** %9
%96 = load i8*, i8** %9
%97 = call i32 @strlen(i8* %96)
%98 = call i64 @send(i32 %94, i8* %95, i32 %97, i32 0)
%99 = icmp sle i64 0, %98
%100 = zext i1 %99 to i32
%101 = call i32 @assert(i32 %100)
%102 = load i8*, i8** %9
%103 = call i32 (i8*, i8*, ...) @sprintf(i8* %102, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%104 = load i32, i32* %6
%105 = load i8*, i8** %9
%106 = load i8*, i8** %9
%107 = call i32 @strlen(i8* %106)
%108 = call i64 @send(i32 %104, i8* %105, i32 %107, i32 0)
%109 = icmp sle i64 0, %108
%110 = zext i1 %109 to i32
%111 = call i32 @assert(i32 %110)
%112 = load i32, i32* %6
%113 = call i32 @close(i32 %112)
store i32 0, i32* %3
br label %114
114: ; preds = %39, %38, %25
%115 = load i32, i32* %3
ret i32 %115
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [14 x i8] c"smtp.tcnj.edu\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [17 x i8] c"HELO localhost\0D\0A\00"
@.str.2 = [16 x i8] c"MAIL FROM: %s\0D\0A\00"
@.str.3 = [15 x i8] c"admin@tcnj.edu\00"
@.str.4 = [14 x i8] c"RCPT TO: %s\0D\0A\00"
@.str.5 = [7 x i8] c"DATA\0D\0A\00"
@.str.6 = [8 x i8] c"%s\0D\0A.\0D\0A\00"
@.str.7 = [7 x i8] c"QUIT\0D\0A\00"
define i32 @email_send(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%6 = bitcast %struct.sockaddr_in* %4 to i8*
%7 = load i32, i32* @AF_INET
%8 = load i32, i32* @SOCK_STREAM
%9 = tail call i32 @socket(i32 %7, i32 %8, i32 0)
%10 = xor i32 %9, -1
%11 = lshr i32 %10, 31
%12 = tail call i32 @assert(i32 %11)
%13 = call i32 @memset(%struct.sockaddr_in* %4, i32 0, i32 12)
%14 = load i32, i32* @AF_INET
%15 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %14, i32* %15
%16 = call i32 @htons(i32 25)
%17 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1
store i32 %16, i32* %17
%18 = load i32, i32* @AF_INET
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
%20 = call i32 @inet_pton(i32 %18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %19)
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %78
22: ; preds = %2
%23 = load i32, i32* @SOL_SOCKET
%24 = load i32, i32* @SO_REUSEADDR
%25 = call i64 @setsockopt(i32 %9, i32 %23, i32 %24, i32* %3, i32 4)
%26 = icmp eq i64 %25, 0
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%30 = call i64 @connect(i32 %9, %struct.sockaddr* %29, i32 12)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %78
32: ; preds = %22
%33 = call i32 @strlen(i8* %0)
%34 = add nsw i32 %33, 16
%35 = call i32 @strlen(i8* %1)
%36 = add nsw i32 %34, %35
%37 = call i8* @malloc(i32 %36)
%38 = call i32 @strlen(i8* %37)
%39 = call i64 @send(i32 %9, i8* %37, i32 %38, i32 0)
%40 = lshr i64 %39, 63
%41 = trunc i64 %40 to i32
%42 = xor i32 %41, 1
%43 = call i32 @assert(i32 %42)
%44 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %37, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%45 = call i32 @strlen(i8* %37)
%46 = call i64 @send(i32 %9, i8* %37, i32 %45, i32 0)
%47 = lshr i64 %46, 63
%48 = trunc i64 %47 to i32
%49 = xor i32 %48, 1
%50 = call i32 @assert(i32 %49)
%51 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %37, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %0)
%52 = call i32 @strlen(i8* %37)
%53 = call i64 @send(i32 %9, i8* %37, i32 %52, i32 0)
%54 = lshr i64 %53, 63
%55 = trunc i64 %54 to i32
%56 = xor i32 %55, 1
%57 = call i32 @assert(i32 %56)
%58 = call i32 @strlen(i8* %37)
%59 = call i64 @send(i32 %9, i8* %37, i32 %58, i32 0)
%60 = lshr i64 %59, 63
%61 = trunc i64 %60 to i32
%62 = xor i32 %61, 1
%63 = call i32 @assert(i32 %62)
%64 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %37, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %1)
%65 = call i32 @strlen(i8* %37)
%66 = call i64 @send(i32 %9, i8* %37, i32 %65, i32 0)
%67 = lshr i64 %66, 63
%68 = trunc i64 %67 to i32
%69 = xor i32 %68, 1
%70 = call i32 @assert(i32 %69)
%71 = call i32 @strlen(i8* %37)
%72 = call i64 @send(i32 %9, i8* %37, i32 %71, i32 0)
%73 = lshr i64 %72, 63
%74 = trunc i64 %73 to i32
%75 = xor i32 %74, 1
%76 = call i32 @assert(i32 %75)
%77 = call i32 @close(i32 %9)
br label %78
78: ; preds = %22, %2, %32
%79 = phi i32 [ 0, %32 ], [ -1, %2 ], [ -1, %22 ]
ret i32 %79
}