xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int iso_hfsplus_xinfo_func(void *data, int flag) {
  if (flag == 1 && data != NULL)
    free(data);
  return 1;
}


x86 assembly (clang, -O0):
<iso_hfsplus_xinfo_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    113d <iso_hfsplus_xinfo_func+0x2d>
cmpq   $0x0,-0x8(%rbp)
je     113d <iso_hfsplus_xinfo_func+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_hfsplus_xinfo_func>:
test   %rdi,%rdi
je     1124 <iso_hfsplus_xinfo_func+0x14>
cmp    $0x1,%esi
jne    1124 <iso_hfsplus_xinfo_func+0x14>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @iso_hfsplus_xinfo_func(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = icmp ne i8* %0, null
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @free(i8* %0)
br label %8
8: ; preds = %6, %2
ret i32 1
}
int IsLeapYear(int year) {
  return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}


x86 assembly (clang, -O0):
<IsLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
je     1153 <IsLeapYear+0x53>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <IsLeapYear+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsLeapYear>:
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
jb     1121 <IsLeapYear+0x21>
xor    %eax,%eax
test   $0x3,%dil
je     1127 <IsLeapYear+0x27>
ret
mov    $0x1,%eax
ret
ror    $0x2,%ecx
xor    %eax,%eax
cmp    $0x28f5c29,%ecx
setae  %al
ret

