xunge/DecIR huggingface dataset:
/* Variables and functions */
int getchar();
int getline(char *inp) {
  int i = 0;
  int c;
  while ((c = getchar()) != '\n') {
    ++i;
    *(inp++) = c;
  }
  return i;
}


x86 assembly (clang, -O0):
<getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x10(%rbp)
cmp    $0xa,%eax
je     115a <getline+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1123 <getline+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1144 <getline+0x34>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %al,(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <getchar@plt>
add    $0x1,%rbx
cmp    $0xa,%eax
jne    1130 <getline+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @getline(i8* nocapture writeonly %0) {
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 10
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %8, %4 ], [ 0, %1 ]
%8 = add nuw nsw i32 %7, 1
%9 = trunc i32 %5 to i8
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %9, i8* %6
%11 = tail call i32 (...) @getchar()
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %14
}
/* Variables and functions */
int bar(int /*<<< orphan*/);
int foo(int /*<<< orphan*/);
int main() { return foo(0) + bar(0); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <foo@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1030 <bar@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = tail call i32 @bar(i32 0)
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int __real_bar();
int /*<<< orphan*/ printf(char *);
int __wrap_bar(void) {
  printf("__wrap_bar()\n");
  return 7 + __real_bar();
}


x86 assembly (clang, -O0):
<__wrap_bar>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <__real_bar@plt>
add    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_bar>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <__real_bar@plt>
add    $0x7,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"__wrap_bar()\0A\00"
define i32 @__wrap_bar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @__real_bar()
%3 = add nsw i32 7, %2
ret i32 %3
}

LLVM IR (-O2):
@str = [13 x i8] c"__wrap_bar()\00"
define i32 @__wrap_bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @__real_bar()
%3 = add nsw i32 %2, 7
ret i32 %3
}
/* Forward declarations */
typedef struct ds TYPE_1__;

/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ st;
struct ds {
  int v;
  int u32;
};

/* Variables and functions */
int /*<<< orphan*/ hexlify(char *, TYPE_1__ *, int);
int /*<<< orphan*/ memset(TYPE_1__ *, int, int);
void ex_packed_struct(void) {
  struct ds {
    uint8_t v;
    uint32_t u32;
  } __attribute__((__packed__)) st;
  memset(&st, 0xbd, sizeof(st));
  st.v = 1;
  st.u32 = 0x12345678;
  hexlify("packed C struct", &st, sizeof(st));
}


x86 assembly (clang, -O0):
<ex_packed_struct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
mov    $0xbd,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
movl   $0x1,-0x8(%rbp)
movl   $0x12345678,-0x4(%rbp)
lea    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x8,%edx
call   1040 <hexlify@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_packed_struct>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xbd,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
movabs $0x1234567800000001,%rax
56 34 12
mov    %rax,0x8(%rsp)
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1040 <hexlify@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.ds = type { i32, i32 }
%struct.ds.0 = type { i32, i32 }
@.str = [16 x i8] c"packed C struct\00"
define void @ex_packed_struct() {
%1 = alloca %struct.ds
%2 = bitcast %struct.ds* %1 to %struct.ds.0*
%3 = call i32 @memset(%struct.ds.0* %2, i32 189, i32 8)
%4 = getelementptr inbounds %struct.ds, %struct.ds* %1, i32 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.ds, %struct.ds* %1, i32 0, i32 1
store i32 305419896, i32* %5
%6 = bitcast %struct.ds* %1 to %struct.ds.0*
%7 = call i32 @hexlify(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), %struct.ds.0* %6, i32 8)
ret void
}

