xunge/DecIR huggingface dataset:
/* Variables and functions */
int test1(char const *);
int test2(char const *);
int main(int argc, const char **argv) {
  return test1(argv[0]) - test2(argv[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)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <test1@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <test2@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rdi
call   1030 <test1@plt>
mov    %eax,%ebp
mov    (%rbx),%rdi
call   1040 <test2@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @test1(i8* %8)
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @test2(i8* %12)
%14 = sub nsw i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @test1(i8* %3)
%5 = load i8*, i8** %1
%6 = tail call i32 @test2(i8* %5)
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
struct _elf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ elf_destroy_resources(struct _elf *);
int /*<<< orphan*/ free(struct _elf *);
void elf_destroy(struct _elf *elf) {
  elf_destroy_resources(elf);
  free(elf);
}


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

x86 assembly (clang, -O2):
<elf_destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <elf_destroy_resources@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct._elf = type { i32 }
define void @elf_destroy(%struct._elf* %0) {
%2 = tail call i32 @elf_destroy_resources(%struct._elf* %0)
%3 = tail call i32 @free(%struct._elf* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ id_t;
typedef int /*<<< orphan*/ __priority_which_t;

/* Variables and functions */
int __syscall_getpriority(int /*<<< orphan*/, int /*<<< orphan*/);
int getpriority(__priority_which_t which, id_t who) {
  int res;
  res = __syscall_getpriority(which, who);
  if (res >= 0)
    res = 20 - res;
  return res;
}


x86 assembly (clang, -O0):
<getpriority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__syscall_getpriority@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1141 <getpriority+0x31>
mov    $0x14,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpriority>:
push   %rax
call   1030 <__syscall_getpriority@plt>
mov    $0x14,%ecx
sub    %eax,%ecx
test   %eax,%eax
cmovns %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getpriority(i32 %0, i32 %1) {
%3 = tail call i32 @__syscall_getpriority(i32 %0, i32 %1)
%4 = icmp sgt i32 %3, -1
%5 = sub nsw i32 20, %3
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
/* Variables and functions */
unsigned int SuperFastHash(void const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(void const *);
unsigned int str_hash(const void *s) { return SuperFastHash(s, strlen(s)); }


x86 assembly (clang, -O0):
<str_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <SuperFastHash@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_hash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <SuperFastHash@plt>

LLVM IR (-O0):
define i32 @str_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @SuperFastHash(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @str_hash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @SuperFastHash(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int my_putstr(char *str) {
  int h;
  int cmp;
  h = 0;
  cmp = 0;
  while (str[h] != '\0') {
    my_putchar(str[h]);
    h++;
    cmp++;
  }
  return (cmp);
}


x86 assembly (clang, -O0):
<my_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1167 <my_putstr+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <my_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <my_putstr+0x1a>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1138 <my_putstr+0x28>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <my_putchar@plt>
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <my_putstr+0x10>
jmp    113a <my_putstr+0x2a>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @my_putstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @my_putchar(i8 signext %18)
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @my_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i32 @my_putchar(i8 signext %6)
%9 = add nuw i64 %5, 1
%10 = add nuw nsw i32 %7, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int gz_check(const char *in, size_t inlen) {
  if (inlen < 10 || in[0] != 0x1f || in[1] != 0x8b || in[2] != 0x08)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<gz_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0xa,-0x18(%rbp)
jb     114b <gz_check+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1f,%eax
jne    114b <gz_check+0x4b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x8b,%eax
jne    114b <gz_check+0x4b>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x8,%eax
je     1157 <gz_check+0x57>
movl   $0x0,-0x4(%rbp)
jmp    115e <gz_check+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gz_check(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp ult i64 %6, 10
br i1 %7, label %26, label %8
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 31
br i1 %13, label %26, label %14
14: ; preds = %8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 139
br i1 %19, label %26, label %20
20: ; preds = %14
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 8
br i1 %25, label %26, label %27
26: ; preds = %20, %14, %8, %2
store i32 0, i32* %3
br label %28
27: ; preds = %20
store i32 1, i32* %3
br label %28
28: ; preds = %27, %26
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @gz_check(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void int64Copy(int64_t *dst, const int64_t *src) {
  assert(dst != NULL);
  assert(src != NULL);
  *dst = *src;
}


x86 assembly (clang, -O0):
<int64Copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int64Copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @int64Copy(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 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %4
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @int64Copy(i32* writeonly %0, i32* %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i32* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* %1
store i32 %9, i32* %0
ret void
}
void triexit(status) int status;
{ lush_error("error in triangle.o"); }


x86 assembly (clang, -O0):
<triexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <lush_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triexit>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <lush_error@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"error in triangle.o\00"
define void @triexit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @lush_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"error in triangle.o\00"
define void @triexit(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @lush_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *opus_alloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<opus_alloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @opus_alloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @opus_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
float square(float *cir_rad) {
  float *cir_ans;
  *cir_ans = ((*cir_rad * *cir_rad) * 3.14);
  return (*cir_ans);
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define float @square(float* %0) {
%2 = alloca float*
%3 = alloca float*
store float* %0, float** %2
%4 = load float*, float** %2
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = load float, float* %6
%8 = fmul float %5, %7
%9 = fpext float %8 to double
%10 = fmul double %9, 3.140000e+00
%11 = fptrunc double %10 to float
%12 = load float*, float** %3
store float %11, float* %12
%13 = load float*, float** %3
%14 = load float, float* %13
ret float %14
}

LLVM IR (-O2):
double projection(double xi, double lbi, double ubi) {
  if (xi < lbi) {
    return lbi;
  }
  if (xi > ubi) {
    return ubi;
  }
  return xi;
}


x86 assembly (clang, -O0):
<projection>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <projection+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <projection+0x5f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <projection+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <projection+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<projection>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @projection(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @projection(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int filesize(FILE *fp) {
  long pos;
  fseek(fp, 0, SEEK_END);
  pos = ftell(fp);
  fseek(fp, 0, SEEK_SET);
  return pos;
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @filesize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i64, i64* %3
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @filesize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
%7 = trunc i64 %4 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen_asm(char const *);
int main(int argc, char *argv[]) {
  const char *text = "Aaaaa bbb ccccc dddd!\n";
  int tsize;
  tsize = strlen_asm(text);
  printf("strlen_asm(\"Aaaaa bbb ccccc dddd!\") = %d\n", tsize);
  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)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen_asm@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"Aaaaa bbb ccccc dddd!\0A\00"
@.str.1 = [42 x i8] c"strlen_asm(\22Aaaaa bbb ccccc dddd!\22) = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @strlen_asm(i8* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Aaaaa bbb ccccc dddd!\0A\00"
@.str.1 = [42 x i8] c"strlen_asm(\22Aaaaa bbb ccccc dddd!\22) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @strlen_asm(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_close(int /*<<< orphan*/);
void PIC16F777_stop(void) {
  serial_close(0);
  ;
}


x86 assembly (clang, -O0):
<PIC16F777_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <serial_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC16F777_stop>:
xor    %edi,%edi
jmp    1030 <serial_close@plt>

LLVM IR (-O0):
define void @PIC16F777_stop() {
%1 = call i32 @serial_close(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC16F777_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
/* Variables and functions */
int rom_present(char *);
int s3_diamond_stealth64_964_available(void) {
  return rom_present(L"roms/video/s3/964_107h.rom");
}


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

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

LLVM IR (-O0):
@.str = [27 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 57, i32 54, i32 52, i32 95, i32 49, i32 48, i32 55, i32 104, i32 46, i32 114, i32 111, i32 109, i32 0]
define i32 @s3_diamond_stealth64_964_available() {
%1 = call i32 @rom_present(i8* bitcast ([27 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [27 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 57, i32 54, i32 52, i32 95, i32 49, i32 48, i32 55, i32 104, i32 46, i32 114, i32 111, i32 109, i32 0]
define i32 @s3_diamond_stealth64_964_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([27 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int check_strict_monotonicity(double *, int);
int test4() {
  double arr[] = {0.0, 1.0, 0.5};
  int n = 3;
  int i = check_strict_monotonicity(arr, n);
  return (i == 0);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x3,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <check_strict_monotonicity@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <check_strict_monotonicity@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test4.arr = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 5.000000e-01]
define i32 @test4() {
%1 = alloca [3 x double]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [3 x double]* %1 to i8*
store i32 3, i32* %2
%5 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @check_strict_monotonicity(double* %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@__const.test4.arr = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 5.000000e-01]
define i32 @test4() {
%1 = alloca [3 x double]
%2 = bitcast [3 x double]* %1 to i8*
%3 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%4 = call i32 @check_strict_monotonicity(double* %3, i32 3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint;

/* Variables and functions */
scalar_t__ clz(scalar_t__);
uint fls(uint x) { return sizeof(uint) * 8 - clz(x); }


x86 assembly (clang, -O0):
<fls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <clz@plt>
mov    %rax,%rcx
mov    $0x40,%eax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fls>:
push   %rax
call   1030 <clz@plt>
mov    $0x40,%ecx
sub    %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @fls(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @clz(i64 %3)
%5 = sub i64 64, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @fls(i64 %0) {
%2 = tail call i64 @clz(i64 %0)
%3 = sub i64 64, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ theDisplayCB();
void invokeDisplayCB(void) { theDisplayCB(); }


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

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

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

LLVM IR (-O2):
define void @invokeDisplayCB() {
%1 = tail call i32 (...) @theDisplayCB()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetInputWithGets();
int /*<<< orphan*/ GetInput_With_Fgets();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  printf("Try GetInputWithGets:\n");
  GetInputWithGets();
  fflush(stdin);
  printf("Try GetInput_With_Fgets:\n");
  GetInput_With_Fgets();
  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    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <GetInputWithGets@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <GetInput_With_Fgets@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <GetInputWithGets@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <GetInput_With_Fgets@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Try GetInputWithGets:\0A\00"
@stdin = global i32 0
@.str.1 = [26 x i8] c"Try GetInput_With_Fgets:\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 ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @GetInputWithGets()
%8 = load i32, i32* @stdin
%9 = call i32 @fflush(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (...) @GetInput_With_Fgets()
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [22 x i8] c"Try GetInputWithGets:\00"
@str.2 = [25 x i8] c"Try GetInput_With_Fgets:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @GetInputWithGets()
%5 = load i32, i32* @stdin
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
%8 = tail call i32 (...) @GetInput_With_Fgets()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ checkExtension(char *, char *);
size_t deserialize(char *);
int execute(size_t);
int /*<<< orphan*/ printf(char *, char *);
int __execute(char *filename) {
  size_t length;
  if (!checkExtension(filename, ".zzz")) {
    printf("Error: The file \"%s\" isn't zzz executable code.", filename);
    return 1;
  }
  length = deserialize(filename);
  return execute(length);
}


x86 assembly (clang, -O0):
<__execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <checkExtension@plt>
cmp    $0x0,%eax
jne    1181 <__execute+0x41>
mov    -0x10(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    119a <__execute+0x5a>
mov    -0x10(%rbp),%rdi
call   1050 <deserialize@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <execute@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__execute>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
call   1060 <checkExtension@plt>
test   %eax,%eax
je     1165 <__execute+0x25>
mov    %rbx,%rdi
call   1050 <deserialize@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <execute@plt>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c".zzz\00"
@.str.1 = [48 x i8] c"Error: The file \22%s\22 isn't zzz executable code.\00"
define i32 @__execute(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @checkExtension(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %9)
store i32 1, i32* %2
br label %16
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i64 @deserialize(i8* %12)
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = call i32 @execute(i64 %14)
store i32 %15, i32* %2
br label %16
16: ; preds = %11, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [5 x i8] c".zzz\00"
@.str.1 = [48 x i8] c"Error: The file \22%s\22 isn't zzz executable code.\00"
define i32 @__execute(i8* %0) {
%2 = tail call i32 @checkExtension(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
6: ; preds = %1
%7 = tail call i64 @deserialize(i8* %0)
%8 = tail call i32 @execute(i64 %7)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ %8, %6 ], [ 1, %4 ]
ret i32 %10
}
/* Variables and functions */
int yaffs_unmount2_common(int /*<<< orphan*/, char const *, int);
int yaffs_unmount2(const char *path, int force) {
  return yaffs_unmount2_common((0), path, force);
}


x86 assembly (clang, -O0):
<yaffs_unmount2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
call   1030 <yaffs_unmount2_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_unmount2>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_unmount2_common@plt>

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

LLVM IR (-O2):
define i32 @yaffs_unmount2(i8* %0, i32 %1) {
%3 = tail call i32 @yaffs_unmount2_common(i32 0, i8* %0, i32 %1)
ret i32 %3
}
int suma(int num1, int num2) { return num1 + num2; }


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

x86 assembly (clang, -O2):
<suma>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @suma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprint(char const *, int /*<<< orphan*/ *);
int fputc(char, int /*<<< orphan*/ *);
extern int fprintln(const char *str, FILE *stream) {
  if (-1 == fprint(str, stream))
    return -1;
  if (-1 == fputc('\n', stream))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<fprintln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fprint@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1158 <fprintln+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <fprintln+0x68>
mov    -0x18(%rbp),%rsi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1181 <fprintln+0x61>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <fprintln+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprintln>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fprint@plt>
cmp    $0xffffffff,%eax
je     1149 <fprintln+0x29>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fprintln(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i8*, i8** %4
%7 = load i32*, i32** %5
%8 = call i32 @fprint(i8* %6, i32* %7)
%9 = icmp eq i32 -1, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %17
11: ; preds = %2
%12 = load i32*, i32** %5
%13 = call i32 @fputc(i8 signext 10, i32* %12)
%14 = icmp eq i32 -1, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 -1, i32* %3
br label %17
16: ; preds = %11
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15, %10
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @fprintln(i8* %0, i32* %1) {
%3 = tail call i32 @fprint(i8* %0, i32* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @fputc(i8 signext 10, i32* %1)
%7 = icmp eq i32 %6, -1
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ _assert_true(unsigned long, char *, char *, int);
int /*<<< orphan*/ free(void *);
void free_value(const void *value, void *cleanup_value_data) {
  (void)cleanup_value_data;
  _assert_true(((unsigned long int)(((uintptr_t)((size_t)(value))))), "value",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/RoaringBitmap/CRoaring/refs/"
               "heads/master/tests/vendor/cmocka/cmocka.c",
               517);
  free((void *)value);
}


x86 assembly (clang, -O0):
<free_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    $0x205,%ecx
call   1040 <_assert_true@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_value>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
lea    0xed4(%rip),%rdx
mov    $0x205,%ecx
call   1040 <_assert_true@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"value\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RoaringBitmap/CRoaring/refs/heads/master/tests/vendor/cmocka/cmocka.c\00"
define void @free_value(i8* %0, i8* %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
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @_assert_true(i64 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 517)
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"value\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RoaringBitmap/CRoaring/refs/heads/master/tests/vendor/cmocka/cmocka.c\00"
define void @free_value(i8* %0, i8* nocapture readnone %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @_assert_true(i64 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 517)
%5 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
float CC3CyclicAngle(float);
float CC3SemiCyclicAngle(float angle) {
  float modAngle = CC3CyclicAngle(angle);
  if (modAngle > 180.0f) {
    return modAngle - 360.0f;
  }
  if (modAngle < -180.0f) {
    return modAngle + 360.0f;
  }
  return modAngle;
}


x86 assembly (clang, -O0):
<CC3SemiCyclicAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <CC3CyclicAngle@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xec7(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    115d <CC3SemiCyclicAngle+0x4d>
movss  -0xc(%rbp),%xmm0
movss  0xeb9(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1190 <CC3SemiCyclicAngle+0x80>
movss  0xe9f(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1186 <CC3SemiCyclicAngle+0x76>
movss  0xe91(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1190 <CC3SemiCyclicAngle+0x80>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CC3SemiCyclicAngle>:
push   %rax
call   1030 <CC3CyclicAngle@plt>
ucomiss 0xee3(%rip),%xmm0
jbe    1129 <CC3SemiCyclicAngle+0x19>
addss  0xee5(%rip),%xmm0
pop    %rax
ret
movss  0xed3(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    113e <CC3SemiCyclicAngle+0x2e>
addss  0xeca(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @CC3SemiCyclicAngle(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = call float @CC3CyclicAngle(float %5)
store float %6, float* %4
%7 = load float, float* %4
%8 = fcmp ogt float %7, 1.800000e+02
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load float, float* %4
%11 = fsub float %10, 3.600000e+02
store float %11, float* %2
br label %20
12: ; preds = %1
%13 = load float, float* %4
%14 = fcmp olt float %13, -1.800000e+02
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load float, float* %4
%17 = fadd float %16, 3.600000e+02
store float %17, float* %2
br label %20
18: ; preds = %12
%19 = load float, float* %4
store float %19, float* %2
br label %20
20: ; preds = %18, %15, %9
%21 = load float, float* %2
ret float %21
}

LLVM IR (-O2):
define float @CC3SemiCyclicAngle(float %0) {
%2 = tail call float @CC3CyclicAngle(float %0)
%3 = fcmp ogt float %2, 1.800000e+02
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = fadd float %2, -3.600000e+02
br label %10
6: ; preds = %1
%7 = fcmp olt float %2, -1.800000e+02
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = fadd float %2, 3.600000e+02
br label %10
10: ; preds = %6, %8, %4
%11 = phi float [ %5, %4 ], [ %9, %8 ], [ %2, %6 ]
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void *print_message_function(void *ptr) {
  char *message;
  message = (char *)ptr;
  printf("%s \n", message);
  return NULL;
}


x86 assembly (clang, -O0):
<print_message_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
define noalias i8* @print_message_function(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* null
}
/* Variables and functions */
int floor(float);
float roundToTenths(float number) { return floor(number * 10 + .5) / 10; }


x86 assembly (clang, -O0):
<roundToTenths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <floor@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundToTenths>:
push   %rax
mulss  0xee7(%rip),%xmm0
addss  0xee3(%rip),%xmm0
call   1030 <floor@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @roundToTenths(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.000000e+01
%5 = fpext float %4 to double
%6 = fadd double %5, 5.000000e-01
%7 = fptrunc double %6 to float
%8 = call i32 @floor(float %7)
%9 = sdiv i32 %8, 10
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @roundToTenths(float %0) {
%2 = fmul float %0, 1.000000e+01
%3 = fadd float %2, 5.000000e-01
%4 = tail call i32 @floor(float %3)
%5 = sdiv i32 %4, 10
%6 = sitofp i32 %5 to float
ret float %6
}
int main() {
  int a, b;
  int f[2] = {1, 2};
  enum foo { BAR = 15 };
  if (1) {
    a++;
    b++;
  }
  while (0) {
    a++;
    b++;
  }
  do {
    a++;
    b++;
  } while (0);
  for (;;) {
    a++;
    b++;
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1137 <main+0x37>
jmp    114e <main+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <main+0x28>
jmp    1153 <main+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116a <main+0x6a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0xc(%rbp)
jmp    116a <main+0x6a>

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

LLVM IR (-O0):
@__const.main.f = [2 x i32] [i32 1, i32 2]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 0, i32* %1
%5 = bitcast [2 x i32]* %4 to i8*
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
br label %10
10: ; preds = %11, %0
br i1 false, label %11, label %16
11: ; preds = %10
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %10
16: ; preds = %10
br label %17
17: ; preds = %16
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %22
22: ; preds = %17
br label %23
23: ; preds = %23, %22
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %23
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
void *dlmemalign(int, size_t);
void *dlvalloc(size_t bytes) { return dlmemalign((4096), bytes); }


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

x86 assembly (clang, -O2):
<dlvalloc>:
mov    %rdi,%rsi
mov    $0x1000,%edi
jmp    1030 <dlmemalign@plt>

LLVM IR (-O0):
define i8* @dlvalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @dlmemalign(i32 4096, i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @dlvalloc(i64 %0) {
%2 = tail call i8* @dlmemalign(i32 4096, i64 %0)
ret i8* %2
}
float myFunction1(int const *i, float **c) {
  int *a;
  if (i == a)
    return 5.0 * 3.0 * **c;
  else
    return 2.0 * 5.0;
}


x86 assembly (clang, -O0):
<myFunction1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1143 <myFunction1+0x43>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed7(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1150 <myFunction1+0x50>
movss  0xeb5(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @myFunction1(i32* %0, float** %1) {
%3 = alloca float
%4 = alloca i32*
%5 = alloca float**
%6 = alloca i32*
store i32* %0, i32** %4
store float** %1, float*** %5
%7 = load i32*, i32** %4
%8 = load i32*, i32** %6
%9 = icmp eq i32* %7, %8
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load float**, float*** %5
%12 = load float*, float** %11
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = fmul double 1.500000e+01, %14
%16 = fptrunc double %15 to float
store float %16, float* %3
br label %18
17: ; preds = %2
store float 1.000000e+01, float* %3
br label %18
18: ; preds = %17, %10
%19 = load float, float* %3
ret float %19
}

LLVM IR (-O2):
define float @myFunction1(i32* nocapture readnone %0, float** nocapture readnone %1) {
ret float 1.000000e+01
}
void XmbTextListToTextProperty() {}


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

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

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

LLVM IR (-O2):
define void @XmbTextListToTextProperty() {
ret void
}
int test7(int k) { return ~k < 3; }


x86 assembly (clang, -O0):
<test7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
cmp    $0x3,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7>:
xor    %eax,%eax
cmp    $0xfffffffd,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @test7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = icmp slt i32 %4, 3
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test7(i32 %0) {
%2 = icmp sgt i32 %0, -4
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
bool chars_is_lower(char c) { return 'a' <= c && c <= 'z'; }


x86 assembly (clang, -O0):
<chars_is_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <chars_is_lower+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_is_lower>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @chars_is_lower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @chars_is_lower(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}