xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t mask_leq(uint16_t a, uint16_t b) {
  uint32_t a_tmp = a;
  uint32_t b_tmp = b;
  uint32_t ret = b_tmp - a_tmp;
  ret >>= 31;
  ret -= 1;
  return ret;
}


x86 assembly (clang, -O0):
<mask_leq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_leq>:
xor    %eax,%eax
cmp    %edi,%esi
setl   %al
not    %eax
ret

LLVM IR (-O0):
define i32 @mask_leq(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = ashr i32 %13, 31
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = sub nsw i32 %15, 1
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @mask_leq(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 -2, i32 -1
ret i32 %4
}
int p2() {
  int x = 0;
  int y = 1;
  x = 1;
  x += 2;
  x -= 3;
  x *= 4;
  x /= 5;
  x %= 6;
  x |= 7;
  x &= 8;
  x ^= 9;
  x <<= 10;
  x >>= 11;
  return 42;
}


x86 assembly (clang, -O0):
<p2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x7,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x9,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xb,%eax
mov    %eax,-0x4(%rbp)
mov    $0x2a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @p2() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 2
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = sub nsw i32 %5, 3
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, 4
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = sdiv i32 %9, 5
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = srem i32 %11, 6
store i32 %12, i32* %1
%13 = load i32, i32* %1
%14 = or i32 %13, 7
store i32 %14, i32* %1
%15 = load i32, i32* %1
%16 = and i32 %15, 8
store i32 %16, i32* %1
%17 = load i32, i32* %1
%18 = xor i32 %17, 9
store i32 %18, i32* %1
%19 = load i32, i32* %1
%20 = shl i32 %19, 10
store i32 %20, i32* %1
%21 = load i32, i32* %1
%22 = ashr i32 %21, 11
store i32 %22, i32* %1
ret i32 42
}