LLVM IR (-O2):
%struct.ds = type { i32, i32 }
%struct.ds.0 = type { i32, i32 }
@.str = [16 x i8] c"packed C struct\00"
define void @ex_packed_struct() {
%1 = alloca %struct.ds
%2 = bitcast %struct.ds* %1 to i8*
%3 = bitcast %struct.ds* %1 to %struct.ds.0*
%4 = call i32 @memset(%struct.ds.0* %3, i32 189, i32 8)
%5 = getelementptr inbounds %struct.ds, %struct.ds* %1, i64 0, i32 0
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.ds, %struct.ds* %1, i64 0, i32 1
store i32 305419896, i32* %6
%7 = call i32 @hexlify(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), %struct.ds.0* %3, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ data_scr_init();
int /*<<< orphan*/ measure_scr_draw();
int /*<<< orphan*/ measure_scr_init();
int /*<<< orphan*/ measure_scr_open();
void gui_init(void) {
  data_scr_init();
  measure_scr_init();
  measure_scr_open();
  measure_scr_draw();
}


x86 assembly (clang, -O0):
<gui_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <data_scr_init@plt>
mov    $0x0,%al
call   1050 <measure_scr_init@plt>
mov    $0x0,%al
call   1030 <measure_scr_open@plt>
mov    $0x0,%al
call   1060 <measure_scr_draw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_init>:
push   %rax
xor    %eax,%eax
call   1040 <data_scr_init@plt>
xor    %eax,%eax
call   1050 <measure_scr_init@plt>
xor    %eax,%eax
call   1030 <measure_scr_open@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <measure_scr_draw@plt>

LLVM IR (-O0):
define void @gui_init() {
%1 = call i32 (...) @data_scr_init()
%2 = call i32 (...) @measure_scr_init()
%3 = call i32 (...) @measure_scr_open()
%4 = call i32 (...) @measure_scr_draw()
ret void
}

LLVM IR (-O2):
define void @gui_init() {
%1 = tail call i32 (...) @data_scr_init()
%2 = tail call i32 (...) @measure_scr_init()
%3 = tail call i32 (...) @measure_scr_open()
%4 = tail call i32 (...) @measure_scr_draw()
ret void
}
/* Type definitions */
struct kmem_cache {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct kmem_cache *);
void kmem_cache_destroy(struct kmem_cache *cache) { free(cache); }


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

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

LLVM IR (-O2):
%struct.kmem_cache = type { i32 }
define void @kmem_cache_destroy(%struct.kmem_cache* nocapture %0) {
%2 = tail call i32 @free(%struct.kmem_cache* %0)
ret void
}
/* Type definitions */
typedef size_t uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ UINT32_MAX;
scalar_t__ arc4random_uniform(int /*<<< orphan*/);
void fill_array_with_random_uint32(int32_t *restrict A, uint32_t num_items) {
  for (uint32_t i = 0; i < num_items; i++) {
    A[i] = (int32_t)arc4random_uniform(UINT32_MAX);
  }
}


x86 assembly (clang, -O0):
<fill_array_with_random_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1164 <fill_array_with_random_uint32+0x54>
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1030 <arc4random_uniform@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <fill_array_with_random_uint32+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_array_with_random_uint32>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1146 <fill_array_with_random_uint32+0x36>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
mov    0x2ecc(%rip),%r12
nopl   0x0(%rax)
mov    (%r12),%edi
call   1030 <arc4random_uniform@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <fill_array_with_random_uint32+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@UINT32_MAX = global i32 0
define void @fill_array_with_random_uint32(i64* noalias %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32, i32* @UINT32_MAX
%12 = call i64 @arc4random_uniform(i32 %11)
%13 = load i64*, i64** %3
%14 = load i64, i64* %5
%15 = getelementptr inbounds i64, i64* %13, i64 %14
store i64 %12, i64* %15
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
@UINT32_MAX = global i32 0
define void @fill_array_with_random_uint32(i64* noalias nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = load i32, i32* @UINT32_MAX
%8 = tail call i64 @arc4random_uniform(i32 %7)
%9 = getelementptr inbounds i64, i64* %0, i64 %6
store i64 %8, i64* %9
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %4, label %5
}
/* Type definitions */
struct _glist {
  int dummy;
};

/* Variables and functions */
float glist_pixelstox(struct _glist *, int);
float glist_dpixtodx(struct _glist *x, float dxpix) {
  return (dxpix * (glist_pixelstox(x, 1) - glist_pixelstox(x, 0)));
}


x86 assembly (clang, -O0):
<glist_dpixtodx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <glist_pixelstox@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <glist_pixelstox@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glist_dpixtodx>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <glist_pixelstox@plt>
movss  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <glist_pixelstox@plt>
movss  0x8(%rsp),%xmm1
subss  %xmm0,%xmm1
mulss  0xc(%rsp),%xmm1
movaps %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct._glist = type { i32 }
define float @glist_dpixtodx(%struct._glist* %0, float %1) {
%3 = alloca %struct._glist*
%4 = alloca float
store %struct._glist* %0, %struct._glist** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load %struct._glist*, %struct._glist** %3
%7 = call float @glist_pixelstox(%struct._glist* %6, i32 1)
%8 = load %struct._glist*, %struct._glist** %3
%9 = call float @glist_pixelstox(%struct._glist* %8, i32 0)
%10 = fsub float %7, %9
%11 = fmul float %5, %10
ret float %11
}

LLVM IR (-O2):
%struct._glist = type { i32 }
define float @glist_dpixtodx(%struct._glist* %0, float %1) {
%3 = tail call float @glist_pixelstox(%struct._glist* %0, i32 1)
%4 = tail call float @glist_pixelstox(%struct._glist* %0, i32 0)
%5 = fsub float %3, %4
%6 = fmul float %5, %1
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hegeszto() { printf("hegesztem a kodot\n"); }


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"hegesztem a kodot\00"
define void @hegeszto() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
int ux500_pm_domains_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ux500_pm_domains_init() {
ret i32 0
}
void nothing(void *a) { return; }


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

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

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

LLVM IR (-O2):
define void @nothing(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn();
int main(void) {
  fn();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fn()
ret i32 0
}
int (*x2(const int x[3][3]))[3] { return x; }


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

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

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

LLVM IR (-O2):
define [3 x i32]* @x2([3 x i32]* readnone returned %0) {
ret [3 x i32]* %0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void bit_off(uint8_t *byte, uint8_t n) { *byte &= ~(1 << n); }


x86 assembly (clang, -O0):
<bit_off>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_off>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @bit_off(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = load i32, i32* %0
%6 = and i32 %5, %4
store i32 %6, i32* %0
ret void
}
/* Type definitions */
struct ln_rst_time {
  int dummy;
};
struct ln_lnlat_posn {
  int dummy;
};
struct ln_hyp_orbit {
  int dummy;
};

/* Variables and functions */
int ln_get_hyp_body_rst_horizon(double, struct ln_lnlat_posn *,
                                struct ln_hyp_orbit *, double,
                                struct ln_rst_time *);
int ln_get_hyp_body_rst(double JD, struct ln_lnlat_posn *observer,
                        struct ln_hyp_orbit *orbit, struct ln_rst_time *rst) {
  return ln_get_hyp_body_rst_horizon(JD, observer, orbit, -0.5667, rst);
}


x86 assembly (clang, -O0):
<ln_get_hyp_body_rst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
movsd  0xebe(%rip),%xmm1
call   1030 <ln_get_hyp_body_rst_horizon@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_hyp_body_rst>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <ln_get_hyp_body_rst_horizon@plt>

LLVM IR (-O0):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_hyp_orbit = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_hyp_body_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_hyp_orbit* %2, %struct.ln_rst_time* %3) {
%5 = alloca double
%6 = alloca %struct.ln_lnlat_posn*
%7 = alloca %struct.ln_hyp_orbit*
%8 = alloca %struct.ln_rst_time*
store double %0, double* %5
store %struct.ln_lnlat_posn* %1, %struct.ln_lnlat_posn** %6
store %struct.ln_hyp_orbit* %2, %struct.ln_hyp_orbit** %7
store %struct.ln_rst_time* %3, %struct.ln_rst_time** %8
%9 = load double, double* %5
%10 = load %struct.ln_lnlat_posn*, %struct.ln_lnlat_posn** %6
%11 = load %struct.ln_hyp_orbit*, %struct.ln_hyp_orbit** %7
%12 = load %struct.ln_rst_time*, %struct.ln_rst_time** %8
%13 = call i32 @ln_get_hyp_body_rst_horizon(double %9, %struct.ln_lnlat_posn* %10, %struct.ln_hyp_orbit* %11, double -5.667000e-01, %struct.ln_rst_time* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_hyp_orbit = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_hyp_body_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_hyp_orbit* %2, %struct.ln_rst_time* %3) {
%5 = tail call i32 @ln_get_hyp_body_rst_horizon(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_hyp_orbit* %2, double -5.667000e-01, %struct.ln_rst_time* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
volatile void error(char *msg) {
  fprintf(stderr, "Fatal Error:%s\n", msg);
  exit(2);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Fatal Error:%s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Fatal Error:%s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
void ext2fs_fast_clear_bit(unsigned int nr, void *addr) {
  unsigned char *ADDR = (unsigned char *)addr;
  ADDR += nr >> 3;
  *ADDR &= (unsigned char)~(1 << (nr & 0x07));
}


x86 assembly (clang, -O0):
<ext2fs_fast_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
movzbl %al,%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2fs_fast_clear_bit>:
mov    %edi,%ecx
mov    %edi,%eax
shr    $0x3,%rax
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
not    %dl
and    %dl,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @ext2fs_fast_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
%7 = load i32, i32* %3
%8 = lshr i32 %7, 3
%9 = load i8*, i8** %5
%10 = zext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %5
%12 = load i32, i32* %3
%13 = and i32 %12, 7
%14 = shl i32 1, %13
%15 = xor i32 %14, -1
%16 = trunc i32 %15 to i8
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %20, %17
%22 = trunc i32 %21 to i8
store i8 %22, i8* %18
ret void
}

LLVM IR (-O2):
define void @ext2fs_fast_clear_bit(i32 %0, i8* nocapture %1) {
%3 = lshr i32 %0, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %0, 7
%7 = shl nuw nsw i32 1, %6
%8 = load i8, i8* %5
%9 = trunc i32 %7 to i8
%10 = xor i8 %9, -1
%11 = and i8 %8, %10
store i8 %11, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *free_match_string(void *m) {
  if (m) {
    free(m);
  }
  return ((void *)NULL);
}


x86 assembly (clang, -O0):
<free_match_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_match_string+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_match_string>:
test   %rdi,%rdi
je     111f <free_match_string+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @free_match_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(2 >= 2);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
int sub4(void *P, void *Q) { return P - Q; }


x86 assembly (clang, -O0):
<sub4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub4>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @sub4(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @sub4(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ reverseWords(char *);
int main() {
  char s[] = "a";
  reverseWords(s);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x61,0x6(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <reverseWords@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 97, i16* %1
%3 = call i32 @reverseWords(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void version(void) { printf("%s %s\n", "cant", "0.1"); }


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

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xee7(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [5 x i8] c"cant\00"
@.str.2 = [4 x i8] c"0.1\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [5 x i8] c"cant\00"
@.str.2 = [4 x i8] c"0.1\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int func(int (*x)(int, int)) { return x(20, 5); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x14,%edi
mov    $0x5,%esi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mov    %rdi,%rax
mov    $0x14,%edi
mov    $0x5,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @func(i32 (i32, i32)* nocapture %0) {
%2 = tail call i32 %0(i32 20, i32 5)
ret i32 %2
}
void pullUpDnControlSys(int pin, int pud) { return; }


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

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

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

LLVM IR (-O2):
define void @pullUpDnControlSys(i32 %0, i32 %1) {
ret void
}
int mus_vol_set_valance(int *vols, int num) {
  printf("%s not implemented\n", __func__);
  return (-1);
}


x86 assembly (clang, -O0):
<mus_vol_set_valance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.mus_vol_set_valance = [20 x i8] c"mus_vol_set_valance\00"
define i32 @mus_vol_set_valance(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.mus_vol_set_valance, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.mus_vol_set_valance = [20 x i8] c"mus_vol_set_valance\00"
define i32 @mus_vol_set_valance(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.mus_vol_set_valance, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
char *write_uint8(char *buf, uint8_t val) {
  *buf = val;
  return buf + 1;
}


x86 assembly (clang, -O0):
<write_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_uint8>:
mov    %sil,(%rdi)
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @write_uint8(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
store i8 %5, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
ret i8* %8
}

LLVM IR (-O2):
define i8* @write_uint8(i8* writeonly %0, i8 signext %1) {
store i8 %1, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t mat_element_type(void *self) { return self ? *((int32_t *)self) : 0; }


x86 assembly (clang, -O0):
<mat_element_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1121 <mat_element_type+0x21>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    112b <mat_element_type+0x2b>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <mat_element_type+0x2b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_element_type>:
test   %rdi,%rdi
je     1108 <mat_element_type+0x8>
mov    (%rdi),%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mat_element_type(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
char *UTIL_mallocStr(size_t);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *OC_mkRef(char *info) {
  size_t length = strlen(info) + 10;
  char *rtptr = UTIL_mallocStr(length + 1);
  strcpy(rtptr, "(ref ");
  strcat(rtptr, info);
  strcat(rtptr, ")");
  return rtptr;
}


x86 assembly (clang, -O0):
<OC_mkRef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0xa,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <UTIL_mallocStr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OC_mkRef>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
movslq %eax,%rdi
add    $0xb,%rdi
call   1050 <UTIL_mallocStr@plt>
mov    %rax,%rbx
lea    0xe9e(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"(ref \00"
@.str.1 = [2 x i8] c")\00"
define i8* @OC_mkRef(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 10
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = add i64 %9, 1
%11 = call i8* @UTIL_mallocStr(i64 %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = call i32 @strcat(i8* %14, i8* %15)
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
@.str = [6 x i8] c"(ref \00"
@.str.1 = [2 x i8] c")\00"
define i8* @OC_mkRef(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = add nsw i64 %3, 11
%5 = tail call i8* @UTIL_mallocStr(i64 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* %5, i8* %0)
%8 = tail call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ KDSETMODE;
int /*<<< orphan*/ KD_TEXT;
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int tty;
  tty = open("/dev/tty1", O_RDWR);
  ioctl(tty, KDSETMODE, KD_TEXT);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
call   1030 <ioctl@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
mov    0x2e9b(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%edx
mov    %eax,%edi
call   1030 <ioctl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/tty1\00"
@O_RDWR = global i32 0
@KDSETMODE = global i32 0
@KD_TEXT = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* @O_RDWR
%7 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* @KDSETMODE
%10 = load i32, i32* @KD_TEXT
%11 = call i32 @ioctl(i32 %8, i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/tty1\00"
@O_RDWR = global i32 0
@KDSETMODE = global i32 0
@KD_TEXT = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @KDSETMODE
%6 = load i32, i32* @KD_TEXT
%7 = tail call i32 @ioctl(i32 %4, i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "Usage:\t%1$s [-cs] -f <from_code> -t <to_code> [file ...]\n"
                "\t%1$s -f <from_code> [-cs] [-t <to_code>] [file ...]\n"
                "\t%1$s -t <to_code> [-cs] [-f <from_code>] [file ...]\n"
                "\t%1$s -l\n",
                getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [173 x i8] c"Usage:\09%1$s [-cs] -f <from_code> -t <to_code> [file ...]\0A\09%1$s -f <from_code> [-cs] [-t <to_code>] [file ...]\0A\09%1$s -t <to_code> [-cs] [-f <from_code>] [file ...]\0A\09%1$s -l\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [173 x i8] c"Usage:\09%1$s [-cs] -f <from_code> -t <to_code> [file ...]\0A\09%1$s -f <from_code> [-cs] [-t <to_code>] [file ...]\0A\09%1$s -t <to_code> [-cs] [-f <from_code>] [file ...]\0A\09%1$s -l\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ nokia_lcd_out_char(char);
int /*<<< orphan*/ nokia_lcd_out_unsigned_int(int);
void nokia_lcd_out_int(int num) {
  if (num < 0) {
    nokia_lcd_out_char('-');
    num *= -1;
  }
  nokia_lcd_out_unsigned_int(num);
}


x86 assembly (clang, -O0):
<nokia_lcd_out_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1146 <nokia_lcd_out_int+0x26>
mov    $0x2d,%edi
call   1040 <nokia_lcd_out_char@plt>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <nokia_lcd_out_unsigned_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nokia_lcd_out_int>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jns    1133 <nokia_lcd_out_int+0x13>
mov    $0x2d,%edi
call   1040 <nokia_lcd_out_char@plt>
neg    %ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <nokia_lcd_out_unsigned_int@plt>

LLVM IR (-O0):
define void @nokia_lcd_out_int(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 %9
5: ; preds = %1
%6 = call i32 @nokia_lcd_out_char(i8 signext 45)
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, -1
store i32 %8, i32* %2
br label %9
9: ; preds = %5, %1
%10 = load i32, i32* %2
%11 = call i32 @nokia_lcd_out_unsigned_int(i32 %10)
ret void
}

LLVM IR (-O2):
define void @nokia_lcd_out_int(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @nokia_lcd_out_char(i8 signext 45)
%5 = sub nsw i32 0, %0
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
%8 = tail call i32 @nokia_lcd_out_unsigned_int(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initgui_(int *, int *, int *, int *, int *);
void initgui(int *model, int *debug, int *lats, int *mrpid, int *mrnum) {
  initgui_(model, debug, lats, mrpid, mrnum);
}


x86 assembly (clang, -O0):
<initgui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <initgui_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initgui>:
jmp    1030 <initgui_@plt>

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

LLVM IR (-O2):
define void @initgui(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @initgui_(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 4 * 2;
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 8, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int fs_is(char *fs, char *fs_name) { return (strcmp(fs, fs_name) == 0); }


x86 assembly (clang, -O0):
<fs_is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_is>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fs_is(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @fs_is(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int is_blank(char *line) {
  if (*line == '\n')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_blank>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1124 <is_blank+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <is_blank+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank>:
xor    %eax,%eax
cmpb   $0xa,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_blank(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int xcorr_range(double *, int, double *, int, double *, int, double, double);
int autocorr_range(double *output, int len_output, double *rev, int len_rev,
                   double max_threshold, double min_threshold) {
  return xcorr_range(output, len_output, rev, len_rev, rev, len_rev,
                     max_threshold, min_threshold);
}


x86 assembly (clang, -O0):
<autocorr_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
call   1030 <xcorr_range@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autocorr_range>:
mov    %rdx,%r8
mov    %ecx,%r9d
jmp    1030 <xcorr_range@plt>

LLVM IR (-O0):
define i32 @autocorr_range(double* %0, i32 %1, double* %2, i32 %3, double %4, double %5) {
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
%11 = alloca double
%12 = alloca double
store double* %0, double** %7
store i32 %1, i32* %8
store double* %2, double** %9
store i32 %3, i32* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double*, double** %7
%14 = load i32, i32* %8
%15 = load double*, double** %9
%16 = load i32, i32* %10
%17 = load double*, double** %9
%18 = load i32, i32* %10
%19 = load double, double* %11
%20 = load double, double* %12
%21 = call i32 @xcorr_range(double* %13, i32 %14, double* %15, i32 %16, double* %17, i32 %18, double %19, double %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @autocorr_range(double* %0, i32 %1, double* %2, i32 %3, double %4, double %5) {
%7 = tail call i32 @xcorr_range(double* %0, i32 %1, double* %2, i32 %3, double* %2, i32 %3, double %4, double %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xfe() {
  Assert_real((isbdigit(254) == 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_isbdigit.c",
              1275, ("isbdigit should be 0 for 0xfe"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xfe>:
push   %rax
mov    $0xfe,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4fb,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xfe\00"
define void @t_isbdigit_0xfe() {
%1 = call i64 @isbdigit(i32 254)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1275, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xfe\00"
define void @t_isbdigit_0xfe() {
%1 = tail call i64 @isbdigit(i32 254)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1275, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}