#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 */
typedef int /*<<< orphan*/ rsp;
typedef int /*<<< orphan*/ header;

/* Variables and functions */
int /*<<< orphan*/ MSG_PEEK;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int file2mem(char *, char **, int *);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int snprintf(char *, int, char *, int);
int /*<<< orphan*/ sscanf(char *, char *, char *);
char *strerror(int /*<<< orphan*/);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
char *strstr(char *, char *);
int /*<<< orphan*/ write(int, char *, int);
void *do_work(void *argv) {
  char header[4096] = "";
  char rsp[4096] = "";
  char path[1024] = ".";
  int connfd = -1;
  int rv = -1;
  char *pos, *p;
  int size = 0;
  connfd = (intptr_t)argv;
  rv = recv(connfd, header, sizeof(header) - 1, MSG_PEEK);
  if (rv == -1) {
    printf("recv peek fail %s\n", strerror(errno));
    goto done;
  }
  printf("===%s===\n", header);
  if (strncmp("GET", header, 3)) {
    printf("header is %s\n", header);
    goto done;
  }
  pos = strstr(header, "\r\n\r\n");
  if (pos == NULL) {
    printf("not found \\r\\n\\r\\n \n");
    goto done;
  }
  rv = recv(connfd, header, pos - header + 4, 0);
  sscanf(header, "GET %[^ ]", path + 1);
  printf("path(%s)\n", path);
  rv = file2mem(path, &p, &size);
  if (rv == -1) {
    printf("file2mem fail\n");
    return 0;
  }
  if (strncmp(path + strlen(path) - 4, ".mp3", 4) == 0) {
    printf("mp3 type");
    rv = snprintf(rsp, sizeof(rsp) - 1,
                  "HTTP/1.0 200 OK\r\n"
                  "Content-Type: audio/mpeg\r\n"
                  "Content-Length: %d\r\n"
                  "Connection: close\r\n\r\n",
                  size);
  } else {
    rv = snprintf(rsp, sizeof(rsp) - 1,
                  "HTTP/1.0 200 OK\r\n"
                  "Content-Length: %d\r\n"
                  "Connection: close\r\n\r\n",
                  size);
  }
  write(connfd, rsp, rv);
  write(connfd, p, size);
done:
  close(connfd);
  return 0;
}


