xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ tolower(int);
char *strtolower(char *str) {
  char *s = str;
  for (; *s != '\0'; s++)
    *s = (char)tolower((int)*s);
  return str;
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <strtolower+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strtolower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strtolower+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtolower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strtolower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @tolower(i32 %7)
%9 = trunc i64 %8 to i8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void hypre_Free(char *ptr) {
  if (ptr) {
    free(ptr);
  }
}


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

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

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

LLVM IR (-O2):
define void @hypre_Free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void display(char *s) { printf("%s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @display(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_puts(char *);
void kernel(void) {
  console_puts("Ready.\r\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<kernel>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <console_puts@plt>
jmp    1120 <kernel+0x10>

x86 assembly (clang, -O2):
<kernel>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <console_puts@plt>
nopl   (%rax)
jmp    1120 <kernel+0x10>

LLVM IR (-O0):
@.str = [9 x i8] c"Ready.\0D\0A\00"
define void @kernel() {
%1 = call i32 @console_puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [9 x i8] c"Ready.\0D\0A\00"
define void @kernel() {
%1 = tail call i32 @console_puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ DoList(char *, char *);
void Nlst(char *param) { DoList(param, "-1"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"-1\00"
define void @Nlst(i8* %0) {
%2 = tail call i32 @DoList(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_52uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x52 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_52uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x52,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_52uint64_highword_reg>:
movabs $0x5200000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_52uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 82
%6 = icmp ne i64 %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_52uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 352187318272
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t option_increment(int v) {
  if (v < 5)
    return 1;
  else if (v < 115)
    return 5;
  else if (v < 1000)
    return 59;
  else
    return 1000;
}


x86 assembly (clang, -O0):
<option_increment>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    111d <option_increment+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1153 <option_increment+0x53>
cmpl   $0x73,-0x8(%rbp)
jge    1133 <option_increment+0x33>
movl   $0x5,-0x4(%rbp)
jmp    1153 <option_increment+0x53>
cmpl   $0x3e8,-0x8(%rbp)
jge    114c <option_increment+0x4c>
movl   $0x3b,-0x4(%rbp)
jmp    1153 <option_increment+0x53>
movl   $0x3e8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<option_increment>:
mov    $0x1,%eax
cmp    $0x5,%edi
jl     1127 <option_increment+0x27>
mov    $0x5,%eax
cmp    $0x73,%edi
jb     1127 <option_increment+0x27>
cmp    $0x3e8,%edi
mov    $0x3b,%ecx
mov    $0x3e8,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @option_increment(i32 %0) {
%2 = icmp slt i32 %0, 5
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 115
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 1000
%7 = select i1 %6, i32 59, i32 1000
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 1, %1 ], [ 5, %3 ], [ %7, %5 ]
ret i32 %9
}
/* Variables and functions */
int RetournerEtatBouton(int, char *);
int /*<<< orphan*/ printf(char *);
void testRetournerEtatBouton() {
  int identifiantBouton;
  char *resultat;
  int result = RetournerEtatBouton(identifiantBouton, resultat);
  if (1) {
    printf("%%TEST_FAILED%% time=0 testname=testRetournerEtatBouton "
           "(Test_gestioncommandes) message=error message sample\n");
  }
}


x86 assembly (clang, -O0):
<testRetournerEtatBouton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <RetournerEtatBouton@plt>
mov    %eax,-0x14(%rbp)
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testRetournerEtatBouton>:
push   %rax
call   1040 <RetournerEtatBouton@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [110 x i8] c"%%TEST_FAILED%% time=0 testname=testRetournerEtatBouton (Test_gestioncommandes) message=error message sample\0A\00"
define void @testRetournerEtatBouton() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = load i32, i32* %1
%5 = load i8*, i8** %2
%6 = call i32 @RetournerEtatBouton(i32 %4, i8* %5)
store i32 %6, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [110 x i8] c"%%TEST_FAILED%% time=0 testname=testRetournerEtatBouton (Test_gestioncommandes) message=error message sample\0A\00"
define void @testRetournerEtatBouton() {
%1 = tail call i32 @RetournerEtatBouton(i32 undef, i8* undef)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0))
ret void
}
indreg0imm1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((*p0) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x21,(%rax)
jg     1131 <indreg0imm1+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <indreg0imm1+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0imm1>:
xor    %eax,%eax
cmpl   $0x22,(%r8)
setl   %al
ret

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

LLVM IR (-O2):
define i32 @indreg0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 34
%9 = zext i1 %8 to i32
ret i32 %9
}
int get_log_bit(char *s, int node) {
  int j, i;
  unsigned char c;
  j = (node - 1) / 8;
  i = (node - 1) % 8;
  c = 0x80 >> i;
  c = s[j] & c;
  return c != 0;
}


x86 assembly (clang, -O0):
<get_log_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x80,%eax
sar    %cl,%eax
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movzbl -0x15(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0x15(%rbp)
movzbl -0x15(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_log_bit>:
lea    -0x1(%rsi),%ecx
add    $0x6,%esi
test   %ecx,%ecx
cmovns %ecx,%esi
sar    $0x3,%esi
and    $0x7,%cl
mov    $0x80,%edx
shr    %cl,%edx
movslq %esi,%rcx
xor    %eax,%eax
test   %dl,(%rdi,%rcx,1)
setne  %al
ret

LLVM IR (-O0):
define i32 @get_log_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = sdiv i32 %9, 8
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = srem i32 %12, 8
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = ashr i32 128, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %7
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = load i8, i8* %7
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = icmp ne i32 %28, 0
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @get_log_bit(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 8
%5 = and i32 %3, 7
%6 = lshr i32 128, %5
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = trunc i32 %6 to i8
%11 = and i8 %9, %10
%12 = icmp ne i8 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
int isascii(int c) { return !(c & 0x80); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
test   $0x80,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = lshr i32 %0, 7
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void std_out(const char *s) { write(1, s, strlen(s)); }


x86 assembly (clang, -O0):
<std_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_out>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @std_out(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ csolve_assert(int);
int foo(int *x) {
  int y;
  y = *x;
  csolve_assert(y >= 0);
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <csolve_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    (%rdi),%edi
not    %edi
shr    $0x1f,%edi
call   1030 <csolve_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @csolve_assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = xor i32 %2, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @csolve_assert(i32 %4)
ret i32 0
}
int bar(int x, int y) {
  int z = x && y;
  if (z)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1123 <bar+0x23>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1144 <bar+0x44>
movl   $0x0,-0x4(%rbp)
jmp    114b <bar+0x4b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %edi,%edi
sete   %al
test   %esi,%esi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ terminal_initialize();
void kernel_early() { terminal_initialize(); }


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

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

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

LLVM IR (-O2):
define void @kernel_early() {
%1 = tail call i32 (...) @terminal_initialize()
ret void
}
void rop3_36_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ T;
  stk2 = *D ^ S;
  stk1 = stk1 & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_36_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_36_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
xor    %sil,%cl
mov    %edx,%eax
not    %al
and    %sil,%al
and    %cl,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_36_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %8
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %8
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %7
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = load i8, i8* %5
%31 = zext i8 %30 to i32
%32 = and i32 %29, %31
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = or i32 %32, %38
%40 = load i8, i8* %6
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = xor i32 %43, -1
%45 = and i32 %41, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = and i32 %45, %48
%50 = or i32 %39, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
store i8 %51, i8* %52
ret void
}

LLVM IR (-O2):
define void @rop3_36_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %2, -1
%7 = and i8 %6, %1
%8 = and i8 %7, %5
%9 = xor i8 %1, -1
%10 = and i8 %9, %2
%11 = and i8 %10, %4
%12 = or i8 %8, %11
store i8 %12, i8* %0
ret void
}
void fillrow(int *blk, int val) {
  blk[0] = blk[1] = blk[2] = blk[3] = blk[4] = blk[5] = blk[6] = blk[7] = val;
}


x86 assembly (clang, -O0):
<fillrow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillrow>:
movd   %esi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqu %xmm0,0x10(%rdi)
movdqu %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @fillrow(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = insertelement <4 x i32> poison, i32 %1, i64 0
%5 = shufflevector <4 x i32> %4, <4 x i32> poison, <4 x i32> zeroinitializer
%6 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
%7 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %7
ret void
}
/* Variables and functions */
int rand();
void populateRandomArray(int *A, int size) {
  int max = 100;
  for (int j = 0; j < size; j++) {
    *(A + j) = (rand() % (max + 1));
  }
}


x86 assembly (clang, -O0):
<populateRandomArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x64,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <populateRandomArray+0x52>
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <populateRandomArray+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<populateRandomArray>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    115f <populateRandomArray+0x4f>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x288df0cb,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x65,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <populateRandomArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @populateRandomArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 100, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = call i32 (...) @rand()
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = srem i32 %12, %14
%16 = load i32*, i32** %3
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %11
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %7
23: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @populateRandomArray(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 101
%11 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %10, i32* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ binderfs_stress(struct __test_metadata *);
void wrapper_binderfs_stress(struct __test_metadata *_metadata,
                             struct __fixture_variant_metadata *variant) {
  binderfs_stress(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_binderfs_stress>:
jmp    1030 <binderfs_stress@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_binderfs_stress(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @binderfs_stress(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_binderfs_stress(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @binderfs_stress(%struct.__test_metadata* %0)
ret void
}
int builtin_cd(int argc, const char **argv, char **env) {}


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

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

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

LLVM IR (-O2):
define i32 @builtin_cd(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ k_yield();
int sched_yield(void) {
  k_yield();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @sched_yield() {
%1 = call i32 (...) @k_yield()
ret i32 0
}

LLVM IR (-O2):
define i32 @sched_yield() {
%1 = tail call i32 (...) @k_yield()
ret i32 0
}
void rsn_preauth_scan_results(struct wpa_sm *sm,
                              struct wpa_scan_result *results, int count) {}


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

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

LLVM IR (-O0):
%struct.wpa_sm = type opaque
%struct.wpa_scan_result = type opaque
define void @rsn_preauth_scan_results(%struct.wpa_sm* %0, %struct.wpa_scan_result* %1, i32 %2) {
%4 = alloca %struct.wpa_sm*
%5 = alloca %struct.wpa_scan_result*
%6 = alloca i32
store %struct.wpa_sm* %0, %struct.wpa_sm** %4
store %struct.wpa_scan_result* %1, %struct.wpa_scan_result** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.wpa_sm = type opaque
%struct.wpa_scan_result = type opaque
define void @rsn_preauth_scan_results(%struct.wpa_sm* nocapture %0, %struct.wpa_scan_result* nocapture %1, i32 %2) {
ret void
}
double sun_delta_gpstime(int week2, double tow2, int week1, double tow1) {
  int delta_week = week2 - week1;
  double delta_tow = tow2 - tow1;
  return (double)(delta_week * (7 * (60 * 60 * 24))) + delta_tow;
}


x86 assembly (clang, -O0):
<sun_delta_gpstime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
imul   $0x93a80,-0x24(%rbp),%eax
cvtsi2sd %eax,%xmm0
addsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sun_delta_gpstime>:
sub    %esi,%edi
subsd  %xmm1,%xmm0
imul   $0x93a80,%edi,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sun_delta_gpstime(i32 %0, double %1, i32 %2, double %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store i32 %2, i32* %7
store double %3, double* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load double, double* %6
%15 = load double, double* %8
%16 = fsub double %14, %15
store double %16, double* %10
%17 = load i32, i32* %9
%18 = mul nsw i32 %17, 604800
%19 = sitofp i32 %18 to double
%20 = load double, double* %10
%21 = fadd double %19, %20
ret double %21
}

LLVM IR (-O2):
define double @sun_delta_gpstime(i32 %0, double %1, i32 %2, double %3) {
%5 = sub nsw i32 %0, %2
%6 = fsub double %1, %3
%7 = mul nsw i32 %5, 604800
%8 = sitofp i32 %7 to double
%9 = fadd double %6, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_NoTypeSpecifiedForForeignHandlerParameter(long p_position) {
  _Error(p_position, "Foreign handler parameters must be typed");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Foreign handler parameters must be typed\00"
define void @Error_NoTypeSpecifiedForForeignHandlerParameter(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Foreign handler parameters must be typed\00"
define void @Error_NoTypeSpecifiedForForeignHandlerParameter(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned xrop3_103_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | S;
  stk3 = ~stk3;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_103_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_103_0_0>:
shl    $0x8,%esi
lea    (%rsi,%rdi,1),%eax
shl    $0x8,%edi
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_103_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %5
%29 = load i32, i32* %10
%30 = or i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_103_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %3
%8 = xor i32 %7, -1
%9 = or i32 %4, %8
ret i32 %9
}
int execute_readlinkat() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_readlinkat() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  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 = [14 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 ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @fset_mouse_end() {
ret void
}
__attribute((always_)) or (float a) { return a; }


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

x86 assembly (clang, -O2):
<or>:
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @or(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @or(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}
void emptyControlFunction(void *d, unsigned char uc) {}


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

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

LLVM IR (-O0):
define void @emptyControlFunction(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
ret void
}

LLVM IR (-O2):
define void @emptyControlFunction(i8* nocapture %0, i8 zeroext %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 10; i++)
    ;
  printf("%i\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1143 <main+0x33>
jmp    1135 <main+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xeb3(%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
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
void ringbuffer_print(struct ringbuffer *ring_buf, unsigned int cnt) { return; }


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

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

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

LLVM IR (-O2):
%struct.ringbuffer = type opaque
define void @ringbuffer_print(%struct.ringbuffer* nocapture %0, i32 %1) {
ret void
}
double sqr(double *args) { return args[0] * args[0]; }


x86 assembly (clang, -O0):
<sqr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqr>:
movsd  (%rdi),%xmm0
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @sqr(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fmul double %5, %8
ret double %9
}

LLVM IR (-O2):
define double @sqr(double* nocapture %0) {
%2 = load double, double* %0
%3 = fmul double %2, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ memory_free(void *, char *, int);
void var_element_free(void *elem) {
  memory_free((elem),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/nakal/qubs/refs/heads/master/qubs.c",
              472);
}


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

x86 assembly (clang, -O2):
<var_element_free>:
lea    0xee9(%rip),%rsi
mov    $0x1d8,%edx
jmp    1030 <memory_free@plt>

LLVM IR (-O0):
@.str = [126 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nakal/qubs/refs/heads/master/qubs.c\00"
define void @var_element_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memory_free(i8* %3, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str, i64 0, i64 0), i32 472)
ret void
}

LLVM IR (-O2):
@.str = [126 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nakal/qubs/refs/heads/master/qubs.c\00"
define void @var_element_free(i8* %0) {
%2 = tail call i32 @memory_free(i8* %0, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str, i64 0, i64 0), i32 472)
ret void
}
void f4() {
  typedef int __attribute__((__mode__(__SI__))) si_int_type;
  si_int_type si_int;
  __sync_bool_compare_and_swap(&si_int, (si_int_type)0, (si_int_type)1);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    $0x1,%ecx
lock cmpxchg %ecx,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    $0x1,%ecx
xor    %eax,%eax
lock cmpxchg %ecx,-0x4(%rsp)
ret

LLVM IR (-O0):
define void @f4() {
%1 = alloca i32
%2 = cmpxchg i32* %1, i32 0, i32 1 seq_cst seq_cst
%3 = extractvalue { i32, i1 } %2, 1
ret void
}

LLVM IR (-O2):
define void @f4() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = cmpxchg i32* %1, i32 0, i32 1 seq_cst seq_cst
ret void
}
void nseel_asm_1pdd_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_1pdd_end() {
ret void
}
/* Variables and functions */
int asin(double);
int /*<<< orphan*/ print(int);
int /*<<< orphan*/ printid(int);
int rand();
int round(double);
void main() {
  int i;
  print(asin(.5));
  print(rand());
  printid(i);
  print(i = round(3.14));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xea8(%rip),%xmm0
call   1050 <asin@plt>
mov    %eax,%edi
call   1030 <print@plt>
mov    $0x0,%al
call   1070 <rand@plt>
mov    %eax,%edi
call   1030 <print@plt>
mov    -0x4(%rbp),%edi
call   1040 <printid@plt>
movsd  0xe76(%rip),%xmm0
call   1060 <round@plt>
mov    %eax,%edi
mov    %edi,-0x4(%rbp)
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xea7(%rip),%xmm0
call   1050 <asin@plt>
mov    %eax,%edi
call   1030 <print@plt>
xor    %eax,%eax
call   1070 <rand@plt>
mov    %eax,%edi
call   1030 <print@plt>
call   1040 <printid@plt>
movsd  0xe88(%rip),%xmm0
call   1060 <round@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <print@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = call i32 @asin(double 5.000000e-01)
%3 = call i32 @print(i32 %2)
%4 = call i32 (...) @rand()
%5 = call i32 @print(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @printid(i32 %6)
%8 = call i32 @round(double 3.140000e+00)
store i32 %8, i32* %1
%9 = call i32 @print(i32 %8)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @asin(double 5.000000e-01)
%2 = tail call i32 @print(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = tail call i32 @print(i32 %3)
%5 = tail call i32 @printid(i32 undef)
%6 = tail call i32 @round(double 3.140000e+00)
%7 = tail call i32 @print(i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
__m128 __attribute__((__always___, __nodebug__)) _mm_castpd_ps(__m128d in) {
  return (__m128)in;
}


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

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

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

LLVM IR (-O2):
define i32 @_mm_castpd_ps(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ matNd_copy(double *, double const *, int const);
int /*<<< orphan*/ matNd_transpose(double *, int const);
void matNd_transpose_new(double dest[], const double src[], const int n) {
  matNd_copy(dest, src, n);
  matNd_transpose(dest, n);
}


x86 assembly (clang, -O0):
<matNd_transpose_new>:
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 <matNd_copy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <matNd_transpose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matNd_transpose_new>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <matNd_copy@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <matNd_transpose@plt>

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

LLVM IR (-O2):
define void @matNd_transpose_new(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @matNd_copy(double* %0, double* %1, i32 %2)
%5 = tail call i32 @matNd_transpose(double* %0, i32 %2)
ret void
}