#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 */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, int *, int *, int *, int *, int *,
                          int *);
char *flightnum_character(char str6[]) {
  int bit[6];
  int id1, id2;
  const char *a[] = {" ", "A", "B", "C", "D", "E", "F", "G",
                     "H", "I", "J", "K", "L", "M", "N", "O"};
  const char *b[] = {"P", "Q", "R", "S", "T", "U", "V", "W",
                     "X", "Y", "Z", " ", " ", " ", " ", " "};
  const char *c[] = {"0", "1", "2", "3", "4", "5", "6", "7",
                     "8", "9", " ", " ", " ", " ", " ", " "};
  char *outc = malloc(2);
  sscanf(str6, "%1d%1d%1d%1d%1d%1d", &bit[0], &bit[1], &bit[2], &bit[3],
         &bit[4], &bit[5]);
  id1 = 1 * bit[1] + 2 * bit[0];
  id2 = 1 * bit[5] + 2 * bit[4] + 4 * bit[3] + 8 * bit[2];
  if (id1 == 0) {
    sprintf(outc, "%1s\0", a[id2]);
  } else if (id1 == 1) {
    sprintf(outc, "%1s\0", b[id2]);
  } else if (id1 == 2) {
    sprintf(outc, " \0");
  } else if (id1 == 3) {
    sprintf(outc, "%1s\0", c[id2]);
  }
  return outc;
}


