#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);
int main(int argc, char *argv[]) {
  char c;
  int i;
  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    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
mov    0x2e9e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     119e <main+0x7e>
movsbl -0x11(%rbp),%eax
cmp    $0x9,%eax
jne    1190 <main+0x70>
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    118b <main+0x6b>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1169 <main+0x49>
jmp    1199 <main+0x79>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %31, %2
%9 = call signext i8 (...) @getchar()
store i8 %9, i8* %6
%10 = sext i8 %9 to i32
%11 = load i8, i8* @EOF
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %10, %12
br i1 %13, label %14, label %32
14: ; preds = %8
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 9
br i1 %17, label %18, label %28
18: ; preds = %14
store i32 0, i32* %7
br label %19
19: ; preds = %24, %18
%20 = load i32, i32* %7
%21 = icmp slt i32 %20, 4
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = call i32 @putchar(i8 signext 32)
br label %24
24: ; preds = %22
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %19
27: ; preds = %19
br label %31
28: ; preds = %14
%29 = load i8, i8* %6
%30 = call i32 @putchar(i8 signext %29)
br label %31
31: ; preds = %28, %27
br label %8
32: ; preds = %8
ret i32 0
}

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