#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*/ detab(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ readline(char *, int);
int main() {
  char line[1024];
  while ((readline(line, 1024)) > 0) {
    printf("Detabbing\n");
    detab(line);
    printf("%s", line);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1050 <readline@plt>
cmp    $0x0,%rax
jle    1191 <main+0x61>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <detab@plt>
lea    -0x410(%rbp),%rsi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1142 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1060 <readline@plt>
test   %rax,%rax
jle    119f <main+0x5f>
lea    0xe9e(%rip),%r14
mov    %rsp,%rbx
lea    0xe91(%rip),%r15
nop
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <detab@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
call   1060 <readline@plt>
test   %rax,%rax
jg     1170 <main+0x30>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Detabbing\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i64 @readline(i8* %4, i32 1024)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%10 = call i32 @detab(i8* %9)
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %3
13: ; preds = %3
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [10 x i8] c"Detabbing\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i64 @readline(i8* %2, i32 1024)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%7 = call i32 @detab(i8* %2)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%9 = call i64 @readline(i8* %2, i32 1024)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}