#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 fib(int);
int /*<<< orphan*/ serial_init();
int /*<<< orphan*/ serial_print_num(int);
int /*<<< orphan*/ serial_print_str(char *);
int /*<<< orphan*/ serial_putc(char);
void main() {
  int i, j;
  serial_init();
  for (j = 1; 1; j++) {
    serial_print_str("run#");
    serial_print_num(j);
    serial_putc(0x1b);
    serial_putc('E');
    for (i = 1; i <= 20; i++) {
      serial_print_str("f(");
      serial_print_num(i);
      serial_print_str(")=");
      serial_print_num(fib(i));
      serial_putc(0x1b);
      serial_putc('E');
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <serial_init@plt>
movl   $0x1,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1175 <main+0x25>
jmp    1212 <main+0xc2>
lea    0xe84(%rip),%rdi
call   1050 <serial_print_str@plt>
mov    -0x8(%rbp),%edi
call   1040 <serial_print_num@plt>
mov    $0x1b,%edi
call   1030 <serial_putc@plt>
mov    $0x45,%edi
call   1030 <serial_putc@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jg     11ff <main+0xaf>
lea    0xe50(%rip),%rdi
call   1050 <serial_print_str@plt>
mov    -0x4(%rbp),%edi
call   1040 <serial_print_num@plt>
lea    0xe3f(%rip),%rdi
call   1050 <serial_print_str@plt>
mov    -0x4(%rbp),%edi
call   1060 <fib@plt>
mov    %eax,%edi
call   1040 <serial_print_num@plt>
mov    $0x1b,%edi
call   1030 <serial_putc@plt>
mov    $0x45,%edi
call   1030 <serial_putc@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11a4 <main+0x54>
jmp    1204 <main+0xb4>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1070 <serial_init@plt>
mov    $0x1,%r15d
lea    0xe94(%rip),%r14
lea    0xe92(%rip),%r12
lea    0xe8e(%rip),%rbp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1050 <serial_print_str@plt>
mov    %r15d,%edi
call   1040 <serial_print_num@plt>
mov    $0x1b,%edi
call   1030 <serial_putc@plt>
mov    $0x45,%edi
call   1030 <serial_putc@plt>
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    %r12,%rdi
call   1050 <serial_print_str@plt>
mov    %ebx,%edi
call   1040 <serial_print_num@plt>
mov    %rbp,%rdi
call   1050 <serial_print_str@plt>
mov    %ebx,%edi
call   1060 <fib@plt>
mov    %eax,%edi
call   1040 <serial_print_num@plt>
mov    $0x1b,%edi
call   1030 <serial_putc@plt>
mov    $0x45,%edi
call   1030 <serial_putc@plt>
add    $0x1,%ebx
cmp    $0x15,%ebx
jne    11b0 <main+0x60>
add    $0x1,%r15d
jmp    1180 <main+0x30>

LLVM IR (-O0):
@.str = [5 x i8] c"run#\00"
@.str.1 = [3 x i8] c"f(\00"
@.str.2 = [3 x i8] c")=\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @serial_init()
store i32 1, i32* %2
br label %4
4: ; preds = %28, %0
br i1 true, label %5, label %31
5: ; preds = %4
%6 = call i32 @serial_print_str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = call i32 @serial_print_num(i32 %7)
%9 = call i32 @serial_putc(i8 signext 27)
%10 = call i32 @serial_putc(i8 signext 69)
store i32 1, i32* %1
br label %11
11: ; preds = %24, %5
%12 = load i32, i32* %1
%13 = icmp sle i32 %12, 20
br i1 %13, label %14, label %27
14: ; preds = %11
%15 = call i32 @serial_print_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* %1
%17 = call i32 @serial_print_num(i32 %16)
%18 = call i32 @serial_print_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = load i32, i32* %1
%20 = call i32 @fib(i32 %19)
%21 = call i32 @serial_print_num(i32 %20)
%22 = call i32 @serial_putc(i8 signext 27)
%23 = call i32 @serial_putc(i8 signext 69)
br label %24
24: ; preds = %14
%25 = load i32, i32* %1
%26 = add nsw i32 %25, 1
store i32 %26, i32* %1
br label %11
27: ; preds = %11
br label %28
28: ; preds = %27
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %4
31: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"run#\00"
@.str.1 = [3 x i8] c"f(\00"
@.str.2 = [3 x i8] c")=\00"
define void @main() {
%1 = tail call i32 (...) @serial_init()
br label %2
2: ; preds = %19, %0
%3 = phi i32 [ 1, %0 ], [ %20, %19 ]
%4 = tail call i32 @serial_print_str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @serial_print_num(i32 %3)
%6 = tail call i32 @serial_putc(i8 signext 27)
%7 = tail call i32 @serial_putc(i8 signext 69)
br label %8
8: ; preds = %2, %8
%9 = phi i32 [ 1, %2 ], [ %17, %8 ]
%10 = tail call i32 @serial_print_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @serial_print_num(i32 %9)
%12 = tail call i32 @serial_print_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @fib(i32 %9)
%14 = tail call i32 @serial_print_num(i32 %13)
%15 = tail call i32 @serial_putc(i8 signext 27)
%16 = tail call i32 @serial_putc(i8 signext 69)
%17 = add nuw nsw i32 %9, 1
%18 = icmp eq i32 %17, 21
br i1 %18, label %19, label %8
19: ; preds = %8
%20 = add nuw nsw i32 %3, 1
br label %2
}