xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a;
  for (a = 1; a <= 256; a++)
    printf("%d %c\n", a, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x101,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 257
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int ENOSYS;
int /*<<< orphan*/ mp_msg(int, int, char *, char const *);
int preinit(const char *arg) {
  if (arg) {
    mp_msg(3, 2, "[VO_TGA] Unknown subdevice: %s.\n", arg);
    return ENOSYS;
  }
  return 0;
}


x86 assembly (clang, -O0):
<preinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1152 <preinit+0x42>
mov    -0x10(%rbp),%rcx
mov    $0x3,%edi
mov    $0x2,%esi
lea    0xec4(%rip),%rdx
call   1030 <mp_msg@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <preinit+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preinit>:
test   %rdi,%rdi
je     113d <preinit+0x2d>
push   %rax
mov    %rdi,%rcx
lea    0xee0(%rip),%rdx
mov    $0x3,%edi
mov    $0x2,%esi
call   1030 <mp_msg@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"[VO_TGA] Unknown subdevice: %s.\0A\00"
@ENOSYS = global i32 0
define i32 @preinit(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @mp_msg(i32 3, i32 2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @ENOSYS
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [33 x i8] c"[VO_TGA] Unknown subdevice: %s.\0A\00"
@ENOSYS = global i32 0
define i32 @preinit(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @mp_msg(i32 3, i32 2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @ENOSYS
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, size_t, size_t,
                           size_t);
void test_print_results_json(FILE *output, size_t nb_tests,
                             size_t nb_passed_tests, size_t nb_failed_tests) {
  fprintf(output,
          "  },\n"
          "  \"results\": {\n"
          "    \"nb_tests\": %zu,\n"
          "    \"nb_passed_tests\": %zu,\n"
          "    \"nb_failed_tests\": %zu\n"
          "  }\n"
          "}\n",
          nb_tests, nb_passed_tests, nb_failed_tests);
}


x86 assembly (clang, -O0):
<test_print_results_json>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_print_results_json>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [103 x i8] c" },\0A \22results\22: {\0A \22nb_tests\22: %zu,\0A \22nb_passed_tests\22: %zu,\0A \22nb_failed_tests\22: %zu\0A }\0A}\0A\00"
define void @test_print_results_json(i32* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i64 %10, i64 %11, i64 %12)
ret void
}

LLVM IR (-O2):
@.str = [103 x i8] c" },\0A \22results\22: {\0A \22nb_tests\22: %zu,\0A \22nb_passed_tests\22: %zu,\0A \22nb_failed_tests\22: %zu\0A }\0A}\0A\00"
define void @test_print_results_json(i32* nocapture %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i64 %1, i64 %2, i64 %3)
ret void
}
/* Variables and functions */
int test_sat_parser_should_fail(char *);
int test04(void) { return test_sat_parser_should_fail("(a b)"); }


x86 assembly (clang, -O0):
<test04>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <test_sat_parser_should_fail@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test04>:
lea    0xee9(%rip),%rdi
jmp    1030 <test_sat_parser_should_fail@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"(a b)\00"
define i32 @test04() {
%1 = call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"(a b)\00"
define i32 @test04() {
%1 = tail call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
char getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void exit_function(void) {
  if (0)
    while (getc(stdin) != '\n')
      ;
}


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

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

LLVM IR (-O0):
@stdin = global i32 0
define void @exit_function() {
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @exit_function() {
ret void
}
int ilog2(int x) {
  int n;
  for (n = 0; !(x & 1); n++)
    x = x >> 1;
  return n;
}


x86 assembly (clang, -O0):
<ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1129 <ilog2+0x29>
jmp    1140 <ilog2+0x40>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ilog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog2>:
xor    %eax,%eax
test   $0x1,%dil
jne    111d <ilog2+0x1d>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax)
sar    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1110 <ilog2+0x10>
ret

LLVM IR (-O0):
define i32 @ilog2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %2
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = load i32, i32* %2
%11 = ashr i32 %10, 1
store i32 %11, i32* %2
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = ashr i32 %6, 1
%8 = add nuw nsw i32 %5, 1
%9 = and i32 %6, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ check_val_init();
__attribute__((__constructor__)) void construct(void) { check_val_init(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @construct, i8* null }]
define void @construct() {
%1 = call i32 (...) @check_val_init()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @construct, i8* null }]
define void @construct() {
%1 = tail call i32 (...) @check_val_init()
ret void
}
/* Variables and functions */
long find_max_prime_factor(long);
int /*<<< orphan*/ printf(char *, long, long);
int main() {
  long max_value = 600851475143;
  long max_prime_factor = max_value;
  max_prime_factor = find_max_prime_factor(max_value);
  printf("largest prime factor of %lu is %lu\n", max_value, max_prime_factor);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x8be589eac7,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <find_max_prime_factor@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movabs $0x8be589eac7,%rbx
mov    %rbx,%rdi
call   1040 <find_max_prime_factor@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"largest prime factor of %lu is %lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 600851475143, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = load i64, i64* %2
%6 = call i64 @find_max_prime_factor(i64 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [36 x i8] c"largest prime factor of %lu is %lu\0A\00"
define i32 @main() {
%1 = tail call i64 @find_max_prime_factor(i64 600851475143)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 600851475143, i64 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x33() {
  Assert_real((isbdigit(51) == 0),
              "/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_isbdigit.c",
              260, ("isbdigit should be 0 for 3"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x33>:
push   %rbp
mov    %rsp,%rbp
mov    $0x33,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x104,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x33>:
push   %rax
mov    $0x33,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x104,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for 3\00"
define void @t_isbdigit_0x33() {
%1 = call i64 @isbdigit(i32 51)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 260, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for 3\00"
define void @t_isbdigit_0x33() {
%1 = tail call i64 @isbdigit(i32 51)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 260, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ McuSleepC__McuPowerState__update();
void Atm128SpiP__McuPowerState__update(void) {
  McuSleepC__McuPowerState__update();
}


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

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

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

LLVM IR (-O2):
define void @Atm128SpiP__McuPowerState__update() {
%1 = tail call i32 (...) @McuSleepC__McuPowerState__update()
ret void
}
void iter(int (*cb)(void *), void *d) { cb(d); }


x86 assembly (clang, -O0):
<iter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iter>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define void @iter(i32 (i8*)* nocapture %0, i8* %1) {
%3 = tail call i32 %0(i8* %1)
ret void
}
int BITS(int start, int end) {
  return (((0x01 << (start - end + 1)) - 1) << end);
}


x86 assembly (clang, -O0):
<BITS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BITS>:
sub    %esi,%edi
lea    0x1(%rdi),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %esi,%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @BITS(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 = sub nsw i32 %5, %6
%8 = add nsw i32 %7, 1
%9 = shl i32 1, %8
%10 = sub nsw i32 %9, 1
%11 = load i32, i32* %4
%12 = shl i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @BITS(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = sub i32 %3, %1
%5 = shl nsw i32 -1, %4
%6 = xor i32 %5, -1
%7 = shl i32 %6, %1
ret i32 %7
}
/* Variables and functions */
char const *version_get_compilation_date();
const char *plugin_api_info_date_cb(void *data, const char *info_name,
                                    const char *arguments) {
  (void)data;
  (void)info_name;
  (void)arguments;
  return version_get_compilation_date();
}


x86 assembly (clang, -O0):
<plugin_api_info_date_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <version_get_compilation_date@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @plugin_api_info_date_cb(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* (...) @version_get_compilation_date()
ret i8* %10
}

LLVM IR (-O2):
define i8* @plugin_api_info_date_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* (...) @version_get_compilation_date()
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ hi();
int main() {
  hi();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <hi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @hi()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hi()
ret i32 0
}
unsigned char FastUShortUByteDiv(unsigned short x, unsigned char y) {
  return x / y;
}


x86 assembly (clang, -O0):
<FastUShortUByteDiv>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzwl -0x2(%rbp),%eax
movzbl -0x3(%rbp),%ecx
cltd
idiv   %ecx
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastUShortUByteDiv>:
mov    %edi,%eax
xor    %edx,%edx
div    %si
ret

LLVM IR (-O0):
define zeroext i8 @FastUShortUByteDiv(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = sdiv i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @FastUShortUByteDiv(i16 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i16
%4 = udiv i16 %0, %3
%5 = trunc i16 %4 to i8
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ test_1();
int /*<<< orphan*/ test_2();
int /*<<< orphan*/ test_3();
int /*<<< orphan*/ test_4();
int32_t main(void) {
  setbuf(stdout, NULL);
  printf("Performing AES128 tests...\n");
  test_1();
  test_2();
  test_3();
  test_4();
  printf("All AES128 tests succeeded!\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <setbuf@plt>
lea    0xe78(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <test_1@plt>
mov    $0x0,%al
call   1060 <test_2@plt>
mov    $0x0,%al
call   1080 <test_3@plt>
mov    $0x0,%al
call   1070 <test_4@plt>
lea    0xe6c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <setbuf@plt>
lea    0xe88(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <test_1@plt>
xor    %eax,%eax
call   1060 <test_2@plt>
xor    %eax,%eax
call   1080 <test_3@plt>
xor    %eax,%eax
call   1070 <test_4@plt>
lea    0xe7b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [28 x i8] c"Performing AES128 tests...\0A\00"
@.str.1 = [30 x i8] c"All AES128 tests succeeded!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @setbuf(i32 %2, i32* null)
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @test_1()
%6 = call i32 (...) @test_2()
%7 = call i32 (...) @test_3()
%8 = call i32 (...) @test_4()
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [27 x i8] c"Performing AES128 tests...\00"
@str.2 = [29 x i8] c"All AES128 tests succeeded!\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32* null)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test_1()
%5 = tail call i32 (...) @test_2()
%6 = tail call i32 (...) @test_3()
%7 = tail call i32 (...) @test_4()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
float pt_to_px_f32(float pt, float dpi_scale) { return pt * dpi_scale; }


x86 assembly (clang, -O0):
<pt_to_px_f32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_to_px_f32>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @pt_to_px_f32(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @pt_to_px_f32(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
int RIGHT(int i) { return i * 2 + 1; }


x86 assembly (clang, -O0):
<RIGHT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RIGHT>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @RIGHT(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @RIGHT(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void normalcursor(void) {}


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

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

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

LLVM IR (-O2):
define void @normalcursor() {
ret void
}
/* Variables and functions */
void *__coverity_alloc__(int);
int /*<<< orphan*/ __coverity_mark_as_afm_allocated__(void *, char *);
void *H5Aget_type(void *attr_id) {
  void *id = __coverity_alloc__(10);
  __coverity_mark_as_afm_allocated__(id, "H5Tclose");
  return id;
}


x86 assembly (clang, -O0):
<H5Aget_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H5Aget_type>:
push   %rbx
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"H5Tclose\00"
define i8* @H5Aget_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @__coverity_alloc__(i32 10)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @__coverity_mark_as_afm_allocated__(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"H5Tclose\00"
define i8* @H5Aget_type(i8* nocapture readnone %0) {
%2 = tail call i8* @__coverity_alloc__(i32 10)
%3 = tail call i32 @__coverity_mark_as_afm_allocated__(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
void gdk_display_get_default_group() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_get_default_group() {
ret void
}
void init_buffer(char *buffer) {
  for (int i = 0; i < 1024; i++)
    buffer[i] = 0;
}


x86 assembly (clang, -O0):
<init_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    1136 <init_buffer+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_buffer+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_buffer>:
push   %rax
mov    $0x400,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @init_buffer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1024
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @init_buffer(i8* nocapture writeonly %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int EVP_PKEY_assign_RSA(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ RSA_up_ref(int /*<<< orphan*/ *);
int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) {
  int ret = EVP_PKEY_assign_RSA(pkey, key);
  if (ret != 0)
    RSA_up_ref(key);
  return ret;
}


x86 assembly (clang, -O0):
<EVP_PKEY_set1_RSA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <EVP_PKEY_assign_RSA@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1153 <EVP_PKEY_set1_RSA+0x33>
mov    -0x10(%rbp),%rdi
call   1040 <RSA_up_ref@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_PKEY_set1_RSA>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <EVP_PKEY_assign_RSA@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1139 <EVP_PKEY_set1_RSA+0x19>
mov    %rbx,%rdi
call   1040 <RSA_up_ref@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @EVP_PKEY_set1_RSA(i32* %0, i32* %1) {
%3 = tail call i32 @EVP_PKEY_assign_RSA(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @RSA_up_ref(i32* %1)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello PGO!\n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [11 x i8] c"Hello PGO!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popinteger8array_(char *x, unsigned int *n) { popNarray(x, (*n * 8)); }


x86 assembly (clang, -O0):
<popinteger8array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x3,%esi
call   1030 <popNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popinteger8array_>:
mov    (%rsi),%esi
shl    $0x3,%esi
jmp    1030 <popNarray@plt>

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

LLVM IR (-O2):
define void @popinteger8array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 3
%5 = tail call i32 @popNarray(i8* %0, i32 %4)
ret void
}
int fun740() { return 740; }


x86 assembly (clang, -O0):
<fun740>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2e4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun740>:
mov    $0x2e4,%eax
ret

LLVM IR (-O0):
define i32 @fun740() {
ret i32 740
}

LLVM IR (-O2):
define i32 @fun740() {
ret i32 740
}
int test_imm_FDuint16_mem(unsigned short *val) {
  return ((*val) & (-0xFD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FDuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff03,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FDuint16_mem>:
movzwl (%rdi),%eax
test   $0xff03,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FDuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -253
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_FDuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -253
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int *add(int *number, int adder) {
  int mul = (*number) + adder;
  *number = mul;
  return number;
}


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

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

LLVM IR (-O0):
define i32* @add(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32*, i32** %3
store i32 %10, i32* %11
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
define i32* @add(i32* returned %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, %1
store i32 %4, i32* %0
ret i32* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void undefined_local() {
  int x;
  printf("x = %d\n", x);
}


x86 assembly (clang, -O0):
<undefined_local>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<undefined_local>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"x = %d\0A\00"
define void @undefined_local() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 undef)
ret void
}
int GRWFCH(fd, nbytes, buf, w_fd, w_nbytes, w_buf)
int *fd, *nbytes;
char *buf;
int w_fd, w_nbytes, w_buf;
{ return write(*fd, (void *)buf, *nbytes); }


x86 assembly (clang, -O0):
<GRWFCH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GRWFCH>:
mov    (%rdi),%edi
mov    (%rsi),%eax
mov    %rdx,%rsi
mov    %eax,%edx
xor    %eax,%eax
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @GRWFCH(i32* %0, i32* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i32* %1, i32** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i8*, i8** %9
%16 = load i32*, i32** %8
%17 = load i32, i32* %16
%18 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %14, i8* %15, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @GRWFCH(i32* nocapture %0, i32* nocapture %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = load i32, i32* %0
%8 = load i32, i32* %1
%9 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %7, i8* %2, i32 %8)
ret i32 %9
}
struct s31 {
  char : 0;
  float b;
  char : 0;
} f31(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<f31>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f31+0x9>
jmp    1109 <f31+0x9>

x86 assembly (clang, -O2):
<f31>:
jmp    1100 <f31>

LLVM IR (-O0):
define float @f31() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define float @f31() {
br label %1
1: ; preds = %0, %1
br label %1
}
char *peApiName(void) { return "select"; }


x86 assembly (clang, -O0):
<peApiName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<peApiName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"select\00"
define i8* @peApiName() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"select\00"
define i8* @peApiName() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
int fun106() { return 106; }


x86 assembly (clang, -O0):
<fun106>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun106>:
mov    $0x6a,%eax
ret

LLVM IR (-O0):
define i32 @fun106() {
ret i32 106
}

LLVM IR (-O2):
define i32 @fun106() {
ret i32 106
}
void fn0800_0163() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @fn0800_0163() {
ret void
}
void disable_wdg(void) { (*(volatile unsigned long *)0x53000000) = 0; }


x86 assembly (clang, -O0):
<disable_wdg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x53000000,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_wdg>:
movq   $0x0,0x53000000
ret

LLVM IR (-O0):
define void @disable_wdg() {
store volatile i64 0, i64* inttoptr (i64 1392508928 to i64*)
ret void
}

LLVM IR (-O2):
define void @disable_wdg() {
store volatile i64 0, i64* inttoptr (i64 1392508928 to i64*)
ret void
}
/* Variables and functions */
scalar_t__ uart1Putch(char);
const char *uart1Puts(const char *string) {
  char ch;
  while ((ch = *string)) {
    if (uart1Putch(ch) < 0)
      break;
    string++;
  }
  return string;
}


x86 assembly (clang, -O0):
<uart1Puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1156 <uart1Puts+0x46>
movsbl -0x9(%rbp),%edi
call   1030 <uart1Putch@plt>
cmp    $0x0,%rax
jge    1145 <uart1Puts+0x35>
jmp    1156 <uart1Puts+0x46>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <uart1Puts+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart1Puts>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <uart1Puts+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <uart1Putch@plt>
test   %rax,%rax
js     1139 <uart1Puts+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart1Puts+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @uart1Puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %13, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i8, i8* %3
%10 = call i64 @uart1Putch(i8 signext %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
br label %16
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %4
16: ; preds = %12, %4
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @uart1Puts(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @uart1Putch(i8 signext %5)
%8 = icmp slt i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %9, %4, %1
%14 = phi i8* [ %0, %1 ], [ %6, %4 ], [ %10, %9 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hi\n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void ff_hevc_put_hevc_bi_pel_pixels8_10_sse4() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ getppid();
__attribute__((__weak__, __always___)) pid_t softboundcets_getppid(void) {
  return getppid();
}


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

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

LLVM IR (-O0):
define weak i32 @softboundcets_getppid() {
%1 = call i32 (...) @getppid()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @softboundcets_getppid() {
%1 = tail call i32 (...) @getppid()
ret i32 %1
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int set_quaddobl_state_to_verbose(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(690, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<set_quaddobl_state_to_verbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2b2,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_quaddobl_state_to_verbose>:
mov    $0x2b2,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @set_quaddobl_state_to_verbose() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 690, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @set_quaddobl_state_to_verbose() {
%1 = tail call i32 @_ada_use_c2phc(i32 690, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int printf(char *, char, ...);
main() {
  int a = 10000;
  char b = 'c';
  printf("%d,%d", printf("%d\n", a), printf("%c\n", b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2710,-0x4(%rbp)
movb   $0x63,-0x5(%rbp)
mov    -0x4(%rbp),%eax
lea    0xed9(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %al,-0x6(%rbp)
lea    0xec9(%rip),%rdi
movsbl -0x5(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,%edx
mov    -0x6(%rbp),%al
lea    0xea8(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeee(%rip),%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %eax,%ebx
lea    0xedd(%rip),%rdi
mov    $0x63,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl %bl,%esi
lea    0xebd(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d,%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 10000, i32* %1
store i8 99, i8* %2
%3 = load i32, i32* %1
%4 = trunc i32 %3 to i8
%5 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
%6 = trunc i32 %5 to i8
%7 = load i8, i8* %2
%8 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext %7)
%9 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d,%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 16)
%2 = trunc i32 %1 to i8
%3 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext 99)
%4 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %2, i32 %3)
ret i32 0
}
float square(float X) { return X * X; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @square(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @square(float %0) {
%2 = fmul float %0, %0
ret float %2
}
int calculateRecursive(int m) {
  if (m == 0)
    return 0;
  else
    return calculateRecursive(m - 1) + m;
}


x86 assembly (clang, -O0):
<calculateRecursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <calculateRecursive+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1142 <calculateRecursive+0x32>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <calculateRecursive@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateRecursive>:
test   %edi,%edi
je     1119 <calculateRecursive+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @calculateRecursive(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
void eapol_sm_erp_flush(struct eapol_sm *sm) {}


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

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

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

LLVM IR (-O2):
%struct.eapol_sm = type opaque
define void @eapol_sm_erp_flush(%struct.eapol_sm* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ examples_of_dynamic_arrays(int, int);
int /*<<< orphan*/ examples_with_static_arrays();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  examples_with_static_arrays();
  examples_of_dynamic_arrays(10, 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1060 <examples_with_static_arrays@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1050 <examples_of_dynamic_arrays@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1060 <examples_with_static_arrays@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1050 <examples_of_dynamic_arrays@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @examples_with_static_arrays()
%5 = call i32 @examples_of_dynamic_arrays(i32 10, i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @examples_with_static_arrays()
%4 = tail call i32 @examples_of_dynamic_arrays(i32 10, i32 20)
ret i32 0
}