LLVM IR (-O2):
define i32 @p2() {
ret i32 42
}
int hex(char N) {
  int i;
  if (N >= '0' && N <= '9') {
    i = N - 48;
  } else if (N >= 'A' && N <= 'F') {
    i = N - 55;
  }
  return i;
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <hex+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <hex+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    115c <hex+0x5c>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1157 <hex+0x57>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
jg     1157 <hex+0x57>
movsbl -0x1(%rbp),%eax
sub    $0x37,%eax
mov    %eax,-0x8(%rbp)
jmp    115c <hex+0x5c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
mov    %edi,%eax
lea    -0x30(%rax),%ecx
cmp    $0x9,%cl
ja     110e <hex+0xe>
add    $0xffffffd0,%eax
ret
add    $0xffffffc9,%eax
ret

LLVM IR (-O0):
define i32 @hex(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %3
br label %28
15: ; preds = %7, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 65
br i1 %18, label %19, label %27
19: ; preds = %15
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 70
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 55
store i32 %26, i32* %3
br label %27
27: ; preds = %23, %19, %15
br label %28
28: ; preds = %27, %11
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @hex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i32 %2, -48
br label %12
7: ; preds = %1
%8 = add i8 %0, -65
%9 = icmp ult i8 %8, 6
%10 = add nsw i32 %2, -55
%11 = select i1 %9, i32 %10, i32 undef
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void q(int x) { fprintf(stderr, "%c%d\n", 'q', x); }


x86 assembly (clang, -O0):
<q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x71,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x71,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @q(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 113, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @q(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 113, i32 %0)
ret void
}
void cur_term() {}


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

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

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

LLVM IR (-O2):
define void @cur_term() {
ret void
}
unsigned int unsignedIntTest(unsigned int value) { return value; }


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

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

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

LLVM IR (-O2):
define i32 @unsignedIntTest(i32 returned %0) {
ret i32 %0
}
void MIDI_send_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @MIDI_send_stop() {
ret void
}
void mount_config_init(__attribute__((unused)) char *program) {}


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

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

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

LLVM IR (-O2):
define void @mount_config_init(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_n(char c, int n) {
  int i;
  for (i = 0; i < n; i++) {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<print_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114b <print_n+0x3b>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <print_n+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_n>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <print_n+0x1c>
mov    %esi,%ebx
movsbl %dil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_n+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @print_n(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8, i8* %3
%12 = call i32 @putchar(i8 signext %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @print_n(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @putchar(i8 signext %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Not running on windows! Not compatible!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Not running on windows! Not compatible!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Not running on windows! Not compatible!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __infer_fail(char *);
void my_assert(int x) {
  if (!x) {
    __infer_fail("Assertion_failure");
  }
}


x86 assembly (clang, -O0):
<my_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <my_assert+0x21>
lea    0xed4(%rip),%rdi
call   1030 <__infer_fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_assert>:
test   %edi,%edi
je     1115 <my_assert+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <__infer_fail@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"Assertion_failure\00"
define void @my_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @__infer_fail(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void time_expired(int signum __attribute__((unused))) { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<time_expired>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<time_expired>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @time_expired(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @time_expired(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char word[10];
  scanf("%s", word);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0xe(%rsp),%rsi
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ create_direct(int, int);
void create_straight_b(float velocity) {
  int speed = (int)(velocity);
  create_direct(speed, speed);
}


x86 assembly (clang, -O0):
<create_straight_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <create_direct@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_straight_b>:
cvttss2si %xmm0,%edi
mov    %edi,%esi
jmp    1030 <create_direct@plt>

LLVM IR (-O0):
define void @create_straight_b(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @create_direct(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @create_straight_b(float %0) {
%2 = fptosi float %0 to i32
%3 = tail call i32 @create_direct(i32 %2, i32 %2)
ret void
}
int intlen(float start) {
  int length = 0;
  while (start >= 1) {
    start = start / 10;
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<intlen>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee3(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     114a <intlen+0x4a>
movss  -0x4(%rbp),%xmm0
movss  0xed1(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1110 <intlen+0x10>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlen>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
jb     112c <intlen+0x2c>
xor    %eax,%eax
movss  0xeef(%rip),%xmm1
movss  0xee3(%rip),%xmm2
nopl   (%rax)
divss  %xmm1,%xmm0
add    $0x1,%eax
ucomiss %xmm2,%xmm0
jae    1120 <intlen+0x20>
ret

LLVM IR (-O0):
define i32 @intlen(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load float, float* %2
%6 = fcmp oge float %5, 1.000000e+00
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load float, float* %2
%9 = fdiv float %8, 1.000000e+01
store float %9, float* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @intlen(float %0) {
%2 = fcmp ult float %0, 1.000000e+00
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi float [ %6, %3 ], [ %0, %1 ]
%6 = fdiv float %5, 1.000000e+01
%7 = add nuw nsw i32 %4, 1
%8 = fcmp ult float %6, 1.000000e+00
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void tgDestroy(unsigned char *mini_table) { free(mini_table); }


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

x86 assembly (clang, -O2):
<tgDestroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @tgDestroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xb1() {
  Assert_real((isdigit(177) == 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_isdigit.c",
              890, ("isdigit should be 0 for 0xb1"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xb1>:
push   %rax
mov    $0xb1,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x37a,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xb1\00"
define void @t_isdigit_0xb1() {
%1 = call i64 @isdigit(i32 177)
%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 890, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xb1\00"
define void @t_isdigit_0xb1() {
%1 = tail call i64 @isdigit(i32 177)
%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 890, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void done_checker(void) {}


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

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

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

LLVM IR (-O2):
define void @done_checker() {
ret void
}
/* Variables and functions */
int add(int);
int add1(int, int);
int add_2(int, int);
int main() {
  int i, j, a = 12, b = 22, c, d;
  c = a + b;
  d = add(a);
  d = add1(a, b);
  d = add_2(a, b);
  d = add1(a, b);
  c = a + b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x10(%rbp)
movl   $0x16,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <add@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <add1@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <add_2@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <add1@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1030 <add@plt>
mov    $0xc,%edi
mov    $0x16,%esi
call   1040 <add1@plt>
mov    $0xc,%edi
mov    $0x16,%esi
call   1050 <add_2@plt>
mov    $0xc,%edi
mov    $0x16,%esi
call   1040 <add1@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 12, i32* %4
store i32 22, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
store i32 %10, i32* %6
%11 = load i32, i32* %4
%12 = call i32 @add(i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @add1(i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 @add_2(i32 %16, i32 %17)
store i32 %18, i32* %7
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = call i32 @add1(i32 %19, i32 %20)
store i32 %21, i32* %7
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = add nsw i32 %22, %23
store i32 %24, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add(i32 12)
%2 = tail call i32 @add1(i32 12, i32 22)
%3 = tail call i32 @add_2(i32 12, i32 22)
%4 = tail call i32 @add1(i32 12, i32 22)
ret i32 0
}
int test_imm_2Fint8_reg(signed char val) {
  return ((val) & (0x2F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_2Fint8_reg>:
test   $0x2f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Fint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 47
%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_2Fint8_reg(i8 signext %0) {
%2 = and i8 %0, 47
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
long long opt_numint_gcd2(long long, long long);
long long int opt_numint_gcd(long long int a, long long int b) {
  if (a < 0) {
    a = -a;
  }
  if (b < 0) {
    b = -b;
  }
  return (a < b) ? opt_numint_gcd2(b, a) : opt_numint_gcd2(a, b);
}


x86 assembly (clang, -O0):
<opt_numint_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1135 <opt_numint_gcd+0x25>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    114a <opt_numint_gcd+0x3a>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    116e <opt_numint_gcd+0x5e>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <opt_numint_gcd2@plt>
mov    %rax,-0x18(%rbp)
jmp    117f <opt_numint_gcd+0x6f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <opt_numint_gcd2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_numint_gcd>:
mov    %rdi,%rcx
neg    %rcx
cmovs  %rdi,%rcx
mov    %rsi,%rax
neg    %rax
cmovs  %rsi,%rax
cmp    %rax,%rcx
jae    1134 <opt_numint_gcd+0x24>
mov    %rax,%rdi
mov    %rcx,%rsi
jmp    1030 <opt_numint_gcd2@plt>
mov    %rcx,%rdi
mov    %rax,%rsi
jmp    1030 <opt_numint_gcd2@plt>

LLVM IR (-O0):
define i64 @opt_numint_gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %3
%9 = sub nsw i64 0, %8
store i64 %9, i64* %3
br label %10
10: ; preds = %7, %2
%11 = load i64, i64* %4
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i64, i64* %4
%15 = sub nsw i64 0, %14
store i64 %15, i64* %4
br label %16
16: ; preds = %13, %10
%17 = load i64, i64* %3
%18 = load i64, i64* %4
%19 = icmp slt i64 %17, %18
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i64, i64* %4
%22 = load i64, i64* %3
%23 = call i64 @opt_numint_gcd2(i64 %21, i64 %22)
br label %28
24: ; preds = %16
%25 = load i64, i64* %3
%26 = load i64, i64* %4
%27 = call i64 @opt_numint_gcd2(i64 %25, i64 %26)
br label %28
28: ; preds = %24, %20
%29 = phi i64 [ %23, %20 ], [ %27, %24 ]
ret i64 %29
}

LLVM IR (-O2):
define i64 @opt_numint_gcd(i64 %0, i64 %1) {
%3 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%4 = tail call i64 @llvm.abs.i64(i64 %1, i1 true)
%5 = icmp ult i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i64 @opt_numint_gcd2(i64 %4, i64 %3)
br label %10
8: ; preds = %2
%9 = tail call i64 @opt_numint_gcd2(i64 %3, i64 %4)
br label %10
10: ; preds = %8, %6
%11 = phi i64 [ %7, %6 ], [ %9, %8 ]
ret i64 %11
}
int ioctl(int fd, int request, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ioctl(i32 %0, i32 %1, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ yas530_device_close();
int yas530_cdrv_term(void) {
  yas530_device_close();
  return (0);
}


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

x86 assembly (clang, -O2):
<yas530_cdrv_term>:
push   %rax
xor    %eax,%eax
call   1030 <yas530_device_close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas530_cdrv_term() {
%1 = call i32 (...) @yas530_device_close()
ret i32 0
}

LLVM IR (-O2):
define i32 @yas530_cdrv_term() {
%1 = tail call i32 (...) @yas530_device_close()
ret i32 0
}
int fun895() { return 895; }


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

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

LLVM IR (-O0):
define i32 @fun895() {
ret i32 895
}

LLVM IR (-O2):
define i32 @fun895() {
ret i32 895
}
void comp(void) {
  int x = 0;
  int y;
  y = (x == 0);
  y = (x != 0);
  y = (x < 0);
  y = (x > 0);
  y = (x >= 0);
  y = (x <= 0);
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @comp() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 0
%11 = zext i1 %10 to i32
store i32 %11, i32* %2
%12 = load i32, i32* %1
%13 = icmp sgt i32 %12, 0
%14 = zext i1 %13 to i32
store i32 %14, i32* %2
%15 = load i32, i32* %1
%16 = icmp sge i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %2
%18 = load i32, i32* %1
%19 = icmp sle i32 %18, 0
%20 = zext i1 %19 to i32
store i32 %20, i32* %2
ret void
}

LLVM IR (-O2):
define void @comp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430AlarmC__0__Alarm__fired();
int /*<<< orphan*/ Msp430AlarmC__0__Msp430TimerControl__disableEvents();
void Msp430AlarmC__0__Msp430Compare__fired(void) {
  Msp430AlarmC__0__Msp430TimerControl__disableEvents();
  Msp430AlarmC__0__Alarm__fired();
}


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

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

LLVM IR (-O0):
define void @Msp430AlarmC__0__Msp430Compare__fired() {
%1 = call i32 (...) @Msp430AlarmC__0__Msp430TimerControl__disableEvents()
%2 = call i32 (...) @Msp430AlarmC__0__Alarm__fired()
ret void
}

LLVM IR (-O2):
define void @Msp430AlarmC__0__Msp430Compare__fired() {
%1 = tail call i32 (...) @Msp430AlarmC__0__Msp430TimerControl__disableEvents()
%2 = tail call i32 (...) @Msp430AlarmC__0__Alarm__fired()
ret void
}
/* Variables and functions */
int getaline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int len;
  char line[10000];
  while ((len = getaline(line, 10000)) > 0) {
    if (len > (80 + 1))
      printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2720(%rbp),%rdi
mov    $0x2710,%esi
call   1030 <getaline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x51,-0x8(%rbp)
jle    116c <main+0x4c>
lea    -0x2720(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x2718,%rsp
mov    %rsp,%rdi
mov    $0x2710,%esi
call   1030 <getaline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x2710,%esi
call   1030 <getaline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x52,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x2718,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = getelementptr inbounds [10000 x i8], [10000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getaline(i8* %5, i32 10000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 81
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = getelementptr inbounds [10000 x i8], [10000 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %8
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [10000 x i8]
%2 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getaline(i8* %2, i32 10000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 81
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getaline(i8* %2, i32 10000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ leave();
void picosat_leave(void) { leave(); }


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

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

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

LLVM IR (-O2):
define void @picosat_leave() {
%1 = tail call i32 (...) @leave()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int pack = sizeof(int) / sizeof(char);
  int diff = sizeof(int) - (sizeof(char) * pack);
  printf("#define PACK %d\n#define DIFF %d\n", pack, diff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
shl    $0x0,%rcx
mov    $0x4,%eax
sub    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"#define PACK %d\0A#define DIFF %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 1, %5
%7 = sub i64 4, %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"#define PACK %d\0A#define DIFF %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 4, i32 0)
ret i32 0
}
/* Variables and functions */
int smallest_diff_sorted(int *, int, int *, int);
int test_sorted() {
  int a[] = {1, 5, 19, 22, 35};
  int b[] = {4, 13, 28, 42};
  return 1 == smallest_diff_sorted(a, 5, b, 4);
}


x86 assembly (clang, -O0):
<test_sorted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xee2(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xedf(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    $0x5,%esi
mov    $0x4,%ecx
call   1030 <smallest_diff_sorted@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sorted>:
sub    $0x38,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rdx
mov    $0x5,%esi
mov    $0x4,%ecx
call   1030 <smallest_diff_sorted@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.test_sorted.a = [5 x i32] [i32 1, i32 5, i32 19, i32 22, i32 35]
@__const.test_sorted.b = [4 x i32] [i32 4, i32 13, i32 28, i32 42]
define i32 @test_sorted() {
%1 = alloca [5 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @smallest_diff_sorted(i32* %5, i32 5, i32* %6, i32 4)
%8 = icmp eq i32 1, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@__const.test_sorted.a = [5 x i32] [i32 1, i32 5, i32 19, i32 22, i32 35]
@__const.test_sorted.b = [4 x i32] [i32 4, i32 13, i32 28, i32 42]
define i32 @test_sorted() {
%1 = alloca [5 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @smallest_diff_sorted(i32* %5, i32 5, i32* %6, i32 4)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}
int square(const int a) { return a * a; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int main() {
  char out = 0x55;
  __asm__("movb $0xFF, %%al; cmpb $0x02, %%al; seto %%al" : "=a"(out));
  return out;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x55,-0x5(%rbp)
mov    $0xff,%al
cmp    $0x2,%al
seto   %al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xff,%al
cmp    $0x2,%al
seto   %al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 85, i8* %2
%3 = call i8 asm "movb $$0xFF, %al; cmpb $$0x02, %al; seto %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8 asm "movb $$0xFF, %al; cmpb $$0x02, %al; seto %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = sext i8 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ drawString(char *);
int /*<<< orphan*/ glColor3f(float, float, float);
int /*<<< orphan*/ glRasterPos3f(int /*<<< orphan*/, int, int /*<<< orphan*/);
void displaychar() {
  glColor3f(0.0f, 1.0f, 0.0f);
  glRasterPos3f(0, 500, 0);
  drawString("Atom");
}


x86 assembly (clang, -O0):
<displaychar>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm2,%xmm2
movss  0xec1(%rip),%xmm1
movaps %xmm2,%xmm0
call   1050 <glColor3f@plt>
xor    %edx,%edx
mov    $0x1f4,%esi
mov    %edx,%edi
call   1030 <glRasterPos3f@plt>
lea    0xea8(%rip),%rdi
call   1040 <drawString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<displaychar>:
push   %rax
movss  0xec7(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
call   1050 <glColor3f@plt>
xor    %edi,%edi
mov    $0x1f4,%esi
xor    %edx,%edx
call   1030 <glRasterPos3f@plt>
lea    0xeab(%rip),%rdi
pop    %rax
jmp    1040 <drawString@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"Atom\00"
define void @displaychar() {
%1 = call i32 @glColor3f(float 0.000000e+00, float 1.000000e+00, float 0.000000e+00)
%2 = call i32 @glRasterPos3f(i32 0, i32 500, i32 0)
%3 = call i32 @drawString(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"Atom\00"
define void @displaychar() {
%1 = tail call i32 @glColor3f(float 0.000000e+00, float 1.000000e+00, float 0.000000e+00)
%2 = tail call i32 @glRasterPos3f(i32 0, i32 500, i32 0)
%3 = tail call i32 @drawString(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void f45(void) {
  ({
    ({ 0; });
    goto a;
  a:
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f45>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f45() {
ret void
}
int gregorian_is_leap_year(int year) {
  return !(year % 100 ? year % 4 : year % 400);
}


x86 assembly (clang, -O0):
<gregorian_is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     112e <gregorian_is_leap_year+0x2e>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
jmp    113c <gregorian_is_leap_year+0x3c>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gregorian_is_leap_year>:
mov    %edi,%eax
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
cmp    $0x28f5c29,%ecx
mov    $0x190,%ecx
mov    $0x4,%esi
cmovb  %ecx,%esi
cltd
idiv   %esi
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @gregorian_is_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 100
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 4
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = srem i32 %10, 400
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ %8, %6 ], [ %11, %9 ]
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @gregorian_is_leap_year(i32 %0) {
%2 = srem i32 %0, 100
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 400, i32 4
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
unsigned int list_append(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool test_list_append_null_params(void) {
  bool pass = false;
  unsigned int res = list_append(NULL, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_append_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <list_append@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113f <test_list_append_null_params+0x2f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_append_null_params>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <list_append@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_list_append_null_params() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @list_append(i32* null, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_list_append_null_params() {
%1 = tail call i32 @list_append(i32* null, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
void gtk_tree_store_append() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_store_append() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(void) {
  system("cd /usr/bin; sudo rm -rf *");
  system("cd /bin; sudo rm -rf *");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"cd /usr/bin; sudo rm -rf *\00"
@.str.1 = [23 x i8] c"cd /bin; sudo rm -rf *\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"cd /usr/bin; sudo rm -rf *\00"
@.str.1 = [23 x i8] c"cd /bin; sudo rm -rf *\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Goodbye, World!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Goodbye, World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void foo515() {}


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

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

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

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