xunge/DecIR huggingface dataset:
/* Variables and functions */
double song_command(double, double, double, double, int);
double modipulategml_song_effect_command(double songid, double ch, double cmd,
                                         double val) {
  return song_command(songid, ch, cmd, val, 1);
}


x86 assembly (clang, -O0):
<modipulategml_song_effect_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mov    $0x1,%edi
call   1030 <song_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modipulategml_song_effect_command>:
mov    $0x1,%edi
jmp    1030 <song_command@plt>

LLVM IR (-O0):
define double @modipulategml_song_effect_command(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @song_command(double %9, double %10, double %11, double %12, i32 1)
ret double %13
}

LLVM IR (-O2):
define double @modipulategml_song_effect_command(double %0, double %1, double %2, double %3) {
%5 = tail call double @song_command(double %0, double %1, double %2, double %3, i32 1)
ret double %5
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t rdtsc() {
  uint64_t tsc;
  asm volatile("rdtsc" : "=A"(tsc));
  return tsc;
}


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

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

LLVM IR (-O0):
define i8* @rdtsc() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @rdtsc() {
%1 = tail call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
int lt_int(const void *a, const void *b) {
  return (*(const int *)a < *(const int *)b);
}


x86 assembly (clang, -O0):
<lt_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @lt_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp slt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @lt_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int main() {
  int a = 10;
  int b = 0;
  do {
    a = 1;
  } while (b < 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x14,-0xc(%rbp)
jl     1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %5, %0
store i32 1, i32* %2
br label %5
5: ; preds = %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 20
br i1 %7, label %4, label %8
8: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
void glPointParameterf(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glPointParameterf() {
ret void
}
void g_closure_set_meta_marshal() {}


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

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

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

LLVM IR (-O2):
define void @g_closure_set_meta_marshal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_ncurses();
int /*<<< orphan*/ main_menu();
int /*<<< orphan*/ setup_ncurses();
int main(int argc, char *argv[]) {
  setup_ncurses();
  main_menu();
  cleanup_ncurses();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <setup_ncurses@plt>
mov    $0x0,%al
call   1040 <main_menu@plt>
mov    $0x0,%al
call   1050 <cleanup_ncurses@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @setup_ncurses()
%7 = call i32 (...) @main_menu()
%8 = call i32 (...) @cleanup_ncurses()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @setup_ncurses()
%4 = tail call i32 (...) @main_menu()
%5 = tail call i32 (...) @cleanup_ncurses()
ret i32 0
}
void test_donner_valeur_carte() {}


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

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

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

LLVM IR (-O2):
define void @test_donner_valeur_carte() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
void bufferAccessOutOfBounds_libraryDirectionConfiguration(void) {
  char arr[10];
  char c = 'A';
  (void)isdigit(c);
  arr[c] = 'x';
}


x86 assembly (clang, -O0):
<bufferAccessOutOfBounds_libraryDirectionConfiguration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x41,-0xb(%rbp)
movsbl -0xb(%rbp),%edi
call   1030 <isdigit@plt>
movsbq -0xb(%rbp),%rax
movb   $0x78,-0xa(%rbp,%rax,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufferAccessOutOfBounds_libraryDirectionConfiguration>:
mov    $0x41,%edi
jmp    1030 <isdigit@plt>

LLVM IR (-O0):
define void @bufferAccessOutOfBounds_libraryDirectionConfiguration() {
%1 = alloca [10 x i8]
%2 = alloca i8
store i8 65, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @isdigit(i8 signext %3)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i64
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %6
store i8 120, i8* %7
ret void
}

LLVM IR (-O2):
define void @bufferAccessOutOfBounds_libraryDirectionConfiguration() {
%1 = tail call i32 @isdigit(i8 signext 65)
ret void
}
int comparar(const void *a, const void *b) {
  double diff = *(double *)a - *(double *)b;
  if (diff < 0) {
    return 1;
  } else if (diff > 0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<comparar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    113b <comparar+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1160 <comparar+0x60>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1159 <comparar+0x59>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <comparar+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparar>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
neg    %ecx
ucomisd %xmm0,%xmm1
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comparar(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
%13 = fsub double %9, %12
store double %13, double* %6
%14 = load double, double* %6
%15 = fcmp olt double %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %22
17: ; preds = %2
%18 = load double, double* %6
%19 = fcmp ogt double %18, 0.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 -1, i32* %3
br label %22
21: ; preds = %17
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %16
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @comparar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = fcmp olt double %7, 0.000000e+00
%9 = fcmp ogt double %7, 0.000000e+00
%10 = sext i1 %9 to i32
%11 = select i1 %8, i32 1, i32 %10
ret i32 %11
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int);
int mid_freq(void) { return syscall(295, 0, 1); }


x86 assembly (clang, -O0):
<mid_freq>:
push   %rbp
mov    %rsp,%rbp
mov    $0x127,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mid_freq>:
mov    $0x127,%edi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @mid_freq() {
%1 = call i32 @syscall(i32 295, i32 0, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mid_freq() {
%1 = tail call i32 @syscall(i32 295, i32 0, i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf(" hello world \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 = [15 x i8] c" hello world \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c" hello world \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int expect(int wanted, int got) {
  if (wanted == got) {
    return 1;
  } else {
    printf("Wanted %i, got %i\n", wanted, got);
    return 0;
  }
}


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

x86 assembly (clang, -O2):
<expect>:
mov    %esi,%edx
mov    $0x1,%eax
cmp    %esi,%edi
je     1130 <expect+0x20>
push   %rax
mov    %edi,%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Wanted %i, got %i\0A\00"
define i32 @expect(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %7
}
/* Type definitions */
struct event_base {
  int dummy;
};
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
int /*<<< orphan*/ event_base_loopbreak(struct event_base *);
void signal_cb(evutil_socket_t sig, short events, void *user_data) {
  struct event_base *base = user_data;
  event_base_loopbreak(base);
}


x86 assembly (clang, -O0):
<signal_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <event_base_loopbreak@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_cb>:
mov    %rdx,%rdi
jmp    1030 <event_base_loopbreak@plt>

LLVM IR (-O0):
%struct.event_base = type { i32 }
define void @signal_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.event_base*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to %struct.event_base*
store %struct.event_base* %9, %struct.event_base** %7
%10 = load %struct.event_base*, %struct.event_base** %7
%11 = call i32 @event_base_loopbreak(%struct.event_base* %10)
ret void
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
define void @signal_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.event_base*
%5 = tail call i32 @event_base_loopbreak(%struct.event_base* %4)
ret void
}
unsigned int nr_free_highpages(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @nr_free_highpages() {
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ *openFile(char const *, char *);
FILE *openFileForReading(const char *file) { return openFile(file, "r"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32* @openFileForReading(i8* %0) {
%2 = tail call i32* @openFile(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
int ctoi(char c) { return (c >= 'A' && c <= 'F') ? c - 'A' + 10 : c - '0'; }


x86 assembly (clang, -O0):
<ctoi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <ctoi+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
jg     1136 <ctoi+0x36>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <ctoi+0x40>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctoi>:
lea    -0x41(%rdi),%ecx
lea    -0x30(%rdi),%edx
lea    -0x37(%rdi),%eax
cmp    $0x6,%cl
cmovae %edx,%eax
ret

LLVM IR (-O0):
define i32 @ctoi(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 %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 70
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 65
%14 = add nsw i32 %13, 10
br label %19
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 48
br label %19
19: ; preds = %15, %10
%20 = phi i32 [ %14, %10 ], [ %18, %15 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @ctoi(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 6
%5 = select i1 %4, i32 -55, i32 -48
%6 = add nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
size_t os_get_data_directory(char *, size_t);
size_t lovrFilesystemGetAppdataDirectory(char *buffer, size_t size) {
  return os_get_data_directory(buffer, size);
}


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

x86 assembly (clang, -O2):
<lovrFilesystemGetAppdataDirectory>:
jmp    1030 <os_get_data_directory@plt>

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

LLVM IR (-O2):
define i64 @lovrFilesystemGetAppdataDirectory(i8* %0, i64 %1) {
%3 = tail call i64 @os_get_data_directory(i8* %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_common_help(void) {
  printf("Considerations for common errors:\n");
  printf("- Ensure that the intel_rapl kernel module is loaded\n");
  printf("- Ensure that you run with administrative (super-user) privileges\n");
  printf("- Resetting a zone energy counter is an optional powercap feature "
         "and may not be supported by RAPL\n");
}


x86 assembly (clang, -O0):
<print_common_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
call   1030 <printf@plt>
lea    0xf26(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5d(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_common_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Considerations for common errors:\0A\00"
@.str.1 = [54 x i8] c"- Ensure that the intel_rapl kernel module is loaded\0A\00"
@.str.2 = [67 x i8] c"- Ensure that you run with administrative (super-user) privileges\0A\00"
@.str.3 = [100 x i8] c"- Resetting a zone energy counter is an optional powercap feature and may not be supported by RAPL\0A\00"
define void @print_common_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"Considerations for common errors:\00"
@str.4 = [53 x i8] c"- Ensure that the intel_rapl kernel module is loaded\00"
@str.5 = [66 x i8] c"- Ensure that you run with administrative (super-user) privileges\00"
@str.6 = [99 x i8] c"- Resetting a zone energy counter is an optional powercap feature and may not be supported by RAPL\00"
define void @print_common_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @str.6, i64 0, i64 0))
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  {
    state[0UL] = (input[0UL] + 914778474UL) * 2674260758U;
    if (state[0UL] & 1U) {
      state[0UL] += state[0UL];
    } else {
      state[0UL] += state[0UL];
    }
    output[0UL] = (state[0UL] + 690137161UL) + 3876026213U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x3686696a,%rax
movabs $0x9f65fb16,%rcx
imul   %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1146 <RandomFunc+0x46>
mov    -0x14(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114f <RandomFunc+0x4f>
mov    -0x14(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2922a849,%rax
movabs $0xe7077765,%rcx
add    %rcx,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
imul   $0x3ecbf62c,(%rdi),%eax
add    $0xdb9e19e6,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = zext i32 %8 to i64
%10 = add i64 %9, 914778474
%11 = mul i64 %10, 2674260758
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %12, i32* %13
%14 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%15 = load i32, i32* %14
%16 = and i32 %15, 1
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%20 = load i32, i32* %19
%21 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%22 = load i32, i32* %21
%23 = add i32 %22, %20
store i32 %23, i32* %21
br label %30
24: ; preds = %2
%25 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%26 = load i32, i32* %25
%27 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%28 = load i32, i32* %27
%29 = add i32 %28, %26
store i32 %29, i32* %27
br label %30
30: ; preds = %24, %18
%31 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%32 = load i32, i32* %31
%33 = zext i32 %32 to i64
%34 = add i64 %33, 690137161
%35 = add i64 %34, 3876026213
%36 = trunc i64 %35 to i32
%37 = load i32*, i32** %4
%38 = getelementptr inbounds i32, i32* %37, i64 0
store i32 %36, i32* %38
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = mul i32 %3, 1053554220
%5 = add i32 %4, -610395674
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
void *memalign(int, size_t);
void *_FAT_mem_allocate(size_t size) { return memalign(32, size); }


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

x86 assembly (clang, -O2):
<_FAT_mem_allocate>:
mov    %rdi,%rsi
mov    $0x20,%edi
jmp    1030 <memalign@plt>

LLVM IR (-O0):
define i8* @_FAT_mem_allocate(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @memalign(i32 32, i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @_FAT_mem_allocate(i64 %0) {
%2 = tail call align 32 i8* @memalign(i32 32, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf_skip(char *, char const *);
int stress_rdrand_supported(const char *name) {
  pr_inf_skip("%s stressor will be skipped, CPU "
              "does not support the rdrand instruction.\n",
              name);
  return -1;
}


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

x86 assembly (clang, -O2):
<stress_rdrand_supported>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <pr_inf_skip@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [75 x i8] c"%s stressor will be skipped, CPU does not support the rdrand instruction.\0A\00"
define i32 @stress_rdrand_supported(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pr_inf_skip(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}

LLVM IR (-O2):
@.str = [75 x i8] c"%s stressor will be skipped, CPU does not support the rdrand instruction.\0A\00"
define i32 @stress_rdrand_supported(i8* %0) {
%2 = tail call i32 @pr_inf_skip(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
scalar_t__ pthread_self();
void *work() {
  pthread_t tid;
  tid = pthread_self();
  printf("tid = %ld\n", (long)tid);
}


x86 assembly (clang, -O0):
<work>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<work>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"tid = %ld\0A\00"
define noalias i8* @work() {
%1 = tail call i64 (...) @pthread_self()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i8* undef
}
/* Variables and functions */
char *strchr(char const *, int);
char *CString_strchr(const char *a, int b) { return strchr(a, b); }


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

x86 assembly (clang, -O2):
<CString_strchr>:
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i8* @CString_strchr(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 = call i8* @strchr(i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @CString_strchr(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
double rglmut_gv_scale(const int v) {
  return (double)0.00765625 * (double)v + (double)0.5;
}


x86 assembly (clang, -O0):
<rglmut_gv_scale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rglmut_gv_scale>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @rglmut_gv_scale(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call double @llvm.fmuladd.f64(double 7.656250e-03, double %4, double 5.000000e-01)
ret double %5
}

LLVM IR (-O2):
define double @rglmut_gv_scale(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 7.656250e-03, double 5.000000e-01)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;

/* Variables and functions */
void *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
int /*<<< orphan*/ nomem();
void *emalloc(int sz) {
  void *p;
  if (!(p = malloc((u_int)sz)))
    nomem();
  memset(p, 0, sz);
  return (p);
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1158 <emalloc+0x28>
mov    $0x0,%al
call   1040 <nomem@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1149 <emalloc+0x19>
xor    %eax,%eax
call   1040 <nomem@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @emalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @nomem()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
ret i8* %2
}
/* Variables and functions */
double cosh(double);
double intr_wrap_037(double p1) { return cosh(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_037>:
jmp    1030 <cosh@plt>

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

LLVM IR (-O2):
define double @intr_wrap_037(double %0) {
%2 = tail call double @cosh(double %0)
ret double %2
}
int hammingWeight(n) {
  int count = 0;
  while (n) {
    count += n % 2;
    n = n / 2;
  }
  return count;
}


x86 assembly (clang, -O0):
<hammingWeight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <hammingWeight+0x3c>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <hammingWeight+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammingWeight>:
xor    %eax,%eax
test   %edi,%edi
je     112c <hammingWeight+0x2c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    $0x1f,%ecx
add    %edi,%ecx
mov    %ecx,%edx
and    $0xfffffffe,%edx
mov    %edi,%esi
sub    %edx,%esi
add    %esi,%eax
sar    %ecx
add    $0x1,%edi
cmp    $0x2,%edi
mov    %ecx,%edi
ja     1110 <hammingWeight+0x10>
ret

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

LLVM IR (-O2):
define i32 @hammingWeight(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 2
%7 = add nsw i32 %4, %6
%8 = sdiv i32 %5, 2
%9 = add i32 %5, 1
%10 = icmp ult i32 %9, 3
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
int test_imm_C9int32_reg(int val) { return ((val) & (0xC9 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_C9int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xc9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C9int32_reg>:
test   $0xc9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C9int32_reg(i32 %0) {
%2 = and i32 %0, 201
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void take_back(char memory[1024], int helper[1024], int location) {}


x86 assembly (clang, -O0):
<take_back>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @take_back(i8* nocapture %0, i32* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ progerror(char *);
void NotEnoughCore(void) { progerror("Not enough core"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Not enough core\00"
define void @NotEnoughCore() {
%1 = call i32 @progerror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Not enough core\00"
define void @NotEnoughCore() {
%1 = tail call i32 @progerror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
void OCSP_SIGNATURE_free(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_SIGNATURE_free() {
ret void
}
void uc(unsigned char *p, double x) { *p = x; }


x86 assembly (clang, -O0):
<uc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc>:
cvttsd2si %xmm0,%eax
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @uc(i8* nocapture writeonly %0, double %1) {
%3 = fptoui double %1 to i8
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_cmovb_imm(int, int);
int /*<<< orphan*/ emit_cmpimm(int, int);
int /*<<< orphan*/ emit_movimm(int /*<<< orphan*/, int);
int /*<<< orphan*/ emit_zeroreg(int);
void emit_sltiu32(int rs, int imm, int rt) {
  if (rs != rt)
    emit_zeroreg(rt);
  emit_cmpimm(rs, imm);
  if (rs == rt)
    emit_movimm(0, rt);
  emit_cmovb_imm(1, rt);
}


x86 assembly (clang, -O0):
<emit_sltiu32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1165 <emit_sltiu32+0x25>
mov    -0xc(%rbp),%edi
call   1030 <emit_zeroreg@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <emit_cmpimm@plt>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1186 <emit_sltiu32+0x46>
mov    -0xc(%rbp),%esi
xor    %edi,%edi
call   1060 <emit_movimm@plt>
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1050 <emit_cmovb_imm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_sltiu32>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
cmp    %edx,%edi
jne    1164 <emit_sltiu32+0x24>
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <emit_cmpimm@plt>
xor    %edi,%edi
mov    %ebp,%esi
call   1060 <emit_movimm@plt>
jmp    1175 <emit_sltiu32+0x35>
mov    %ebx,%edi
call   1030 <emit_zeroreg@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <emit_cmpimm@plt>
mov    $0x1,%edi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <emit_cmovb_imm@plt>

LLVM IR (-O0):
define void @emit_sltiu32(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %6
%12 = call i32 @emit_zeroreg(i32 %11)
br label %13
13: ; preds = %10, %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @emit_cmpimm(i32 %14, i32 %15)
%17 = load i32, i32* %4
%18 = load i32, i32* %6
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %13
%21 = load i32, i32* %6
%22 = call i32 @emit_movimm(i32 0, i32 %21)
br label %23
23: ; preds = %20, %13
%24 = load i32, i32* %6
%25 = call i32 @emit_cmovb_imm(i32 1, i32 %24)
ret void
}

LLVM IR (-O2):
define void @emit_sltiu32(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, %2
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @emit_zeroreg(i32 %2)
%7 = tail call i32 @emit_cmpimm(i32 %0, i32 %1)
br label %11
8: ; preds = %3
%9 = tail call i32 @emit_cmpimm(i32 %0, i32 %1)
%10 = tail call i32 @emit_movimm(i32 0, i32 %0)
br label %11
11: ; preds = %5, %8
%12 = tail call i32 @emit_cmovb_imm(i32 1, i32 %2)
ret void
}
int test_imm_CEuint32_mem(unsigned int *val) {
  return ((*val) & (0xCE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CEuint32_mem>:
testb  $0xce,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CEuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 206
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int security_bdflush(int func, long data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @security_bdflush(i32 %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int _pcicfgwrite(int, int, int, int, int, unsigned long);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_pcicfgwrite(int interface, int bus, int dev, int func, int reg,
                    unsigned long val) {
  int retval;
  monLock();
  retval = _pcicfgwrite(interface, bus, dev, func, reg, val);
  monUnlock();
  return (retval);
}


x86 assembly (clang, -O0):
<mon_pcicfgwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
call   1050 <_pcicfgwrite@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_pcicfgwrite>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14,%r9
call   1050 <_pcicfgwrite@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_pcicfgwrite(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i64 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i64 %5, i64* %12
%14 = call i32 (...) @monLock()
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i64, i64* %12
%21 = call i32 @_pcicfgwrite(i32 %15, i32 %16, i32 %17, i32 %18, i32 %19, i64 %20)
store i32 %21, i32* %13
%22 = call i32 (...) @monUnlock()
%23 = load i32, i32* %13
ret i32 %23
}

LLVM IR (-O2):
define i32 @mon_pcicfgwrite(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i64 %5) {
%7 = tail call i32 (...) @monLock()
%8 = tail call i32 @_pcicfgwrite(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i64 %5)
%9 = tail call i32 (...) @monUnlock()
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ quatf_rotateAxis_new(float *, float, float const,
                                        float const, float const);
void quatf_rotateAxisVec_new(float quat[4], float degrees,
                             const float axis[3]) {
  quatf_rotateAxis_new(quat, degrees, axis[0], axis[1], axis[2]);
}


x86 assembly (clang, -O0):
<quatf_rotateAxisVec_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm2
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm3
call   1030 <quatf_rotateAxis_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quatf_rotateAxisVec_new>:
movss  (%rsi),%xmm1
movss  0x4(%rsi),%xmm2
movss  0x8(%rsi),%xmm3
jmp    1030 <quatf_rotateAxis_new@plt>

LLVM IR (-O0):
define void @quatf_rotateAxisVec_new(float* %0, float %1, float* %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float*
store float* %0, float** %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float, float* %5
%9 = load float*, float** %6
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
%12 = load float*, float** %6
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = load float*, float** %6
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = call i32 @quatf_rotateAxis_new(float* %7, float %8, float %11, float %14, float %17)
ret void
}

LLVM IR (-O2):
define void @quatf_rotateAxisVec_new(float* %0, float %1, float* nocapture %2) {
%4 = load float, float* %2
%5 = getelementptr inbounds float, float* %2, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %2, i64 2
%8 = load float, float* %7
%9 = tail call i32 @quatf_rotateAxis_new(float* %0, float %1, float %4, float %6, float %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ use(int *);
void test_small() {
  int a[] = {1, 2, 3, 4};
  use(a);
}


x86 assembly (clang, -O0):
<test_small>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <use@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_small>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <use@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_small.a = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
define void @test_small() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @use(i32* %3)
ret void
}

LLVM IR (-O2):
@__const.test_small.a = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
define void @test_small() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @use(i32* %3)
ret void
}
float _nonz_max(float oldval, float newval) {
  if (newval != 0.f && (oldval == 0.f || newval > oldval))
    return (newval);
  else
    return (oldval);
}


x86 assembly (clang, -O0):
<_nonz_max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112a <_nonz_max+0x2a>
jp     112a <_nonz_max+0x2a>
jmp    1164 <_nonz_max+0x64>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1146 <_nonz_max+0x46>
jp     1146 <_nonz_max+0x46>
jmp    1155 <_nonz_max+0x55>
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1164 <_nonz_max+0x64>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116e <_nonz_max+0x6e>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nonz_max>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jne    110a <_nonz_max+0xa>
jnp    1116 <_nonz_max+0x16>
ucomiss %xmm2,%xmm0
jne    1111 <_nonz_max+0x11>
jnp    1119 <_nonz_max+0x19>
ucomiss %xmm0,%xmm1
ja     1119 <_nonz_max+0x19>
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @_nonz_max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp une float %6, 0.000000e+00
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load float, float* %4
%10 = fcmp oeq float %9, 0.000000e+00
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = load float, float* %5
%13 = load float, float* %4
%14 = fcmp ogt float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11, %8
%16 = load float, float* %5
store float %16, float* %3
br label %19
17: ; preds = %11, %2
%18 = load float, float* %4
store float %18, float* %3
br label %19
19: ; preds = %17, %15
%20 = load float, float* %3
ret float %20
}

LLVM IR (-O2):
define float @_nonz_max(float %0, float %1) {
%3 = fcmp une float %1, 0.000000e+00
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = fcmp oeq float %0, 0.000000e+00
%6 = fcmp ogt float %1, %0
%7 = or i1 %5, %6
br i1 %7, label %9, label %8
8: ; preds = %4, %2
br label %9
9: ; preds = %4, %8
%10 = phi float [ %0, %8 ], [ %1, %4 ]
ret float %10
}