xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ parse_value(char const **, int /*<<< orphan*/ *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ skip_space(char const **);
int json_validate(const char *json) {
  const char *s = json;
  skip_space(&s);
  if (!parse_value(&s, NULL, 0))
    return 0;
  skip_space(&s);
  if (*s != 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<json_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <skip_space@plt>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <parse_value@plt>
cmp    $0x0,%eax
jne    1161 <json_validate+0x41>
movl   $0x0,-0x4(%rbp)
jmp    118d <json_validate+0x6d>
lea    -0x18(%rbp),%rdi
call   1040 <skip_space@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1186 <json_validate+0x66>
movl   $0x0,-0x4(%rbp)
jmp    118d <json_validate+0x6d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_validate>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <skip_space@plt>
xor    %ebx,%ebx
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <parse_value@plt>
test   %eax,%eax
je     1159 <json_validate+0x39>
mov    %rsp,%rdi
call   1040 <skip_space@plt>
mov    (%rsp),%rax
xor    %ebx,%ebx
cmpb   $0x0,(%rax)
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @json_validate(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = call i32 @skip_space(i8** %4)
%7 = call i32 @parse_value(i8** %4, i32* null, i32 0)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 0, i32* %2
br label %18
10: ; preds = %1
%11 = call i32 @skip_space(i8** %4)
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 0, i32* %2
br label %18
17: ; preds = %10
store i32 1, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @json_validate(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
%4 = call i32 @skip_space(i8** %2)
%5 = call i32 @parse_value(i8** %2, i32* null, i32 0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1
%8 = call i32 @skip_space(i8** %2)
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %1
%14 = phi i32 [ 0, %1 ], [ %12, %7 ]
ret i32 %14
}
/* Variables and functions */
float FP_Cos(int /*<<< orphan*/);
int /*<<< orphan*/ __subsf3(float, float const);
float FP_Sin(float rad) {
  const float pi_2 = (float)(((float)3.1415926) / 2.0);
  return FP_Cos(__subsf3(rad, pi_2));
}


x86 assembly (clang, -O0):
<FP_Sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeb9(%rip),%xmm1
call   1040 <__subsf3@plt>
mov    %eax,%edi
call   1030 <FP_Cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FP_Sin>:
push   %rax
movss  0xed7(%rip),%xmm1
call   1040 <__subsf3@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <FP_Cos@plt>

LLVM IR (-O0):
define float @FP_Sin(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0x3FF921FB40000000, float* %3
%4 = load float, float* %2
%5 = call i32 @__subsf3(float %4, float 0x3FF921FB40000000)
%6 = call float @FP_Cos(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @FP_Sin(float %0) {
%2 = tail call i32 @__subsf3(float %0, float 0x3FF921FB40000000)
%3 = tail call float @FP_Cos(i32 %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ do_work();
int main() {
  do_work();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_work()
ret i32 0
}
/* Variables and functions */
int GetResult(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char buf[100];
  printf("%d\n", GetResult("abadcbad", buf));
  puts(buf);
  puts(buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1050 <GetResult@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x70(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <GetResult@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [9 x i8] c"abadcbad\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @GetResult(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @puts(i8* %2)
%6 = call i32 @puts(i8* %2)
ret i32 0
}
void icp(void (*p)()) { p(); }


x86 assembly (clang, -O0):
<icp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icp>:
xor    %eax,%eax
jmp    *%rdi

LLVM IR (-O0):
define void @icp(void (...)* %0) {
%2 = alloca void (...)*
store void (...)* %0, void (...)** %2
%3 = load void (...)*, void (...)** %2
ret void
}

LLVM IR (-O2):
define void @icp(void (...)* nocapture %0) {
tail call void (...) %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fibonacci_improved(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int n;
  printf("Input N: ");
  scanf("%d", &n);
  printf("%lld\n", fibonacci_improved(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1040 <fibonacci_improved@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fibonacci_improved@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Input N: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"%lld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 @fibonacci_improved(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Input N: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"%lld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @fibonacci_improved(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap32_a_load(uint32_t *in) {
  return ((uint32_t)((((uint32_t)(*in) & (uint32_t)0x000000ffUL) << 24) |
                     (((uint32_t)(*in) & (uint32_t)0x0000ff00UL) << 8) |
                     (((uint32_t)(*in) & (uint32_t)0x00ff0000UL) >> 8) |
                     (((uint32_t)(*in) & (uint32_t)0xff000000UL) >> 24)));
}


x86 assembly (clang, -O0):
<swap32_a_load>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xff000000,%ecx
sar    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap32_a_load>:
mov    (%rdi),%eax
mov    %eax,%ecx
and    $0xffffff,%ecx
bswap  %ecx
sar    $0x18,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @swap32_a_load(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 255
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = and i32 %8, 65280
%10 = shl i32 %9, 8
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = and i32 %13, 16711680
%15 = ashr i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = load i32, i32* %17
%19 = and i32 %18, -16777216
%20 = ashr i32 %19, 24
%21 = or i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @swap32_a_load(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 16777215
%4 = tail call i32 @llvm.bswap.i32(i32 %3)
%5 = ashr i32 %2, 24
%6 = or i32 %4, %5
ret i32 %6
}
/* Type definitions */
struct rtas_event {
  int dummy;
};
struct rtas_cpu_scn {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_re_scn(struct rtas_event *, int);
struct rtas_cpu_scn *rtas_get_cpu_scn(struct rtas_event *re) {
  return (struct rtas_cpu_scn *)get_re_scn(re, 5);
}


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

x86 assembly (clang, -O2):
<rtas_get_cpu_scn>:
mov    $0x5,%esi
jmp    1030 <get_re_scn@plt>

LLVM IR (-O0):
%struct.rtas_cpu_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_cpu_scn* @rtas_get_cpu_scn(%struct.rtas_event* %0) {
%2 = alloca %struct.rtas_event*
store %struct.rtas_event* %0, %struct.rtas_event** %2
%3 = load %struct.rtas_event*, %struct.rtas_event** %2
%4 = call i64 @get_re_scn(%struct.rtas_event* %3, i32 5)
%5 = inttoptr i64 %4 to %struct.rtas_cpu_scn*
ret %struct.rtas_cpu_scn* %5
}

LLVM IR (-O2):
%struct.rtas_cpu_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_cpu_scn* @rtas_get_cpu_scn(%struct.rtas_event* %0) {
%2 = tail call i64 @get_re_scn(%struct.rtas_event* %0, i32 5)
%3 = inttoptr i64 %2 to %struct.rtas_cpu_scn*
ret %struct.rtas_cpu_scn* %3
}
void f6(char ***bar) {
  const char *volatile **p9 = (const char *volatile **)bar;
  char *volatile const **p11 = (char *volatile const **)bar;
  char *volatile *const *p13 = (char *volatile *const *)bar;
  const char *volatile const **p15 = (const char *volatile const **)bar;
  const char *volatile *const *p17 = (const char *volatile *const *)bar;
  char *volatile const *const *p19 = (char *volatile const *const *)bar;
  const char *volatile const *const *p21 =
      (const char *volatile const *const *)bar;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f6(i8*** nocapture %0) {
ret void
}
/* Variables and functions */
int yas_lis331dl_read_reg(unsigned char, unsigned char *, int);
int yas_lis331dl_read_reg_byte(unsigned char adr) {
  unsigned char buf;
  int err;
  err = yas_lis331dl_read_reg(adr, &buf, 1);
  if (err == 0) {
    return buf;
  }
  return 0;
}


x86 assembly (clang, -O0):
<yas_lis331dl_read_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x5(%rbp),%edi
call   1030 <yas_lis331dl_read_reg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <yas_lis331dl_read_reg_byte+0x39>
movzbl -0x6(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <yas_lis331dl_read_reg_byte+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_lis331dl_read_reg_byte>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_lis331dl_read_reg@plt>
xor    %ecx,%ecx
test   %eax,%eax
movzbl 0x7(%rsp),%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_lis331dl_read_reg_byte(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
%6 = load i8, i8* %3
%7 = call i32 @yas_lis331dl_read_reg(i8 zeroext %6, i8* %4, i32 1)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @yas_lis331dl_read_reg_byte(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @yas_lis331dl_read_reg(i8 zeroext %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 0
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ xorshift_seed(int /*<<< orphan*/ *);
void sam_srand(void) { xorshift_seed(NULL); }


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

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

LLVM IR (-O0):
define void @sam_srand() {
%1 = call i32 @xorshift_seed(i32* null)
ret void
}

LLVM IR (-O2):
define void @sam_srand() {
%1 = tail call i32 @xorshift_seed(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, int);
void function(const void *key, const void *data, const void *arg) {
  printf("%lg %d\n", *(double *)key, *(int *)data);
  return;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
movsd  (%rdi),%xmm0
mov    (%rsi),%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%lg %d\0A\00"
define void @function(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %9, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lg %d\0A\00"
define void @function(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to double*
%5 = load double, double* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %5, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void file(char *s) { printf("File %s:\n", s); }


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

x86 assembly (clang, -O2):
<file>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"File %s:\0A\00"
define void @file(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int ReleaseInput(int handle) { return 1; }


x86 assembly (clang, -O0):
<ReleaseInput>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ReleaseInput(i32 %0) {
ret i32 1
}
float _ccv_mod_2pi(float x) {
  while (x > 2 * (3.141592653589793))
    x -= 2 * (3.141592653589793);
  while (x < 0)
    x += 2 * (3.141592653589793);
  return x;
}


x86 assembly (clang, -O0):
<_ccv_mod_2pi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1147 <_ccv_mod_2pi+0x47>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecb(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1109 <_ccv_mod_2pi+0x9>
jmp    114c <_ccv_mod_2pi+0x4c>
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    117c <_ccv_mod_2pi+0x7c>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe96(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    114c <_ccv_mod_2pi+0x4c>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ccv_mod_2pi>:
cvtss2sd %xmm0,%xmm1
ucomisd 0xef4(%rip),%xmm1
jbe    1138 <_ccv_mod_2pi+0x38>
movsd  0xef2(%rip),%xmm2
movsd  0xee2(%rip),%xmm3
xchg   %ax,%ax
addsd  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
ucomisd %xmm3,%xmm1
ja     1120 <_ccv_mod_2pi+0x20>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1161 <_ccv_mod_2pi+0x61>
movsd  0xeb8(%rip),%xmm2
nopl   0x0(%rax,%rax,1)
cvtss2sd %xmm0,%xmm0
addsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
ucomiss %xmm0,%xmm1
ja     1150 <_ccv_mod_2pi+0x50>
ret

LLVM IR (-O0):
define float @_ccv_mod_2pi(float %0) {
%2 = alloca float
store float %0, float* %2
br label %3
3: ; preds = %7, %1
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 0x401921FB54442D18
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fsub double %9, 0x401921FB54442D18
%11 = fptrunc double %10 to float
store float %11, float* %2
br label %3
12: ; preds = %3
br label %13
13: ; preds = %16, %12
%14 = load float, float* %2
%15 = fcmp olt float %14, 0.000000e+00
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load float, float* %2
%18 = fpext float %17 to double
%19 = fadd double %18, 0x401921FB54442D18
%20 = fptrunc double %19 to float
store float %20, float* %2
br label %13
21: ; preds = %13
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @_ccv_mod_2pi(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ogt double %2, 0x401921FB54442D18
br i1 %3, label %7, label %4
4: ; preds = %7, %1
%5 = phi float [ %0, %1 ], [ %10, %7 ]
%6 = fcmp olt float %5, 0.000000e+00
br i1 %6, label %13, label %19
7: ; preds = %1, %7
%8 = phi double [ %11, %7 ], [ %2, %1 ]
%9 = fadd double %8, 0xC01921FB54442D18
%10 = fptrunc double %9 to float
%11 = fpext float %10 to double
%12 = fcmp ogt double %11, 0x401921FB54442D18
br i1 %12, label %7, label %4
13: ; preds = %4, %13
%14 = phi float [ %17, %13 ], [ %5, %4 ]
%15 = fpext float %14 to double
%16 = fadd double %15, 0x401921FB54442D18
%17 = fptrunc double %16 to float
%18 = fcmp olt float %17, 0.000000e+00
br i1 %18, label %13, label %19
19: ; preds = %13, %4
%20 = phi float [ %5, %4 ], [ %17, %13 ]
ret float %20
}
void st_init(const char *file) {}


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

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

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

LLVM IR (-O2):
define void @st_init(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_fatal(char *);
int open(char const *, int);
int Open(const char *filename, int oflags) {
  int n;
  n = open(filename, oflags);
  if (n == -1) {
    err_fatal("ERROR. open() failed");
  }
  return n;
}


x86 assembly (clang, -O0):
<Open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1154 <Open+0x34>
lea    0xeb1(%rip),%rdi
call   1030 <err_fatal@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Open>:
push   %rbx
call   1040 <open@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1139 <Open+0x19>
lea    0xecc(%rip),%rdi
call   1030 <err_fatal@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"ERROR. open() failed\00"
define i32 @Open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @err_fatal(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@.str = [21 x i8] c"ERROR. open() failed\00"
define i32 @Open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_fatal(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
unsigned char Avi_GetAudio(unsigned char *str, unsigned long *length,
                           unsigned long Buflength) {
  unsigned char result = 1;
  {}
  return result;
}


x86 assembly (clang, -O0):
<Avi_GetAudio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x1,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @Avi_GetAudio(i8* %0, i64* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i8
store i8* %0, i8** %4
store i64* %1, i64** %5
store i64 %2, i64* %6
store i8 1, i8* %7
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @Avi_GetAudio(i8* nocapture readnone %0, i64* nocapture readnone %1, i64 %2) {
ret i8 1
}
/* Variables and functions */
bool nrf53_errata_80(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_80() {
ret i32 0
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *malloc(size_t);
void *rtrb_malloc(struct libavl_allocator *allocator, size_t size) {
  assert(allocator != NULL && size > 0);
  return malloc(size);
}


x86 assembly (clang, -O0):
<rtrb_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <rtrb_malloc+0x2b>
cmpq   $0x0,-0x10(%rbp)
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtrb_malloc>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define i8* @rtrb_malloc(%struct.libavl_allocator* %0, i64 %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i64
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i64 %1, i64* %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp ugt i64 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64, i64* %4
%15 = call i8* @malloc(i64 %14)
ret i8* %15
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define noalias i8* @rtrb_malloc(%struct.libavl_allocator* readnone %0, i64 %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i8* @malloc(i64 %1)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printLayout(void) {
  printf("The board is layed out like this:\n"
         "|----|----|----|----|\n"
         "|  0 |  1 |  2 |  3 |\n"
         "|----|----|----|----|\n"
         "|  4 |  5 |  6 |  7 |\n"
         "|----|----|----|----|\n"
         "|  8 |  9 | 10 | 11 |\n"
         "|----|----|----|----|\n"
         "| 12 | 13 | 14 | 15 |\n"
         "|----|----|----|----|\n\n");
}


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

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

LLVM IR (-O0):
@.str = [234 x i8] c"The board is layed out like this:\0A|----|----|----|----|\0A| 0 | 1 | 2 | 3 |\0A|----|----|----|----|\0A| 4 | 5 | 6 | 7 |\0A|----|----|----|----|\0A| 8 | 9 | 10 | 11 |\0A|----|----|----|----|\0A| 12 | 13 | 14 | 15 |\0A|----|----|----|----|\0A\0A\00"
define void @printLayout() {
%1 = call i32 @printf(i8* getelementptr inbounds ([234 x i8], [234 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [233 x i8] c"The board is layed out like this:\0A|----|----|----|----|\0A| 0 | 1 | 2 | 3 |\0A|----|----|----|----|\0A| 4 | 5 | 6 | 7 |\0A|----|----|----|----|\0A| 8 | 9 | 10 | 11 |\0A|----|----|----|----|\0A| 12 | 13 | 14 | 15 |\0A|----|----|----|----|\0A\00"
define void @printLayout() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([233 x i8], [233 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strchr(char const *, int);
char *mc_strchr(const char *s, int c) { return strchr(s, c); }


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

x86 assembly (clang, -O2):
<mc_strchr>:
jmp    1030 <strchr@plt>

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

LLVM IR (-O2):
define i8* @mc_strchr(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
int change_PIN(int fd) {}


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

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

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

LLVM IR (-O2):
define i32 @change_PIN(i32 %0) {
ret i32 undef
}
void TimerOnePulseModeConfigure(unsigned long ulBase, unsigned long ulOPMode) {

  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000008;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= ulOPMode;
}


x86 assembly (clang, -O0):
<TimerOnePulseModeConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffffff7,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerOnePulseModeConfigure>:
andq   $0xfffffffffffffff7,(%rdi)
or     %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @TimerOnePulseModeConfigure(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 = add i64 %5, 0
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -9
store volatile i64 %9, i64* %7
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = add i64 %11, 0
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %10
store volatile i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @TimerOnePulseModeConfigure(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -9
store volatile i64 %5, i64* %3
%6 = load volatile i64, i64* %3
%7 = or i64 %6, %1
store volatile i64 %7, i64* %3
ret void
}
/* Variables and functions */
size_t scheme_symbol_hash_function(void *sym) {
  const char *str = (const char *)sym;
  size_t hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<scheme_symbol_hash_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x1505,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1152 <scheme_symbol_hash_function+0x52>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <scheme_symbol_hash_function+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scheme_symbol_hash_function>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <scheme_symbol_hash_function+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <scheme_symbol_hash_function+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @scheme_symbol_hash_function(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int strcasecmp(char *, char *);
int msvcrt_strcmpi(char *str1, char *str2) { return strcasecmp(str1, str2); }


x86 assembly (clang, -O0):
<msvcrt_strcmpi>:
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 <strcasecmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msvcrt_strcmpi>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @msvcrt_strcmpi(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int barrier_imanager_req();
int d2mce_set_barrier_manager() { return barrier_imanager_req(); }


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

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

LLVM IR (-O0):
define i32 @d2mce_set_barrier_manager() {
%1 = call i32 (...) @barrier_imanager_req()
ret i32 %1
}

LLVM IR (-O2):
define i32 @d2mce_set_barrier_manager() {
%1 = tail call i32 (...) @barrier_imanager_req()
ret i32 %1
}
int g3() { return 4; }


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

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

LLVM IR (-O0):
define i32 @g3() {
ret i32 4
}

LLVM IR (-O2):
define i32 @g3() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *malloc(size_t size) {
  printf("malloc\n");
  return NULL;
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"malloc\00"
define noalias i8* @malloc(i64 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ ParseIcsTextColors();
int IcsOptionsOK(int n) {
  ParseIcsTextColors();
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @IcsOptionsOK(i32 %0) {
%2 = tail call i32 (...) @ParseIcsTextColors()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%.2f\n", 1.0 * a / b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xeb0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm0
cvtsi2sdl (%rsp),%xmm1
divsd  %xmm1,%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = fmul double 1.000000e+00, %6
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to double
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
size_t uint64PackSize(const uint64_t *data) { return sizeof(*data); }


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

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

LLVM IR (-O0):
define i64 @uint64PackSize(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret i64 4
}

LLVM IR (-O2):
define i64 @uint64PackSize(i32* nocapture readnone %0) {
ret i64 4
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("before\n");
  if (fork())
    printf("parent\n");
  else
    printf("child\n");
  printf("both\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
je     115d <main+0x3d>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <main+0x49>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
lea    0xec9(%rip),%rax
lea    0xecd(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"before\0A\00"
@.str.1 = [8 x i8] c"parent\0A\00"
@.str.2 = [7 x i8] c"child\0A\00"
@.str.3 = [6 x i8] c"both\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @fork()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@str = [7 x i8] c"before\00"
@str.4 = [6 x i8] c"child\00"
@str.5 = [5 x i8] c"both\00"
@str.6 = [7 x i8] c"parent\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.6, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
int cdops_play_cdda_sectors(int start, int stop, int reps) {
  struct {
    int start, stop, reps, dunno;
  } param;
  param.start = start;
  param.stop = stop;
  param.reps = reps;
  param.dunno = 0;
  return cdops_exec_cmd(21, &param);
}


x86 assembly (clang, -O0):
<cdops_play_cdda_sectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x15,%edi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <cdops_exec_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdops_play_cdda_sectors>:
sub    $0x18,%rsp
mov    %edi,0x8(%rsp)
mov    %esi,0xc(%rsp)
mov    %edx,0x10(%rsp)
movl   $0x0,0x14(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x15,%edi
xor    %eax,%eax
call   1030 <cdops_exec_cmd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { i32, i32, i32, i32 }
define i32 @cdops_play_cdda_sectors(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.anon
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %5
%11 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 1
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 2
store i32 %12, i32* %13
%14 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 3
store i32 0, i32* %14
%15 = call i32 (i32, %struct.anon*, ...) bitcast (i32 (...)* @cdops_exec_cmd to i32 (i32, %struct.anon*, ...)*)(i32 21, %struct.anon* %7)
ret i32 %15
}

LLVM IR (-O2):
%struct.anon = type { i32, i32, i32, i32 }
define i32 @cdops_play_cdda_sectors(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.anon
%5 = bitcast %struct.anon* %4 to i8*
%6 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 0
store i32 %0, i32* %6
%7 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 1
store i32 %1, i32* %7
%8 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 2
store i32 %2, i32* %8
%9 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 3
store i32 0, i32* %9
%10 = call i32 (i32, %struct.anon*, ...) bitcast (i32 (...)* @cdops_exec_cmd to i32 (i32, %struct.anon*, ...)*)(i32 21, %struct.anon* %4)
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlockattr_t;

/* Variables and functions */
int pthread_rwlockattr_setpshared(int /*<<< orphan*/ *, int);
int my_pthread_rwlockattr_setpshared(pthread_rwlockattr_t *__attr,
                                     int pshared) {
  pthread_rwlockattr_t *realattr = (pthread_rwlockattr_t *)*(int *)__attr;
  return pthread_rwlockattr_setpshared(realattr, pshared);
}


x86 assembly (clang, -O0):
<my_pthread_rwlockattr_setpshared>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <pthread_rwlockattr_setpshared@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_rwlockattr_setpshared>:
movslq (%rdi),%rdi
jmp    1030 <pthread_rwlockattr_setpshared@plt>

LLVM IR (-O0):
define i32 @my_pthread_rwlockattr_setpshared(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32, i32* %4
%12 = call i32 @pthread_rwlockattr_setpshared(i32* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_rwlockattr_setpshared(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_rwlockattr_setpshared(i32* %5, i32 %1)
ret i32 %6
}