xunge/DecIR huggingface dataset:
int isPrime(int numToCheck) {
  int i = 0;
  for (i = 2; i < numToCheck; i++) {
    if (numToCheck % i == 0 && i != numToCheck) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115c <isPrime+0x5c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1149 <isPrime+0x49>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1149 <isPrime+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1163 <isPrime+0x63>
jmp    114e <isPrime+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <isPrime+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
xor    %ecx,%ecx
cmp    $0x3,%edi
jl     1120 <isPrime+0x20>
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isPrime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isPrime+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %5 ]
ret i32 %11
}
int color_offset_f4(int x, int y) {
  return ((y << 10) + (((x << 10) * 23) / 8) - (11610 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0x17,%eax,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0xb56800,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f4>:
shl    $0xa,%esi
imul   $0x5c00,%edi,%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x3,%ecx
lea    (%rcx,%rsi,1),%eax
add    $0xff4a9800,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 23
%10 = sdiv i32 %9, 8
%11 = add nsw i32 %6, %10
%12 = sub nsw i32 %11, 11888640
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f4(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 23552
%5 = sdiv i32 %4, 8
%6 = add nsw i32 %5, -11888640
%7 = add i32 %6, %3
%8 = ashr i32 %7, 10
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ path_get_file_name(char const *);
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int base_cmp(const void *a, const void *b) {
  const char *s1, *s2;
  s1 = *(char *const *)a;
  s2 = *(char *const *)b;
  return strcmp(path_get_file_name(s1), path_get_file_name(s2));
}


x86 assembly (clang, -O0):
<base_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <path_get_file_name@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <path_get_file_name@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   1040 <strcmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_cmp>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rbx
call   1030 <path_get_file_name@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <path_get_file_name@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <strcmp@plt>

LLVM IR (-O0):
define i32 @base_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = call i32 @path_get_file_name(i8* %13)
%15 = load i8*, i8** %6
%16 = call i32 @path_get_file_name(i8* %15)
%17 = call i32 @strcmp(i32 %14, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @base_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @path_get_file_name(i8* %4)
%8 = tail call i32 @path_get_file_name(i8* %6)
%9 = tail call i32 @strcmp(i32 %7, i32 %8)
ret i32 %9
}
int testA20() {
  unsigned char *A20TestLow = (unsigned char *)0x1600;
  unsigned char *A20TestHi = (unsigned char *)0x101600;
  unsigned char oldHi = A20TestHi[0];
  ;
  A20TestHi[0] = 0x00;
  ;
  A20TestLow[0] = 0xFF;
  ;
  if (A20TestHi[0] != 0xFF) {
    return 1;
    A20TestHi[0] = oldHi;
  }
  A20TestHi[0] = oldHi;
  return 0;
}


x86 assembly (clang, -O0):
<testA20>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1600,%eax
mov    %rax,-0x10(%rbp)
mov    $0x101600,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0xff,(%rax)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xff,%eax
je     114b <testA20+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    115b <testA20+0x5b>
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testA20>:
mov    0x101600,%cl
movb   $0x0,0x101600
movb   $0xff,0x1600
ff
mov    $0x1,%eax
cmpb   $0xff,0x101600
ff
je     1127 <testA20+0x27>
ret
mov    %cl,0x101600
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @testA20() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* inttoptr (i64 5632 to i8*), i8** %2
store i8* inttoptr (i64 1054208 to i8*), i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
store i8 %7, i8* %4
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 0, i8* %9
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 -1, i8* %11
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = icmp ne i32 %15, 255
br i1 %16, label %17, label %18
17: ; preds = %0
store i32 1, i32* %1
br label %22
18: ; preds = %0
%19 = load i8, i8* %4
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 0
store i8 %19, i8* %21
store i32 0, i32* %1
br label %22
22: ; preds = %18, %17
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @testA20() {
%1 = load i8, i8* inttoptr (i64 1054208 to i8*)
store i8 0, i8* inttoptr (i64 1054208 to i8*)
store i8 -1, i8* inttoptr (i64 5632 to i8*)
%2 = load i8, i8* inttoptr (i64 1054208 to i8*)
%3 = icmp eq i8 %2, -1
br i1 %3, label %4, label %5
4: ; preds = %0
store i8 %1, i8* inttoptr (i64 1054208 to i8*)
br label %5
5: ; preds = %0, %4
%6 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %6
}
int main() {
  volatile int foo = 111;
  unsigned long int volatile bar = 222;
  const volatile int *baz = &foo;
  volatile const unsigned long int *rt_clk = &bar;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x6f,-0x4(%rbp)
movq   $0xde,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x6f,-0xc(%rsp)
movq   $0xde,-0x8(%rsp)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32*
%4 = alloca i64*
store volatile i32 111, i32* %1
store volatile i64 222, i64* %2
store i32* %1, i32** %3
store i64* %2, i64** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i32* %1 to i8*
store volatile i32 111, i32* %1
%4 = bitcast i64* %2 to i8*
store volatile i64 222, i64* %2
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
int parse_name(const char *value, char **name) {
  if ((*name = strdup(value)) == NULL) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    1146 <parse_name+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <parse_name+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_name>:
push   %rbx
mov    %rsi,%rbx
call   1030 <strdup@plt>
mov    %rax,(%rbx)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @parse_name(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 = call i8* @strdup(i8* %6)
%8 = load i8**, i8*** %5
store i8* %7, i8** %8
%9 = icmp eq i8* %7, null
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):
define i32 @parse_name(i8* nocapture %0, i8** nocapture writeonly %1) {
%3 = tail call i8* @strdup(i8* %0)
store i8* %3, i8** %1
%4 = icmp eq i8* %3, null
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ operand(int /*<<< orphan*/, int);
ccr() { operand(0, 0x01); }


x86 assembly (clang, -O0):
<ccr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <operand@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccr>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <operand@plt>

LLVM IR (-O0):
define i32 @ccr() {
%1 = alloca i32
%2 = call i32 @operand(i32 0, i32 1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @ccr() {
%1 = tail call i32 @operand(i32 0, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int factorial(int n) {
  if (n == 1) {
    printf("ar1\n");
    return (1);
  } else {
    printf(" ar%d,", n);
    return (n * factorial(n - 1));
  }
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114f <factorial+0x2f>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117c <factorial+0x5c>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebx
cmp    $0x1,%edi
je     1157 <factorial+0x37>
mov    %edi,%ebp
mov    $0x1,%ebx
lea    0xec4(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
imul   %ebp,%ebx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jne    1140 <factorial+0x20>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [7 x i8] c" ar%d,\00"
@str = [4 x i8] c"ar1\00"
define i32 @factorial(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %6, %1
%4 = phi i32 [ 1, %1 ], [ %11, %6 ]
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 %4
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ %0, %1 ]
%8 = phi i32 [ %11, %6 ], [ 1, %1 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%10 = add nsw i32 %7, -1
%11 = mul nsw i32 %7, %8
%12 = icmp eq i32 %10, 1
br i1 %12, label %3, label %6
}
/* Variables and functions */
int /*<<< orphan*/ nl();
int /*<<< orphan*/ ot(char *);
gjcase() {
  ot("jmp\tcase");
  nl();
}


x86 assembly (clang, -O0):
<gjcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <ot@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gjcase>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <ot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"jmp\09case\00"
define i32 @gjcase() {
%1 = alloca i32
%2 = call i32 @ot(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @nl()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"jmp\09case\00"
define i32 @gjcase() {
%1 = tail call i32 @ot(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @nl()
ret i32 undef
}
/* Variables and functions */
int sqrt(int);
int math___Int_sqrt___impl(int recv) { return sqrt(recv); }


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

x86 assembly (clang, -O2):
<math___Int_sqrt___impl>:
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define i32 @math___Int_sqrt___impl(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ getfloat(float *);
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float f;
  if (getfloat(&f))
    printf("%g\n", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <getfloat@plt>
cmp    $0x0,%rax
je     1153 <main+0x33>
movss  -0x8(%rbp),%xmm0
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <getfloat@plt>
test   %rax,%rax
je     1142 <main+0x22>
movss  0x4(%rsp),%xmm0
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i64 @getfloat(float* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load float, float* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %6)
br label %8
8: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i64 @getfloat(float* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load float, float* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %6)
br label %8
8: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ xpto();
int alfa(int x, int y) {
  int z = 5;
  xpto();
  printf("\n3 - %d", z);
  return ++x * y++;
}


x86 assembly (clang, -O0):
<alfa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    $0x0,%al
call   1040 <xpto@plt>
mov    -0xc(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alfa>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <xpto@plt>
lea    0xecb(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
imul   %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\0A3 - %d\00"
define i32 @alfa(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 5, i32* %5
%6 = call i32 (...) @xpto()
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = mul nsw i32 %10, %11
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0A3 - %d\00"
define i32 @alfa(i32 %0, i32 %1) {
%3 = tail call i32 (...) @xpto()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = add nsw i32 %0, 1
%6 = mul nsw i32 %5, %1
ret i32 %6
}
__attribute__((visibility("hidden"))) int sd_notify(int unset_environment,
                                                    const char *state) {
  return 0;
}


x86 assembly (clang, -O0):
<sd_notify>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define hidden i32 @sd_notify(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool read_defect_data_10_is_plist_valid(uint8_t *data) {
  return data[1] & 0x10;
}


x86 assembly (clang, -O0):
<read_defect_data_10_is_plist_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_defect_data_10_is_plist_valid>:
mov    0x4(%rdi),%eax
and    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @read_defect_data_10_is_plist_valid(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 16
ret i32 %6
}

LLVM IR (-O2):
define i32 @read_defect_data_10_is_plist_valid(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = and i32 %3, 16
ret i32 %4
}
int rev(int a) {
  int r = 0, s;
  for (s = a; s > 0; s /= 10)
    r = 10 * r + s % 10;
  return r;
}


x86 assembly (clang, -O0):
<rev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114b <rev+0x4b>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1114 <rev+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <rev+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <rev+0x10>
ret

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

LLVM IR (-O2):
define i32 @rev(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = mul nsw i32 %5, 10
%7 = urem i32 %4, 10
%8 = add nsw i32 %7, %6
%9 = udiv i32 %4, 10
%10 = icmp ult i32 %4, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
int multFiveEighths(int x) {
  int sign = (x >> 31) & 1;
  int resultAfterDivision = (x << 2) + x;
  int additionForNeg = (sign << 3) + (~sign + 1);
  int balancedResult = resultAfterDivision + additionForNeg;
  int resultAfterMultiplication = balancedResult >> 3;
  int result = resultAfterMultiplication;
  return result;
}


x86 assembly (clang, -O0):
<multFiveEighths>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multFiveEighths>:
mov    %edi,%eax
sar    $0x1f,%eax
lea    (%rdi,%rdi,4),%ecx
add    %eax,%ecx
shr    $0x1f,%edi
lea    (%rcx,%rdi,8),%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @multFiveEighths(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 31
%11 = and i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = shl i32 %12, 2
%14 = load i32, i32* %2
%15 = add nsw i32 %13, %14
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = shl i32 %16, 3
%18 = load i32, i32* %3
%19 = xor i32 %18, -1
%20 = add nsw i32 %19, 1
%21 = add nsw i32 %17, %20
store i32 %21, i32* %5
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = add nsw i32 %22, %23
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = ashr i32 %25, 3
store i32 %26, i32* %7
%27 = load i32, i32* %7
store i32 %27, i32* %8
%28 = load i32, i32* %8
ret i32 %28
}

LLVM IR (-O2):
define i32 @multFiveEighths(i32 %0) {
%2 = ashr i32 %0, 31
%3 = mul i32 %0, 5
%4 = lshr i32 %0, 28
%5 = and i32 %4, 8
%6 = add i32 %3, %2
%7 = add i32 %6, %5
%8 = ashr i32 %7, 3
ret i32 %8
}
float fitParabola(float leftSample, float midSample, float rightSample) {
  float p;
  p = (leftSample - (2 * midSample) + rightSample);
  if (p != 0.0)
    p = (leftSample - rightSample) / p * 0.5;
  return p;
}


x86 assembly (clang, -O0):
<fitParabola>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm1
subss  %xmm1,%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1150 <fitParabola+0x50>
jp     1150 <fitParabola+0x50>
jmp    1178 <fitParabola+0x78>
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe95(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitParabola>:
addss  %xmm1,%xmm1
movaps %xmm0,%xmm3
subss  %xmm1,%xmm3
addss  %xmm2,%xmm3
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm3
jne    1119 <fitParabola+0x19>
jnp    112c <fitParabola+0x2c>
subss  %xmm2,%xmm0
divss  %xmm3,%xmm0
mulss  0xed7(%rip),%xmm0
movaps %xmm0,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @fitParabola(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %9, float %8)
%11 = load float, float* %6
%12 = fadd float %10, %11
store float %12, float* %7
%13 = load float, float* %7
%14 = fpext float %13 to double
%15 = fcmp une double %14, 0.000000e+00
br i1 %15, label %16, label %25
16: ; preds = %3
%17 = load float, float* %4
%18 = load float, float* %6
%19 = fsub float %17, %18
%20 = load float, float* %7
%21 = fdiv float %19, %20
%22 = fpext float %21 to double
%23 = fmul double %22, 5.000000e-01
%24 = fptrunc double %23 to float
store float %24, float* %7
br label %25
25: ; preds = %16, %3
%26 = load float, float* %7
ret float %26
}

LLVM IR (-O2):
define float @fitParabola(float %0, float %1, float %2) {
%4 = tail call float @llvm.fmuladd.f32(float %1, float -2.000000e+00, float %0)
%5 = fadd float %4, %2
%6 = fcmp une float %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = fsub float %0, %2
%9 = fdiv float %8, %5
%10 = fmul float %9, 5.000000e-01
br label %11
11: ; preds = %7, %3
%12 = phi float [ %10, %7 ], [ %5, %3 ]
ret float %12
}
void swapi(int *a, int *b) {
  int t = *b;
  *b = *a;
  *a = t;
}


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

x86 assembly (clang, -O2):
<swapi>:
mov    (%rsi),%eax
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @swapi(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
store i32 %4, i32* %1
store i32 %3, i32* %0
ret void
}
void joystick_poll() {}


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

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

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

LLVM IR (-O2):
define void @joystick_poll() {
ret void
}
unsigned char f31(unsigned char x, int y) {
  return (x >> (8 * sizeof(unsigned char) - y)) ^ (x << y);
}


x86 assembly (clang, -O0):
<f31>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
movslq -0x8(%rbp),%rdx
mov    $0x8,%ecx
sub    %rdx,%rcx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f31>:
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f31(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = sub i64 8, %8
%10 = trunc i64 %9 to i32
%11 = ashr i32 %6, %10
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = load i32, i32* %4
%15 = shl i32 %13, %14
%16 = xor i32 %11, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f31(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = sub i32 8, %1
%5 = lshr i32 %3, %4
%6 = shl i32 %3, %1
%7 = xor i32 %5, %6
%8 = trunc i32 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void panic(char *filename, int line) {
  fprintf(stderr, "\n?Panic in line %d of file %s\n", line, filename);
  perror("Unespected UNIX error");
  abort();
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xebd(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rcx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xecd(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"\0A?Panic in line %d of file %s\0A\00"
@.str.1 = [22 x i8] c"Unespected UNIX error\00"
define void @panic(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"\0A?Panic in line %d of file %s\0A\00"
@.str.1 = [22 x i8] c"Unespected UNIX error\00"
define void @panic(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%5 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @abort()
unreachable
}
int os_seek(void *data, long offset, int origin, int *rc) { return -1; }


x86 assembly (clang, -O0):
<os_seek>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @os_seek(i8* nocapture readnone %0, i64 %1, i32 %2, i32* nocapture readnone %3) {
ret i32 -1
}
void f_void(void) {}


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

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

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

LLVM IR (-O2):
define void @f_void() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x28() {
  Assert_real((iscntrl(40) == 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_iscntrl.c",
              205, ("iscntrl should be 0 for ("));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x28>:
push   %rax
mov    $0x28,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xcd,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for (\00"
define void @t_iscntrl_0x28() {
%1 = call i64 @iscntrl(i32 40)
%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 205, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for (\00"
define void @t_iscntrl_0x28() {
%1 = tail call i64 @iscntrl(i32 40)
%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 205, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct desc_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pack_descriptor(struct desc_struct *, unsigned long,
                                   unsigned int, int, int /*<<< orphan*/);
__attribute__((always_)) void set_tssldt_descriptor(void *d, unsigned long addr,
                                                    unsigned type,
                                                    unsigned size) {
  pack_descriptor((struct desc_struct *)d, addr, size, 0x80 | type, 0);
}


x86 assembly (clang, -O0):
<set_tssldt_descriptor>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
or     $0x80,%ecx
xor    %r8d,%r8d
call   1030 <pack_descriptor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_tssldt_descriptor>:
mov    %edx,%eax
or     $0x80,%eax
mov    %ecx,%edx
mov    %eax,%ecx
xor    %r8d,%r8d
jmp    1030 <pack_descriptor@plt>

LLVM IR (-O0):
%struct.desc_struct = type { i32 }
define void @set_tssldt_descriptor(i8* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to %struct.desc_struct*
%11 = load i64, i64* %6
%12 = load i32, i32* %8
%13 = load i32, i32* %7
%14 = or i32 128, %13
%15 = call i32 @pack_descriptor(%struct.desc_struct* %10, i64 %11, i32 %12, i32 %14, i32 0)
ret void
}

LLVM IR (-O2):
%struct.desc_struct = type { i32 }
define void @set_tssldt_descriptor(i8* %0, i64 %1, i32 %2, i32 %3) {
%5 = bitcast i8* %0 to %struct.desc_struct*
%6 = or i32 %2, 128
%7 = tail call i32 @pack_descriptor(%struct.desc_struct* %5, i64 %1, i32 %3, i32 %6, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int socketpair(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int *);
int fd_pair(int fd[2]) {
  int ret;
  ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd);
  return ret;
}


x86 assembly (clang, -O0):
<fd_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
xor    %edx,%edx
call   1030 <socketpair@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_pair>:
mov    %rdi,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socketpair@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @fd_pair(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32, i32* @AF_UNIX
%5 = load i32, i32* @SOCK_STREAM
%6 = load i32*, i32** %2
%7 = call i32 @socketpair(i32 %4, i32 %5, i32 0, i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @fd_pair(i32* %0) {
%2 = load i32, i32* @AF_UNIX
%3 = load i32, i32* @SOCK_STREAM
%4 = tail call i32 @socketpair(i32 %2, i32 %3, i32 0, i32* %0)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void write_word(uint8_t *ptr, uint16_t value) {
  ptr[0] = value;
  ptr[1] = value >> 8;
}


x86 assembly (clang, -O0):
<write_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_word>:
mov    %esi,(%rdi)
sar    $0x8,%esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @write_word(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 %5, i32* %7
%8 = load i32, i32* %4
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @write_word(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
ret void
}
void clearGraph(int g[7][7]) {
  int i, j;
  for (i = 0; i < 7; i++) {
    for (j = 0; j < 7; j++) {
      g[i][j] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<clearGraph>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    1165 <clearGraph+0x65>
movl   $0x0,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
jge    1152 <clearGraph+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x1c,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <clearGraph+0x20>
jmp    1157 <clearGraph+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clearGraph+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearGraph>:
xorps  %xmm0,%xmm0
movups %xmm0,0xb0(%rdi)
movups %xmm0,0xa0(%rdi)
movups %xmm0,0x90(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x0,0xc0(%rdi)
ret

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

LLVM IR (-O2):
define void @clearGraph([7 x i32]* nocapture writeonly %0) {
%2 = bitcast [7 x i32]* %0 to i8*
ret void
}
adrreg0indreg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[10000000]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0indreg1>:
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    0x2625a00(%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
ja     113a <adrreg0indreg1+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <adrreg0indreg1+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0indreg1>:
mov    0x2625a00(%r8),%ecx
xor    %eax,%eax
cmp    (%r9),%ecx
setbe  %al
ret

LLVM IR (-O0):
define i32 @adrreg0indreg1(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 = getelementptr inbounds i32, i32* %14, i64 10000000
%16 = load i32, i32* %15
%17 = load i32*, i32** %13
%18 = load i32, i32* %17
%19 = icmp ule i32 %16, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @adrreg0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %4, i64 10000000
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = icmp ule i32 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int usage() {
  printf("Usage: make_mem [-w] <input file> <output file> <size> [offset]\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [65 x i8] c"Usage: make_mem [-w] <input file> <output file> <size> [offset]\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [64 x i8] c"Usage: make_mem [-w] <input file> <output file> <size> [offset]\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float remainingAngle(float, float);
int main(int argc, const char *argv[]) {
  float angleA = 30.0;
  float angleB = 60.0;
  float angleC = remainingAngle(angleA, angleB);
  printf("The third angle is %.2f\n", angleC);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
call   1030 <remainingAngle@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
movss  0xed3(%rip),%xmm1
call   1030 <remainingAngle@plt>
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"The third angle is %.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 %0, i32* %3
store i8** %1, i8*** %4
store float 3.000000e+01, float* %5
store float 6.000000e+01, float* %6
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @remainingAngle(float %8, float %9)
store float %10, float* %7
%11 = load float, float* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"The third angle is %.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float @remainingAngle(float 3.000000e+01, float 6.000000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char buf[8];
  strcpy(buf, argv[1]);
  printf("Input:%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x18(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x8(%rsi),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Input:%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @strcpy(i8* %7, i8* %10)
%12 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Input:%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
void OCSP_REVOKEDINFO_new(void) {}


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

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

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

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