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


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

x86 assembly (clang, -O2):
<func>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @func(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int file_exists(char *file) {
  FILE *stream;
  stream = fopen(file, "r");
  return (stream == NULL ? 0 : 1);
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <fopen@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
ret i32 %9
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sig_int() {
  printf("Bye!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sig_int>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_int>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Bye!\0A\00"
define void @sig_int() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [5 x i8] c"Bye!\00"
define void @sig_int() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void term(int sig) {
  fprintf(stderr, "line 2 of 2\n");
  fflush(stderr);
  exit(0);
}


x86 assembly (clang, -O0):
<term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<term>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"line 2 of 2\0A\00"
define void @term(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"line 2 of 2\0A\00"
define void @term(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
adrreg0adrx1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[10000000]) <= (((short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl 0x1312d00(%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movswl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     114b <adrreg0adrx1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <adrreg0adrx1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adrx1>:
movzwl 0x1312d00(%r8),%edx
01
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx,%rcx,1),%dx
setle  %al
ret

LLVM IR (-O0):
define i32 @adrreg0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = getelementptr inbounds i16, i16* %16, i64 10000000
%18 = load i16, i16* %17
%19 = sext i16 %18 to i32
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %21
%23 = load i16, i16* %22
%24 = sext i16 %23 to i32
%25 = icmp sle i32 %19, %24
br i1 %25, label %26, label %27
26: ; preds = %6
store i32 1, i32* %7
br label %28
27: ; preds = %6
store i32 0, i32* %7
br label %28
28: ; preds = %27, %26
%29 = load i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
define i32 @adrreg0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %9
%11 = load i16, i16* %10
%12 = icmp sle i16 %8, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xbb() {
  Assert_real((islower(187) == 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_islower.c",
              940, ("islower should be 0 for 0xbb"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xbb>:
push   %rax
mov    $0xbb,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ac,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xbb\00"
define void @t_islower_0xbb() {
%1 = call i64 @islower(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xbb\00"
define void @t_islower_0xbb() {
%1 = tail call i64 @islower(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sighandler2(int signum) {
  printf("this is sighandler2: %d\n", signum);
  return;
}


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

x86 assembly (clang, -O2):
<sighandler2>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [25 x i8] c"this is sighandler2: %d\0A\00"
define void @sighandler2(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
long internal__syscall0(long);
long __syscall0(long n) { return internal__syscall0(n); }


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

x86 assembly (clang, -O2):
<__syscall0>:
jmp    1030 <internal__syscall0@plt>

LLVM IR (-O0):
define i64 @__syscall0(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @internal__syscall0(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @__syscall0(i64 %0) {
%2 = tail call i64 @internal__syscall0(i64 %0)
ret i64 %2
}
const char *oj_version() { return "4.0.0"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"4.0.0\00"
define i8* @oj_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int get_mask(int num) {
  int mask, index;
  if (num <= 0) {
    return (0);
  }
  mask = 0;
  index = 0;
  while (num) {
    mask |= (1 << index);
    ++index;
    num >>= 1;
  }
  return (mask);
}


x86 assembly (clang, -O0):
<get_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <get_mask+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1162 <get_mask+0x62>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115c <get_mask+0x5c>
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <get_mask+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mask>:
test   %edi,%edi
jle    1120 <get_mask+0x20>
xor    %ecx,%ecx
xor    %eax,%eax
mov    %edi,%edx
nopw   0x0(%rax,%rax,1)
bts    %ecx,%eax
add    $0x1,%ecx
sar    %edx
cmp    $0x1,%edi
mov    %edx,%edi
ja     1110 <get_mask+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_mask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %24
9: ; preds = %1
store i32 0, i32* %4
store i32 0, i32* %5
br label %10
10: ; preds = %13, %9
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %5
%15 = shl i32 1, %14
%16 = load i32, i32* %4
%17 = or i32 %16, %15
store i32 %17, i32* %4
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
%20 = load i32, i32* %3
%21 = ashr i32 %20, 1
store i32 %21, i32* %3
br label %10
22: ; preds = %10
%23 = load i32, i32* %4
store i32 %23, i32* %2
br label %24
24: ; preds = %22, %8
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @get_mask(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = shl nuw i32 1, %4
%8 = or i32 %7, %5
%9 = add nuw nsw i32 %4, 1
%10 = ashr i32 %6, 1
%11 = icmp ult i32 %6, 2
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
void pcp_print_pwr_in_stats(struct activity *a, int curr) {}


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

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_pwr_in_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_pwr_in_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
void test_log_conflict() {}


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

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

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

LLVM IR (-O2):
define void @test_log_conflict() {
ret void
}
int clamp(int n, int a, int b) {
  if (n < a)
    return a;
  if (n > b)
    return b;
  return n;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <clamp+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
void Convert16To8Row_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @Convert16To8Row_SSSE3() {
ret void
}
/* Variables and functions */
float fabs(float n) { return (n < 0.0) ? -n : n; }


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <fabs+0x3b>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1145 <fabs+0x45>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fabs(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %2
%8 = fneg float %7
br label %11
9: ; preds = %1
%10 = load float, float* %2
br label %11
11: ; preds = %9, %6
%12 = phi float [ %8, %6 ], [ %10, %9 ]
ret float %12
}

LLVM IR (-O2):
define float @fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
void point(int row, int col, int color) {
  int red, green, blue;
  unsigned long *point = (unsigned long *)0x59000000;
  red = (color >> 16) & 0xff;
  green = (color >> 8) & 0xff;
  blue = (color >> 0) & 0xff;
  *(point + row * 480 + col) = (green << 24) | (blue << 16) | red;
}


x86 assembly (clang, -O0):
<point>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x59000000,%eax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x18,%eax
mov    -0x18(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
movslq %eax,%rdx
mov    -0x20(%rbp),%rax
imul   $0x1e0,-0x4(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<point>:
rol    $0x10,%edx
and    $0xffff00ff,%edx
movslq %edx,%rax
imul   $0x1e0,%edi,%ecx
movslq %ecx,%rcx
movslq %esi,%rdx
shl    $0x3,%rdx
mov    %rax,0x59000000(%rdx,%rcx,8)
59
ret

LLVM IR (-O0):
define void @point(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i64* inttoptr (i64 1493172224 to i64*), i64** %10
%11 = load i32, i32* %6
%12 = ashr i32 %11, 16
%13 = and i32 %12, 255
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
store i32 %16, i32* %8
%17 = load i32, i32* %6
%18 = ashr i32 %17, 0
%19 = and i32 %18, 255
store i32 %19, i32* %9
%20 = load i32, i32* %8
%21 = shl i32 %20, 24
%22 = load i32, i32* %9
%23 = shl i32 %22, 16
%24 = or i32 %21, %23
%25 = load i32, i32* %7
%26 = or i32 %24, %25
%27 = sext i32 %26 to i64
%28 = load i64*, i64** %10
%29 = load i32, i32* %4
%30 = mul nsw i32 %29, 480
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i64, i64* %28, i64 %31
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i64, i64* %32, i64 %34
store i64 %27, i64* %35
ret void
}

LLVM IR (-O2):
define void @point(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %2, 16
%5 = and i32 %4, 255
%6 = shl i32 %2, 16
%7 = or i32 %5, %6
%8 = sext i32 %7 to i64
%9 = mul nsw i32 %0, 480
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i64, i64* inttoptr (i64 1493172224 to i64*), i64 %10
%12 = sext i32 %1 to i64
%13 = getelementptr inbounds i64, i64* %11, i64 %12
store i64 %8, i64* %13
ret void
}
int compare(char data[], char temp[], int length) {
  int i;
  for (i = 0; i < length; i++) {
    if (data[i] != temp[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1161 <compare+0x61>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114e <compare+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1168 <compare+0x68>
jmp    1153 <compare+0x53>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <compare+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    $0x1,%eax
test   %edx,%edx
jle    1122 <compare+0x22>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
movzbl (%rdi,%rdx,1),%ecx
cmp    (%rsi,%rdx,1),%cl
jne    1123 <compare+0x23>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <compare+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
float log(int);
float g2(float xOld) {
  float xNew = 0;
  xNew = log(4 * xOld * xOld);
  return xNew;
}


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <log@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
movss  0xee8(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
jmp    1030 <log@plt>

LLVM IR (-O0):
define float @g2(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = fmul float 4.000000e+00, %4
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = fptosi float %7 to i32
%9 = call float @log(i32 %8)
store float %9, float* %3
%10 = load float, float* %3
ret float %10
}

LLVM IR (-O2):
define float @g2(float %0) {
%2 = fmul float %0, 4.000000e+00
%3 = fmul float %2, %0
%4 = fptosi float %3 to i32
%5 = tail call float @log(i32 %4)
ret float %5
}
/* Variables and functions */
int get(long, long);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, long *, long *);
int main(int argc, char *argv[]) {
  long a, b;
  scanf("%i%i", &a, &b);
  printf("%i", get(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <get@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1040 <get@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%i%i\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %6, i64* %7)
%9 = load i64, i64* %6
%10 = load i64, i64* %7
%11 = call i32 @get(i64 %9, i64 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%i%i\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3, i64* %4)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 @get(i64 %8, i64 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
int identity(int x) { return x; }


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

x86 assembly (clang, -O2):
<identity>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @identity(i32 returned %0) {
ret i32 %0
}
int isNonNegative(int x) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @isNonNegative(i32 %0) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ f3(long *);
int f3_Skel(int *argTypes, void **args) {
  f3((long *)(*args));
  return 0;
}


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

x86 assembly (clang, -O2):
<f3_Skel>:
push   %rax
mov    (%rsi),%rdi
call   1030 <f3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f3_Skel(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = load i8*, i8** %5
%7 = bitcast i8* %6 to i64*
%8 = call i32 @f3(i64* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @f3_Skel(i32* nocapture readnone %0, i8** nocapture %1) {
%3 = bitcast i8** %1 to i64**
%4 = load i64*, i64** %3
%5 = tail call i32 @f3(i64* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ mf_devicemgr_destroy();
int /*<<< orphan*/ mf_logger_close();
int /*<<< orphan*/ mf_topomgr_destroy();
int /*<<< orphan*/ stderr;
void controller_exit() {
  mf_logger_close();
  mf_topomgr_destroy();
  mf_devicemgr_destroy();
  fprintf(stderr, "\033[32m\033[1m[INFO]\033[0m\033[32m "
                  "Microflow exit"
                  "\n\033[0m");
}


x86 assembly (clang, -O0):
<controller_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <mf_logger_close@plt>
mov    $0x0,%al
call   1050 <mf_topomgr_destroy@plt>
mov    $0x0,%al
call   1040 <mf_devicemgr_destroy@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<controller_exit>:
push   %rax
xor    %eax,%eax
call   1060 <mf_logger_close@plt>
xor    %eax,%eax
call   1050 <mf_topomgr_destroy@plt>
xor    %eax,%eax
call   1040 <mf_devicemgr_destroy@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
pop    %rax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"\1B[32m\1B[1m[INFO]\1B[0m\1B[32m Microflow exit\0A\1B[0m\00"
define void @controller_exit() {
%1 = call i32 (...) @mf_logger_close()
%2 = call i32 (...) @mf_topomgr_destroy()
%3 = call i32 (...) @mf_devicemgr_destroy()
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"\1B[32m\1B[1m[INFO]\1B[0m\1B[32m Microflow exit\0A\1B[0m\00"
define void @controller_exit() {
%1 = tail call i32 (...) @mf_logger_close()
%2 = tail call i32 (...) @mf_topomgr_destroy()
%3 = tail call i32 (...) @mf_devicemgr_destroy()
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
int iidotprod(int *a, int *b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}


x86 assembly (clang, -O0):
<iidotprod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   0x4(%rdx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   0x8(%rdx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iidotprod>:
mov    (%rsi),%eax
imul   (%rdi),%eax
mov    0x4(%rsi),%ecx
imul   0x4(%rdi),%ecx
add    %eax,%ecx
mov    0x8(%rsi),%eax
imul   0x8(%rdi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @iidotprod(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %7, %10
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = mul nsw i32 %14, %17
%19 = add nsw i32 %11, %18
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i64 2
%25 = load i32, i32* %24
%26 = mul nsw i32 %22, %25
%27 = add nsw i32 %19, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @iidotprod(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %3
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, %7
%11 = add nsw i32 %10, %5
%12 = getelementptr inbounds i32, i32* %0, i64 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 2
%15 = load i32, i32* %14
%16 = mul nsw i32 %15, %13
%17 = add nsw i32 %11, %16
ret i32 %17
}
/* Type definitions */
struct crush_rule {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct crush_rule *);
void crush_destroy_rule(struct crush_rule *rule) {
  do {
    if (rule)
      free(rule);
  } while (0);
}


x86 assembly (clang, -O0):
<crush_destroy_rule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <crush_destroy_rule+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
jmp    1135 <crush_destroy_rule+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crush_destroy_rule>:
test   %rdi,%rdi
je     111a <crush_destroy_rule+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.crush_rule = type { i32 }
define void @crush_destroy_rule(%struct.crush_rule* %0) {
%2 = alloca %struct.crush_rule*
store %struct.crush_rule* %0, %struct.crush_rule** %2
br label %3
3: ; preds = %1
%4 = load %struct.crush_rule*, %struct.crush_rule** %2
%5 = icmp ne %struct.crush_rule* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load %struct.crush_rule*, %struct.crush_rule** %2
%8 = call i32 @free(%struct.crush_rule* %7)
br label %9
9: ; preds = %6, %3
br label %10
10: ; preds = %9
ret void
}

LLVM IR (-O2):
%struct.crush_rule = type { i32 }
define void @crush_destroy_rule(%struct.crush_rule* %0) {
%2 = icmp eq %struct.crush_rule* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.crush_rule* %0)
br label %5
5: ; preds = %1, %3
ret void
}
int is_uppercase(char c) { return (((c >= 'A') && (c <= 'Z')) ? 1 : 0); }


x86 assembly (clang, -O0):
<is_uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_uppercase+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_uppercase>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_uppercase(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_uppercase(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
double heaviside(z)
double z;
{
  float w = 1.0;
  if (z < 0)
    w = 0.0;
  return (w);
}


x86 assembly (clang, -O0):
<heaviside>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112c <heaviside+0x2c>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<heaviside>:
xorpd  %xmm1,%xmm1
cmpltsd %xmm1,%xmm0
movsd  0xeef(%rip),%xmm1
andnpd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @heaviside(double %0) {
%2 = alloca double
%3 = alloca float
store double %0, double* %2
store float 1.000000e+00, float* %3
%4 = load double, double* %2
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %3
br label %7
7: ; preds = %6, %1
%8 = load float, float* %3
%9 = fpext float %8 to double
ret double %9
}

LLVM IR (-O2):
define double @heaviside(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double 0.000000e+00, double 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printDash(int start, int num) {
  int i;
  for (i = 0; i < num; i++) {
    printf("-");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printDash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114b <printDash+0x3b>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <printDash+0x15>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDash>:
push   %rbx
test   %esi,%esi
jle    112f <printDash+0x1f>
mov    %esi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printDash+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printDash(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 = %12, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
store i32 %14, i32* %5
br label %6
15: ; preds = %6
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printDash(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @putchar(i32 45)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = tail call i32 @putchar(i32 10)
ret void
}
int sequence_search(int set[], int size, int target) {
  for (int i = 0; i < size; ++i) {
    if (set[i] == target) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<sequence_search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <sequence_search+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <sequence_search+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <sequence_search+0x5a>
jmp    1145 <sequence_search+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <sequence_search+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequence_search>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <sequence_search+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <sequence_search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <sequence_search+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sequence_search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
void ifx_ppa_pwm_activate_module(void) {}


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

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

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

LLVM IR (-O2):
define void @ifx_ppa_pwm_activate_module() {
ret void
}
/* Type definitions */
struct ibv_qp_attr {
  int dummy;
};
struct ibv_qp {
  int dummy;
};

/* Variables and functions */
int ibv_modify_qp(struct ibv_qp *, struct ibv_qp_attr *, int);
int mlx4_glue_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
                        int attr_mask) {
  return ibv_modify_qp(qp, attr, attr_mask);
}


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

x86 assembly (clang, -O2):
<mlx4_glue_modify_qp>:
jmp    1030 <ibv_modify_qp@plt>

LLVM IR (-O0):
%struct.ibv_qp = type { i32 }
%struct.ibv_qp_attr = type { i32 }
define i32 @mlx4_glue_modify_qp(%struct.ibv_qp* %0, %struct.ibv_qp_attr* %1, i32 %2) {
%4 = alloca %struct.ibv_qp*
%5 = alloca %struct.ibv_qp_attr*
%6 = alloca i32
store %struct.ibv_qp* %0, %struct.ibv_qp** %4
store %struct.ibv_qp_attr* %1, %struct.ibv_qp_attr** %5
store i32 %2, i32* %6
%7 = load %struct.ibv_qp*, %struct.ibv_qp** %4
%8 = load %struct.ibv_qp_attr*, %struct.ibv_qp_attr** %5
%9 = load i32, i32* %6
%10 = call i32 @ibv_modify_qp(%struct.ibv_qp* %7, %struct.ibv_qp_attr* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.ibv_qp = type { i32 }
%struct.ibv_qp_attr = type { i32 }
define i32 @mlx4_glue_modify_qp(%struct.ibv_qp* %0, %struct.ibv_qp_attr* %1, i32 %2) {
%4 = tail call i32 @ibv_modify_qp(%struct.ibv_qp* %0, %struct.ibv_qp_attr* %1, i32 %2)
ret i32 %4
}
void smp_wmb(void) { __asm__ __volatile__("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @smp_wmb() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int main(void) {
  long unsigned int s = 0;
  size_t s2 = 0;
  fprintf(stderr, "%d\n", sizeof(s));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
mov    $0x8,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0x8,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ printw(char *, char *);
int /*<<< orphan*/ refresh();
void printMessage(char *message) {
  move(22, 0);
  printw("*** %s\n", message);
  refresh();
}


x86 assembly (clang, -O0):
<printMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x16,%edi
xor    %esi,%esi
call   1050 <move@plt>
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMessage>:
push   %rbx
mov    %rdi,%rbx
mov    $0x16,%edi
xor    %esi,%esi
call   1050 <move@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printw@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <refresh@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"*** %s\0A\00"
define void @printMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @move(i32 22, i32 0)
%4 = load i8*, i8** %2
%5 = call i32 @printw(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"*** %s\0A\00"
define void @printMessage(i8* %0) {
%2 = tail call i32 @move(i32 22, i32 0)
%3 = tail call i32 @printw(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @refresh()
ret void
}
void mat4_itranslate(float m[4][4], float x, float y, float z) {
  mat4_translate(m, x, y, z, m);
}


x86 assembly (clang, -O0):
<mat4_itranslate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x8(%rbp),%rsi
mov    $0x3,%al
call   1030 <mat4_translate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4_itranslate>:
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
mov    %rdi,%rsi
mov    $0x3,%al
jmp    1030 <mat4_translate@plt>

LLVM IR (-O0):
define void @mat4_itranslate([4 x float]* %0, float %1, float %2, float %3) {
%5 = alloca [4 x float]*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store [4 x float]* %0, [4 x float]** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load [4 x float]*, [4 x float]** %5
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = load float, float* %7
%13 = fpext float %12 to double
%14 = load float, float* %8
%15 = fpext float %14 to double
%16 = load [4 x float]*, [4 x float]** %5
%17 = call i32 ([4 x float]*, double, double, double, [4 x float]*, ...) bitcast (i32 (...)* @mat4_translate to i32 ([4 x float]*, double, double, double, [4 x float]*, ...)*)([4 x float]* %9, double %11, double %13, double %15, [4 x float]* %16)
ret void
}

LLVM IR (-O2):
define void @mat4_itranslate([4 x float]* %0, float %1, float %2, float %3) {
%5 = fpext float %1 to double
%6 = fpext float %2 to double
%7 = fpext float %3 to double
%8 = tail call i32 ([4 x float]*, double, double, double, [4 x float]*, ...) bitcast (i32 (...)* @mat4_translate to i32 ([4 x float]*, double, double, double, [4 x float]*, ...)*)([4 x float]* %0, double %5, double %6, double %7, [4 x float]* %0)
ret void
}