x86 assembly (clang, -O0):
<do_work>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2440,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x1010(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1090 <memset@plt>
lea    -0x2010(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1090 <memset@plt>
lea    -0x2410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1090 <memset@plt>
movb   $0x2e,-0x2410(%rbp)
movl   $0xffffffff,-0x2414(%rbp)
ff ff ff
movl   $0xffffffff,-0x2418(%rbp)
ff ff ff
movl   $0x0,-0x242c(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x2414(%rbp)
mov    -0x2414(%rbp),%edi
lea    -0x1010(%rbp),%rsi
mov    0x2d9d(%rip),%rax
mov    (%rax),%ecx
mov    $0xfff,%edx
call   1030 <recv@plt>
mov    %eax,-0x2418(%rbp)
cmpl   $0xffffffff,-0x2418(%rbp)
jne    128e <do_work+0xce>
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    %rax,%rsi
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1496 <do_work+0x2d6>
lea    -0x1010(%rbp),%rsi
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x1010(%rbp),%rsi
lea    0xd6c(%rip),%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     12df <do_work+0x11f>
lea    -0x1010(%rbp),%rsi
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1496 <do_work+0x2d6>
lea    -0x1010(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   10e0 <strstr@plt>
mov    %rax,-0x2420(%rbp)
cmpq   $0x0,-0x2420(%rbp)
jne    131a <do_work+0x15a>
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1496 <do_work+0x2d6>
mov    -0x2414(%rbp),%edi
lea    -0x1010(%rbp),%rsi
mov    -0x2420(%rbp),%rax
lea    -0x1010(%rbp),%rcx
sub    %rcx,%rax
add    $0x4,%rax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x2418(%rbp)
lea    -0x1010(%rbp),%rdi
lea    -0x2410(%rbp),%rdx
add    $0x1,%rdx
lea    0xce0(%rip),%rsi
call   10c0 <sscanf@plt>
lea    -0x2410(%rbp),%rsi
lea    0xcd7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x2410(%rbp),%rdi
lea    -0x2428(%rbp),%rsi
lea    -0x242c(%rbp),%rdx
call   10b0 <file2mem@plt>
mov    %eax,-0x2418(%rbp)
cmpl   $0xffffffff,-0x2418(%rbp)
jne    13c6 <do_work+0x206>
lea    0xca6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    14a9 <do_work+0x2e9>
lea    -0x2410(%rbp),%rax
mov    %rax,-0x2438(%rbp)
lea    -0x2410(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x2438(%rbp),%rdi
cltq
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
lea    0xc70(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1442 <do_work+0x282>
lea    0xc5a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x2010(%rbp),%rdi
mov    -0x242c(%rbp),%ecx
mov    $0xfff,%esi
lea    0xc43(%rip),%rdx
call   1080 <snprintf@plt>
mov    %eax,-0x2418(%rbp)
jmp    1466 <do_work+0x2a6>
lea    -0x2010(%rbp),%rdi
mov    -0x242c(%rbp),%ecx
mov    $0xfff,%esi
lea    0xc6f(%rip),%rdx
call   1080 <snprintf@plt>
mov    %eax,-0x2418(%rbp)
mov    -0x2414(%rbp),%edi
lea    -0x2010(%rbp),%rsi
mov    -0x2418(%rbp),%edx
call   1050 <write@plt>
mov    -0x2414(%rbp),%edi
mov    -0x2428(%rbp),%rsi
mov    -0x242c(%rbp),%edx
call   1050 <write@plt>
mov    -0x2414(%rbp),%edi
call   10a0 <close@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_work>:
push   %r14
push   %rbx
sub    $0x2418,%rsp
mov    %rdi,%r14
lea    0x410(%rsp),%rbx
mov    $0x1000,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10a0 <memset@plt>
lea    0x1410(%rsp),%rdi
mov    $0x1000,%edx
xor    %esi,%esi
call   10a0 <memset@plt>
lea    0x10(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   10a0 <memset@plt>
movb   $0x2e,0x10(%rsp)
movl   $0x0,0x4(%rsp)
mov    0x2dbb(%rip),%rax
mov    (%rax),%ecx
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0xfff,%edx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     1287 <do_work+0xb7>
lea    0xdc8(%rip),%rdi
lea    0x410(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xdb9(%rip),%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     12bb <do_work+0xeb>
lea    0xda4(%rip),%rdi
lea    0x410(%rsp),%rsi
jmp    129f <do_work+0xcf>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xd64(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14d,%edi
call   10b0 <close@plt>
xor    %eax,%eax
add    $0x2418,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe1a(%rip),%rsi
lea    0x410(%rsp),%rdi
call   10f0 <strstr@plt>
test   %rax,%rax
je     136c <do_work+0x19c>
lea    0x410(%rsp),%rbx
sub    %ebx,%eax
add    $0x4,%eax
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
lea    0x11(%rsp),%rdx
lea    0xd2f(%rip),%rsi
mov    %rbx,%rdi
call   10d0 <sscanf@plt>
lea    0xd2a(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   10c0 <file2mem@plt>
cmp    $0xffffffff,%eax
je     137d <do_work+0x1ad>
lea    0x10(%rsp),%rdi
call   1070 <strlen@plt>
cltq
lea    (%rsp,%rax,1),%rdi
add    $0xc,%rdi
lea    0xcf3(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     138e <do_work+0x1be>
mov    0x4(%rsp),%ecx
lea    0xd3c(%rip),%rdx
jmp    13a7 <do_work+0x1d7>
lea    0xd7c(%rip),%rdi
call   1050 <puts@plt>
jmp    12a6 <do_work+0xd6>
lea    0xd5d(%rip),%rdi
call   1050 <puts@plt>
jmp    12ae <do_work+0xde>
lea    0xcb3(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x4(%rsp),%ecx
lea    0xcaa(%rip),%rdx
lea    0x1410(%rsp),%rdi
mov    $0xfff,%esi
call   1090 <snprintf@plt>
lea    0x1410(%rsp),%rsi
mov    %r14d,%edi
mov    %eax,%edx
call   1060 <write@plt>
mov    0x8(%rsp),%rsi
mov    0x4(%rsp),%edx
mov    %r14d,%edi
call   1060 <write@plt>
jmp    12a6 <do_work+0xd6>

LLVM IR (-O0):
@MSG_PEEK = global i32 0
@.str = [19 x i8] c"recv peek fail %s\0A\00"
@errno = global i32 0
@.str.1 = [10 x i8] c"===%s===\0A\00"
@.str.2 = [4 x i8] c"GET\00"
@.str.3 = [14 x i8] c"header is %s\0A\00"
@.str.4 = [5 x i8] c"\0D\0A\0D\0A\00"
@.str.5 = [21 x i8] c"not found \\r\\n\\r\\n \0A\00"
@.str.6 = [10 x i8] c"GET %[^ ]\00"
@.str.7 = [10 x i8] c"path(%s)\0A\00"
@.str.8 = [15 x i8] c"file2mem fail\0A\00"
@.str.9 = [5 x i8] c".mp3\00"
@.str.10 = [9 x i8] c"mp3 type\00"
@.str.11 = [85 x i8] c"HTTP/1.0 200 OK\0D\0AContent-Type: audio/mpeg\0D\0AContent-Length: %d\0D\0AConnection: close\0D\0A\0D\0A\00"
@.str.12 = [59 x i8] c"HTTP/1.0 200 OK\0D\0AContent-Length: %d\0D\0AConnection: close\0D\0A\0D\0A\00"
define i8* @do_work(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [4096 x i8]
%5 = alloca [4096 x i8]
%6 = alloca [1024 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %3
%12 = bitcast [4096 x i8]* %4 to i8*
%13 = bitcast [4096 x i8]* %5 to i8*
%14 = bitcast [1024 x i8]* %6 to i8*
%15 = bitcast i8* %14 to [1024 x i8]*
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i32 0, i32 0
store i8 46, i8* %16
store i32 -1, i32* %7
store i32 -1, i32* %8
store i32 0, i32* %11
%17 = load i8*, i8** %3
%18 = ptrtoint i8* %17 to i64
%19 = trunc i64 %18 to i32
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%22 = load i32, i32* @MSG_PEEK
%23 = call i32 @recv(i32 %20, i8* %21, i32 4095, i32 %22)
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %30
26: ; preds = %1
%27 = load i32, i32* @errno
%28 = call i8* @strerror(i32 %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %28)
br label %96
30: ; preds = %1
%31 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %31)
%33 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%34 = call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %33, i32 3)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %30
%37 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %37)
br label %96
39: ; preds = %30
%40 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%41 = call i8* @strstr(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i8* %41, i8** %9
%42 = load i8*, i8** %9
%43 = icmp eq i8* %42, null
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
br label %96
46: ; preds = %39
%47 = load i32, i32* %7
%48 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%49 = load i8*, i8** %9
%50 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%51 = ptrtoint i8* %49 to i64
%52 = ptrtoint i8* %50 to i64
%53 = sub i64 %51, %52
%54 = add nsw i64 %53, 4
%55 = trunc i64 %54 to i32
%56 = call i32 @recv(i32 %47, i8* %48, i32 %55, i32 0)
store i32 %56, i32* %8
%57 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%59 = getelementptr inbounds i8, i8* %58, i64 1
%60 = call i32 @sscanf(i8* %57, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %59)
%61 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %61)
%63 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%64 = call i32 @file2mem(i8* %63, i8** %10, i32* %11)
store i32 %64, i32* %8
%65 = load i32, i32* %8
%66 = icmp eq i32 %65, -1
br i1 %66, label %67, label %69
67: ; preds = %46
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
store i8* null, i8** %2
br label %99
69: ; preds = %46
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%71 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%72 = call i32 @strlen(i8* %71)
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %70, i64 %73
%75 = getelementptr inbounds i8, i8* %74, i64 -4
%76 = call i64 @strncmp(i8* %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 4)
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %83
78: ; preds = %69
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%80 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%81 = load i32, i32* %11
%82 = call i32 @snprintf(i8* %80, i32 4095, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.11, i64 0, i64 0), i32 %81)
store i32 %82, i32* %8
br label %87
83: ; preds = %69
%84 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%85 = load i32, i32* %11
%86 = call i32 @snprintf(i8* %84, i32 4095, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.12, i64 0, i64 0), i32 %85)
store i32 %86, i32* %8
br label %87
87: ; preds = %83, %78
%88 = load i32, i32* %7
%89 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%90 = load i32, i32* %8
%91 = call i32 @write(i32 %88, i8* %89, i32 %90)
%92 = load i32, i32* %7
%93 = load i8*, i8** %10
%94 = load i32, i32* %11
%95 = call i32 @write(i32 %92, i8* %93, i32 %94)
br label %96
96: ; preds = %87, %44, %36, %26
%97 = load i32, i32* %7
%98 = call i32 @close(i32 %97)
store i8* null, i8** %2
br label %99
99: ; preds = %96, %67
%100 = load i8*, i8** %2
ret i8* %100
}

LLVM IR (-O2):
@MSG_PEEK = global i32 0
@.str = [19 x i8] c"recv peek fail %s\0A\00"
@errno = global i32 0
@.str.1 = [10 x i8] c"===%s===\0A\00"
@.str.2 = [4 x i8] c"GET\00"
@.str.3 = [14 x i8] c"header is %s\0A\00"
@.str.4 = [5 x i8] c"\0D\0A\0D\0A\00"
@.str.6 = [10 x i8] c"GET %[^ ]\00"
@.str.7 = [10 x i8] c"path(%s)\0A\00"
@.str.9 = [5 x i8] c".mp3\00"
@.str.10 = [9 x i8] c"mp3 type\00"
@.str.11 = [85 x i8] c"HTTP/1.0 200 OK\0D\0AContent-Type: audio/mpeg\0D\0AContent-Length: %d\0D\0AConnection: close\0D\0A\0D\0A\00"
@.str.12 = [59 x i8] c"HTTP/1.0 200 OK\0D\0AContent-Length: %d\0D\0AConnection: close\0D\0A\0D\0A\00"
@str = [14 x i8] c"file2mem fail\00"
@str.13 = [20 x i8] c"not found \\r\\n\\r\\n \00"
define noalias i8* @do_work(i8* %0) {
%2 = alloca [4096 x i8]
%3 = alloca [4096 x i8]
%4 = alloca [1024 x i8]
%5 = alloca i8*
%6 = alloca i32
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
store i8 46, i8* %9
%10 = bitcast i8** %5 to i8*
%11 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%12 = ptrtoint i8* %0 to i64
%13 = trunc i64 %12 to i32
%14 = load i32, i32* @MSG_PEEK
%15 = call i32 @recv(i32 %13, i8* %7, i32 4095, i32 %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %21
17: ; preds = %1
%18 = load i32, i32* @errno
%19 = call i8* @strerror(i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %19)
br label %66
21: ; preds = %1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%23 = call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %7, i32 3)
%24 = icmp eq i64 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %7)
br label %66
27: ; preds = %21
%28 = call i8* @strstr(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.13, i64 0, i64 0))
br label %66
32: ; preds = %27
%33 = ptrtoint i8* %28 to i64
%34 = ptrtoint [4096 x i8]* %2 to i64
%35 = sub i64 %33, %34
%36 = trunc i64 %35 to i32
%37 = add i32 %36, 4
%38 = call i32 @recv(i32 %13, i8* %7, i32 %37, i32 0)
%39 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 1
%40 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %39)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %9)
%42 = call i32 @file2mem(i8* %9, i8** %5, i32* %6)
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %46
44: ; preds = %32
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %68
46: ; preds = %32
%47 = call i32 @strlen(i8* %9)
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %48
%50 = getelementptr inbounds i8, i8* %49, i64 -4
%51 = call i64 @strncmp(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 4)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %46
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%55 = load i32, i32* %6
%56 = call i32 @snprintf(i8* %8, i32 4095, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.11, i64 0, i64 0), i32 %55)
br label %60
57: ; preds = %46
%58 = load i32, i32* %6
%59 = call i32 @snprintf(i8* %8, i32 4095, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.12, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %57, %53
%61 = phi i32 [ %56, %53 ], [ %59, %57 ]
%62 = call i32 @write(i32 %13, i8* %8, i32 %61)
%63 = load i8*, i8** %5
%64 = load i32, i32* %6
%65 = call i32 @write(i32 %13, i8* %63, i32 %64)
br label %66
66: ; preds = %60, %30, %25, %17
%67 = call i32 @close(i32 %13)
br label %68
68: ; preds = %66, %44
ret i8* null
}