#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 */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
main() {
  int i;
  char c;
  while ((c = getchar()) != EOF) {
    if (c == '\t') {
      for (i = 0; i < 4; i++)
        putchar(' ');
    } else
      putchar(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1197 <main+0x77>
movsbl -0x9(%rbp),%eax
cmp    $0x9,%eax
jne    1189 <main+0x69>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1184 <main+0x64>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <main+0x42>
jmp    1192 <main+0x72>
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
jmp    114f <main+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
je     1179 <main+0x59>
cmp    $0x9,%al
jne    1140 <main+0x20>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%al
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
br label %4
4: ; preds = %27, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %28
10: ; preds = %4
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 9
br i1 %13, label %14, label %24
14: ; preds = %10
store i32 0, i32* %2
br label %15
15: ; preds = %20, %14
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 4
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = call i32 @putchar(i8 signext 32)
br label %20
20: ; preds = %18
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %15
23: ; preds = %15
br label %27
24: ; preds = %10
%25 = load i8, i8* %3
%26 = call i32 @putchar(i8 signext %25)
br label %27
27: ; preds = %24, %23
br label %4
28: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %17, label %4
4: ; preds = %0, %11
%5 = phi i8 [ %14, %11 ], [ %1, %0 ]
%6 = icmp eq i8 %5, 9
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @putchar(i8 signext 32)
%9 = tail call i32 @putchar(i8 signext 32)
%10 = tail call i32 @putchar(i8 signext 32)
br label %11
11: ; preds = %4, %7
%12 = phi i8 [ 32, %7 ], [ %5, %4 ]
%13 = tail call i32 @putchar(i8 signext %12)
%14 = tail call signext i8 (...) @getchar()
%15 = load i8, i8* @EOF
%16 = icmp eq i8 %14, %15
br i1 %16, label %17, label %4
17: ; preds = %11, %0
ret i32 0
}