#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 {
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ srcletter;
typedef int /*<<< orphan*/ servaddr;
typedef int /*<<< orphan*/ desletter;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
scalar_t__ islower(char);
scalar_t__ isupper(char);
int listen(int, int);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
char *strerror(int /*<<< orphan*/);
char tolower(char);
char toupper(char);
int main(int argc, char **argv) {
  int sockfd;
  int clifd;
  char srcletter;
  char desletter;
  struct sockaddr_in servaddr;
  if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
    printf("socket error: %s\n", strerror(errno));
    return -1;
  }
  memset(&servaddr, 0, sizeof(servaddr));
  servaddr.sin_family = AF_INET;
  servaddr.sin_port = htons(8000);
  servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
  if (bind(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) == -1) {
    printf("bind error: %s\n", strerror(errno));
    close(sockfd);
    return -1;
  }
  if (listen(sockfd, 1) == -1) {
    printf("listen error: %s\n", strerror(errno));
    close(sockfd);
    return -1;
  }
  printf("===== waiting for client's request =====\n");
  if ((clifd = accept(sockfd, (struct sockaddr *)NULL, NULL)) == -1) {
    printf("accept error: %s\n", strerror(errno));
    close(sockfd);
    return -1;
  }
  while (1) {
    if (recv(clifd, &srcletter, sizeof(srcletter), 0) == -1) {
      printf("recv error: %s\n", strerror(errno));
      break;
    }
    if (isupper(srcletter)) {
      desletter = tolower(srcletter);
    } else if (islower(srcletter)) {
      desletter = toupper(srcletter);
    }
    printf("recv [%c] send[%c]\n", srcletter, desletter);
    if (send(clifd, &desletter, sizeof(desletter), 0) == -1) {
      printf("send error: %s\n", strerror(errno));
      break;
    }
  }
  close(clifd);
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
mov    0x2daa(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1266 <main+0x66>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1491 <main+0x291>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10a0 <memset@plt>
mov    0x2d6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    $0x1f40,%edi
call   1060 <htons@plt>
mov    %eax,-0x24(%rbp)
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
call   1090 <htonl@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   10f0 <bind@plt>
cmp    $0xffffffff,%eax
jne    12ed <main+0xed>
mov    0x2d07(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xd40(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x14(%rbp),%edi
call   10b0 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1491 <main+0x291>
mov    -0x14(%rbp),%edi
mov    $0x1,%esi
call   10d0 <listen@plt>
cmp    $0xffffffff,%eax
jne    1336 <main+0x136>
mov    0x2cbe(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x14(%rbp),%edi
call   10b0 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1491 <main+0x291>
lea    0xcf7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x14(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1100 <accept@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1392 <main+0x192>
mov    0x2c62(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xce7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x14(%rbp),%edi
call   10b0 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1491 <main+0x291>
jmp    1397 <main+0x197>
mov    -0x18(%rbp),%edi
lea    -0x19(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    13d7 <main+0x1d7>
mov    0x2c0e(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xca5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    147a <main+0x27a>
movsbl -0x19(%rbp),%edi
call   10e0 <isupper@plt>
cmp    $0x0,%rax
je     13fb <main+0x1fb>
movsbl -0x19(%rbp),%edi
call   10c0 <tolower@plt>
mov    %al,-0x1a(%rbp)
jmp    141f <main+0x21f>
movsbl -0x19(%rbp),%edi
call   1040 <islower@plt>
cmp    $0x0,%rax
je     141a <main+0x21a>
movsbl -0x19(%rbp),%edi
call   1050 <toupper@plt>
mov    %al,-0x1a(%rbp)
jmp    141f <main+0x21f>
movsbl -0x19(%rbp),%esi
movsbl -0x1a(%rbp),%edx
lea    0xc52(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x18(%rbp),%edi
lea    -0x1a(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
jne    1475 <main+0x275>
mov    0x2b70(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xc2b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    147a <main+0x27a>
jmp    1397 <main+0x197>
mov    -0x18(%rbp),%edi
call   10b0 <close@plt>
mov    -0x14(%rbp),%edi
call   10b0 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x2dc3(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2da1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
cmp    $0xffffffff,%eax
je     1370 <main+0x160>
mov    %eax,%r14d
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10b0 <memset@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    $0x1f40,%edi
call   1070 <htons@plt>
mov    %eax,0xc(%rsp)
mov    0x2d6c(%rip),%rax
mov    (%rax),%edi
call   10a0 <htonl@plt>
mov    %eax,0x8(%rsp)
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   1100 <bind@plt>
cmp    $0xffffffff,%eax
je     1399 <main+0x189>
mov    %r14d,%edi
mov    $0x1,%esi
call   10e0 <listen@plt>
cmp    $0xffffffff,%eax
je     13b0 <main+0x1a0>
lea    0xdc5(%rip),%rdi
call   1060 <puts@plt>
mov    %r14d,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1110 <accept@plt>
cmp    $0xffffffff,%eax
je     13c7 <main+0x1b7>
mov    %eax,%ebp
lea    0x6(%rsp),%r15
lea    0xd79(%rip),%r12
lea    0x7(%rsp),%r13
lea    0xd81(%rip),%rbx
jmp    1325 <main+0x115>
nopl   0x0(%rax,%rax,1)
call   10d0 <tolower@plt>
mov    %al,0x7(%rsp)
movsbl 0x6(%rsp),%esi
movsbl %al,%edx
mov    %r12,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
cmp    $0xffffffff,%eax
je     13f5 <main+0x1e5>
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     13fa <main+0x1ea>
movsbl 0x6(%rsp),%edi
call   10f0 <isupper@plt>
movsbl 0x6(%rsp),%edi
test   %rax,%rax
jne    12f0 <main+0xe0>
call   1040 <islower@plt>
test   %rax,%rax
je     1369 <main+0x159>
movsbl 0x6(%rsp),%edi
call   1050 <toupper@plt>
jmp    12f5 <main+0xe5>
movzbl 0x7(%rsp),%eax
jmp    12f9 <main+0xe9>
mov    0x2c51(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xc7b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0xffffffff,%ebx
jmp    142d <main+0x21d>
mov    0x2c28(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xc64(%rip),%rdi
jmp    13dc <main+0x1cc>
mov    0x2c11(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xc5d(%rip),%rdi
jmp    13dc <main+0x1cc>
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xc58(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r14d,%edi
call   10c0 <close@plt>
mov    $0xffffffff,%ebx
jmp    142d <main+0x21d>
mov    %rbx,%r15
jmp    1401 <main+0x1f1>
lea    0xc45(%rip),%r15
mov    0x2bc0(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
xor    %ebx,%ebx
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %ebp,%edi
call   10c0 <close@plt>
mov    %r14d,%edi
call   10c0 <close@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [18 x i8] c"socket error: %s\0A\00"
@errno = global i32 0
@INADDR_ANY = global i32 0
@.str.1 = [16 x i8] c"bind error: %s\0A\00"
@.str.2 = [18 x i8] c"listen error: %s\0A\00"
@.str.3 = [42 x i8] c"===== waiting for client's request =====\0A\00"
@.str.4 = [18 x i8] c"accept error: %s\0A\00"
@.str.5 = [16 x i8] c"recv error: %s\0A\00"
@.str.6 = [20 x i8] c"recv [%c] send[%c]\0A\00"
@.str.7 = [16 x i8] c"send error: %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 i8
%9 = alloca i8
%10 = alloca %struct.sockaddr_in
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* @AF_INET
%12 = load i32, i32* @SOCK_STREAM
%13 = call i32 @socket(i32 %11, i32 %12, i32 0)
store i32 %13, i32* %6
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i32, i32* @errno
%17 = call i8* @strerror(i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 -1, i32* %3
br label %103
19: ; preds = %2
%20 = call i32 @memset(%struct.sockaddr_in* %10, i32 0, i32 12)
%21 = load i32, i32* @AF_INET
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 2
store i32 %21, i32* %22
%23 = call i32 @htons(i32 8000)
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 1
store i32 %23, i32* %24
%25 = load i32, i32* @INADDR_ANY
%26 = call i32 @htonl(i32 %25)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 0
%28 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %27, i32 0, i32 0
store i32 %26, i32* %28
%29 = load i32, i32* %6
%30 = bitcast %struct.sockaddr_in* %10 to %struct.sockaddr*
%31 = call i32 @bind(i32 %29, %struct.sockaddr* %30, i32 12)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %39
33: ; preds = %19
%34 = load i32, i32* @errno
%35 = call i8* @strerror(i32 %34)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %35)
%37 = load i32, i32* %6
%38 = call i32 @close(i32 %37)
store i32 -1, i32* %3
br label %103
39: ; preds = %19
%40 = load i32, i32* %6
%41 = call i32 @listen(i32 %40, i32 1)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %49
43: ; preds = %39
%44 = load i32, i32* @errno
%45 = call i8* @strerror(i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %45)
%47 = load i32, i32* %6
%48 = call i32 @close(i32 %47)
store i32 -1, i32* %3
br label %103
49: ; preds = %39
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%51 = load i32, i32* %6
%52 = call i32 @accept(i32 %51, %struct.sockaddr* null, i32* null)
store i32 %52, i32* %7
%53 = icmp eq i32 %52, -1
br i1 %53, label %54, label %60
54: ; preds = %49
%55 = load i32, i32* @errno
%56 = call i8* @strerror(i32 %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %56)
%58 = load i32, i32* %6
%59 = call i32 @close(i32 %58)
store i32 -1, i32* %3
br label %103
60: ; preds = %49
br label %61
61: ; preds = %60, %97
%62 = load i32, i32* %7
%63 = call i32 @recv(i32 %62, i8* %8, i32 1, i32 0)
%64 = icmp eq i32 %63, -1
br i1 %64, label %65, label %69
65: ; preds = %61
%66 = load i32, i32* @errno
%67 = call i8* @strerror(i32 %66)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* %67)
br label %98
69: ; preds = %61
%70 = load i8, i8* %8
%71 = call i64 @isupper(i8 signext %70)
%72 = icmp ne i64 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %69
%74 = load i8, i8* %8
%75 = call signext i8 @tolower(i8 signext %74)
store i8 %75, i8* %9
br label %84
76: ; preds = %69
%77 = load i8, i8* %8
%78 = call i64 @islower(i8 signext %77)
%79 = icmp ne i64 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %76
%81 = load i8, i8* %8
%82 = call signext i8 @toupper(i8 signext %81)
store i8 %82, i8* %9
br label %83
83: ; preds = %80, %76
br label %84
84: ; preds = %83, %73
%85 = load i8, i8* %8
%86 = sext i8 %85 to i32
%87 = load i8, i8* %9
%88 = sext i8 %87 to i32
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %86, i32 %88)
%90 = load i32, i32* %7
%91 = call i32 @send(i32 %90, i8* %9, i32 1, i32 0)
%92 = icmp eq i32 %91, -1
br i1 %92, label %93, label %97
93: ; preds = %84
%94 = load i32, i32* @errno
%95 = call i8* @strerror(i32 %94)
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %95)
br label %98
97: ; preds = %84
br label %61
98: ; preds = %93, %65
%99 = load i32, i32* %7
%100 = call i32 @close(i32 %99)
%101 = load i32, i32* %6
%102 = call i32 @close(i32 %101)
store i32 0, i32* %3
br label %103
103: ; preds = %98, %54, %43, %33, %15
%104 = load i32, i32* %3
ret i32 %104
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [18 x i8] c"socket error: %s\0A\00"
@errno = global i32 0
@INADDR_ANY = global i32 0
@.str.1 = [16 x i8] c"bind error: %s\0A\00"
@.str.2 = [18 x i8] c"listen error: %s\0A\00"
@.str.4 = [18 x i8] c"accept error: %s\0A\00"
@.str.5 = [16 x i8] c"recv error: %s\0A\00"
@.str.6 = [20 x i8] c"recv [%c] send[%c]\0A\00"
@.str.7 = [16 x i8] c"send error: %s\0A\00"
@str = [41 x i8] c"===== waiting for client's request =====\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca %struct.sockaddr_in
%6 = bitcast %struct.sockaddr_in* %5 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 = icmp eq i32 %9, -1
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = tail call i8* @strerror(i32 %12)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %82
15: ; preds = %2
%16 = call i32 @memset(%struct.sockaddr_in* %5, i32 0, i32 12)
%17 = load i32, i32* @AF_INET
%18 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i32 %17, i32* %18
%19 = call i32 @htons(i32 8000)
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1
store i32 %19, i32* %20
%21 = load i32, i32* @INADDR_ANY
%22 = call i32 @htonl(i32 %21)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0, i32 0
store i32 %22, i32* %23
%24 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%25 = call i32 @bind(i32 %9, %struct.sockaddr* %24, i32 12)
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %32
27: ; preds = %15
%28 = load i32, i32* @errno
%29 = call i8* @strerror(i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = call i32 @close(i32 %9)
br label %82
32: ; preds = %15
%33 = call i32 @listen(i32 %9, i32 1)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %40
35: ; preds = %32
%36 = load i32, i32* @errno
%37 = call i8* @strerror(i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %37)
%39 = call i32 @close(i32 %9)
br label %82
40: ; preds = %32
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%42 = call i32 @accept(i32 %9, %struct.sockaddr* null, i32* null)
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %49
44: ; preds = %40
%45 = load i32, i32* @errno
%46 = call i8* @strerror(i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %46)
%48 = call i32 @close(i32 %9)
br label %82
49: ; preds = %40, %67
%50 = call i32 @recv(i32 %42, i8* %3, i32 1, i32 0)
%51 = icmp eq i32 %50, -1
br i1 %51, label %75, label %52
52: ; preds = %49
%53 = load i8, i8* %3
%54 = call i64 @isupper(i8 signext %53)
%55 = icmp eq i64 %54, 0
%56 = load i8, i8* %3
br i1 %55, label %59, label %57
57: ; preds = %52
%58 = call signext i8 @tolower(i8 signext %56)
store i8 %58, i8* %4
br label %67
59: ; preds = %52
%60 = call i64 @islower(i8 signext %56)
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = load i8, i8* %4
br label %67
64: ; preds = %59
%65 = load i8, i8* %3
%66 = call signext i8 @toupper(i8 signext %65)
store i8 %66, i8* %4
br label %67
67: ; preds = %62, %64, %57
%68 = phi i8 [ %63, %62 ], [ %66, %64 ], [ %58, %57 ]
%69 = load i8, i8* %3
%70 = sext i8 %69 to i32
%71 = sext i8 %68 to i32
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %70, i32 %71)
%73 = call i32 @send(i32 %42, i8* %4, i32 1, i32 0)
%74 = icmp eq i32 %73, -1
br i1 %74, label %75, label %49
75: ; preds = %67, %49
%76 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), %49 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), %67 ]
%77 = load i32, i32* @errno
%78 = call i8* @strerror(i32 %77)
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %76, i8* %78)
%80 = call i32 @close(i32 %42)
%81 = call i32 @close(i32 %9)
br label %82
82: ; preds = %75, %44, %35, %27, %11
%83 = phi i32 [ -1, %11 ], [ -1, %27 ], [ -1, %35 ], [ -1, %44 ], [ 0, %75 ]
ret i32 %83
}