#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 /*<<< orphan*/ strcmp(char *, char *);
scalar_t__ strlen(char *);
char toupper(char);
int get_filetype(char *type_string) {
  struct ft {
    char *name;
    int code;
  } filetype[] = {{"TEXT", 1},
                  {"SDATA", 0xE0D0},
                  {"DATA71", 0xE0F0},
                  {"BIN71", 0xE204},
                  {"LEX71", 0xE208},
                  {"KEY71", 0xE20C},
                  {"BASIC71", 0xE214},
                  {"FORTH71", 0xE218},
                  {"WALL41", 0xE040},
                  {"KEY41", 0xE050},
                  {"STAT41", 0xE060},
                  {"ROM41", 0xE070},
                  {"PROG41", 0xE080},
                  {"TEXT75", 0xE052},
                  {"APPT75", 0xE053},
                  {"LEX75", 0xE089},
                  {"BASIC75", 0xE088},
                  {"ROM75", 0xE08B},
                  {"", 0}};
  char uc_ftype[11];
  int i;
  int type_code;
  i = 0;
  while ((i < 10) && (type_string[i] > ' ')) {
    uc_ftype[i] = toupper(type_string[i]);
    i++;
  }
  uc_ftype[i] = 0;
  i = 0;
  type_code = -1;
  while (strlen(filetype[i].name)) {
    if (!strcmp(uc_ftype, filetype[i].name)) {
      type_code = filetype[i].code;
      break;
    }
    i++;
  }
  return (type_code);
}


