xunge/DecIR huggingface dataset:
/* Variables and functions */
int largest_prime();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", largest_prime()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <largest_prime@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <largest_prime@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 (...) @largest_prime()
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @largest_prime()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void init_call_single_data(void) {}


x86 assembly (clang, -O0):
<init_call_single_data>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_call_single_data>:
ret

LLVM IR (-O0):
define void @init_call_single_data() {
ret void
}

LLVM IR (-O2):
define void @init_call_single_data() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *xmalloc_fatal(size_t);
void *xcalloc(size_t nmemb, size_t size) {
  void *ptr = calloc(nmemb, size);
  if (ptr == NULL)
    return xmalloc_fatal(nmemb * size);
  return ptr;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1163 <xcalloc+0x43>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1040 <xmalloc_fatal@plt>
mov    %rax,-0x8(%rbp)
jmp    116b <xcalloc+0x4b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <calloc@plt>
test   %rax,%rax
je     113c <xcalloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
imul   %r14,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <xmalloc_fatal@plt>

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = call i8* @calloc(i64 %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = mul i64 %13, %14
%16 = call i8* @xmalloc_fatal(i64 %15)
store i8* %16, i8** %3
br label %19
17: ; preds = %2
%18 = load i8*, i8** %6
store i8* %18, i8** %3
br label %19
19: ; preds = %17, %12
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = mul i64 %1, %0
%7 = tail call i8* @xmalloc_fatal(i64 %6)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ %3, %2 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int chess_square_up(int square) {
  assert(square >= 0 && square <= 63);
  if (square < 55)
    return square + 8;
  return -1;
}


x86 assembly (clang, -O0):
<chess_square_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1134 <chess_square_up+0x24>
cmpl   $0x3f,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x37,-0x8(%rbp)
jge    1159 <chess_square_up+0x49>
mov    -0x8(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <chess_square_up+0x50>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chess_square_up>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40,%ebx
setb   %dil
call   1030 <assert@plt>
lea    0x8(%rbx),%ecx
cmp    $0x37,%ebx
mov    $0xffffffff,%eax
cmovl  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @chess_square_up(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 63
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 55
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 8
store i32 %17, i32* %2
br label %19
18: ; preds = %9
store i32 -1, i32* %2
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @chess_square_up(i32 %0) {
%2 = icmp ult i32 %0, 64
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp slt i32 %0, 55
%6 = add nsw i32 %0, 8
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  long long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ err(int, char *);
long long now(void) {
  struct timespec ts;
  if (clock_gettime(CLOCK_MONOTONIC, &ts))
    err(3, "clock_gettime failed");
  return ts.tv_sec * 1000000000ll + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
je     1155 <now+0x35>
mov    $0x3,%edi
lea    0xeb0(%rip),%rsi
call   1040 <err@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
test   %rax,%rax
je     114d <now+0x2d>
lea    0xebd(%rip),%rsi
mov    $0x3,%edi
call   1040 <err@plt>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
@.str = [21 x i8] c"clock_gettime failed\00"
define i64 @now() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i64 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @err(i32 3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = mul nsw i64 %9, 1000000000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%12 = load i64, i64* %11
%13 = add nsw i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
@.str = [21 x i8] c"clock_gettime failed\00"
define i64 @now() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @err(i32 3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = mul nsw i64 %10, 1000000000
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%13 = load i64, i64* %12
%14 = add nsw i64 %11, %13
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x5c() {
  Assert_real((isgraph(92)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              465, ("isgraph should be 1 for 0x5c"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x5c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5c,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1d1,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x5c>:
push   %rax
mov    $0x5c,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1d1,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 1 for 0x5c\00"
define void @t_isgraph_0x5c() {
%1 = call i32 @isgraph(i32 92)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 465, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 1 for 0x5c\00"
define void @t_isgraph_0x5c() {
%1 = tail call i32 @isgraph(i32 92)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 465, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ imprimirMaxMinLeituras(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  if (imprimirMaxMinLeituras("leituras.txt") == 0) {
    printf("Erro ao executar funcao.\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <imprimirMaxMinLeituras@plt>
cmp    $0x0,%rax
jne    115d <main+0x3d>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1164 <main+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <imprimirMaxMinLeituras@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1139 <main+0x19>
pop    %rcx
ret
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"leituras.txt\00"
@.str.1 = [26 x i8] c"Erro ao executar funcao.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @imprimirMaxMinLeituras(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [13 x i8] c"leituras.txt\00"
@str = [25 x i8] c"Erro ao executar funcao.\00"
define i32 @main() {
%1 = tail call i64 @imprimirMaxMinLeituras(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __ExitInner(int /*<<< orphan*/, int /*<<< orphan*/, int);
void _Exit(int status) { __ExitInner(0, 0, status); }


x86 assembly (clang, -O0):
<_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <__ExitInner@plt>

x86 assembly (clang, -O2):
<_Exit>:
push   %rax
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <__ExitInner@plt>

LLVM IR (-O0):
define void @_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__ExitInner(i32 0, i32 0, i32 %3)
unreachable
}

LLVM IR (-O2):
define void @_Exit(i32 %0) {
%2 = tail call i32 @__ExitInner(i32 0, i32 0, i32 %0)
unreachable
}
void f4(const char *fmt, ...) {
  __builtin_va_list args;
  __builtin___vsnprintf_chk(0, 42, 0, 11, fmt, args);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r8
xor    %edx,%edx
mov    %edx,%edi
mov    $0x2a,%esi
mov    $0xb,%ecx
lea    -0x20(%rbp),%r9
call   1030 <__vsnprintf_chk@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
sub    $0x18,%rsp
mov    %rdi,%r8
mov    %rsp,%r9
mov    $0x2a,%esi
mov    $0xb,%ecx
xor    %edi,%edi
xor    %edx,%edx
call   1030 <__vsnprintf_chk@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @f4(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca [1 x %struct.__va_list_tag]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%6 = call i32 @__vsnprintf_chk(i8* null, i64 42, i32 0, i64 11, i8* %4, %struct.__va_list_tag* %5)
ret void
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @f4(i8* %0, ...) {
%2 = alloca [1 x %struct.__va_list_tag]
%3 = bitcast [1 x %struct.__va_list_tag]* %2 to i8*
%4 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %2, i64 0, i64 0
%5 = call i32 @__vsnprintf_chk(i8* null, i64 42, i32 0, i64 11, i8* %0, %struct.__va_list_tag* %4)
ret void
}
void drm_debugfs_crtc_remove(struct drm_crtc *crtc) {}


x86 assembly (clang, -O0):
<drm_debugfs_crtc_remove>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<drm_debugfs_crtc_remove>:
ret

LLVM IR (-O0):
%struct.drm_crtc = type opaque
define void @drm_debugfs_crtc_remove(%struct.drm_crtc* %0) {
%2 = alloca %struct.drm_crtc*
store %struct.drm_crtc* %0, %struct.drm_crtc** %2
ret void
}

LLVM IR (-O2):
%struct.drm_crtc = type opaque
define void @drm_debugfs_crtc_remove(%struct.drm_crtc* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void leseSchreibFehlerMelden(char dateiName[]) {
  printf("\n\n\n  Fehler beim Arbeiten mit der Datei: %s\n\n", dateiName);
}


x86 assembly (clang, -O0):
<leseSchreibFehlerMelden>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leseSchreibFehlerMelden>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"\0A\0A\0A Fehler beim Arbeiten mit der Datei: %s\0A\0A\00"
define void @leseSchreibFehlerMelden(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"\0A\0A\0A Fehler beim Arbeiten mit der Datei: %s\0A\0A\00"
define void @leseSchreibFehlerMelden(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct plainstring *);
int /*<<< orphan*/ plainstring_deinit(struct plainstring *);
void plainstring_delete(struct plainstring *this_string) {
  plainstring_deinit(this_string);
  free(this_string);
}


x86 assembly (clang, -O0):
<plainstring_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <plainstring_deinit@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <plainstring_deinit@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define void @plainstring_delete(%struct.plainstring* %0) {
%2 = alloca %struct.plainstring*
store %struct.plainstring* %0, %struct.plainstring** %2
%3 = load %struct.plainstring*, %struct.plainstring** %2
%4 = call i32 @plainstring_deinit(%struct.plainstring* %3)
%5 = load %struct.plainstring*, %struct.plainstring** %2
%6 = call i32 @free(%struct.plainstring* %5)
ret void
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define void @plainstring_delete(%struct.plainstring* %0) {
%2 = tail call i32 @plainstring_deinit(%struct.plainstring* %0)
%3 = tail call i32 @free(%struct.plainstring* %0)
ret void
}
int FlAcpiConfigureFloppy(int DisketteExtension, int FdcInfo) {
  { return (0); }
}


x86 assembly (clang, -O0):
<FlAcpiConfigureFloppy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlAcpiConfigureFloppy>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @FlAcpiConfigureFloppy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @FlAcpiConfigureFloppy(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int HECMW_partlex();
int HECMW_partlex_next_token_skip(int skip_token) {
  int token;
  while ((token = HECMW_partlex())) {
    if (token != skip_token)
      break;
  }
  return token;
}


x86 assembly (clang, -O0):
<HECMW_partlex_next_token_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <HECMW_partlex@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1144 <HECMW_partlex_next_token_skip+0x34>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     113f <HECMW_partlex_next_token_skip+0x2f>
jmp    1144 <HECMW_partlex_next_token_skip+0x34>
jmp    111b <HECMW_partlex_next_token_skip+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HECMW_partlex_next_token_skip>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <HECMW_partlex@plt>
test   %eax,%eax
je     112f <HECMW_partlex_next_token_skip+0x1f>
cmp    %ebx,%eax
je     1120 <HECMW_partlex_next_token_skip+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @HECMW_partlex_next_token_skip(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %12, %1
%5 = call i32 (...) @HECMW_partlex()
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %13
12: ; preds = %7
br label %4
13: ; preds = %11, %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @HECMW_partlex_next_token_skip(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @HECMW_partlex()
%4 = icmp ne i32 %3, 0
%5 = icmp eq i32 %3, %0
%6 = and i1 %4, %5
br i1 %6, label %2, label %7
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *);
void vpl_wr_init(const char *fname) {
  fatal("Writing file of type %s is not support\n", "vpl");
}


x86 assembly (clang, -O0):
<vpl_wr_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xefe(%rip),%rsi
call   1030 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpl_wr_init>:
lea    0xee9(%rip),%rdi
lea    0xf0a(%rip),%rsi
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Writing file of type %s is not support\0A\00"
@.str.1 = [4 x i8] c"vpl\00"
define void @vpl_wr_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Writing file of type %s is not support\0A\00"
@.str.1 = [4 x i8] c"vpl\00"
define void @vpl_wr_init(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double FMIN(const double a, const double b) { return ((a < b) ? a : b); }


x86 assembly (clang, -O0):
<FMIN>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <FMIN+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <FMIN+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FMIN>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @FMIN(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @FMIN(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double xgettimeofday(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + (double)tv.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<xgettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xgettimeofday>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
divsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @xgettimeofday() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %4, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @xgettimeofday() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}
void delay(void) {
  volatile unsigned int i, j;
  for (i = 0; i < 1000; i++) {
    for (j = 0; j < 300; j++)
      __asm__("nop");
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x3e8,%eax
jae    1150 <delay+0x50>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x12c,%eax
jae    113d <delay+0x3d>
nop
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1120 <delay+0x20>
jmp    1142 <delay+0x42>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <delay+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x3e7,%eax
jbe    1130 <delay+0x30>
ret
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x3e8,%eax
jae    1113 <delay+0x13>
movl   $0x0,-0x8(%rsp)
mov    -0x8(%rsp),%eax
cmp    $0x12b,%eax
ja     1120 <delay+0x20>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
nop
addl   $0x1,-0x8(%rsp)
mov    -0x8(%rsp),%eax
cmp    $0x12c,%eax
jb     1150 <delay+0x50>
jmp    1120 <delay+0x20>

LLVM IR (-O0):
define void @delay() {
%1 = alloca i32
%2 = alloca i32
store volatile i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = load volatile i32, i32* %1
%5 = icmp ult i32 %4, 1000
br i1 %5, label %6, label %18
6: ; preds = %3
store volatile i32 0, i32* %2
br label %7
7: ; preds = %11, %6
%8 = load volatile i32, i32* %2
%9 = icmp ult i32 %8, 300
br i1 %9, label %10, label %14
10: ; preds = %7
br label %11
11: ; preds = %10
%12 = load volatile i32, i32* %2
%13 = add i32 %12, 1
store volatile i32 %13, i32* %2
br label %7
14: ; preds = %7
br label %15
15: ; preds = %14
%16 = load volatile i32, i32* %1
%17 = add i32 %16, 1
store volatile i32 %17, i32* %1
br label %3
18: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %1
%5 = load volatile i32, i32* %1
%6 = icmp ult i32 %5, 1000
br i1 %6, label %7, label %20
7: ; preds = %0, %15
store volatile i32 0, i32* %2
%8 = load volatile i32, i32* %2
%9 = icmp ult i32 %8, 300
br i1 %9, label %10, label %15
10: ; preds = %7, %10
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%11 = load volatile i32, i32* %2
%12 = add i32 %11, 1
store volatile i32 %12, i32* %2
%13 = load volatile i32, i32* %2
%14 = icmp ult i32 %13, 300
br i1 %14, label %10, label %15
15: ; preds = %10, %7
%16 = load volatile i32, i32* %1
%17 = add i32 %16, 1
store volatile i32 %17, i32* %1
%18 = load volatile i32, i32* %1
%19 = icmp ult i32 %18, 1000
br i1 %19, label %7, label %20
20: ; preds = %15, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main_cleanup();
int main_unix(int, char **);
int /*<<< orphan*/ str_init();
int main(int argc, char *argv[]) {
  int retval;
  str_init();
  retval = main_unix(argc, argv);
  main_cleanup();
  return retval;
}


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   1050 <str_init@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <main_unix@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <main_cleanup@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <str_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <main_unix@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <main_cleanup@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @str_init()
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @main_unix(i32 %8, i8** %9)
store i32 %10, i32* %6
%11 = call i32 (...) @main_cleanup()
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @str_init()
%4 = tail call i32 @main_unix(i32 %0, i8** %1)
%5 = tail call i32 (...) @main_cleanup()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fib(int n) {
  int next = 0;
  int previous = 0;
  int current = 1;
  int i;
  for (i = 1; i <= n; i++) {
    printf("%d ", previous);
    next = current + previous;
    previous = current;
    current = next;
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1175 <fib+0x65>
mov    -0xc(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <fib+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    114a <fib+0x3a>
mov    %edi,%ebx
xor    %ebp,%ebp
mov    $0x1,%eax
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %eax,%r15d
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    %r15d,%ebp
mov    %ebp,%eax
mov    %r15d,%ebp
add    $0xffffffff,%ebx
jne    1130 <fib+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 1, i32* %5
store i32 1, i32* %6
br label %7
7: ; preds = %19, %1
%8 = load i32, i32* %6
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
store i32 %16, i32* %3
%17 = load i32, i32* %5
store i32 %17, i32* %4
%18 = load i32, i32* %3
store i32 %18, i32* %5
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @fib(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 1, %1 ]
%5 = phi i32 [ %8, %3 ], [ 1, %1 ]
%6 = phi i32 [ %5, %3 ], [ 0, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nsw i32 %5, %6
%9 = add nuw i32 %4, 1
%10 = icmp eq i32 %4, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
ret void
}
void consoleSetColor(int color) {}


x86 assembly (clang, -O0):
<consoleSetColor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<consoleSetColor>:
ret

LLVM IR (-O0):
define void @consoleSetColor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @consoleSetColor(i32 %0) {
ret void
}
double my_min(double a, double b, double c) {
  if (a <= b && a <= c)
    return a;
  if (b <= a && b <= c)
    return b;
  return c;
}


x86 assembly (clang, -O0):
<my_min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     114a <my_min+0x4a>
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     114a <my_min+0x4a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118b <my_min+0x8b>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1181 <my_min+0x81>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1181 <my_min+0x81>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118b <my_min+0x8b>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_min>:
movapd %xmm1,%xmm4
cmpnlesd %xmm2,%xmm4
movapd %xmm4,%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm1,%xmm4
orpd   %xmm3,%xmm4
movapd %xmm0,%xmm3
cmpnlesd %xmm1,%xmm3
cmpnlesd %xmm0,%xmm1
movapd %xmm1,%xmm5
andnpd %xmm4,%xmm5
andpd  %xmm2,%xmm1
orpd   %xmm5,%xmm1
movapd %xmm3,%xmm4
andpd  %xmm1,%xmm4
movapd %xmm0,%xmm5
cmpnlesd %xmm2,%xmm5
andpd  %xmm5,%xmm1
andnpd %xmm0,%xmm5
orpd   %xmm1,%xmm5
andnpd %xmm5,%xmm3
orpd   %xmm4,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @my_min(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp ole double %8, %9
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load double, double* %5
%13 = load double, double* %7
%14 = fcmp ole double %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load double, double* %5
store double %16, double* %4
br label %29
17: ; preds = %11, %3
%18 = load double, double* %6
%19 = load double, double* %5
%20 = fcmp ole double %18, %19
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load double, double* %6
%23 = load double, double* %7
%24 = fcmp ole double %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load double, double* %6
store double %26, double* %4
br label %29
27: ; preds = %21, %17
%28 = load double, double* %7
store double %28, double* %4
br label %29
29: ; preds = %27, %25, %15
%30 = load double, double* %4
ret double %30
}

LLVM IR (-O2):
define double @my_min(double %0, double %1, double %2) {
%4 = fcmp ugt double %0, %1
%5 = fcmp ugt double %0, %2
%6 = or i1 %4, %5
%7 = fcmp ugt double %1, %0
%8 = fcmp ugt double %1, %2
%9 = or i1 %7, %8
%10 = select i1 %9, double %2, double %1
%11 = select i1 %6, double %10, double %0
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  while (1) {
    printf("hello eyu\n");
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [11 x i8] c"hello eyu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@str = [10 x i8] c"hello eyu\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
br label %1
}
/* Type definitions */
struct track_info {
  int dummy;
};

/* Variables and functions */
int is_filtered(struct track_info *);
int is_filtered_cb(void *data, struct track_info *ti) {
  return is_filtered(ti);
}


x86 assembly (clang, -O0):
<is_filtered_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_filtered@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_filtered_cb>:
mov    %rsi,%rdi
jmp    1030 <is_filtered@plt>

LLVM IR (-O0):
%struct.track_info = type { i32 }
define i32 @is_filtered_cb(i8* %0, %struct.track_info* %1) {
%3 = alloca i8*
%4 = alloca %struct.track_info*
store i8* %0, i8** %3
store %struct.track_info* %1, %struct.track_info** %4
%5 = load %struct.track_info*, %struct.track_info** %4
%6 = call i32 @is_filtered(%struct.track_info* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.track_info = type { i32 }
define i32 @is_filtered_cb(i8* nocapture readnone %0, %struct.track_info* %1) {
%3 = tail call i32 @is_filtered(%struct.track_info* %1)
ret i32 %3
}
void search_stats(void) {}


x86 assembly (clang, -O0):
<search_stats>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_stats>:
ret

LLVM IR (-O0):
define void @search_stats() {
ret void
}

LLVM IR (-O2):
define void @search_stats() {
ret void
}
extern __attribute__((gnu_)) int carmen_imax(int val1, int val2) {
  if (val2 > val1)
    return val2;
  return val1;
}


x86 assembly (clang, -O0):
<carmen_imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <carmen_imax+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <carmen_imax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_imax>:
mov    %edi,%eax
cmp    %edi,%esi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @carmen_imax(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %5
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @carmen_imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XResizeRequestEvent;

/* Variables and functions */
void set_XResizeRequestEvent_serial(void *_p, unsigned long _v) {
  ((XResizeRequestEvent *)_p)->serial = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XResizeRequestEvent_serial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XResizeRequestEvent_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XResizeRequestEvent_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XResizeRequestEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_exit(int);
void int_trap() { err_exit(11); }


x86 assembly (clang, -O0):
<int_trap>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%edi
call   1030 <err_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_trap>:
mov    $0xb,%edi
jmp    1030 <err_exit@plt>

LLVM IR (-O0):
define void @int_trap() {
%1 = call i32 @err_exit(i32 11)
ret void
}

LLVM IR (-O2):
define void @int_trap() {
%1 = tail call i32 @err_exit(i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("나의 이름은 홍길동입니다.\n나의 나이는 13살입니다.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [70 x i8] c"\EB\82\98\EC\9D\98 \EC\9D\B4\EB\A6\84\EC\9D\80 \ED\99\8D\EA\B8\B8\EB\8F\99\EC\9E\85\EB\8B\88\EB\8B\A4.\0A\EB\82\98\EC\9D\98 \EB\82\98\EC\9D\B4\EB\8A\94 13\EC\82\B4\EC\9E\85\EB\8B\88\EB\8B\A4.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [70 x i8] c"\EB\82\98\EC\9D\98 \EC\9D\B4\EB\A6\84\EC\9D\80 \ED\99\8D\EA\B8\B8\EB\8F\99\EC\9E\85\EB\8B\88\EB\8B\A4.\0A\EB\82\98\EC\9D\98 \EB\82\98\EC\9D\B4\EB\8A\94 13\EC\82\B4\EC\9E\85\EB\8B\88\EB\8B\A4.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Reserved170_DriverIRQHandler();
__attribute__((weak)) void Reserved170_IRQHandler(void) {
  Reserved170_DriverIRQHandler();
}


x86 assembly (clang, -O0):
<Reserved170_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Reserved170_DriverIRQHandler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reserved170_IRQHandler>:
xor    %eax,%eax
jmp    1030 <Reserved170_DriverIRQHandler@plt>

LLVM IR (-O0):
define weak void @Reserved170_IRQHandler() {
%1 = call i32 (...) @Reserved170_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved170_IRQHandler() {
%1 = tail call i32 (...) @Reserved170_DriverIRQHandler()
ret void
}
void getpath(unsigned char path, unsigned char *destination, int length) {
  static const unsigned char paths[44] = {
      0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x10, 0x20, 0x30,
      0x40, 0x50, 0x60, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
      0x67, 0x57, 0x47, 0x37, 0x27, 0x17, 0x04, 0x03, 0x12, 0x21, 0x30,
      0x40, 0x51, 0x62, 0x73, 0x74, 0x65, 0x56, 0x47, 0x37, 0x26, 0x15};
  int offset = path ? 28 : 0;
  int i;
  for (i = 0; i < length; i++)
    destination[i] = paths[i + offset];
}


x86 assembly (clang, -O0):
<getpath>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movzbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1c,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1164 <getpath+0x64>
mov    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
movslq %eax,%rcx
lea    0xeb8(%rip),%rax
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112c <getpath+0x2c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpath>:
test   %edx,%edx
jle    113b <getpath+0x2b>
push   %rax
test   %dil,%dil
lea    0xee1(%rip),%rcx
lea    0xef6(%rip),%rax
cmove  %rcx,%rax
mov    %edx,%edx
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <memcpy@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
@getpath.paths = internal constant [44 x i8] c"\07\06\05\04\03\02\01\00\10 0@P`pqrstuvwgWG7'\17\04\03\12!0@QbsteVG7&\15"
define void @getpath(i8 zeroext %0, i8* %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 28, i32 0
store i32 %13, i32* %7
store i32 0, i32* %8
br label %14
14: ; preds = %29, %3
%15 = load i32, i32* %8
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %32
18: ; preds = %14
%19 = load i32, i32* %8
%20 = load i32, i32* %7
%21 = add nsw i32 %19, %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [44 x i8], [44 x i8]* @getpath.paths, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = load i8*, i8** %5
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
store i8 %24, i8* %28
br label %29
29: ; preds = %18
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %14
32: ; preds = %14
ret void
}

LLVM IR (-O2):
@getpath.paths = internal unnamed_addr constant [44 x i8] c"\07\06\05\04\03\02\01\00\10 0@P`pqrstuvwgWG7'\17\04\03\12!0@QbsteVG7&\15"
define void @getpath(i8 zeroext %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = icmp eq i8 %0, 0
%7 = select i1 %6, i64 0, i64 28
%8 = getelementptr [44 x i8], [44 x i8]* @getpath.paths, i64 0, i64 %7
%9 = zext i32 %2 to i64
br label %10
10: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Amstrad_PPI_Refresh();
int /*<<< orphan*/ ppi_write_port(int, int);
void PPI_WritePortC(int Data) {
  ppi_write_port(2, Data);
  Amstrad_PPI_Refresh();
}


x86 assembly (clang, -O0):
<PPI_WritePortC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <ppi_write_port@plt>
mov    $0x0,%al
call   1040 <Amstrad_PPI_Refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PPI_WritePortC>:
push   %rax
mov    %edi,%esi
mov    $0x2,%edi
call   1030 <ppi_write_port@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Amstrad_PPI_Refresh@plt>

LLVM IR (-O0):
define void @PPI_WritePortC(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ppi_write_port(i32 2, i32 %3)
%5 = call i32 (...) @Amstrad_PPI_Refresh()
ret void
}

LLVM IR (-O2):
define void @PPI_WritePortC(i32 %0) {
%2 = tail call i32 @ppi_write_port(i32 2, i32 %0)
%3 = tail call i32 (...) @Amstrad_PPI_Refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ another();
int /*<<< orphan*/ printf(char *);
void say_bye() {
  printf("Goodbye!\n");
  another();
}


x86 assembly (clang, -O0):
<say_bye>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <another@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<say_bye>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <another@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Goodbye!\0A\00"
define void @say_bye() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @another()
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"Goodbye!\00"
define void @say_bye() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @another()
ret void
}
int console_write(const char *buffer, int buff_len) { return buff_len; }


x86 assembly (clang, -O0):
<console_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_write>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @console_write(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @console_write(i8* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}