xunge/DecIR huggingface dataset:
int intcmp(void const *a, void const *b) {
  int lhs = *(int const *)a, rhs = *(int const *)b;
  if (lhs < rhs)
    return -1;
  else if (lhs > rhs)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <intcmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <intcmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <intcmp+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <intcmp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @intcmp(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 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i = 0, j = 0;
  int a;
  int b;
  int c;
  int d = 4;
  do {
    j = 0;
    do {
      a = 5 * d;
      b = i * 5;
      c = i * j;
      j++;
    } while (j < 5);
    i++;
  } while (i < 5);
  __print_int(a);
  __print_int(b);
  __print_int(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x4,-0x1c(%rbp)
movl   $0x0,-0xc(%rbp)
imul   $0x5,-0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0x5,-0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jl     113b <main+0x2b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jl     1134 <main+0x24>
mov    -0x10(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x14(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x18(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1030 <__print_int@plt>
mov    $0x14,%edi
call   1030 <__print_int@plt>
mov    $0x10,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 20)
%2 = tail call i32 @__print_int(i32 20)
%3 = tail call i32 @__print_int(i32 16)
ret i32 0
}
unsigned Cyc_umin(unsigned i, unsigned j) {
  unsigned _T0;
  unsigned _T1;
  if (i >= j)
    goto _TL7;
  _T0 = i;
  return _T0;
_TL7:
  _T1 = j;
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_umin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     111b <Cyc_umin+0x1b>
jmp    112c <Cyc_umin+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <Cyc_umin+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_umin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Cyc_umin(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void WeaponAWP_SecondaryFire(void) {}


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

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

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

LLVM IR (-O2):
define void @WeaponAWP_SecondaryFire() {
ret void
}
int regulator_get_current_limit(struct regulator *regulator) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.regulator = type opaque
define i32 @regulator_get_current_limit(%struct.regulator* nocapture readnone %0) {
ret i32 0
}
int main(void) {
  "a" + 'a';
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
struct _vm_memory_controller {
  int dummy;
};

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int main() {
  struct _vm_memory_controller *MEM = 0;
  0;
  if (0 == 0) {
    printf("Machine in C starting\n");
  } else {
    printf("Machine in C starting DEBUG mode\n");
  }
  0;
  0;
  0;
  0;
  float *X = (float *)malloc(16);
  *X = 15;
  0;
  0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  0xeaa(%rip),%xmm0
movss  %xmm0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x10,%edi
call   1040 <malloc@plt>
movl   $0x41700000,(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct._vm_memory_controller = type { i32 }
@.str = [23 x i8] c"Machine in C starting\0A\00"
define i32 @main() {
%1 = alloca %struct._vm_memory_controller*
%2 = alloca float*
store %struct._vm_memory_controller* null, %struct._vm_memory_controller** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @malloc(i32 16)
%5 = inttoptr i64 %4 to float*
store float* %5, float** %2
%6 = load float*, float** %2
store float 1.500000e+01, float* %6
ret i32 0
}

LLVM IR (-O2):
%struct._vm_memory_controller = type { i32 }
@str = [22 x i8] c"Machine in C starting\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 @malloc(i32 16)
%3 = inttoptr i64 %2 to float*
store float 1.500000e+01, float* %3
ret i32 0
}
/* Variables and functions */
char *strsep(char **, char const *);
char *strtok_r(char *s, const char *delim, char **holder) {
  if (s)
    *holder = s;
  do {
    s = strsep(holder, delim);
  } while (s && !*s);
  return s;
}


x86 assembly (clang, -O0):
<strtok_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <strtok_r+0x2a>
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    113f <strtok_r+0x2f>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strsep@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
je     116f <strtok_r+0x5f>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    113f <strtok_r+0x2f>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtok_r>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
test   %rdi,%rdi
je     1130 <strtok_r+0x20>
mov    %rdi,(%rbx)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strsep@plt>
test   %rax,%rax
je     1145 <strtok_r+0x35>
cmpb   $0x0,(%rax)
je     1130 <strtok_r+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strtok_r(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** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8**, i8*** %6
store i8* %10, i8** %11
br label %12
12: ; preds = %9, %3
br label %13
13: ; preds = %25, %12
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %5
%16 = call i8* @strsep(i8** %14, i8* %15)
store i8* %16, i8** %4
br label %17
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = icmp ne i8 %22, 0
%24 = xor i1 %23, true
br label %25
25: ; preds = %20, %17
%26 = phi i1 [ false, %17 ], [ %24, %20 ]
br i1 %26, label %13, label %27
27: ; preds = %25
%28 = load i8*, i8** %4
ret i8* %28
}

LLVM IR (-O2):
define i8* @strtok_r(i8* %0, i8* %1, i8** %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* %0, i8** %2
br label %6
6: ; preds = %5, %3
br label %7
7: ; preds = %6, %10
%8 = tail call i8* @strsep(i8** %2, i8* %1)
%9 = icmp eq i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7, %10
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("this is the original program\n");
  execlp("vi", "vi", "asdf.txt", (char *)0);
  printf("this line should never be printed\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rsi
lea    0xee3(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1040 <execlp@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0xec8(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1040 <execlp@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"this is the original program\0A\00"
@.str.1 = [3 x i8] c"vi\00"
@.str.2 = [9 x i8] c"asdf.txt\00"
@.str.3 = [35 x i8] c"this line should never be printed\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* null)
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"vi\00"
@.str.2 = [9 x i8] c"asdf.txt\00"
@str = [29 x i8] c"this is the original program\00"
@str.4 = [34 x i8] c"this line should never be printed\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* null)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
int isBlank(char c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t'; }


x86 assembly (clang, -O0):
<isBlank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <isBlank+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <isBlank+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <isBlank+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBlank>:
cmp    $0x20,%dil
ja     1120 <isBlank+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002400,%rdx
bt     %rcx,%rdx
jae    1120 <isBlank+0x20>
ret
xor    %eax,%eax
cmp    $0x9,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isBlank(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 9
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isBlank(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
bool nrf51_errata_23(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_23() {
ret i32 0
}
int rangeBitwiseAnd(int m, int n) {
  if (m == n)
    return m;
  else {
    double fMN = m ^ n;
    int lg2_mn = (*((unsigned long long *)&fMN) >> 52) - 1023;
    return ~((1 << (lg2_mn + 1)) - 1) & m;
  }
}


x86 assembly (clang, -O0):
<rangeBitwiseAnd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1121 <rangeBitwiseAnd+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <rangeBitwiseAnd+0x5a>
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x34,%rax
sub    $0x3ff,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rangeBitwiseAnd>:
mov    %edi,%eax
cmp    %esi,%edi
je     111c <rangeBitwiseAnd+0x1c>
xor    %eax,%esi
cvtsi2sd %esi,%xmm0
movq   %xmm0,%rcx
shr    $0x34,%rcx
add    $0x2,%cl
shr    %cl,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @rangeBitwiseAnd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = xor i32 %1, %0
%6 = sitofp i32 %5 to double
%7 = bitcast double %6 to i64
%8 = lshr i64 %7, 52
%9 = trunc i64 %8 to i32
%10 = add nsw i32 %9, -1022
%11 = shl nsw i32 -1, %10
%12 = and i32 %11, %0
br label %13
13: ; preds = %2, %4
%14 = phi i32 [ %12, %4 ], [ %0, %2 ]
ret i32 %14
}
void cleanupTerm() {}


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

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

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

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

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
scalar_t__ isspace(int);
int /*<<< orphan*/ skip_line(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skip_white_space(FILE *fp) {
  int ch;
  while (isspace(ch = fgetc(fp)))
    ;
  ungetc(ch, fp);
  if (ch == '#') {
    skip_line(fp);
    skip_white_space(fp);
  }
}


x86 assembly (clang, -O0):
<skip_white_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%edi
mov    %edi,-0xc(%rbp)
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     117e <skip_white_space+0x2e>
jmp    115c <skip_white_space+0xc>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1070 <ungetc@plt>
cmpl   $0x23,-0xc(%rbp)
jne    11a6 <skip_white_space+0x56>
mov    -0x8(%rbp),%rdi
call   1050 <skip_line@plt>
mov    -0x8(%rbp),%rdi
call   1060 <skip_white_space@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_white_space>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    1150 <skip_white_space+0x10>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <ungetc@plt>
cmp    $0x23,%ebp
jne    117f <skip_white_space+0x3f>
mov    %rbx,%rdi
call   1050 <skip_line@plt>
jmp    1150 <skip_white_space+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @skip_white_space(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %9, %1
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
%7 = call i64 @isspace(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load i32, i32* %3
%12 = load i32*, i32** %2
%13 = call i32 @ungetc(i32 %11, i32* %12)
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 35
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = load i32*, i32** %2
%18 = call i32 @skip_line(i32* %17)
%19 = load i32*, i32** %2
br label %20
20: ; preds = %16, %10
ret void
}

LLVM IR (-O2):
define void @skip_white_space(i32* %0) {
br label %2
2: ; preds = %6, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = tail call i64 @isspace(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %2, %10
br label %2
7: ; preds = %2
%8 = tail call i32 @ungetc(i32 %3, i32* %0)
%9 = icmp eq i32 %3, 35
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @skip_line(i32* %0)
br label %6
12: ; preds = %7
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int sweep_clear_definitions(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(617, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_clear_definitions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x269,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_clear_definitions>:
mov    $0x269,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @sweep_clear_definitions() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 617, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @sweep_clear_definitions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 617, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
double sqrt(double);
double foo(double x) { return sqrt(1.0 / x); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movapd %xmm0,%xmm1
movsd  0xee4(%rip),%xmm0
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112f <foo+0x1f>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = call double @sqrt(double %4)
ret double %5
}

LLVM IR (-O2):
define double @foo(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = tail call double @sqrt(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ _printf_putls(unsigned int, int, int /*<<< orphan*/);
void puthex(unsigned x) { _printf_putls(x, 16, 0); }


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

x86 assembly (clang, -O2):
<puthex>:
mov    $0x10,%esi
xor    %edx,%edx
jmp    1030 <_printf_putls@plt>

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

LLVM IR (-O2):
define void @puthex(i32 %0) {
%2 = tail call i32 @_printf_putls(i32 %0, i32 16, i32 0)
ret void
}
/* Variables and functions */
void CON_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @CON_Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t const);
int /*<<< orphan*/ printf(char *);
void *xMalloc(const size_t size) {
  void *temp;
  if ((temp = malloc(size)) == NULL) {
    printf("Out of memory\n");
    exit(EXIT_FAILURE);
  }
  return temp;
}


x86 assembly (clang, -O0):
<xMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116d <xMalloc+0x3d>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xMalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xMalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xMalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [14 x i8] c"Out of memory\00"
define noalias i8* @xMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ set_name(char const *);
int /*<<< orphan*/ u_assert_int_eq(int /*<<< orphan*/, int /*<<< orphan*/);
void test_set_name(void) {
  const char name[] = "testname";
  u_assert_int_eq(set_name(name), 0);
}


x86 assembly (clang, -O0):
<test_set_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x9(%rbp),%rdi
call   1040 <set_name@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <u_assert_int_eq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_set_name>:
sub    $0x18,%rsp
movabs $0x656d616e74736574,%rax
61 6d 65
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <set_name@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <u_assert_int_eq@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_set_name.name = [9 x i8] c"testname\00"
define void @test_set_name() {
%1 = alloca [9 x i8]
%2 = bitcast [9 x i8]* %1 to i8*
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = call i32 @set_name(i8* %3)
%5 = call i32 @u_assert_int_eq(i32 %4, i32 0)
ret void
}

LLVM IR (-O2):
@__const.test_set_name.name = [9 x i8] c"testname\00"
define void @test_set_name() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = call i32 @set_name(i8* %2)
%4 = call i32 @u_assert_int_eq(i32 %3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main(void) {
  int i = 1;
  int n = __VERIFIER_nondet_int();
  while (i < n) {
    i++;
  }
  __VERIFIER_assert(i > n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %3
br label %5
5: ; preds = %9, %0
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %5
12: ; preds = %5
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = icmp sgt i32 %13, %14
%16 = zext i1 %15 to i32
%17 = call i32 @__VERIFIER_assert(i32 %16)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assert(i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateIntEnable(uint32_t ui32IntFlags) {

  ;
  (*((volatile uint32_t *)(0x400FC014))) |= ui32IntFlags;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x400fc014,%ecx
mov    (%rcx),%ecx
or     %eax,%ecx
mov    $0x400fc014,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntEnable>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
or     %eax,0x400fc014
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateIntEnable(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 1074774036 to i32*)
%5 = or i32 %4, %3
store volatile i32 %5, i32* inttoptr (i64 1074774036 to i32*)
%6 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateIntEnable(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 1074774036 to i32*)
%5 = or i32 %4, %3
store volatile i32 %5, i32* inttoptr (i64 1074774036 to i32*)
%6 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ pthread_attr_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void sirius_pthread_attr_init(pthread_attr_t *attr) {
  if (pthread_attr_init(attr)) {
    fprintf(stderr, "pthread_init() failed.\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<sirius_pthread_attr_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_attr_init@plt>
cmp    $0x0,%rax
je     116e <sirius_pthread_attr_init+0x3e>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sirius_pthread_attr_init>:
push   %rax
call   1030 <pthread_attr_init@plt>
test   %rax,%rax
jne    113d <sirius_pthread_attr_init+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"pthread_init() failed.\0A\00"
define void @sirius_pthread_attr_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pthread_attr_init(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"pthread_init() failed.\0A\00"
define void @sirius_pthread_attr_init(i32* %0) {
%2 = tail call i64 @pthread_attr_init(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
char foo(char a, unsigned char b, int8_t c) { return 'd'; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    $0x64,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x64,%al
ret

LLVM IR (-O0):
define signext i8 @foo(i8 signext %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store i32 %2, i32* %6
ret i8 100
}

LLVM IR (-O2):
define signext i8 @foo(i8 signext %0, i8 zeroext %1, i32 %2) {
ret i8 100
}
/* Variables and functions */
int /*<<< orphan*/ execute(char *);
void cmd_execute(char *str) { execute(str); }


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

x86 assembly (clang, -O2):
<cmd_execute>:
jmp    1030 <execute@plt>

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

LLVM IR (-O2):
define void @cmd_execute(i8* %0) {
%2 = tail call i32 @execute(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_geometry_evaluate_flow_c();
void read_geometry_evaluate_flow() { read_geometry_evaluate_flow_c(); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @suggest_passwords() {
ret i32 0
}
int test_imm_FEuint8_reg(unsigned char val) {
  return ((val) & (0xFE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FEuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xfe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FEuint8_reg>:
cmp    $0x2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FEuint8_reg(i8 zeroext %0) {
%2 = icmp ult i8 %0, 2
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xc6() {
  Assert_real((isupper(198) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              995, ("isupper should be 0 for 0xc6"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xc6\00"
define void @t_isupper_0xc6() {
%1 = call i64 @isupper(i32 198)
%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 995, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xc6\00"
define void @t_isupper_0xc6() {
%1 = tail call i64 @isupper(i32 198)
%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 995, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  int a = 5;
  printf("%s(%d): a is %d\n", __func__, 11, a);
  helper_function(a);
  printf("%s(%d): a is %d\n", __func__, 13, a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xec7(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0xb,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <helper_function@plt>
mov    -0x4(%rbp),%ecx
lea    0xea0(%rip),%rdi
lea    0xeaa(%rip),%rsi
mov    $0xd,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xedf(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xb,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x5,%edi
xor    %eax,%eax
call   1040 <helper_function@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xd,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%s(%d): a is %d\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 11, i32 %2)
%4 = load i32, i32* %1
%5 = call i32 (i32, ...) bitcast (i32 (...)* @helper_function to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 13, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s(%d): a is %d\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 11, i32 5)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @helper_function to i32 (i32, ...)*)(i32 5)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 13, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void puts(char *s) {
  int c;
  while ((c = *s++) != '\0') {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1147 <puts+0x37>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
store i32 %8, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i32, i32* %3
%12 = call i32 @putchar(i32 %11)
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @putchar(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ done();
int /*<<< orphan*/ fib(int);
void entry(void) {
  for (int i = 0; i < 10; ++i) {
    fib(10);
  }
  done();
}


x86 assembly (clang, -O0):
<entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1151 <entry+0x31>
mov    $0xa,%edi
call   1040 <fib@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <entry+0xf>
mov    $0x0,%al
call   1030 <done@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entry>:
push   %rax
mov    $0xa,%edi
call   1040 <fib@plt>
mov    $0xa,%edi
call   1040 <fib@plt>
mov    $0xa,%edi
call   1040 <fib@plt>
mov    $0xa,%edi
call   1040 <fib@plt>
mov    $0xa,%edi
call   1040 <fib@plt>
mov    $0xa,%edi
call   1040 <fib@plt>
mov    $0xa,%edi
call   1040 <fib@plt>
mov    $0xa,%edi
call   1040 <fib@plt>
mov    $0xa,%edi
call   1040 <fib@plt>
mov    $0xa,%edi
call   1040 <fib@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <done@plt>

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

LLVM IR (-O2):
define void @entry() {
%1 = tail call i32 @fib(i32 10)
%2 = tail call i32 @fib(i32 10)
%3 = tail call i32 @fib(i32 10)
%4 = tail call i32 @fib(i32 10)
%5 = tail call i32 @fib(i32 10)
%6 = tail call i32 @fib(i32 10)
%7 = tail call i32 @fib(i32 10)
%8 = tail call i32 @fib(i32 10)
%9 = tail call i32 @fib(i32 10)
%10 = tail call i32 @fib(i32 10)
%11 = tail call i32 (...) @done()
ret void
}
int normalizeHeading(int heading) {
  while (heading < 0)
    heading += 360;
  return heading % 360;
}


x86 assembly (clang, -O0):
<normalizeHeading>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1121 <normalizeHeading+0x21>
mov    -0x4(%rbp),%eax
add    $0x168,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <normalizeHeading+0x7>
mov    -0x4(%rbp),%eax
mov    $0x168,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalizeHeading>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %edi,%eax
xor    %ecx,%ecx
sub    %edi,%eax
setne  %cl
sub    %ecx,%eax
shr    $0x3,%eax
imul   $0x16c16c17,%rax,%rax
shr    $0x22,%rax
add    %ecx,%eax
imul   $0x168,%eax,%eax
add    %edi,%eax
mov    %eax,%ecx
shr    $0x3,%ecx
imul   $0x16c16c17,%rcx,%rcx
shr    $0x22,%rcx
imul   $0x168,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @normalizeHeading(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 0)
%3 = sub i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = sub i32 %3, %5
%7 = udiv i32 %6, 360
%8 = add nuw nsw i32 %7, %5
%9 = mul i32 %8, 360
%10 = add i32 %9, %0
%11 = urem i32 %10, 360
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetGain(char byBoardNum, char byGainMode) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetGain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSetGain(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetGain(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}