xunge/DecIR huggingface dataset:
/* Variables and functions */
int printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double r;
  return printf("원의 반지름 : "), scanf("%lf", &r),
         0 * printf("원의 넓이 = %.3lf", r * r * 3.141592);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xea1(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
imul   $0x0,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xeb1(%rip),%xmm0
lea    0xeca(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\EC\9B\90\EC\9D\98 \EB\B0\98\EC\A7\80\EB\A6\84 : \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [22 x i8] c"\EC\9B\90\EC\9D\98 \EB\84\93\EC\9D\B4 = %.3lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 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* %2)
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = fmul double %7, 0x400921FAFC8B007A
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %8)
%10 = mul nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"\EC\9B\90\EC\9D\98 \EB\B0\98\EC\A7\80\EB\A6\84 : \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [22 x i8] c"\EC\9B\90\EC\9D\98 \EB\84\93\EC\9D\B4 = %.3lf\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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 = fmul double %5, %5
%7 = fmul double %6, 0x400921FAFC8B007A
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
double DSConvertZUnitsToFt(int z, int zUnits) { return z * zUnits / 304800.0; }


x86 assembly (clang, -O0):
<DSConvertZUnitsToFt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSConvertZUnitsToFt>:
imul   %esi,%edi
cvtsi2sd %edi,%xmm0
divsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @DSConvertZUnitsToFt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 3.048000e+05
ret double %9
}

LLVM IR (-O2):
define double @DSConvertZUnitsToFt(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 3.048000e+05
ret double %5
}
binary_size(row, col, x, y) int row, col, *x, *y;
{
  *x = col;
  *y = row;
  if (*x > 316 || *y > 316) {
    error(10);
  }
}


