#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_header(FILE *fp, char type[]) {
  if (type == "assembly") {
    printf("Line\tOP\tL\tM");
  } else if (type == "exectrace") {
    printf("\t\t\t\t\tPC\tBP\tSP\t Stack");
    printf("Initial Values\t\t0\t1\t0");
  }
}


x86 assembly (clang, -O0):
<print_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rax
cmp    %rax,-0x10(%rbp)
jne    1142 <print_header+0x32>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <print_header+0x60>
lea    0xecc(%rip),%rax
cmp    %rax,-0x10(%rbp)
jne    116b <print_header+0x5b>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <print_header+0x60>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_header>:
lea    0xee9(%rip),%rax
cmp    %rax,%rsi
je     1129 <print_header+0x19>
lea    0xef2(%rip),%rax
cmp    %rax,%rsi
je     1135 <print_header+0x25>
ret
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
add    $0x8,%rsp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"assembly\00"
@.str.1 = [12 x i8] c"Line\09OP\09L\09M\00"
@.str.2 = [10 x i8] c"exectrace\00"
@.str.3 = [21 x i8] c"\09\09\09\09\09PC\09BP\09SP\09 Stack\00"
@.str.4 = [22 x i8] c"Initial Values\09\090\091\090\00"
define void @print_header(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %16
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0)
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %15
15: ; preds = %12, %9
br label %16
16: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"assembly\00"
@.str.1 = [12 x i8] c"Line\09OP\09L\09M\00"
@.str.2 = [10 x i8] c"exectrace\00"
@.str.3 = [21 x i8] c"\09\09\09\09\09PC\09BP\09SP\09 Stack\00"
@.str.4 = [22 x i8] c"Initial Values\09\090\091\090\00"
define void @print_header(i32* nocapture readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %1, getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp eq i8* %1, getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0)
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %2 ]
%10 = tail call i32 @printf(i8* dereferenceable(1) %9)
br label %11
11: ; preds = %8, %4
ret void
}