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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void InitDeftemplateCode(void *theEnv, FILE *initFP, int imageID,
                         int maxIndices) {
  fprintf(initFP, "   DeftemplateRunTimeInitialize(theEnv);\n");
}


x86 assembly (clang, -O0):
<InitDeftemplateCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitDeftemplateCode>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x29,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [42 x i8] c" DeftemplateRunTimeInitialize(theEnv);\0A\00"
define void @InitDeftemplateCode(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %6
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c" DeftemplateRunTimeInitialize(theEnv);\0A\00"
define void @InitDeftemplateCode(i8* nocapture readnone %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 41, i64 1, i32* %1)
ret void
}
/* Variables and functions */
int isdigit(int const);
int fisdigit(const int c) { return isdigit(c); }


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

x86 assembly (clang, -O2):
<fisdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @fisdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void sgx_thread_set_multiple_untrusted_events_ocall() {}


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

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

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

LLVM IR (-O2):
define void @sgx_thread_set_multiple_untrusted_events_ocall() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int __syscall_ret(int /*<<< orphan*/);
int brk(void *end) { return __syscall_ret(-ENOMEM); }


x86 assembly (clang, -O0):
<brk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    0x2ebb(%rip),%rax
sub    (%rax),%edi
call   1030 <__syscall_ret@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brk>:
mov    0x2ec9(%rip),%rax
xor    %edi,%edi
sub    (%rax),%edi
jmp    1030 <__syscall_ret@plt>

