xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  double x;
  int y;
  x = 2;
  x -= 0.6;
  y = x;
  assert(y == 1);
  x = 2;
  x -= 0.4;
  y = x;
  assert(y == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe92(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca double
%2 = alloca i32
store double 2.000000e+00, double* %1
%3 = load double, double* %1
%4 = fsub double %3, 6.000000e-01
store double %4, double* %1
%5 = load double, double* %1
%6 = fptosi double %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
store double 2.000000e+00, double* %1
%11 = load double, double* %1
%12 = fsub double %11, 4.000000e-01
store double %12, double* %1
%13 = load double, double* %1
%14 = fptosi double %13 to i32
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 1
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bark();
__attribute__((transaction_callable)) int foo() { bark(); }


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = call i32 (...) @bark()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bark()
ret i32 undef
}
/* Variables and functions */
int print();
int /*<<< orphan*/ print2();
int /*<<< orphan*/ printf(char *, int);
int sum(int, int);
void main() {
  printf("size of integer is %lu \n", sizeof(int));
  int x = 10;
  int y = 20;
  int result;
  result = sum(x, y);
  printf("print x in main :%d \n", x);
  result = print();
  print2();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <sum@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <print2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1050 <sum@plt>
lea    0xeb1(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <print@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <print2@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"size of integer is %lu \0A\00"
@.str.1 = [22 x i8] c"print x in main :%d \0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 4)
store i32 10, i32* %1
store i32 20, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @sum(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @print()
store i32 %10, i32* %3
%11 = call i32 (...) @print2()
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"size of integer is %lu \0A\00"
@.str.1 = [22 x i8] c"print x in main :%d \0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @sum(i32 10, i32 20)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 10)
%4 = tail call i32 (...) @print()
%5 = tail call i32 (...) @print2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *, int);
int sci_get_chip_id();
int soc_id_is_sc9630v0(void) {
  pr_info("chip id is %x\n", sci_get_chip_id());
  return ((sci_get_chip_id() & (0xFFFFF000)) == ((0x96300000) & (0xFFFFF000)));
}


x86 assembly (clang, -O0):
<soc_id_is_sc9630v0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <pr_info@plt>
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
and    $0xfffff000,%eax
cmp    $0x96300000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_id_is_sc9630v0>:
push   %rax
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <pr_info@plt>
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
and    $0xfffff000,%eax
xor    %ecx,%ecx
cmp    $0x96300000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc9630v0() {
%1 = call i32 (...) @sci_get_chip_id()
%2 = call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -4096
%5 = icmp eq i32 %4, -1775239168
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc9630v0() {
%1 = tail call i32 (...) @sci_get_chip_id()
%2 = tail call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -4096
%5 = icmp eq i32 %4, -1775239168
%6 = zext i1 %5 to i32
ret i32 %6
}
void vtime_guest_exit(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @vtime_guest_exit(%struct.task_struct* nocapture %0) {
ret void
}
void globalvar_set_match(const char *match, const char *val) {}


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

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

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

LLVM IR (-O2):
define void @globalvar_set_match(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int atoi(char *);
int getNumber(char *c) { return atoi(c); }


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

x86 assembly (clang, -O2):
<getNumber>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @getNumber(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
/* Type definitions */
struct codec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t sgen_delay(struct codec *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.codec = type { i32 }
define i32 @sgen_delay(%struct.codec* nocapture readnone %0) {
ret i32 0
}
void testList_2_destructor(void *data) { *(int *)data -= 1; }


x86 assembly (clang, -O0):
<testList_2_destructor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testList_2_destructor>:
addl   $0xffffffff,(%rdi)
ret

LLVM IR (-O0):
define void @testList_2_destructor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @testList_2_destructor(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
g(long long i) {
  if (i % 2)
    foo();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     113b <g+0x2b>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
test   $0x1,%dil
je     1122 <g+0x12>
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @g(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = srem i64 %4, 2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @foo()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @g(i64 %0) {
%2 = and i64 %0, 1
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @foo()
br label %6
6: ; preds = %4, %1
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
double era_sinh(double);
double ourDuration(double x, double *y) {
  clock_t start = clock();
  *y = era_sinh(x);
  clock_t stop = clock();
  return (double)(stop - start) / CLOCKS_PER_SEC * 1000;
}


x86 assembly (clang, -O0):
<ourDuration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <era_sinh@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e7b(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xe87(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ourDuration>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
call   1040 <era_sinh@plt>
movsd  %xmm0,(%r14)
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2e8a(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0xe96(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @ourDuration(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca i64
%6 = alloca i64
store double %0, double* %3
store double* %1, double** %4
%7 = call i64 (...) @clock()
store i64 %7, i64* %5
%8 = load double, double* %3
%9 = call double @era_sinh(double %8)
%10 = load double*, double** %4
store double %9, double* %10
%11 = call i64 (...) @clock()
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = load i64, i64* %5
%14 = sub nsw i64 %12, %13
%15 = sitofp i64 %14 to double
%16 = load double, double* @CLOCKS_PER_SEC
%17 = fdiv double %15, %16
%18 = fmul double %17, 1.000000e+03
ret double %18
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @ourDuration(double %0, double* nocapture writeonly %1) {
%3 = tail call i64 (...) @clock()
%4 = tail call double @era_sinh(double %0)
store double %4, double* %1
%5 = tail call i64 (...) @clock()
%6 = sub nsw i64 %5, %3
%7 = sitofp i64 %6 to double
%8 = load double, double* @CLOCKS_PER_SEC
%9 = fdiv double %7, %8
%10 = fmul double %9, 1.000000e+03
ret double %10
}
void lcd_shiftleft(void) {}


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

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

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

LLVM IR (-O2):
define void @lcd_shiftleft() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRDF_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRDF_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRDF_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print() { printf("%f", 3.14159265); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
movsd  0xedd(%rip),%xmm0
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
lea    0xef1(%rip),%rdi
movsd  0xee1(%rip),%xmm0
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @print() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double 0x400921FB53C8D4F1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @print() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double 0x400921FB53C8D4F1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("unical1 prool's DIRTY EXPERIMENTAL mod\n\nusage: unical1 inputfile "
         "outputfile\nor\nunical1 -f inputfile outputfile\n\nProol: "
         "http://prool.kharkov.org\n\n");
}


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

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

LLVM IR (-O0):
@.str = [146 x i8] c"unical1 prool's DIRTY EXPERIMENTAL mod\0A\0Ausage: unical1 inputfile outputfile\0Aor\0Aunical1 -f inputfile outputfile\0A\0AProol: http://prool.kharkov.org\0A\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [145 x i8] c"unical1 prool's DIRTY EXPERIMENTAL mod\0A\0Ausage: unical1 inputfile outputfile\0Aor\0Aunical1 -f inputfile outputfile\0A\0AProol: http://prool.kharkov.org\0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([145 x i8], [145 x i8]* @str, i64 0, i64 0))
ret void
}
long labs(long __n) { return (__n < 0L) ? -__n : __n; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
int test_imm_0Cuint16_mem(unsigned short *val) {
  return ((*val) & (-0x0C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -12
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_instr(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void cgen_loop_condition(int num) {
  print_instr("li $t0 0");
  char str[100];
  sprintf(str, "beq $a0 $t0 END_LOOP%d", num);
  print_instr(str);
}


x86 assembly (clang, -O0):
<cgen_loop_condition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <print_instr@plt>
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec4(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <print_instr@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgen_loop_condition>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %edi,%ebx
lea    0xed0(%rip),%rdi
call   1030 <print_instr@plt>
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1030 <print_instr@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"li $t0 0\00"
@.str.1 = [23 x i8] c"beq $a0 $t0 END_LOOP%d\00"
define void @cgen_loop_condition(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 %0, i32* %2
%4 = call i32 @print_instr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i32 @print_instr(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"li $t0 0\00"
@.str.1 = [23 x i8] c"beq $a0 $t0 END_LOOP%d\00"
define void @cgen_loop_condition(i32 %0) {
%2 = alloca [100 x i8]
%3 = tail call i32 @print_instr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%6 = call i32 @print_instr(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  int i;
  char array[4] = {'A', 'B', 'C', 'D'};
  for (i = 0; i < 4; i++) {
    printf("%c\n", array[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    115c <main+0x4c>
movslq -0x8(%rbp),%rax
lea    0xec0(%rip),%rdi
movsbl -0xc(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0x1f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x42,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x43,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x44,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 65)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 66)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 67)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 68)
ret i32 0
}
/* Type definitions */
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_family;
};

/* Variables and functions */
int /*<<< orphan*/ PF_INET6;
int main(int argc, char **argv) {
  struct sockaddr_in6 sa;
  sa.sin6_family = PF_INET6;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32 }
@PF_INET6 = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_in6
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @PF_INET6
%8 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %6, i32 0, i32 0
store i32 %7, i32* %8
ret i32 0
}

LLVM IR (-O2):
@PF_INET6 = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void swap(int *arr, int idx1, int idx2) {
  int tmp = arr[idx1];
  arr[idx1] = arr[idx2];
  arr[idx2] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fork();
pid_t c_fork(void) { return fork(); }


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

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

LLVM IR (-O0):
define i32 @c_fork() {
%1 = call i32 (...) @fork()
ret i32 %1
}

LLVM IR (-O2):
define i32 @c_fork() {
%1 = tail call i32 (...) @fork()
ret i32 %1
}
/* Type definitions */
typedef void EVP_MD_CTX;

/* Variables and functions */
int EVP_DigestInit_ex(void *, int /*<<< orphan*/, int /*<<< orphan*/ *);
void *EVP_MD_CTX_create();
int /*<<< orphan*/ EVP_sha512();
void *SHA512_init() {
  EVP_MD_CTX *pctx;
  pctx = EVP_MD_CTX_create();
  if (EVP_DigestInit_ex(pctx, EVP_sha512(), NULL) != 1)
    return NULL;
  return pctx;
}


x86 assembly (clang, -O0):
<SHA512_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <EVP_MD_CTX_create@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <EVP_sha512@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <EVP_DigestInit_ex@plt>
cmp    $0x1,%eax
je     1177 <SHA512_init+0x47>
movq   $0x0,-0x8(%rbp)
jmp    117f <SHA512_init+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA512_init>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <EVP_MD_CTX_create@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <EVP_sha512@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <EVP_DigestInit_ex@plt>
cmp    $0x1,%eax
cmove  %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @SHA512_init() {
%1 = tail call i8* (...) @EVP_MD_CTX_create()
%2 = tail call i32 (...) @EVP_sha512()
%3 = tail call i32 @EVP_DigestInit_ex(i8* %1, i32 %2, i32* null)
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, i8* %1, i8* null
ret i8* %5
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
void humConvert(uint16_t rawTemp, uint16_t rawHum, float *tTemp, float *tHum) {
  *tTemp = ((double)rawTemp / 65536) * 165 - 40;
  *tHum = ((double)rawHum / 65536) * 100;
}


x86 assembly (clang, -O0):
<humConvert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe9c(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<humConvert>:
cvtsi2sd %rdi,%xmm0
movsd  0xef3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sd %rsi,%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xee6(%rip),%xmm0
addsd  0xee6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mulsd  0xee2(%rip),%xmm2
movss  %xmm0,(%rdx)
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
movss  %xmm0,(%rcx)
ret

LLVM IR (-O0):
define void @humConvert(i64 %0, i64 %1, float* %2, float* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca float*
%8 = alloca float*
store i64 %0, i64* %5
store i64 %1, i64* %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load i64, i64* %5
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 6.553600e+04
%12 = call double @llvm.fmuladd.f64(double %11, double 1.650000e+02, double -4.000000e+01)
%13 = fptrunc double %12 to float
%14 = load float*, float** %7
store float %13, float* %14
%15 = load i64, i64* %6
%16 = sitofp i64 %15 to double
%17 = fdiv double %16, 6.553600e+04
%18 = fmul double %17, 1.000000e+02
%19 = fptrunc double %18 to float
%20 = load float*, float** %8
store float %19, float* %20
ret void
}

LLVM IR (-O2):
define void @humConvert(i64 %0, i64 %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = sitofp i64 %0 to double
%6 = fmul double %5, 0x3EF0000000000000
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.650000e+02, double -4.000000e+01)
%8 = fptrunc double %7 to float
store float %8, float* %2
%9 = sitofp i64 %1 to double
%10 = fmul double %9, 0x3EF0000000000000
%11 = fmul double %10, 1.000000e+02
%12 = fptrunc double %11 to float
store float %12, float* %3
ret void
}
/* Type definitions */
struct drm_i915_private {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ init_contexts(struct drm_i915_private *);
void mock_init_contexts(struct drm_i915_private *i915) { init_contexts(i915); }


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

x86 assembly (clang, -O2):
<mock_init_contexts>:
jmp    1030 <init_contexts@plt>

LLVM IR (-O0):
%struct.drm_i915_private = type { i32 }
define void @mock_init_contexts(%struct.drm_i915_private* %0) {
%2 = alloca %struct.drm_i915_private*
store %struct.drm_i915_private* %0, %struct.drm_i915_private** %2
%3 = load %struct.drm_i915_private*, %struct.drm_i915_private** %2
%4 = call i32 @init_contexts(%struct.drm_i915_private* %3)
ret void
}

LLVM IR (-O2):
%struct.drm_i915_private = type { i32 }
define void @mock_init_contexts(%struct.drm_i915_private* %0) {
%2 = tail call i32 @init_contexts(%struct.drm_i915_private* %0)
ret void
}
void gtk_icon_source_get_size_wildcarded() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_source_get_size_wildcarded() {
ret void
}
int test_imm_60int16_mem(short *val) {
  return ((*val) & (-0x60 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_60int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -96
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t to_int32(uint8_t *bytes) {
  return (uint32_t)bytes[0] | ((uint32_t)bytes[1] << 8) |
         ((uint32_t)bytes[2] << 16) | ((uint32_t)bytes[3] << 24);
}


x86 assembly (clang, -O0):
<to_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_int32>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @to_int32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
scalar_t__ inc_addr(void *, int);
int shim_get_mempolicy(int *, unsigned long *, int, unsigned long,
                       unsigned long);
int bad_get_mempolicy(void *addr) {
  return shim_get_mempolicy((int *)addr, (unsigned long *)inc_addr(addr, 1), 1,
                            (unsigned long)inc_addr(addr, 2), 0UL);
}


x86 assembly (clang, -O0):
<bad_get_mempolicy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <inc_addr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <inc_addr@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    %rax,%rcx
mov    $0x1,%edx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <shim_get_mempolicy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_get_mempolicy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <inc_addr@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <inc_addr@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %rax,%rcx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <shim_get_mempolicy@plt>

LLVM IR (-O0):
define i32 @bad_get_mempolicy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i8*, i8** %2
%6 = call i64 @inc_addr(i8* %5, i32 1)
%7 = inttoptr i64 %6 to i64*
%8 = load i8*, i8** %2
%9 = call i64 @inc_addr(i8* %8, i32 2)
%10 = call i32 @shim_get_mempolicy(i32* %4, i64* %7, i32 1, i64 %9, i64 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @bad_get_mempolicy(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @inc_addr(i8* %0, i32 1)
%4 = inttoptr i64 %3 to i64*
%5 = tail call i64 @inc_addr(i8* %0, i32 2)
%6 = tail call i32 @shim_get_mempolicy(i32* %2, i64* %4, i32 1, i64 %5, i64 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ run_crt_limits_tests();
void run_crt_tests() { run_crt_limits_tests(); }


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

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

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

LLVM IR (-O2):
define void @run_crt_tests() {
%1 = tail call i32 (...) @run_crt_limits_tests()
ret void
}
/* Variables and functions */
double tune_mpres_mul(size_t, int);
double tune_mpres_mul_modmuln(size_t n) { return tune_mpres_mul(n, 3); }


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

x86 assembly (clang, -O2):
<tune_mpres_mul_modmuln>:
mov    $0x3,%esi
jmp    1030 <tune_mpres_mul@plt>

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

LLVM IR (-O2):
define double @tune_mpres_mul_modmuln(i64 %0) {
%2 = tail call double @tune_mpres_mul(i64 %0, i32 3)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ ruspma_setup();
int main(void) { ruspma_setup(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ruspma_setup()
ret i32 0
}
int hc05_state(void) {
  return ((*(volatile unsigned int *)(0x7F008164)) &= 0x2);
}


x86 assembly (clang, -O0):
<hc05_state>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008164,%eax
mov    (%rax),%eax
and    $0x2,%eax
mov    $0x7f008164,%ecx
mov    %eax,(%rcx)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hc05_state() {
%1 = load volatile i32, i32* inttoptr (i64 2130739556 to i32*)
%2 = and i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 2130739556 to i32*)
ret i32 %2
}

LLVM IR (-O2):
define i32 @hc05_state() {
%1 = load volatile i32, i32* inttoptr (i64 2130739556 to i32*)
%2 = and i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 2130739556 to i32*)
ret i32 %2
}
void IntSyncClkFreeRunSet(void) {
  (*((volatile unsigned int *)((0x48200000) + (0x50)))) &= ~(0x00000002u);
}


x86 assembly (clang, -O0):
<IntSyncClkFreeRunSet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48200050,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    $0x48200050,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntSyncClkFreeRunSet>:
andl   $0xfffffffd,0x48200050
fd
ret

LLVM IR (-O0):
define void @IntSyncClkFreeRunSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056784 to i32*)
%2 = and i32 %1, -3
store volatile i32 %2, i32* inttoptr (i64 1210056784 to i32*)
ret void
}

LLVM IR (-O2):
define void @IntSyncClkFreeRunSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056784 to i32*)
%2 = and i32 %1, -3
store volatile i32 %2, i32* inttoptr (i64 1210056784 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exe(long long, long long, long long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, long long *, long long *, long long *);
int main(int argc, char **argv) {
  long long a, b, m;
  scanf("%lld%lld%lld", &a, &b, &m);
  printf("%lld", exe(a, b, m));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"%lld%lld%lld\00"
@.str.1 = [5 x i8] c"%lld\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = bitcast i64* %3 to i8*
%7 = bitcast i64* %4 to i8*
%8 = bitcast i64* %5 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64* %3, i64* %4, i64* %5)
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = call i32 @exe(i64 %10, i64 %11, i64 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}
int rev(int product) {
  int rev_pro = 0;
  while (product > 0) {
    rev_pro *= 10;
    rev_pro += (product % 10);
    product = product / 10;
  }
  return rev_pro;
}


x86 assembly (clang, -O0):
<rev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1143 <rev+0x43>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <rev+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <rev+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <rev+0x10>
ret

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

LLVM IR (-O2):
define i32 @rev(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = urem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ log2(float);
float log2f(float x) { return (float)log2(x); }


x86 assembly (clang, -O0):
<log2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log2@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2f>:
push   %rax
call   1030 <log2@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @log2(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @log2f(float %0) {
%2 = tail call i64 @log2(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
void run_scan() {}


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

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

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

LLVM IR (-O2):
define void @run_scan() {
ret void
}
/* Variables and functions */
unsigned int _crc8(unsigned int);
unsigned int crc8(unsigned int crc, const unsigned char *vptr, int len) {
  int i;
  for (i = 0; i < len; i++)
    crc = _crc8((crc ^ vptr[i]) << 8);
  return crc;
}


x86 assembly (clang, -O0):
<crc8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115f <crc8+0x4f>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
xor    %eax,%edi
shl    $0x8,%edi
call   1030 <_crc8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <crc8+0x19>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc8>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%eax
test   %edx,%edx
jle    1148 <crc8+0x38>
mov    %rsi,%r14
mov    %edx,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%r14,%rbx,1),%edi
xor    %eax,%edi
shl    $0x8,%edi
call   1030 <_crc8@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <crc8+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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