#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*/ strcpy(char *, char *);
void get_format_name(int output_format, char format_name[64]) {
  strcpy(format_name, " ");
  if (output_format == 2)
    strcpy(format_name, "ms");
  else if (output_format == 4)
    strcpy(format_name, "ds");
  else if (output_format == 3)
    strcpy(format_name, "pdb");
  else if (output_format == 7)
    strcpy(format_name, "sun");
  else if (output_format == 8)
    strcpy(format_name, "sgi");
  else if (output_format == 13)
    strcpy(format_name, "whatif");
  else if (output_format == 14)
    strcpy(format_name, "O");
  else if (output_format == 9)
    strcpy(format_name, "avsimage");
  else if (output_format == 10)
    strcpy(format_name, "avsfield");
  else if (output_format == 11)
    strcpy(format_name, "avsdensity");
  else if (output_format == 12)
    strcpy(format_name, "inventor");
  else if (output_format == 5)
    strcpy(format_name, "hpgl");
  else if (output_format == 6)
    strcpy(format_name, "ps");
  else if (output_format == 15)
    strcpy(format_name, "vet");
}


x86 assembly (clang, -O0):
<get_format_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcpy@plt>
cmpl   $0x2,-0x4(%rbp)
jne    114e <get_format_name+0x3e>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strcpy@plt>
jmp    131d <get_format_name+0x20d>
cmpl   $0x4,-0x4(%rbp)
jne    116d <get_format_name+0x5d>
mov    -0x10(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1318 <get_format_name+0x208>
cmpl   $0x3,-0x4(%rbp)
jne    118c <get_format_name+0x7c>
mov    -0x10(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1313 <get_format_name+0x203>
cmpl   $0x7,-0x4(%rbp)
jne    11ab <get_format_name+0x9b>
mov    -0x10(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130e <get_format_name+0x1fe>
cmpl   $0x8,-0x4(%rbp)
jne    11ca <get_format_name+0xba>
mov    -0x10(%rbp),%rdi
lea    0xe50(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1309 <get_format_name+0x1f9>
cmpl   $0xd,-0x4(%rbp)
jne    11e9 <get_format_name+0xd9>
mov    -0x10(%rbp),%rdi
lea    0xe35(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1304 <get_format_name+0x1f4>
cmpl   $0xe,-0x4(%rbp)
jne    1208 <get_format_name+0xf8>
mov    -0x10(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12ff <get_format_name+0x1ef>
cmpl   $0x9,-0x4(%rbp)
jne    1227 <get_format_name+0x117>
mov    -0x10(%rbp),%rdi
lea    0xe00(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fa <get_format_name+0x1ea>
cmpl   $0xa,-0x4(%rbp)
jne    1246 <get_format_name+0x136>
mov    -0x10(%rbp),%rdi
lea    0xdea(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12f5 <get_format_name+0x1e5>
cmpl   $0xb,-0x4(%rbp)
jne    1265 <get_format_name+0x155>
mov    -0x10(%rbp),%rdi
lea    0xdd4(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12f0 <get_format_name+0x1e0>
cmpl   $0xc,-0x4(%rbp)
jne    1284 <get_format_name+0x174>
mov    -0x10(%rbp),%rdi
lea    0xdc0(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12eb <get_format_name+0x1db>
cmpl   $0x5,-0x4(%rbp)
jne    12a3 <get_format_name+0x193>
mov    -0x10(%rbp),%rdi
lea    0xdaa(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12e6 <get_format_name+0x1d6>
cmpl   $0x6,-0x4(%rbp)
jne    12c2 <get_format_name+0x1b2>
mov    -0x10(%rbp),%rdi
lea    0xd90(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12e1 <get_format_name+0x1d1>
cmpl   $0xf,-0x4(%rbp)
jne    12dc <get_format_name+0x1cc>
mov    -0x10(%rbp),%rdi
lea    0xd74(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12e1 <get_format_name+0x1d1>
jmp    12e6 <get_format_name+0x1d6>
jmp    12eb <get_format_name+0x1db>
jmp    12f0 <get_format_name+0x1e0>
jmp    12f5 <get_format_name+0x1e5>
jmp    12fa <get_format_name+0x1ea>
jmp    12ff <get_format_name+0x1ef>
jmp    1304 <get_format_name+0x1f4>
jmp    1309 <get_format_name+0x1f9>
jmp    130e <get_format_name+0x1fe>
jmp    1313 <get_format_name+0x203>
jmp    1318 <get_format_name+0x208>
jmp    131d <get_format_name+0x20d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_format_name>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
add    $0xfffffffe,%ebp
cmp    $0xd,%ebp
ja     114e <get_format_name+0x3e>
movslq %ebp,%rax
lea    0xf17(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [3 x i8] c"ms\00"
@.str.2 = [3 x i8] c"ds\00"
@.str.3 = [4 x i8] c"pdb\00"
@.str.4 = [4 x i8] c"sun\00"
@.str.5 = [4 x i8] c"sgi\00"
@.str.6 = [7 x i8] c"whatif\00"
@.str.7 = [2 x i8] c"O\00"
@.str.8 = [9 x i8] c"avsimage\00"
@.str.9 = [9 x i8] c"avsfield\00"
@.str.10 = [11 x i8] c"avsdensity\00"
@.str.11 = [9 x i8] c"inventor\00"
@.str.12 = [5 x i8] c"hpgl\00"
@.str.13 = [3 x i8] c"ps\00"
@.str.14 = [4 x i8] c"vet\00"
define void @get_format_name(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %103
12: ; preds = %2
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 4
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %4
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %102
18: ; preds = %12
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 3
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i8*, i8** %4
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %101
24: ; preds = %18
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 7
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i8*, i8** %4
%29 = call i32 @strcpy(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %100
30: ; preds = %24
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 8
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i8*, i8** %4
%35 = call i32 @strcpy(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %99
36: ; preds = %30
%37 = load i32, i32* %3
%38 = icmp eq i32 %37, 13
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = load i8*, i8** %4
%41 = call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %98
42: ; preds = %36
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, 14
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = load i8*, i8** %4
%47 = call i32 @strcpy(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %97
48: ; preds = %42
%49 = load i32, i32* %3
%50 = icmp eq i32 %49, 9
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = load i8*, i8** %4
%53 = call i32 @strcpy(i8* %52, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %96
54: ; preds = %48
%55 = load i32, i32* %3
%56 = icmp eq i32 %55, 10
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = load i8*, i8** %4
%59 = call i32 @strcpy(i8* %58, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
br label %95
60: ; preds = %54
%61 = load i32, i32* %3
%62 = icmp eq i32 %61, 11
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = load i8*, i8** %4
%65 = call i32 @strcpy(i8* %64, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
br label %94
66: ; preds = %60
%67 = load i32, i32* %3
%68 = icmp eq i32 %67, 12
br i1 %68, label %69, label %72
69: ; preds = %66
%70 = load i8*, i8** %4
%71 = call i32 @strcpy(i8* %70, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
br label %93
72: ; preds = %66
%73 = load i32, i32* %3
%74 = icmp eq i32 %73, 5
br i1 %74, label %75, label %78
75: ; preds = %72
%76 = load i8*, i8** %4
%77 = call i32 @strcpy(i8* %76, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %92
78: ; preds = %72
%79 = load i32, i32* %3
%80 = icmp eq i32 %79, 6
br i1 %80, label %81, label %84
81: ; preds = %78
%82 = load i8*, i8** %4
%83 = call i32 @strcpy(i8* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %91
84: ; preds = %78
%85 = load i32, i32* %3
%86 = icmp eq i32 %85, 15
br i1 %86, label %87, label %90
87: ; preds = %84
%88 = load i8*, i8** %4
%89 = call i32 @strcpy(i8* %88, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
br label %90
90: ; preds = %87, %84
br label %91
91: ; preds = %90, %81
br label %92
92: ; preds = %91, %75
br label %93
93: ; preds = %92, %69
br label %94
94: ; preds = %93, %63
br label %95
95: ; preds = %94, %57
br label %96
96: ; preds = %95, %51
br label %97
97: ; preds = %96, %45
br label %98
98: ; preds = %97, %39
br label %99
99: ; preds = %98, %33
br label %100
100: ; preds = %99, %27
br label %101
101: ; preds = %100, %21
br label %102
102: ; preds = %101, %15
br label %103
103: ; preds = %102, %9
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [3 x i8] c"ms\00"
@.str.2 = [3 x i8] c"ds\00"
@.str.3 = [4 x i8] c"pdb\00"
@.str.4 = [4 x i8] c"sun\00"
@.str.5 = [4 x i8] c"sgi\00"
@.str.6 = [7 x i8] c"whatif\00"
@.str.7 = [2 x i8] c"O\00"
@.str.8 = [9 x i8] c"avsimage\00"
@.str.9 = [9 x i8] c"avsfield\00"
@.str.10 = [11 x i8] c"avsdensity\00"
@.str.11 = [9 x i8] c"inventor\00"
@.str.12 = [5 x i8] c"hpgl\00"
@.str.13 = [3 x i8] c"ps\00"
@.str.14 = [4 x i8] c"vet\00"
@reltable.get_format_name = [14 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.2 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.12 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.13 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.8 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.9 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.10 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.11 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.6 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.7 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.14 to i64), i64 ptrtoint ([14 x i32]* @reltable.get_format_name to i64)) to i32)]
define void @get_format_name(i32 %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = add i32 %0, -2
%5 = icmp ult i32 %4, 14
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = sext i32 %4 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([14 x i32]* @reltable.get_format_name to i8*), i64 %8)
%10 = tail call i32 @strcpy(i8* %1, i8* %9)
br label %11
11: ; preds = %2, %6
ret void
}