#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 */
typedef int /*<<< orphan*/ inbuffer;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int strlen(char *);
int main() {
  char inbuffer[8192];
  int LastEvent = 0;
  while (fgets(inbuffer, sizeof(inbuffer), stdin)) {
    if (strlen(inbuffer) <= 1) {
      continue;
    }
    inbuffer[strlen(inbuffer) - 1] = '\0';
    if (inbuffer[0] == ' ') {
      LastEvent = 2;
      printf("	%s\n", inbuffer);
      fflush(stdout);
    } else {
      if (LastEvent == 1) {
        putc('\n', stdout);
        fflush(stdout);
      }
      printf("%s", inbuffer);
      LastEvent = 1;
    }
  }
  fflush(stdout);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2020,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x2014(%rbp)
lea    -0x2010(%rbp),%rdi
mov    0x2e6e(%rip),%rax
mov    (%rax),%edx
mov    $0x2000,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1253 <main+0x103>
lea    -0x2010(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jg     11aa <main+0x5a>
jmp    116c <main+0x1c>
lea    -0x2010(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x2010(%rbp,%rax,1)
movsbl -0x2010(%rbp),%eax
cmp    $0x20,%eax
jne    1203 <main+0xb3>
movl   $0x2,-0x2014(%rbp)
lea    -0x2010(%rbp),%rsi
lea    0xe15(%rip),%rdi
call   1040 <printf@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    124e <main+0xfe>
cmpl   $0x1,-0x2014(%rbp)
jne    1231 <main+0xe1>
mov    0x2dc1(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1060 <putc@plt>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
lea    -0x2010(%rbp),%rsi
lea    0xdc6(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x2014(%rbp)
jmp    116c <main+0x1c>
mov    0x2d7e(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
xor    %eax,%eax
add    $0x2020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2008,%rsp
xor    %ebp,%ebp
mov    0x2e7e(%rip),%r12
mov    %rsp,%rbx
mov    0x2e64(%rip),%r13
lea    0xe8a(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x2000,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     120c <main+0xbc>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     1180 <main+0x30>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
movzbl (%rsp),%r14d
cmp    $0x20,%r14b
jne    11d7 <main+0x87>
lea    0xe3c(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    0x0(%r13),%edi
call   1070 <fflush@plt>
jmp    11ff <main+0xaf>
test   $0x1,%bpl
je     11f4 <main+0xa4>
mov    0x0(%r13),%esi
mov    $0xa,%edi
call   1060 <putc@plt>
mov    0x0(%r13),%edi
call   1070 <fflush@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
cmp    $0x20,%r14b
setne  %bpl
jmp    1180 <main+0x30>
mov    0x0(%r13),%edi
call   1070 <fflush@plt>
xor    %eax,%eax
add    $0x2008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [5 x i8] c"\09%s\0A\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8192 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %40, %13, %0
%5 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i64 @fgets(i8* %5, i32 8192, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %41
9: ; preds = %4
%10 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
%12 = icmp sle i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %9
br label %4
14: ; preds = %9
%15 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 %18
store i8 0, i8* %19
%20 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 32
br i1 %23, label %24, label %29
24: ; preds = %14
store i32 2, i32* %3
%25 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %25)
%27 = load i32, i32* @stdout
%28 = call i32 @fflush(i32 %27)
br label %40
29: ; preds = %14
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = load i32, i32* @stdout
%34 = call i32 @putc(i8 signext 10, i32 %33)
%35 = load i32, i32* @stdout
%36 = call i32 @fflush(i32 %35)
br label %37
37: ; preds = %32, %29
%38 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%39 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %38)
store i32 1, i32* %3
br label %40
40: ; preds = %37, %24
br label %4
41: ; preds = %4
%42 = load i32, i32* @stdout
%43 = call i32 @fflush(i32 %42)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [5 x i8] c"\09%s\0A\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [8192 x i8]
%2 = getelementptr inbounds [8192 x i8], [8192 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %31, %0
%4 = phi i1 [ false, %0 ], [ %32, %31 ]
br label %5
5: ; preds = %3, %9
%6 = load i32, i32* @stdin
%7 = call i64 @fgets(i8* %2, i32 8192, i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %33, label %9
9: ; preds = %5
%10 = call i32 @strlen(i8* %2)
%11 = icmp slt i32 %10, 2
br i1 %11, label %5, label %12
12: ; preds = %9
%13 = call i32 @strlen(i8* %2)
%14 = add nsw i32 %13, -1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [8192 x i8], [8192 x i8]* %1, i64 0, i64 %15
store i8 0, i8* %16
%17 = load i8, i8* %2
%18 = icmp eq i8 %17, 32
br i1 %18, label %19, label %23
19: ; preds = %12
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%21 = load i32, i32* @stdout
%22 = call i32 @fflush(i32 %21)
br label %31
23: ; preds = %12
br i1 %4, label %24, label %29
24: ; preds = %23
%25 = load i32, i32* @stdout
%26 = call i32 @putc(i8 signext 10, i32 %25)
%27 = load i32, i32* @stdout
%28 = call i32 @fflush(i32 %27)
br label %29
29: ; preds = %24, %23
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %31
31: ; preds = %29, %19
%32 = xor i1 %18, true
br label %3
33: ; preds = %5
%34 = load i32, i32* @stdout
%35 = call i32 @fflush(i32 %34)
ret i32 0
}