xunge/DecIR huggingface dataset:
/* Variables and functions */
char toupper(char);
void toUpperN(char *s, int n) {
  int i;
  for (i = 0; i < n; ++i)
    s[i] = toupper(s[i]);
}


x86 assembly (clang, -O0):
<toUpperN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <toUpperN+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <toUpperN+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toUpperN>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <toUpperN+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <toUpperN+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @toUpperN(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
double jac_chain_nm8_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<jac_chain_nm8_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <jac_chain_nm8_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <jac_chain_nm8_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <jac_chain_nm8_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <jac_chain_nm8_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm8_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @jac_chain_nm8_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @jac_chain_nm8_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
void left_shift_key(char *key) {
  char temp = key[0];
  int i;
  for (i = 0; i < 27; i++) {
    key[i] = key[i + 1];
  }
  key[27] = temp;
}


x86 assembly (clang, -O0):
<left_shift_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1b,-0x10(%rbp)
jge    114b <left_shift_key+0x4b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1118 <left_shift_key+0x18>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1b(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<left_shift_key>:
mov    (%rdi),%al
movups 0x1(%rdi),%xmm0
mov    0x11(%rdi),%rcx
mov    %rcx,0x10(%rdi)
movzwl 0x19(%rdi),%ecx
mov    %cx,0x18(%rdi)
mov    0x1b(%rdi),%cl
mov    %cl,0x1a(%rdi)
movups %xmm0,(%rdi)
mov    %al,0x1b(%rdi)
ret

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

LLVM IR (-O2):
define void @left_shift_key(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr i8, i8* %0, i64 1
%4 = getelementptr inbounds i8, i8* %0, i64 27
store i8 %2, i8* %4
ret void
}
int parity(unsigned int x) {
  x ^= x >> 16;
  x ^= x >> 8;
  x ^= x >> 4;
  x &= 0xf;
  return (0x6996 >> x) & 1;
}


x86 assembly (clang, -O0):
<parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x6996,%eax
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity>:
mov    %edi,%eax
shr    $0x10,%eax
xor    %edi,%eax
mov    %eax,%edx
shr    $0x8,%edx
xor    %eax,%edx
mov    %edx,%ecx
shr    $0x4,%ecx
xor    %edx,%ecx
and    $0xf,%cl
mov    $0x6996,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @parity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 8
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 4
%13 = load i32, i32* %2
%14 = xor i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = and i32 %15, 15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 27030, %17
%19 = and i32 %18, 1
ret i32 %19
}

LLVM IR (-O2):
define i32 @parity(i32 %0) {
%2 = lshr i32 %0, 16
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 8
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 4
%7 = xor i32 %6, %5
%8 = and i32 %7, 15
%9 = lshr i32 27030, %8
%10 = and i32 %9, 1
ret i32 %10
}
void DMA2_Stream7_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @DMA2_Stream7_IRQHandler() {
ret void
}
/* Variables and functions */
char *getcwd(char *, int);
char *malloc(int);
char *idris2_currentDirectory() {
  char *cwd = malloc(1024);
  return getcwd(cwd, 1024);
}


x86 assembly (clang, -O0):
<idris2_currentDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x400,%esi
call   1030 <getcwd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idris2_currentDirectory>:
push   %rax
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x400,%esi
pop    %rax
jmp    1030 <getcwd@plt>

LLVM IR (-O0):
define i8* @idris2_currentDirectory() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1024)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i8* @getcwd(i8* %3, i32 1024)
ret i8* %4
}

LLVM IR (-O2):
define i8* @idris2_currentDirectory() {
%1 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%2 = tail call i8* @getcwd(i8* %1, i32 1024)
ret i8* %2
}
void pinMode(int pin, int value) { return; }


