#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 BUFSIZ;
int /*<<< orphan*/ entab(char *, char *);
int getaline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int len;
  char line[BUFSIZ];
  char tabbed[BUFSIZ];
  while ((len = getaline(line, BUFSIZ)) != -1) {
    entab(tabbed, line);
    printf("%s", tabbed);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x30(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x18(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rdi
mov    0x2e4c(%rip),%rax
mov    (%rax),%esi
call   1030 <getaline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
je     11c9 <main+0x99>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1050 <entab@plt>
mov    -0x28(%rbp),%rsi
lea    0xe41(%rip),%rdi
call   1040 <printf@plt>
jmp    1189 <main+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    0x2e9e(%rip),%r12
mov    (%r12),%esi
mov    %rsp,%r14
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r14,%rdi
call   1030 <getaline@plt>
cmp    $0xffffffff,%eax
je     11a7 <main+0x77>
lea    0xe89(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <entab@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    (%r12),%esi
mov    %r14,%rdi
call   1030 <getaline@plt>
cmp    $0xffffffff,%eax
jne    1180 <main+0x50>
xor    %eax,%eax
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
%6 = load i32, i32* @BUFSIZ
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = load i32, i32* @BUFSIZ
%11 = zext i32 %10 to i64
%12 = alloca i8, i64 %11
store i64 %11, i64* %5
br label %13
13: ; preds = %17, %0
%14 = load i32, i32* @BUFSIZ
%15 = call i32 @getaline(i8* %9, i32 %14)
store i32 %15, i32* %2
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = call i32 @entab(i8* %12, i8* %9)
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %13
20: ; preds = %13
store i32 0, i32* %1
%21 = load i8*, i8** %3
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = load i32, i32* @BUFSIZ
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = alloca i8, i64 %2
%5 = call i32 @getaline(i8* %3, i32 %1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %13, label %7
7: ; preds = %0, %7
%8 = call i32 @entab(i8* %4, i8* %3)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = load i32, i32* @BUFSIZ
%11 = call i32 @getaline(i8* %3, i32 %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %7
13: ; preds = %7, %0
ret i32 0
}