LLVM IR (-O0):
define i32 @IsLeapYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 400
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 100
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @IsLeapYear(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i32 %0, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 100
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
int gpi_exif_stat(void *exifdata) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @gpi_exif_stat(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int to(int, int);
int opa_unicode_to_lower(int codepoint) { return to(1, codepoint); }


x86 assembly (clang, -O0):
<opa_unicode_to_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <to@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opa_unicode_to_lower>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <to@plt>

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

LLVM IR (-O2):
define i32 @opa_unicode_to_lower(i32 %0) {
%2 = tail call i32 @to(i32 1, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ test();
int main(int c, char **v, char **e) {
  test();
  getchar();
  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)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <test@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 (...) @test()
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @test()
%5 = tail call i32 (...) @getchar()
ret i32 0
}
void UCRCConfig(unsigned long ulBase, unsigned long ulType) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ulType;
}


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

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

LLVM IR (-O0):
define void @UCRCConfig(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 0
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @UCRCConfig(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, double *, int);
uint64_t float64_to_uint64(double d) {
  uint64_t u64;
  assert((sizeof(double) == sizeof(uint64_t)));
  memcpy(&u64, &d, sizeof(double));
  return u64;
}


x86 assembly (clang, -O0):
<float64_to_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
lea    -0xc(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float64_to_uint64>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
xor    %edi,%edi
call   1030 <assert@plt>
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @float64_to_uint64(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = call i32 @assert(i32 0)
%5 = call i32 @memcpy(i32* %3, double* %2, i32 8)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @float64_to_uint64(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @assert(i32 0)
%6 = call i32 @memcpy(i32* %3, double* %2, i32 8)
%7 = load i32, i32* %3
ret i32 %7
}
char *cio_file_st_get_hash(char *map) { return map + 2; }


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

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

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

LLVM IR (-O2):
define i8* @cio_file_st_get_hash(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun_ctor() {
  printf("fun_ctor"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"fun_ctor\00"
define void @fun_ctor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_E0int8_reg(signed char val) {
  return ((val) & (-0xE0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E0int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff20,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E0int8_reg>:
test   $0xffffff20,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E0int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -224
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int serwer();
int main(int argc, const char *argv[]) {
  int wynik = serwer();
  return wynik;
}


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    $0x0,%al
call   1030 <serwer@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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
%7 = call i32 (...) @serwer()
store i32 %7, i32* %6
%8 = load i32, i32* %6
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @serwer()
ret i32 %3
}
int fail_on_purpose(const char *msg) { return 1; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int /*<<< orphan*/ strerror(int);
void checked_unlock(pthread_mutex_t *m) {
  int err = pthread_mutex_unlock(m);
  if (err != 0) {
    errx(1, "Failed to unlock a mutex: %s", strerror(err));
  }
}


x86 assembly (clang, -O0):
<checked_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116d <checked_unlock+0x3d>
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe98(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_unlock>:
push   %rax
call   1040 <pthread_mutex_unlock@plt>
test   %eax,%eax
je     1155 <checked_unlock+0x25>
mov    %eax,%edi
call   1050 <strerror@plt>
lea    0xeb8(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
pop    %rax
jmp    1030 <errx@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Failed to unlock a mutex: %s\00"
define void @checked_unlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_unlock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Failed to unlock a mutex: %s\00"
define void @checked_unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @strerror(i32 %2)
%6 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int M_PI;
float rad_to_deg(float radians) { return radians / (M_PI / 180); }


x86 assembly (clang, -O0):
<rad_to_deg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad_to_deg>:
mov    0x2ee1(%rip),%rax
movslq (%rax),%rax
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x7,%ecx
add    %eax,%ecx
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @rad_to_deg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load i32, i32* @M_PI
%5 = sdiv i32 %4, 180
%6 = sitofp i32 %5 to float
%7 = fdiv float %3, %6
ret float %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @rad_to_deg(float %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 %2, 180
%4 = sitofp i32 %3 to float
%5 = fdiv float %0, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ se_write_read_bytes(char *, int, char *, int);
void se_resetanswer(void) {
  printf("Reset answer\n");
  char cmd = 0x2F;
  char in[16];
  se_write_read_bytes(&cmd, 1, in, 16);
}


x86 assembly (clang, -O0):
<se_resetanswer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movb   $0x2f,-0x1(%rbp)
lea    -0x20(%rbp),%rdx
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
mov    $0x10,%ecx
call   1040 <se_write_read_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<se_resetanswer>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
movb   $0x2f,0xf(%rsp)
lea    0xf(%rsp),%rdi
lea    0x10(%rsp),%rdx
mov    $0x1,%esi
mov    $0x10,%ecx
call   1040 <se_write_read_bytes@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Reset answer\0A\00"
define void @se_resetanswer() {
%1 = alloca i8
%2 = alloca [16 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8 47, i8* %1
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @se_write_read_bytes(i8* %1, i32 1, i8* %4, i32 16)
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Reset answer\00"
define void @se_resetanswer() {
%1 = alloca i8
%2 = alloca [16 x i8]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
store i8 47, i8* %1
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @se_write_read_bytes(i8* %1, i32 1, i8* %4, i32 16)
ret void
}
/* Variables and functions */
int abs(int);
double getSaturation(double delta, double light) {
  double saturation;
  if (delta == 0)
    saturation = 0;
  else
    saturation = delta / (1 - abs(2 * light - 1));
  return saturation;
}


x86 assembly (clang, -O0):
<getSaturation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <getSaturation+0x37>
jp     1147 <getSaturation+0x37>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    118a <getSaturation+0x7a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xe9e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <abs@plt>
movsd  -0x20(%rbp),%xmm0
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSaturation>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    1111 <getSaturation+0x11>
jp     1111 <getSaturation+0x11>
movapd %xmm2,%xmm0
ret
addsd  %xmm1,%xmm1
addsd  0xee3(%rip),%xmm1
cvttsd2si %xmm1,%eax
mov    %eax,%ecx
neg    %ecx
cmovns %eax,%ecx
add    $0x1,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @getSaturation(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store double 0.000000e+00, double* %5
br label %18
9: ; preds = %2
%10 = load double, double* %3
%11 = load double, double* %4
%12 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %11, double -1.000000e+00)
%13 = fptosi double %12 to i32
%14 = call i32 @abs(i32 %13)
%15 = sub nsw i32 1, %14
%16 = sitofp i32 %15 to double
%17 = fdiv double %10, %16
store double %17, double* %5
br label %18
18: ; preds = %9, %8
%19 = load double, double* %5
ret double %19
}

LLVM IR (-O2):
define double @getSaturation(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = tail call double @llvm.fmuladd.f64(double %1, double 2.000000e+00, double -1.000000e+00)
%6 = fptosi double %5 to i32
%7 = tail call i32 @llvm.abs.i32(i32 %6, i1 true)
%8 = sub nsw i32 1, %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %0, %9
br label %11
11: ; preds = %2, %4
%12 = phi double [ %10, %4 ], [ 0.000000e+00, %2 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ cblas_dswap(int const, double *, int const, double *,
                               int const);
void c_dswap(const int N, double *X, const int strideX, double *Y,
             const int strideY) {
  cblas_dswap(N, X, strideX, Y, strideY);
}


x86 assembly (clang, -O0):
<c_dswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <cblas_dswap@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_dswap>:
jmp    1030 <cblas_dswap@plt>

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

LLVM IR (-O2):
define void @c_dswap(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = tail call i32 @cblas_dswap(i32 %0, double* %1, i32 %2, double* %3, i32 %4)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ same_screen;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcrossing_same_screen(void *_p) {
  return (int)((XEvent *)_p)->xcrossing.same_screen;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xcrossing_same_screen(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ setArgs(int, char **);
int main(int argc, char *argv[]) {
  setArgs(argc, argv);
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <setArgs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <setArgs@plt>
xor    %eax,%eax
pop    %rcx
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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @setArgs(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @setArgs(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ picint(int);
int /*<<< orphan*/ picintc(int);
void pit_irq0_timer(int new_out, int old_out) {
  if (new_out && !old_out)
    picint(1);
  if (!new_out)
    picintc(1);
}


x86 assembly (clang, -O0):
<pit_irq0_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114c <pit_irq0_timer+0x2c>
cmpl   $0x0,-0x8(%rbp)
jne    114c <pit_irq0_timer+0x2c>
mov    $0x1,%edi
call   1030 <picint@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1160 <pit_irq0_timer+0x40>
mov    $0x1,%edi
call   1040 <picintc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pit_irq0_timer>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
je     1135 <pit_irq0_timer+0x15>
test   %esi,%esi
jne    1135 <pit_irq0_timer+0x15>
mov    $0x1,%edi
call   1030 <picint@plt>
test   %ebx,%ebx
je     113b <pit_irq0_timer+0x1b>
pop    %rbx
ret
mov    $0x1,%edi
pop    %rbx
jmp    1040 <picintc@plt>

LLVM IR (-O0):
define void @pit_irq0_timer(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, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = call i32 @picint(i32 1)
br label %12
12: ; preds = %10, %7, %2
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = call i32 @picintc(i32 1)
br label %17
17: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
define void @pit_irq0_timer(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @picint(i32 1)
br label %8
8: ; preds = %6, %2
br i1 %3, label %9, label %11
9: ; preds = %8
%10 = tail call i32 @picintc(i32 1)
br label %11
11: ; preds = %9, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void alarm_handler(int signo) {
  fprintf(stderr, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/bjorng/otp/refs/heads/"
                  "maint/erts/test/erlexec_SUITE_data/erlexec_tests.c"
                  " self terminating after timeout\n");
  exit(1);
}


x86 assembly (clang, -O0):
<alarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<alarm_handler>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [195 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bjorng/otp/refs/heads/maint/erts/test/erlexec_SUITE_data/erlexec_tests.c self terminating after timeout\0A\00"
define void @alarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [195 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bjorng/otp/refs/heads/maint/erts/test/erlexec_SUITE_data/erlexec_tests.c self terminating after timeout\0A\00"
define void @alarm_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char toupper(unsigned char);
char nat_toupper(char a) { return toupper((unsigned char)a); }


x86 assembly (clang, -O0):
<nat_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nat_toupper>:
movzbl %dil,%edi
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define signext i8 @nat_toupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @toupper(i8 zeroext %3)
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @nat_toupper(i8 signext %0) {
%2 = tail call signext i8 @toupper(i8 zeroext %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned char);
void update_cursor(int row, int col) {
  unsigned short position = (row * 80) + col;
  outb(0x3D4, 0x0F);
  outb(0x3D5, (unsigned char)(position & 0xFF));
  outb(0x3D4, 0x0E);
  outb(0x3D5, (unsigned char)((position >> 8) & 0xFF));
}


x86 assembly (clang, -O0):
<update_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x50,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %ax,-0xa(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_cursor>:
push   %rbx
lea    (%rdi,%rdi,4),%ebx
shl    $0x4,%ebx
add    %esi,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @update_cursor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 80
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %5
%11 = call i32 @outb(i32 980, i8 zeroext 15)
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = call i32 @outb(i32 981, i8 zeroext %15)
%17 = call i32 @outb(i32 980, i8 zeroext 14)
%18 = load i16, i16* %5
%19 = zext i16 %18 to i32
%20 = ashr i32 %19, 8
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = call i32 @outb(i32 981, i8 zeroext %22)
ret void
}

LLVM IR (-O2):
define void @update_cursor(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 80
%4 = add nsw i32 %3, %1
%5 = tail call i32 @outb(i32 980, i8 zeroext 15)
%6 = trunc i32 %4 to i8
%7 = tail call i32 @outb(i32 981, i8 zeroext %6)
%8 = tail call i32 @outb(i32 980, i8 zeroext 14)
%9 = lshr i32 %4, 8
%10 = trunc i32 %9 to i8
%11 = tail call i32 @outb(i32 981, i8 zeroext %10)
ret void
}
void FreeMatrixd(double **matptr) {
  free(matptr[0]);
  free(matptr);
}


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

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

LLVM IR (-O0):
define void @FreeMatrixd(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 0
%5 = load double*, double** %4
%6 = bitcast double* %5 to i8*
%7 = load double**, double*** %2
%8 = bitcast double** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @FreeMatrixd(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret void
}
extern unsigned int hweight32(unsigned int w) {
  unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
  res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
  res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F);
  res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF);
  return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF);
}


x86 assembly (clang, -O0):
<hweight32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x33333333,%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0f0f0f,%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf0f0f0f,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff00ff,%eax
mov    -0x8(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    -0x8(%rbp),%ecx
shr    $0x10,%ecx
and    $0xffff,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight32>:
mov    %edi,%eax
and    $0x55555555,%eax
shr    %edi
and    $0x55555555,%edi
add    %edi,%eax
mov    %eax,%ecx
and    $0x33333333,%ecx
shr    $0x2,%eax
and    $0x33333333,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x7070707,%ecx
shr    $0x4,%eax
and    $0x7070707,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0xf000f,%ecx
shr    $0x8,%eax
and    $0xf000f,%eax
add    %ecx,%eax
movzwl %ax,%ecx
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hweight32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = and i32 %7, 1431655765
%9 = add i32 %5, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = and i32 %10, 858993459
%12 = load i32, i32* %3
%13 = lshr i32 %12, 2
%14 = and i32 %13, 858993459
%15 = add i32 %11, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = and i32 %16, 252645135
%18 = load i32, i32* %3
%19 = lshr i32 %18, 4
%20 = and i32 %19, 252645135
%21 = add i32 %17, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = and i32 %22, 16711935
%24 = load i32, i32* %3
%25 = lshr i32 %24, 8
%26 = and i32 %25, 16711935
%27 = add i32 %23, %26
store i32 %27, i32* %3
%28 = load i32, i32* %3
%29 = and i32 %28, 65535
%30 = load i32, i32* %3
%31 = lshr i32 %30, 16
%32 = and i32 %31, 65535
%33 = add i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @hweight32(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1431655765
%5 = add nuw i32 %4, %2
%6 = and i32 %5, 858993459
%7 = lshr i32 %5, 2
%8 = and i32 %7, 858993459
%9 = add nuw nsw i32 %8, %6
%10 = and i32 %9, 117901063
%11 = lshr i32 %9, 4
%12 = and i32 %11, 117901063
%13 = add nuw nsw i32 %12, %10
%14 = and i32 %13, 983055
%15 = lshr i32 %13, 8
%16 = and i32 %15, 983055
%17 = add nuw nsw i32 %16, %14
%18 = and i32 %17, 31
%19 = lshr i32 %17, 16
%20 = add nuw nsw i32 %18, %19
ret i32 %20
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ sysdie(char *, unsigned long, char const *, int);
void *x_malloc(size_t size, const char *file, int line) {
  void *p;
  p = malloc(size);
  if (p == NULL)
    sysdie("failed to malloc %lu bytes at %s line %d", (unsigned long)size,
           file, line);
  return p;
}


x86 assembly (clang, -O0):
<x_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1162 <x_malloc+0x42>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xea3(%rip),%rdi
call   1030 <sysdie@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_malloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1152 <x_malloc+0x32>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <sysdie@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"failed to malloc %lu bytes at %s line %d\00"
define i8* @x_malloc(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i64, i64* %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @sysdie(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %13, i8* %14, i32 %15)
br label %17
17: ; preds = %12, %3
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
@.str = [41 x i8] c"failed to malloc %lu bytes at %s line %d\00"
define noalias i8* @x_malloc(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @sysdie(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %0, i8* %1, i32 %2)
br label %8
8: ; preds = %6, %3
ret i8* %4
}
float interpolate(float a, float b, float alpha) {
  return a * (1 - alpha) + b * alpha;
}


x86 assembly (clang, -O0):
<interpolate>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee0(%rip),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @interpolate(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fsub float 1.000000e+00, %8
%10 = load float, float* %5
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %7, float %9, float %12)
ret float %13
}

LLVM IR (-O2):
define float @interpolate(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %5)
ret float %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t rol32(uint32_t a, uint8_t r) { return (a << r) | (a >> (32 - r)); }


x86 assembly (clang, -O0):
<rol32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol32>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
int ft_recursive_factorial(int nb) {
  if (nb < 0 || nb >= 13)
    return (0);
  else if (nb == 0)
    return (1);
  else
    return (ft_recursive_factorial(nb - 1) * nb);
}


x86 assembly (clang, -O0):
<ft_recursive_factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112f <ft_recursive_factorial+0x1f>
cmpl   $0xd,-0x8(%rbp)
jl     113b <ft_recursive_factorial+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1163 <ft_recursive_factorial+0x53>
cmpl   $0x0,-0x8(%rbp)
jne    1151 <ft_recursive_factorial+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1163 <ft_recursive_factorial+0x53>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <ft_recursive_factorial@plt>
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_recursive_factorial>:
xor    %eax,%eax
cmp    $0xc,%edi
ja     1134 <ft_recursive_factorial+0x34>
lea    -0xe(%rdi),%edx
mov    $0x1,%ecx
mov    $0x1,%eax
mov    %edi,%esi
cs nopw 0x0(%rax,%rax,1)
sub    $0x1,%esi
jb     1131 <ft_recursive_factorial+0x31>
imul   %edi,%eax
mov    %esi,%edi
cmp    $0xfffffff2,%edx
ja     1120 <ft_recursive_factorial+0x20>
xor    %ecx,%ecx
imul   %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_recursive_factorial(i32 %0) {
%2 = icmp ugt i32 %0, 12
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = add i32 %0, -14
%5 = icmp ult i32 %4, -13
br label %6
6: ; preds = %3, %10
%7 = phi i32 [ %11, %10 ], [ %0, %3 ]
%8 = phi i32 [ %12, %10 ], [ 1, %3 ]
%9 = icmp eq i32 %7, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = add nsw i32 %7, -1
%12 = mul nsw i32 %7, %8
br i1 %5, label %13, label %6
13: ; preds = %6, %10
%14 = phi i32 [ %12, %10 ], [ %8, %6 ]
%15 = phi i32 [ 0, %10 ], [ 1, %6 ]
%16 = mul nuw nsw i32 %15, %14
br label %17
17: ; preds = %13, %1
%18 = phi i32 [ %16, %13 ], [ 0, %1 ]
ret i32 %18
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_write_standard_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(21, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_write_standard_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x15,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_write_standard_system>:
mov    $0x15,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_write_standard_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 21, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_write_standard_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 21, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double coshl(long double x) { return __infer_nondet_long_double(); }


x86 assembly (clang, -O0):
<coshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @coshl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @coshl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ original_free(void *);
void xfree(void *ptr) { original_free(ptr); }


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

x86 assembly (clang, -O2):
<xfree>:
jmp    1030 <original_free@plt>

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = tail call i32 @original_free(i8* %0)
ret void
}
void irq_enable(void) { asm volatile("sti" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @irq_enable() {
tail call void asm sideeffect "sti", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ floats_mat44_inv(float const *, float *);
int /*<<< orphan*/ floats_mat44_transform_xyz(float *, float const *, float *);
void floats_mat44_inv_transform_xyz(const float M[16], const float in[3],
                                    float out[3]) {
  float T[16];
  floats_mat44_inv(M, T);
  floats_mat44_transform_xyz(T, in, out);
}


x86 assembly (clang, -O0):
<floats_mat44_inv_transform_xyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <floats_mat44_inv@plt>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <floats_mat44_transform_xyz@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_mat44_inv_transform_xyz>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rsp,%r15
mov    %r15,%rsi
call   1030 <floats_mat44_inv@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <floats_mat44_transform_xyz@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @floats_mat44_inv_transform_xyz(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
%7 = alloca [16 x float]
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%8 = load float*, float** %4
%9 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 0
%10 = call i32 @floats_mat44_inv(float* %8, float* %9)
%11 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 0
%12 = load float*, float** %5
%13 = load float*, float** %6
%14 = call i32 @floats_mat44_transform_xyz(float* %11, float* %12, float* %13)
ret void
}

LLVM IR (-O2):
define void @floats_mat44_inv_transform_xyz(float* %0, float* %1, float* %2) {
%4 = alloca [16 x float]
%5 = bitcast [16 x float]* %4 to i8*
%6 = getelementptr inbounds [16 x float], [16 x float]* %4, i64 0, i64 0
%7 = call i32 @floats_mat44_inv(float* %0, float* %6)
%8 = call i32 @floats_mat44_transform_xyz(float* %6, float* %1, float* %2)
ret void
}
void deallocate_FileHeader(struct FileHeader *v) {}


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

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

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

LLVM IR (-O2):
%struct.FileHeader = type opaque
define void @deallocate_FileHeader(%struct.FileHeader* nocapture %0) {
ret void
}
/* Variables and functions */
long hs_refcount(void const *, size_t, int /*<<< orphan*/);
long refcount(const void *p, size_t s) { return hs_refcount(p, s - 1, 0); }


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

x86 assembly (clang, -O2):
<refcount>:
add    $0xffffffffffffffff,%rsi
xor    %edx,%edx
jmp    1030 <hs_refcount@plt>

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

LLVM IR (-O2):
define i64 @refcount(i8* %0, i64 %1) {
%3 = add i64 %1, -1
%4 = tail call i64 @hs_refcount(i8* %0, i64 %3, i32 0)
ret i64 %4
}