xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t stdlib_ndarray_set_ptr_float32(uint8_t *idx, const float v) {
  *(float *)idx = v;
  return 0;
}


x86 assembly (clang, -O0):
<stdlib_ndarray_set_ptr_float32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_ndarray_set_ptr_float32>:
movss  %xmm0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @stdlib_ndarray_set_ptr_float32(i32* %0, float %1) {
%3 = alloca i32*
%4 = alloca float
store i32* %0, i32** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load i32*, i32** %3
%7 = bitcast i32* %6 to float*
store float %5, float* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @stdlib_ndarray_set_ptr_float32(i32* nocapture writeonly %0, float %1) {
%3 = bitcast i32* %0 to float*
store float %1, float* %3
ret i32 0
}
int *list3(x, y, z)
int *y, *z;
{
  int *p = newvec(2);
  p[0] = x;
  p[1] = (int)y;
  p[2] = (int)z;
  return p;
}


x86 assembly (clang, -O0):
<list3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <newvec@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list3>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x2,%edi
xor    %eax,%eax
call   1030 <newvec@plt>
cltq
mov    %ebp,(%rax)
mov    %ebx,0x4(%rax)
mov    %r14d,0x8(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32* @list3(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = call i32 (i32, ...) bitcast (i32 (...)* @newvec to i32 (i32, ...)*)(i32 2)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %7
%11 = load i32, i32* %4
%12 = load i32*, i32** %7
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %11, i32* %13
%14 = load i32*, i32** %5
%15 = ptrtoint i32* %14 to i32
%16 = load i32*, i32** %7
%17 = getelementptr inbounds i32, i32* %16, i64 1
store i32 %15, i32* %17
%18 = load i32*, i32** %6
%19 = ptrtoint i32* %18 to i32
%20 = load i32*, i32** %7
%21 = getelementptr inbounds i32, i32* %20, i64 2
store i32 %19, i32* %21
%22 = load i32*, i32** %7
ret i32* %22
}

LLVM IR (-O2):
define i32* @list3(i32 %0, i32* %1, i32* %2) {
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @newvec to i32 (i32, ...)*)(i32 2)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store i32 %0, i32* %6
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = getelementptr inbounds i32, i32* %6, i64 1
store i32 %8, i32* %9
%10 = ptrtoint i32* %2 to i64
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds i32, i32* %6, i64 2
store i32 %11, i32* %12
ret i32* %6
}
void hvt_drop_privileges() {}


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

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

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

LLVM IR (-O2):
define void @hvt_drop_privileges() {
ret void
}
void GetRowOfPosition(long p_position, long *r_row) {
  *r_row = ((p_position / 1000) % 10000) + 1;
}


x86 assembly (clang, -O0):
<GetRowOfPosition>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    $0x2710,%ecx
cqto
idiv   %rcx
add    $0x1,%rdx
mov    -0x10(%rbp),%rax
mov    %rdx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRowOfPosition>:
mov    %rdi,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rcx
add    %rax,%rcx
movabs $0x346dc5d63886594b,%rdx
c5 6d 34
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xb,%rdx
add    %rax,%rdx
imul   $0x2710,%rdx,%rax
sub    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define void @GetRowOfPosition(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i64, i64* %3
%6 = sdiv i64 %5, 1000
%7 = srem i64 %6, 10000
%8 = add nsw i64 %7, 1
%9 = load i64*, i64** %4
store i64 %8, i64* %9
ret void
}

LLVM IR (-O2):
define void @GetRowOfPosition(i64 %0, i64* nocapture writeonly %1) {
%3 = sdiv i64 %0, 1000
%4 = srem i64 %3, 10000
%5 = add nsw i64 %4, 1
store i64 %5, i64* %1
ret void
}
int test_imm_58int64_highword_reg(long long val) {
  return ((val >> 32) & (0x58 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_58int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x58,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_58int64_highword_reg>:
movabs $0x5800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_58int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 88
%6 = icmp ne i64 %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_58int64_highword_reg(i64 %0) {
%2 = and i64 %0, 377957122048
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main01() {
  char c;
  c = 'a';
  printf("%c\n", c);
  c = 'D';
  c = c + 32;
  printf("%c\n", c);
  c = '9';
  c = c - '0';
  printf("%d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x1(%rbp)
lea    0xedd(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
movb   $0x44,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
lea    0xebf(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
movb   $0x39,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
lea    0xea5(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main01>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main01() {
%1 = alloca i8
store i8 97, i8* %1
%2 = load i8, i8* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %2)
store i8 68, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 32
%7 = trunc i32 %6 to i8
store i8 %7, i8* %1
%8 = load i8, i8* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
store i8 57, i8* %1
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 48
%13 = trunc i32 %12 to i8
store i8 %13, i8* %1
%14 = load i8, i8* %1
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main01() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 97)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 100)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 9)
ret i32 0
}
/* Variables and functions */
scalar_t__ COND_MI();
int /*<<< orphan*/ EA_AY_AI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_smi_8_ai(void) {
  m68ki_write_8(EA_AY_AI_8(), COND_MI() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_smi_8_ai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_AI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_MI@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_smi_8_ai>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_AI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_MI@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_smi_8_ai() {
%1 = call i32 (...) @EA_AY_AI_8()
%2 = call i64 (...) @COND_MI()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_smi_8_ai() {
%1 = tail call i32 (...) @EA_AY_AI_8()
%2 = tail call i64 (...) @COND_MI()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
void get_memory(char *p, int num) { p = (char *)malloc(sizeof(char) * num); }


x86 assembly (clang, -O0):
<get_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_memory>:
mov    %esi,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @get_memory(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 = sext i32 %5 to i64
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
ret void
}

LLVM IR (-O2):
define void @get_memory(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i64 @malloc(i32 %1)
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int /*<<< orphan*/ strcmp(int /*<<< orphan*/, char *);
int filter(const struct dirent *ent) {
  if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     1152 <filter+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    115e <filter+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1165 <filter+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
lea    0xee4(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     113f <filter+0x2f>
mov    (%rbx),%edi
lea    0xed1(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define i32 @filter(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @strcmp(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load %struct.dirent*, %struct.dirent** %3
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcmp(i32 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %9, %1
store i32 0, i32* %2
br label %17
16: ; preds = %9
store i32 1, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define i32 @filter(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @strcmp(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = tail call i32 @strcmp(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %1
%12 = phi i32 [ 0, %1 ], [ %10, %6 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ ReadUint64Be(void const *, int /*<<< orphan*/ *);
int32_t ReadInt64Be(const void *in, int64_t *value) {
  return ReadUint64Be(in, (uint64_t *)value);
}


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

x86 assembly (clang, -O2):
<ReadInt64Be>:
jmp    1030 <ReadUint64Be@plt>

LLVM IR (-O0):
define i32 @ReadInt64Be(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 @ReadUint64Be(i8* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ReadInt64Be(i8* %0, i32* %1) {
%3 = tail call i32 @ReadUint64Be(i8* %0, i32* %1)
ret i32 %3
}
void CRYPTO_realloc(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_realloc() {
ret void
}
int is_even(int num) { return (!(num % 2)); }


x86 assembly (clang, -O0):
<is_even>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_even>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_even(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_even(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
int rounding(double x) {
  int q;
  double temp;
  temp = (int)x;
  temp = x - temp;
  if (temp > 0.5)
    q = (int)x + 1;
  else if (temp < -0.5)
    q = (int)x - 1;
  else
    q = (int)x;
  return q;
}


x86 assembly (clang, -O0):
<rounding>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xecd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <rounding+0x4d>
cvttsd2si -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117d <rounding+0x7d>
movsd  0xeb3(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1170 <rounding+0x70>
cvttsd2si -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1178 <rounding+0x78>
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    117d <rounding+0x7d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rounding>:
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
ucomisd 0xee8(%rip),%xmm0
jbe    111e <rounding+0x1e>
add    $0x1,%eax
ret
movsd  0xee2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    112f <rounding+0x2f>
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @rounding(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fptosi double %5 to i32
%7 = sitofp i32 %6 to double
store double %7, double* %4
%8 = load double, double* %2
%9 = load double, double* %4
%10 = fsub double %8, %9
store double %10, double* %4
%11 = load double, double* %4
%12 = fcmp ogt double %11, 5.000000e-01
br i1 %12, label %13, label %17
13: ; preds = %1
%14 = load double, double* %2
%15 = fptosi double %14 to i32
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %28
17: ; preds = %1
%18 = load double, double* %4
%19 = fcmp olt double %18, -5.000000e-01
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load double, double* %2
%22 = fptosi double %21 to i32
%23 = sub nsw i32 %22, 1
store i32 %23, i32* %3
br label %27
24: ; preds = %17
%25 = load double, double* %2
%26 = fptosi double %25 to i32
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %20
br label %28
28: ; preds = %27, %13
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @rounding(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
%5 = fcmp ogt double %4, 5.000000e-01
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = add nsw i32 %2, 1
br label %12
8: ; preds = %1
%9 = fcmp olt double %4, -5.000000e-01
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = add nsw i32 %2, -1
br label %12
12: ; preds = %8, %10, %6
%13 = phi i32 [ %7, %6 ], [ %11, %10 ], [ %2, %8 ]
ret i32 %13
}
int f(int x) {
  if (x <= 2)
    return 1;
  return f(x - 1) + f(x - 2);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     1131 <f+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <f+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jl     1145 <f+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <f@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
ja     1130 <f+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @f(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 5
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
int slti(int register2, int number) {
  if (register2 < number) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<slti>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <slti+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <slti+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slti>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @slti(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x64() {
  Assert_real((isascii(100)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              505, ("isascii should be 1 for d"));
}


x86 assembly (clang, -O0):
<t_isascii_0x64>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1f9,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x64>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x1f9,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for d\00"
define void @t_isascii_0x64() {
%1 = call i32 @isascii(i32 100)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for d\00"
define void @t_isascii_0x64() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void return_unwind(void) {}


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

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

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

LLVM IR (-O2):
define void @return_unwind() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void f2(void) {
  typedef int int_arr[3];
  typedef int(*int_arr_ptr)[3];
  int_arr arr1;
  int_arr_ptr arr1_ptr;
  arr1_ptr = &arr1;
  (*arr1_ptr)[0] = 'a';
  (*arr1_ptr)[1] = 'b';
  (*arr1_ptr)[2] = 'c';
  putchar(arr1[0]);
  putchar(arr1[1]);
  putchar(arr1[2]);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x61,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x62,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x63,0x8(%rax)
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x62,%edi
call   1030 <putchar@plt>
mov    $0x63,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @f2() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]*
store [3 x i32]* %1, [3 x i32]** %2
%3 = load [3 x i32]*, [3 x i32]** %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 97, i32* %4
%5 = load [3 x i32]*, [3 x i32]** %2
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 98, i32* %6
%7 = load [3 x i32]*, [3 x i32]** %2
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 2
store i32 99, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%10 = load i32, i32* %9
%11 = call i32 @putchar(i32 %10)
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%13 = load i32, i32* %12
%14 = call i32 @putchar(i32 %13)
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%16 = load i32, i32* %15
%17 = call i32 @putchar(i32 %16)
ret void
}

LLVM IR (-O2):
define void @f2() {
%1 = tail call i32 @putchar(i32 97)
%2 = tail call i32 @putchar(i32 98)
%3 = tail call i32 @putchar(i32 99)
ret void
}
char *microbit_end_of_rom() { return (char *)0x40000; }


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

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

LLVM IR (-O0):
define i8* @microbit_end_of_rom() {
ret i8* inttoptr (i64 262144 to i8*)
}

LLVM IR (-O2):
define i8* @microbit_end_of_rom() {
ret i8* inttoptr (i64 262144 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int getDraws(int);
int getNumbers();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printDrawnNumbers(int, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  int arrlength = getNumbers();
  int numbersToDraw = getDraws(arrlength);
  printDrawnNumbers(numbersToDraw, arrlength);
  fflush(stdin);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1090 <getNumbers@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <getDraws@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <printDrawnNumbers@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1090 <getNumbers@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <getDraws@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <printDrawnNumbers@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
%6 = call i32 (...) @getNumbers()
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @getDraws(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = call i32 @printDrawnNumbers(i32 %9, i32 %10)
%12 = load i32, i32* @stdin
%13 = call i32 @fflush(i32 %12)
%14 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @getNumbers()
%4 = tail call i32 @getDraws(i32 %3)
%5 = tail call i32 @printDrawnNumbers(i32 %4, i32 %3)
%6 = load i32, i32* @stdin
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int /*<<< orphan*/, int, int);
void C67_INTSP(int r, int v) { C67_asm("INTSP.L", 0, r, v); }


x86 assembly (clang, -O0):
<C67_INTSP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdi
xor    %esi,%esi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_INTSP>:
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee5(%rip),%rdi
xor    %esi,%esi
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"INTSP.L\00"
define void @C67_INTSP(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 = call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"INTSP.L\00"
define void @C67_INTSP(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0, i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
size_t match_v4_f2_p0(int /*<<< orphan*/ const *, size_t,
                      int /*<<< orphan*/ const *, size_t, int /*<<< orphan*/ *);
size_t v1(const uint32_t *rare, size_t lenRare, const uint32_t *freq,
          size_t lenFreq, uint32_t *matchOut) {
  return match_v4_f2_p0(rare, lenRare, freq, lenFreq, matchOut);
}


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

x86 assembly (clang, -O2):
<v1>:
jmp    1030 <match_v4_f2_p0@plt>

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

LLVM IR (-O2):
define i64 @v1(i32* %0, i64 %1, i32* %2, i64 %3, i32* %4) {
%6 = tail call i64 @match_v4_f2_p0(i32* %0, i64 %1, i32* %2, i64 %3, i32* %4)
ret i64 %6
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_enqueue_before(struct list *, struct list *);
void list_enqueue_back(struct list *head, struct list *newitem) {
  list_enqueue_before(head, newitem);
}


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

x86 assembly (clang, -O2):
<list_enqueue_back>:
jmp    1030 <list_enqueue_before@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_enqueue_back(%struct.list* %0, %struct.list* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list*
store %struct.list* %0, %struct.list** %3
store %struct.list* %1, %struct.list** %4
%5 = load %struct.list*, %struct.list** %3
%6 = load %struct.list*, %struct.list** %4
%7 = call i32 @list_enqueue_before(%struct.list* %5, %struct.list* %6)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_enqueue_back(%struct.list* %0, %struct.list* %1) {
%3 = tail call i32 @list_enqueue_before(%struct.list* %0, %struct.list* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
void __attribute__((weak)) __aeabi_memset_impl2(void *dest, size_t n, int c) {
  memset(dest, c, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memset_impl2>:
mov    %rsi,%rax
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define weak void @__aeabi_memset_impl2(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = load i64, i64* %5
%10 = call i32 @memset(i8* %7, i32 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define weak void @__aeabi_memset_impl2(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @memset(i8* %0, i32 %2, i64 %1)
ret void
}
/* Variables and functions */
double __nv_sinpi(double);
double sinpi(double __a) { return __nv_sinpi(__a); }


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

x86 assembly (clang, -O2):
<sinpi>:
jmp    1030 <__nv_sinpi@plt>

LLVM IR (-O0):
define double @sinpi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__nv_sinpi(double %3)
ret double %4
}

LLVM IR (-O2):
define double @sinpi(double %0) {
%2 = tail call double @__nv_sinpi(double %0)
ret double %2
}
/* Variables and functions */
long long osfreq();
long long cpucycles_sparccpuinfo_persecond(void) { return osfreq(); }


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

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

LLVM IR (-O0):
define i64 @cpucycles_sparccpuinfo_persecond() {
%1 = call i64 (...) @osfreq()
ret i64 %1
}

LLVM IR (-O2):
define i64 @cpucycles_sparccpuinfo_persecond() {
%1 = tail call i64 (...) @osfreq()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void errorDecl(void) { error("Invalid or unsupported declaration\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Invalid or unsupported declaration\0A\00"
define void @errorDecl() {
%1 = call i32 @error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Invalid or unsupported declaration\0A\00"
define void @errorDecl() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
int GC(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @GC() {
ret i32 42
}

LLVM IR (-O2):
define i32 @GC() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char a[10];
  strcpy(a, "abcdef");
  printf("%s\n", &a[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xe(%rbp),%rsi
add    $0x1,%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rsi
lea    0xe(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xf(%rsp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"abcdef\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ getpid();
scalar_t__ getppid();
int /*<<< orphan*/ printf(char *, long);
int main(void) {
  printf("Hello from process getpid %ld\n", (long)getpid());
  printf("Hello from process getppid %ld\n", (long)getppid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %rax,%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Hello from process getpid %ld\0A\00"
@.str.1 = [32 x i8] c"Hello from process getppid %ld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = call i64 (...) @getppid()
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Hello from process getpid %ld\0A\00"
@.str.1 = [32 x i8] c"Hello from process getppid %ld\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %1)
%3 = tail call i64 (...) @getppid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i64 %3)
ret i32 0
}
/* Variables and functions */
double quadpack_ctypes_function(double);
double quad_function2(double *x) { return quadpack_ctypes_function(*x); }


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

x86 assembly (clang, -O2):
<quad_function2>:
movsd  (%rdi),%xmm0
jmp    1030 <quadpack_ctypes_function@plt>

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

LLVM IR (-O2):
define double @quad_function2(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @quadpack_ctypes_function(double %2)
ret double %3
}
void *PCGetDirFirstFile(const char *directory, char *filename,
                        int filenamelength, int *filesize) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @PCGetDirFirstFile(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32* nocapture readnone %3) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ t1();
int /*<<< orphan*/ t2();
int /*<<< orphan*/ t3();
int /*<<< orphan*/ test_sizeof();
int main() {
  t1();
  t2();
  t3();
  test_sizeof();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <t1@plt>
xor    %eax,%eax
call   1060 <t2@plt>
xor    %eax,%eax
call   1040 <t3@plt>
xor    %eax,%eax
call   1050 <test_sizeof@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @t1()
%3 = call i32 (...) @t2()
%4 = call i32 (...) @t3()
%5 = call i32 (...) @test_sizeof()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @t1()
%2 = tail call i32 (...) @t2()
%3 = tail call i32 (...) @t3()
%4 = tail call i32 (...) @test_sizeof()
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t ror16(uint16_t x, int r) { return (x >> r) | (x << (16 - r)); }


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

x86 assembly (clang, -O2):
<ror16>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
mov    $0x10,%dl
sub    %cl,%dl
mov    %edx,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ror16(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 16, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ror16(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 16, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_UNBLOCK;
scalar_t__ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int /*<<< orphan*/ unix_fatal(char *);
void unblock_sig(sigset_t *mask) {
  if (sigprocmask(SIG_UNBLOCK, mask, NULL) < 0) {
    unix_fatal("sigprocmask error");
  }
}


x86 assembly (clang, -O0):
<unblock_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <sigprocmask@plt>
cmp    $0x0,%rax
jge    1158 <unblock_sig+0x38>
lea    0xead(%rip),%rdi
call   1030 <unix_fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unblock_sig>:
push   %rax
mov    %rdi,%rsi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
call   1040 <sigprocmask@plt>
test   %rax,%rax
js     113b <unblock_sig+0x1b>
pop    %rax
ret
lea    0xebe(%rip),%rdi
pop    %rax
jmp    1030 <unix_fatal@plt>

LLVM IR (-O0):
@SIG_UNBLOCK = global i32 0
@.str = [18 x i8] c"sigprocmask error\00"
define void @unblock_sig(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @SIG_UNBLOCK
%4 = load i32*, i32** %2
%5 = call i64 @sigprocmask(i32 %3, i32* %4, i32* null)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @unix_fatal(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@SIG_UNBLOCK = global i32 0
@.str = [18 x i8] c"sigprocmask error\00"
define void @unblock_sig(i32* %0) {
%2 = load i32, i32* @SIG_UNBLOCK
%3 = tail call i64 @sigprocmask(i32 %2, i32* %0, i32* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @unix_fatal(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ nl_catd;

/* Variables and functions */
scalar_t__ be32toh(int /*<<< orphan*/);
int /*<<< orphan*/ munmap(char *, scalar_t__);
int catclose(nl_catd catd) {
  char *map = (char *)catd;
  munmap(map, be32toh(*(uint32_t *)(map + 8)) + 20);
  return 0;
}


x86 assembly (clang, -O0):
<catclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edi
call   1030 <be32toh@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
add    $0x14,%rsi
call   1040 <munmap@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catclose>:
push   %rbx
mov    %rdi,%rbx
mov    0x8(%rdi),%edi
call   1030 <be32toh@plt>
lea    0x14(%rax),%rsi
mov    %rbx,%rdi
call   1040 <munmap@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @catclose(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 8
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = call i64 @be32toh(i32 %10)
%12 = add nsw i64 %11, 20
%13 = call i32 @munmap(i8* %6, i64 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @catclose(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 8
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i64 @be32toh(i32 %5)
%7 = add nsw i64 %6, 20
%8 = tail call i32 @munmap(i8* %2, i64 %7)
ret i32 0
}
void hardfault_handler(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<hardfault_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <hardfault_handler+0x9>
jmp    1109 <hardfault_handler+0x9>

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

LLVM IR (-O0):
define void @hardfault_handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @hardfault_handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
void graphics_preinit(void) {}


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

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

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

LLVM IR (-O2):
define void @graphics_preinit() {
ret void
}
/* Type definitions */
struct _Locale_numeric {
  int dummy;
};

/* Variables and functions */
void _Locale_numeric_destroy(struct _Locale_numeric *lnum) {}


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

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

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

LLVM IR (-O2):
%struct._Locale_numeric = type { i32 }
define void @_Locale_numeric_destroy(%struct._Locale_numeric* nocapture %0) {
ret void
}
void cw1200_pm_stay_awake(struct cw1200_pm_state *pm, unsigned long tmo) {}


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

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.cw1200_pm_state = type opaque
define void @cw1200_pm_stay_awake(%struct.cw1200_pm_state* %0, i64 %1) {
%3 = alloca %struct.cw1200_pm_state*
%4 = alloca i64
store %struct.cw1200_pm_state* %0, %struct.cw1200_pm_state** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
%struct.cw1200_pm_state = type opaque
define void @cw1200_pm_stay_awake(%struct.cw1200_pm_state* nocapture %0, i64 %1) {
ret void
}