xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printBits(int, unsigned int *);
int /*<<< orphan*/ printf(char *);
unsigned int rightrot(unsigned int, int);
int main(void) {
  unsigned int x;
  x = 52942;
  int n;
  n = 6;
  printf("original:   ");
  printBits(sizeof(x), &x);
  x = rightrot(x, n);
  printf("\nafter rotr: ");
  printBits(sizeof(x), &x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xcece,0xc(%rsp)
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xc(%rsp),%rbx
mov    $0x4,%edi
mov    %rbx,%rsi
call   1030 <printBits@plt>
mov    0xc(%rsp),%edi
mov    $0x6,%esi
call   1050 <rightrot@plt>
mov    %eax,0xc(%rsp)
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1030 <printBits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"original: \00"
@.str.1 = [14 x i8] c"\0Aafter rotr: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 52942, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printBits(i32 4, i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @rightrot(i32 %5, i32 6)
store i32 %6, i32* %1
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printBits(i32 4, i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ atan2(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ cos(float);
float deg2rad(float);
float rad2deg(int /*<<< orphan*/);
int /*<<< orphan*/ sin(float);
float signedDiff(float deg1, float deg2) {
  float diff = deg2rad(deg1) - deg2rad(deg2);
  float angle = rad2deg(atan2(sin(diff), cos(diff)));
  return angle;
}


x86 assembly (clang, -O0):
<signedDiff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <deg2rad@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <deg2rad@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <sin@plt>
mov    %eax,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
call   1070 <cos@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <atan2@plt>
mov    %eax,%edi
call   1060 <rad2deg@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedDiff>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
call   1040 <deg2rad@plt>
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
call   1040 <deg2rad@plt>
movss  0x8(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
movaps %xmm1,%xmm0
call   1050 <sin@plt>
mov    %eax,%ebx
movss  0x8(%rsp),%xmm0
call   1070 <cos@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <atan2@plt>
mov    %eax,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1060 <rad2deg@plt>

LLVM IR (-O0):
define float @signedDiff(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
%8 = call float @deg2rad(float %7)
%9 = load float, float* %4
%10 = call float @deg2rad(float %9)
%11 = fsub float %8, %10
store float %11, float* %5
%12 = load float, float* %5
%13 = call i32 @sin(float %12)
%14 = load float, float* %5
%15 = call i32 @cos(float %14)
%16 = call i32 @atan2(i32 %13, i32 %15)
%17 = call float @rad2deg(i32 %16)
store float %17, float* %6
%18 = load float, float* %6
ret float %18
}

LLVM IR (-O2):
define float @signedDiff(float %0, float %1) {
%3 = tail call float @deg2rad(float %0)
%4 = tail call float @deg2rad(float %1)
%5 = fsub float %3, %4
%6 = tail call i32 @sin(float %5)
%7 = tail call i32 @cos(float %5)
%8 = tail call i32 @atan2(i32 %6, i32 %7)
%9 = tail call float @rad2deg(i32 %8)
ret float %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
char *fgets_or_exit(char *buf, int size, FILE *stream) {
  if (fgets(buf, size, stream) == NULL)
    exit(1);
  return buf;
}


x86 assembly (clang, -O0):
<fgets_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%rax
jne    1157 <fgets_or_exit+0x37>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_or_exit>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fgets@plt>
test   %rax,%rax
je     1133 <fgets_or_exit+0x13>
mov    %rbx,%rax
pop    %rbx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @fgets_or_exit(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32* @fgets(i8* %7, i32 %8, i32* %9)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %3
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @fgets_or_exit(i8* returned %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3
ret i8* %0
}
int foo() {
  int x = 5;
  if (3 < 4 || 7 < (x++)) {
    x = 0;
  };
  int y = 19;
  int n = ((3 < 4 || 7 < ((x++) - y)) ? 1 : 2);
  n = (2 < 1 ? 1 : (5 > 4 ? 1 : 2));
  return (0 + (7 > 9 ? 1 : 0));
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
movl   $0x13,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 5, i32* %1
store i32 0, i32* %1
store i32 19, i32* %2
store i32 1, i32* %3
store i32 1, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *am(size_t n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<am>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @am(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int _min(int first, int second) {
  if (first <= second)
    return first;
  else
    return second;
}


x86 assembly (clang, -O0):
<_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <_min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
double gatecap(width, wirelength)
double width;
double wirelength;
{ return (width * 0.8 * (1.95e-15) + wirelength * 0.25e-15 * 0.8); }


x86 assembly (clang, -O0):
<gatecap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xef2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeed(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xed8(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gatecap>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm2,%xmm0
mulsd  0xef4(%rip),%xmm1
mulsd  %xmm1,%xmm2
mulsd  0xef0(%rip),%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @gatecap(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fmul double %5, 8.000000e-01
%7 = load double, double* %4
%8 = fmul double %7, 2.500000e-16
%9 = fmul double %8, 8.000000e-01
%10 = call double @llvm.fmuladd.f64(double %6, double 1.950000e-15, double %9)
ret double %10
}

LLVM IR (-O2):
define double @gatecap(double %0, double %1) {
%3 = fmul double %0, 8.000000e-01
%4 = fmul double %1, 2.500000e-16
%5 = fmul double %4, 8.000000e-01
%6 = tail call double @llvm.fmuladd.f64(double %3, double 1.950000e-15, double %5)
ret double %6
}
void rop3_237_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

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

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

LLVM IR (-O2):
define void @rop3_237_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %2, %1
%7 = or i8 %6, %5
%8 = xor i8 %7, -1
%9 = and i8 %4, %6
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
void helloworld(const char *name, void (*language)(const char *)) {
  language(name);
}


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

x86 assembly (clang, -O2):
<helloworld>:
jmp    *%rsi

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

LLVM IR (-O2):
define void @helloworld(i8* %0, void (i8*)* nocapture %1) {
tail call void %1(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

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


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

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

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

LLVM IR (-O2):
define void @round_l_d(double* nocapture %0, i64* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = tail call i64 @round(double %3)
store i64 %4, i64* %1
ret void
}
/* Type definitions */
struct lemon {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ machine_reset(struct lemon *);
void lemon_machine_reset(struct lemon *lemon) { machine_reset(lemon); }


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

x86 assembly (clang, -O2):
<lemon_machine_reset>:
jmp    1030 <machine_reset@plt>

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

LLVM IR (-O2):
%struct.lemon = type { i32 }
define void @lemon_machine_reset(%struct.lemon* %0) {
%2 = tail call i32 @machine_reset(%struct.lemon* %0)
ret void
}
/* Type definitions */
struct BuffList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DuanChangBuff_SetDot(struct BuffList *);
void BuffList_SetDuanChangDot(struct BuffList *self) {
  DuanChangBuff_SetDot(self);
}


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

x86 assembly (clang, -O2):
<BuffList_SetDuanChangDot>:
jmp    1030 <DuanChangBuff_SetDot@plt>

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

LLVM IR (-O2):
%struct.BuffList = type { i32 }
define void @BuffList_SetDuanChangDot(%struct.BuffList* %0) {
%2 = tail call i32 @DuanChangBuff_SetDot(%struct.BuffList* %0)
ret void
}
void _emptyExtraDataReduce(void *retValue, void *data[],
                           unsigned int nThreads) {
  (void)retValue;
  (void)data;
  (void)nThreads;
}


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

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

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

LLVM IR (-O2):
define void @_emptyExtraDataReduce(i8* nocapture %0, i8** nocapture %1, i32 %2) {
ret void
}
int abs(int x) {
  int y = (x >> 31);
  return (x ^ y) - y;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Pid(int);
int main() {
  while (1) {
    Pid(665);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x299,%edi
call   1030 <Pid@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x299,%edi
call   1030 <Pid@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @Pid(i32 665)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @Pid(i32 665)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned long *, void const *, int);
long int compare_uli(const void *data1, const void *data2) {
  unsigned long int i1, i2;
  memcpy(&i1, data1, sizeof(unsigned long int));
  memcpy(&i2, data2, sizeof(unsigned long int));
  return (long int)(i1 - i2);
}


x86 assembly (clang, -O0):
<compare_uli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_uli>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x8(%rsp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    0x8(%rsp),%rax
sub    (%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @compare_uli(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @memcpy(i64* %5, i8* %7, i32 8)
%9 = load i8*, i8** %4
%10 = call i32 @memcpy(i64* %6, i8* %9, i32 8)
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = sub i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @compare_uli(i8* %0, i8* %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = call i32 @memcpy(i64* %3, i8* %0, i32 8)
%8 = call i32 @memcpy(i64* %4, i8* %1, i32 8)
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = sub i64 %9, %10
ret i64 %11
}
/* Type definitions */
struct data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct data *);
void destroy_func(struct data *data) { free(data); }


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

x86 assembly (clang, -O2):
<destroy_func>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.data = type { i32 }
define void @destroy_func(%struct.data* nocapture %0) {
%2 = tail call i32 @free(%struct.data* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *);
void print_list_header() {
  printf("\n%18s%18s%11s%11s%11s", "snd_addr", "rcv_addr", "jitter", "loss",
         "srtt");
}


x86 assembly (clang, -O0):
<print_list_header>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef4(%rip),%rsi
lea    0xef6(%rip),%rdx
lea    0xef8(%rip),%rcx
lea    0xef8(%rip),%r8
lea    0xef6(%rip),%r9
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_list_header>:
lea    0xee9(%rip),%rdi
lea    0xef8(%rip),%rsi
lea    0xefa(%rip),%rdx
lea    0xefc(%rip),%rcx
lea    0xefc(%rip),%r8
lea    0xefa(%rip),%r9
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\0A%18s%18s%11s%11s%11s\00"
@.str.1 = [9 x i8] c"snd_addr\00"
@.str.2 = [9 x i8] c"rcv_addr\00"
@.str.3 = [7 x i8] c"jitter\00"
@.str.4 = [5 x i8] c"loss\00"
@.str.5 = [5 x i8] c"srtt\00"
define void @print_list_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0A%18s%18s%11s%11s%11s\00"
@.str.1 = [9 x i8] c"snd_addr\00"
@.str.2 = [9 x i8] c"rcv_addr\00"
@.str.3 = [7 x i8] c"jitter\00"
@.str.4 = [5 x i8] c"loss\00"
@.str.5 = [5 x i8] c"srtt\00"
define void @print_list_header() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}
int is_valid_size(int width, int height) {
  if (width >= 5 && width < 'Z' && height >= 5 && height < 100) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_valid_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x5,-0x8(%rbp)
jl     113e <is_valid_size+0x3e>
cmpl   $0x5a,-0x8(%rbp)
jge    113e <is_valid_size+0x3e>
cmpl   $0x5,-0xc(%rbp)
jl     113e <is_valid_size+0x3e>
cmpl   $0x64,-0xc(%rbp)
jge    113e <is_valid_size+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <is_valid_size+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_size>:
add    $0xfffffffb,%edi
cmp    $0x55,%edi
setb   %al
add    $0xfffffffb,%esi
cmp    $0x5f,%esi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_valid_size(i32 %0, i32 %1) {
%3 = add i32 %0, -5
%4 = icmp ult i32 %3, 85
%5 = add i32 %1, -5
%6 = icmp ult i32 %5, 95
%7 = and i1 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
char *itob(int /*<<< orphan*/, int, char *);
char *uint16tob(uint16_t in, char *out) { return itob(in, 16, out); }


x86 assembly (clang, -O0):
<uint16tob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x10,%esi
call   1030 <itob@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint16tob>:
mov    %rsi,%rdx
mov    $0x10,%esi
jmp    1030 <itob@plt>

LLVM IR (-O0):
define i8* @uint16tob(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 = load i8*, i8** %4
%7 = call i8* @itob(i32 %5, i32 16, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @uint16tob(i32 %0, i8* %1) {
%3 = tail call i8* @itob(i32 %0, i32 16, i8* %1)
ret i8* %3
}
/* Variables and functions */
void foo_defined_in_subtarget1() {
  int *t = NULL;
  *t = 42;
}


x86 assembly (clang, -O0):
<foo_defined_in_subtarget1>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @foo_defined_in_subtarget1() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 42, i32* %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ cp15_dcache_clean();
int /*<<< orphan*/ cp15_dcache_invalidate();
int /*<<< orphan*/ l2cc_cache_sync();
int /*<<< orphan*/ l2cc_clean_invalidate_way(int);
scalar_t__ l2cc_is_enabled();
void l2cc_clean_invalidate(void) {
  cp15_dcache_clean();
  if (l2cc_is_enabled()) {
    l2cc_clean_invalidate_way(0xFF);
    l2cc_cache_sync();
  }
  cp15_dcache_invalidate();
}


x86 assembly (clang, -O0):
<l2cc_clean_invalidate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cp15_dcache_clean@plt>
mov    $0x0,%al
call   1070 <l2cc_is_enabled@plt>
cmp    $0x0,%rax
je     117d <l2cc_clean_invalidate+0x2d>
mov    $0xff,%edi
call   1060 <l2cc_clean_invalidate_way@plt>
mov    $0x0,%al
call   1050 <l2cc_cache_sync@plt>
mov    $0x0,%al
call   1030 <cp15_dcache_invalidate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<l2cc_clean_invalidate>:
push   %rax
xor    %eax,%eax
call   1040 <cp15_dcache_clean@plt>
xor    %eax,%eax
call   1070 <l2cc_is_enabled@plt>
test   %rax,%rax
je     1175 <l2cc_clean_invalidate+0x25>
mov    $0xff,%edi
call   1060 <l2cc_clean_invalidate_way@plt>
xor    %eax,%eax
call   1050 <l2cc_cache_sync@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cp15_dcache_invalidate@plt>

LLVM IR (-O0):
define void @l2cc_clean_invalidate() {
%1 = call i32 (...) @cp15_dcache_clean()
%2 = call i64 (...) @l2cc_is_enabled()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @l2cc_clean_invalidate_way(i32 255)
%6 = call i32 (...) @l2cc_cache_sync()
br label %7
7: ; preds = %4, %0
%8 = call i32 (...) @cp15_dcache_invalidate()
ret void
}

LLVM IR (-O2):
define void @l2cc_clean_invalidate() {
%1 = tail call i32 (...) @cp15_dcache_clean()
%2 = tail call i64 (...) @l2cc_is_enabled()
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @l2cc_clean_invalidate_way(i32 255)
%6 = tail call i32 (...) @l2cc_cache_sync()
br label %7
7: ; preds = %4, %0
%8 = tail call i32 (...) @cp15_dcache_invalidate()
ret void
}
/* Variables and functions */
scalar_t__ strlen(char const *);
char *xcopy(char const *, scalar_t__, size_t);
char *xstrdup(const char *str, size_t expand) {
  return xcopy(str, strlen(str) + 1, expand);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
mov    -0x10(%rbp),%rdx
call   1040 <xcopy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <xcopy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = load i64, i64* %4
%10 = call i8* @xcopy(i8* %5, i64 %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0, i64 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @xcopy(i8* %0, i64 %4, i64 %1)
ret i8* %5
}
void vid_vsync_pre(void) {
  while (*(volatile unsigned short *)0x04000006 >= 160)
    ;
}


x86 assembly (clang, -O0):
<vid_vsync_pre>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <vid_vsync_pre+0x9>
mov    $0x4000006,%eax
mov    (%rax),%ax
movzwl %ax,%eax
cmp    $0xa0,%eax
jl     1124 <vid_vsync_pre+0x24>
jmp    1109 <vid_vsync_pre+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vid_vsync_pre>:
movzwl 0x4000006,%eax
04
cmp    $0x9f,%eax
ja     1100 <vid_vsync_pre>
ret

LLVM IR (-O0):
define void @vid_vsync_pre() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i16, i16* inttoptr (i64 67108870 to i16*)
%3 = zext i16 %2 to i32
%4 = icmp sge i32 %3, 160
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @vid_vsync_pre() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i16, i16* inttoptr (i64 67108870 to i16*)
%3 = icmp ugt i16 %2, 159
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: evtest /dev/input/eventX\n");
  printf("Where X = input device number\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: evtest /dev/input/eventX\0A\00"
@.str.1 = [31 x i8] c"Where X = input device number\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"Usage: evtest /dev/input/eventX\00"
@str.2 = [30 x i8] c"Where X = input device number\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
double M_PI;
double todeg(double r) { return r * 180.0 / M_PI; }


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

x86 assembly (clang, -O2):
<todeg>:
mulsd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @todeg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = load double, double* @M_PI
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @todeg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = load double, double* @M_PI
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
long fp_exp10(long, unsigned int);
long fp_factor(long decibels, unsigned int fracbits) {
  return fp_exp10((long)((((long long)(decibels)) << (fracbits)) /
                         ((long long)((20L << fracbits)))),
                  fracbits);
}


x86 assembly (clang, -O0):
<fp_factor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    %cl,%rax
mov    -0xc(%rbp),%ecx
mov    $0x14,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0xc(%rbp),%esi
call   1030 <fp_exp10@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_factor>:
mov    %esi,%ecx
mov    %rdi,%rax
shl    %cl,%rax
mov    $0x14,%esi
shl    %cl,%rsi
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1133 <fp_factor+0x23>
cqto
idiv   %rsi
jmp    1137 <fp_factor+0x27>
xor    %edx,%edx
div    %esi
mov    %rax,%rdi
mov    %ecx,%esi
jmp    1030 <fp_exp10@plt>

LLVM IR (-O0):
define i64 @fp_factor(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = shl i64 %5, %7
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = shl i64 20, %10
%12 = sdiv i64 %8, %11
%13 = load i32, i32* %4
%14 = call i64 @fp_exp10(i64 %12, i32 %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @fp_factor(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = shl i64 %0, %3
%5 = shl i64 20, %3
%6 = sdiv i64 %4, %5
%7 = tail call i64 @fp_exp10(i64 %6, i32 %1)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello, World!");
  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 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int cycle_is_sprite_dma1_dma2(unsigned int flags) {
  return (flags & 0x00000e00) == 0x00000800;
}


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

x86 assembly (clang, -O2):
<cycle_is_sprite_dma1_dma2>:
and    $0xe00,%edi
xor    %eax,%eax
cmp    $0x800,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @cycle_is_sprite_dma1_dma2(i32 %0) {
%2 = and i32 %0, 3584
%3 = icmp eq i32 %2, 2048
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ L1C_CleanInvalidateCache(int);
void L1C_CleanInvalidateDCacheAll(void) { L1C_CleanInvalidateCache(2); }


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

x86 assembly (clang, -O2):
<L1C_CleanInvalidateDCacheAll>:
mov    $0x2,%edi
jmp    1030 <L1C_CleanInvalidateCache@plt>

LLVM IR (-O0):
define void @L1C_CleanInvalidateDCacheAll() {
%1 = call i32 @L1C_CleanInvalidateCache(i32 2)
ret void
}

LLVM IR (-O2):
define void @L1C_CleanInvalidateDCacheAll() {
%1 = tail call i32 @L1C_CleanInvalidateCache(i32 2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32r8(uint32_t x) { return (x >> 8) | (x << 24); }


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

x86 assembly (clang, -O2):
<rot32r8>:
mov    %edi,%eax
sar    $0x8,%eax
shl    $0x18,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32r8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 24
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32r8(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 24
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_multprec_start_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(283, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_multprec_start_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x11b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_multprec_start_system_to_container>:
mov    $0x11b,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @copy_multprec_start_system_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 283, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_multprec_start_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 283, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int sigwait(int /*<<< orphan*/ *, int *);
void test(void) {
  sigset_t set;
  int sig;
  int result;
  result = sigwait(&set, &sig);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <sigwait@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <sigwait@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @sigwait(i32* %1, i32* %2)
store i32 %4, i32* %3
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sigwait(i32* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ turnOffLed(int);
void turnOffLight1(void) { turnOffLed(3); }


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

x86 assembly (clang, -O2):
<turnOffLight1>:
mov    $0x3,%edi
jmp    1030 <turnOffLed@plt>

LLVM IR (-O0):
define void @turnOffLight1() {
%1 = call i32 @turnOffLed(i32 3)
ret void
}

LLVM IR (-O2):
define void @turnOffLight1() {
%1 = tail call i32 @turnOffLed(i32 3)
ret void
}
/* Variables and functions */
int bbm_hostif_select(void *, unsigned char, unsigned int);
int bbm_com_hostif_select(void *handle, unsigned char hostif,
                          unsigned int param) {
  int res = 1;
  res = bbm_hostif_select(handle, hostif, param);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_hostif_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%edx
movzbl %al,%esi
call   1030 <bbm_hostif_select@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_hostif_select>:
jmp    1030 <bbm_hostif_select@plt>

LLVM IR (-O0):
define i32 @bbm_com_hostif_select(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
store i32 1, i32* %7
%8 = load i8*, i8** %4
%9 = load i8, i8* %5
%10 = load i32, i32* %6
%11 = call i32 @bbm_hostif_select(i8* %8, i8 zeroext %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @bbm_com_hostif_select(i8* %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 @bbm_hostif_select(i8* %0, i8 zeroext %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int omap_rev();
int is_omap1621(void) {
  return (((omap_rev() >> 16) & 0xffff) == (0x1621)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_omap1621>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
sar    $0x10,%edx
and    $0xffff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1621,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap1621>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x16210000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap1621() {
%1 = call i32 (...) @omap_rev()
%2 = ashr i32 %1, 16
%3 = and i32 %2, 65535
%4 = icmp eq i32 %3, 5665
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_omap1621() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, 371261440
%4 = zext i1 %3 to i32
ret i32 %4
}
void tegra_smmu_resume(struct tegra_smmu *smmu) {}


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

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

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

LLVM IR (-O2):
%struct.tegra_smmu = type opaque
define void @tegra_smmu_resume(%struct.tegra_smmu* nocapture %0) {
ret void
}
void test_no_clause() {
  int i;
#pragma omp target
#pragma omp teams
#pragma omp distribute simd
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
#pragma omp distribute simd
  ++i;
}


x86 assembly (clang, -O0):
<test_no_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_no_clause+0x28>
jmp    111a <test_no_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_no_clause+0xb>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_no_clause() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int standard_row_reduce_system(int diag) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(707, &diag, b, c, 0);
  return 0;
}


x86 assembly (clang, -O0):
<standard_row_reduce_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x2c3,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_row_reduce_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2c3,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @standard_row_reduce_system(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 707, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @standard_row_reduce_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 707, i32* %2, i32* undef, double* undef, i32 0)
ret i32 0
}
/* Variables and functions */
char *strcat(char *, char const *);
char *strcatch(char *str, char c) {
  const char buf[2] = {c, '\0'};
  return strcat(str, buf);
}


x86 assembly (clang, -O0):
<strcatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xb(%rbp)
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1030 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcatch>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %sil,0xe(%rsp)
movb   $0x0,0xf(%rsp)
lea    0xe(%rsp),%rsi
call   1030 <strcat@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strcatch(i8* returned %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %5
%6 = call i8* @strcat(i8* dereferenceable(1) %0, i8* %4)
ret i8* %0
}