xunge/DecIR huggingface dataset:
int equal(char *s1, char *s2) {
  while (*s1 == *s2++) {
    if (*s1++ == '\0')
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <equal+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <equal+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1160 <equal+0x60>
jmp    110c <equal+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1126 <equal+0x26>
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <equal+0x10>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @equal(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %22, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %5
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %9, %13
br i1 %14, label %15, label %23
15: ; preds = %6
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
%18 = load i8, i8* %16
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 1, i32* %3
br label %24
22: ; preds = %15
br label %6
23: ; preds = %6
store i32 0, i32* %3
br label %24
24: ; preds = %23, %21
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @equal(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %13, label %3
13: ; preds = %3, %9
%14 = phi i32 [ 1, %9 ], [ 0, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void sig_handler(int signo) { _exit(0); }


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

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define void @sig_handler(i32 %0) {
%2 = tail call i32 @_exit(i32 0)
unreachable
}
int is_leap(int year) {
  return year % 400 ? (year % 100 ? (year % 4 ? 0 : 1) : 0) : 1;
}


x86 assembly (clang, -O0):
<is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1164 <is_leap+0x64>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114f <is_leap+0x4f>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <is_leap+0x59>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <is_leap+0x59>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1171 <is_leap+0x71>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1171 <is_leap+0x71>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <is_leap+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <is_leap+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_leap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 400
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 4
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 1
br label %17
16: ; preds = %6
br label %17
17: ; preds = %16, %10
%18 = phi i32 [ %15, %10 ], [ 0, %16 ]
br label %20
19: ; preds = %1
br label %20
20: ; preds = %19, %17
%21 = phi i32 [ %18, %17 ], [ 1, %19 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @is_leap(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7, %4
%12 = phi i32 [ %10, %7 ], [ 0, %4 ], [ 1, %1 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ html_cvt_long(char const *, int, void *, void *);
int html_cvt_date(const char *data, int len, void *dst, void *closure) {
  if (data) {
    if (html_cvt_long(data, len, dst, closure))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<html_cvt_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1161 <html_cvt_date+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <html_cvt_long@plt>
cmp    $0x0,%rax
je     115c <html_cvt_date+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1168 <html_cvt_date+0x58>
jmp    1161 <html_cvt_date+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_cvt_date>:
test   %rdi,%rdi
je     112e <html_cvt_date+0x1e>
push   %rax
call   1030 <html_cvt_long@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
lea    0x8(%rsp),%rsp
je     112e <html_cvt_date+0x1e>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @html_cvt_date(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i64 @html_cvt_long(i8* %0, i32 %1, i8* %2, i8* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6, %4
br label %10
10: ; preds = %6, %9
%11 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECCRTST(const char *the_title) { return any_decrqss(the_title, "-q"); }


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

x86 assembly (clang, -O2):
<rpt_DECCRTST>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-q\00"
define i32 @rpt_DECCRTST(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @any_decrqss(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"-q\00"
define i32 @rpt_DECCRTST(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
int end_option(unsigned char *optionptr) {
  int i = 0;
  while (optionptr[i] != 0xFF) {
    if (optionptr[i] == 0x00)
      i++;
    else
      i += optionptr[i + 1] + 2;
  }
  return i;
}


x86 assembly (clang, -O0):
<end_option>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0xff,%eax
je     1168 <end_option+0x68>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1149 <end_option+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1163 <end_option+0x63>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
add    $0x2,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <end_option+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_option>:
xor    %eax,%eax
jmp    1113 <end_option+0x13>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
movslq %eax,%rcx
movzbl (%rdi,%rcx,1),%edx
test   %dl,%dl
je     1110 <end_option+0x10>
cmp    $0xff,%dl
je     112f <end_option+0x2f>
movzbl 0x1(%rcx,%rdi,1),%ecx
add    %ecx,%eax
add    $0x2,%eax
jmp    1113 <end_option+0x13>
ret

LLVM IR (-O0):
define i32 @end_option(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %34, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = icmp ne i32 %10, 255
br i1 %11, label %12, label %35
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %12
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %34
23: ; preds = %12
%24 = load i8*, i8** %2
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = add nsw i32 %30, 2
%32 = load i32, i32* %3
%33 = add nsw i32 %32, %31
store i32 %33, i32* %3
br label %34
34: ; preds = %23, %20
br label %4
35: ; preds = %4
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @end_option(i8* nocapture %0) {
br label %2
2: ; preds = %17, %1
%3 = phi i32 [ 0, %1 ], [ %18, %17 ]
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 -1, label %19
i8 0, label %7
]
7: ; preds = %2
%8 = add nsw i32 %3, 1
br label %17
9: ; preds = %2
%10 = add nsw i32 %3, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = add i32 %3, 2
%16 = add i32 %15, %14
br label %17
17: ; preds = %9, %7
%18 = phi i32 [ %8, %7 ], [ %16, %9 ]
br label %2
19: ; preds = %2
ret i32 %3
}
int foo(int *A, unsigned X) { return A[X]; }


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

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%eax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ subsystem_power(int, int);
void io_config_clk_on(void) { subsystem_power((1 << 16), 1); }


x86 assembly (clang, -O0):
<io_config_clk_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000,%edi
mov    $0x1,%esi
call   1030 <subsystem_power@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_config_clk_on>:
mov    $0x10000,%edi
mov    $0x1,%esi
jmp    1030 <subsystem_power@plt>

LLVM IR (-O0):
define void @io_config_clk_on() {
%1 = call i32 @subsystem_power(i32 65536, i32 1)
ret void
}

LLVM IR (-O2):
define void @io_config_clk_on() {
%1 = tail call i32 @subsystem_power(i32 65536, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void put_byte(FILE *s, unsigned int b) {
  char tmp = b;
  fwrite(&tmp, sizeof(char), 1, s);
}


x86 assembly (clang, -O0):
<put_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xd(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_byte>:
mov    %rdi,%rax
movsbl %sil,%edi
mov    %rax,%rsi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @put_byte(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i32*, i32** %3
%9 = call i32 @fwrite(i8* %5, i32 1, i32 1, i32* %8)
ret void
}

LLVM IR (-O2):
define void @put_byte(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = tail call i32 @fputc(i32 %4, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, b = 10;
  for (a = 0; a < b; a++) {
    printf("Hello, world! %d\n", a);
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114f <main+0x3f>
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"Hello, world! %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 0, i32* %1
br label %14
11: ; No predecessors!
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %8, %4
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [18 x i8] c"Hello, world! %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die();
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr && size != 0) {
    die();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <xmalloc+0x36>
cmpq   $0x0,-0x8(%rbp)
je     1156 <xmalloc+0x36>
mov    $0x0,%al
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1140 <xmalloc+0x20>
test   %r14,%r14
jne    1140 <xmalloc+0x20>
xor    %eax,%eax
call   1040 <die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @die()
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int);
void defaultEventHandler(unsigned int a, unsigned int x, unsigned int y) {
  if (0) {
    printf("Event: A=%02x X=%02x Y=%02x\r\n", a, x, y);
  }
}


x86 assembly (clang, -O0):
<defaultEventHandler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @defaultEventHandler(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @defaultEventHandler(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void clean_exit(void) {
  fflush(stdout);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<clean_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<clean_exit>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @clean_exit() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @clean_exit() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
size_t c_tree_max_size();
size_t c_multimap_max_size(void) { return c_tree_max_size(); }


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

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

LLVM IR (-O0):
define i64 @c_multimap_max_size() {
%1 = call i64 (...) @c_tree_max_size()
ret i64 %1
}

LLVM IR (-O2):
define i64 @c_multimap_max_size() {
%1 = tail call i64 (...) @c_tree_max_size()
ret i64 %1
}
void foo_1_2_2_1_1_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_1_2_2_2_2() {
ret void
}
void pwm_disable(struct pwm_device *pwm) {}


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

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

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

LLVM IR (-O2):
%struct.pwm_device = type opaque
define void @pwm_disable(%struct.pwm_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_instr(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void cgen_ifelse(int num) {
  print_instr("li $t0 0");
  char str[100];
  sprintf(str, "beq $a0 $t0 ELSE%d", num);
  print_instr(str);
}


x86 assembly (clang, -O0):
<cgen_ifelse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <print_instr@plt>
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec4(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <print_instr@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgen_ifelse>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %edi,%ebx
lea    0xed0(%rip),%rdi
call   1030 <print_instr@plt>
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1030 <print_instr@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"li $t0 0\00"
@.str.1 = [19 x i8] c"beq $a0 $t0 ELSE%d\00"
define void @cgen_ifelse(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 %0, i32* %2
%4 = call i32 @print_instr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i32 @print_instr(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"li $t0 0\00"
@.str.1 = [19 x i8] c"beq $a0 $t0 ELSE%d\00"
define void @cgen_ifelse(i32 %0) {
%2 = alloca [100 x i8]
%3 = tail call i32 @print_instr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%6 = call i32 @print_instr(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *malloc(long);
void *midi_mem_alloc(long nbytes, const char *file, int line) {
  void *p;
  assert(nbytes > 0);
  p = malloc(nbytes);
  assert(p != NULL);
  return p;
}


x86 assembly (clang, -O0):
<midi_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midi_mem_alloc>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setg   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @midi_mem_alloc(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %4
%13 = call i8* @malloc(i64 %12)
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = icmp ne i8* %14, null
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
define noalias i8* @midi_mem_alloc(i64 %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp sgt i64 %0, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i8* @malloc(i64 %0)
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ scrBreakLine();
int /*<<< orphan*/ scrDelete();
int /*<<< orphan*/ scrPutGlyph(char const);
void uioPrintChar(const char c) {
  switch (c) {
  case '\n':
    scrBreakLine();
    break;
  case 0x7F:
    scrDelete();
    break;
  default:
    scrPutGlyph(c);
  }
}


x86 assembly (clang, -O0):
<uioPrintChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xa,%eax
je     1164 <uioPrintChar+0x34>
jmp    1153 <uioPrintChar+0x23>
mov    -0x8(%rbp),%eax
sub    $0x7f,%eax
je     1170 <uioPrintChar+0x40>
jmp    117c <uioPrintChar+0x4c>
mov    $0x0,%al
call   1050 <scrBreakLine@plt>
jmp    1185 <uioPrintChar+0x55>
mov    $0x0,%al
call   1040 <scrDelete@plt>
jmp    1185 <uioPrintChar+0x55>
movsbl -0x1(%rbp),%edi
call   1030 <scrPutGlyph@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uioPrintChar>:
cmp    $0x7f,%edi
je     1141 <uioPrintChar+0x11>
cmp    $0xa,%edi
jne    1148 <uioPrintChar+0x18>
xor    %eax,%eax
jmp    1050 <scrBreakLine@plt>
xor    %eax,%eax
jmp    1040 <scrDelete@plt>
movsbl %dil,%edi
jmp    1030 <scrPutGlyph@plt>

LLVM IR (-O0):
define void @uioPrintChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %9 [
i32 10, label %5
i32 127, label %7
]
5: ; preds = %1
%6 = call i32 (...) @scrBreakLine()
br label %12
7: ; preds = %1
%8 = call i32 (...) @scrDelete()
br label %12
9: ; preds = %1
%10 = load i8, i8* %2
%11 = call i32 @scrPutGlyph(i8 signext %10)
br label %12
12: ; preds = %9, %7, %5
ret void
}

LLVM IR (-O2):
define void @uioPrintChar(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 10, label %3
i32 127, label %5
]
3: ; preds = %1
%4 = tail call i32 (...) @scrBreakLine()
br label %9
5: ; preds = %1
%6 = tail call i32 (...) @scrDelete()
br label %9
7: ; preds = %1
%8 = tail call i32 @scrPutGlyph(i8 signext %0)
br label %9
9: ; preds = %7, %5, %3
ret void
}
/* Variables and functions */
int CHAR_BIT;
int /*<<< orphan*/ test(int);
int main(void) {
  int bits = sizeof(int) * CHAR_BIT;
  int i;
  for (i = 0; i < bits; i++)
    test(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1159 <main+0x49>
mov    -0xc(%rbp),%edi
call   1030 <test@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rax
mov    (%rax),%ebp
shl    $0x2,%ebp
test   %ebp,%ebp
jle    113e <main+0x2e>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <test@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @CHAR_BIT
%5 = sext i32 %4 to i64
%6 = mul i64 4, %5
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
store i32 0, i32* %3
br label %8
8: ; preds = %15, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i32, i32* %3
%14 = call i32 @test(i32 %13)
br label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %8
18: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = load i32, i32* @CHAR_BIT
%2 = shl i32 %1, 2
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ 0, %0 ]
%6 = tail call i32 @test(i32 %5)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %2
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int EXIT_FAILURE;
int main(void) { return EXIT_FAILURE; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @EXIT_FAILURE
ret i32 %2
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = load i32, i32* @EXIT_FAILURE
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t instruction_extension_extract_displacement(uint16_t instruction) {
  return (instruction >> 0x00) & 0xFF;
}


x86 assembly (clang, -O0):
<instruction_extension_extract_displacement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instruction_extension_extract_displacement>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @instruction_extension_extract_displacement(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 0
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @instruction_extension_extract_displacement(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ randomLong();
int main() {
  printf("%ld\n", randomLong());
  return 9;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @randomLong()
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 9
}

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


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

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

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

LLVM IR (-O2):
define void @RTPathQueryInfo() {
ret void
}
void g_source_get_context() {}


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

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

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

LLVM IR (-O2):
define void @g_source_get_context() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fibonachi(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int g = 0;
  printf("Enter number to count up to in fibonachi:\n");
  scanf("%d", &g);
  printf("fibonachi %d times:\n", g);
  fibonachi(g);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <fibonachi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
call   1050 <fibonachi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Enter number to count up to in fibonachi:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"fibonachi %d times:\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @fibonachi(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"fibonachi %d times:\0A\00"
@str = [42 x i8] c"Enter number to count up to in fibonachi:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @fibonachi(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ NONULL(char const *);
int strcasecmp(int /*<<< orphan*/, int /*<<< orphan*/);
int safe_strcasecmp(const char *a, const char *b) {
  return strcasecmp(NONULL(a), NONULL(b));
}


x86 assembly (clang, -O0):
<safe_strcasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <NONULL@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <NONULL@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strcasecmp>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <NONULL@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <NONULL@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @safe_strcasecmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @NONULL(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @NONULL(i8* %7)
%9 = call i32 @strcasecmp(i32 %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @safe_strcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @NONULL(i8* %0)
%4 = tail call i32 @NONULL(i8* %1)
%5 = tail call i32 @strcasecmp(i32 %3, i32 %4)
ret i32 %5
}
void test_Struct4(void) {}


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

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

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

LLVM IR (-O2):
define void @test_Struct4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int arr[], int m) {
  int i;
  for (i = 0; i < m; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
void initGpio(void) {}


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

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

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

LLVM IR (-O2):
define void @initGpio() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *);
void MakeMark(char *sMark) {
  FILE *hFilename;
  hFilename = fopen("MARK", "w");
  if (hFilename == NULL) {
    printf("mark: can't open file\n");
  }
  fprintf(hFilename, "%s\n", sMark);
}


x86 assembly (clang, -O0):
<MakeMark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <MakeMark+0x3a>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeMark>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115e <MakeMark+0x2e>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"MARK\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [23 x i8] c"mark: can't open file\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define void @MakeMark(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32*, i32** %3
%11 = load i8*, i8** %2
%12 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"MARK\00"
@.str.1 = [2 x i8] c"w\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@str = [22 x i8] c"mark: can't open file\00"
define void @MakeMark(i8* %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %0)
ret void
}
void ARGBToRGB24Row_AVX512VBMI() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB24Row_AVX512VBMI() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void System_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<System_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @System_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @System_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void TestEmptyFunction(void) {}


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

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

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

LLVM IR (-O2):
define void @TestEmptyFunction() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430Usart0P__Usart__disableSpi();
void Msp430SpiNoDmaP__0__Usart__disableSpi(void) {
  HplMsp430Usart0P__Usart__disableSpi();
}


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

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

LLVM IR (-O0):
define void @Msp430SpiNoDmaP__0__Usart__disableSpi() {
%1 = call i32 (...) @HplMsp430Usart0P__Usart__disableSpi()
ret void
}

LLVM IR (-O2):
define void @Msp430SpiNoDmaP__0__Usart__disableSpi() {
%1 = tail call i32 (...) @HplMsp430Usart0P__Usart__disableSpi()
ret void
}
/* Variables and functions */
double double_max();
float float_max_size();
int /*<<< orphan*/ printf(char *, double);
int main() {
  float float_max;
  double db_max;
  float_max = float_max_size();
  db_max = double_max();
  printf("maximal size of float eq:%46f;\n", float_max);
  db_max = double_max();
  printf("maximal size of double eq:%46g;\n", db_max);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <float_max_size@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <double_max@plt>
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <double_max@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <float_max_size@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <double_max@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <double_max@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"maximal size of float eq:%46f;\0A\00"
@.str.1 = [33 x i8] c"maximal size of double eq:%46g;\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca double
%3 = call float (...) @float_max_size()
store float %3, float* %1
%4 = call double (...) @double_max()
store double %4, double* %2
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call double (...) @double_max()
store double %8, double* %2
%9 = load double, double* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"maximal size of float eq:%46f;\0A\00"
@.str.1 = [33 x i8] c"maximal size of double eq:%46g;\0A\00"
define i32 @main() {
%1 = tail call float (...) @float_max_size()
%2 = tail call double (...) @double_max()
%3 = fpext float %1 to double
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call double (...) @double_max()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), double %5)
ret i32 0
}
void __hv_gt_f(float bIn0, float bIn1, float *bOut) {
  *bOut = (bIn0 > bIn1) ? 1.0f : 0.0f;
}


x86 assembly (clang, -O0):
<__hv_gt_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movss  0xedc(%rip),%xmm3
xorps  %xmm2,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_gt_f>:
cmpltss %xmm0,%xmm1
movss  0xef3(%rip),%xmm0
andps  %xmm1,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @__hv_gt_f(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp ogt float %7, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, float 1.000000e+00, float 0.000000e+00
%12 = load float*, float** %6
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @__hv_gt_f(float %0, float %1, float* nocapture writeonly %2) {
%4 = fcmp ogt float %0, %1
%5 = select i1 %4, float 1.000000e+00, float 0.000000e+00
store float %5, float* %2
ret void
}
void ser_null_log(char *msg) { return; }


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

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

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

LLVM IR (-O2):
define void @ser_null_log(i8* nocapture %0) {
ret void
}
__attribute__((weak)) void fd_nrf8001_bond_security_request_success(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_bond_security_request_success() {
ret void
}