xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *jent_zalloc(size_t len) {
  void *tmp = NULL;
  tmp = malloc(len);
  if (NULL != tmp)
    memset(tmp, 0, len);
  return tmp;
}


x86 assembly (clang, -O0):
<jent_zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     115c <jent_zalloc+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jent_zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <jent_zalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @jent_zalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void prompts_1(void) {
  int x;
  char prompts[3][16] = {"Type something:", "C:\>", "."};
  for (x = 0; x < 3; x++) {
    puts(prompts[x]);
  }
}


x86 assembly (clang, -O0):
<prompts_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1172 <prompts_1+0x52>
movslq -0x4(%rbp),%rax
lea    -0x40(%rbp),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <prompts_1+0x24>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompts_1>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%r14
lea    0x10(%rsp),%rbx
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.prompts_1.prompts = [3 x [16 x i8]] [[16 x i8] c"Type something:\00", [16 x i8] c"C:>\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
define void @prompts_1() {
%1 = alloca i32
%2 = alloca [3 x [16 x i8]]
%3 = bitcast [3 x [16 x i8]]* %2 to i8*
store i32 0, i32* %1
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [3 x [16 x i8]], [3 x [16 x i8]]* %2, i64 0, i64 %9
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %10, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
@__const.prompts_1.prompts = [3 x [16 x i8]] [[16 x i8] c"Type something:\00", [16 x i8] c"C:>\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
define void @prompts_1() {
%1 = alloca [3 x [16 x i8]]
%2 = getelementptr inbounds [3 x [16 x i8]], [3 x [16 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %2)
%4 = getelementptr inbounds [3 x [16 x i8]], [3 x [16 x i8]]* %1, i64 0, i64 1, i64 0
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %4)
%6 = getelementptr inbounds [3 x [16 x i8]], [3 x [16 x i8]]* %1, i64 0, i64 2, i64 0
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %6)
ret void
}
int __test() {
  union lol {
    float f;
    char c[4];
  } foo;
  foo.f = 1.753753153e6;
  int res = 0;
  for (int i = 0; i < 4; ++i) {
    res += foo.c[i];
  }
  return res;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1146 <__test+0x46>
movslq -0x10(%rbp),%rax
movsbl -0x8(%rbp,%rax,1),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111f <__test+0x1f>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.lol = type { float }
define i32 @__test() {
%1 = alloca %union.lol
%2 = alloca i32
%3 = alloca i32
%4 = bitcast %union.lol* %1 to float*
store float 0x413AC29920000000, float* %4
store i32 0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = bitcast %union.lol* %1 to [4 x i8]*
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i32, i32* %2
%16 = add nsw i32 %15, %14
store i32 %16, i32* %2
br label %17
17: ; preds = %8
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %5
20: ; preds = %5
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 -4
}
int getcol(int i, int rows) { return (i / rows); }


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

x86 assembly (clang, -O2):
<getcol>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @getcol(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @getcol(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int hidden_func();
int main(void) { return hidden_func(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hidden_func()
ret i32 %1
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ fail(char *);
int /*<<< orphan*/ free(int *);
void *reallocvec(int *op, int columns, int size) {
  void *p;
  p = calloc(columns, size);
  if (p == NULL)
    fail("reallocvec: calloc failed!");
  free(op);
  return p;
}


x86 assembly (clang, -O0):
<reallocvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <reallocvec+0x38>
lea    0xe9d(%rip),%rdi
call   1040 <fail@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocvec>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %esi,%edi
mov    %edx,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1154 <reallocvec+0x24>
lea    0xeb1(%rip),%rdi
call   1040 <fail@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"reallocvec: calloc failed!\00"
define i8* @reallocvec(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i8* @calloc(i32 %8, i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @fail(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i32*, i32** %4
%17 = call i32 @free(i32* %16)
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
@.str = [27 x i8] c"reallocvec: calloc failed!\00"
define noalias i8* @reallocvec(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i8* @calloc(i32 %1, i32 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @fail(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @free(i32* %0)
ret i8* %4
}
int trans_0_x(int x, int y) { return x; }


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

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

LLVM IR (-O0):
define i32 @trans_0_x(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @trans_0_x(i32 returned %0, i32 %1) {
ret i32 %0
}
I0A1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (22 <= (*((int *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0x16,%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx),%eax
jg     1136 <I0A1+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <I0A1+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0A1>:
xor    %eax,%eax
cmpl   $0x16,0xa98ac7
16
setge  %al
ret

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

LLVM IR (-O2):
define i32 @I0A1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = load i32, i32* inttoptr (i64 11111111 to i32*)
%8 = icmp sgt i32 %7, 21
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int sprintf(char *, char *, char const *, char const *);
int smp_sio_strcat(char *buffer, const char *str1, const char *str2) {
  return sprintf(buffer, "%s%s", str1, str2);
}


x86 assembly (clang, -O0):
<smp_sio_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_sio_strcat>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i32 @smp_sio_strcat(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i32 @smp_sio_strcat(i8* nocapture writeonly %0, i8* %1, i8* %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("hello %s.\n", argv[1]);
  printf("You are %d miles away.\n", distance);
  return 0;
}


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   $0x64,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"hello %s.\0A\00"
@.str.1 = [24 x i8] c"You are %d miles away.\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 100, i32* %6
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"hello %s.\0A\00"
@.str.1 = [24 x i8] c"You are %d miles away.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 100)
ret i32 0
}
void MY_RELAX_CPU(void) { __asm__ __volatile__("pause"); }


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

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

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

LLVM IR (-O2):
define void @MY_RELAX_CPU() {
tail call void asm sideeffect "pause", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct sip_msg {
  int dummy;
};
struct fis_param {
  int dummy;
};

/* Variables and functions */
int ops_write_avp(struct sip_msg *, struct fis_param *, struct fis_param *);
int w_write_avps(struct sip_msg *msg, char *source, char *param) {
  return ops_write_avp(msg, (struct fis_param *)source,
                       (struct fis_param *)param);
}


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

x86 assembly (clang, -O2):
<w_write_avps>:
jmp    1030 <ops_write_avp@plt>

LLVM IR (-O0):
%struct.sip_msg = type { i32 }
%struct.fis_param = type { i32 }
define i32 @w_write_avps(%struct.sip_msg* %0, i8* %1, i8* %2) {
%4 = alloca %struct.sip_msg*
%5 = alloca i8*
%6 = alloca i8*
store %struct.sip_msg* %0, %struct.sip_msg** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.sip_msg*, %struct.sip_msg** %4
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to %struct.fis_param*
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to %struct.fis_param*
%12 = call i32 @ops_write_avp(%struct.sip_msg* %7, %struct.fis_param* %9, %struct.fis_param* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.sip_msg = type { i32 }
%struct.fis_param = type { i32 }
define i32 @w_write_avps(%struct.sip_msg* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %1 to %struct.fis_param*
%5 = bitcast i8* %2 to %struct.fis_param*
%6 = tail call i32 @ops_write_avp(%struct.sip_msg* %0, %struct.fis_param* %4, %struct.fis_param* %5)
ret i32 %6
}
/* Variables and functions */
int main() {
  int *x = NULL;
  *x = 5;
  return 1;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
%3 = load i32*, i32** %2
store i32 5, i32* %3
ret i32 1
}

LLVM IR (-O2):
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int bt_sys_write(int, char const *, int);
int _write_r(struct _reent *r, int file, const char *ptr, int len) {
  return bt_sys_write(file, ptr, len);
}


x86 assembly (clang, -O0):
<_write_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <bt_sys_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_r>:
mov    %esi,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <bt_sys_write@plt>

LLVM IR (-O0):
%struct._reent = type { i32 }
define i32 @_write_r(%struct._reent* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @bt_sys_write(i32 %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i32 @_write_r(%struct._reent* nocapture readnone %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @bt_sys_write(i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _ts_q(char *, unsigned char *, int);
char *ts_a(char *host, unsigned char *q) { _ts_q(host, q, 1); }


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

x86 assembly (clang, -O2):
<ts_a>:
mov    $0x1,%edx
jmp    1030 <_ts_q@plt>

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

LLVM IR (-O2):
define noalias i8* @ts_a(i8* %0, i8* %1) {
%3 = tail call i32 @_ts_q(i8* %0, i8* %1, i32 1)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ fun(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 55;
  fun(x);
  printf("fuori dalla funzione: %d\n", x);
}


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

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

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

LLVM IR (-O2):
@.str = [26 x i8] c"fuori dalla funzione: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @fun(i32 55)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 55)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_90() {
  Assert_real((isqrt(90) == 9),
              "/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/stdlib/isqrt.c",
              455, ("Integer square root of 90 should be 9"));
}


x86 assembly (clang, -O0):
<t_sqrt_90>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5a,%edi
call   1030 <isqrt@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x1c7,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_90>:
push   %rax
mov    $0x5a,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x1c7,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 90 should be 9\00"
define void @t_sqrt_90() {
%1 = call i32 @isqrt(i32 90)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 455, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 90 should be 9\00"
define void @t_sqrt_90() {
%1 = tail call i32 @isqrt(i32 90)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 455, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float MagicBlank() {
  float blank = -1.23456e+15;
  return blank;
}


x86 assembly (clang, -O0):
<MagicBlank>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @MagicBlank() {
%1 = alloca float
store float 0xC3118B4DA0000000, float* %1
%2 = load float, float* %1
ret float %2
}

LLVM IR (-O2):
define float @MagicBlank() {
ret float 0xC3118B4DA0000000
}
/* Variables and functions */
int /*<<< orphan*/ AirspeedActualHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AirspeedActualRequestUpdate() {
  UAVObjRequestUpdate(AirspeedActualHandle());
}


x86 assembly (clang, -O0):
<AirspeedActualRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AirspeedActualHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AirspeedActualRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <AirspeedActualHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @AirspeedActualRequestUpdate() {
%1 = call i32 (...) @AirspeedActualHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AirspeedActualRequestUpdate() {
%1 = tail call i32 (...) @AirspeedActualHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
void view_hotel_volume_minumum(void) {}


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

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

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

LLVM IR (-O2):
define void @view_hotel_volume_minumum() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_compatible_with_channel_map() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_compatible_with_channel_map"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"NOT IMPLEMENTED:pa_cvolume_compatible_with_channel_map\0A\00"
define i32 @pa_cvolume_compatible_with_channel_map() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [55 x i8] c"NOT IMPLEMENTED:pa_cvolume_compatible_with_channel_map\00"
define i32 @pa_cvolume_compatible_with_channel_map() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void sn9cxxx_shutdown(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @sn9cxxx_shutdown(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello world!\n");
  return 0;
}


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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello world!\0A\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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *str) {
  size_t n = strlen(str) + 1;
  char *dup = malloc(n);
  if (dup)
    memcpy(dup, str, n);
  return dup;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1177 <strdup+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup(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, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = load i64, i64* %3
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
br label %18
18: ; preds = %13, %1
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
void c_pomp_begin_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_begin_(%struct.ompregdescr* nocapture %0) {
ret void
}
void pickinit() {}


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

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

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

LLVM IR (-O2):
define void @pickinit() {
ret void
}
/* Variables and functions */
char *pdf_calloc(int, unsigned long);
int /*<<< orphan*/ strcpy(char *, char *);
unsigned long strlen(char *);
char *pdf_strdup(char *s) {
  unsigned long len = strlen(s);
  char *s2 = pdf_calloc(1, len + 1);
  strcpy(s2, s);
  return (s2);
}


x86 assembly (clang, -O0):
<pdf_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    $0x1,%edi
call   1030 <pdf_calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdf_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%rsi
mov    $0x1,%edi
call   1030 <pdf_calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @pdf_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @pdf_calloc(i32 1, i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @pdf_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @pdf_calloc(i32 1, i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
double genrand_real1();
double rrand(double low, double high) {
  return low + genrand_real1() * (high - low);
}


x86 assembly (clang, -O0):
<rrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <genrand_real1@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrand>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <genrand_real1@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rrand(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double (...) @genrand_real1()
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = call double @llvm.fmuladd.f64(double %6, double %9, double %5)
ret double %10
}

LLVM IR (-O2):
define double @rrand(double %0, double %1) {
%3 = tail call double (...) @genrand_real1()
%4 = fsub double %1, %0
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %0)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;

/* Variables and functions */
int /*<<< orphan*/ MPFR_RNDN;
int /*<<< orphan*/ mpfr_set_d(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ sin(double);
void getsin_d(mpfr_t y, float phase) {
  mpfr_set_d(y, sin((double)phase), MPFR_RNDN);
}


x86 assembly (clang, -O0):
<getsin_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1040 <sin@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
call   1030 <mpfr_set_d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsin_d>:
push   %rbx
mov    %edi,%ebx
cvtss2sd %xmm0,%xmm0
call   1040 <sin@plt>
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%edx
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <mpfr_set_d@plt>

LLVM IR (-O0):
@MPFR_RNDN = global i32 0
define void @getsin_d(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = call i32 @sin(double %7)
%9 = load i32, i32* @MPFR_RNDN
%10 = call i32 @mpfr_set_d(i32 %5, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@MPFR_RNDN = global i32 0
define void @getsin_d(i32 %0, float %1) {
%3 = fpext float %1 to double
%4 = tail call i32 @sin(double %3)
%5 = load i32, i32* @MPFR_RNDN
%6 = tail call i32 @mpfr_set_d(i32 %0, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rtc_fetch_time();
int /*<<< orphan*/ rtc_read_port(int);
void rtc_interrupt_handler(int intr, int code) {
  rtc_fetch_time();
  rtc_read_port((0x80 + 12));
}


x86 assembly (clang, -O0):
<rtc_interrupt_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rtc_fetch_time@plt>
mov    $0x8c,%edi
call   1040 <rtc_read_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtc_interrupt_handler>:
push   %rax
xor    %eax,%eax
call   1030 <rtc_fetch_time@plt>
mov    $0x8c,%edi
pop    %rax
jmp    1040 <rtc_read_port@plt>

LLVM IR (-O0):
define void @rtc_interrupt_handler(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rtc_fetch_time()
%6 = call i32 @rtc_read_port(i32 140)
ret void
}

LLVM IR (-O2):
define void @rtc_interrupt_handler(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rtc_fetch_time()
%4 = tail call i32 @rtc_read_port(i32 140)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FP_free(void *ptr) {
  if (ptr)
    free(ptr);
}


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

x86 assembly (clang, -O2):
<FP_free>:
test   %rdi,%rdi
je     111a <FP_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @FP_free(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 void
}

LLVM IR (-O2):
define void @FP_free(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 void
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void irc_channel_key(char *channel, char *key) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s +k %s", "MODE", channel, key);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_channel_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    $0x1fd,%esi
lea    0xeb2(%rip),%rdx
lea    0xeb7(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_channel_key>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
lea    0xecb(%rip),%rdx
lea    0xed0(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s %s +k %s\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_channel_key(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [509 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 509, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%11 = call i32 @net_send(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s %s +k %s\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_channel_key(i8* %0, i8* %1) {
%3 = alloca [509 x i8]
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @net_send(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int clib() {
  printf("Hello from C!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello from C!\00"
define i32 @clib() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int aftrekken(int term1, int term2) { return term1 - term2; }


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

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

LLVM IR (-O0):
define i32 @aftrekken(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @aftrekken(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __RBIT(uint32_t value) {
  uint32_t result;
  int32_t s = 4 * 8 - 1;
  result = value;
  for (value >>= 1; value; value >>= 1) {
    result <<= 1;
    result |= value & 1;
    s--;
  }
  result <<= s;
  return (result);
}


x86 assembly (clang, -O0):
<__RBIT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1f,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1153 <__RBIT+0x53>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111d <__RBIT+0x1d>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__RBIT>:
mov    $0x1f,%ecx
cmp    $0x2,%edi
jae    110e <__RBIT+0xe>
mov    %edi,%eax
jmp    1134 <__RBIT+0x34>
mov    $0x1f,%ecx
mov    %edi,%eax
mov    %edi,%edx
nopw   0x0(%rax,%rax,1)
sar    %edx
mov    %edx,%esi
and    $0x1,%esi
lea    (%rsi,%rax,2),%eax
add    $0xffffffff,%ecx
cmp    $0x3,%edi
mov    %edx,%edi
ja     1120 <__RBIT+0x20>
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @__RBIT(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 31, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = ashr i32 %4, 1
%8 = shl i32 %6, 1
%9 = and i32 %7, 1
%10 = or i32 %8, %9
%11 = add nsw i32 %5, -1
%12 = icmp ult i32 %4, 4
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ %0, %1 ], [ %10, %3 ]
%15 = phi i32 [ 31, %1 ], [ %11, %3 ]
%16 = shl i32 %14, %15
ret i32 %16
}
unsigned int GPMCECCBCHSWDataRead(unsigned int baseAddr) {
  unsigned int bchData;
  bchData =
      ((*((volatile unsigned int *)(baseAddr + (0x2D0)))) & (0x0000FFFFu));
  return (bchData);
}


x86 assembly (clang, -O0):
<GPMCECCBCHSWDataRead>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2d0,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCECCBCHSWDataRead>:
add    $0x2d0,%edi
mov    (%rdi),%eax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @GPMCECCBCHSWDataRead(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 720
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 65535
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @GPMCECCBCHSWDataRead(i32 %0) {
%2 = add i32 %0, 720
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 65535
ret i32 %6
}
short ffiTestShorts(short c1, short c2, short c3, short c4) {
  ;
  return -42;
}


x86 assembly (clang, -O0):
<ffiTestShorts>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    $0xffd6,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffiTestShorts>:
mov    $0xffd6,%ax
ret

LLVM IR (-O0):
define signext i16 @ffiTestShorts(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
ret i16 -42
}

LLVM IR (-O2):
define signext i16 @ffiTestShorts(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
ret i16 -42
}
/* Variables and functions */
int /*<<< orphan*/ sync_close_child(int *);
int /*<<< orphan*/ sync_close_parent(int *);
void sync_close(int fd[2]) {
  sync_close_child(fd);
  sync_close_parent(fd);
}


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

x86 assembly (clang, -O2):
<sync_close>:
push   %rbx
mov    %rdi,%rbx
call   1040 <sync_close_child@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <sync_close_parent@plt>

LLVM IR (-O0):
define void @sync_close(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @sync_close_child(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @sync_close_parent(i32* %5)
ret void
}

LLVM IR (-O2):
define void @sync_close(i32* %0) {
%2 = tail call i32 @sync_close_child(i32* %0)
%3 = tail call i32 @sync_close_parent(i32* %0)
ret void
}
/* Variables and functions */
void *getpwnam() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @getpwnam() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @getpwnam() {
ret i8* null
}
/* Variables and functions */
int errno;
int _set_errno(int code) {
  errno = code;
  return -1;
}


x86 assembly (clang, -O0):
<_set_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_errno>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @_set_errno(i32 %0) {
store i32 %0, i32* @errno
ret i32 -1
}