x86 assembly (clang, -O0):
<flightnum_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0x2b43(%rip),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
lea    -0x130(%rbp),%rdi
lea    0x2bab(%rip),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
lea    -0x1b0(%rbp),%rdi
lea    0x2c13(%rip),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x1b8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    -0x20(%rbp),%rcx
add    $0x4,%rcx
lea    -0x20(%rbp),%r8
add    $0x8,%r8
lea    -0x20(%rbp),%r9
add    $0xc,%r9
lea    -0x20(%rbp),%r10
add    $0x10,%r10
lea    -0x20(%rbp),%rax
add    $0x14,%rax
lea    0xe6b(%rip),%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <sscanf@plt>
mov    -0x1c(%rbp),%eax
shl    $0x0,%eax
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x0,%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    124f <flightnum_character+0x10f>
mov    -0x1b8(%rbp),%rdi
movslq -0x28(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdx
ff
lea    0xe1a(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    12dd <flightnum_character+0x19d>
cmpl   $0x1,-0x24(%rbp)
jne    127f <flightnum_character+0x13f>
mov    -0x1b8(%rbp),%rdi
movslq -0x28(%rbp),%rax
mov    -0x130(%rbp,%rax,8),%rdx
ff
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    12d8 <flightnum_character+0x198>
cmpl   $0x2,-0x24(%rbp)
jne    12a3 <flightnum_character+0x163>
mov    -0x1b8(%rbp),%rdi
lea    0xdcb(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    12d3 <flightnum_character+0x193>
cmpl   $0x3,-0x24(%rbp)
jne    12ce <flightnum_character+0x18e>
mov    -0x1b8(%rbp),%rdi
movslq -0x28(%rbp),%rax
mov    -0x1b0(%rbp,%rax,8),%rdx
ff
lea    0xd96(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    12d3 <flightnum_character+0x193>
jmp    12d8 <flightnum_character+0x198>
jmp    12dd <flightnum_character+0x19d>
mov    -0x1b8(%rbp),%rax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flightnum_character>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,%r14
lea    0x4(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0xc(%rsp),%r9
lea    0x10(%rsp),%r10
lea    0x14(%rsp),%rax
lea    0xfb8(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
push   %rax
push   %r10
call   1040 <sscanf@plt>
add    $0x10,%rsp
mov    (%rsp),%eax
add    %eax,%eax
add    0x4(%rsp),%eax
cmp    $0x3,%eax
ja     11fd <flightnum_character+0xcd>
movslq 0x14(%rsp),%rcx
movslq 0x10(%rsp),%rdx
lea    (%rcx,%rdx,2),%rcx
movslq 0xc(%rsp),%rdx
lea    (%rcx,%rdx,4),%rcx
movslq 0x8(%rsp),%rdx
lea    (%rcx,%rdx,8),%rcx
lea    0xe52(%rip),%rdx
movslq (%rdx,%rax,4),%rax
add    %rdx,%rax
jmp    *%rax
lea    0xe52(%rip),%rax
movslq (%rax,%rcx,4),%rdx
add    %rax,%rdx
jmp    11ec <flightnum_character+0xbc>
movslq %ecx,%rax
lea    0xe7f(%rip),%rcx
jmp    11e5 <flightnum_character+0xb5>
movw   $0x20,(%r14)
jmp    11fd <flightnum_character+0xcd>
movslq %ecx,%rax
lea    0xeab(%rip),%rcx
movslq (%rcx,%rax,4),%rdx
add    %rcx,%rdx
lea    0xedd(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r14,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"A\00"
@.str.2 = [2 x i8] c"B\00"
@.str.3 = [2 x i8] c"C\00"
@.str.4 = [2 x i8] c"D\00"
@.str.5 = [2 x i8] c"E\00"
@.str.6 = [2 x i8] c"F\00"
@.str.7 = [2 x i8] c"G\00"
@.str.8 = [2 x i8] c"H\00"
@.str.9 = [2 x i8] c"I\00"
@.str.10 = [2 x i8] c"J\00"
@.str.11 = [2 x i8] c"K\00"
@.str.12 = [2 x i8] c"L\00"
@.str.13 = [2 x i8] c"M\00"
@.str.14 = [2 x i8] c"N\00"
@.str.15 = [2 x i8] c"O\00"
@__const.flightnum_character.a = [16 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i32 0, i32 0)]
@.str.16 = [2 x i8] c"P\00"
@.str.17 = [2 x i8] c"Q\00"
@.str.18 = [2 x i8] c"R\00"
@.str.19 = [2 x i8] c"S\00"
@.str.20 = [2 x i8] c"T\00"
@.str.21 = [2 x i8] c"U\00"
@.str.22 = [2 x i8] c"V\00"
@.str.23 = [2 x i8] c"W\00"
@.str.24 = [2 x i8] c"X\00"
@.str.25 = [2 x i8] c"Y\00"
@.str.26 = [2 x i8] c"Z\00"
@__const.flightnum_character.b = [16 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0)]
@.str.27 = [2 x i8] c"0\00"
@.str.28 = [2 x i8] c"1\00"
@.str.29 = [2 x i8] c"2\00"
@.str.30 = [2 x i8] c"3\00"
@.str.31 = [2 x i8] c"4\00"
@.str.32 = [2 x i8] c"5\00"
@.str.33 = [2 x i8] c"6\00"
@.str.34 = [2 x i8] c"7\00"
@.str.35 = [2 x i8] c"8\00"
@.str.36 = [2 x i8] c"9\00"
@__const.flightnum_character.c = [16 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.35, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.36, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0)]
@.str.37 = [19 x i8] c"%1d%1d%1d%1d%1d%1d\00"
@.str.38 = [5 x i8] c"%1s\00\00"
@.str.39 = [3 x i8] c" \00\00"
define i8* @flightnum_character(i8* %0) {
%2 = alloca i8*
%3 = alloca [6 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca [16 x i8*]
%7 = alloca [16 x i8*]
%8 = alloca [16 x i8*]
%9 = alloca i8*
store i8* %0, i8** %2
%10 = bitcast [16 x i8*]* %6 to i8*
%11 = bitcast [16 x i8*]* %7 to i8*
%12 = bitcast [16 x i8*]* %8 to i8*
%13 = call i8* @malloc(i32 2)
store i8* %13, i8** %9
%14 = load i8*, i8** %2
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 1
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 2
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 3
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 4
%20 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 5
%21 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.37, i64 0, i64 0), i32* %15, i32* %16, i32* %17, i32* %18, i32* %19, i32* %20)
%22 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 1
%23 = load i32, i32* %22
%24 = mul nsw i32 1, %23
%25 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%26 = load i32, i32* %25
%27 = mul nsw i32 2, %26
%28 = add nsw i32 %24, %27
store i32 %28, i32* %4
%29 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 5
%30 = load i32, i32* %29
%31 = mul nsw i32 1, %30
%32 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 4
%33 = load i32, i32* %32
%34 = mul nsw i32 2, %33
%35 = add nsw i32 %31, %34
%36 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 3
%37 = load i32, i32* %36
%38 = mul nsw i32 4, %37
%39 = add nsw i32 %35, %38
%40 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 2
%41 = load i32, i32* %40
%42 = mul nsw i32 8, %41
%43 = add nsw i32 %39, %42
store i32 %43, i32* %5
%44 = load i32, i32* %4
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %53
46: ; preds = %1
%47 = load i8*, i8** %9
%48 = load i32, i32* %5
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [16 x i8*], [16 x i8*]* %6, i64 0, i64 %49
%51 = load i8*, i8** %50
%52 = call i32 (i8*, i8*, ...) @sprintf(i8* %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.38, i64 0, i64 0), i8* %51)
br label %82
53: ; preds = %1
%54 = load i32, i32* %4
%55 = icmp eq i32 %54, 1
br i1 %55, label %56, label %63
56: ; preds = %53
%57 = load i8*, i8** %9
%58 = load i32, i32* %5
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [16 x i8*], [16 x i8*]* %7, i64 0, i64 %59
%61 = load i8*, i8** %60
%62 = call i32 (i8*, i8*, ...) @sprintf(i8* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.38, i64 0, i64 0), i8* %61)
br label %81
63: ; preds = %53
%64 = load i32, i32* %4
%65 = icmp eq i32 %64, 2
br i1 %65, label %66, label %69
66: ; preds = %63
%67 = load i8*, i8** %9
%68 = call i32 (i8*, i8*, ...) @sprintf(i8* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.39, i64 0, i64 0))
br label %80
69: ; preds = %63
%70 = load i32, i32* %4
%71 = icmp eq i32 %70, 3
br i1 %71, label %72, label %79
72: ; preds = %69
%73 = load i8*, i8** %9
%74 = load i32, i32* %5
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [16 x i8*], [16 x i8*]* %8, i64 0, i64 %75
%77 = load i8*, i8** %76
%78 = call i32 (i8*, i8*, ...) @sprintf(i8* %73, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.38, i64 0, i64 0), i8* %77)
br label %79
79: ; preds = %72, %69
br label %80
80: ; preds = %79, %66
br label %81
81: ; preds = %80, %56
br label %82
82: ; preds = %81, %46
%83 = load i8*, i8** %9
ret i8* %83
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"A\00"
@.str.2 = [2 x i8] c"B\00"
@.str.3 = [2 x i8] c"C\00"
@.str.4 = [2 x i8] c"D\00"
@.str.5 = [2 x i8] c"E\00"
@.str.6 = [2 x i8] c"F\00"
@.str.7 = [2 x i8] c"G\00"
@.str.8 = [2 x i8] c"H\00"
@.str.9 = [2 x i8] c"I\00"
@.str.10 = [2 x i8] c"J\00"
@.str.11 = [2 x i8] c"K\00"
@.str.12 = [2 x i8] c"L\00"
@.str.13 = [2 x i8] c"M\00"
@.str.14 = [2 x i8] c"N\00"
@.str.15 = [2 x i8] c"O\00"
@reltable.flightnum_character = [16 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.1 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.2 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.3 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.4 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.5 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.6 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.7 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.8 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.9 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.10 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.11 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.12 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.13 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.14 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.15 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character to i64)) to i32)]
@.str.16 = [2 x i8] c"P\00"
@.str.17 = [2 x i8] c"Q\00"
@.str.18 = [2 x i8] c"R\00"
@.str.19 = [2 x i8] c"S\00"
@.str.20 = [2 x i8] c"T\00"
@.str.21 = [2 x i8] c"U\00"
@.str.22 = [2 x i8] c"V\00"
@.str.23 = [2 x i8] c"W\00"
@.str.24 = [2 x i8] c"X\00"
@.str.25 = [2 x i8] c"Y\00"
@.str.26 = [2 x i8] c"Z\00"
@reltable.flightnum_character.40 = [16 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.16 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.17 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.18 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.19 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.20 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.21 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.22 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.23 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.24 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.25 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.26 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.40 to i64)) to i32)]
@.str.27 = [2 x i8] c"0\00"
@.str.28 = [2 x i8] c"1\00"
@.str.29 = [2 x i8] c"2\00"
@.str.30 = [2 x i8] c"3\00"
@.str.31 = [2 x i8] c"4\00"
@.str.32 = [2 x i8] c"5\00"
@.str.33 = [2 x i8] c"6\00"
@.str.34 = [2 x i8] c"7\00"
@.str.35 = [2 x i8] c"8\00"
@.str.36 = [2 x i8] c"9\00"
@reltable.flightnum_character.41 = [16 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.27 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.28 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.29 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.30 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.31 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.32 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.33 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.34 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.35 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.36 to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.flightnum_character.41 to i64)) to i32)]
@.str.37 = [19 x i8] c"%1d%1d%1d%1d%1d%1d\00"
@.str.38 = [5 x i8] c"%1s\00\00"
define noalias i8* @flightnum_character(i8* nocapture %0) {
%2 = alloca [6 x i32]
%3 = bitcast [6 x i32]* %2 to i8*
%4 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 1
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 2
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 3
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 4
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 5
%11 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.37, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10)
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = shl nsw i32 %13, 1
%15 = add nsw i32 %14, %12
%16 = load i32, i32* %10
%17 = load i32, i32* %9
%18 = shl nsw i32 %17, 1
%19 = add nsw i32 %18, %16
%20 = load i32, i32* %8
%21 = shl nsw i32 %20, 2
%22 = add nsw i32 %19, %21
%23 = load i32, i32* %7
%24 = shl nsw i32 %23, 3
%25 = add nsw i32 %22, %24
switch i32 %15, label %43 [
i32 0, label %26
i32 1, label %31
i32 2, label %36
i32 3, label %38
]
26: ; preds = %1
%27 = sext i32 %25 to i64
%28 = shl i64 %27, 2
%29 = call i8* @llvm.load.relative.i64(i8* bitcast ([16 x i32]* @reltable.flightnum_character to i8*), i64 %28)
%30 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.38, i64 0, i64 0), i8* %29)
br label %43
31: ; preds = %1
%32 = sext i32 %25 to i64
%33 = shl i64 %32, 2
%34 = call i8* @llvm.load.relative.i64(i8* bitcast ([16 x i32]* @reltable.flightnum_character.40 to i8*), i64 %33)
%35 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.38, i64 0, i64 0), i8* %34)
br label %43
36: ; preds = %1
%37 = bitcast i8* %4 to i16*
store i16 32, i16* %37
br label %43
38: ; preds = %1
%39 = sext i32 %25 to i64
%40 = shl i64 %39, 2
%41 = call i8* @llvm.load.relative.i64(i8* bitcast ([16 x i32]* @reltable.flightnum_character.41 to i8*), i64 %40)
%42 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.38, i64 0, i64 0), i8* %41)
br label %43
43: ; preds = %1, %31, %38, %36, %26
ret i8* %4
}