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

/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
char *getenv(char *);
int getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strcasecmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *get_mime_type(char *filename) {
  char *str, *s, *a, *fname = NULL;
  FILE *mime;
  size_t n;
  a = filename + strlen(filename);
  while (a != filename) {
    if (*a == '.') {
      a++;
      break;
    }
    a--;
  }
  if (a == filename)
    a = "";
  if (!(s = getenv("conf_dir")))
    return NULL;
  str = calloc(n = (strlen(s) + 256), sizeof(char));
  sprintf(str, "%s/mime", s);
  if (!(mime = fopen(str, "r")))
    return NULL;
  while (getline(&str, &n, mime) != -1) {
    if (*str == '#')
      continue;
    for (s = str; *s; s++)
      if ((*s == ' ') || (*s == '\t'))
        break;
    *(s++) = 0;
    if (!strcasecmp(a, str)) {
      for (a = s; (*s == ' ') || (*s == '\t'); s++)
        ;
      for (a = s; *s; s++)
        if ((*s == '\r') || (*s == '\n'))
          break;
      *s = 0;
      fname = calloc(1 + strlen(a), sizeof(char));
      strcpy(fname, a);
      break;
    }
  }
  if (!fname) {
    fname = calloc(32, sizeof(char));
    strcpy(fname, "application/octet-stream");
  }
  (free(str), (str) = NULL);
  fclose(mime);
  return fname;
}