LLVM IR (-O0):
@ENOMEM = global i32 0
define i32 @brk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOMEM
%4 = sub nsw i32 0, %3
%5 = call i32 @__syscall_ret(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i32 @brk(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOMEM
%3 = sub nsw i32 0, %2
%4 = tail call i32 @__syscall_ret(i32 %3)
ret i32 %4
}
/* Type definitions */
struct orbita_potential {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ orbita_err(char *);
struct orbita_potential *orbita_potential_plummer_var(double rho, double a) {
  orbita_err("orbita_potential_homogeneous_sphere_var: Not implemented.");
  return NULL;
}


x86 assembly (clang, -O0):
<orbita_potential_plummer_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <orbita_err@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.orbita_potential = type { i32 }
@.str = [58 x i8] c"orbita_potential_homogeneous_sphere_var: Not implemented.\00"
define %struct.orbita_potential* @orbita_potential_plummer_var(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 @orbita_err(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret %struct.orbita_potential* null
}

LLVM IR (-O2):
%struct.orbita_potential = type { i32 }
@.str = [58 x i8] c"orbita_potential_homogeneous_sphere_var: Not implemented.\00"
define noalias %struct.orbita_potential* @orbita_potential_plummer_var(double %0, double %1) {
%3 = tail call i32 @orbita_err(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret %struct.orbita_potential* null
}
int get_digits(int num) {
  int digits = 0;
  if (num == 0) {
    digits = 1;
  } else {
    while (num != 0) {
      num = num / 10;
      digits++;
    }
  }
  return digits;
}


x86 assembly (clang, -O0):
<get_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1124 <get_digits+0x24>
movl   $0x1,-0x8(%rbp)
jmp    1154 <get_digits+0x54>
jmp    1129 <get_digits+0x29>
cmpl   $0x0,-0x4(%rbp)
je     114f <get_digits+0x4f>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <get_digits+0x29>
jmp    1154 <get_digits+0x54>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_digits>:
test   %edi,%edi
je     1133 <get_digits+0x33>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <get_digits+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %11
}
int is_location_full(int size) {
  int i;
  if (size % 32)
    return 0;
  for (i = 32;; i <<= 1) {
    if (size > i) {
      continue;
    }
    if ((size & i) == size) {
      return 1;
    } else {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_location_full>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1127 <is_location_full+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1174 <is_location_full+0x74>
movl   $0x20,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113f <is_location_full+0x3f>
jmp    115f <is_location_full+0x5f>
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    115a <is_location_full+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1174 <is_location_full+0x74>
jmp    116d <is_location_full+0x6d>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <is_location_full+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_location_full>:
xor    %eax,%eax
test   $0x1f,%dil
je     1109 <is_location_full+0x9>
ret
mov    $0x20,%eax
xchg   %ax,%ax
mov    %eax,%ecx
lea    (%rcx,%rcx,1),%eax
cmp    %edi,%ecx
jl     1110 <is_location_full+0x10>
not    %ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_location_full(i32 %0) {
%2 = and i32 %0, 31
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 32, %1 ]
%6 = icmp slt i32 %5, %0
%7 = shl i32 %5, 1
br i1 %6, label %4, label %8
8: ; preds = %4
%9 = and i32 %5, %0
%10 = icmp eq i32 %9, %0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %1
%13 = phi i32 [ 0, %1 ], [ %11, %8 ]
ret i32 %13
}
int num_namespaces(char *nspaths) {
  int i;
  int size = 0;
  for (i = 0; nspaths[i]; i++) {
    if (nspaths[i] == ',') {
      size += 1;
    }
  }
  return size + 1;
}


x86 assembly (clang, -O0):
<num_namespaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1159 <num_namespaces+0x59>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
jne    1146 <num_namespaces+0x46>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114b <num_namespaces+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <num_namespaces+0x16>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_namespaces>:
xor    %eax,%eax
jmp    1117 <num_namespaces+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x2c,%cl
je     1110 <num_namespaces+0x10>
test   %cl,%cl
jne    1113 <num_namespaces+0x13>
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @num_namespaces(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 44, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
%13 = add nsw i32 %4, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
#pragma offload target(mic)
  printf("Hello from Host!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"Hello from Host!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void kernel_main(void) {}


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

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

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

LLVM IR (-O2):
define void @kernel_main() {
ret void
}
char *hash_plugin_summary(void) {
  return ("msoffice-old \tMS Office XP/2003 plugin");
}


x86 assembly (clang, -O0):
<hash_plugin_summary>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_summary>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [39 x i8] c"msoffice-old \09MS Office XP/2003 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [39 x i8] c"msoffice-old \09MS Office XP/2003 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}
int main() {
  int sum = 0;
  sum += !0 ? 1 : 2;
  sum += sum ? 4 : 8;
  sum += (5 && 3) ? 16 : 32;
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x8,%eax
mov    $0x4,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 4, i32 8
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 16
store i32 %12, i32* %2
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
ret i32 21
}
int get_end(int vends[], int i) {
  while (vends[i] != 0)
    i = vends[i];
  return i;
}


x86 assembly (clang, -O0):
<get_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1130 <get_end+0x30>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
jmp    110b <get_end+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_end>:
mov    %esi,%eax
movslq %esi,%rcx
mov    (%rdi,%rcx,4),%esi
test   %esi,%esi
jne    1100 <get_end>
ret

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

LLVM IR (-O2):
define i32 @get_end(i32* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %7, %3 ]
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 %4
}
int LeapYear(int year) {
  if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<LeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1143 <LeapYear+0x43>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114f <LeapYear+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <LeapYear+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <LeapYear+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeapYear>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     1130 <LeapYear+0x30>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
setae  %al
test   $0x3,%dil
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @LeapYear(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = and i32 %0, 3
%8 = icmp eq i32 %7, 0
%9 = and i1 %6, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %10, %4 ]
ret i32 %12
}
/* Variables and functions */
void *realloc(void *, size_t);
void *rpl_realloc(void *ptr, size_t size) {
  if (size == 0)
    size = 1;
  return realloc(ptr, size);
}


x86 assembly (clang, -O0):
<rpl_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <rpl_realloc+0x23>
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_realloc>:
test   %rsi,%rsi
mov    $0x1,%eax
cmove  %rax,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @rpl_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
store i64 1, i64* %4
br label %8
8: ; preds = %7, %2
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i8* @realloc(i8* %9, i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @rpl_realloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = select i1 %3, i64 1, i64 %1
%5 = tail call i8* @realloc(i8* %0, i64 %4)
ret i8* %5
}
float tetragono(float factor) { return factor * 4; }


x86 assembly (clang, -O0):
<tetragono>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @tetragono(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 4.000000e+00
ret float %4
}

LLVM IR (-O2):
define float @tetragono(float %0) {
%2 = fmul float %0, 4.000000e+00
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ cvector_norm2_l(double const *, int);
long double sqrtl(int /*<<< orphan*/);
long double cvector_norm_l(const double *a, int n) {
  return sqrtl(cvector_norm2_l(a, n));
}


x86 assembly (clang, -O0):
<cvector_norm_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <cvector_norm2_l@plt>
mov    %eax,%edi
call   1030 <sqrtl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvector_norm_l>:
push   %rax
call   1040 <cvector_norm2_l@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrtl@plt>

LLVM IR (-O0):
define x86_fp80 @cvector_norm_l(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call i32 @cvector_norm2_l(double* %5, i32 %6)
%8 = call x86_fp80 @sqrtl(i32 %7)
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @cvector_norm_l(double* %0, i32 %1) {
%3 = tail call i32 @cvector_norm2_l(double* %0, i32 %1)
%4 = tail call x86_fp80 @sqrtl(i32 %3)
ret x86_fp80 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
size_t iconv(iconv_t cd, char **__restrict inbuf,
             size_t *__restrict inbytesleft, char **__restrict outbuf,
             size_t *__restrict outbytesleft) {
  return 0;
}


x86 assembly (clang, -O0):
<iconv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @iconv(i32 %0, i8** noalias %1, i64* noalias %2, i8** noalias %3, i64* noalias %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i64*
%9 = alloca i8**
%10 = alloca i64*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i64* %2, i64** %8
store i8** %3, i8*** %9
store i64* %4, i64** %10
ret i64 0
}

LLVM IR (-O2):
define i64 @iconv(i32 %0, i8** noalias nocapture readnone %1, i64* noalias nocapture readnone %2, i8** noalias nocapture readnone %3, i64* noalias nocapture readnone %4) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int UserChoice(void) {
  int user_chosen_action;
  printf("1)----   Load the Sudoku    ----\n"
         "2)----   Print Loaded Sudoku    ----\n"
         "3)----   Solve Serialy    ----\n"
         "4)----   Solve in Parallel Manually   ----\n"
         "5)----   Print Solved Sudoku    ----\n"
         "6)----   Validate    ----\n"
         "7)----   Exit    ----\n");
  scanf("%d", &user_chosen_action);
  fflush(stdin);
  return user_chosen_action;
}


x86 assembly (clang, -O0):
<UserChoice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf9b(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UserChoice>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [230 x i8] c"1)---- Load the Sudoku ----\0A2)---- Print Loaded Sudoku ----\0A3)---- Solve Serialy ----\0A4)---- Solve in Parallel Manually ----\0A5)---- Print Solved Sudoku ----\0A6)---- Validate ----\0A7)---- Exit ----\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @UserChoice() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([230 x i8], [230 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), i32* %1)
%4 = load i32, i32* @stdin
%5 = call i32 @fflush(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
@str = [229 x i8] c"1)---- Load the Sudoku ----\0A2)---- Print Loaded Sudoku ----\0A3)---- Solve Serialy ----\0A4)---- Solve in Parallel Manually ----\0A5)---- Print Solved Sudoku ----\0A6)---- Validate ----\0A7)---- Exit ----\00"
define i32 @UserChoice() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([229 x i8], [229 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), i32* %1)
%5 = load i32, i32* @stdin
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}
int sde_rotator_wait_sync_fence(struct sde_rot_sync_fence *fence,
                                long timeout) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.sde_rot_sync_fence = type opaque
define i32 @sde_rotator_wait_sync_fence(%struct.sde_rot_sync_fence* %0, i64 %1) {
%3 = alloca %struct.sde_rot_sync_fence*
%4 = alloca i64
store %struct.sde_rot_sync_fence* %0, %struct.sde_rot_sync_fence** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
%struct.sde_rot_sync_fence = type opaque
define i32 @sde_rotator_wait_sync_fence(%struct.sde_rot_sync_fence* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int random();
uint8_t getRandom() {
  int n = random();
  while (((n & 0xFF) == 0x00)) {
    n = random();
  }
  return (uint8_t)n;
}


x86 assembly (clang, -O0):
<getRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
jne    1142 <getRandom+0x32>
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x4(%rbp)
jmp    1122 <getRandom+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandom>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random@plt>
test   %al,%al
je     1120 <getRandom+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getRandom() {
%1 = tail call i32 (...) @random()
%2 = and i32 %1, 255
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0, %4
%5 = tail call i32 (...) @random()
%6 = and i32 %5, 255
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %0
%9 = phi i32 [ %1, %0 ], [ %5, %4 ]
ret i32 %9
}
char *whereami(void) { return (char *)0; }


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

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

LLVM IR (-O0):
define i8* @whereami() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @whereami() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 1;
  while (i <= 3000000) {
    if (i % 1000000 == 0)
      printf("%d\n", i);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x2dc6c0,-0x8(%rbp)
jg     1164 <main+0x54>
mov    -0x8(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1156 <main+0x46>
mov    -0x8(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@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   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
jmp    113b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x2dc6c1,%ebx
je     115e <main+0x4e>
mov    %ebx,%eax
imul   $0x431bde83,%rax,%rax
shr    $0x32,%rax
imul   $0xf4240,%eax,%eax
cmp    %eax,%ebx
jne    1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 1, %0 ], [ %8, %7 ]
%3 = urem i32 %2, 1000000
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %5, %1
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 3000001
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
int IsSortedDouble(int M, double *in) {
  int m, out;
  out = 1;
  for (m = 1; m < M; m++)
    if (in[m] < in[m - 1]) {
      out = 0;
      break;
    }
  return out;
}


x86 assembly (clang, -O0):
<IsSortedDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116d <IsSortedDouble+0x6d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    115a <IsSortedDouble+0x5a>
movl   $0x0,-0x18(%rbp)
jmp    116d <IsSortedDouble+0x6d>
jmp    115f <IsSortedDouble+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <IsSortedDouble+0x19>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsSortedDouble>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1138 <IsSortedDouble+0x38>
mov    %edi,%ecx
movsd  (%rsi),%xmm0
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nop
movapd %xmm0,%xmm1
movsd  (%rsi,%rdx,8),%xmm0
ucomisd %xmm0,%xmm1
ja     1139 <IsSortedDouble+0x39>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1120 <IsSortedDouble+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @IsSortedDouble(i32 %0, double* nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = load double, double* %1
br label %9
7: ; preds = %9
%8 = icmp eq i64 %15, %5
br i1 %8, label %16, label %9
9: ; preds = %4, %7
%10 = phi double [ %6, %4 ], [ %13, %7 ]
%11 = phi i64 [ 1, %4 ], [ %15, %7 ]
%12 = getelementptr inbounds double, double* %1, i64 %11
%13 = load double, double* %12
%14 = fcmp olt double %13, %10
%15 = add nuw nsw i64 %11, 1
br i1 %14, label %16, label %7
16: ; preds = %7, %9, %2
%17 = phi i32 [ 1, %2 ], [ 0, %9 ], [ 1, %7 ]
ret i32 %17
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_PROCESS_CPUTIME_ID;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
struct timespec timer_start() {
  struct timespec start_time;
  clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start_time);
  return start_time;
}


x86 assembly (clang, -O0):
<timer_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_start>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define i32 @timer_start() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define i32 @timer_start() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
unsigned char xsingle2c(unsigned char *what) {
  register unsigned char digit;
  digit = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0'));
  return digit;
}


x86 assembly (clang, -O0):
<xsingle2c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x41,%eax
jl     1132 <xsingle2c+0x32>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xdf,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <xsingle2c+0x3f>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsingle2c>:
mov    (%rdi),%al
mov    %eax,%ecx
and    $0xdf,%cl
add    $0xc9,%cl
lea    -0x30(%rax),%edx
cmp    $0x41,%al
movzbl %dl,%edx
movzbl %cl,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @xsingle2c(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 223
%15 = sub nsw i32 %14, 65
%16 = add nsw i32 %15, 10
br label %23
17: ; preds = %1
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 0
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %21, 48
br label %23
23: ; preds = %17, %9
%24 = phi i32 [ %16, %9 ], [ %22, %17 ]
%25 = trunc i32 %24 to i8
store i8 %25, i8* %3
%26 = load i8, i8* %3
ret i8 %26
}

LLVM IR (-O2):
define zeroext i8 @xsingle2c(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ugt i8 %2, 64
%4 = and i8 %2, -33
%5 = add i8 %4, -55
%6 = add i8 %2, -48
%7 = select i1 %3, i8 %5, i8 %6
ret i8 %7
}
/* Variables and functions */
void *active_vector_dummy_dup(const void *data, const size_t len) {
  return (void *)data;
}


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

x86 assembly (clang, -O2):
<active_vector_dummy_dup>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @active_vector_dummy_dup(i8* readnone returned %0, i64 %1) {
ret i8* %0
}
indreg0adr1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((*p0) <= (*((int *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx),%eax
jg     1137 <indreg0adr1+0x37>
movl   $0x1,-0x4(%rbp)
jmp    113e <indreg0adr1+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adr1>:
mov    (%r8),%ecx
xor    %eax,%eax
cmp    0xa98ac7,%ecx
setle  %al
ret

LLVM IR (-O0):
define i32 @indreg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %12
%15 = load i32, i32* %14
%16 = load i32, i32* inttoptr (i64 11111111 to i32*)
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %6
store i32 1, i32* %7
br label %20
19: ; preds = %6
store i32 0, i32* %7
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @indreg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = load i32, i32* %4
%8 = load i32, i32* inttoptr (i64 11111111 to i32*)
%9 = icmp sle i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ poe_isword(char);
int poe_isnotcmdword(char c) { return !poe_isword(c); }


x86 assembly (clang, -O0):
<poe_isnotcmdword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <poe_isword@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poe_isnotcmdword>:
push   %rax
call   1030 <poe_isword@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @poe_isnotcmdword(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @poe_isword(i8 signext %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @poe_isnotcmdword(i8 signext %0) {
%2 = tail call i32 @poe_isword(i8 signext %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PathSummaryHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void PathSummaryRequestUpdate() { UAVObjRequestUpdate(PathSummaryHandle()); }


x86 assembly (clang, -O0):
<PathSummaryRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PathSummaryHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PathSummaryRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <PathSummaryHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @PathSummaryRequestUpdate() {
%1 = call i32 (...) @PathSummaryHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PathSummaryRequestUpdate() {
%1 = tail call i32 (...) @PathSummaryHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
void swap(int *list, int index1, int index2) {
  int tmp = list[index1];
  list[index1] = list[index2];
  list[index2] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x38() {
  Assert_real((islower(56) == 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_islower.c",
              285, ("islower should be 0 for 8"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x38>:
push   %rax
mov    $0x38,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x11d,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for 8\00"
define void @t_islower_0x38() {
%1 = call i64 @islower(i32 56)
%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 285, i8* getelementptr inbounds ([26 x i8], [26 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for 8\00"
define void @t_islower_0x38() {
%1 = tail call i64 @islower(i32 56)
%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 285, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *afio_get_EXTICR2() {
  return mem_get_reg32(0x40010000 + 0x0C);
}


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

x86 assembly (clang, -O2):
<afio_get_EXTICR2>:
mov    $0x4001000c,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @afio_get_EXTICR2() {
%1 = call i32* @mem_get_reg32(i32 1073807372)
ret i32* %1
}

LLVM IR (-O2):
define i32* @afio_get_EXTICR2() {
%1 = tail call i32* @mem_get_reg32(i32 1073807372)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ __NR_clone;
scalar_t__ syscall(int /*<<< orphan*/, unsigned long, void *);
int syscall_clone(unsigned long flags, void *child_stack) {
  return (int)syscall(__NR_clone, flags, child_stack);
}


x86 assembly (clang, -O0):
<syscall_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_clone>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ed3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_clone = global i32 0
define i32 @syscall_clone(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i32, i32* @__NR_clone
%6 = load i64, i64* %3
%7 = load i8*, i8** %4
%8 = call i64 @syscall(i32 %5, i64 %6, i8* %7)
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@__NR_clone = global i32 0
define i32 @syscall_clone(i64 %0, i8* %1) {
%3 = load i32, i32* @__NR_clone
%4 = tail call i64 @syscall(i32 %3, i64 %0, i8* %1)
%5 = trunc i64 %4 to i32
ret i32 %5
}
void dummy(void *d) {}


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

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

LLVM IR (-O0):
define void @dummy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @dummy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ intenable(int);
void kbdinit(void) { intenable(1); }


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

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

LLVM IR (-O0):
define void @kbdinit() {
%1 = call i32 @intenable(i32 1)
ret void
}

LLVM IR (-O2):
define void @kbdinit() {
%1 = tail call i32 @intenable(i32 1)
ret void
}
/* Variables and functions */
double pow(int, double);
double exp10(double x) { return pow(10, x); }


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

x86 assembly (clang, -O2):
<exp10>:
mov    $0xa,%edi
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @exp10(double %0) {
%2 = tail call double @pow(i32 10, double %0)
ret double %2
}