xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int j;
  int k;
  if (!(i < j && k > 0))
    return 0;
  while (i < j) {
    k = k + 1;
    i = i + 1;
  }
  assert(k > j - i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1135 <main+0x25>
cmpl   $0x0,-0x10(%rbp)
jg     1141 <main+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1188 <main+0x78>
jmp    1146 <main+0x36>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <main+0x59>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x36>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_smoother_free() {
  printf("NOT IMPLEMENTED:"
         "pa_smoother_free"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_smoother_free\0A\00"
define i32 @pa_smoother_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_smoother_free\00"
define i32 @pa_smoother_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ run_guest();
int /*<<< orphan*/ set_affinity(void *);
void *start_guest(void *arg) {
  set_affinity(arg);
  run_guest();
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<start_guest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <set_affinity@plt>
mov    $0x0,%al
call   1030 <run_guest@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_guest>:
push   %rax
call   1050 <set_affinity@plt>
xor    %eax,%eax
call   1030 <run_guest@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @start_guest(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @set_affinity(i8* %4)
%6 = call i32 (...) @run_guest()
%7 = call i32 @pthread_exit(i32* null)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @start_guest(i8* %0) {
%2 = tail call i32 @set_affinity(i8* %0)
%3 = tail call i32 (...) @run_guest()
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
int isOperand(char c) {
  if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isOperand>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1124 <isOperand+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    113e <isOperand+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     114a <isOperand+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     114a <isOperand+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <isOperand+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOperand>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isOperand(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %19, label %20
19: ; preds = %15, %7
store i32 1, i32* %2
br label %21
20: ; preds = %15, %11
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @isOperand(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void outsl(int port, const void *addr, unsigned long count) {
  __asm__ __volatile__("rep; outs"
                       "l"
                       : "+S"(addr), "+c"(count)
                       : "d"(port));
}


x86 assembly (clang, -O0):
<outsl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%edx
rep outsl %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsl>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsl %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsl(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32, i32* %4
%10 = call { i8*, i64 } asm sideeffect "rep; outsl", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsl(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep; outsl", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
ret void
}
double Radians(double degrees) { return (degrees / 180 * 3.1415926535); }


x86 assembly (clang, -O0):
<Radians>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Radians>:
divsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Radians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.800000e+02
%5 = fmul double %4, 0x400921FB54411744
ret double %5
}

LLVM IR (-O2):
define double @Radians(double %0) {
%2 = fdiv double %0, 1.800000e+02
%3 = fmul double %2, 0x400921FB54411744
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_VERSION_NUMBER;
int /*<<< orphan*/ OpenSSL_version_num();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  printf("Build version: 0x%08lX\n", OPENSSL_VERSION_NUMBER);
  printf("Library version: 0x%08lX\n", OpenSSL_version_num());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <OpenSSL_version_num@plt>
lea    0xed4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Build version: 0x%08lX\0A\00"
@OPENSSL_VERSION_NUMBER = global i32 0
@.str.1 = [26 x i8] c"Library version: 0x%08lX\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @OPENSSL_VERSION_NUMBER
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @OpenSSL_version_num()
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Build version: 0x%08lX\0A\00"
@OPENSSL_VERSION_NUMBER = global i32 0
@.str.1 = [26 x i8] c"Library version: 0x%08lX\0A\00"
define i32 @main() {
%1 = load i32, i32* @OPENSSL_VERSION_NUMBER
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @OpenSSL_version_num()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
void foo758() {}


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

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

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

LLVM IR (-O2):
define void @foo758() {
ret void
}
/* Variables and functions */
void *__ioremap(unsigned long, unsigned long, int);
extern void *ioremap_nocache(unsigned long physaddr, unsigned long size) {
  return __ioremap(physaddr, size, 1);
}


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

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

LLVM IR (-O0):
define i8* @ioremap_nocache(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 = call i8* @__ioremap(i64 %5, i64 %6, i32 1)
ret i8* %7
}

LLVM IR (-O2):
define i8* @ioremap_nocache(i64 %0, i64 %1) {
%3 = tail call i8* @__ioremap(i64 %0, i64 %1, i32 1)
ret i8* %3
}
__attribute__((no)) int bar2() {
  int a = -1;
  volatile unsigned b = 1U;
  int c = 1;
  c = (a + 972195716) % (b ? 1 : 2);
  if (c == 0)
    ;
  else
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<bar2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x39f28784,%eax
mov    -0x8(%rbp),%esi
mov    $0x2,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    115d <bar2+0x4d>
jmp    1162 <bar2+0x52>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar2>:
push   %rax
movl   $0x1,0x4(%rsp)
cmpl   $0x0,0x4(%rsp)
je     1124 <bar2+0x14>
xor    %eax,%eax
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @bar2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 -1, i32* %1
store volatile i32 1, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 972195716
%6 = load volatile i32, i32* %2
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 2
%10 = srem i32 %5, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %0
br label %15
14: ; preds = %0
unreachable
15: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @bar2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
tail call void @abort()
unreachable
6: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fexist(char *fname) {
  FILE *fp;
  fp = fopen(fname, "r");
  if (fp == NULL)
    return (0);
  fclose(fp);
  return (1);
}


x86 assembly (clang, -O0):
<fexist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <fexist+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <fexist+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fexist>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <fexist+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @fexist(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %13
10: ; preds = %1
%11 = load i32*, i32** %4
%12 = call i32 @fclose(i32* %11)
store i32 1, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @fexist(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ head;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, int);
void markPerror(char *fileName, int fileLine) {
  char head[(256)];
  snprintf(head, sizeof(head), "%s, %d", fileName, fileLine);
  perror(head);
  return;
}


x86 assembly (clang, -O0):
<markPerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
mov    $0x100,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <perror@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<markPerror>:
push   %rbx
sub    $0x100,%rsp
mov    %esi,%r8d
mov    %rdi,%rcx
lea    0xecb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s, %d\00"
define void @markPerror(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i32 @perror(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s, %d\00"
define void @markPerror(i8* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%6 = call i32 @perror(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_factor_comments();
int /*<<< orphan*/ test_factor_strings();
void all_factor_tests() {
  test_factor_comments();
  test_factor_strings();
}


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

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

LLVM IR (-O0):
define void @all_factor_tests() {
%1 = call i32 (...) @test_factor_comments()
%2 = call i32 (...) @test_factor_strings()
ret void
}

LLVM IR (-O2):
define void @all_factor_tests() {
%1 = tail call i32 (...) @test_factor_comments()
%2 = tail call i32 (...) @test_factor_strings()
ret void
}
char __unit_test_24() { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @__unit_test_24() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @__unit_test_24() {
ret i8 0
}
unsigned xma_le32(unsigned n) {
  static const int endianess = 1;
  if (*(char *)&endianess)
    return (n);
  n = (((n & 0xff000000) >> 24) | ((n & 0x00ff0000) >> 8) |
       ((n & 0x0000ff00) << 8) | ((n & 0x000000ff) << 24));
  return (n);
}


x86 assembly (clang, -O0):
<xma_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpb   $0x0,0xef2(%rip)
je     111f <xma_le32+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <xma_le32+0x5d>
mov    -0x8(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x8(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@xma_le32.endianess = internal constant i32 1
define i32 @xma_le32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i8, i8* bitcast (i32* @xma_le32.endianess to i8*)
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %25
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, -16777216
%11 = lshr i32 %10, 24
%12 = load i32, i32* %3
%13 = and i32 %12, 16711680
%14 = lshr i32 %13, 8
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 65280
%18 = shl i32 %17, 8
%19 = or i32 %15, %18
%20 = load i32, i32* %3
%21 = and i32 %20, 255
%22 = shl i32 %21, 24
%23 = or i32 %19, %22
store i32 %23, i32* %3
%24 = load i32, i32* %3
store i32 %24, i32* %2
br label %25
25: ; preds = %8, %6
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @xma_le32(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct _mgmt_tempadd_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _mgmt_tempadd_rsp *);
void mgmt_tempadd_rsp_free(struct _mgmt_tempadd_rsp *ptr) { osapi_free(ptr); }


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

x86 assembly (clang, -O2):
<mgmt_tempadd_rsp_free>:
jmp    1030 <osapi_free@plt>

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

LLVM IR (-O2):
%struct._mgmt_tempadd_rsp = type { i32 }
define void @mgmt_tempadd_rsp_free(%struct._mgmt_tempadd_rsp* %0) {
%2 = tail call i32 @osapi_free(%struct._mgmt_tempadd_rsp* %0)
ret void
}
void ble_rsp_hardware_i2c_read(
    const struct ble_msg_hardware_i2c_read_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_hardware_i2c_read_rsp_t = type opaque
define void @ble_rsp_hardware_i2c_read(%struct.ble_msg_hardware_i2c_read_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void spo_print(const char *buf) { fputs(buf, stdout); }


x86 assembly (clang, -O0):
<spo_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spo_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @spo_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @spo_print(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
void sws_freeVec() {}


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

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

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

LLVM IR (-O2):
define void @sws_freeVec() {
ret void
}
float log2f(float x) { return 0.0; }


x86 assembly (clang, -O0):
<log2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2f>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @log2f(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @log2f(float %0) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ foo_test_3();
__attribute__((__noreturn__)) void *test3_positive(int arg) {
  while (0)
    foo_test_3();
}


x86 assembly (clang, -O0):
<test3_positive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    112a <test3_positive+0x1a>
jmp    1136 <test3_positive+0x26>
mov    $0x0,%al
call   1030 <foo_test_3@plt>
jmp    111b <test3_positive+0xb>

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i8* @test3_positive(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %4, %1
br i1 false, label %4, label %6
4: ; preds = %3
%5 = call i32 (...) @foo_test_3()
br label %3
6: ; preds = %3
unreachable
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void menu(int selection) {
  printf("FAIL: menu callback should never be called\n");
  exit(1);
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<menu>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"FAIL: menu callback should never be called\0A\00"
define void @menu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [43 x i8] c"FAIL: menu callback should never be called\00"
define void @menu(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int toMin(const unsigned char hh, const unsigned char mm) {
  return (hh * 60) + mm;
}


x86 assembly (clang, -O0):
<toMin>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
imul   $0x3c,%eax,%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toMin>:
imul   $0x3c,%edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @toMin(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = mul nsw i32 %6, 60
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @toMin(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 60
%5 = zext i8 %1 to i32
%6 = add nuw nsw i32 %4, %5
ret i32 %6
}
void testClosureIIIrV(void (*closure)(int, int, int), int a1, int a2, int a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureIIIrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureIIIrV>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
jmp    *%rax

LLVM IR (-O0):
define void @testClosureIIIrV(void (i32, i32, i32)* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca void (i32, i32, i32)*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store void (i32, i32, i32)* %0, void (i32, i32, i32)** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load void (i32, i32, i32)*, void (i32, i32, i32)** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
ret void
}

LLVM IR (-O2):
define void @testClosureIIIrV(void (i32, i32, i32)* nocapture %0, i32 %1, i32 %2, i32 %3) {
tail call void %0(i32 %1, i32 %2, i32 %3)
ret void
}
int fork(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fork() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned char);
void __attribute__((no)) crtc_reg_write(unsigned char reg, unsigned char val) {
  outb(0x3d4, reg);
  outb(0x3d5, val);
}


x86 assembly (clang, -O0):
<crtc_reg_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x3d4,%edi
movzbl -0x1(%rbp),%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
movzbl -0x2(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crtc_reg_write>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x3d4,%edi
call   1030 <outb@plt>
mov    $0x3d5,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @crtc_reg_write(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @outb(i32 980, i8 zeroext %5)
%7 = load i8, i8* %4
%8 = call i32 @outb(i32 981, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @crtc_reg_write(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @outb(i32 980, i8 zeroext %0)
%4 = tail call i32 @outb(i32 981, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay();
int main() {
  int i = 0;
  volatile unsigned long *gpmcon = (volatile unsigned long *)0x10008820;
  volatile unsigned long *gpmdat = (volatile unsigned long *)0x20008824;
  *gpmcon = 0x1111;
  while (1) {
    *gpmdat = i;
    i++;
    if (i == 16)
      i = 0;
    delay();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x10008820,%eax
mov    %rax,-0x10(%rbp)
mov    $0x20008824,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x1111,(%rax)
movslq -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jne    1168 <main+0x58>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <delay@plt>
jmp    1143 <main+0x33>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movq   $0x1111,0x10008820
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq %ebx,%rbx
mov    %rbx,0x20008824
20
add    $0x1,%ebx
cmp    $0x10,%ebx
cmove  %ebp,%ebx
xor    %eax,%eax
call   1030 <delay@plt>
jmp    1130 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64*
%4 = alloca i64*
store i32 0, i32* %1
store i32 0, i32* %2
store i64* inttoptr (i64 268470304 to i64*), i64** %3
store i64* inttoptr (i64 536905764 to i64*), i64** %4
%5 = load i64*, i64** %3
store volatile i64 4369, i64* %5
br label %6
6: ; preds = %0, %15
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = load i64*, i64** %4
store volatile i64 %8, i64* %9
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 16
br i1 %13, label %14, label %15
14: ; preds = %6
store i32 0, i32* %2
br label %15
15: ; preds = %14, %6
%16 = call i32 (...) @delay()
br label %6
}

LLVM IR (-O2):
define i32 @main() {
store volatile i64 4369, i64* inttoptr (i64 268470304 to i64*)
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = sext i32 %2 to i64
store volatile i64 %3, i64* inttoptr (i64 536905764 to i64*)
%4 = add nsw i32 %2, 1
%5 = icmp eq i32 %4, 16
%6 = select i1 %5, i32 0, i32 %4
%7 = tail call i32 (...) @delay()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ safef(char *, int, char *, char *, char *);
void makeResultName(char *tableName, char *columnName, char *path) {
  safef(path, 512, "../trash/AUTO_UPGRADE_RESULT_%s_%s", tableName, columnName);
}


x86 assembly (clang, -O0):
<makeResultName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x200,%esi
lea    0xec4(%rip),%rdx
call   1030 <safef@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeResultName>:
mov    %rdx,%rax
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xee0(%rip),%rdx
mov    %rax,%rdi
mov    $0x200,%esi
jmp    1030 <safef@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"../trash/AUTO_UPGRADE_RESULT_%s_%s\00"
define void @makeResultName(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @safef(i8* %7, i32 512, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"../trash/AUTO_UPGRADE_RESULT_%s_%s\00"
define void @makeResultName(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @safef(i8* %2, i32 512, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, world!\n\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 = [16 x i8] c"Hello, world!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int vector_ref(int *v, int i) { return v[i + 1]; }


x86 assembly (clang, -O0):
<vector_ref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_ref>:
movslq %esi,%rax
mov    0x4(%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @vector_ref(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @vector_ref(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Type definitions */
struct in6_addr {
  int /*<<< orphan*/ s6_addr;
};

/* Variables and functions */
scalar_t__ memcmp(int /*<<< orphan*/, int /*<<< orphan*/, int);
int in6_addr_match(void *val1, void *val2) {
  struct in6_addr *addr1 = val1;
  struct in6_addr *addr2 = val2;
  return (memcmp(addr1->s6_addr, addr2->s6_addr, 16) == 0);
}


x86 assembly (clang, -O0):
<in6_addr_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    $0x10,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in6_addr_match>:
push   %rax
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    $0x10,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define i32 @in6_addr_match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.in6_addr*
%6 = alloca %struct.in6_addr*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.in6_addr*
store %struct.in6_addr* %8, %struct.in6_addr** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.in6_addr*
store %struct.in6_addr* %10, %struct.in6_addr** %6
%11 = load %struct.in6_addr*, %struct.in6_addr** %5
%12 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load %struct.in6_addr*, %struct.in6_addr** %6
%15 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i64 @memcmp(i32 %13, i32 %16, i32 16)
%18 = icmp eq i64 %17, 0
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @in6_addr_match(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i64 @memcmp(i32 %4, i32 %6, i32 16)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
int mst_ckme(int method) {
  switch (method) {
  case 2:
    return -2 > 0 ? 0 : 64;
  case 1:
    return 0;
  case 3:
    return 0;
  default:;
  }
  return 64;
}


x86 assembly (clang, -O0):
<mst_ckme>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1149 <mst_ckme+0x49>
jmp    111b <mst_ckme+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     113d <mst_ckme+0x3d>
jmp    112c <mst_ckme+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1155 <mst_ckme+0x55>
jmp    1161 <mst_ckme+0x61>
movl   $0x40,-0x4(%rbp)
jmp    116d <mst_ckme+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    116d <mst_ckme+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    116d <mst_ckme+0x6d>
jmp    1166 <mst_ckme+0x66>
movl   $0x40,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mst_ckme>:
and    $0xfffffffd,%edi
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
shl    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @mst_ckme(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 2, label %5
i32 1, label %6
i32 3, label %7
]
5: ; preds = %1
store i32 64, i32* %2
br label %10
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
store i32 0, i32* %2
br label %10
8: ; preds = %1
br label %9
9: ; preds = %8
store i32 64, i32* %2
br label %10
10: ; preds = %9, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @mst_ckme(i32 %0) {
%2 = and i32 %0, -3
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i32 0, i32 64
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Atm128UartP__0__Counter__overflow();
void TransformCounterC__1__Counter__overflow(void) {
  Atm128UartP__0__Counter__overflow();
}


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

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

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

LLVM IR (-O2):
define void @TransformCounterC__1__Counter__overflow() {
%1 = tail call i32 (...) @Atm128UartP__0__Counter__overflow()
ret void
}
void foo_1_1_1_1_1_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_1_1_1_2_1() {
ret void
}
int mf__mem_compare(const void *a1, const void *a2) {
  if (a1 < a2)
    return (-1);
  if (a1 > a2)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<mf__mem_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1126 <mf__mem_compare+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <mf__mem_compare+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1140 <mf__mem_compare+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <mf__mem_compare+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mf__mem_compare>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mf__mem_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
int test_imm_A5int64_highword_reg(long long val) {
  return ((val >> 32) & (0xA5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A5int64_highword_reg>:
movabs $0xa500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A5int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 165
%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_A5int64_highword_reg(i64 %0) {
%2 = and i64 %0, 708669603840
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fseek(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ ftell(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void exit_if_app_is_offline() {
  switch (0) {
  case 0:
    exit(0);
  case 1:
    fseek(stdin, 0, SEEK_END);
    if (ftell(stdin) <= 0)
      exit(0);
    break;
  }
}


x86 assembly (clang, -O0):
<exit_if_app_is_offline>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_if_app_is_offline>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
@stdin = global i32 0
define void @exit_if_app_is_offline() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@stdin = global i32 0
define void @exit_if_app_is_offline() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
scalar_t__ tcgetattr(int, struct termios *);
int tty_get_attributes(int fd, struct termios *buf) {
  if (tcgetattr(fd, buf) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<tty_get_attributes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <tcgetattr@plt>
cmp    $0x0,%rax
jge    1141 <tty_get_attributes+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <tty_get_attributes+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_get_attributes>:
push   %rax
call   1030 <tcgetattr@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @tty_get_attributes(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.termios*
store i32 %0, i32* %4
store %struct.termios* %1, %struct.termios** %5
%6 = load i32, i32* %4
%7 = load %struct.termios*, %struct.termios** %5
%8 = call i64 @tcgetattr(i32 %6, %struct.termios* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @tty_get_attributes(i32 %0, %struct.termios* %1) {
%3 = tail call i64 @tcgetattr(i32 %0, %struct.termios* %1)
%4 = ashr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
char *createData(char *input) {
  char *dup = malloc(sizeof(char) * (strlen(input)) + 1);
  strcpy(dup, input);
  return dup;
}


x86 assembly (clang, -O0):
<createData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
shl    $0x0,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createData>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @createData(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = mul i64 1, %5
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i8* @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @createData(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
int num_factors(int n) {
  int count = 2;
  int f = 2;
  while (f * f <= n) {
    if (n % f == 0)
      count += 2;
    if (f * f == n)
      count--;
    f++;
  }
  return count;
}


x86 assembly (clang, -O0):
<num_factors>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1165 <num_factors+0x65>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113e <num_factors+0x3e>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1157 <num_factors+0x57>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <num_factors+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_factors>:
mov    $0x2,%eax
cmp    $0x4,%edi
jl     1147 <num_factors+0x47>
mov    %edi,%r8d
mov    $0x2,%ecx
mov    $0x4,%esi
mov    $0x2,%edi
nopl   0x0(%rax)
mov    %r8d,%eax
cltd
idiv   %ecx
lea    0x2(%rdi),%eax
test   %edx,%edx
cmovne %edi,%eax
xor    %edx,%edx
cmp    %r8d,%esi
sete   %dl
sub    %edx,%eax
add    $0x1,%ecx
mov    %ecx,%esi
imul   %ecx,%esi
mov    %eax,%edi
cmp    %r8d,%esi
jle    1120 <num_factors+0x20>
ret

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

LLVM IR (-O2):
define i32 @num_factors(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %17, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %15, %3 ], [ 4, %1 ]
%5 = phi i32 [ %14, %3 ], [ 2, %1 ]
%6 = phi i32 [ %13, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %5
%8 = icmp eq i32 %7, 0
%9 = add nsw i32 %6, 2
%10 = select i1 %8, i32 %9, i32 %6
%11 = icmp eq i32 %4, %0
%12 = sext i1 %11 to i32
%13 = add nsw i32 %10, %12
%14 = add nuw nsw i32 %5, 1
%15 = mul nsw i32 %14, %14
%16 = icmp sgt i32 %15, %0
br i1 %16, label %17, label %3
17: ; preds = %3, %1
%18 = phi i32 [ 2, %1 ], [ %13, %3 ]
ret i32 %18
}