#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ handler(char *);
int /*<<< orphan*/ init();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  char in[100];
  printf("----[Init]---\n");
  init();
  printf("----[REPL init]----\n");
  while (1) {
    printf(">");
    fgets(in, 100, stdin);
    handler(in);
    fflush(stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <init@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    0x2e53(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
lea    -0x70(%rbp),%rdi
call   1070 <handler@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
jmp    117e <main+0x2e>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xe90(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <init@plt>
lea    0xe8b(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e59(%rip),%r14
mov    %rsp,%rbx
mov    0x2e3f(%rip),%r15
nopl   0x0(%rax)
mov    $0x3e,%edi
call   1030 <putchar@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1080 <handler@plt>
mov    (%r15),%edi
call   1070 <fflush@plt>
jmp    11a0 <main+0x40>

LLVM IR (-O0):
@.str = [15 x i8] c"----[Init]---\0A\00"
@.str.1 = [21 x i8] c"----[REPL init]----\0A\00"
@.str.2 = [2 x i8] c">\00"
@stdin = global i32 0
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @init()
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %0, %6
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 100, i32 %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%12 = call i32 @handler(i8* %11)
%13 = load i32, i32* @stdout
%14 = call i32 @fflush(i32 %13)
br label %6
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
@str = [14 x i8] c"----[Init]---\00"
@str.3 = [20 x i8] c"----[REPL init]----\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @init()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0))
br label %6
6: ; preds = %6, %0
%7 = call i32 @putchar(i32 62)
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %2, i32 100, i32 %8)
%10 = call i32 @handler(i8* %2)
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
br label %6
}