#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 *);
scalar_t__ line(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int len;
  char s[1000];
  char t[1000 * 8];
  printf(
      "Note: for the sake of clarity, all tabs will be replaced with '-'.\n");
  while (line(s, 1000)) {
    detab(s, t);
    printf("%s", t);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2330,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <line@plt>
cmp    $0x0,%rax
je     1198 <main+0x68>
lea    -0x3f0(%rbp),%rdi
lea    -0x2330(%rbp),%rsi
call   1030 <detab@plt>
lea    -0x2330(%rbp),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1150 <main+0x20>
mov    -0x4(%rbp),%eax
add    $0x2330,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x2330,%rsp
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1060 <line@plt>
test   %rax,%rax
je     11aa <main+0x6a>
mov    %rsp,%r14
lea    0x3f0(%rsp),%rbx
lea    0xe84(%rip),%r15
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <detab@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    $0x3e8,%esi
call   1060 <line@plt>
test   %rax,%rax
jne    1180 <main+0x40>
xor    %eax,%eax
add    $0x2330,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [68 x i8] c"Note: for the sake of clarity, all tabs will be replaced with '-'.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
%4 = alloca [8000 x i8]
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %10, %0
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%8 = call i64 @line(i8* %7, i32 1000)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [8000 x i8], [8000 x i8]* %4, i64 0, i64 0
%13 = call i32 @detab(i8* %11, i8* %12)
%14 = getelementptr inbounds [8000 x i8], [8000 x i8]* %4, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %6
16: ; preds = %6
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [67 x i8] c"Note: for the sake of clarity, all tabs will be replaced with '-'.\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [8000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [8000 x i8], [8000 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%6 = call i64 @line(i8* %3, i32 1000)
%7 = icmp eq i64 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %0, %8
%9 = call i32 @detab(i8* %3, i8* %4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%11 = call i64 @line(i8* %3, i32 1000)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %0
ret i32 0
}