xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, size_t);
void *malloc(size_t);
void *pmalloc(size_t nbytes) {
  void *p;
  p = malloc(nbytes);
  if (p) {
    bzero(p, nbytes);
  }
  return (p);
}


x86 assembly (clang, -O0):
<pmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1151 <pmalloc+0x31>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <bzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113f <pmalloc+0x1f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @pmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @bzero(i8* %2, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ refresh();
void refresh_view(void) { refresh(); }


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

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

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

LLVM IR (-O2):
define void @refresh_view() {
%1 = tail call i32 (...) @refresh()
ret void
}
void check_winch() {}


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

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

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

LLVM IR (-O2):
define void @check_winch() {
ret void
}
double ephCalcT(double jde) { return (jde - 2451545.0) / 36525.0; }


x86 assembly (clang, -O0):
<ephCalcT>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ephCalcT>:
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ephCalcT(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 0x4142B42C80000000
%5 = fdiv double %4, 3.652500e+04
ret double %5
}

LLVM IR (-O2):
define double @ephCalcT(double %0) {
%2 = fadd double %0, 0xC142B42C80000000
%3 = fdiv double %2, 3.652500e+04
ret double %3
}
int main(argc, argv)
int argc;
char **argv;
{
  MixedLengthTest("test.db");
  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)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <MixedLengthTest@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <MixedLengthTest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"test.db\00"
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 (i8*, ...) bitcast (i32 (...)* @MixedLengthTest to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"test.db\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @MixedLengthTest to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int max(int a, int b) {
  int i, j;
  for (i = 1; i <= a || i <= b; i++) {
    if ((a % i == 0) && (b % i == 0))
      j = i;
  }
  return j;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x11(%rbp)
jle    112e <max+0x2e>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113e <max+0x3e>
jmp    1177 <max+0x77>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1164 <max+0x64>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1164 <max+0x64>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <max+0x69>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <max+0x11>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
test   %edi,%edi
jg     1108 <max+0x8>
test   %esi,%esi
jle    1131 <max+0x31>
mov    $0x1,%eax
nopl   (%rax)
mov    %eax,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    1126 <max+0x26>
mov    %esi,%eax
cltd
idiv   %ecx
test   %edx,%edx
cmove  %ecx,%r8d
lea    0x1(%rcx),%eax
cmp    %edi,%ecx
jl     1110 <max+0x10>
cmp    %esi,%ecx
jl     1110 <max+0x10>
mov    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 1, i32* %5
br label %7
7: ; preds = %30, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br label %15
15: ; preds = %11, %7
%16 = phi i1 [ true, %7 ], [ %14, %11 ]
br i1 %16, label %17, label %33
17: ; preds = %15
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = srem i32 %18, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = srem i32 %23, %24
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = load i32, i32* %5
store i32 %28, i32* %6
br label %29
29: ; preds = %27, %22, %17
br label %30
30: ; preds = %29
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %7
33: ; preds = %15
%34 = load i32, i32* %6
ret i32 %34
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %6, label %21
6: ; preds = %2, %15
%7 = phi i32 [ %16, %15 ], [ undef, %2 ]
%8 = phi i32 [ %17, %15 ], [ 1, %2 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = srem i32 %1, %8
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 %8, i32 %7
br label %15
15: ; preds = %11, %6
%16 = phi i32 [ %7, %6 ], [ %14, %11 ]
%17 = add nuw nsw i32 %8, 1
%18 = icmp slt i32 %8, %0
%19 = icmp slt i32 %8, %1
%20 = or i1 %18, %19
br i1 %20, label %6, label %21
21: ; preds = %15, %2
%22 = phi i32 [ undef, %2 ], [ %16, %15 ]
ret i32 %22
}
/* Variables and functions */
int strcmp(void const *, void const *);
int pointercmp(const void *pointer1, const void *pointer2) {
  return (strcmp(pointer1, pointer2));
}


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

x86 assembly (clang, -O2):
<pointercmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @pointercmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
void *alloc_low_pages(int);
void *alloc_low_page(void) { return alloc_low_pages(1); }


x86 assembly (clang, -O0):
<alloc_low_page>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <alloc_low_pages@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @alloc_low_page() {
%1 = call i8* @alloc_low_pages(i32 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @alloc_low_page() {
%1 = tail call i8* @alloc_low_pages(i32 1)
ret i8* %1
}
/* Variables and functions */
int __nv_signbitd(double);
int __signbit(double __a) { return __nv_signbitd(__a); }


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

x86 assembly (clang, -O2):
<__signbit>:
jmp    1030 <__nv_signbitd@plt>

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

LLVM IR (-O2):
define i32 @__signbit(double %0) {
%2 = tail call i32 @__nv_signbitd(double %0)
ret i32 %2
}
void socfpga_cyclone5_uart_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @socfpga_cyclone5_uart_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_dir(char *);
int main() {
  print_dir(".");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <print_dir@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <print_dir@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = tail call i32 @print_dir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ trace_puts(char *);
void __attribute__((weak, noreturn)) abort(void) {
  trace_puts("abort(), exiting...");
  _exit(1);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <trace_puts@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <trace_puts@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"abort(), exiting...\00"
define weak void @abort() {
%1 = call i32 @trace_puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"abort(), exiting...\00"
define weak void @abort() {
%1 = tail call i32 @trace_puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_exit(i32 1)
unreachable
}
int GoogleHotwordVersion(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @GoogleHotwordVersion() {
ret i32 0
}
/* Variables and functions */
float log(float);
float riplrandRan1(long *);
float riplrandExp(long *idum) {
  float dum;
  do
    dum = riplrandRan1(idum);
  while (dum == 0.0);
  return -log(dum);
}


x86 assembly (clang, -O0):
<riplrandExp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <riplrandRan1@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115b <riplrandExp+0x3b>
jp     115b <riplrandExp+0x3b>
jmp    112c <riplrandExp+0xc>
movss  -0xc(%rbp),%xmm0
call   1040 <log@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<riplrandExp>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <riplrandRan1@plt>
ucomiss 0xed1(%rip),%xmm0
jne    1143 <riplrandExp+0x23>
jnp    1130 <riplrandExp+0x10>
call   1040 <log@plt>
xorps  0xeb1(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @riplrandExp(i64* %0) {
%2 = alloca i64*
%3 = alloca float
store i64* %0, i64** %2
br label %4
4: ; preds = %7, %1
%5 = load i64*, i64** %2
%6 = call float @riplrandRan1(i64* %5)
store float %6, float* %3
br label %7
7: ; preds = %4
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %4, label %11
11: ; preds = %7
%12 = load float, float* %3
%13 = call float @log(float %12)
%14 = fneg float %13
ret float %14
}

LLVM IR (-O2):
define float @riplrandExp(i64* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call float @riplrandRan1(i64* %0)
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call float @log(float %3)
%7 = fneg float %6
ret float %7
}
/* Variables and functions */
char *getSectorData(char *, int, int);
char *getBlockData(char *data, int blockNum) {
  return getSectorData(data, (blockNum / 64), (blockNum % 64));
}


x86 assembly (clang, -O0):
<getBlockData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0xc(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
call   1030 <getSectorData@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBlockData>:
mov    %esi,%edx
lea    0x3f(%rdx),%esi
test   %edx,%edx
cmovns %edx,%esi
mov    %esi,%eax
and    $0xffffffc0,%eax
sub    %eax,%edx
sar    $0x6,%esi
jmp    1030 <getSectorData@plt>

LLVM IR (-O0):
define i8* @getBlockData(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 = sdiv i32 %6, 64
%8 = load i32, i32* %4
%9 = srem i32 %8, 64
%10 = call i8* @getSectorData(i8* %5, i32 %7, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @getBlockData(i8* %0, i32 %1) {
%3 = sdiv i32 %1, 64
%4 = srem i32 %1, 64
%5 = tail call i8* @getSectorData(i8* %0, i32 %3, i32 %4)
ret i8* %5
}
int test03(const char *s1) {
  return __builtin_strlen(__builtin_assume_aligned(s1, 4));
}


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

x86 assembly (clang, -O2):
<test03>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @test03(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test03(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int foo(int arg) {
  int ret;
  ret = arg + 37;
  return ret;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x25,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x25(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 37
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 37
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg16(int, unsigned short);
void VIM_IPP_SetCaptureWindowSize(unsigned short wWidth,
                                  unsigned short wHeight) {
  VIM_HIF_SetReg16((0x1c00 + 0x022), wWidth);
  VIM_HIF_SetReg16((0x1c00 + 0x024), wHeight);
}


x86 assembly (clang, -O0):
<VIM_IPP_SetCaptureWindowSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0x1c22,%edi
movzwl -0x2(%rbp),%esi
call   1030 <VIM_HIF_SetReg16@plt>
mov    $0x1c24,%edi
movzwl -0x4(%rbp),%esi
call   1030 <VIM_HIF_SetReg16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_IPP_SetCaptureWindowSize>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x1c22,%edi
call   1030 <VIM_HIF_SetReg16@plt>
mov    $0x1c24,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <VIM_HIF_SetReg16@plt>

LLVM IR (-O0):
define void @VIM_IPP_SetCaptureWindowSize(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = call i32 @VIM_HIF_SetReg16(i32 7202, i16 zeroext %5)
%7 = load i16, i16* %4
%8 = call i32 @VIM_HIF_SetReg16(i32 7204, i16 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @VIM_IPP_SetCaptureWindowSize(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @VIM_HIF_SetReg16(i32 7202, i16 zeroext %0)
%4 = tail call i32 @VIM_HIF_SetReg16(i32 7204, i16 zeroext %1)
ret void
}
/* Variables and functions */
long logEnd(char *);
int /*<<< orphan*/ sprintf(char *, char *, long);
long logEndA(char *text, long a) {
  char buffer[255];
  sprintf(buffer, text, a);
  return logEnd(buffer);
  return -1;
}


x86 assembly (clang, -O0):
<logEndA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <logEnd@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logEndA>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <logEnd@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @logEndA(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [255 x i8]
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i64 %8)
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i64 @logEnd(i8* %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @logEndA(i8* nocapture %0, i64 %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i64 %1)
%6 = call i64 @logEnd(i8* %4)
ret i64 %6
}
int test_imm_29uint8_reg(unsigned char val) {
  return ((val) & (0x29 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_29uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x29,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_29uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 41
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float value_as_float(unsigned int value) {
  union {
    float f;
    unsigned int i;
  } u = {.i = value};
  return u.f;
}


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

x86 assembly (clang, -O2):
<value_as_float>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @value_as_float(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = bitcast %union.anon* %3 to i32*
%5 = load i32, i32* %2
store i32 %5, i32* %4
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @value_as_float(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
double acosh(double x) { return 4; }


x86 assembly (clang, -O0):
<acosh>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<acosh>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @acosh(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @acosh(double %0) {
ret double 4.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ _IO(char, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
void reg_clr() {
  int fd;
  fd = open("/dev/hapara_reg", O_RDWR);
  if (fd == -1)
    return;
  ioctl(fd, _IO('r', 0));
  close(fd);
}


x86 assembly (clang, -O0):
<reg_clr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    116f <reg_clr+0x2f>
jmp    1193 <reg_clr+0x53>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x72,%edi
xor    %esi,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_clr>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1060 <open@plt>
cmp    $0xffffffff,%eax
je     117a <reg_clr+0x3a>
mov    %eax,%ebx
mov    $0x72,%edi
xor    %esi,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"/dev/hapara_reg\00"
@O_RDWR = global i32 0
define void @reg_clr() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
br label %13
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i32 @_IO(i8 signext 114, i32 0)
%10 = call i32 @ioctl(i32 %8, i32 %9)
%11 = load i32, i32* %1
%12 = call i32 @close(i32 %11)
br label %13
13: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"/dev/hapara_reg\00"
@O_RDWR = global i32 0
define void @reg_clr() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i32 @_IO(i8 signext 114, i32 0)
%6 = tail call i32 @ioctl(i32 %2, i32 %5)
%7 = tail call i32 @close(i32 %2)
br label %8
8: ; preds = %0, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int solveMeFirst(int, int);
int main(void) {
  int num1, num2, sum;
  scanf("%d %d", &num1, &num2);
  sum = solveMeFirst(num1, num2);
  printf("%d", sum);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @solveMeFirst(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t HibernateRTCMatchGet(uint32_t ui32Match) {
  ASSERT(ui32Match == 0);
  return ((*((volatile uint32_t *)(0x400FC004))));
}


x86 assembly (clang, -O0):
<HibernateRTCMatchGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    $0x400fc004,%eax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCMatchGet>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
mov    %eax,%edi
call   1030 <ASSERT@plt>
mov    0x400fc004,%rax
40
pop    %rcx
ret

LLVM IR (-O0):
define i64 @HibernateRTCMatchGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load volatile i64, i64* inttoptr (i64 1074774020 to i64*)
ret i64 %7
}

LLVM IR (-O2):
define i64 @HibernateRTCMatchGet(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = load volatile i64, i64* inttoptr (i64 1074774020 to i64*)
ret i64 %5
}
int ceph_osd_op_type_exec(int op) { return (op & 0x0f00) == 0x0400; }


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

x86 assembly (clang, -O2):
<ceph_osd_op_type_exec>:
and    $0xf00,%edi
xor    %eax,%eax
cmp    $0x400,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ceph_osd_op_type_exec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3840
%5 = icmp eq i32 %4, 1024
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ceph_osd_op_type_exec(i32 %0) {
%2 = and i32 %0, 3840
%3 = icmp eq i32 %2, 1024
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int sortCompare(void *, void *);
int compareTwoElements(const void *element1, const void *element2) {
  return sortCompare(*(void **)element1, *(void **)element2);
}


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

x86 assembly (clang, -O2):
<compareTwoElements>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <sortCompare@plt>

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

LLVM IR (-O2):
define i32 @compareTwoElements(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @sortCompare(i8* %4, i8* %6)
ret i32 %7
}
double hour2sec(double x) { return (x * 3600.0); }


x86 assembly (clang, -O0):
<hour2sec>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hour2sec>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @hour2sec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.600000e+03
ret double %4
}

LLVM IR (-O2):
define double @hour2sec(double %0) {
%2 = fmul double %0, 3.600000e+03
ret double %2
}
int undoexec(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @undoexec() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ index_to_the_moon(int *);
int main(int argc, char **argv) {
  int intary[100];
  index_to_the_moon(intary);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a0(%rbp),%rdi
call   1030 <index_to_the_moon@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
mov    %rsp,%rdi
call   1030 <index_to_the_moon@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%8 = call i32 @index_to_the_moon(i32* %7)
%9 = load i32, i32* @EXIT_SUCCESS
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i32]
%4 = bitcast [100 x i32]* %3 to i8*
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%6 = call i32 @index_to_the_moon(i32* %5)
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
double rint(double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double a, b;
  printf("Input a real number:");
  scanf("%lf", &a);
  b = rint(a);
  printf("\t    Integer:%f\n", b);
  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    0xec1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <rint@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%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    0xecf(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <rint@plt>
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Input a real number:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [17 x i8] c"\09 Integer:%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 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), double* %2)
%6 = load double, double* %2
%7 = call double @llvm.rint.f64(double %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Input a real number:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [17 x i8] c"\09 Integer:%f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 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), double* %1)
%5 = load double, double* %1
%6 = call double @llvm.rint.f64(double %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stacktop();
int /*<<< orphan*/ xlerror(char *, int /*<<< orphan*/);
xlfail(char *emsg) { xlerror(emsg, stacktop()); }


x86 assembly (clang, -O0):
<xlfail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <stacktop@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <xlerror@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlfail>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <stacktop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <xlerror@plt>

LLVM IR (-O0):
define i32 @xlfail(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (...) @stacktop()
%6 = call i32 @xlerror(i8* %4, i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @xlfail(i8* %0) {
%2 = tail call i32 (...) @stacktop()
%3 = tail call i32 @xlerror(i8* %0, i32 %2)
ret i32 undef
}
unsigned short bit_HWCTS(unsigned reg_value) {
  return (reg_value & 0x4000) == 0x4000;
}


x86 assembly (clang, -O0):
<bit_HWCTS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4000,%eax
cmp    $0x4000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_HWCTS>:
mov    %edi,%eax
shr    $0xe,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define zeroext i16 @bit_HWCTS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16384
%5 = icmp eq i32 %4, 16384
%6 = zext i1 %5 to i32
%7 = trunc i32 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @bit_HWCTS(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = lshr i16 %2, 14
%4 = and i16 %3, 1
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ grecs_free(void *);
void incl_free(void *data) { grecs_free(data); }


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

x86 assembly (clang, -O2):
<incl_free>:
jmp    1030 <grecs_free@plt>

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

LLVM IR (-O2):
define void @incl_free(i8* %0) {
%2 = tail call i32 @grecs_free(i8* %0)
ret void
}
unsigned short ___ia64_readw(void *addr) {
  return *(volatile unsigned short *)addr;
}


x86 assembly (clang, -O0):
<___ia64_readw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<___ia64_readw>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @___ia64_readw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i16*
%5 = load volatile i16, i16* %4
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @___ia64_readw(i8* %0) {
%2 = bitcast i8* %0 to i16*
%3 = load volatile i16, i16* %2
ret i16 %3
}
int test_imm_E7int32_mem(int *val) {
  return ((*val) & (0xE7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E7int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 231
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_n_times(int);
void do_m2_times(int m) {
  for (int i = 0; i < m; i++) {
    do_n_times(m);
  }
}


x86 assembly (clang, -O0):
<do_m2_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1144 <do_m2_times+0x34>
mov    -0x4(%rbp),%edi
call   1030 <do_n_times@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <do_m2_times+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_m2_times>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112c <do_m2_times+0x1c>
mov    %edi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <do_n_times@plt>
add    $0xffffffff,%ebp
jne    1120 <do_m2_times+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @do_m2_times(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @do_n_times(i32 %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ CPL();
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0x2f(void) {
  CPL();
  T_WAIT_UNTIL(4);
  return;
}


x86 assembly (clang, -O0):
<op_0x2f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CPL@plt>
mov    $0x4,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_0x2f>:
push   %rax
xor    %eax,%eax
call   1030 <CPL@plt>
mov    $0x4,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_0x2f() {
%1 = call i32 (...) @CPL()
%2 = call i32 @T_WAIT_UNTIL(i32 4)
ret void
}

LLVM IR (-O2):
define void @op_0x2f() {
%1 = tail call i32 (...) @CPL()
%2 = tail call i32 @T_WAIT_UNTIL(i32 4)
ret void
}
int is_prime(int num) {
  if (num <= 0)
    return -1;
  int divider = 2;
  while (num % divider == 0) {
    if (divider != num) {
      return 0;
      break;
    }
    divider++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <is_prime+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <is_prime+0x61>
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    115a <is_prime+0x5a>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     114c <is_prime+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1161 <is_prime+0x61>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <is_prime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
test   %edi,%edi
jle    1138 <is_prime+0x38>
mov    $0x1,%r8d
test   $0x1,%dil
jne    1134 <is_prime+0x34>
mov    %edi,%esi
neg    %esi
mov    $0x3,%ecx
nopl   0x0(%rax)
lea    (%rsi,%rcx,1),%eax
cmp    $0x1,%eax
jne    113e <is_prime+0x3e>
mov    %edi,%eax
cltd
idiv   %ecx
add    $0x1,%ecx
test   %edx,%edx
je     1120 <is_prime+0x20>
mov    %r8d,%eax
ret
mov    $0xffffffff,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %13
6: ; preds = %9
%7 = srem i32 %0, %12
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3, %6
%10 = phi i32 [ %12, %6 ], [ 2, %3 ]
%11 = icmp eq i32 %10, %0
%12 = add nuw nsw i32 %10, 1
br i1 %11, label %6, label %13
13: ; preds = %6, %9, %3, %1
%14 = phi i32 [ -1, %1 ], [ 1, %3 ], [ 1, %6 ], [ 0, %9 ]
ret i32 %14
}
void InsertI4(int x, unsigned char *buf) {
  buf[3] = x & 0xff;
  x >>= 8;
  buf[2] = x & 0xff;
  x >>= 8;
  buf[1] = x & 0xff;
  x >>= 8;
  buf[0] = x & 0xff;
}


x86 assembly (clang, -O0):
<InsertI4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<InsertI4>:
bswap  %edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @InsertI4(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 3
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 %14, i8* %16
%17 = load i32, i32* %3
%18 = ashr i32 %17, 8
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
%24 = load i32, i32* %3
%25 = ashr i32 %24, 8
store i32 %25, i32* %3
%26 = load i32, i32* %3
%27 = and i32 %26, 255
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i64 0
store i8 %28, i8* %30
ret void
}

LLVM IR (-O2):
define void @InsertI4(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
%4 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %3, i8* %4
%5 = lshr i32 %0, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %6, i8* %7
%8 = lshr i32 %0, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %9, i8* %10
%11 = lshr i32 %0, 24
%12 = trunc i32 %11 to i8
store i8 %12, i8* %1
ret void
}
/* Variables and functions */
char getchar();
void LimpaBuffer() {
  char c = getchar();
  while (c != '\n')
    c = getchar();
}


x86 assembly (clang, -O0):
<LimpaBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     113e <LimpaBuffer+0x2e>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
jmp    1122 <LimpaBuffer+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LimpaBuffer>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <LimpaBuffer+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @LimpaBuffer() {
%1 = alloca i8
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
br label %3
3: ; preds = %7, %0
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %1
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @LimpaBuffer() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(float *, float *);
void foo(float *x, float *y) {
  int n = 1 << 10;
#pragma acc data create(x [0:n]) copyout(y [0:n])
  {
#pragma acc host_data use_device(x, y)
    bar(x, y);
  }
}


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i32
store float* %0, float** %3
store float* %1, float** %4
store i32 1024, i32* %5
%6 = load float*, float** %3
%7 = load float*, float** %4
%8 = call i32 @bar(float* %6, float* %7)
ret void
}

LLVM IR (-O2):
define void @foo(float* %0, float* %1) {
%3 = tail call i32 @bar(float* %0, float* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printUsage(char *exeName) {
  printf("Usage: %s file1 [file2 ...]\n\n", exeName);
}


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

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

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

LLVM IR (-O2):
@.str = [30 x i8] c"Usage: %s file1 [file2 ...]\0A\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}