#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*/ strcat(char *, char *);
void AddColumnType(char *sLine, int iType, char *sName) {
  strcat(sLine, " ");
  switch (iType) {
  case 0x00000001:
    strcat(sLine, " ");
    strcat(sLine, "int");
    break;
  case 0x00000002:
    strcat(sLine, " ");
    strcat(sLine, "dbl");
    break;
  case 0x00000003:
    strcat(sLine, " ");
    strcat(sLine, "str");
    break;
  }
  strcat(sLine, " ");
  strcat(sLine, sName);
}


x86 assembly (clang, -O0):
<AddColumnType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <strcat@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     1169 <AddColumnType+0x59>
jmp    1147 <AddColumnType+0x37>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     118e <AddColumnType+0x7e>
jmp    1158 <AddColumnType+0x48>
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
je     11b3 <AddColumnType+0xa3>
jmp    11d3 <AddColumnType+0xc3>
mov    -0x8(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1030 <strcat@plt>
jmp    11d3 <AddColumnType+0xc3>
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe5d(%rip),%rsi
call   1030 <strcat@plt>
jmp    11d3 <AddColumnType+0xc3>
mov    -0x8(%rbp),%rdi
lea    0xe42(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe22(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddColumnType>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xedd(%rip),%rsi
call   1030 <strcat@plt>
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     115b <AddColumnType+0x4b>
movslq %ebp,%rax
lea    0xed6(%rip),%rcx
movslq (%rcx,%rax,4),%rbp
add    %rcx,%rbp
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <strcat@plt>
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <strcat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [4 x i8] c"int\00"
@.str.2 = [4 x i8] c"dbl\00"
@.str.3 = [4 x i8] c"str\00"
define void @AddColumnType(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %5
switch i32 %9, label %25 [
i32 1, label %10
i32 2, label %15
i32 3, label %20
]
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %4
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %25
15: ; preds = %3
%16 = load i8*, i8** %4
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = load i8*, i8** %4
%19 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %25
20: ; preds = %3
%21 = load i8*, i8** %4
%22 = call i32 @strcat(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%23 = load i8*, i8** %4
%24 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %3, %20, %15, %10
%26 = load i8*, i8** %4
%27 = call i32 @strcat(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%28 = load i8*, i8** %4
%29 = load i8*, i8** %6
%30 = call i32 @strcat(i8* %28, i8* %29)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [4 x i8] c"int\00"
@.str.2 = [4 x i8] c"dbl\00"
@.str.3 = [4 x i8] c"str\00"
@reltable.AddColumnType = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.AddColumnType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.AddColumnType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.AddColumnType to i64)) to i32)]
define void @AddColumnType(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = add i32 %1, -1
%6 = icmp ult i32 %5, 3
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = sext i32 %5 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.AddColumnType to i8*), i64 %9)
%11 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @strcat(i8* %0, i8* %10)
br label %13
13: ; preds = %3, %7
%14 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @strcat(i8* %0, i8* %2)
ret void
}