x86 assembly (clang, -O0):
<get_mime_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <strlen@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1215 <get_mime_type+0x75>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1204 <get_mime_type+0x64>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1215 <get_mime_type+0x75>
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
jmp    11d5 <get_mime_type+0x35>
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    122e <get_mime_type+0x8e>
lea    0xde6(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xdcb(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1255 <get_mime_type+0xb5>
movq   $0x0,-0x8(%rbp)
jmp    1491 <get_mime_type+0x2f1>
mov    -0x20(%rbp),%rdi
call   1080 <strlen@plt>
add    $0x100,%eax
cltq
mov    %rax,-0x40(%rbp)
mov    %eax,%edi
mov    $0x1,%esi
call   1090 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xd81(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xd6f(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    12b8 <get_mime_type+0x118>
movq   $0x0,-0x8(%rbp)
jmp    1491 <get_mime_type+0x2f1>
jmp    12bd <get_mime_type+0x11d>
mov    -0x38(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   10b0 <getline@plt>
cmp    $0xffffffff,%eax
je     1441 <get_mime_type+0x2a1>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    12ec <get_mime_type+0x14c>
jmp    12bd <get_mime_type+0x11d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     133c <get_mime_type+0x19c>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1321 <get_mime_type+0x181>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1326 <get_mime_type+0x186>
jmp    133c <get_mime_type+0x19c>
jmp    132b <get_mime_type+0x18b>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    12f4 <get_mime_type+0x154>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcasecmp@plt>
cmp    $0x0,%eax
jne    143c <get_mime_type+0x29c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x49(%rbp)
je     1391 <get_mime_type+0x1f1>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x49(%rbp)
mov    -0x49(%rbp),%al
test   $0x1,%al
jne    13a1 <get_mime_type+0x201>
jmp    13b7 <get_mime_type+0x217>
jmp    13a6 <get_mime_type+0x206>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    136c <get_mime_type+0x1cc>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1407 <get_mime_type+0x267>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     13ec <get_mime_type+0x24c>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    13f1 <get_mime_type+0x251>
jmp    1407 <get_mime_type+0x267>
jmp    13f6 <get_mime_type+0x256>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    13bf <get_mime_type+0x21f>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rdi
call   1080 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1090 <calloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <strcpy@plt>
jmp    1441 <get_mime_type+0x2a1>
jmp    12bd <get_mime_type+0x11d>
cmpq   $0x0,-0x30(%rbp)
jne    146f <get_mime_type+0x2cf>
mov    $0x20,%edi
mov    $0x1,%esi
call   1090 <calloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xba7(%rip),%rsi
call   1060 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x38(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mime_type>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
call   1080 <strlen@plt>
cltq
test   %eax,%eax
je     11d1 <get_mime_type+0x31>
nopl   0x0(%rax)
cmpb   $0x2e,(%rbx,%rax,1)
je     11d6 <get_mime_type+0x36>
add    $0xffffffffffffffff,%rax
jne    11c0 <get_mime_type+0x20>
mov    %rbx,%rax
jmp    11dd <get_mime_type+0x3d>
add    %rbx,%rax
jmp    11dd <get_mime_type+0x3d>
add    %rbx,%rax
add    $0x1,%rax
cmp    %rbx,%rax
lea    0xe29(%rip),%r15
cmovne %rax,%r15
lea    0xe0e(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     138e <get_mime_type+0x1ee>
mov    %rax,%r14
mov    %rax,%rdi
call   1080 <strlen@plt>
add    $0x100,%eax
movslq %eax,%rdi
mov    %rdi,0x10(%rsp)
mov    $0x1,%esi
call   1090 <calloc@plt>
mov    %rax,%rbx
mov    %rax,0x8(%rsp)
lea    0xdd8(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   10c0 <sprintf@plt>
lea    0xdc4(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     138e <get_mime_type+0x1ee>
mov    %rax,%r14
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    %rax,%rdx
call   10b0 <getline@plt>
cmp    $0xffffffff,%eax
je     1350 <get_mime_type+0x1b0>
lea    0x8(%rsp),%r12
lea    0x10(%rsp),%r13
movabs $0x100000201,%rbp
jmp    12a7 <get_mime_type+0x107>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   10b0 <getline@plt>
cmp    $0xffffffff,%eax
je     1350 <get_mime_type+0x1b0>
mov    0x8(%rsp),%rbx
mov    (%rbx),%al
cmp    $0x23,%al
jne    12c3 <get_mime_type+0x123>
jmp    1290 <get_mime_type+0xf0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%eax
add    $0x1,%rbx
cmp    $0x20,%al
ja     12c0 <get_mime_type+0x120>
movzbl %al,%eax
bt     %rax,%rbp
jae    12c0 <get_mime_type+0x120>
movb   $0x0,-0x1(%rbx)
mov    0x8(%rsp),%rsi
mov    %r15,%rdi
call   1050 <strcasecmp@plt>
test   %eax,%eax
jne    1290 <get_mime_type+0xf0>
jmp    12f4 <get_mime_type+0x154>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x9,%al
je     12f0 <get_mime_type+0x150>
cmp    $0x20,%al
je     12f0 <get_mime_type+0x150>
lea    0x1(%rbx),%rcx
mov    $0x2401,%edx
jmp    1317 <get_mime_type+0x177>
nopw   0x0(%rax,%rax,1)
movzbl (%rcx),%eax
add    $0x1,%rcx
cmp    $0xd,%al
ja     1310 <get_mime_type+0x170>
movzbl %al,%eax
bt     %rax,%rdx
jae    1310 <get_mime_type+0x170>
movb   $0x0,-0x1(%rcx)
mov    %rbx,%rdi
call   1080 <strlen@plt>
lea    0x1(%rax),%edi
mov    $0x1,%esi
call   1090 <calloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %rbx,%rsi
call   1060 <strcpy@plt>
test   %r15,%r15
jne    1371 <get_mime_type+0x1d1>
mov    $0x20,%edi
mov    $0x1,%esi
call   1090 <calloc@plt>
mov    %rax,%r15
lea    0xca8(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcpy@plt>
mov    0x8(%rsp),%rdi
call   1040 <free@plt>
movq   $0x0,0x8(%rsp)
mov    %r14,%rdi
call   1070 <fclose@plt>
jmp    1391 <get_mime_type+0x1f1>
xor    %r15d,%r15d
mov    %r15,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [9 x i8] c"conf_dir\00"
@.str.2 = [8 x i8] c"%s/mime\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [25 x i8] c"application/octet-stream\00"
define i8* @get_mime_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i64
store i8* %0, i8** %3
store i8* null, i8** %7
%10 = load i8*, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @strlen(i8* %11)
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
store i8* %14, i8** %6
br label %15
15: ; preds = %27, %1
%16 = load i8*, i8** %6
%17 = load i8*, i8** %3
%18 = icmp ne i8* %16, %17
br i1 %18, label %19, label %30
19: ; preds = %15
%20 = load i8*, i8** %6
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 46
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = load i8*, i8** %6
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %6
br label %30
27: ; preds = %19
%28 = load i8*, i8** %6
%29 = getelementptr inbounds i8, i8* %28, i32 -1
store i8* %29, i8** %6
br label %15
30: ; preds = %24, %15
%31 = load i8*, i8** %6
%32 = load i8*, i8** %3
%33 = icmp eq i8* %31, %32
br i1 %33, label %34, label %35
34: ; preds = %30
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %6
br label %35
35: ; preds = %34, %30
%36 = call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i8* %36, i8** %5
%37 = icmp ne i8* %36, null
br i1 %37, label %39, label %38
38: ; preds = %35
store i8* null, i8** %2
br label %154
39: ; preds = %35
%40 = load i8*, i8** %5
%41 = call i32 @strlen(i8* %40)
%42 = add nsw i32 %41, 256
%43 = sext i32 %42 to i64
store i64 %43, i64* %9
%44 = trunc i64 %43 to i32
%45 = call i8* @calloc(i32 %44, i32 1)
store i8* %45, i8** %4
%46 = load i8*, i8** %4
%47 = load i8*, i8** %5
%48 = call i32 @sprintf(i8* %46, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %47)
%49 = load i8*, i8** %4
%50 = call i32* @fopen(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %50, i32** %8
%51 = icmp ne i32* %50, null
br i1 %51, label %53, label %52
52: ; preds = %39
store i8* null, i8** %2
br label %154
53: ; preds = %39
br label %54
54: ; preds = %140, %63, %53
%55 = load i32*, i32** %8
%56 = call i32 @getline(i8** %4, i64* %9, i32* %55)
%57 = icmp ne i32 %56, -1
br i1 %57, label %58, label %141
58: ; preds = %54
%59 = load i8*, i8** %4
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 35
br i1 %62, label %63, label %64
63: ; preds = %58
br label %54
64: ; preds = %58
%65 = load i8*, i8** %4
store i8* %65, i8** %5
br label %66
66: ; preds = %82, %64
%67 = load i8*, i8** %5
%68 = load i8, i8* %67
%69 = icmp ne i8 %68, 0
br i1 %69, label %70, label %85
70: ; preds = %66
%71 = load i8*, i8** %5
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 32
br i1 %74, label %80, label %75
75: ; preds = %70
%76 = load i8*, i8** %5
%77 = load i8, i8* %76
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 9
br i1 %79, label %80, label %81
80: ; preds = %75, %70
br label %85
81: ; preds = %75
br label %82
82: ; preds = %81
%83 = load i8*, i8** %5
%84 = getelementptr inbounds i8, i8* %83, i32 1
store i8* %84, i8** %5
br label %66
85: ; preds = %80, %66
%86 = load i8*, i8** %5
%87 = getelementptr inbounds i8, i8* %86, i32 1
store i8* %87, i8** %5
store i8 0, i8* %86
%88 = load i8*, i8** %6
%89 = load i8*, i8** %4
%90 = call i32 @strcasecmp(i8* %88, i8* %89)
%91 = icmp ne i32 %90, 0
br i1 %91, label %140, label %92
92: ; preds = %85
%93 = load i8*, i8** %5
store i8* %93, i8** %6
br label %94
94: ; preds = %107, %92
%95 = load i8*, i8** %5
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = icmp eq i32 %97, 32
br i1 %98, label %104, label %99
99: ; preds = %94
%100 = load i8*, i8** %5
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = icmp eq i32 %102, 9
br label %104
104: ; preds = %99, %94
%105 = phi i1 [ true, %94 ], [ %103, %99 ]
br i1 %105, label %106, label %110
106: ; preds = %104
br label %107
107: ; preds = %106
%108 = load i8*, i8** %5
%109 = getelementptr inbounds i8, i8* %108, i32 1
store i8* %109, i8** %5
br label %94
110: ; preds = %104
%111 = load i8*, i8** %5
store i8* %111, i8** %6
br label %112
112: ; preds = %128, %110
%113 = load i8*, i8** %5
%114 = load i8, i8* %113
%115 = icmp ne i8 %114, 0
br i1 %115, label %116, label %131
116: ; preds = %112
%117 = load i8*, i8** %5
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = icmp eq i32 %119, 13
br i1 %120, label %126, label %121
121: ; preds = %116
%122 = load i8*, i8** %5
%123 = load i8, i8* %122
%124 = sext i8 %123 to i32
%125 = icmp eq i32 %124, 10
br i1 %125, label %126, label %127
126: ; preds = %121, %116
br label %131
127: ; preds = %121
br label %128
128: ; preds = %127
%129 = load i8*, i8** %5
%130 = getelementptr inbounds i8, i8* %129, i32 1
store i8* %130, i8** %5
br label %112
131: ; preds = %126, %112
%132 = load i8*, i8** %5
store i8 0, i8* %132
%133 = load i8*, i8** %6
%134 = call i32 @strlen(i8* %133)
%135 = add nsw i32 1, %134
%136 = call i8* @calloc(i32 %135, i32 1)
store i8* %136, i8** %7
%137 = load i8*, i8** %7
%138 = load i8*, i8** %6
%139 = call i32 @strcpy(i8* %137, i8* %138)
br label %141
140: ; preds = %85
br label %54
141: ; preds = %131, %54
%142 = load i8*, i8** %7
%143 = icmp ne i8* %142, null
br i1 %143, label %148, label %144
144: ; preds = %141
%145 = call i8* @calloc(i32 32, i32 1)
store i8* %145, i8** %7
%146 = load i8*, i8** %7
%147 = call i32 @strcpy(i8* %146, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %148
148: ; preds = %144, %141
%149 = load i8*, i8** %4
%150 = call i32 @free(i8* %149)
store i8* null, i8** %4
%151 = load i32*, i32** %8
%152 = call i32 @fclose(i32* %151)
%153 = load i8*, i8** %7
store i8* %153, i8** %2
br label %154
154: ; preds = %148, %52, %38
%155 = load i8*, i8** %2
ret i8* %155
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [9 x i8] c"conf_dir\00"
@.str.2 = [8 x i8] c"%s/mime\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [25 x i8] c"application/octet-stream\00"
define i8* @get_mime_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = bitcast i8** %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = tail call i32 @strlen(i8* %0)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = icmp eq i32 %6, 0
br i1 %9, label %19, label %10
10: ; preds = %1, %16
%11 = phi i8* [ %17, %16 ], [ %8, %1 ]
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 46
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = getelementptr inbounds i8, i8* %11, i64 1
br label %19
16: ; preds = %10
%17 = getelementptr inbounds i8, i8* %11, i64 -1
%18 = icmp eq i8* %17, %0
br i1 %18, label %19, label %10
19: ; preds = %16, %1, %14
%20 = phi i8* [ %15, %14 ], [ %8, %1 ], [ %0, %16 ]
%21 = icmp eq i8* %20, %0
%22 = select i1 %21, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %20
%23 = tail call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i8* %23, null
br i1 %24, label %78, label %25
25: ; preds = %19
%26 = tail call i32 @strlen(i8* %23)
%27 = add nsw i32 %26, 256
%28 = sext i32 %27 to i64
store i64 %28, i64* %3
%29 = tail call i8* @calloc(i32 %27, i32 1)
store i8* %29, i8** %2
%30 = tail call i32 @sprintf(i8* dereferenceable(1) %29, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%31 = tail call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i32* %31, null
br i1 %32, label %78, label %33
33: ; preds = %25
%34 = call i32 @getline(i8** %2, i64* %3, i32* %31)
%35 = icmp eq i32 %34, -1
br i1 %35, label %70, label %36
36: ; preds = %33, %40
%37 = load i8*, i8** %2
%38 = load i8, i8* %37
%39 = icmp eq i8 %38, 35
br i1 %39, label %40, label %43
40: ; preds = %36, %49
%41 = call i32 @getline(i8** %2, i64* %3, i32* %31)
%42 = icmp eq i32 %41, -1
br i1 %42, label %70, label %36
43: ; preds = %36, %46
%44 = phi i8 [ %48, %46 ], [ %38, %36 ]
%45 = phi i8* [ %47, %46 ], [ %37, %36 ]
switch i8 %44, label %46 [
i8 0, label %49
i8 32, label %49
i8 9, label %49
]
46: ; preds = %43
%47 = getelementptr inbounds i8, i8* %45, i64 1
%48 = load i8, i8* %47
br label %43
49: ; preds = %43, %43, %43
store i8 0, i8* %45
%50 = load i8*, i8** %2
%51 = call i32 @strcasecmp(i8* %22, i8* %50)
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %40
53: ; preds = %49, %57
%54 = phi i8* [ %55, %57 ], [ %45, %49 ]
%55 = getelementptr inbounds i8, i8* %54, i64 1
%56 = load i8, i8* %55
switch i8 %56, label %58 [
i8 32, label %57
i8 9, label %57
]
57: ; preds = %53, %53
br label %53
58: ; preds = %53, %61
%59 = phi i8 [ %63, %61 ], [ %56, %53 ]
%60 = phi i8* [ %62, %61 ], [ %55, %53 ]
switch i8 %59, label %61 [
i8 0, label %64
i8 13, label %64
i8 10, label %64
]
61: ; preds = %58
%62 = getelementptr inbounds i8, i8* %60, i64 1
%63 = load i8, i8* %62
br label %58
64: ; preds = %58, %58, %58
store i8 0, i8* %60
%65 = call i32 @strlen(i8* %55)
%66 = add nsw i32 %65, 1
%67 = call i8* @calloc(i32 %66, i32 1)
%68 = call i32 @strcpy(i8* %67, i8* %55)
%69 = icmp eq i8* %67, null
br i1 %69, label %70, label %73
70: ; preds = %40, %33, %64
%71 = call dereferenceable_or_null(32) i8* @calloc(i32 32, i32 1)
%72 = call i32 @strcpy(i8* %71, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %73
73: ; preds = %70, %64
%74 = phi i8* [ %67, %64 ], [ %71, %70 ]
%75 = load i8*, i8** %2
%76 = call i32 @free(i8* %75)
store i8* null, i8** %2
%77 = call i32 @fclose(i32* %31)
br label %78
78: ; preds = %25, %19, %73
%79 = phi i8* [ %74, %73 ], [ null, %19 ], [ null, %25 ]
ret i8* %79
}