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

/* Variables and functions */
int atoi(char *);
int fread(char *, int, int, int /*<<< orphan*/);
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strstr(char *, char *);
int main(void) {
  char buf[4096] = {0};
  char *content_type = NULL;
  char *p1 = NULL;
  char *p2 = NULL;
  char boundary[256] = {0};
  char *content_length = NULL;
  int len = 0;
  char pattern[256] = {0};
  int read_len = 0;
  char *p3 = NULL;
  char *p4 = NULL;
  char *p5 = NULL;
  char *p6 = NULL;
  int file_len = 0;
  char file_buf[4096] = {0};
  content_type = getenv("CONTENT_TYPE");
  p1 = strstr(content_type, "multipart/form-data");
  if (p1 != NULL) {
    p2 = strstr(p1, "boundary=");
    if (p2 != NULL) {
      strcpy(boundary, p2 + strlen("boundary="));
      content_length = getenv("CONTENT_LENGTH");
      len = atoi(content_length);
      read_len = fread(buf, sizeof(char), len, stdin);
      if (len == read_len) {
        strcat(pattern, "--");
        strcat(pattern, boundary);
        p3 = strstr(buf, pattern);
        if (p3 != NULL) {
          p4 = strstr(p3, "Content-Type: ");
          if (p4 != NULL) {
            p5 = strstr(p4, "\r\n\r\n");
            if (p5 != NULL) {
              p6 = strstr(p5, pattern);
              if (p6 != NULL) {
                file_len = (p6 - 2) - (p5 + 4);
                strncpy(file_buf, p5 + 4, file_len);
                printf("Content-type: text/plain\n");
                printf("\n");
                printf("boundary: %s\n", boundary);
                printf("len: %d\n", len);
                printf("pattern: %s\n", pattern);
                printf("file_len: %d\n", file_len);
                printf("-----file begin-----\n");
                printf("%s\n", file_buf);
                printf("-----file end-----\n");
              }
            }
          }
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2280,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1010(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1090 <memset@plt>
movq   $0x0,-0x1018(%rbp)
movq   $0x0,-0x1020(%rbp)
movq   $0x0,-0x1028(%rbp)
lea    -0x1130(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1090 <memset@plt>
movq   $0x0,-0x1138(%rbp)
movl   $0x0,-0x113c(%rbp)
lea    -0x1240(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1090 <memset@plt>
movl   $0x0,-0x1244(%rbp)
movq   $0x0,-0x1250(%rbp)
movq   $0x0,-0x1258(%rbp)
movq   $0x0,-0x1260(%rbp)
movq   $0x0,-0x1268(%rbp)
movl   $0x0,-0x126c(%rbp)
lea    -0x2270(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1090 <memset@plt>
lea    0xd85(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x1018(%rbp)
mov    -0x1018(%rbp),%rdi
lea    0xd78(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,-0x1020(%rbp)
cmpq   $0x0,-0x1020(%rbp)
je     1533 <main+0x393>
mov    -0x1020(%rbp),%rdi
lea    0xd64(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,-0x1028(%rbp)
cmpq   $0x0,-0x1028(%rbp)
je     152e <main+0x38e>
lea    -0x1130(%rbp),%rax
mov    %rax,-0x2278(%rbp)
mov    -0x1028(%rbp),%rax
mov    %rax,-0x2280(%rbp)
lea    0xd27(%rip),%rdi
call   1070 <strlen@plt>
mov    -0x2280(%rbp),%rsi
mov    -0x2278(%rbp),%rdi
cltq
add    %rax,%rsi
call   1050 <strcpy@plt>
lea    0xd0d(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x1138(%rbp)
mov    -0x1138(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x113c(%rbp)
lea    -0x1010(%rbp),%rdi
mov    -0x113c(%rbp),%edx
mov    0x2c98(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1060 <fread@plt>
mov    %eax,-0x1244(%rbp)
mov    -0x113c(%rbp),%eax
cmp    -0x1244(%rbp),%eax
jne    1529 <main+0x389>
lea    -0x1240(%rbp),%rdi
lea    0xcb8(%rip),%rsi
call   10b0 <strcat@plt>
lea    -0x1240(%rbp),%rdi
lea    -0x1130(%rbp),%rsi
call   10b0 <strcat@plt>
lea    -0x1010(%rbp),%rdi
lea    -0x1240(%rbp),%rsi
call   10c0 <strstr@plt>
mov    %rax,-0x1250(%rbp)
cmpq   $0x0,-0x1250(%rbp)
je     1524 <main+0x384>
mov    -0x1250(%rbp),%rdi
lea    0xc6d(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,-0x1258(%rbp)
cmpq   $0x0,-0x1258(%rbp)
je     151f <main+0x37f>
mov    -0x1258(%rbp),%rdi
lea    0xc54(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,-0x1260(%rbp)
cmpq   $0x0,-0x1260(%rbp)
je     151a <main+0x37a>
mov    -0x1260(%rbp),%rdi
lea    -0x1240(%rbp),%rsi
call   10c0 <strstr@plt>
mov    %rax,-0x1268(%rbp)
cmpq   $0x0,-0x1268(%rbp)
je     1515 <main+0x375>
mov    -0x1268(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    -0x1260(%rbp),%rcx
add    $0x4,%rcx
sub    %rcx,%rax
mov    %eax,-0x126c(%rbp)
lea    -0x2270(%rbp),%rdi
mov    -0x1260(%rbp),%rsi
add    $0x4,%rsi
mov    -0x126c(%rbp),%edx
call   1040 <strncpy@plt>
lea    0xbd4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xbc4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x1130(%rbp),%rsi
lea    0xbcb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x113c(%rbp),%esi
lea    0xbd7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x1240(%rbp),%rsi
lea    0xbb0(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x126c(%rbp),%esi
lea    0xba9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xba9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x2270(%rbp),%rsi
lea    0xb82(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xb9c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    151a <main+0x37a>
jmp    151f <main+0x37f>
jmp    1524 <main+0x384>
jmp    1529 <main+0x389>
jmp    152e <main+0x38e>
jmp    1533 <main+0x393>
xor    %eax,%eax
add    $0x2280,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2200,%rsp
lea    0x200(%rsp),%rdi
mov    $0x1000,%edx
xor    %esi,%esi
call   10b0 <memset@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0x1200(%rsp),%rdi
mov    $0x1000,%edx
xor    %esi,%esi
call   10b0 <memset@plt>
lea    0xd18(%rip),%rdi
call   1030 <getenv@plt>
lea    0xd19(%rip),%rsi
mov    %rax,%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     14a0 <main+0x2e0>
lea    0xd15(%rip),%rsi
mov    %rax,%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     14a0 <main+0x2e0>
mov    %rax,%rbx
lea    0xcfa(%rip),%rdi
call   1090 <strlen@plt>
cltq
add    %rax,%rbx
lea    0x100(%rsp),%rdi
mov    %rbx,%rsi
call   1060 <strcpy@plt>
lea    0xce3(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebp
mov    0x2c8a(%rip),%rax
mov    (%rax),%ecx
lea    0x200(%rsp),%rdi
mov    $0x1,%esi
mov    %ebp,%edx
call   1080 <fread@plt>
cmp    %eax,%ebp
jne    14a0 <main+0x2e0>
lea    0xd32(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   10d0 <strcat@plt>
lea    0x100(%rsp),%rsi
mov    %rbx,%rdi
call   10d0 <strcat@plt>
lea    0x200(%rsp),%rdi
mov    %rbx,%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
je     14a0 <main+0x2e0>
lea    0xc7c(%rip),%rsi
mov    %rax,%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     14a0 <main+0x2e0>
lea    0xc73(%rip),%rsi
mov    %rax,%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     14a0 <main+0x2e0>
mov    %rax,%r12
mov    %rsp,%rsi
mov    %rax,%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     14a0 <main+0x2e0>
mov    %rax,%r14
add    $0x4,%r12
sub    %r12d,%r14d
add    $0xfffffffe,%r14d
lea    0x1200(%rsp),%r15
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1050 <strncpy@plt>
lea    0xc4e(%rip),%rdi
call   1070 <puts@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xc0f(%rip),%rdi
lea    0x100(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xc19(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xbf7(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xbf3(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xc09(%rip),%rdi
call   1070 <puts@plt>
mov    %r15,%rdi
call   1070 <puts@plt>
lea    0xc0a(%rip),%rdi
call   1070 <puts@plt>
xor    %eax,%eax
add    $0x2200,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"CONTENT_TYPE\00"
@.str.1 = [20 x i8] c"multipart/form-data\00"
@.str.2 = [10 x i8] c"boundary=\00"
@.str.3 = [15 x i8] c"CONTENT_LENGTH\00"
@stdin = global i32 0
@.str.4 = [3 x i8] c"--\00"
@.str.5 = [15 x i8] c"Content-Type: \00"
@.str.6 = [5 x i8] c"\0D\0A\0D\0A\00"
@.str.7 = [26 x i8] c"Content-type: text/plain\0A\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [14 x i8] c"boundary: %s\0A\00"
@.str.10 = [9 x i8] c"len: %d\0A\00"
@.str.11 = [13 x i8] c"pattern: %s\0A\00"
@.str.12 = [14 x i8] c"file_len: %d\0A\00"
@.str.13 = [22 x i8] c"-----file begin-----\0A\00"
@.str.14 = [4 x i8] c"%s\0A\00"
@.str.15 = [20 x i8] c"-----file end-----\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4096 x i8]
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [256 x i8]
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [256 x i8]
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca [4096 x i8]
store i32 0, i32* %1
%17 = bitcast [4096 x i8]* %2 to i8*
store i8* null, i8** %3
store i8* null, i8** %4
store i8* null, i8** %5
%18 = bitcast [256 x i8]* %6 to i8*
store i8* null, i8** %7
store i32 0, i32* %8
%19 = bitcast [256 x i8]* %9 to i8*
store i32 0, i32* %10
store i8* null, i8** %11
store i8* null, i8** %12
store i8* null, i8** %13
store i8* null, i8** %14
store i32 0, i32* %15
%20 = bitcast [4096 x i8]* %16 to i8*
%21 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i8* %21, i8** %3
%22 = load i8*, i8** %3
%23 = call i8* @strstr(i8* %22, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i8* %23, i8** %4
%24 = load i8*, i8** %4
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %109
26: ; preds = %0
%27 = load i8*, i8** %4
%28 = call i8* @strstr(i8* %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
store i8* %28, i8** %5
%29 = load i8*, i8** %5
%30 = icmp ne i8* %29, null
br i1 %30, label %31, label %108
31: ; preds = %26
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%33 = load i8*, i8** %5
%34 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %33, i64 %35
%37 = call i32 @strcpy(i8* %32, i8* %36)
%38 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
store i8* %38, i8** %7
%39 = load i8*, i8** %7
%40 = call i32 @atoi(i8* %39)
store i32 %40, i32* %8
%41 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%42 = load i32, i32* %8
%43 = load i32, i32* @stdin
%44 = call i32 @fread(i8* %41, i32 1, i32 %42, i32 %43)
store i32 %44, i32* %10
%45 = load i32, i32* %8
%46 = load i32, i32* %10
%47 = icmp eq i32 %45, %46
br i1 %47, label %48, label %107
48: ; preds = %31
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%50 = call i32 @strcat(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%53 = call i32 @strcat(i8* %51, i8* %52)
%54 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%56 = call i8* @strstr(i8* %54, i8* %55)
store i8* %56, i8** %11
%57 = load i8*, i8** %11
%58 = icmp ne i8* %57, null
br i1 %58, label %59, label %106
59: ; preds = %48
%60 = load i8*, i8** %11
%61 = call i8* @strstr(i8* %60, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
store i8* %61, i8** %12
%62 = load i8*, i8** %12
%63 = icmp ne i8* %62, null
br i1 %63, label %64, label %105
64: ; preds = %59
%65 = load i8*, i8** %12
%66 = call i8* @strstr(i8* %65, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i8* %66, i8** %13
%67 = load i8*, i8** %13
%68 = icmp ne i8* %67, null
br i1 %68, label %69, label %104
69: ; preds = %64
%70 = load i8*, i8** %13
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%72 = call i8* @strstr(i8* %70, i8* %71)
store i8* %72, i8** %14
%73 = load i8*, i8** %14
%74 = icmp ne i8* %73, null
br i1 %74, label %75, label %103
75: ; preds = %69
%76 = load i8*, i8** %14
%77 = getelementptr inbounds i8, i8* %76, i64 -2
%78 = load i8*, i8** %13
%79 = getelementptr inbounds i8, i8* %78, i64 4
%80 = ptrtoint i8* %77 to i64
%81 = ptrtoint i8* %79 to i64
%82 = sub i64 %80, %81
%83 = trunc i64 %82 to i32
store i32 %83, i32* %15
%84 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 0
%85 = load i8*, i8** %13
%86 = getelementptr inbounds i8, i8* %85, i64 4
%87 = load i32, i32* %15
%88 = call i32 @strncpy(i8* %84, i8* %86, i32 %87)
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %91)
%93 = load i32, i32* %8
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %93)
%95 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* %95)
%97 = load i32, i32* %15
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 %97)
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0))
%100 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 0
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8* %100)
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0))
br label %103
103: ; preds = %75, %69
br label %104
104: ; preds = %103, %64
br label %105
105: ; preds = %104, %59
br label %106
106: ; preds = %105, %48
br label %107
107: ; preds = %106, %31
br label %108
108: ; preds = %107, %26
br label %109
109: ; preds = %108, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"CONTENT_TYPE\00"
@.str.1 = [20 x i8] c"multipart/form-data\00"
@.str.2 = [10 x i8] c"boundary=\00"
@.str.3 = [15 x i8] c"CONTENT_LENGTH\00"
@stdin = global i32 0
@.str.4 = [3 x i8] c"--\00"
@.str.5 = [15 x i8] c"Content-Type: \00"
@.str.6 = [5 x i8] c"\0D\0A\0D\0A\00"
@.str.9 = [14 x i8] c"boundary: %s\0A\00"
@.str.10 = [9 x i8] c"len: %d\0A\00"
@.str.11 = [13 x i8] c"pattern: %s\0A\00"
@.str.12 = [14 x i8] c"file_len: %d\0A\00"
@str = [25 x i8] c"Content-type: text/plain\00"
@str.16 = [21 x i8] c"-----file begin-----\00"
@str.17 = [19 x i8] c"-----file end-----\00"
define i32 @main() {
%1 = alloca [4096 x i8]
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca [4096 x i8]
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%9 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = tail call i8* @strstr(i8* dereferenceable(1) %9, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %56, label %12
12: ; preds = %0
%13 = tail call i8* @strstr(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i8* %13, null
br i1 %14, label %56, label %15
15: ; preds = %12
%16 = tail call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %13, i64 %17
%19 = call i32 @strcpy(i8* %6, i8* %18)
%20 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 @atoi(i8* %20)
%22 = load i32, i32* @stdin
%23 = call i32 @fread(i8* %5, i32 1, i32 %21, i32 %22)
%24 = icmp eq i32 %21, %23
br i1 %24, label %25, label %56
25: ; preds = %15
%26 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 @strcat(i8* %7, i8* %6)
%28 = call i8* @strstr(i8* %5, i8* %7)
%29 = icmp eq i8* %28, null
br i1 %29, label %56, label %30
30: ; preds = %25
%31 = call i8* @strstr(i8* %28, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%32 = icmp eq i8* %31, null
br i1 %32, label %56, label %33
33: ; preds = %30
%34 = call i8* @strstr(i8* %31, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp eq i8* %34, null
br i1 %35, label %56, label %36
36: ; preds = %33
%37 = call i8* @strstr(i8* %34, i8* %7)
%38 = icmp eq i8* %37, null
br i1 %38, label %56, label %39
39: ; preds = %36
%40 = getelementptr inbounds i8, i8* %37, i64 -2
%41 = getelementptr inbounds i8, i8* %34, i64 4
%42 = ptrtoint i8* %40 to i64
%43 = ptrtoint i8* %41 to i64
%44 = sub i64 %42, %43
%45 = trunc i64 %44 to i32
%46 = call i32 @strncpy(i8* %8, i8* %41, i32 %45)
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%48 = call i32 @putchar(i32 10)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %6)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %21)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* %7)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 %45)
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.16, i64 0, i64 0))
%54 = call i32 @puts(i8* %8)
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.17, i64 0, i64 0))
br label %56
56: ; preds = %12, %25, %33, %39, %36, %30, %15, %0
ret i32 0
}