xunge/DecIR huggingface dataset:
/* Variables and functions */
void *fopen(char *, char *);
void *pc_createsrc(char *filename) { return fopen(filename, "wt"); }


x86 assembly (clang, -O0):
<pc_createsrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_createsrc>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"wt\00"
define i8* @pc_createsrc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @fopen(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"wt\00"
define noalias i8* @pc_createsrc(i8* nocapture %0) {
%2 = tail call i8* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
void *i2cp(void *key) {
  int *newkey = malloc(sizeof(int) * 2);
  newkey[0] = ((int *)key)[0];
  newkey[1] = ((int *)key)[1];
  return newkey;
}


x86 assembly (clang, -O0):
<i2cp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2cp>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    (%rbx),%ecx
mov    %ecx,(%rax)
mov    0x4(%rbx),%ecx
mov    %ecx,0x4(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @i2cp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i8* @malloc(i64 8)
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i8*, i8** %2
%13 = bitcast i8* %12 to i32*
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 1
store i32 %15, i32* %17
%18 = load i32*, i32** %3
%19 = bitcast i32* %18 to i8*
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @i2cp(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(8) i8* @malloc(i64 8)
%3 = bitcast i8* %2 to i32*
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %8, i32* %9
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ op_tgt();
void vm_op_tgt(void) {
  op_tgt();
  return;
}


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

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

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

LLVM IR (-O2):
define void @vm_op_tgt() {
%1 = tail call i32 (...) @op_tgt()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t minipack_unpack_pos_fixnum(void *ptr, size_t *sz) {
  *sz = 1;
  uint8_t value = *((uint8_t *)ptr);
  return value & 0x7F;
}


x86 assembly (clang, -O0):
<minipack_unpack_pos_fixnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x1,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_pos_fixnum>:
movq   $0x1,(%rsi)
mov    (%rdi),%eax
and    $0x7f,%eax
ret

LLVM IR (-O0):
define i32 @minipack_unpack_pos_fixnum(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i32
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
store i64 1, i64* %6
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = and i32 %10, 127
ret i32 %11
}

LLVM IR (-O2):
define i32 @minipack_unpack_pos_fixnum(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 1, i64* %1
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = and i32 %4, 127
ret i32 %5
}
unsigned char inkey() {}


x86 assembly (clang, -O0):
<inkey>:
push   %rbp
mov    %rsp,%rbp
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @inkey() {
%1 = alloca i8
%2 = load i8, i8* %1
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @inkey() {
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int mainProgram(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int ret = 0;
  if (argc < 2) {
    printf("No control file specified\n");
    exit(1);
  }
  ret = mainProgram(argv[1]);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    116d <main+0x3d>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <mainProgram@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1140 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1040 <mainProgram@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"No control file specified\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @mainProgram(i8* %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
@str = [26 x i8] c"No control file specified\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @mainProgram(i8* %9)
ret i32 %10
}
unsigned int zero_nth_position(unsigned int num, int position) {
  return (num & (~(1 << position)));
}


x86 assembly (clang, -O0):
<zero_nth_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @zero_nth_position(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 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @zero_nth_position(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
int dummySortFunction(const void *a, const void *b) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dummySortFunction(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int fb_line_sign(int x) {
  if (x < 0) {
    return -1;
  } else if (x == 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<fb_line_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <fb_line_sign+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <fb_line_sign+0x3a>
cmpl   $0x0,-0x8(%rbp)
jne    1133 <fb_line_sign+0x33>
movl   $0x0,-0x4(%rbp)
jmp    113a <fb_line_sign+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_line_sign>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fb_line_sign(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = icmp sgt i32 %0, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
/* Type definitions */
struct chippy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct chippy *);
void chippy_destroy(struct chippy *machine) { free(machine); }


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

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

LLVM IR (-O2):
%struct.chippy = type { i32 }
define void @chippy_destroy(%struct.chippy* nocapture %0) {
%2 = tail call i32 @free(%struct.chippy* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ request;
};
struct TYPE_4__ {
  TYPE_1__ xmapping;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xmapping_request(void *_p) {
  return (int)((XEvent *)_p)->xmapping.request;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xmapping_request(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xmapping_request(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int main(void) {
  unsigned long i = 0;
  (*(volatile unsigned long *)0x56000050) =
      (1 << (4 * 2)) | (1 << (5 * 2)) | (1 << (6 * 2));
  while (1) {
    delay(3000);
    (*(volatile unsigned long *)0x56000054) = ~(i << 4);
    if (++i == 8) {
      i = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x56000050,%eax
movq   $0x1500,(%rax)
mov    $0xbb8,%edi
call   1030 <delay@plt>
mov    -0x10(%rbp),%rcx
shl    $0x4,%rcx
xor    $0xffffffffffffffff,%rcx
mov    $0x56000054,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x8,%rax
jne    116f <main+0x5f>
movq   $0x0,-0x10(%rbp)
jmp    1133 <main+0x23>

x86 assembly (clang, -O2):
<main>:
push   %rbx
movq   $0x1500,0x56000050
xor    %ebx,%ebx
nop
mov    $0xbb8,%edi
call   1030 <delay@plt>
mov    %rbx,%rax
shl    $0x4,%rax
not    %rax
mov    %rax,0x56000054
56
add    $0x1,%rbx
cmp    $0x8,%rbx
mov    $0x0,%eax
cmove  %rax,%rbx
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
store volatile i64 5376, i64* inttoptr (i64 1442840656 to i64*)
br label %3
3: ; preds = %0, %12
%4 = call i32 @delay(i32 3000)
%5 = load i64, i64* %2
%6 = shl i64 %5, 4
%7 = xor i64 %6, -1
store volatile i64 %7, i64* inttoptr (i64 1442840660 to i64*)
%8 = load i64, i64* %2
%9 = add i64 %8, 1
store i64 %9, i64* %2
%10 = icmp eq i64 %9, 8
br i1 %10, label %11, label %12
11: ; preds = %3
store i64 0, i64* %2
br label %12
12: ; preds = %11, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
store volatile i64 5376, i64* inttoptr (i64 1442840656 to i64*)
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %8, %1 ]
%3 = tail call i32 @delay(i32 3000)
%4 = shl i64 %2, 4
%5 = xor i64 %4, -1
store volatile i64 %5, i64* inttoptr (i64 1442840660 to i64*)
%6 = add i64 %2, 1
%7 = icmp eq i64 %6, 8
%8 = select i1 %7, i64 0, i64 %6
br label %1
}
void INT_Excep_PDC_PCDFI(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PDC_PCDFI() {
ret void
}
/* Variables and functions */
int device_getch();
int /*<<< orphan*/ display_refresh();
int display_getch(void) {
  display_refresh();
  return device_getch();
}


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

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

LLVM IR (-O0):
define i32 @display_getch() {
%1 = call i32 (...) @display_refresh()
%2 = call i32 (...) @device_getch()
ret i32 %2
}

LLVM IR (-O2):
define i32 @display_getch() {
%1 = tail call i32 (...) @display_refresh()
%2 = tail call i32 (...) @device_getch()
ret i32 %2
}
int test_0x1123456() { return 0x1123456; }


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

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

LLVM IR (-O0):
define i32 @test_0x1123456() {
ret i32 17970262
}

LLVM IR (-O2):
define i32 @test_0x1123456() {
ret i32 17970262
}
void ScaleRowDown2Box_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown2Box_Any_NEON() {
ret void
}
double unipolarToBipolar(double dValue) { return 2.0 * dValue - 1.0; }


x86 assembly (clang, -O0):
<unipolarToBipolar>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<unipolarToBipolar>:
addsd  %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @unipolarToBipolar(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %3, double -1.000000e+00)
ret double %4
}

LLVM IR (-O2):
define double @unipolarToBipolar(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double -1.000000e+00)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ *_fpopen(char const *, char const *, int /*<<< orphan*/ *);
scalar_t__ fclose(int /*<<< orphan*/ *);
FILE *freopen(const char *restrict name, const char *restrict mode,
              FILE *restrict fp) {
  if (fclose(fp) == EOF)
    return NULL;
  return _fpopen(name, mode, fp);
}


x86 assembly (clang, -O0):
<freopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%rax
jne    115a <freopen+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    116f <freopen+0x4f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <_fpopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freopen>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <fclose@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
jne    114a <freopen+0x2a>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <_fpopen@plt>

LLVM IR (-O0):
@EOF = global i64 0
define i32* @freopen(i8* noalias %0, i8* noalias %1, i32* noalias %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
%8 = load i32*, i32** %7
%9 = call i64 @fclose(i32* %8)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %3
store i32* null, i32** %4
br label %18
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = load i32*, i32** %7
%17 = call i32* @_fpopen(i8* %14, i8* %15, i32* %16)
store i32* %17, i32** %4
br label %18
18: ; preds = %13, %12
%19 = load i32*, i32** %4
ret i32* %19
}

LLVM IR (-O2):
@EOF = global i64 0
define i32* @freopen(i8* noalias %0, i8* noalias %1, i32* noalias %2) {
%4 = tail call i64 @fclose(i32* %2)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32* @_fpopen(i8* %0, i8* %1, i32* %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32* [ %8, %7 ], [ null, %3 ]
ret i32* %10
}
int test_imm_BCint16_reg(short val) {
  return ((val) & (0xBC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BCint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xbc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_BCint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 188
%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_BCint16_reg(i16 signext %0) {
%2 = and i16 %0, 188
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar(void *, void *, void *);
int /*<<< orphan*/ free(void *);
void *malloc(int);
void test_4(void *q, void *r) {
  void *p = malloc(1024);
  bar(p, q, r);
  bar(p, q, r);
  free(p);
}


x86 assembly (clang, -O0):
<test_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <bar@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <bar@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_4>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <bar@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <bar@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @test_4(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i8* @malloc(i32 1024)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @bar(i8* %7, i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @bar(i8* %11, i8* %12, i8* %13)
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
define void @test_4(i8* %0, i8* %1) {
%3 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%4 = tail call i32 @bar(i8* %3, i8* %0, i8* %1)
%5 = tail call i32 @bar(i8* %3, i8* %0, i8* %1)
%6 = tail call i32 @free(i8* %3)
ret void
}
/* Type definitions */
struct node {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct node *);
int /*<<< orphan*/ free_list(struct list *);
void free_node_and_list(struct node *current_node, struct node *parent_node,
                        struct list *open_list, struct list *close_list) {
  free(current_node);
  free(parent_node);
  free_list(open_list);
  free_list(close_list);
}


x86 assembly (clang, -O0):
<free_node_and_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free_list@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free_list@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_node_and_list>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1040 <free_list@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <free_list@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
%struct.list = type { i32 }
define void @free_node_and_list(%struct.node* %0, %struct.node* %1, %struct.list* %2, %struct.list* %3) {
%5 = alloca %struct.node*
%6 = alloca %struct.node*
%7 = alloca %struct.list*
%8 = alloca %struct.list*
store %struct.node* %0, %struct.node** %5
store %struct.node* %1, %struct.node** %6
store %struct.list* %2, %struct.list** %7
store %struct.list* %3, %struct.list** %8
%9 = load %struct.node*, %struct.node** %5
%10 = call i32 @free(%struct.node* %9)
%11 = load %struct.node*, %struct.node** %6
%12 = call i32 @free(%struct.node* %11)
%13 = load %struct.list*, %struct.list** %7
%14 = call i32 @free_list(%struct.list* %13)
%15 = load %struct.list*, %struct.list** %8
%16 = call i32 @free_list(%struct.list* %15)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
%struct.list = type { i32 }
define void @free_node_and_list(%struct.node* nocapture %0, %struct.node* nocapture %1, %struct.list* %2, %struct.list* %3) {
%5 = tail call i32 @free(%struct.node* %0)
%6 = tail call i32 @free(%struct.node* %1)
%7 = tail call i32 @free_list(%struct.list* %2)
%8 = tail call i32 @free_list(%struct.list* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x06() {
  Assert_real((isspace(6) == 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",
              35, ("isspace should be 0 for 0x06"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x06>:
push   %rax
mov    $0x6,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x23,%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 0x06\00"
define void @t_isspace_0x06() {
%1 = call i64 @isspace(i32 6)
%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 35, 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 0x06\00"
define void @t_isspace_0x06() {
%1 = tail call i64 @isspace(i32 6)
%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 35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int getSize(const long long int num) {
  if (num < 10)
    return 1;
  return 1 + getSize(num / 10);
}


x86 assembly (clang, -O0):
<getSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0xa,-0x10(%rbp)
jge    1133 <getSize+0x23>
movl   $0x1,-0x4(%rbp)
jmp    114f <getSize+0x3f>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1030 <getSize@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSize>:
mov    $0x1,%ecx
cmp    $0xa,%rdi
jl     1136 <getSize+0x36>
mov    $0x1,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
nopw   0x0(%rax,%rax,1)
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
add    $0x1,%ecx
cmp    $0x63,%rdi
mov    %rdx,%rdi
ja     1120 <getSize+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getSize(i64 %0) {
%2 = icmp slt i64 %0, 10
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = udiv i64 %4, 10
%7 = add i32 %5, 1
%8 = icmp ult i64 %4, 100
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = add i32 %5, 2
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 1, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int value1, value2, sum;
  value1 = 15;
  value2 = 87;
  sum = value2 - value1;
  printf("Subtracting %i from %i gives %i\n", value1, value2, sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
movl   $0x57,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
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    $0xf,%esi
mov    $0x57,%edx
mov    $0x48,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Subtracting %i from %i gives %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 15, i32* %2
store i32 87, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = sub nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Subtracting %i from %i gives %i\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 15, i32 87, i32 72)
ret i32 0
}
int deinit(void) {
  debug_printf(3,
               "[INFO] %s:%d (%s): "
               "Deregistering module %s"
               "\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/rpedde/evgopherd/refs/heads/"
               "master/src/plugin-skeleton.c",
               31, __FUNCTION__, "skeleton");
  return 1;
}


x86 assembly (clang, -O0):
<deinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
lea    0xee0(%rip),%rsi
lea    0xf05(%rip),%rdx
mov    $0x1f,%ecx
lea    0xf8c(%rip),%r8
lea    0xf8c(%rip),%r9
mov    $0x0,%al
call   1030 <debug_printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deinit>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xf0d(%rip),%rdx
lea    0xf99(%rip),%r8
lea    0xf99(%rip),%r9
mov    $0x3,%edi
mov    $0x1f,%ecx
xor    %eax,%eax
call   1030 <debug_printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"[INFO] %s:%d (%s): Deregistering module %s\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/rpedde/evgopherd/refs/heads/master/src/plugin-skeleton.c\00"
@__FUNCTION__.deinit = [7 x i8] c"deinit\00"
@.str.2 = [9 x i8] c"skeleton\00"
define i32 @deinit() {
%1 = call i32 (i32, i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @debug_printf to i32 (i32, i8*, i8*, i32, i8*, i8*, ...)*)(i32 3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 31, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.deinit, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [44 x i8] c"[INFO] %s:%d (%s): Deregistering module %s\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/rpedde/evgopherd/refs/heads/master/src/plugin-skeleton.c\00"
@__FUNCTION__.deinit = [7 x i8] c"deinit\00"
@.str.2 = [9 x i8] c"skeleton\00"
define i32 @deinit() {
%1 = tail call i32 (i32, i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @debug_printf to i32 (i32, i8*, i8*, i32, i8*, i8*, ...)*)(i32 3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 31, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.deinit, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int input = 0;
  scanf("%d", &input);
  printf("%d", is_prime(input));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <is_prime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
unsigned xrop3_118_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = ~S;
  stk3 = T & stk4;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_118_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_118_1_0>:
shl    $0x8,%edi
shl    $0x8,%esi
not    %edi
and    %esi,%edi
lea    0xff(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @xrop3_118_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %6
%25 = xor i32 %24, -1
store i32 %25, i32* %11
%26 = load i32, i32* %7
%27 = load i32, i32* %11
%28 = and i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %5
%30 = load i32, i32* %10
%31 = or i32 %29, %30
store i32 %31, i32* %9
%32 = load i32, i32* %6
%33 = load i32, i32* %9
%34 = xor i32 %32, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = load i32, i32* %6
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_118_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, 255
ret i32 %9
}
int clear_out_buffer(string, n)
char string[];
int n;
{
  int i;
  for (i = 0; i < n; i++)
    string[i] = ' ';
  string[0] = '\0';
  return (1);
}


x86 assembly (clang, -O0):
<clear_out_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <clear_out_buffer+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clear_out_buffer+0x12>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_out_buffer>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
jle    1127 <clear_out_buffer+0x17>
mov    %esi,%edx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <memset@plt>
movb   $0x0,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @clear_out_buffer(i8* %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 = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 32, i8* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 0
store i8 0, i8* %20
ret i32 1
}

LLVM IR (-O2):
define i32 @clear_out_buffer(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
store i8 0, i8* %0
ret i32 1
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
intptr_t st_pop(struct forth_instance *);
int /*<<< orphan*/ st_push(struct forth_instance *, int);
void lessthan(struct forth_instance *fi) {
  intptr_t tp;
  tp = st_pop(fi);
  st_push(fi, st_pop(fi) < tp);
}


x86 assembly (clang, -O0):
<lessthan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    -0x18(%rbp),%rdi
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%esi
call   1040 <st_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lessthan>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <st_pop@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <st_pop@plt>
xor    %esi,%esi
cmp    %r14,%rax
setl   %sil
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @lessthan(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
%3 = alloca i64
store %struct.forth_instance* %0, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i64 @st_pop(%struct.forth_instance* %4)
store i64 %5, i64* %3
%6 = load %struct.forth_instance*, %struct.forth_instance** %2
%7 = load %struct.forth_instance*, %struct.forth_instance** %2
%8 = call i64 @st_pop(%struct.forth_instance* %7)
%9 = load i64, i64* %3
%10 = icmp slt i64 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @st_push(%struct.forth_instance* %6, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @lessthan(%struct.forth_instance* %0) {
%2 = tail call i64 @st_pop(%struct.forth_instance* %0)
%3 = tail call i64 @st_pop(%struct.forth_instance* %0)
%4 = icmp slt i64 %3, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @st_push(%struct.forth_instance* %0, i32 %5)
ret void
}
unsigned int get_length_of_text(char *text) {
  int i = 0;
  while (text[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<get_length_of_text>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <get_length_of_text+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <get_length_of_text+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_length_of_text>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <get_length_of_text+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_length_of_text(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("1..1");
  puts("not ok 1 - some test");
  return 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"1..1\00"
@.str.1 = [21 x i8] c"not ok 1 - some test\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@.str = [5 x i8] c"1..1\00"
@.str.1 = [21 x i8] c"not ok 1 - some test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 2
}
__attribute__((no)) void foo() {}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
int HelpItem78(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem78() {
ret i32 0
}
void rop3_59_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T | stk3;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_59_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_59_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
not    %cl
and    %al,%sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_59_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = load i8*, i8** %4
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = and i32 %43, %45
%47 = or i32 %40, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = load i8, i8* %6
%52 = zext i8 %51 to i32
%53 = and i32 %50, %52
%54 = or i32 %47, %53
%55 = trunc i32 %54 to i8
%56 = load i8*, i8** %4
store i8 %55, i8* %56
ret void
}

LLVM IR (-O2):
define void @rop3_59_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = xor i8 %5, -1
%7 = and i8 %4, %1
%8 = or i8 %7, %6
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
double log(double x) { return 4; }


x86 assembly (clang, -O0):
<log>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<log>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @log(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @log(double %0) {
ret double 4.000000e+00
}