xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
scalar_t__ tolower(int);
extern void str_lower(char *str) {
  for (int i = 0; i < strlen(str); i++) {
    str[i] = (char)tolower((int)str[i]);
  }
}


x86 assembly (clang, -O0):
<str_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <str_lower+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <str_lower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_lower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <str_lower+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <str_lower+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @str_lower(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %12, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = tail call i64 @tolower(i32 %9)
%11 = trunc i64 %10 to i8
store i8 %11, i8* %7
%12 = add nuw nsw i64 %6, 1
%13 = tail call i32 @strlen(i8* %0)
%14 = sext i32 %13 to i64
%15 = icmp slt i64 %12, %14
br i1 %15, label %5, label %4
}
int __kern_pmem_writable(char *__ptr) {
  char b, b1, b2;
  b = *__ptr;
  b1 = b;
  b = b + 1;
  *__ptr = b;
  b = *__ptr;
  b = b - 1;
  b2 = b;
  *__ptr = b;
  if (b1 == b2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<__kern_pmem_writable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
sub    $0x1,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x13(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movsbl -0x12(%rbp),%eax
movsbl -0x13(%rbp),%ecx
cmp    %ecx,%eax
jne    1168 <__kern_pmem_writable+0x68>
movl   $0x1,-0x4(%rbp)
jmp    116f <__kern_pmem_writable+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__kern_pmem_writable(i8* nocapture readnone %0) {
ret i32 1
}
void scaleCenter(double xCenter, double yCenter, double *x, double *y) {
  *x = xCenter - (*x * xCenter);
  *y = yCenter - (*y * yCenter);
}


x86 assembly (clang, -O0):
<scaleCenter>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scaleCenter>:
movsd  (%rdi),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm0
movsd  %xmm0,(%rdi)
movsd  (%rsi),%xmm0
mulsd  %xmm1,%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @scaleCenter(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = load double*, double** %7
%11 = load double, double* %10
%12 = load double, double* %5
%13 = fneg double %11
%14 = call double @llvm.fmuladd.f64(double %13, double %12, double %9)
%15 = load double*, double** %7
store double %14, double* %15
%16 = load double, double* %6
%17 = load double*, double** %8
%18 = load double, double* %17
%19 = load double, double* %6
%20 = fneg double %18
%21 = call double @llvm.fmuladd.f64(double %20, double %19, double %16)
%22 = load double*, double** %8
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @scaleCenter(double %0, double %1, double* nocapture %2, double* nocapture %3) {
%5 = load double, double* %2
%6 = fneg double %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %0)
store double %7, double* %2
%8 = load double, double* %3
%9 = fneg double %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double %1, double %1)
store double %10, double* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int getsid(int /*<<< orphan*/);
int read(int /*<<< orphan*/, int *, int);
int /*<<< orphan*/ write(int, int *, int);
int main(int argc, char **argv) {
  int i;
  while (1) {
    if (read(0, &i, sizeof(i)) != sizeof(i))
      break;
    i = getsid(0);
    write(1, &i, sizeof(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1050 <read@plt>
cltq
cmp    $0x4,%rax
je     1167 <main+0x37>
jmp    1189 <main+0x59>
xor    %edi,%edi
call   1040 <getsid@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1050 <read@plt>
cmp    $0x4,%eax
jne    1181 <main+0x51>
lea    0xc(%rsp),%rbx
xor    %edi,%edi
call   1040 <getsid@plt>
mov    %eax,0xc(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1050 <read@plt>
cmp    $0x4,%eax
je     1150 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %2, %12
%8 = call i32 @read(i32 0, i32* %6, i32 4)
%9 = sext i32 %8 to i64
%10 = icmp ne i64 %9, 4
br i1 %10, label %11, label %12
11: ; preds = %7
br label %15
12: ; preds = %7
%13 = call i32 @getsid(i32 0)
store i32 %13, i32* %6
%14 = call i32 @write(i32 1, i32* %6, i32 4)
br label %7
15: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @read(i32 0, i32* %3, i32 4)
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = tail call i32 @getsid(i32 0)
store i32 %8, i32* %3
%9 = call i32 @write(i32 1, i32* %3, i32 4)
%10 = call i32 @read(i32 0, i32* %3, i32 4)
%11 = icmp eq i32 %10, 4
br i1 %11, label %7, label %12
12: ; preds = %7, %2
ret i32 0
}
int uwrite(fd, b, n)
char *b;
int fd, n;
{ return (_write(fd, b, n)); }


x86 assembly (clang, -O0):
<uwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @uwrite(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @_write to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
double fmod(double, int);
double angle_diff(double a, const double b) {
  a = fmod(a - b, 360.);
  if (a < .0)
    a += 360.;
  if (a > 180.)
    return 360. - a;
  return a;
}


x86 assembly (clang, -O0):
<angle_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
mov    $0x168,%edi
call   1030 <fmod@plt>
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115b <angle_diff+0x4b>
movsd  0xeaf(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1189 <angle_diff+0x79>
movsd  0xe86(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1193 <angle_diff+0x83>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle_diff>:
push   %rax
subsd  %xmm1,%xmm0
mov    $0x168,%edi
call   1030 <fmod@plt>
movsd  0xed9(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm4
cmpltsd %xmm3,%xmm4
andpd  %xmm4,%xmm2
andnpd %xmm0,%xmm4
orpd   %xmm2,%xmm4
subsd  %xmm4,%xmm1
movsd  0xeb4(%rip),%xmm0
cmpltsd %xmm4,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm4,%xmm0
orpd   %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @angle_diff(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = call double @fmod(double %8, i32 360)
store double %9, double* %4
%10 = load double, double* %4
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load double, double* %4
%14 = fadd double %13, 3.600000e+02
store double %14, double* %4
br label %15
15: ; preds = %12, %2
%16 = load double, double* %4
%17 = fcmp ogt double %16, 1.800000e+02
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load double, double* %4
%20 = fsub double 3.600000e+02, %19
store double %20, double* %3
br label %23
21: ; preds = %15
%22 = load double, double* %4
store double %22, double* %3
br label %23
23: ; preds = %21, %18
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @angle_diff(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @fmod(double %3, i32 360)
%5 = fcmp olt double %4, 0.000000e+00
%6 = fadd double %4, 3.600000e+02
%7 = select i1 %5, double %6, double %4
%8 = fcmp ogt double %7, 1.800000e+02
%9 = fsub double 3.600000e+02, %7
%10 = select i1 %8, double %9, double %7
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ moveTower(int, char, char, char);
void main() { moveTower(5, 'A', 'B', 'C'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1030 <moveTower@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
jmp    1030 <moveTower@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @moveTower(i32 5, i8 signext 65, i8 signext 66, i8 signext 67)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @moveTower(i32 5, i8 signext 65, i8 signext 66, i8 signext 67)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x19() {
  Assert_real((isupper(25) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              130, ("isupper should be 0 for 0x19"));
}


x86 assembly (clang, -O0):
<t_isupper_0x19>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x82,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x19>:
push   %rax
mov    $0x19,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x82,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x19\00"
define void @t_isupper_0x19() {
%1 = call i64 @isupper(i32 25)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x19\00"
define void @t_isupper_0x19() {
%1 = tail call i64 @isupper(i32 25)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushreal8array_(void *x, unsigned int *n) {
  pushNarray((char *)x, (*n * 8));
}


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

x86 assembly (clang, -O2):
<pushreal8array_>:
mov    (%rsi),%esi
shl    $0x3,%esi
jmp    1030 <pushNarray@plt>

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

LLVM IR (-O2):
define void @pushreal8array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 3
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
int test_imm_C1int32_mem(int *val) {
  return ((*val) & (0xC1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C1int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 193
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float converterHorasEmDias(int horas) { return 10000 / horas; }


x86 assembly (clang, -O0):
<converterHorasEmDias>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x2710,%eax
cltd
idivl  -0x4(%rbp)
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<converterHorasEmDias>:
mov    $0x2710,%eax
xor    %edx,%edx
idiv   %edi
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @converterHorasEmDias(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 10000, %3
%5 = sitofp i32 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @converterHorasEmDias(i32 %0) {
%2 = sdiv i32 10000, %0
%3 = sitofp i32 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ calc(char *);
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putnbr(int /*<<< orphan*/);
int main(int ac, char **av) {
  if (ac > 1) {
    ft_putnbr(calc(av[1]));
    ft_putchar('\n');
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    116e <main+0x3e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <calc@plt>
mov    %eax,%edi
call   1050 <ft_putnbr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     1154 <main+0x24>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <calc@plt>
mov    %eax,%edi
call   1050 <ft_putnbr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @calc(i8* %11)
%13 = call i32 @ft_putnbr(i32 %12)
%14 = call i32 @ft_putchar(i8 signext 10)
br label %15
15: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @calc(i8* %6)
%8 = tail call i32 @ft_putnbr(i32 %7)
%9 = tail call i32 @ft_putchar(i8 signext 10)
br label %10
10: ; preds = %4, %2
ret i32 0
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *,
                                          int /*<<< orphan*/);
void wl_buffer_send_release(struct wl_resource *resource_) {
  wl_resource_post_event(resource_, 0);
}


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

x86 assembly (clang, -O2):
<wl_buffer_send_release>:
xor    %esi,%esi
jmp    1030 <wl_resource_post_event@plt>

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

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_buffer_send_release(%struct.wl_resource* %0) {
%2 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FCEU_DispMessage(char *);
void FCEUD_MovieReplayFrom(void) { FCEU_DispMessage("Not implemented."); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Not implemented.\00"
define void @FCEUD_MovieReplayFrom() {
%1 = call i32 @FCEU_DispMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Not implemented.\00"
define void @FCEUD_MovieReplayFrom() {
%1 = tail call i32 @FCEU_DispMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
int main(void) {
  int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
  int i = 4;
  printf("arr[i]:%d\n", arr[i]);
  printf("i[arr]:%d\n", i[arr]);
  printf("And this is funny!!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x34(%rbp)
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 0]
@.str = [11 x i8] c"arr[i]:%d\0A\00"
@.str.1 = [11 x i8] c"i[arr]:%d\0A\00"
@.str.2 = [22 x i8] c"And this is funny!!!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
store i32 4, i32* %3
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"arr[i]:%d\0A\00"
@.str.1 = [11 x i8] c"i[arr]:%d\0A\00"
@str = [21 x i8] c"And this is funny!!!\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 5)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double pow3(double x) { return x * x * x; }


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

x86 assembly (clang, -O2):
<pow3>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pow3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @pow3(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_help(void) {
  static const char *help =
      "Usage: biosdecode [OPTIONS]\n"
      "Options are:\n"
      " -d, --dev-mem FILE     Read memory from device FILE (default: "
      "/dev/mem"
      ")\n"
      " -h, --help             Display this help text and exit\n"
      " -V, --version          Display the version and exit\n";
  printf("%s", help);
}


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

x86 assembly (clang, -O2):
<print_help>:
lea    0xfc9(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@print_help.help = internal global i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str, i32 0, i32 0)
@.str = [224 x i8] c"Usage: biosdecode [OPTIONS]\0AOptions are:\0A -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)\0A -h, --help Display this help text and exit\0A -V, --version Display the version and exit\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_help() {
%1 = load i8*, i8** @print_help.help
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [224 x i8] c"Usage: biosdecode [OPTIONS]\0AOptions are:\0A -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)\0A -h, --help Display this help text and exit\0A -V, --version Display the version and exit\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_file(char *, int);
int /*<<< orphan*/ printf(char *, ...);
void touch(char param[]) {
  printf("touch command \n");
  printf("parameters = %s \n", param);
  create_file("myfs", 1);
  return;
}


x86 assembly (clang, -O0):
<touch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x1,%esi
call   1040 <create_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<touch>:
push   %rbx
mov    %rdi,%rbx
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1050 <create_file@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"touch command \0A\00"
@.str.1 = [18 x i8] c"parameters = %s \0A\00"
@.str.2 = [5 x i8] c"myfs\00"
define void @touch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @create_file(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"parameters = %s \0A\00"
@.str.2 = [5 x i8] c"myfs\00"
@str = [15 x i8] c"touch command \00"
define void @touch(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @create_file(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret void
}
unsigned short __atomic_fetch_and_2(volatile void *atom, unsigned short value,
                                    int memorder) {
  unsigned short xchg;
  unsigned short cmp;
  __atomic_load((unsigned short *)atom, (unsigned short *)&cmp, 0);
  do {
    xchg = ((cmp & value));
  } while (
      !__atomic_compare_exchange((unsigned short *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_and_2>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
movzwl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%ax
mov    -0x12(%rbp),%dx
lock cmpxchg %dx,(%rcx)
mov    %ax,%cx
sete   %al
mov    %al,-0x19(%rbp)
mov    %cx,-0x18(%rbp)
test   $0x1,%al
jne    1159 <__atomic_fetch_and_2+0x59>
mov    -0x18(%rbp),%ax
mov    %ax,-0x14(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    111d <__atomic_fetch_and_2+0x1d>
movzwl -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_and_2>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
mov    %ecx,%edx
and    %esi,%edx
lock cmpxchg %dx,(%rdi)
jne    1110 <__atomic_fetch_and_2+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @__atomic_fetch_and_2(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i16*
%12 = load atomic i16, i16* %11 monotonic
store i16 %12, i16* %8
br label %13
13: ; preds = %29, %3
%14 = load i16, i16* %8
%15 = zext i16 %14 to i32
%16 = load i16, i16* %5
%17 = zext i16 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i16
store i16 %19, i16* %7
br label %20
20: ; preds = %13
%21 = load i8*, i8** %4
%22 = bitcast i8* %21 to i16*
%23 = load i16, i16* %8
%24 = load i16, i16* %7
%25 = cmpxchg weak i16* %22, i16 %23, i16 %24 seq_cst seq_cst
%26 = extractvalue { i16, i1 } %25, 0
%27 = extractvalue { i16, i1 } %25, 1
br i1 %27, label %29, label %28
28: ; preds = %20
store i16 %26, i16* %8
br label %29
29: ; preds = %28, %20
%30 = zext i1 %27 to i8
store i8 %30, i8* %9
%31 = load i8, i8* %9
%32 = trunc i8 %31 to i1
%33 = xor i1 %32, true
br i1 %33, label %13, label %34
34: ; preds = %29
%35 = load i16, i16* %8
ret i16 %35
}

LLVM IR (-O2):
define zeroext i16 @__atomic_fetch_and_2(i8* nocapture %0, i16 zeroext %1, i32 %2) {
%4 = bitcast i8* %0 to i16*
%5 = load atomic i16, i16* %4 monotonic
br label %6
6: ; preds = %6, %3
%7 = phi i16 [ %5, %3 ], [ %11, %6 ]
%8 = and i16 %7, %1
%9 = cmpxchg weak i16* %4, i16 %7, i16 %8 seq_cst seq_cst
%10 = extractvalue { i16, i1 } %9, 1
%11 = extractvalue { i16, i1 } %9, 0
br i1 %10, label %12, label %6
12: ; preds = %6
ret i16 %7
}
void matrix_uninit(float **A) {
  if (A[0])
    free(A[0]);
  if (A)
    free(A);
}


x86 assembly (clang, -O0):
<matrix_uninit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <matrix_uninit+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x8(%rbp)
je     114a <matrix_uninit+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_uninit>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1121 <matrix_uninit+0x11>
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @matrix_uninit(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** %4
%6 = icmp ne float* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load float**, float*** %2
%9 = getelementptr inbounds float*, float** %8, i64 0
%10 = load float*, float** %9
%11 = bitcast float* %10 to i8*
br label %12
12: ; preds = %7, %1
%13 = load float**, float*** %2
%14 = icmp ne float** %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load float**, float*** %2
%17 = bitcast float** %16 to i8*
br label %18
18: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
define void @matrix_uninit(float** nocapture %0) {
%2 = load float*, float** %0
%3 = icmp eq float* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = bitcast float* %2 to i8*
tail call void @free(i8* %5)
br label %6
6: ; preds = %1, %4
%7 = bitcast float** %0 to i8*
tail call void @free(i8* %7)
ret void
}
void set_hardware_tx_frequency(void) {}


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

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

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

LLVM IR (-O2):
define void @set_hardware_tx_frequency() {
ret void
}
void thread_init(void) {}


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

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

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

LLVM IR (-O2):
define void @thread_init() {
ret void
}
two1(a, b) { nop(); }


x86 assembly (clang, -O0):
<two1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <nop@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @two1(i32 %0, i32 %1) {
%3 = tail call i32 (...) @nop()
ret i32 undef
}
int powerof2(int n) { return (n == (n & (-n))); }


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

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

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

LLVM IR (-O2):
define i32 @powerof2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void usage_error_server(const char *prog_name) {
  fprintf(stdout, "Usage: %s <port_number>\n", prog_name);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage_error_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_error_server>:
push   %rax
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [25 x i8] c"Usage: %s <port_number>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage_error_server(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [25 x i8] c"Usage: %s <port_number>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage_error_server(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int one(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @one() {
ret i32 1
}

LLVM IR (-O2):
define i32 @one() {
ret i32 1
}
void swap(char *x, char *y) {
  char temp;
  temp = *x;
  *x = *y;
  *y = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %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 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(void) {
  int i = 5, j = 5, p, q;
  p = (i++) + (i++) + (i++);
  q = (++j) + (++j) + (++j);
  printf("p=%d,q=%d,i=%d,j=%d \n", p, q, i, j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x12,%esi
mov    $0x15,%edx
mov    $0x8,%ecx
mov    $0x8,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"p=%d,q=%d,i=%d,j=%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 5, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = add nsw i32 %6, %8
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = add nsw i32 %10, %11
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
%18 = add nsw i32 %15, %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
%21 = add nsw i32 %18, %20
store i32 %21, i32* %5
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %23, i32 %24, i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"p=%d,q=%d,i=%d,j=%d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 18, i32 21, i32 8, i32 8)
ret i32 0
}
int init_work(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_work() {
ret i32 0
}
int div(int a, int b) { return (a / b) != 0; }


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
mov    %edi,%eax
cltd
idiv   %esi
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @div(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 = sdiv i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int f411(int *);
int f412(int *p) { return f411(p); }


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

x86 assembly (clang, -O2):
<f412>:
jmp    1030 <f411@plt>

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

LLVM IR (-O2):
define i32 @f412(i32* %0) {
%2 = tail call i32 @f411(i32* %0)
ret i32 %2
}
/* Type definitions */
struct hdr_histogram {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int hdr_record_corrected_values(struct hdr_histogram *, int /*<<< orphan*/, int,
                                int /*<<< orphan*/);
bool hdr_record_corrected_value(struct hdr_histogram *h, int64_t value,
                                int64_t expected_interval) {
  return hdr_record_corrected_values(h, value, 1, expected_interval);
}


x86 assembly (clang, -O0):
<hdr_record_corrected_value>:
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),%esi
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
call   1030 <hdr_record_corrected_values@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdr_record_corrected_value>:
mov    %edx,%ecx
mov    $0x1,%edx
jmp    1030 <hdr_record_corrected_values@plt>

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

LLVM IR (-O2):
%struct.hdr_histogram = type { i32 }
define i32 @hdr_record_corrected_value(%struct.hdr_histogram* %0, i32 %1, i32 %2) {
%4 = tail call i32 @hdr_record_corrected_values(%struct.hdr_histogram* %0, i32 %1, i32 1, i32 %2)
ret i32 %4
}
void outb(unsigned short port, char data) {
  __asm__ __volatile__("outb %1, %0" : : "dN"(port), "a"(data));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x3(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @outb(i16 zeroext %0, i8 signext %1) {
tail call void asm sideeffect "outb $1, $0", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %1)
ret void
}
/* Variables and functions */
int pow(double, int);
double volumenEsfera(double radio) { return (4 / 3) * 3.1416 * pow(radio, 3); }


x86 assembly (clang, -O0):
<volumenEsfera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<volumenEsfera>:
push   %rax
mov    $0x3,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @volumenEsfera(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 3)
%5 = sitofp i32 %4 to double
%6 = fmul double 3.141600e+00, %5
ret double %6
}

LLVM IR (-O2):
define double @volumenEsfera(double %0) {
%2 = tail call i32 @pow(double %0, i32 3)
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 3.141600e+00
ret double %4
}
char *function(a1, a2, fl, a4)
int a1, a2;
float fl;
int a4;
{}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
cvtsd2ss %xmm0,%xmm0
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @function(i32 %0, i32 %1, double %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca i32
%10 = fptrunc double %2 to float
store i32 %0, i32* %6
store i32 %1, i32* %7
store float %10, float* %8
store i32 %3, i32* %9
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @function(i32 %0, i32 %1, double %2, i32 %3) {
ret i8* undef
}