#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 */
unsigned char getchar();
int /*<<< orphan*/ putchar(char);
int main(int argc, char const *argv[]) {
  unsigned char c;
  c = getchar();
  putchar(c);
  for (c = 0; c < 255; c++) {
    putchar(c);
    putchar('\t');
    if (!(c % 5)) {
      putchar('\n');
    }
  }
  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 -0x11(%rbp),%edi
call   1030 <putchar@plt>
movb   $0x0,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0xff,%eax
jge    11a0 <main+0x80>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movzbl -0x11(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118e <main+0x6e>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1193 <main+0x73>
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1148 <main+0x28>
nopw   0x0(%rax,%rax,1)
add    $0x1,%bl
cmp    $0xff,%bl
je     117c <main+0x5c>
movzbl %bl,%ebp
imul   $0xcd,%ebp,%eax
shr    $0xa,%eax
lea    (%rax,%rax,4),%r14d
movsbl %bpl,%edi
call   1030 <putchar@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
cmp    %bpl,%r14b
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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