#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*/ exit(int);
int /*<<< orphan*/ line_error(char *, int);
char *maketabs(int t) {
  switch (t) {
  case 1:
    return "\t";
  case 2:
    return "\t\t";
  case 3:
    return "\t\t\t";
  case 4:
    return "\t\t\t\t";
  case 5:
    return "\t\t\t\t\t";
  }
  line_error("error, maketabs can't do %d tabs", t);
  exit(1);
}


x86 assembly (clang, -O0):
<maketabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     11a4 <maketabs+0x84>
mov    -0x18(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11bd <maketabs+0x9d>
lea    0xeac(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11bd <maketabs+0x9d>
lea    0xe9b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11bd <maketabs+0x9d>
lea    0xe8a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11bd <maketabs+0x9d>
lea    0xe79(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11bd <maketabs+0x9d>
mov    -0xc(%rbp),%esi
lea    0xe6c(%rip),%rdi
call   1030 <line_error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maketabs>:
push   %rax
mov    %edi,%esi
lea    -0x1(%rsi),%eax
cmp    $0x5,%eax
jae    113d <maketabs+0x1d>
cltq
lea    0xef4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
pop    %rcx
ret
lea    0xec2(%rip),%rdi
call   1030 <line_error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
@.str.1 = [3 x i8] c"\09\09\00"
@.str.2 = [4 x i8] c"\09\09\09\00"
@.str.3 = [5 x i8] c"\09\09\09\09\00"
@.str.4 = [6 x i8] c"\09\09\09\09\09\00"
@.str.5 = [33 x i8] c"error, maketabs can't do %d tabs\00"
define i8* @maketabs(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
]
5: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %14
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %14
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %14
8: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %14
9: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @line_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %9, %8, %7, %6, %5
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"\09\00"
@.str.1 = [3 x i8] c"\09\09\00"
@.str.2 = [4 x i8] c"\09\09\09\00"
@.str.3 = [5 x i8] c"\09\09\09\09\00"
@.str.4 = [6 x i8] c"\09\09\09\09\09\00"
@.str.5 = [33 x i8] c"error, maketabs can't do %d tabs\00"
@reltable.maketabs = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([5 x i32]* @reltable.maketabs to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.maketabs to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.maketabs to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.maketabs to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.maketabs to i64)) to i32)]
define i8* @maketabs(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 5
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @line_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = sext i32 %2 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.maketabs to i8*), i64 %9)
ret i8* %10
}