xunge/DecIR huggingface dataset:
void swap(int *a, int *b) {
  int c = *a;
  *a = *b;
  *b = c;
  return;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
int ABS(int a) { return (a < 0 ? -a : a); }


x86 assembly (clang, -O0):
<ABS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <ABS+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <ABS+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ABS(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ HF_memcmp(void const *, void const *, size_t,
                             int /*<<< orphan*/, uintptr_t);
int /*<<< orphan*/ instrumentConstAvail();
void __sanitizer_weak_hook_memcmp(uintptr_t pc, const void *m1, const void *m2,
                                  size_t n,
                                  int result __attribute__((unused))) {
  HF_memcmp(m1, m2, n, instrumentConstAvail(), pc);
}


x86 assembly (clang, -O0):
<__sanitizer_weak_hook_memcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1040 <instrumentConstAvail@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
call   1030 <HF_memcmp@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sanitizer_weak_hook_memcmp>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
xor    %eax,%eax
call   1040 <instrumentConstAvail@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
mov    %r12,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <HF_memcmp@plt>

LLVM IR (-O0):
define void @__sanitizer_weak_hook_memcmp(i64 %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i64 %0, i64* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = load i64, i64* %9
%14 = call i32 (...) @instrumentConstAvail()
%15 = load i64, i64* %6
%16 = call i32 @HF_memcmp(i8* %11, i8* %12, i64 %13, i32 %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @__sanitizer_weak_hook_memcmp(i64 %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = tail call i32 (...) @instrumentConstAvail()
%7 = tail call i32 @HF_memcmp(i8* %1, i8* %2, i64 %3, i32 %6, i64 %0)
ret void
}
unsigned int get_reg(unsigned int addr, int size) {
  static unsigned short *temp_16;
  static unsigned int *temp_32;
  switch (size) {
  case 16:
    temp_16 = (unsigned short *)(addr);
    return (unsigned int)(*temp_16);
  case 32:
    temp_32 = (unsigned int *)(addr);
    return *temp_32;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x10,%eax
je     112f <get_reg+0x2f>
jmp    111e <get_reg+0x1e>
mov    -0x10(%rbp),%eax
sub    $0x20,%eax
je     114b <get_reg+0x4b>
jmp    1166 <get_reg+0x66>
mov    -0x8(%rbp),%eax
mov    %rax,0x2eef(%rip)
mov    0x2ee8(%rip),%rax
movzwl (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <get_reg+0x6d>
mov    -0x8(%rbp),%eax
mov    %rax,0x2edb(%rip)
mov    0x2ed4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <get_reg+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_reg>:
cmp    $0x20,%esi
je     1112 <get_reg+0x12>
xor    %eax,%eax
cmp    $0x10,%esi
jne    1116 <get_reg+0x16>
mov    %edi,%eax
movzwl (%rax),%eax
ret
mov    %edi,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@get_reg.temp_16 = internal global i16* null
@get_reg.temp_32 = internal global i32* null
define i32 @get_reg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %20 [
i32 16, label %7
i32 32, label %14
]
7: ; preds = %2
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i16*
store i16* %10, i16** @get_reg.temp_16
%11 = load i16*, i16** @get_reg.temp_16
%12 = load i16, i16* %11
%13 = zext i16 %12 to i32
store i32 %13, i32* %3
br label %21
14: ; preds = %2
%15 = load i32, i32* %4
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store i32* %17, i32** @get_reg.temp_32
%18 = load i32*, i32** @get_reg.temp_32
%19 = load i32, i32* %18
store i32 %19, i32* %3
br label %21
20: ; preds = %2
store i32 0, i32* %3
br label %21
21: ; preds = %20, %14, %7
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_reg(i32 %0, i32 %1) {
switch i32 %1, label %12 [
i32 16, label %3
i32 32, label %8
]
3: ; preds = %2
%4 = zext i32 %0 to i64
%5 = inttoptr i64 %4 to i16*
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
br label %12
8: ; preds = %2
%9 = zext i32 %0 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* %10
br label %12
12: ; preds = %2, %8, %3
%13 = phi i32 [ %11, %8 ], [ %7, %3 ], [ 0, %2 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ pifacedigital_write_bit(int /*<<< orphan*/,
                                           int /*<<< orphan*/, int,
                                           int /*<<< orphan*/);
void pifacedigital_digital_write(uint8_t pin_num, uint8_t value) {
  pifacedigital_write_bit(value, pin_num, 0x12, 0);
}


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

x86 assembly (clang, -O2):
<pifacedigital_digital_write>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
mov    $0x12,%edx
xor    %ecx,%ecx
jmp    1030 <pifacedigital_write_bit@plt>

LLVM IR (-O0):
define void @pifacedigital_digital_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @pifacedigital_write_bit(i32 %5, i32 %6, i32 18, i32 0)
ret void
}

LLVM IR (-O2):
define void @pifacedigital_digital_write(i32 %0, i32 %1) {
%3 = tail call i32 @pifacedigital_write_bit(i32 %1, i32 %0, i32 18, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
double *matrix_alloc() {
  double *p;
  p = (double *)malloc(8000 * 7000 * sizeof(double));
  if (p == NULL) {
    fprintf(stderr, "I cannot reserve host memory for the matrix.\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<matrix_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1ab3f000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1174 <matrix_alloc+0x44>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_alloc>:
push   %rax
mov    $0x1ab3f000,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1142 <matrix_alloc+0x12>
pop    %rcx
ret
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"I cannot reserve host memory for the matrix.\0A\00"
@EXIT_FAILURE = global i32 0
define double* @matrix_alloc() {
%1 = alloca double*
%2 = call i64 @malloc(i32 448000000)
%3 = inttoptr i64 %2 to double*
store double* %3, double** %1
%4 = load double*, double** %1
%5 = icmp eq double* %4, null
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %0
%12 = load double*, double** %1
ret double* %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"I cannot reserve host memory for the matrix.\0A\00"
@EXIT_FAILURE = global i32 0
define double* @matrix_alloc() {
%1 = tail call i64 @malloc(i32 448000000)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
%9 = inttoptr i64 %1 to double*
ret double* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i;
  char c = 0;
  for (i >= 0; i <= 256; i++) {
    c++;
    printf("%c <-> %d\n", c, i);
  }
  printf("Homework of Vladimir Yordanov 10V №8\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x9(%rbp)
cmpl   $0x100,-0x8(%rbp)
jg     115b <main+0x4b>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1123 <main+0x13>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"%c <-> %d\0A\00"
@.str.1 = [40 x i8] c"Homework of Vladimir Yordanov 10V \E2\84\968\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %3
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 256
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i8, i8* %3
%12 = add i8 %11, 1
store i8 %12, i8* %3
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %7
20: ; preds = %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [39 x i8] c"Homework of Vladimir Yordanov 10V \E2\84\968\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("Usage: stat\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Usage: stat\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Usage: stat\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char isupper(unsigned char c) {
  if (c >= ((unsigned char)'A') && c <= ((unsigned char)'Z'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     112d <isupper+0x2d>
movzbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     112d <isupper+0x2d>
movb   $0x1,-0x1(%rbp)
jmp    1131 <isupper+0x31>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xbf,%dil
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define signext i8 @isupper(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i8 1, i8* %2
br label %13
12: ; preds = %7, %1
store i8 0, i8* %2
br label %13
13: ; preds = %12, %11
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @isupper(i8 zeroext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int tng_compress_uncompress_pos_gen(char *, double *, int /*<<< orphan*/ *,
                                    int /*<<< orphan*/ *, unsigned long *,
                                    unsigned long *);
int tng_compress_uncompress_pos(char *data, double *pos) {
  unsigned long prec_hi, prec_lo;
  return tng_compress_uncompress_pos_gen(data, pos, NULL, NULL, &prec_hi,
                                         &prec_lo);
}


x86 assembly (clang, -O0):
<tng_compress_uncompress_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
lea    -0x20(%rbp),%r9
mov    %rcx,%rdx
call   1030 <tng_compress_uncompress_pos_gen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tng_compress_uncompress_pos>:
sub    $0x18,%rsp
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <tng_compress_uncompress_pos_gen@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @tng_compress_uncompress_pos(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store double* %1, double** %4
%7 = load i8*, i8** %3
%8 = load double*, double** %4
%9 = call i32 @tng_compress_uncompress_pos_gen(i8* %7, double* %8, i32* null, i32* null, i64* %5, i64* %6)
ret i32 %9
}

LLVM IR (-O2):
define i32 @tng_compress_uncompress_pos(i8* %0, double* %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = call i32 @tng_compress_uncompress_pos_gen(i8* %0, double* %1, i32* null, i32* null, i64* %3, i64* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x9a() {
  Assert_real((isspace(154) == 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_isspace.c",
              775, ("isspace should be 0 for 0x9a"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x9a>:
push   %rax
mov    $0x9a,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x307,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x9a\00"
define void @t_isspace_0x9a() {
%1 = call i64 @isspace(i32 154)
%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 775, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x9a\00"
define void @t_isspace_0x9a() {
%1 = tail call i64 @isspace(i32 154)
%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 775, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main(void) {
  int counter;
  for (counter = 0; counter < 5; counter++) {
    int a;
    for (a = 0; a < 5; a++) {
      int b;
    }
  }
  int x;
  for (x = 0; x < 5; x++) {
    int y;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1153 <main+0x53>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1140 <main+0x40>
jmp    1132 <main+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
jmp    1145 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1177 <main+0x77>
jmp    1169 <main+0x69>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115a <main+0x5a>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void sonix_stop0(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @sonix_stop0(%struct.usb_spca50x* nocapture %0) {
ret void
}
unsigned long cp_hash_long(void *l) { return *((long *)l); }


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

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

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

LLVM IR (-O2):
define i64 @cp_hash_long(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ imprimeOUT(int);
int main() {
  int existe = 1;
  imprimeOUT(existe);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @imprimeOUT(i32 1)
ret i32 0
}
int GetGreen(unsigned int rgb) { return (int)((rgb >> 8) & 0xff); }


x86 assembly (clang, -O0):
<GetGreen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @GetGreen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 8
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @GetGreen(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
bool recursivePrime(int n, int i) {
  if (i < 2)
    return true;
  else if (n % i == 0)
    return false;
  else
    return recursivePrime(n, i - 1);
}


x86 assembly (clang, -O0):
<recursivePrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1134 <recursivePrime+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1161 <recursivePrime+0x51>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1150 <recursivePrime+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1161 <recursivePrime+0x51>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <recursivePrime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursivePrime>:
mov    $0x1,%ecx
cmp    $0x2,%esi
jl     1123 <recursivePrime+0x23>
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1126 <recursivePrime+0x26>
lea    -0x1(%rsi),%eax
cmp    $0x3,%esi
mov    %eax,%esi
jge    1110 <recursivePrime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @recursivePrime(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %11, label %7
4: ; preds = %7
%5 = add nsw i32 %8, -1
%6 = icmp slt i32 %8, 3
br i1 %6, label %11, label %7
7: ; preds = %2, %4
%8 = phi i32 [ %5, %4 ], [ %1, %2 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %7, %2
%12 = phi i32 [ 1, %2 ], [ 0, %7 ], [ 1, %4 ]
ret i32 %12
}
int test_imm_E3int8_mem(signed char *val) {
  return ((*val) & (-0xE3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E3int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff1d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E3int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff1d,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E3int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -227
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
unsigned int get_module_rev(struct ssp_data *data) { return 14071000; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @get_module_rev(%struct.ssp_data* nocapture readnone %0) {
ret i32 14071000
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *);
int /*<<< orphan*/ *opendir(char const *);
DIR *xopendir(const char *path) {
  DIR *p;
  p = opendir(path);
  if (p == NULL)
    err(1, "opendir: %s", path);
  return p;
}


x86 assembly (clang, -O0):
<xopendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <xopendir+0x39>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xeac(%rip),%rsi
call   1040 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xopendir>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <opendir@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <xopendir+0x28>
lea    0xec5(%rip),%rsi
mov    $0x1,%edi
mov    %r14,%rdx
call   1040 <err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"opendir: %s\00"
define noalias i32* @xopendir(i8* %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void *Thread(void *x) {
  pthread_mutex_lock((pthread_mutex_t *)x);
  pthread_mutex_unlock((pthread_mutex_t *)x);
  return 0;
}


x86 assembly (clang, -O0):
<Thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_lock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thread>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pthread_mutex_lock@plt>
mov    %rbx,%rdi
call   1030 <pthread_mutex_unlock@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @pthread_mutex_lock(i32* %4)
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = call i32 @pthread_mutex_unlock(i32* %7)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @Thread(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_mutex_lock(i32* %2)
%4 = tail call i32 @pthread_mutex_unlock(i32* %2)
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;
typedef scalar_t__ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, scalar_t__, int);
double ptr_ret_double(void *arg1, int offset) {
  double tmp;
  memcpy(&tmp, (caddr_t)arg1 + offset, sizeof(tmp));
  return tmp;
}


x86 assembly (clang, -O0):
<ptr_ret_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
lea    -0x18(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_ret_double>:
push   %rax
movslq %esi,%rsi
add    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ptr_ret_double(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca double
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = add nsw i64 %7, %9
%11 = call i32 @memcpy(double* %5, i64 %10, i32 8)
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
define double @ptr_ret_double(i8* %0, i32 %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = ptrtoint i8* %0 to i64
%6 = sext i32 %1 to i64
%7 = add nsw i64 %6, %5
%8 = call i32 @memcpy(double* %3, i64 %7, i32 8)
%9 = load double, double* %3
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ e_beq();
int /*<<< orphan*/ e_branch();
void e_beq_branch() {
  e_branch();
  e_beq();
}


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

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

LLVM IR (-O0):
define void @e_beq_branch() {
%1 = call i32 (...) @e_branch()
%2 = call i32 (...) @e_beq()
ret void
}

LLVM IR (-O2):
define void @e_beq_branch() {
%1 = tail call i32 (...) @e_branch()
%2 = tail call i32 (...) @e_beq()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void expr_free(void *ptr) { free((char *)ptr); }


x86 assembly (clang, -O0):
<expr_free>:
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):
<expr_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @expr_free(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 @expr_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
u_int32_t flip_endian(u_int32_t nValue) {
  u_int32_t nR;
  u_int32_t nByte1 = (nValue & 0xff000000) >> 24;
  u_int32_t nByte2 = (nValue & 0x00ff0000) >> 16;
  u_int32_t nByte3 = (nValue & 0x0000ff00) >> 8;
  u_int32_t nByte4 = nValue & 0x0ff;
  nR = nByte4 << 24;
  nR |= (nByte3 << 16);
  nR |= (nByte2 << 8);
  nR |= nByte1;
  return nR;
}


x86 assembly (clang, -O0):
<flip_endian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x10,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @flip_endian(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, -16777216
%10 = lshr i32 %9, 24
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = and i32 %11, 16711680
%13 = ashr i32 %12, 16
store i32 %13, i32* %5
%14 = load i32, i32* %2
%15 = and i32 %14, 65280
%16 = ashr i32 %15, 8
store i32 %16, i32* %6
%17 = load i32, i32* %2
%18 = and i32 %17, 255
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = shl i32 %19, 24
store i32 %20, i32* %3
%21 = load i32, i32* %6
%22 = shl i32 %21, 16
%23 = load i32, i32* %3
%24 = or i32 %23, %22
store i32 %24, i32* %3
%25 = load i32, i32* %5
%26 = shl i32 %25, 8
%27 = load i32, i32* %3
%28 = or i32 %27, %26
store i32 %28, i32* %3
%29 = load i32, i32* %4
%30 = load i32, i32* %3
%31 = or i32 %30, %29
store i32 %31, i32* %3
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @flip_endian(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void stack_destructor(int *stack) { free(stack); }


x86 assembly (clang, -O0):
<stack_destructor>:
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):
<stack_destructor>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @stack_destructor(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FileError(char *);
void restarted_warning() { FileError("the start symbol has been redeclared"); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"the start symbol has been redeclared\00"
define void @restarted_warning() {
%1 = call i32 @FileError(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"the start symbol has been redeclared\00"
define void @restarted_warning() {
%1 = tail call i32 @FileError(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
long labs(long n) { return ((n >= 0) ? (n) : (-n)); }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     1120 <labs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void main() {
  int n = 7;
  for (; n; n--) {
    assert(n == 1);
  }
  int i;
  if (i - 1) {
    assert(i == 2);
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1148 <main+0x38>
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
je     1168 <main+0x58>
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @assert(i32 0)
%2 = tail call i32 @assert(i32 0)
%3 = tail call i32 @assert(i32 0)
%4 = tail call i32 @assert(i32 0)
%5 = tail call i32 @assert(i32 0)
%6 = tail call i32 @assert(i32 0)
%7 = tail call i32 @assert(i32 1)
ret void
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ undo();
void *undo_1_svc(void *argp, struct svc_req *rqstp) { undo(); }


x86 assembly (clang, -O0):
<undo_1_svc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1030 <undo@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i8* @undo_1_svc(i8* %0, %struct.svc_req* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.svc_req*
store i8* %0, i8** %4
store %struct.svc_req* %1, %struct.svc_req** %5
%6 = call i32 (...) @undo()
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define noalias i8* @undo_1_svc(i8* nocapture readnone %0, %struct.svc_req* nocapture readnone %1) {
%3 = tail call i32 (...) @undo()
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_preinit2() {
  printf("main_preinit2"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"main_preinit2\0A\00"
define void @main_preinit2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"main_preinit2\00"
define void @main_preinit2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
int main(void) {
  int i = 0, n = 0;
  for (; i < 10; i += 1) {
    n = n + i;
  }
  return n;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    113a <main+0x3a>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 45
}
int langops_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @langops_init() {
ret i32 0
}
/* Variables and functions */
int lspcon_i2c_spi_write_register(int, int, int);
int lspcon_i2c_spi_toggle_register_protection(int fd, int toggle) {
  return lspcon_i2c_spi_write_register(fd, 0xb3, toggle ? 0x10 : 0);
}


x86 assembly (clang, -O0):
<lspcon_i2c_spi_toggle_register_protection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
xor    %edx,%edx
mov    $0x10,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
mov    $0xb3,%esi
call   1030 <lspcon_i2c_spi_write_register@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lspcon_i2c_spi_toggle_register_protection>:
xor    %edx,%edx
test   %esi,%esi
setne  %dl
shl    $0x4,%edx
mov    $0xb3,%esi
jmp    1030 <lspcon_i2c_spi_write_register@plt>

LLVM IR (-O0):
define i32 @lspcon_i2c_spi_toggle_register_protection(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 16, i32 0
%10 = call i32 @lspcon_i2c_spi_write_register(i32 %5, i32 179, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @lspcon_i2c_spi_toggle_register_protection(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 0, i32 16
%5 = tail call i32 @lspcon_i2c_spi_write_register(i32 %0, i32 179, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  printf("yo\n");
  sleep(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
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    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"yo\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
char *getString();
int /*<<< orphan*/ initVar(char *);
void IF_debVarCS(void) {
  char *v;
  v = getString();
  if (v != NULL) {
    initVar(v);
    free((void *)v);
  }
}


x86 assembly (clang, -O0):
<IF_debVarCS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getString@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <IF_debVarCS+0x30>
mov    -0x8(%rbp),%rdi
call   1050 <initVar@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_debVarCS>:
push   %rbx
xor    %eax,%eax
call   1030 <getString@plt>
test   %rax,%rax
je     1151 <IF_debVarCS+0x21>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <initVar@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @IF_debVarCS() {
%1 = alloca i8*
%2 = call i8* (...) @getString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @initVar(i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @IF_debVarCS() {
%1 = tail call i8* (...) @getString()
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @initVar(i8* %1)
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %3, %0
ret void
}
void makeCallback(void (*callback)(char *, void *), void *fci) {
  callback("Callback called\n", fci);
}


x86 assembly (clang, -O0):
<makeCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
lea    0xee1(%rip),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeCallback>:
mov    %rdi,%rax
lea    0xef6(%rip),%rdi
jmp    *%rax

LLVM IR (-O0):
@.str = [17 x i8] c"Callback called\0A\00"
define void @makeCallback(void (i8*, i8*)* %0, i8* %1) {
%3 = alloca void (i8*, i8*)*
%4 = alloca i8*
store void (i8*, i8*)* %0, void (i8*, i8*)** %3
store i8* %1, i8** %4
%5 = load void (i8*, i8*)*, void (i8*, i8*)** %3
%6 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Callback called\0A\00"
define void @makeCallback(void (i8*, i8*)* nocapture %0, i8* %1) {
tail call void %0(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}