xunge/DecIR huggingface dataset:
/* Variables and functions */
double det4i5(double *, int, int, int, int, int);
int idet4i5(double *vertex, int v1, int v2, int v3, int v4, int v5) {
  double d = det4i5(vertex, v1, v2, v3, v4, v5);
  if (d > 0.0)
    return +1;
  else if (d < 0.0)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<idet4i5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <det4i5@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    116a <idet4i5+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    118b <idet4i5+0x7b>
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    1184 <idet4i5+0x74>
movl   $0xffffffff,-0x4(%rbp)
jmp    118b <idet4i5+0x7b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idet4i5>:
push   %rax
call   1030 <det4i5@plt>
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @idet4i5(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
store double* %0, double** %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
%15 = load double*, double** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = call double @det4i5(double* %15, i32 %16, i32 %17, i32 %18, i32 %19, i32 %20)
store double %21, double* %14
%22 = load double, double* %14
%23 = fcmp ogt double %22, 0.000000e+00
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %30
25: ; preds = %6
%26 = load double, double* %14
%27 = fcmp olt double %26, 0.000000e+00
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 -1, i32* %7
br label %30
29: ; preds = %25
store i32 0, i32* %7
br label %30
30: ; preds = %29, %28, %24
%31 = load i32, i32* %7
ret i32 %31
}

LLVM IR (-O2):
define i32 @idet4i5(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call double @det4i5(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = fcmp ogt double %7, 0.000000e+00
%9 = fcmp olt 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 */
char EOF;
int char_int(char *in) {
  int temp = 0, cnt = 0;
  do {
    temp *= 10;
    temp += (in[cnt] - 48);
    cnt += 1;
  } while (in[cnt] != EOF);
  return temp;
}


x86 assembly (clang, -O0):
<char_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    0x2e9a(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1116 <char_int+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_int>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%cl
mov    (%rdi),%dl
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movsbl %dl,%edx
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%edx
add    $0x1,%rdi
cmp    %cl,%dl
jne    1120 <char_int+0x20>
ret

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @char_int(i8* nocapture %0) {
%2 = load i8, i8* @EOF
%3 = load i8, i8* %0
br label %4
4: ; preds = %4, %1
%5 = phi i8 [ %14, %4 ], [ %3, %1 ]
%6 = phi i64 [ %12, %4 ], [ 0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = mul nsw i32 %7, 10
%9 = sext i8 %5 to i32
%10 = add i32 %8, -48
%11 = add i32 %10, %9
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, %2
br i1 %15, label %16, label %4
16: ; preds = %4
ret i32 %11
}
int do_015() { return 15; }


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

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

LLVM IR (-O0):
define i32 @do_015() {
ret i32 15
}

LLVM IR (-O2):
define i32 @do_015() {
ret i32 15
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void lista_menu(void) {
  puts("Banco Eletronico");
  puts("1 - Creditar");
  puts("2 - Debitar");
  puts("3 - Sair");
}


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

x86 assembly (clang, -O2):
<lista_menu>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Banco Eletronico\00"
@.str.1 = [13 x i8] c"1 - Creditar\00"
@.str.2 = [12 x i8] c"2 - Debitar\00"
@.str.3 = [9 x i8] c"3 - Sair\00"
define void @lista_menu() {
%1 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Banco Eletronico\00"
@.str.1 = [13 x i8] c"1 - Creditar\00"
@.str.2 = [12 x i8] c"2 - Debitar\00"
@.str.3 = [9 x i8] c"3 - Sair\00"
define void @lista_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void *_sbrk(int a) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @_sbrk(i32 %0) {
ret i8* null
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t bswap(uint32_t x) {
  uint32_t result;
  __asm__ __volatile__("bswap %0" : "=&r"(result) : "0"(x));
  return result;
}


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

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

LLVM IR (-O0):
define i8* @bswap(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm sideeffect "bswap $0", "=&r,0,~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @bswap(i8* %0) {
%2 = tail call i8* asm sideeffect "bswap $0", "=&r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ scrputs(char *);
void scrclrlnr(void) { scrputs("\033[1K"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[1K\00"
define void @scrclrlnr() {
%1 = call i32 @scrputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[1K\00"
define void @scrclrlnr() {
%1 = tail call i32 @scrputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int g(int, int, int);
int f(int i, int x) {
  if (i == 0) {
    return x;
  } else {
    return g(i - 1, x, i);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <f+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <f+0x37>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <g@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
je     111e <f+0xe>
mov    %edi,%edx
lea    -0x1(%rdx),%edi
jmp    1030 <g@plt>
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(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 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %5
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @g(i32 %12, i32 %13, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = add nsw i32 %0, -1
%6 = tail call i32 @g(i32 %5, i32 %1, i32 %0)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ %1, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int __u8;
typedef int __u16;

/* Variables and functions */
__u16 __exfat_checksum16(__u16 sum, __u8 val) {
  return ((sum << 15) | (sum >> 1)) + val;
}


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

x86 assembly (clang, -O2):
<__exfat_checksum16>:
mov    %edi,%eax
shl    $0xf,%eax
sar    %edi
or     %edi,%eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @__exfat_checksum16(i32 %0, i32 %1) {
%3 = shl i32 %0, 15
%4 = ashr i32 %0, 1
%5 = or i32 %3, %4
%6 = add nsw i32 %5, %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void interrupt_8259pic_send_slave_eoi() { outb(0x20, 0xA0); }


x86 assembly (clang, -O0):
<interrupt_8259pic_send_slave_eoi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0xa0,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_8259pic_send_slave_eoi>:
mov    $0x20,%edi
mov    $0xa0,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @interrupt_8259pic_send_slave_eoi() {
%1 = call i32 @outb(i32 32, i32 160)
ret void
}

LLVM IR (-O2):
define void @interrupt_8259pic_send_slave_eoi() {
%1 = tail call i32 @outb(i32 32, i32 160)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FrisFatal(char *);
int IGMPSendReport(void) { FrisFatal("IGMPSendReport not implemented"); }


x86 assembly (clang, -O0):
<IGMPSendReport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <FrisFatal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"IGMPSendReport not implemented\00"
define i32 @IGMPSendReport() {
%1 = alloca i32
%2 = call i32 @FrisFatal(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [31 x i8] c"IGMPSendReport not implemented\00"
define i32 @IGMPSendReport() {
%1 = tail call i32 @FrisFatal(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ ceil(double const);
void ceil_l_d(const double *source, int64_t *dest) {
  *dest = (int64_t)ceil(*source);
}


x86 assembly (clang, -O0):
<ceil_l_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <ceil@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_l_d>:
push   %rbx
mov    %rsi,%rbx
movsd  (%rdi),%xmm0
call   1030 <ceil@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ceil_l_d(double* %0, i64* %1) {
%3 = alloca double*
%4 = alloca i64*
store double* %0, double** %3
store i64* %1, i64** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = call i64 @ceil(double %6)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
ret void
}

LLVM IR (-O2):
define void @ceil_l_d(double* nocapture %0, i64* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = tail call i64 @ceil(double %3)
store i64 %4, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adc16(int /*<<< orphan*/);
int /*<<< orphan*/ indirectx();
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
void adcIndirectx16(void) { adc16(readmemw65816(indirectx())); }


x86 assembly (clang, -O0):
<adcIndirectx16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirectx@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <adc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcIndirectx16>:
push   %rax
xor    %eax,%eax
call   1040 <indirectx@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <adc16@plt>

LLVM IR (-O0):
define void @adcIndirectx16() {
%1 = call i32 (...) @indirectx()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @adc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcIndirectx16() {
%1 = tail call i32 (...) @indirectx()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @adc16(i32 %2)
ret void
}
int is_power_of_two(int n) { return ((n & (n - 1)) == 0); }


x86 assembly (clang, -O0):
<is_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_two>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_power_of_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_power_of_two(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
int mdp4_writeback_terminate(struct fb_info *info) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.fb_info = type opaque
define i32 @mdp4_writeback_terminate(%struct.fb_info* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ output(char const *);
void klogStr(const char *description) {
  output(description);
  output("\r\n");
}


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

x86 assembly (clang, -O2):
<klogStr>:
push   %rax
call   1030 <output@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <output@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @klogStr(i8* %0) {
%2 = tail call i32 @output(i8* %0)
%3 = tail call i32 @output(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
int nussl_has_support(int feature) {
  switch (feature) {
  case (1):
  case (6):
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<nussl_has_support>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     112c <nussl_has_support+0x2c>
jmp    111b <nussl_has_support+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
jne    1138 <nussl_has_support+0x38>
jmp    112c <nussl_has_support+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    113f <nussl_has_support+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nussl_has_support>:
cmp    $0x1,%edi
sete   %al
cmp    $0x6,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @nussl_has_support(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 1, label %5
i32 6, label %5
]
5: ; preds = %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @nussl_has_support(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = icmp eq i32 %0, 6
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main() {
  int i;
  for (i = 0; i < 120; i++)
    sleep(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x78,-0x8(%rbp)
jge    1148 <main+0x38>
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x78,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @sleep(i32 1)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 120
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ heapify(int *, int, int);
int build_max_heap(int array[], int array_size) {
  int heap_size = array_size - 1;
  int non_leaf_idx = heap_size / 2;
  for (; non_leaf_idx >= 0; non_leaf_idx--) {
    heapify(array, heap_size, non_leaf_idx);
  }
  return heap_size;
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     115d <build_max_heap+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <heapify@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <build_max_heap+0x26>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
lea    -0x1(%rsi),%ebx
test   %esi,%esi
js     1141 <build_max_heap+0x31>
mov    %rdi,%r14
mov    %ebx,%ebp
shr    $0x1f,%ebp
add    %ebx,%ebp
sar    %ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <heapify@plt>
add    $0xffffffff,%ebp
jb     1130 <build_max_heap+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @build_max_heap(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
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sdiv i32 %9, 2
store i32 %10, i32* %6
br label %11
11: ; preds = %19, %2
%12 = load i32, i32* %6
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = call i32 @heapify(i32* %15, i32 %16, i32 %17)
br label %19
19: ; preds = %14
%20 = load i32, i32* %6
%21 = add nsw i32 %20, -1
store i32 %21, i32* %6
br label %11
22: ; preds = %11
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @build_max_heap(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = icmp sgt i32 %1, -1
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = sdiv i32 %3, 2
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %10, %7 ], [ %6, %5 ]
%9 = tail call i32 @heapify(i32* %0, i32 %3, i32 %8)
%10 = add nsw i32 %8, -1
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret i32 %3
}
int clamp(int x, int x0, int x1) {
  x = x < x0 ? x0 : x;
  x = x > x1 ? x1 : x;
  return x;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112a <clamp+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1147 <clamp+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114d <clamp+0x4d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @clamp(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* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %14
12: ; preds = %3
%13 = load i32, i32* %4
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i32, i32* %6
br label %23
21: ; preds = %14
%22 = load i32, i32* %4
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
store i32 %24, i32* %4
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
double cos(int);
double sin(int);
double tan(int);
void test_trigonometry() {
  double x;
  x = sin(1);
  x = cos(1);
  x = tan(1);
}


x86 assembly (clang, -O0):
<test_trigonometry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <sin@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <cos@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <tan@plt>
movsd  %xmm0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_trigonometry>:
push   %rax
mov    $0x1,%edi
call   1030 <sin@plt>
mov    $0x1,%edi
call   1050 <cos@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <tan@plt>

LLVM IR (-O0):
define void @test_trigonometry() {
%1 = alloca double
%2 = call double @sin(i32 1)
store double %2, double* %1
%3 = call double @cos(i32 1)
store double %3, double* %1
%4 = call double @tan(i32 1)
store double %4, double* %1
ret void
}

LLVM IR (-O2):
define void @test_trigonometry() {
%1 = tail call double @sin(i32 1)
%2 = tail call double @cos(i32 1)
%3 = tail call double @tan(i32 1)
ret void
}
/* Variables and functions */
unsigned long fatorial(unsigned long);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned long *);
int main() {
  unsigned long n;
  unsigned long f;
  printf("digiteum numero:");
  scanf("%li", &n);
  f = fatorial(n);
  printf("N=%li, F=%li\n", n, f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fatorial@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
call   1040 <fatorial@plt>
mov    (%rsp),%rsi
lea    0xeb3(%rip),%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"digiteum numero:\00"
@.str.1 = [4 x i8] c"%li\00"
@.str.2 = [14 x i8] c"N=%li, F=%li\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%6 = load i64, i64* %2
%7 = call i64 @fatorial(i64 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %2
%9 = load i64, i64* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i64 %8, i64 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"digiteum numero:\00"
@.str.1 = [4 x i8] c"%li\00"
@.str.2 = [14 x i8] c"N=%li, F=%li\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i64 @fatorial(i64 %5)
%7 = load i64, i64* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i64 %7, i64 %6)
ret i32 0
}
char transform(char ch) {
  if (ch >= 'a' && ch <= 'z') {
    return ch + 'A' - 'a';
  } else {
    return ch;
  }
}


x86 assembly (clang, -O0):
<transform>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <transform+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1136 <transform+0x36>
movsbl -0x2(%rbp),%eax
add    $0x41,%eax
sub    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    113c <transform+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @transform(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 65
%15 = sub nsw i32 %14, 97
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %19
17: ; preds = %7, %1
%18 = load i8, i8* %3
store i8 %18, i8* %2
br label %19
19: ; preds = %17, %11
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @transform(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ test10();
int main(int argc, char **argv) {
  if (!test10())
    abort();
  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   1040 <test10@plt>
cmp    $0x0,%eax
jne    114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test10@plt>
test   %eax,%eax
je     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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 (...) @test10()
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test10()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
/* Variables and functions */
int u8isloweri(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char const *);
int u8islowercc(const char *c) { return u8isloweri(u8tointcc(c)); }


x86 assembly (clang, -O0):
<u8islowercc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointcc@plt>
mov    %eax,%edi
call   1040 <u8isloweri@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8islowercc>:
push   %rax
call   1030 <u8tointcc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isloweri@plt>

LLVM IR (-O0):
define i32 @u8islowercc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @u8tointcc(i8* %3)
%5 = call i32 @u8isloweri(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @u8islowercc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8isloweri(i32 %2)
ret i32 %3
}
/* Variables and functions */
void *__span_aligned_alloc(size_t, size_t);
void *span_aligned_alloc(size_t alignment, size_t size) {
  return __span_aligned_alloc(alignment, size);
}


x86 assembly (clang, -O0):
<span_aligned_alloc>:
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 <__span_aligned_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<span_aligned_alloc>:
jmp    1030 <__span_aligned_alloc@plt>

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

LLVM IR (-O2):
define i8* @span_aligned_alloc(i64 %0, i64 %1) {
%3 = tail call i8* @__span_aligned_alloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int *array, int leftInd, int rightInd) {
  if (leftInd < rightInd) {
    int pivotInd = partition(array, leftInd, rightInd);
    quickSort(array, leftInd, pivotInd - 1);
    quickSort(array, pivotInd + 1, rightInd);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ or_n();
void opcode_f6() { or_n(); }


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

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

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

LLVM IR (-O2):
define void @opcode_f6() {
%1 = tail call i32 (...) @or_n()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ msg_cpy;

/* Variables and functions */
int /*<<< orphan*/ console_print(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
void console_error(const char *msg) {
  char msg_cpy[128];
  snprintf(msg_cpy, sizeof(msg_cpy), "[ERROR] %s", msg);
  console_print(msg_cpy);
}


x86 assembly (clang, -O0):
<console_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x80,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <console_print@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_error>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <console_print@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"[ERROR] %s\00"
define void @console_error(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i32 @console_print(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"[ERROR] %s\00"
define void @console_error(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @console_print(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("Usage:  cpu [ reg|flag = <value> ... ]\n"); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Usage: cpu [ reg|flag = <value> ... ]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"Usage: cpu [ reg|flag = <value> ... ]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
int uart1_cts() {
  return ((*((volatile unsigned char *)0xE0010018)) & (1 << 4));
}


x86 assembly (clang, -O0):
<uart1_cts>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0010018,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart1_cts>:
mov    $0xe0010018,%eax
movzbl (%rax),%eax
and    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @uart1_cts() {
%1 = load volatile i8, i8* inttoptr (i64 3758161944 to i8*)
%2 = zext i8 %1 to i32
%3 = and i32 %2, 16
ret i32 %3
}

LLVM IR (-O2):
define i32 @uart1_cts() {
%1 = load volatile i8, i8* inttoptr (i64 3758161944 to i8*)
%2 = and i8 %1, 16
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) { return isupper(c) ? 'a' + (c - 'A') : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113e <tolower+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <tolower+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 65
%9 = add nsw i32 97, %8
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int main() {
  int a;
#pragma scop
  a = 1;
#pragma endscop
  if (a != 1)
    return EXIT_FAILURE;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     112d <main+0x2d>
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <main+0x39>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @EXIT_SUCCESS
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ PUT32(int, int);
void sda_low(void) { PUT32(0x20200028, 1 << 2); }


x86 assembly (clang, -O0):
<sda_low>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20200028,%edi
mov    $0x4,%esi
call   1030 <PUT32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sda_low>:
mov    $0x20200028,%edi
mov    $0x4,%esi
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @sda_low() {
%1 = call i32 @PUT32(i32 538968104, i32 4)
ret void
}

LLVM IR (-O2):
define void @sda_low() {
%1 = tail call i32 @PUT32(i32 538968104, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ldo_power_off();
int /*<<< orphan*/ operation_sleep();
int /*<<< orphan*/ set_wakeup_timer(int /*<<< orphan*/, int, int);
void operation_sleep_notimer(void) {
  ldo_power_off();
  set_wakeup_timer(0, 0x0, 0x0);
  operation_sleep();
}


x86 assembly (clang, -O0):
<operation_sleep_notimer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ldo_power_off@plt>
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <set_wakeup_timer@plt>
mov    $0x0,%al
call   1030 <operation_sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation_sleep_notimer>:
push   %rax
xor    %eax,%eax
call   1050 <ldo_power_off@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <set_wakeup_timer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <operation_sleep@plt>

LLVM IR (-O0):
define void @operation_sleep_notimer() {
%1 = call i32 (...) @ldo_power_off()
%2 = call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%3 = call i32 (...) @operation_sleep()
ret void
}

LLVM IR (-O2):
define void @operation_sleep_notimer() {
%1 = tail call i32 (...) @ldo_power_off()
%2 = tail call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%3 = tail call i32 (...) @operation_sleep()
ret void
}
/* Variables and functions */
scalar_t__ strpbrk(char const *, char const *);
int strIndexOf(const char *str, const char *keys, int startIdx) {
  char *pc;
  if ((pc = (char *)strpbrk((str + startIdx), keys)) == NULL) {
    return -1;
  } else {
    return (pc - str);
  }
}


x86 assembly (clang, -O0):
<strIndexOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1151 <strIndexOf+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <strIndexOf+0x4f>
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strIndexOf>:
push   %rbx
mov    %rdi,%rbx
movslq %edx,%rdi
add    %rbx,%rdi
call   1030 <strpbrk@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @strIndexOf(i8* %0, i8* %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i64 @strpbrk(i8* %5, i8* %1)
%7 = icmp eq i64 %6, 0
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %6, %8
%10 = trunc i64 %9 to i32
%11 = select i1 %7, i32 -1, i32 %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ baz(int);
void foo(void) {
  int i;
#pragma omp parallel for shared(i)
  for (i = 0; i < 2; i++)
    baz(i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    113f <foo+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <baz@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
call   1030 <baz@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <baz@plt>

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @baz(i32 0)
%2 = tail call i32 @baz(i32 1)
ret void
}