x86 assembly (clang, -O0):
<get_filetype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x140(%rbp),%rdi
lea    0x2b93(%rip),%rsi
mov    $0x130,%edx
call   1060 <memcpy@plt>
movl   $0x0,-0x150(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x150(%rbp)
mov    %al,-0x155(%rbp)
jge    11a1 <get_filetype+0x61>
mov    -0x8(%rbp),%rax
movslq -0x150(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
setg   %al
mov    %al,-0x155(%rbp)
mov    -0x155(%rbp),%al
test   $0x1,%al
jne    11b4 <get_filetype+0x74>
jmp    11ec <get_filetype+0xac>
mov    -0x8(%rbp),%rax
movslq -0x150(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%cl
movslq -0x150(%rbp),%rax
mov    %cl,-0x14b(%rbp,%rax,1)
mov    -0x150(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x150(%rbp)
jmp    1171 <get_filetype+0x31>
movslq -0x150(%rbp),%rax
movb   $0x0,-0x14b(%rbp,%rax,1)
movl   $0x0,-0x150(%rbp)
movl   $0xffffffff,-0x154(%rbp)
ff ff ff
movslq -0x150(%rbp),%rcx
lea    -0x140(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
je     129a <get_filetype+0x15a>
lea    -0x14b(%rbp),%rdi
movslq -0x150(%rbp),%rcx
lea    -0x140(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1286 <get_filetype+0x146>
movslq -0x150(%rbp),%rcx
lea    -0x140(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%eax
mov    %eax,-0x154(%rbp)
jmp    129a <get_filetype+0x15a>
mov    -0x150(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x150(%rbp)
jmp    120f <get_filetype+0xcf>
mov    -0x154(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filetype>:
push   %rbx
sub    $0x10,%rsp
mov    (%rdi),%al
cmp    $0x21,%al
jl     121e <get_filetype+0x10e>
mov    %rdi,%rbx
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,0x5(%rsp)
mov    0x1(%rbx),%cl
mov    $0x1,%eax
cmp    $0x21,%cl
jl     1220 <get_filetype+0x110>
movsbl %cl,%edi
call   1030 <toupper@plt>
mov    %al,0x6(%rsp)
mov    0x2(%rbx),%cl
mov    $0x2,%eax
cmp    $0x21,%cl
jl     1220 <get_filetype+0x110>
movsbl %cl,%edi
call   1030 <toupper@plt>
mov    %al,0x7(%rsp)
mov    0x3(%rbx),%cl
mov    $0x3,%eax
cmp    $0x21,%cl
jl     1220 <get_filetype+0x110>
movsbl %cl,%edi
call   1030 <toupper@plt>
mov    %al,0x8(%rsp)
mov    0x4(%rbx),%cl
mov    $0x4,%eax
cmp    $0x21,%cl
jl     1220 <get_filetype+0x110>
movsbl %cl,%edi
call   1030 <toupper@plt>
mov    %al,0x9(%rsp)
mov    0x5(%rbx),%cl
mov    $0x5,%eax
cmp    $0x21,%cl
jl     1220 <get_filetype+0x110>
movsbl %cl,%edi
call   1030 <toupper@plt>
mov    %al,0xa(%rsp)
mov    0x6(%rbx),%cl
mov    $0x6,%eax
cmp    $0x21,%cl
jl     1220 <get_filetype+0x110>
movsbl %cl,%edi
call   1030 <toupper@plt>
mov    %al,0xb(%rsp)
mov    0x7(%rbx),%cl
mov    $0x7,%eax
cmp    $0x21,%cl
jl     1220 <get_filetype+0x110>
movsbl %cl,%edi
call   1030 <toupper@plt>
mov    %al,0xc(%rsp)
mov    0x8(%rbx),%cl
mov    $0x8,%eax
cmp    $0x21,%cl
jl     1220 <get_filetype+0x110>
movsbl %cl,%edi
call   1030 <toupper@plt>
mov    0x9(%rbx),%cl
mov    $0x9,%eax
cmp    $0x21,%cl
jl     1220 <get_filetype+0x110>
movsbl %cl,%edi
call   1030 <toupper@plt>
mov    $0xa,%eax
jmp    1220 <get_filetype+0x110>
xor    %eax,%eax
movb   $0x0,0x5(%rsp,%rax,1)
mov    $0x54584554,%eax
xor    0x5(%rsp),%eax
movzbl 0x9(%rsp),%ecx
or     %eax,%ecx
je     13e7 <get_filetype+0x2d7>
mov    $0x54414453,%eax
xor    0x5(%rsp),%eax
movzwl 0x9(%rsp),%ecx
xor    $0x41,%ecx
or     %eax,%ecx
je     13eb <get_filetype+0x2db>
mov    $0x41544144,%eax
xor    0x5(%rsp),%eax
mov    $0x313741,%ecx
xor    0x8(%rsp),%ecx
or     %eax,%ecx
je     13f2 <get_filetype+0x2e2>
mov    $0x374e4942,%eax
xor    0x5(%rsp),%eax
movzwl 0x9(%rsp),%ecx
xor    $0x31,%ecx
or     %eax,%ecx
je     13f9 <get_filetype+0x2e9>
mov    $0x3758454c,%eax
xor    0x5(%rsp),%eax
movzwl 0x9(%rsp),%ecx
xor    $0x31,%ecx
or     %eax,%ecx
je     1400 <get_filetype+0x2f0>
mov    $0x3759454b,%eax
xor    0x5(%rsp),%eax
movzwl 0x9(%rsp),%ecx
xor    $0x31,%ecx
or     %eax,%ecx
je     1407 <get_filetype+0x2f7>
movabs $0x31374349534142,%rax
cmp    %rax,0x5(%rsp)
je     140e <get_filetype+0x2fe>
movabs $0x31374854524f46,%rax
cmp    %rax,0x5(%rsp)
je     1415 <get_filetype+0x305>
mov    $0x4c4c4157,%eax
xor    0x5(%rsp),%eax
mov    $0x31344c,%ecx
xor    0x8(%rsp),%ecx
or     %eax,%ecx
je     141c <get_filetype+0x30c>
mov    $0x3459454b,%eax
xor    0x5(%rsp),%eax
movzwl 0x9(%rsp),%ecx
xor    $0x31,%ecx
or     %eax,%ecx
je     1423 <get_filetype+0x313>
mov    $0x54415453,%eax
xor    0x5(%rsp),%eax
mov    $0x313454,%ecx
xor    0x8(%rsp),%ecx
or     %eax,%ecx
je     142a <get_filetype+0x31a>
mov    $0x344d4f52,%eax
xor    0x5(%rsp),%eax
movzwl 0x9(%rsp),%ecx
xor    $0x31,%ecx
or     %eax,%ecx
je     1431 <get_filetype+0x321>
mov    $0x474f5250,%eax
xor    0x5(%rsp),%eax
mov    $0x313447,%ecx
xor    0x8(%rsp),%ecx
or     %eax,%ecx
je     1438 <get_filetype+0x328>
mov    $0x54584554,%ecx
xor    0x5(%rsp),%ecx
mov    $0x353754,%eax
mov    0x8(%rsp),%edx
xor    %eax,%edx
or     %ecx,%edx
je     143f <get_filetype+0x32f>
mov    $0x54505041,%ecx
xor    0x5(%rsp),%ecx
xor    0x8(%rsp),%eax
or     %ecx,%eax
je     1446 <get_filetype+0x336>
mov    $0x3758454c,%eax
xor    0x5(%rsp),%eax
movzwl 0x9(%rsp),%ecx
xor    $0x35,%ecx
or     %eax,%ecx
je     144d <get_filetype+0x33d>
movabs $0x35374349534142,%rax
cmp    %rax,0x5(%rsp)
je     1454 <get_filetype+0x344>
mov    $0x374d4f52,%ecx
xor    0x5(%rsp),%ecx
movzwl 0x9(%rsp),%edx
xor    $0x35,%edx
mov    $0xffffffff,%eax
or     %ecx,%edx
jne    1468 <get_filetype+0x358>
mov    $0x11,%eax
jmp    1459 <get_filetype+0x349>
xor    %eax,%eax
jmp    1459 <get_filetype+0x349>
mov    $0x1,%eax
jmp    1459 <get_filetype+0x349>
mov    $0x2,%eax
jmp    1459 <get_filetype+0x349>
mov    $0x3,%eax
jmp    1459 <get_filetype+0x349>
mov    $0x4,%eax
jmp    1459 <get_filetype+0x349>
mov    $0x5,%eax
jmp    1459 <get_filetype+0x349>
mov    $0x6,%eax
jmp    1459 <get_filetype+0x349>
mov    $0x7,%eax
jmp    1459 <get_filetype+0x349>
mov    $0x8,%eax
jmp    1459 <get_filetype+0x349>
mov    $0x9,%eax
jmp    1459 <get_filetype+0x349>
mov    $0xa,%eax
jmp    1459 <get_filetype+0x349>
mov    $0xb,%eax
jmp    1459 <get_filetype+0x349>
mov    $0xc,%eax
jmp    1459 <get_filetype+0x349>
mov    $0xd,%eax
jmp    1459 <get_filetype+0x349>
mov    $0xe,%eax
jmp    1459 <get_filetype+0x349>
mov    $0xf,%eax
jmp    1459 <get_filetype+0x349>
mov    $0x10,%eax
shl    $0x4,%rax
lea    0x288c(%rip),%rcx
mov    0x8(%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.ft = type { i8*, i32 }
@.str = [5 x i8] c"TEXT\00"
@.str.1 = [6 x i8] c"SDATA\00"
@.str.2 = [7 x i8] c"DATA71\00"
@.str.3 = [6 x i8] c"BIN71\00"
@.str.4 = [6 x i8] c"LEX71\00"
@.str.5 = [6 x i8] c"KEY71\00"
@.str.6 = [8 x i8] c"BASIC71\00"
@.str.7 = [8 x i8] c"FORTH71\00"
@.str.8 = [7 x i8] c"WALL41\00"
@.str.9 = [6 x i8] c"KEY41\00"
@.str.10 = [7 x i8] c"STAT41\00"
@.str.11 = [6 x i8] c"ROM41\00"
@.str.12 = [7 x i8] c"PROG41\00"
@.str.13 = [7 x i8] c"TEXT75\00"
@.str.14 = [7 x i8] c"APPT75\00"
@.str.15 = [6 x i8] c"LEX75\00"
@.str.16 = [8 x i8] c"BASIC75\00"
@.str.17 = [6 x i8] c"ROM75\00"
@.str.18 = [1 x i8] zeroinitializer
@__const.get_filetype.filetype = [19 x %struct.ft] [%struct.ft { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i32 1 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i32 57552 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i32 57584 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i32 57860 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i32 57864 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i32 57868 }, %struct.ft { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i32 0, i32 0), i32 57876 }, %struct.ft { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i32 0, i32 0), i32 57880 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i32 0, i32 0), i32 57408 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i32 57424 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i32 0, i32 0), i32 57440 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i32 57456 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i32 0, i32 0), i32 57472 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i32 0, i32 0), i32 57426 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i32 0, i32 0), i32 57427 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i32 57481 }, %struct.ft { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i32 0, i32 0), i32 57480 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i32 0, i32 0), i32 57483 }, %struct.ft { i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i32 0 }]
define i32 @get_filetype(i8* %0) {
%2 = alloca i8*
%3 = alloca [19 x %struct.ft]
%4 = alloca [11 x i8]
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = bitcast [19 x %struct.ft]* %3 to i8*
store i32 0, i32* %5
br label %8
8: ; preds = %21, %1
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i8*, i8** %2
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sgt i32 %17, 32
br label %19
19: ; preds = %11, %8
%20 = phi i1 [ false, %8 ], [ %18, %11 ]
br i1 %20, label %21, label %33
21: ; preds = %19
%22 = load i8*, i8** %2
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = call signext i8 @toupper(i8 signext %26)
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 %29
store i8 %27, i8* %30
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %8
33: ; preds = %19
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 %35
store i8 0, i8* %36
store i32 0, i32* %5
store i32 -1, i32* %6
br label %37
37: ; preds = %60, %33
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [19 x %struct.ft], [19 x %struct.ft]* %3, i64 0, i64 %39
%41 = getelementptr inbounds %struct.ft, %struct.ft* %40, i32 0, i32 0
%42 = load i8*, i8** %41
%43 = call i64 @strlen(i8* %42)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %63
45: ; preds = %37
%46 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 0
%47 = load i32, i32* %5
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [19 x %struct.ft], [19 x %struct.ft]* %3, i64 0, i64 %48
%50 = getelementptr inbounds %struct.ft, %struct.ft* %49, i32 0, i32 0
%51 = load i8*, i8** %50
%52 = call i32 @strcmp(i8* %46, i8* %51)
%53 = icmp ne i32 %52, 0
br i1 %53, label %60, label %54
54: ; preds = %45
%55 = load i32, i32* %5
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [19 x %struct.ft], [19 x %struct.ft]* %3, i64 0, i64 %56
%58 = getelementptr inbounds %struct.ft, %struct.ft* %57, i32 0, i32 1
%59 = load i32, i32* %58
store i32 %59, i32* %6
br label %63
60: ; preds = %45
%61 = load i32, i32* %5
%62 = add nsw i32 %61, 1
store i32 %62, i32* %5
br label %37
63: ; preds = %54, %37
%64 = load i32, i32* %6
ret i32 %64
}

LLVM IR (-O2):
%struct.ft = type { i8*, i32 }
@.str = [5 x i8] c"TEXT\00"
@.str.1 = [6 x i8] c"SDATA\00"
@.str.2 = [7 x i8] c"DATA71\00"
@.str.3 = [6 x i8] c"BIN71\00"
@.str.4 = [6 x i8] c"LEX71\00"
@.str.5 = [6 x i8] c"KEY71\00"
@.str.6 = [8 x i8] c"BASIC71\00"
@.str.7 = [8 x i8] c"FORTH71\00"
@.str.8 = [7 x i8] c"WALL41\00"
@.str.9 = [6 x i8] c"KEY41\00"
@.str.10 = [7 x i8] c"STAT41\00"
@.str.11 = [6 x i8] c"ROM41\00"
@.str.12 = [7 x i8] c"PROG41\00"
@.str.13 = [7 x i8] c"TEXT75\00"
@.str.14 = [7 x i8] c"APPT75\00"
@.str.15 = [6 x i8] c"LEX75\00"
@.str.16 = [8 x i8] c"BASIC75\00"
@.str.17 = [6 x i8] c"ROM75\00"
@.str.18 = [1 x i8] zeroinitializer
@__const.get_filetype.filetype = [19 x %struct.ft] [%struct.ft { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i32 1 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i32 57552 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i32 57584 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i32 57860 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i32 57864 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i32 57868 }, %struct.ft { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i32 0, i32 0), i32 57876 }, %struct.ft { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i32 0, i32 0), i32 57880 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i32 0, i32 0), i32 57408 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i32 57424 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i32 0, i32 0), i32 57440 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i32 57456 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i32 0, i32 0), i32 57472 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i32 0, i32 0), i32 57426 }, %struct.ft { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i32 0, i32 0), i32 57427 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i32 57481 }, %struct.ft { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i32 0, i32 0), i32 57480 }, %struct.ft { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i32 0, i32 0), i32 57483 }, %struct.ft { i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i32 0 }]
define i32 @get_filetype(i8* nocapture %0) {
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%4 = load i8, i8* %0
%5 = icmp sgt i8 %4, 32
br i1 %5, label %6, label %60
6: ; preds = %1
%7 = tail call signext i8 @toupper(i8 signext %4)
store i8 %7, i8* %3
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp sgt i8 %9, 32
br i1 %10, label %11, label %60
11: ; preds = %6
%12 = tail call signext i8 @toupper(i8 signext %9)
%13 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 1
store i8 %12, i8* %13
%14 = getelementptr inbounds i8, i8* %0, i64 2
%15 = load i8, i8* %14
%16 = icmp sgt i8 %15, 32
br i1 %16, label %17, label %60
17: ; preds = %11
%18 = tail call signext i8 @toupper(i8 signext %15)
%19 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 2
store i8 %18, i8* %19
%20 = getelementptr inbounds i8, i8* %0, i64 3
%21 = load i8, i8* %20
%22 = icmp sgt i8 %21, 32
br i1 %22, label %23, label %60
23: ; preds = %17
%24 = tail call signext i8 @toupper(i8 signext %21)
%25 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 3
store i8 %24, i8* %25
%26 = getelementptr inbounds i8, i8* %0, i64 4
%27 = load i8, i8* %26
%28 = icmp sgt i8 %27, 32
br i1 %28, label %29, label %60
29: ; preds = %23
%30 = tail call signext i8 @toupper(i8 signext %27)
%31 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 4
store i8 %30, i8* %31
%32 = getelementptr inbounds i8, i8* %0, i64 5
%33 = load i8, i8* %32
%34 = icmp sgt i8 %33, 32
br i1 %34, label %35, label %60
35: ; preds = %29
%36 = tail call signext i8 @toupper(i8 signext %33)
%37 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 5
store i8 %36, i8* %37
%38 = getelementptr inbounds i8, i8* %0, i64 6
%39 = load i8, i8* %38
%40 = icmp sgt i8 %39, 32
br i1 %40, label %41, label %60
41: ; preds = %35
%42 = tail call signext i8 @toupper(i8 signext %39)
%43 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 6
store i8 %42, i8* %43
%44 = getelementptr inbounds i8, i8* %0, i64 7
%45 = load i8, i8* %44
%46 = icmp sgt i8 %45, 32
br i1 %46, label %47, label %60
47: ; preds = %41
%48 = tail call signext i8 @toupper(i8 signext %45)
%49 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 7
store i8 %48, i8* %49
%50 = getelementptr inbounds i8, i8* %0, i64 8
%51 = load i8, i8* %50
%52 = icmp sgt i8 %51, 32
br i1 %52, label %53, label %60
53: ; preds = %47
%54 = tail call signext i8 @toupper(i8 signext %51)
%55 = getelementptr inbounds i8, i8* %0, i64 9
%56 = load i8, i8* %55
%57 = icmp sgt i8 %56, 32
br i1 %57, label %58, label %60
58: ; preds = %53
%59 = tail call signext i8 @toupper(i8 signext %56)
br label %60
60: ; preds = %58, %53, %47, %41, %35, %29, %23, %17, %11, %6, %1
%61 = phi i64 [ 0, %1 ], [ 1, %6 ], [ 2, %11 ], [ 3, %17 ], [ 4, %23 ], [ 5, %29 ], [ 6, %35 ], [ 7, %41 ], [ 8, %47 ], [ 9, %53 ], [ 10, %58 ]
%62 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 %61
store i8 0, i8* %62
%63 = call i32 @bcmp(i8* dereferenceable(5) %3, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5)
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %69
65: ; preds = %117, %114, %111, %108, %105, %102, %99, %96, %93, %90, %87, %84, %81, %78, %75, %72, %69, %60
%66 = phi i64 [ 0, %60 ], [ 1, %69 ], [ 2, %72 ], [ 3, %75 ], [ 4, %78 ], [ 5, %81 ], [ 6, %84 ], [ 7, %87 ], [ 8, %90 ], [ 9, %93 ], [ 10, %96 ], [ 11, %99 ], [ 12, %102 ], [ 13, %105 ], [ 14, %108 ], [ 15, %111 ], [ 16, %114 ], [ 17, %117 ]
%67 = getelementptr inbounds [19 x %struct.ft], [19 x %struct.ft]* @__const.get_filetype.filetype, i64 0, i64 %66, i32 1
%68 = load i32, i32* %67
br label %120
69: ; preds = %60
%70 = call i32 @bcmp(i8* dereferenceable(6) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 6)
%71 = icmp eq i32 %70, 0
br i1 %71, label %65, label %72
72: ; preds = %69
%73 = call i32 @bcmp(i8* dereferenceable(7) %3, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i64 7)
%74 = icmp eq i32 %73, 0
br i1 %74, label %65, label %75
75: ; preds = %72
%76 = call i32 @bcmp(i8* dereferenceable(6) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64 6)
%77 = icmp eq i32 %76, 0
br i1 %77, label %65, label %78
78: ; preds = %75
%79 = call i32 @bcmp(i8* dereferenceable(6) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i64 6)
%80 = icmp eq i32 %79, 0
br i1 %80, label %65, label %81
81: ; preds = %78
%82 = call i32 @bcmp(i8* dereferenceable(6) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64 6)
%83 = icmp eq i32 %82, 0
br i1 %83, label %65, label %84
84: ; preds = %81
%85 = call i32 @bcmp(i8* dereferenceable(8) %3, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64 8)
%86 = icmp eq i32 %85, 0
br i1 %86, label %65, label %87
87: ; preds = %84
%88 = call i32 @bcmp(i8* dereferenceable(8) %3, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i64 8)
%89 = icmp eq i32 %88, 0
br i1 %89, label %65, label %90
90: ; preds = %87
%91 = call i32 @bcmp(i8* dereferenceable(7) %3, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i64 7)
%92 = icmp eq i32 %91, 0
br i1 %92, label %65, label %93
93: ; preds = %90
%94 = call i32 @bcmp(i8* dereferenceable(6) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i64 6)
%95 = icmp eq i32 %94, 0
br i1 %95, label %65, label %96
96: ; preds = %93
%97 = call i32 @bcmp(i8* dereferenceable(7) %3, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i64 7)
%98 = icmp eq i32 %97, 0
br i1 %98, label %65, label %99
99: ; preds = %96
%100 = call i32 @bcmp(i8* dereferenceable(6) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i64 6)
%101 = icmp eq i32 %100, 0
br i1 %101, label %65, label %102
102: ; preds = %99
%103 = call i32 @bcmp(i8* dereferenceable(7) %3, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i64 7)
%104 = icmp eq i32 %103, 0
br i1 %104, label %65, label %105
105: ; preds = %102
%106 = call i32 @bcmp(i8* dereferenceable(7) %3, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i64 7)
%107 = icmp eq i32 %106, 0
br i1 %107, label %65, label %108
108: ; preds = %105
%109 = call i32 @bcmp(i8* dereferenceable(7) %3, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i64 7)
%110 = icmp eq i32 %109, 0
br i1 %110, label %65, label %111
111: ; preds = %108
%112 = call i32 @bcmp(i8* dereferenceable(6) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i64 6)
%113 = icmp eq i32 %112, 0
br i1 %113, label %65, label %114
114: ; preds = %111
%115 = call i32 @bcmp(i8* dereferenceable(8) %3, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i64 8)
%116 = icmp eq i32 %115, 0
br i1 %116, label %65, label %117
117: ; preds = %114
%118 = call i32 @bcmp(i8* dereferenceable(6) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0), i64 6)
%119 = icmp eq i32 %118, 0
br i1 %119, label %65, label %120
120: ; preds = %117, %65
%121 = phi i32 [ %68, %65 ], [ -1, %117 ]
ret i32 %121
}