x86 assembly (clang, -O0):
<pinMode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @pinMode(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int strlen(char *);
void RestoreLastChar(char *s, char c) {
  int n = strlen(s);
  s[n - 1] = c;
}


x86 assembly (clang, -O0):
<RestoreLastChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RestoreLastChar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,-0x1(%rax,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @RestoreLastChar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8 %8, i8* %13
ret void
}

LLVM IR (-O2):
define void @RestoreLastChar(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %1, i8* %6
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ truncate(char *, int /*<<< orphan*/);
int main(void) {
  if (0 > truncate("arnold.layne", 0))
    return EXIT_FAILURE;
  else
    return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
xor    %esi,%esi
call   1030 <truncate@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    114c <main+0x3c>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <main+0x48>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <truncate@plt>
test   %rax,%rax
jns    112d <main+0x1d>
mov    0x2eb5(%rip),%rax
jmp    1134 <main+0x24>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"arnold.layne\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @truncate(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = icmp sgt i64 0, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @EXIT_FAILURE
store i32 %5, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* @EXIT_SUCCESS
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"arnold.layne\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 @truncate(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp slt i64 %1, 0
%3 = load i32, i32* @EXIT_FAILURE
%4 = load i32, i32* @EXIT_SUCCESS
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DeleteInertiaData(void *inertiaattr) { free(inertiaattr); }


x86 assembly (clang, -O0):
<DeleteInertiaData>:
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):
<DeleteInertiaData>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @DeleteInertiaData(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int even_odd_digits();
int even_odd_digits_naive();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Naive: %u\n", even_odd_digits_naive());
  printf("Lookup table: %u\n", even_odd_digits());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <even_odd_digits_naive@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <even_odd_digits@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <even_odd_digits_naive@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <even_odd_digits@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Naive: %u\0A\00"
@.str.1 = [18 x i8] c"Lookup table: %u\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @even_odd_digits_naive()
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @even_odd_digits()
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Naive: %u\0A\00"
@.str.1 = [18 x i8] c"Lookup table: %u\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @even_odd_digits_naive()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @even_odd_digits()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
int dfym_fun() { return 99; }


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

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

LLVM IR (-O0):
define i32 @dfym_fun() {
ret i32 99
}

LLVM IR (-O2):
define i32 @dfym_fun() {
ret i32 99
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ writeFile(char *, int /*<<< orphan*/ *);
void writeFiles(char **inputPaths, int inputCount, FILE *outStream) {
  for (int i = 0; i < inputCount; i++) {
    writeFile(inputPaths[i], outStream);
  }
}


x86 assembly (clang, -O0):
<writeFiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <writeFiles+0x49>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <writeFile@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <writeFiles+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeFiles>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <writeFiles+0x35>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
mov    %r14,%rsi
call   1030 <writeFile@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <writeFiles+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @writeFiles(i8** nocapture %0, i32 %1, i32* %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @writeFile(i8* %11, i32* %2)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %8
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
__attribute__((always_)) int16_t max_int16_t(int16_t a, int16_t b) {
  return a > b ? a : b;
}


x86 assembly (clang, -O0):
<max_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max_int16_t+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max_int16_t+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_int16_t>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max_int16_t(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ res;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint32_t DCA_MEM32NE(const void *data) {
  uint32_t res;
  memcpy(&res, data, sizeof(res));
  return res;
}


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

x86 assembly (clang, -O2):
<DCA_MEM32NE>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @DCA_MEM32NE(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
struct vm_fault {
  int dummy;
};
struct vm_area_struct {
  int dummy;
};

/* Variables and functions */
int drm_do_vm_dma_fault(struct vm_area_struct *, struct vm_fault *);
int drm_vm_dma_fault(struct vm_area_struct *vma, struct vm_fault *vmf) {
  return drm_do_vm_dma_fault(vma, vmf);
}


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

x86 assembly (clang, -O2):
<drm_vm_dma_fault>:
jmp    1030 <drm_do_vm_dma_fault@plt>

LLVM IR (-O0):
%struct.vm_area_struct = type { i32 }
%struct.vm_fault = type { i32 }
define i32 @drm_vm_dma_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1) {
%3 = alloca %struct.vm_area_struct*
%4 = alloca %struct.vm_fault*
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %3
store %struct.vm_fault* %1, %struct.vm_fault** %4
%5 = load %struct.vm_area_struct*, %struct.vm_area_struct** %3
%6 = load %struct.vm_fault*, %struct.vm_fault** %4
%7 = call i32 @drm_do_vm_dma_fault(%struct.vm_area_struct* %5, %struct.vm_fault* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.vm_area_struct = type { i32 }
%struct.vm_fault = type { i32 }
define i32 @drm_vm_dma_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1) {
%3 = tail call i32 @drm_do_vm_dma_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1)
ret i32 %3
}
/* Variables and functions */
int *dynCastToInt(void *);
void testDynCast(void *p) {
  int *casted = dynCastToInt(p);
  *casted = 1;
}


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

x86 assembly (clang, -O2):
<testDynCast>:
push   %rax
call   1030 <dynCastToInt@plt>
movl   $0x1,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @testDynCast(i8* %0) {
%2 = tail call i32* @dynCastToInt(i8* %0)
store i32 1, i32* %2
ret void
}
int filterpc(int pc, int jmptarget) {
  if (pc < jmptarget)
    return -1;
  else
    return pc;
}


x86 assembly (clang, -O0):
<filterpc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <filterpc+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    1128 <filterpc+0x28>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filterpc>:
cmp    %esi,%edi
mov    $0xffffffff,%eax
cmovge %edi,%eax
ret

LLVM IR (-O0):
define i32 @filterpc(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 slt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
store i32 %11, i32* %3
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @filterpc(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 -1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CatchFatal(int);
int /*<<< orphan*/ abort();
void CatchFatalAndAbort(int signo) {
  CatchFatal(signo);
  abort();
}


x86 assembly (clang, -O0):
<CatchFatalAndAbort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <CatchFatal@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<CatchFatalAndAbort>:
push   %rax
call   1040 <CatchFatal@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @CatchFatalAndAbort(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @CatchFatal(i32 %3)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @CatchFatalAndAbort(i32 %0) {
%2 = tail call i32 @CatchFatal(i32 %0)
%3 = tail call i32 (...) @abort()
unreachable
}
double model_function(double x, double parameters[]) {
  return parameters[0] * x * x + parameters[1] * x + parameters[2];
}


x86 assembly (clang, -O0):
<model_function>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<model_function>:
movsd  (%rdi),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x8(%rdi),%xmm0
addsd  %xmm1,%xmm0
addsd  0x10(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @model_function(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* %3
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double, double* %3
%15 = fmul double %13, %14
%16 = call double @llvm.fmuladd.f64(double %9, double %10, double %15)
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = fadd double %16, %19
ret double %20
}

LLVM IR (-O2):
define double @model_function(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fmul double %3, %0
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = fmul double %6, %0
%8 = tail call double @llvm.fmuladd.f64(double %4, double %0, double %7)
%9 = getelementptr inbounds double, double* %1, i64 2
%10 = load double, double* %9
%11 = fadd double %10, %8
ret double %11
}
/* Type definitions */
typedef size_t uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_point(uint64_t *point, uint64_t length) {
  uint64_t p;
  for (p = 0; p < length; p++)
    printf("%ld ", point[p]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1161 <print_point+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <print_point+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_point>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <print_point+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_point+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%ld \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_point(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i64*, i64** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = load i64, i64* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld \00"
define void @print_point(i64* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i64, i64* %0, i64 %5
%7 = load i64, i64* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x94() {
  Assert_real((isupper(148) == 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",
              745, ("isupper should be 0 for 0x94"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x94>:
push   %rax
mov    $0x94,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e9,%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 0x94\00"
define void @t_isupper_0x94() {
%1 = call i64 @isupper(i32 148)
%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 745, 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 0x94\00"
define void @t_isupper_0x94() {
%1 = tail call i64 @isupper(i32 148)
%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 745, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int isblank(int ch) { return ch == 0x09 || ch == 0x20; }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isblank+0x20>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x9,%edi
sete   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isblank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 9
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 32
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = icmp eq i32 %0, 9
%3 = icmp eq i32 %0, 32
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned long(virt_to_phys)(void volatile *address) {
  { return ((unsigned long)address - 3221225472UL); }
}


x86 assembly (clang, -O0):
<virt_to_phys>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0xc0000000,%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<virt_to_phys>:
movabs $0xffffffff40000000,%rax
ff ff ff
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @virt_to_phys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = sub i64 %4, 3221225472
ret i64 %5
}

LLVM IR (-O2):
define i64 @virt_to_phys(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = add i64 %2, -3221225472
ret i64 %3
}
void RTStrToUInt64(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToUInt64() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = -2;
  int x[16];
  int b = -1;
  int i;
  x[16] = 0;
  printf("%d, %d\n", a, b);
  for (i = 0; i <= 16; ++i) {
    x[i] = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffe,-0x8(%rbp)
movl   $0xffffffff,-0x54(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x54(%rbp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x58(%rbp)
cmpl   $0x10,-0x58(%rbp)
jg     1171 <main+0x61>
movslq -0x58(%rbp),%rax
movl   $0x0,-0x50(%rbp,%rax,4)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    114d <main+0x3d>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 -2, i32 -1)
ret i32 0
}
int test_imm_4Fint64_midword_reg(long long val) {
  return ((val >> 16) & (0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x4f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Fint64_midword_reg>:
test   $0x4f0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Fint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 79
%6 = icmp ne i64 %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_4Fint64_midword_reg(i64 %0) {
%2 = and i64 %0, 5177344
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GPS_UART_UartInit();
void GPS_UART_Init(void) { GPS_UART_UartInit(); }


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

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

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

LLVM IR (-O2):
define void @GPS_UART_Init() {
%1 = tail call i32 (...) @GPS_UART_UartInit()
ret void
}
int testLibAbs1(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @testLibAbs1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ mmapdata();
main() {
  mmapdata();
  func1();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mmapdata()
%2 = tail call i32 (...) @func1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Perm();
int main() {
  int i;
  for (i = 0; i < 100; i++)
    Perm();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <Perm@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <Perm@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @Perm()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
void mdp4_mddi_blt_stop(struct msm_fb_data_type *mfd) {}


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

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

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

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
define void @mdp4_mddi_blt_stop(%struct.msm_fb_data_type* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
float prob() {
  float p;
  printf("Probabilidade: ");
  scanf("%f", &p);
  return p;
}


x86 assembly (clang, -O0):
<prob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prob>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Probabilidade: \00"
@.str.1 = [3 x i8] c"%f\00"
define float @prob() {
%1 = alloca float
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%4 = load float, float* %1
ret float %4
}

LLVM IR (-O2):
@.str = [16 x i8] c"Probabilidade: \00"
@.str.1 = [3 x i8] c"%f\00"
define float @prob() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
ret float %5
}
void to_rgb(unsigned const val, char rgb[3]) {
  rgb[0] = 5 * (val % 15);
  rgb[1] = 32 * (val % 7);
  rgb[2] = 8 * (val % 31);
}


x86 assembly (clang, -O0):
<to_rgb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x5,%edx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x7,%ecx
xor    %edx,%edx
div    %ecx
shl    $0x5,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
mov    $0x1f,%ecx
xor    %edx,%edx
div    %ecx
shl    $0x3,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_rgb>:
mov    %edi,%r8d
mov    $0x88888889,%r9d
imul   %r8,%r9
imul   $0x24924925,%r8,%rdx
shr    $0x20,%rdx
mov    %edi,%ecx
sub    %edx,%ecx
shr    %ecx
add    %edx,%ecx
imul   $0x8421085,%r8,%rdx
shr    $0x20,%rdx
mov    %edi,%eax
sub    %edx,%eax
shr    %eax
add    %edx,%eax
shr    $0x23,%r9
lea    (%r9,%r9,4),%edx
lea    (%rdx,%rdx,2),%edx
shr    $0x2,%ecx
add    %edi,%ecx
shr    $0x4,%eax
add    %edi,%eax
sub    %edx,%edi
lea    (%rdi,%rdi,4),%edx
mov    %dl,(%rsi)
shl    $0x5,%cl
mov    %cl,0x1(%rsi)
shl    $0x3,%al
mov    %al,0x2(%rsi)
ret

LLVM IR (-O0):
define void @to_rgb(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 = urem i32 %5, 15
%7 = mul i32 5, %6
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %3
%12 = urem i32 %11, 7
%13 = mul i32 32, %12
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %3
%18 = urem i32 %17, 31
%19 = mul i32 8, %18
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
ret void
}

LLVM IR (-O2):
define void @to_rgb(i32 %0, i8* nocapture writeonly %1) {
%3 = urem i32 %0, 15
%4 = trunc i32 %3 to i8
%5 = mul nuw nsw i8 %4, 5
store i8 %5, i8* %1
%6 = urem i32 %0, 7
%7 = trunc i32 %6 to i8
%8 = shl nuw i8 %7, 5
%9 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %8, i8* %9
%10 = urem i32 %0, 31
%11 = trunc i32 %10 to i8
%12 = shl nuw i8 %11, 3
%13 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %12, i8* %13
ret void
}
int foo_simdlen(int k) { return k + 1; }


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

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

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

LLVM IR (-O2):
define i32 @foo_simdlen(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_array(int *a, int n) {
  for (int i = 0; i < n; i++) {
    printf("%d\n", a[i]);
  }
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print_array+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print_array+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
int installID() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @installID() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ osn_event_init();
int /*<<< orphan*/ osn_task_init();
void osn_init(void) {
  osn_event_init();
  osn_task_init();
}


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

x86 assembly (clang, -O2):
<osn_init>:
push   %rax
xor    %eax,%eax
call   1040 <osn_event_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <osn_task_init@plt>

LLVM IR (-O0):
define void @osn_init() {
%1 = call i32 (...) @osn_event_init()
%2 = call i32 (...) @osn_task_init()
ret void
}

LLVM IR (-O2):
define void @osn_init() {
%1 = tail call i32 (...) @osn_event_init()
%2 = tail call i32 (...) @osn_task_init()
ret void
}