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

/* Variables and functions */
int /*<<< orphan*/ rdar8332221_vprintf_scanf(char *, int /*<<< orphan*/, char *,
                                             int *);
void rdar8332221(va_list ap, int *x, long *y) {
  rdar8332221_vprintf_scanf("%", ap, "%d", x);
}


x86 assembly (clang, -O0):
<rdar8332221>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rcx
lea    0xecf(%rip),%rdi
lea    0xeca(%rip),%rdx
call   1030 <rdar8332221_vprintf_scanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdar8332221>:
mov    %rsi,%rcx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
lea    0xedf(%rip),%rdx
jmp    1030 <rdar8332221_vprintf_scanf@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"%\00"
@.str.1 = [3 x i8] c"%d\00"
define void @rdar8332221(i32 %0, i32* %1, i64* nocapture readnone %2) {
%4 = tail call i32 @rdar8332221_vprintf_scanf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ namcoGuessN175(int /*<<< orphan*/);
int /*<<< orphan*/ namco_getRAM(int /*<<< orphan*/);
uint8_t namco_getRAM_GuessN175(uint16_t addr) {
  namcoGuessN175(addr);
  return namco_getRAM(addr);
}


x86 assembly (clang, -O0):
<namco_getRAM_GuessN175>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <namcoGuessN175@plt>
mov    -0x4(%rbp),%edi
call   1030 <namco_getRAM@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<namco_getRAM_GuessN175>:
push   %rbx
mov    %edi,%ebx
call   1040 <namcoGuessN175@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <namco_getRAM@plt>

LLVM IR (-O0):
define i32 @namco_getRAM_GuessN175(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @namcoGuessN175(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @namco_getRAM(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @namco_getRAM_GuessN175(i32 %0) {
%2 = tail call i32 @namcoGuessN175(i32 %0)
%3 = tail call i32 @namco_getRAM(i32 %0)
ret i32 %3
}
raise(c) register int c;
{
  if (c >= 'a' && c <= 'z')
    c += 'A' - 'a';
  return (c);
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <raise+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <raise+0x24>
mov    -0x4(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void f1(const char *s) { printf("%s triggered probe3:f1\n", s); }


x86 assembly (clang, -O0):
<f1>:
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):
<f1>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [24 x i8] c"%s triggered probe3:f1\0A\00"
define void @f1(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int do_625() { return 625; }


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

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

LLVM IR (-O0):
define i32 @do_625() {
ret i32 625
}

LLVM IR (-O2):
define i32 @do_625() {
ret i32 625
}
void arch_haltpoll_enable(unsigned int cpu) {}


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

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

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

LLVM IR (-O2):
define void @arch_haltpoll_enable(i32 %0) {
ret void
}
/* Variables and functions */
unsigned long BSP_ReadTSR();
int BSP_GetExecutionState(void) {
  unsigned long tmp = BSP_ReadTSR();
  if (tmp & (1 << 6))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<BSP_GetExecutionState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <BSP_ReadTSR@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x40,%rax
cmp    $0x0,%rax
je     1141 <BSP_GetExecutionState+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1148 <BSP_GetExecutionState+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_GetExecutionState>:
push   %rax
xor    %eax,%eax
call   1030 <BSP_ReadTSR@plt>
xor    %ecx,%ecx
test   $0x40,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BSP_GetExecutionState() {
%1 = alloca i32
%2 = alloca i64
%3 = call i64 (...) @BSP_ReadTSR()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 64
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %1
br label %9
8: ; preds = %0
store i32 1, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @BSP_GetExecutionState() {
%1 = tail call i64 (...) @BSP_ReadTSR()
%2 = trunc i64 %1 to i32
%3 = lshr i32 %2, 6
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
ret i32 %5
}
int test_imm_60int16_reg(short val) {
  return ((val) & (0x60 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_60int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x60,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_60int16_reg>:
test   $0x60,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_60int16_reg(i16 signext %0) {
%2 = and i16 %0, 96
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_wget_wch(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_wget_wch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_wget_wch+0x2a>
jmp    1170 <cmd_wget_wch+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_wget_wch>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_wget_wch+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wget_wch(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wget_wch(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
int myHash(const char *str) {
  int val = 0;
  int i = 0;
  while (str[i] != '\0') {
    val += *(str + i);
    i++;
  }
  return val;
}


x86 assembly (clang, -O0):
<myHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114b <myHash+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <myHash+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <myHash+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <myHash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @myHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %9, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nsw i32 %7, %8
%10 = add nuw nsw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double);
scalar_t__ system(char *);
int is_nan(double d) {
  int result;
  char command[128];
  if (!(d == d)) {
    result = 1;
  } else {
    sprintf(command, "echo '%f' | egrep '[nN][aA][nN]|\\?' >/dev/null", d);
    result = system(command) == 0;
  }
  return result;
}


x86 assembly (clang, -O0):
<is_nan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    114b <is_nan+0x2b>
jp     114b <is_nan+0x2b>
jmp    1157 <is_nan+0x37>
movl   $0x1,-0xc(%rbp)
jmp    118a <is_nan+0x6a>
lea    -0x90(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xe96(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_nan>:
ucomisd %xmm0,%xmm0
jp     115c <is_nan+0x3c>
push   %rbx
sub    $0x80,%rsp
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x80,%rsp
pop    %rbx
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [47 x i8] c"echo '%f' | egrep '[nN][aA][nN]|\\?' >/dev/null\00"
define i32 @is_nan(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca [128 x i8]
store double %0, double* %2
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fcmp oeq double %5, %6
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 1, i32* %3
br label %17
9: ; preds = %1
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%11 = load double, double* %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), double %11)
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%14 = call i64 @system(i8* %13)
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
store i32 %16, i32* %3
br label %17
17: ; preds = %9, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [47 x i8] c"echo '%f' | egrep '[nN][aA][nN]|\\?' >/dev/null\00"
define i32 @is_nan(double %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = fcmp ord double %0, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), double %0)
%7 = call i64 @system(i8* %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ 1, %1 ]
ret i32 %11
}
int test_imm_00uint16_mem(unsigned short *val) {
  return ((*val) & (-0x00 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_00uint16_mem(i16* nocapture readnone %0) {
ret i32 -40
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_number_of_dobldobl_solutions(int *length) {
  int *a, fail;
  double *c;
  fail = _ada_use_c2phc4c(342, a, length, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_number_of_dobldobl_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x156,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_number_of_dobldobl_solutions>:
mov    %rdi,%rdx
mov    $0x156,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_number_of_dobldobl_solutions(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %3
%7 = load i32*, i32** %2
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 342, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @solcon_number_of_dobldobl_solutions(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 342, i32* undef, i32* %0, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
double rndLaplace();
double rndu();
double sqrt(int);
double rndBactrianLaplace(void) {
  double z = 0.95 + rndLaplace() * sqrt(1 - 0.95 * 0.95);
  if (rndu() < 0.5)
    z = -z;
  return (z);
}


x86 assembly (clang, -O0):
<rndBactrianLaplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rndLaplace@plt>
movsd  %xmm0,-0x10(%rbp)
xor    %edi,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rndu@plt>
movaps %xmm0,%xmm1
movsd  0xe86(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a5 <rndBactrianLaplace+0x75>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rndBactrianLaplace>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <rndLaplace@plt>
movsd  %xmm0,(%rsp)
xor    %edi,%edi
call   1050 <sqrt@plt>
mulsd  (%rsp),%xmm0
addsd  0xeac(%rip),%xmm0
movapd %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <rndu@plt>
movapd 0xea8(%rip),%xmm1
cmpltsd 0xe97(%rip),%xmm0
movapd (%rsp),%xmm2
xorpd  %xmm2,%xmm1
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rndBactrianLaplace() {
%1 = alloca double
%2 = call double (...) @rndLaplace()
%3 = call double @sqrt(i32 0)
%4 = call double @llvm.fmuladd.f64(double %2, double %3, double 0x3FEE666666666666)
store double %4, double* %1
%5 = call double (...) @rndu()
%6 = fcmp olt double %5, 5.000000e-01
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load double, double* %1
%9 = fneg double %8
store double %9, double* %1
br label %10
10: ; preds = %7, %0
%11 = load double, double* %1
ret double %11
}

LLVM IR (-O2):
define double @rndBactrianLaplace() {
%1 = tail call double (...) @rndLaplace()
%2 = tail call double @sqrt(i32 0)
%3 = tail call double @llvm.fmuladd.f64(double %1, double %2, double 0x3FEE666666666666)
%4 = tail call double (...) @rndu()
%5 = fcmp olt double %4, 5.000000e-01
%6 = fneg double %3
%7 = select i1 %5, double %6, double %3
ret double %7
}
double logical_notnot(double a) { return a != 0.0; }


x86 assembly (clang, -O0):
<logical_notnot>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<logical_notnot>:
xorpd  %xmm1,%xmm1
cmpneqsd %xmm1,%xmm0
movsd  0xeef(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @logical_notnot(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp une double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @logical_notnot(double %0) {
%2 = fcmp une double %0, 0.000000e+00
%3 = uitofp i1 %2 to double
ret double %3
}
int putchar(int c __attribute__((unused))) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int, char *, char *);
void e_acsl_assert(int predicate, char *kind, char *fct, char *pred_txt,
                   int line) {
  if (!predicate) {
    printf("%s failed at line %d in function %s.\nThe failing predicate "
           "is:\n%s.\n",
           kind, line, fct, pred_txt);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<e_acsl_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    116a <e_acsl_assert+0x4a>
mov    -0x10(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_acsl_assert>:
test   %edi,%edi
je     1125 <e_acsl_assert+0x5>
ret
push   %rax
mov    %rcx,%rax
mov    %rdx,%rcx
lea    0xecd(%rip),%rdi
mov    %r8d,%edx
mov    %rax,%r8
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"%s failed at line %d in function %s.\0AThe failing predicate is:\0A%s.\0A\00"
define void @e_acsl_assert(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %5
%14 = load i8*, i8** %7
%15 = load i32, i32* %10
%16 = load i8*, i8** %8
%17 = load i8*, i8** %9
%18 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15, i8* %16, i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [68 x i8] c"%s failed at line %d in function %s.\0AThe failing predicate is:\0A%s.\0A\00"
define void @e_acsl_assert(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = icmp eq i32 %0, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = tail call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %4, i8* %2, i8* %3)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %5
ret void
}
/* Variables and functions */
scalar_t__ trand();
double tfrand(void) { return (double)trand() / 2147483647; }


x86 assembly (clang, -O0):
<tfrand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <trand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfrand>:
push   %rax
xor    %eax,%eax
call   1030 <trand@plt>
cvtsi2sd %rax,%xmm0
divsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tfrand() {
%1 = call i64 (...) @trand()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 0x41DFFFFFFFC00000
ret double %3
}

LLVM IR (-O2):
define double @tfrand() {
%1 = tail call i64 (...) @trand()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 0x41DFFFFFFFC00000
ret double %3
}
int f3(int x) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void sky_umts_endian_swap(struct umts_t *p) {
  assert(p != NULL);
  ;
  ;
  ;
  ;
  ;
}


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

x86 assembly (clang, -O2):
<sky_umts_endian_swap>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.umts_t = type { i32 }
define void @sky_umts_endian_swap(%struct.umts_t* %0) {
%2 = alloca %struct.umts_t*
store %struct.umts_t* %0, %struct.umts_t** %2
%3 = load %struct.umts_t*, %struct.umts_t** %2
%4 = icmp ne %struct.umts_t* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.umts_t = type { i32 }
define void @sky_umts_endian_swap(%struct.umts_t* readnone %0) {
%2 = icmp ne %struct.umts_t* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
int eq(double a, double b) { return a == b; }


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @eq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @eq(double %0, double %1) {
%3 = fcmp oeq double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syspool_copy_to_quaddobl_container(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(315, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syspool_copy_to_quaddobl_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x13b,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syspool_copy_to_quaddobl_container>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x13b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syspool_copy_to_quaddobl_container(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 315, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syspool_copy_to_quaddobl_container(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 315, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int const rand();
int rand_int(const int range) { return rand() % range; }


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

x86 assembly (clang, -O2):
<rand_int>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rand_int(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int egetc();
long to32bit(int, int, int, int);
long int read32bit() {
  int c1, c2, c3, c4;
  c1 = egetc();
  c2 = egetc();
  c3 = egetc();
  c4 = egetc();
  return to32bit(c1, c2, c3, c4);
}


x86 assembly (clang, -O0):
<read32bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <egetc@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <egetc@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <egetc@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <egetc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <to32bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read32bit>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <egetc@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <egetc@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <egetc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <egetc@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <to32bit@plt>

LLVM IR (-O0):
define i64 @read32bit() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @egetc()
store i32 %5, i32* %1
%6 = call i32 (...) @egetc()
store i32 %6, i32* %2
%7 = call i32 (...) @egetc()
store i32 %7, i32* %3
%8 = call i32 (...) @egetc()
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i64 @to32bit(i32 %9, i32 %10, i32 %11, i32 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @read32bit() {
%1 = tail call i32 (...) @egetc()
%2 = tail call i32 (...) @egetc()
%3 = tail call i32 (...) @egetc()
%4 = tail call i32 (...) @egetc()
%5 = tail call i64 @to32bit(i32 %1, i32 %2, i32 %3, i32 %4)
ret i64 %5
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_43(uint64_t x) {
  __asm__("rolq $43, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_43>:
mov    %rdi,%rax
rol    $0x2b,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_43(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$43, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_43(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$43, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
double JHKeyframeAnimationFunctionEaseOutBounce(double, int /*<<< orphan*/,
                                                double, double);
double JHKeyframeAnimationFunctionEaseInBounce(double t, double b, double c,
                                               double d) {
  return c - JHKeyframeAnimationFunctionEaseOutBounce(d - t, 0, c, d) + b;
}


x86 assembly (clang, -O0):
<JHKeyframeAnimationFunctionEaseInBounce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
xor    %edi,%edi
call   1030 <JHKeyframeAnimationFunctionEaseOutBounce@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JHKeyframeAnimationFunctionEaseInBounce>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
movapd %xmm3,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
xor    %edi,%edi
movaps %xmm2,%xmm1
movapd %xmm3,%xmm2
call   1030 <JHKeyframeAnimationFunctionEaseOutBounce@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @JHKeyframeAnimationFunctionEaseInBounce(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = load double, double* %7
%14 = load double, double* %8
%15 = call double @JHKeyframeAnimationFunctionEaseOutBounce(double %12, i32 0, double %13, double %14)
%16 = fsub double %9, %15
%17 = load double, double* %6
%18 = fadd double %16, %17
ret double %18
}

LLVM IR (-O2):
define double @JHKeyframeAnimationFunctionEaseInBounce(double %0, double %1, double %2, double %3) {
%5 = fsub double %3, %0
%6 = tail call double @JHKeyframeAnimationFunctionEaseOutBounce(double %5, i32 0, double %2, double %3)
%7 = fsub double %2, %6
%8 = fadd double %7, %1
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ g1(long);
double g2(long);
double f(long i) {
  if (g1(i) != g2(i))
    abort();
  return g2(i);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <g1@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <g2@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    1175 <f+0x45>
jp     1175 <f+0x45>
jmp    117c <f+0x4c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1050 <g2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <g1@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1050 <g2@plt>
ucomisd 0x8(%rsp),%xmm0
jne    1167 <f+0x37>
jp     1167 <f+0x37>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <g2@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define double @f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @g1(i64 %3)
%5 = sitofp i64 %4 to double
%6 = load i64, i64* %2
%7 = call double @g2(i64 %6)
%8 = fcmp une double %5, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
%12 = load i64, i64* %2
%13 = call double @g2(i64 %12)
ret double %13
}

LLVM IR (-O2):
define double @f(i64 %0) {
%2 = tail call i64 @g1(i64 %0)
%3 = sitofp i64 %2 to double
%4 = tail call double @g2(i64 %0)
%5 = fcmp une double %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = tail call double @g2(i64 %0)
ret double %9
}
unsigned zigzagdec31(unsigned x) { return (x >> 2 | (x & 2) << 30) ^ -(x & 1); }


x86 assembly (clang, -O0):
<zigzagdec31>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x2,%ecx
shl    $0x1e,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zigzagdec31>:
mov    %edi,%eax
rol    $0x1e,%eax
and    $0xbfffffff,%eax
and    $0x1,%edi
neg    %edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @zigzagdec31(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 2
%5 = load i32, i32* %2
%6 = and i32 %5, 2
%7 = shl i32 %6, 30
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = and i32 %9, 1
%11 = sub i32 0, %10
%12 = xor i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @zigzagdec31(i32 %0) {
%2 = lshr i32 %0, 2
%3 = shl i32 %0, 30
%4 = and i32 %3, -2147483648
%5 = or i32 %4, %2
%6 = and i32 %0, 1
%7 = sub nsw i32 0, %6
%8 = xor i32 %5, %7
ret i32 %8
}
/* Variables and functions */
void *malloc(int);
void *frw_alloc(int length) { return malloc(length); }


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

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

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

LLVM IR (-O2):
define noalias i8* @frw_alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int *distributeCandies(int, int, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int rt;
  int *ret = distributeCandies(10, 3, &rt);
  for (int i = 0; i < rt; i++)
    printf("%d ", ret[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x3,%esi
lea    -0x8(%rbp),%rdx
call   1030 <distributeCandies@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117e <main+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdx
mov    $0xa,%edi
mov    $0x3,%esi
call   1030 <distributeCandies@plt>
cmpl   $0x0,0xc(%rsp)
jle    116a <main+0x4a>
mov    %rax,%r15
xor    %ebx,%ebx
lea    0xeb0(%rip),%r14
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32* @distributeCandies(i32 10, i32 3, i32* %2)
store i32* %5, i32** %3
store i32 0, i32* %4
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %6
20: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32* @distributeCandies(i32 10, i32 3, i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %7, %0
ret i32 0
7: ; preds = %0, %7
%8 = phi i64 [ %12, %7 ], [ 0, %0 ]
%9 = getelementptr inbounds i32, i32* %3, i64 %8
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = icmp slt i64 %12, %14
br i1 %15, label %7, label %6
}
int main() {
  int x;
  int *p;
  int y[10];
  p = &y[6];
  *p = 5;
  x = 10;
  y[3] = 5;
  return x - y[3] - *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
movl   $0xa,-0x8(%rbp)
movl   $0x5,-0x34(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x34(%rbp),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [10 x i32]
store i32 0, i32* %1
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 6
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store i32 5, i32* %6
store i32 10, i32* %2
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 3
store i32 5, i32* %7
%8 = load i32, i32* %2
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 3
%10 = load i32, i32* %9
%11 = sub nsw i32 %8, %10
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = sub nsw i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ hash_keccak(int, int /*<<< orphan*/ const *,
                               int /*<<< orphan*/, int, int /*<<< orphan*/ *,
                               int, int);
int hash_sha3_384(uint8_t *h, const uint8_t *m, uint64_t n) {
  hash_keccak(13 * 8, m, n, 0x06, h, 48, 48);
  return 1;
}


x86 assembly (clang, -O0):
<hash_sha3_384>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%r8
mov    $0x68,%edi
mov    $0x6,%ecx
mov    $0x30,%r9d
movl   $0x30,(%rsp)
call   1030 <hash_keccak@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_sha3_384>:
push   %rax
mov    %rdi,%r8
movl   $0x30,(%rsp)
mov    $0x68,%edi
mov    $0x6,%ecx
mov    $0x30,%r9d
call   1030 <hash_keccak@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash_sha3_384(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = call i32 @hash_keccak(i32 104, i32* %7, i32 %8, i32 6, i32* %9, i32 48, i32 48)
ret i32 1
}

LLVM IR (-O2):
define i32 @hash_sha3_384(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @hash_keccak(i32 104, i32* %1, i32 %2, i32 6, i32* %0, i32 48, i32 48)
ret i32 1
}
int hasOverDrive(int portnum) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hasOverDrive(i32 %0) {
ret i32 0
}
int test_imm_ABint8_reg(signed char val) {
  return ((val) & (-0xAB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ABint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -171
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ lseek(intptr_t, int /*<<< orphan*/, int);
int64_t vmir_sysio_seek(void *opaque, intptr_t fh, int64_t offset, int whence) {
  return lseek(fh, offset, whence);
}


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

x86 assembly (clang, -O2):
<vmir_sysio_seek>:
mov    %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
jmp    1030 <lseek@plt>

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

LLVM IR (-O2):
define i32 @vmir_sysio_seek(i8* nocapture readnone %0, i64 %1, i32 %2, i32 %3) {
%5 = tail call i32 @lseek(i64 %1, i32 %2, i32 %3)
ret i32 %5
}
int g(int x) {
  if (x >= 0 && x <= 3) {
    x = x ^ 2;
    x = x & 3;
  }
  return x;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112d <g+0x2d>
cmpl   $0x3,-0x4(%rbp)
jg     112d <g+0x2d>
mov    -0x4(%rbp),%eax
xor    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %edi,%eax
and    $0x3,%eax
xor    $0x2,%eax
cmp    $0x4,%edi
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp ult i32 %0, 4
%3 = and i32 %0, 3
%4 = xor i32 %3, 2
%5 = select i1 %2, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
void *xcmalloc(size_t size) {
  void *mem;
  mem = malloc(size);
  return (mem);
}


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

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

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

LLVM IR (-O2):
define noalias i8* @xcmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int baz(a)
int a;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @baz(i32 %0) {
ret i32 0
}
const char *GetSystemLibName() { return "SystemLibrary"; }


x86 assembly (clang, -O0):
<GetSystemLibName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSystemLibName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"SystemLibrary\00"
define i8* @GetSystemLibName() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"SystemLibrary\00"
define i8* @GetSystemLibName() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int do_multi(int, int);
int do_calc(int a, int b) {
  int c = a * b;
  return do_multi(a, c);
}


x86 assembly (clang, -O0):
<do_calc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <do_multi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_calc>:
imul   %edi,%esi
jmp    1030 <do_multi@plt>

LLVM IR (-O0):
define i32 @do_calc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = call i32 @do_multi(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @do_calc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @do_multi(i32 %0, i32 %3)
ret i32 %4
}