#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 *, char *, char **);
int /*<<< orphan*/ entab(char *, char *, char **);
int my_getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int len;
  char line[1000];
  char line_detabbed[1000];
  char line_entabbed[1000];
  while ((len = my_getline(line, 1000)) > 0) {
    detab(line, line_detabbed, argv);
    entab(line_detabbed, line_entabbed, argv);
    printf("%s", line_entabbed);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xbe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x3e8,%esi
call   1060 <my_getline@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    11bc <main+0x7c>
lea    -0x400(%rbp),%rdi
lea    -0x7f0(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <detab@plt>
lea    -0x7f0(%rbp),%rdi
lea    -0xbe0(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <entab@plt>
lea    -0xbe0(%rbp),%rsi
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
jmp    1159 <main+0x19>
xor    %eax,%eax
add    $0xbe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xbd0,%rsp
mov    %rsi,%rbx
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1060 <my_getline@plt>
test   %eax,%eax
jle    11b8 <main+0x78>
mov    %rsp,%r14
lea    0x7e0(%rsp),%r15
lea    0x3f0(%rsp),%r12
lea    0xe82(%rip),%r13
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <detab@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <entab@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x3e8,%esi
call   1060 <my_getline@plt>
test   %eax,%eax
jg     1180 <main+0x40>
xor    %eax,%eax
add    $0xbd0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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