x86 assembly (clang, -O0):
<binary_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x13c,(%rax)
jg     1158 <binary_size+0x48>
mov    -0x20(%rbp),%rax
cmpl   $0x13c,(%rax)
jle    1164 <binary_size+0x54>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_size>:
push   %rax
mov    %esi,(%rdx)
mov    %edi,(%rcx)
cmp    $0x13c,%edi
jg     1127 <binary_size+0x17>
cmpl   $0x13d,(%rdx)
jge    1127 <binary_size+0x17>
pop    %rcx
ret
mov    $0xa,%edi
xor    %eax,%eax
call   1030 <error@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @binary_size(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%10 = load i32, i32* %7
%11 = load i32*, i32** %8
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = load i32*, i32** %9
store i32 %12, i32* %13
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
%16 = icmp sgt i32 %15, 316
br i1 %16, label %21, label %17
17: ; preds = %4
%18 = load i32*, i32** %9
%19 = load i32, i32* %18
%20 = icmp sgt i32 %19, 316
br i1 %20, label %21, label %23
21: ; preds = %17, %4
%22 = call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 10)
br label %23
23: ; preds = %21, %17
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @binary_size(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture writeonly %3) {
store i32 %1, i32* %2
store i32 %0, i32* %3
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 316
%7 = icmp sgt i32 %0, 316
%8 = or i1 %7, %6
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 10)
br label %11
11: ; preds = %4, %9
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ O_CREAT;
int /*<<< orphan*/ *sem_open(char *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ sem_wait(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  sem_t *sem = sem_open("/test.sem", O_CREAT, 0666, 66);
  sem_wait(sem);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
mov    $0x1b6,%edx
mov    $0x42,%ecx
call   1040 <sem_open@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <sem_wait@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
mov    $0x1b6,%edx
mov    $0x42,%ecx
call   1040 <sem_open@plt>
mov    %rax,%rdi
call   1030 <sem_wait@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/test.sem\00"
@O_CREAT = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* @O_CREAT
%7 = call i32* @sem_open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6, i32 438, i32 66)
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = call i32 @sem_wait(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/test.sem\00"
@O_CREAT = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_CREAT
%4 = tail call i32* @sem_open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 438, i32 66)
%5 = tail call i32 @sem_wait(i32* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void rtsig_handler(int s) { write(1, "!", 1); }


x86 assembly (clang, -O0):
<rtsig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edx
lea    0xed9(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtsig_handler>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"!\00"
define void @rtsig_handler(i32 %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int rseq_cmpeqv_trymemcpy_storev(intptr_t *, intptr_t, void *, void *, size_t,
                                 intptr_t, int);
__attribute__((always_)) int
rseq_cmpeqv_trymemcpy_storev_release(intptr_t *v, intptr_t expect, void *dst,
                                     void *src, size_t len, intptr_t newv,
                                     int cpu) {
  return rseq_cmpeqv_trymemcpy_storev(v, expect, dst, src, len, newv, cpu);
}


x86 assembly (clang, -O0):
<rseq_cmpeqv_trymemcpy_storev_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <rseq_cmpeqv_trymemcpy_storev@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rseq_cmpeqv_trymemcpy_storev_release>:
jmp    1030 <rseq_cmpeqv_trymemcpy_storev@plt>

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

LLVM IR (-O2):
define i32 @rseq_cmpeqv_trymemcpy_storev_release(i64* %0, i64 %1, i8* %2, i8* %3, i64 %4, i64 %5, i32 %6) {
%8 = tail call i32 @rseq_cmpeqv_trymemcpy_storev(i64* %0, i64 %1, i8* %2, i8* %3, i64 %4, i64 %5, i32 %6)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void PWMIntEnable(unsigned long ulBase, unsigned long ulGenFault) {
  DEBUG_ASSERT((ulBase == 0x40028000) || (ulBase == 0x40029000));
  DEBUG_ASSERT(
      (ulGenFault & ~(0x00000001 | 0x00000002 | 0x00000004 | 0x00000008 |
                      0x00010000 | 0x00020000 | 0x00040000 | 0x00080000)) == 0);
  (*((volatile unsigned long *)(ulBase + 0x00000014))) |= ulGenFault;
}


x86 assembly (clang, -O0):
<PWMIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x40028000,-0x8(%rbp)
40
mov    %al,-0x11(%rbp)
je     1141 <PWMIntEnable+0x31>
cmpq   $0x40029000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0xfffffffffff0fff0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x14(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMIntEnable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40028000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xfffffffffff0fff0,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
or     %r14,0x14(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @PWMIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1073905664
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1073909760
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %4
%15 = and i64 %14, -983056
%16 = icmp eq i64 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @DEBUG_ASSERT(i32 %17)
%19 = load i64, i64* %4
%20 = load i64, i64* %3
%21 = add i64 %20, 20
%22 = inttoptr i64 %21 to i64*
%23 = load volatile i64, i64* %22
%24 = or i64 %23, %19
store volatile i64 %24, i64* %22
ret void
}

LLVM IR (-O2):
define void @PWMIntEnable(i64 %0, i64 %1) {
%3 = and i64 %0, -4097
%4 = icmp eq i64 %3, 1073905664
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = and i64 %1, -983056
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @DEBUG_ASSERT(i32 %9)
%11 = add i64 %0, 20
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = or i64 %13, %1
store volatile i64 %14, i64* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_array_and_pointer_arith(void) {
  test("17 42", "main(){int i[20]; i[0]=17; i[1]=42; int *j=i; printf(\"%d \", "
                "*j); j++; printf(\"%d\", *j);}");
}


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

x86 assembly (clang, -O2):
<TEST_array_and_pointer_arith>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"17 42\00"
@.str.1 = [89 x i8] c"main(){int i[20]; i[0]=17; i[1]=42; int *j=i; printf(\22%d \22, *j); j++; printf(\22%d\22, *j);}\00"
define void @TEST_array_and_pointer_arith() {
%1 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"17 42\00"
@.str.1 = [89 x i8] c"main(){int i[20]; i[0]=17; i[1]=42; int *j=i; printf(\22%d \22, *j); j++; printf(\22%d\22, *j);}\00"
define void @TEST_array_and_pointer_arith() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void finish(float *out) {
  __asm__ volatile("movaps	%%xmm1, %0\n"
                   "movaps	%%xmm2, %1\n"
                   : "=m"(out[0]), "=m"(out[4]));
}


x86 assembly (clang, -O0):
<finish>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x10,%rcx
movaps %xmm1,(%rax)
movaps %xmm2,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<finish>:
movaps %xmm1,(%rdi)
movaps %xmm2,0x10(%rdi)
ret

LLVM IR (-O0):
define void @finish(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 4
ret void
}

LLVM IR (-O2):
define void @finish(float* %0) {
%2 = getelementptr inbounds float, float* %0, i64 4
tail call void asm sideeffect "movaps\09%xmm1, $0\0Amovaps\09%xmm2, $1\0A", "=*m,=*m,~{dirflag},~{fpsr},~{flags}"(float* elementtype(float) %0, float* elementtype(float) %2)
ret void
}
int adis16350_configure_ring(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @adis16350_configure_ring(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
int is_power(int x, int ofy) {
  while ((x % ofy) == 0) {
    x /= ofy;
  }
  return x == 1;
}


x86 assembly (clang, -O0):
<is_power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    112b <is_power+0x2b>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110a <is_power+0xa>
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power>:
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cltd
idiv   %esi
test   %edx,%edx
jne    1120 <is_power+0x20>
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%edi
jmp    1110 <is_power+0x10>
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_power(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ %0, %2 ]
%7 = sdiv i32 %6, %1
%8 = srem i32 %7, %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %2
%11 = phi i32 [ %0, %2 ], [ %7, %5 ]
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
ret i32 %13
}
int is_square(int x) {
  if (x & 0x88)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x88,%eax
cmp    $0x0,%eax
je     1124 <is_square+0x24>
movl   $0x0,-0x4(%rbp)
jmp    112b <is_square+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_square(i32 %0) {
%2 = and i32 %0, 136
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int dcd_getpid();
int kill(int, int);
int dcd_kill(int signal) {
  int pid = dcd_getpid();
  int k = 0;
  if (pid != 0)
    k = kill(pid, signal);
  return pid;
}


x86 assembly (clang, -O0):
<dcd_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <dcd_getpid@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1154 <dcd_kill+0x34>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <kill@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcd_kill>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <dcd_getpid@plt>
mov    %eax,%ebp
test   %eax,%eax
je     113b <dcd_kill+0x1b>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <kill@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dcd_kill(i32 %0) {
%2 = tail call i32 (...) @dcd_getpid()
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @kill(i32 %2, i32 %0)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Type definitions */
struct LaneDetectorParserInfo {
  int dummy;
};

/* Variables and functions */
int LaneDetectorParser2(int, char **, struct LaneDetectorParserInfo *,
                        int /*<<< orphan*/, int, int);
int LaneDetectorParser(int argc, char **argv,
                       struct LaneDetectorParserInfo *args_info) {
  return LaneDetectorParser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<LaneDetectorParser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <LaneDetectorParser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LaneDetectorParser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <LaneDetectorParser2@plt>

LLVM IR (-O0):
%struct.LaneDetectorParserInfo = type { i32 }
define i32 @LaneDetectorParser(i32 %0, i8** %1, %struct.LaneDetectorParserInfo* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.LaneDetectorParserInfo*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.LaneDetectorParserInfo* %2, %struct.LaneDetectorParserInfo** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.LaneDetectorParserInfo*, %struct.LaneDetectorParserInfo** %6
%10 = call i32 @LaneDetectorParser2(i32 %7, i8** %8, %struct.LaneDetectorParserInfo* %9, i32 0, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.LaneDetectorParserInfo = type { i32 }
define i32 @LaneDetectorParser(i32 %0, i8** %1, %struct.LaneDetectorParserInfo* %2) {
%4 = tail call i32 @LaneDetectorParser2(i32 %0, i8** %1, %struct.LaneDetectorParserInfo* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
void ext_fun(void) {}


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

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

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

LLVM IR (-O2):
define void @ext_fun() {
ret void
}
unsigned char update_hg_mask(unsigned char state, unsigned char mask) {
  unsigned char val;
  ;
  val = (state ^ mask) & 0xF;
  val = val << 4;
  mask |= val;
  mask &= 0xF0;
  mask |= (state & 0xF);
  ;
  return mask;
}


x86 assembly (clang, -O0):
<update_hg_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
xor    %ecx,%eax
and    $0xf,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xf0,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0xf,%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_hg_mask>:
mov    %esi,%ecx
xor    %dil,%cl
shl    $0x4,%cl
and    $0xf0,%sil
and    $0xf,%dil
lea    (%rdi,%rsi,1),%eax
or     %cl,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @update_hg_mask(i8 zeroext %0, i8 zeroext %1) {
%3 = xor i8 %1, %0
%4 = shl i8 %3, 4
%5 = and i8 %1, -16
%6 = and i8 %0, 15
%7 = or i8 %5, %6
%8 = or i8 %7, %4
ret i8 %8
}
int kdb_stub(struct kgdb_state *ks) { return -12345; }


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

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

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

LLVM IR (-O2):
%struct.kgdb_state = type opaque
define i32 @kdb_stub(%struct.kgdb_state* nocapture readnone %0) {
ret i32 -12345
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void MacOSX() { printf("This is a Mac OS X build.\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"This is a Mac OS X build.\0A\00"
define void @MacOSX() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"This is a Mac OS X build.\00"
define void @MacOSX() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t _hs_htable_hash_ptr(const void *p) {
  return (uint32_t)((uintptr_t)p >> 3);
}


x86 assembly (clang, -O0):
<_hs_htable_hash_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hs_htable_hash_ptr>:
mov    %rdi,%rax
shr    $0x3,%rax
ret

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

LLVM IR (-O2):
define i32 @_hs_htable_hash_ptr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 3
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ calloc(size_t, int);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *my_strdup(const char *p) {
  size_t tStringSize;
  char *pcResultString;
  tStringSize = 0;
  pcResultString = NULL;
  if (p != NULL) {
    tStringSize = strlen(p);
    pcResultString = (char *)calloc(tStringSize + 1, sizeof(char));
    strcpy(pcResultString, p);
  }
  return (pcResultString);
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1187 <my_strdup+0x57>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <my_strdup+0x2f>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    1162 <my_strdup+0x32>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
store i64 0, i64* %3
store i8* null, i8** %4
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = add i64 %10, 1
%12 = call i64 @calloc(i64 %11, i32 1)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
br label %17
17: ; preds = %7, %1
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add i64 %4, 1
%6 = tail call i64 @calloc(i64 %5, i32 1)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %9
9: ; preds = %3, %1
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_ljmp(FILE *stream, uint8_t addr16_high, uint8_t addr16_low) {
  fprintf(stream,
          "LJMP  "
          "0x%04X"
          "                    ",
          (addr16_high << 8) + addr16_low);
}


x86 assembly (clang, -O0):
<fprint_ljmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
shl    $0x8,%edx
add    -0x10(%rbp),%edx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_ljmp>:
shl    $0x8,%esi
add    %esi,%edx
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"LJMP 0x%04X \00"
define void @fprint_ljmp(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = shl i32 %8, 8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"LJMP 0x%04X \00"
define void @fprint_ljmp(i32* nocapture %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 8
%5 = add nsw i32 %4, %2
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int *p;
  printf("zmienna  p = %p\n", (void *)p);
  *p = 4;
  printf("zmienna *p = %d\n", *p);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"zmienna p = %p\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 undef)
unreachable
}
int test_imm_87uint8_mem(unsigned char *val) {
  return ((*val) & (-0x87 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_87uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -135
%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_87uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 121
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float absoluteValue(float x) {
  if (x < 0) {
    x = -x;
  }
  return (x);
}


x86 assembly (clang, -O0):
<absoluteValue>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112d <absoluteValue+0x2d>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absoluteValue>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @absoluteValue(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
store float %7, float* %2
br label %8
8: ; preds = %5, %1
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @absoluteValue(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ lcdsend(int, int /*<<< orphan*/, int);
int lcdclear(int fd) {
  lcdsend(fd, 0, 0x01);
  return 0;
}


x86 assembly (clang, -O0):
<lcdclear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <lcdsend@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcdclear>:
push   %rax
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <lcdsend@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @lcdclear(i32 %0) {
%2 = tail call i32 @lcdsend(i32 %0, i32 0, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bar(int);
scalar_t__ baz(int);
int foo(int);
int main() {
  if (foo(0x7fffffff) != (bar(0x7fffffff) < 0x7fffffff) ||
      foo(0x7fffffff) != ((int)baz(0x7fffffff) + 1 < 0x7fffffff))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7fffffff,%edi
call   1060 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    $0x7fffffff,%edi
call   1050 <bar@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    $0x7fffffff,%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    11b9 <main+0x79>
mov    $0x7fffffff,%edi
call   1060 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    $0x7fffffff,%edi
call   1040 <baz@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
add    $0x1,%ecx
cmp    $0x7fffffff,%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     11c0 <main+0x80>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7fffffff,%edi
call   1060 <foo@plt>
mov    %eax,%ebx
mov    $0x7fffffff,%edi
call   1050 <bar@plt>
xor    %ecx,%ecx
cmp    $0x7fffffff,%eax
setne  %cl
cmp    %ecx,%ebx
jne    118d <main+0x4d>
mov    $0x7fffffff,%edi
call   1060 <foo@plt>
mov    %eax,%ebx
mov    $0x7fffffff,%edi
call   1040 <baz@plt>
xor    %ecx,%ecx
cmp    $0x7ffffffe,%eax
setne  %cl
cmp    %ecx,%ebx
jne    118d <main+0x4d>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 2147483647)
%3 = call i32 @bar(i32 2147483647)
%4 = icmp slt i32 %3, 2147483647
%5 = zext i1 %4 to i32
%6 = icmp ne i32 %2, %5
br i1 %6, label %15, label %7
7: ; preds = %0
%8 = call i32 @foo(i32 2147483647)
%9 = call i64 @baz(i32 2147483647)
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %10, 1
%12 = icmp slt i32 %11, 2147483647
%13 = zext i1 %12 to i32
%14 = icmp ne i32 %8, %13
br i1 %14, label %15, label %17
15: ; preds = %7, %0
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 2147483647)
%2 = tail call i32 @bar(i32 2147483647)
%3 = icmp ne i32 %2, 2147483647
%4 = zext i1 %3 to i32
%5 = icmp eq i32 %1, %4
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = tail call i32 @foo(i32 2147483647)
%8 = tail call i64 @baz(i32 2147483647)
%9 = trunc i64 %8 to i32
%10 = icmp ne i32 %9, 2147483646
%11 = zext i1 %10 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %15, label %13
13: ; preds = %6, %0
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %6
ret i32 0
}
unsigned int hash_33(char *key) {
  unsigned int hash = 0;
  while (*key) {
    hash = (hash << 5) + hash + *key++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_33>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <hash_33+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_33+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_33>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash_33+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_33+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_33(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glTexCoord3dv(int /*<<< orphan*/ *);
void TexCoord3dv(GLdouble v[3]) { glTexCoord3dv(v); }


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

x86 assembly (clang, -O2):
<TexCoord3dv>:
jmp    1030 <glTexCoord3dv@plt>

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

LLVM IR (-O2):
define void @TexCoord3dv(i32* %0) {
%2 = tail call i32 @glTexCoord3dv(i32* %0)
ret void
}
void gtk_widget_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_path() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dbg_tmr_reset();
void dbg_tmr_setup(void) { dbg_tmr_reset(); }


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

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

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

LLVM IR (-O2):
define void @dbg_tmr_setup() {
%1 = tail call i32 (...) @dbg_tmr_reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ preload_seq(int);
void main(void) {
  preload_seq(173);
  preload_seq(55);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xad,%edi
call   1030 <preload_seq@plt>
mov    $0x37,%edi
call   1030 <preload_seq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xad,%edi
call   1030 <preload_seq@plt>
mov    $0x37,%edi
pop    %rax
jmp    1030 <preload_seq@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @preload_seq(i32 173)
%2 = call i32 @preload_seq(i32 55)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @preload_seq(i32 173)
%2 = tail call i32 @preload_seq(i32 55)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tml_sr_vAbs2(float *, float *, int);
void tml_sr_vAbs1(float *vec, int n) { tml_sr_vAbs2(vec, vec, n); }


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

x86 assembly (clang, -O2):
<tml_sr_vAbs1>:
mov    %esi,%edx
mov    %rdi,%rsi
jmp    1030 <tml_sr_vAbs2@plt>

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

LLVM IR (-O2):
define void @tml_sr_vAbs1(float* %0, i32 %1) {
%3 = tail call i32 @tml_sr_vAbs2(float* %0, float* %0, i32 %1)
ret void
}
void RTC_Alarm_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @RTC_Alarm_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_line_header(void) {
  printf("                                                         s b e\n"
         "                                                         t l s\n"
         "                                                         m c e\n"
         " section    op                                       col t k q\n"
         " offset     code               address     file line umn ? ? ?\n");
}


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

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

LLVM IR (-O0):
@.str = [316 x i8] c" s b e\0A t l s\0A m c e\0A section op col t k q\0A offset code address file line umn ? ? ?\0A\00"
define void @print_line_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([316 x i8], [316 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [315 x i8] c" s b e\0A t l s\0A m c e\0A section op col t k q\0A offset code address file line umn ? ? ?\00"
define void @print_line_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([315 x i8], [315 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *thread_main(void *arg) {
  int i;
  double result = 0.0;
  printf("thread: %d\n", *((int *)arg));
}


x86 assembly (clang, -O0):
<thread_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_main>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"thread: %d\0A\00"
define i8* @thread_main(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca double
store i8* %0, i8** %3
store double 0.000000e+00, double* %5
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [12 x i8] c"thread: %d\0A\00"
define noalias i8* @thread_main(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ BITBOARD_init();
int /*<<< orphan*/ test_BITBOARD_count_bits();
int /*<<< orphan*/ test_BITBOARD_find_bit();
int /*<<< orphan*/ test_bitboard_size();
int /*<<< orphan*/ test_bitboard_unsigned();
int main() {
  BITBOARD_init();
  test_bitboard_size();
  test_bitboard_unsigned();
  test_BITBOARD_count_bits();
  test_BITBOARD_find_bit();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <BITBOARD_init@plt>
mov    $0x0,%al
call   1040 <test_bitboard_size@plt>
mov    $0x0,%al
call   1070 <test_bitboard_unsigned@plt>
mov    $0x0,%al
call   1030 <test_BITBOARD_count_bits@plt>
mov    $0x0,%al
call   1060 <test_BITBOARD_find_bit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <BITBOARD_init@plt>
xor    %eax,%eax
call   1040 <test_bitboard_size@plt>
xor    %eax,%eax
call   1070 <test_bitboard_unsigned@plt>
xor    %eax,%eax
call   1030 <test_BITBOARD_count_bits@plt>
xor    %eax,%eax
call   1060 <test_BITBOARD_find_bit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @BITBOARD_init()
%3 = call i32 (...) @test_bitboard_size()
%4 = call i32 (...) @test_bitboard_unsigned()
%5 = call i32 (...) @test_BITBOARD_count_bits()
%6 = call i32 (...) @test_BITBOARD_find_bit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @BITBOARD_init()
%2 = tail call i32 (...) @test_bitboard_size()
%3 = tail call i32 (...) @test_bitboard_unsigned()
%4 = tail call i32 (...) @test_BITBOARD_count_bits()
%5 = tail call i32 (...) @test_BITBOARD_find_bit()
ret i32 0
}
int test_imm_79int8_mem(signed char *val) {
  return ((*val) & (-0x79 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_79int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -121
%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_79int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -121
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}