xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dot();
void sS() {
  dot();
  dot();
  dot();
  cBreak();
}


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

x86 assembly (clang, -O2):
<sS>:
push   %rax
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cBreak@plt>

LLVM IR (-O0):
define void @sS() {
%1 = call i32 (...) @dot()
%2 = call i32 (...) @dot()
%3 = call i32 (...) @dot()
%4 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sS() {
%1 = tail call i32 (...) @dot()
%2 = tail call i32 (...) @dot()
%3 = tail call i32 (...) @dot()
%4 = tail call i32 (...) @cBreak()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void openxcas_set_ecm_pid(uint16_t UNUSED__pid __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @openxcas_set_ecm_pid(i32 %0) {
ret void
}
putstk(typeobj) char typeobj;
{
  zpop();
  if (typeobj == 2) {
    ol("movl %eax, (%edx)");
  } else {
    ol("movb %al, (%edx)");
  }
}


x86 assembly (clang, -O0):
<putstk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1030 <zpop@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x2,%eax
jne    1155 <putstk+0x35>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <ol@plt>
jmp    1163 <putstk+0x43>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstk>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <zpop@plt>
cmp    $0x2,%bl
lea    0xecc(%rip),%rax
lea    0xed7(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <ol@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"movl %eax, (%edx)\00"
@.str.1 = [17 x i8] c"movb %al, (%edx)\00"
define i32 @putstk(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 (...) @zpop()
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %1
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"movl %eax, (%edx)\00"
@.str.1 = [17 x i8] c"movb %al, (%edx)\00"
define i32 @putstk(i32 %0) {
%2 = tail call i32 (...) @zpop()
%3 = and i32 %0, 255
%4 = icmp eq i32 %3, 2
%5 = select i1 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* %5)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int main1(int);
int main(void) {
  check_vect();
  return main1(8);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    $0x8,%edi
pop    %rax
jmp    1040 <main1@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 @main1(i32 8)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int posix_memalign(void **, size_t, size_t);
int /*<<< orphan*/ stderr;
char *strerror(int);
void *align_malloc(size_t align, size_t size) {
  void *ptr;
  int ret = posix_memalign(&ptr, align, size);
  if (ret != 0) {
    fprintf(stderr, "%s", strerror(ret));
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<align_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1050 <posix_memalign@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     119b <align_malloc+0x5b>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
call   1060 <strerror@plt>
mov    -0x20(%rbp),%edi
mov    %rax,%rdx
lea    0xe71(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_malloc>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0x8(%rsp),%rdi
call   1050 <posix_memalign@plt>
test   %eax,%eax
jne    1164 <align_malloc+0x24>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e75(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1060 <strerror@plt>
lea    0xe85(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define i8* @align_malloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @posix_memalign(i8** %3, i64 %0, i64 %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i8* @strerror(i32 %5)
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %2
%13 = load i8*, i8** %3
ret i8* %13
}
int inp_keypr(int i) {
  const char keypr[11] = {3, 4, 1, 2, 5, 6, 3, 5, 6, ' ', 4};
  int k = keypr[i];
  if (0)
    k |= 0 == 1 ? 0x200 : 0x400;
  if (i >= 6)
    k |= 0x100;
  return k;
}


x86 assembly (clang, -O0):
<inp_keypr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xeef(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xee7(%rip),%al
mov    %al,-0x5(%rbp)
movslq -0x4(%rbp),%rax
movsbl -0xf(%rbp,%rax,1),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x6,-0x4(%rbp)
jl     1147 <inp_keypr+0x47>
mov    -0x14(%rbp),%eax
or     $0x100,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inp_keypr>:
movslq %edi,%rcx
lea    0xef6(%rip),%rax
movsbl (%rcx,%rax,1),%edx
mov    %edx,%eax
or     $0x100,%eax
cmp    $0x6,%ecx
cmovl  %edx,%eax
ret

LLVM IR (-O0):
@__const.inp_keypr.keypr = [11 x i8] c"\03\04\01\02\05\06\03\05\06 \04"
define i32 @inp_keypr(i32 %0) {
%2 = alloca i32
%3 = alloca [11 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast [11 x i8]* %3 to i8*
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 6
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32, i32* %4
%15 = or i32 %14, 256
store i32 %15, i32* %4
br label %16
16: ; preds = %13, %1
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
@__const.inp_keypr.keypr = [11 x i8] c"\03\04\01\02\05\06\03\05\06 \04"
define i32 @inp_keypr(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [11 x i8], [11 x i8]* @__const.inp_keypr.keypr, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %0, 5
%7 = or i32 %5, 256
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
float inToCm(float in) { return in * 2.54; }


x86 assembly (clang, -O0):
<inToCm>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inToCm>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @inToCm(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 2.540000e+00
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @inToCm(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 2.540000e+00
%4 = fptrunc double %3 to float
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char const *, int, int);
char *tgoto(const char *cap, int col, int row) {
  static char buf[30];
  snprintf(buf, sizeof(buf), cap, row + 1, col + 1);
  return (buf);
}


x86 assembly (clang, -O0):
<tgoto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
mov    -0xc(%rbp),%r8d
add    $0x1,%r8d
lea    0x2f05(%rip),%rdi
mov    $0x1e,%esi
call   1030 <snprintf@plt>
lea    0x2ef4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgoto>:
push   %rbx
mov    %rdi,%rax
lea    0x1(%rdx),%ecx
lea    0x1(%rsi),%r8d
lea    0x2f1e(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    %rax,%rdx
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@tgoto.buf = internal global [30 x i8] zeroinitializer
define i8* @tgoto(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = call i32 @snprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tgoto.buf, i64 0, i64 0), i32 30, i8* %7, i32 %9, i32 %11)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tgoto.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@tgoto.buf = internal global [30 x i8] zeroinitializer
define i8* @tgoto(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = add nsw i32 %1, 1
%6 = tail call i32 @snprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tgoto.buf, i64 0, i64 0), i32 30, i8* %0, i32 %4, i32 %5)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tgoto.buf, i64 0, i64 0)
}
/* Variables and functions */
float __nv_logf(float);
float logf(float __a) { return __nv_logf(__a); }


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

x86 assembly (clang, -O2):
<logf>:
jmp    1030 <__nv_logf@plt>

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

LLVM IR (-O2):
define float @logf(float %0) {
%2 = tail call float @__nv_logf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ ft_strdel(char **);
char *ft_strjoin(char *, char *);
char *ft_strmergeflag(char *a, char *b, int flag) {
  char *ret;
  ret = ft_strjoin(a, b);
  if (flag & 1)
    ft_strdel(&a);
  if (flag & 2)
    ft_strdel(&b);
  return (ret);
}


x86 assembly (clang, -O0):
<ft_strmergeflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ft_strjoin@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     115c <ft_strmergeflag+0x3c>
lea    -0x8(%rbp),%rdi
call   1030 <ft_strdel@plt>
mov    -0x14(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1174 <ft_strmergeflag+0x54>
lea    -0x10(%rbp),%rdi
call   1030 <ft_strdel@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strmergeflag>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edx,%ebp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
call   1040 <ft_strjoin@plt>
mov    %rax,%rbx
test   $0x1,%bpl
je     114a <ft_strmergeflag+0x2a>
lea    0x10(%rsp),%rdi
call   1030 <ft_strdel@plt>
test   $0x2,%bpl
je     115a <ft_strmergeflag+0x3a>
lea    0x8(%rsp),%rdi
call   1030 <ft_strdel@plt>
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ft_strmergeflag(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i8* @ft_strjoin(i8* %8, i8* %9)
store i8* %10, i8** %7
%11 = load i32, i32* %6
%12 = and i32 %11, 1
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @ft_strdel(i8** %4)
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %6
%18 = and i32 %17, 2
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @ft_strdel(i8** %5)
br label %22
22: ; preds = %20, %16
%23 = load i8*, i8** %7
ret i8* %23
}

LLVM IR (-O2):
define i8* @ft_strmergeflag(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = tail call i8* @ft_strjoin(i8* %0, i8* %1)
%7 = and i32 %2, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = call i32 @ft_strdel(i8** %4)
br label %11
11: ; preds = %9, %3
%12 = and i32 %2, 2
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = call i32 @ft_strdel(i8** %5)
br label %16
16: ; preds = %14, %11
ret i8* %6
}
/* Variables and functions */
float sqrtf(float);
float calc_dist(float x, float y) { return sqrtf((x * x + y * y)); }


x86 assembly (clang, -O0):
<calc_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_dist>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <calc_dist+0x19>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @calc_dist(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = call float @llvm.fmuladd.f32(float %5, float %6, float %9)
%11 = call float @sqrtf(float %10)
ret float %11
}

LLVM IR (-O2):
define float @calc_dist(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = tail call float @sqrtf(float %4)
ret float %5
}
double dmax(double x, double y) { return (x > y) ? x : y; }


x86 assembly (clang, -O0):
<dmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <dmax+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <dmax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dmax(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 ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @dmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
struct evp_test {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EVP_PKEY_decrypt;
int /*<<< orphan*/ EVP_PKEY_decrypt_init;
int pkey_test_init(struct evp_test *, char const *, int /*<<< orphan*/,
                   int /*<<< orphan*/, int /*<<< orphan*/);
int decrypt_test_init(struct evp_test *t, const char *name) {
  return pkey_test_init(t, name, 0, EVP_PKEY_decrypt_init, EVP_PKEY_decrypt);
}


x86 assembly (clang, -O0):
<decrypt_test_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea0(%rip),%rax
mov    (%rax),%r8d
xor    %edx,%edx
call   1030 <pkey_test_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt_test_init>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    (%rax),%r8d
xor    %edx,%edx
jmp    1030 <pkey_test_init@plt>

LLVM IR (-O0):
%struct.evp_test = type { i32 }
@EVP_PKEY_decrypt_init = global i32 0
@EVP_PKEY_decrypt = global i32 0
define i32 @decrypt_test_init(%struct.evp_test* %0, i8* %1) {
%3 = alloca %struct.evp_test*
%4 = alloca i8*
store %struct.evp_test* %0, %struct.evp_test** %3
store i8* %1, i8** %4
%5 = load %struct.evp_test*, %struct.evp_test** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EVP_PKEY_decrypt_init
%8 = load i32, i32* @EVP_PKEY_decrypt
%9 = call i32 @pkey_test_init(%struct.evp_test* %5, i8* %6, i32 0, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.evp_test = type { i32 }
@EVP_PKEY_decrypt_init = global i32 0
@EVP_PKEY_decrypt = global i32 0
define i32 @decrypt_test_init(%struct.evp_test* %0, i8* %1) {
%3 = load i32, i32* @EVP_PKEY_decrypt_init
%4 = load i32, i32* @EVP_PKEY_decrypt
%5 = tail call i32 @pkey_test_init(%struct.evp_test* %0, i8* %1, i32 0, i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c_init(void) { printf("init\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"init\00"
define void @c_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
void patchp_(useg, vseg) int *useg, *vseg;
{ patchprecision((long)*useg, (long)*vseg); }


x86 assembly (clang, -O0):
<patchp_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq (%rax),%rsi
mov    $0x0,%al
call   1030 <patchprecision@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<patchp_>:
movslq (%rdi),%rdi
movslq (%rsi),%rsi
xor    %eax,%eax
jmp    1030 <patchprecision@plt>

LLVM IR (-O0):
define void @patchp_(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = call i32 (i64, i64, ...) bitcast (i32 (...)* @patchprecision to i32 (i64, i64, ...)*)(i64 %7, i64 %10)
ret void
}

LLVM IR (-O2):
define void @patchp_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = tail call i32 (i64, i64, ...) bitcast (i32 (...)* @patchprecision to i32 (i64, i64, ...)*)(i64 %4, i64 %6)
ret void
}
__attribute__((no, noclone)) void fn_a(volatile int a[]) { a[4] = 5; }


x86 assembly (clang, -O0):
<fn_a>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x5,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_a>:
movl   $0x5,0x10(%rdi)
ret

LLVM IR (-O0):
define void @fn_a(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
store volatile i32 5, i32* %4
ret void
}

LLVM IR (-O2):
define void @fn_a(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
store volatile i32 5, i32* %2
ret void
}
void g(int *ref) { ref[2] = 3 * ref[2]; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3,0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    0x8(%rdi),%eax
lea    (%rax,%rax,2),%eax
mov    %eax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @g(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = mul nsw i32 3, %5
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @g(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 3
store i32 %4, i32* %2
ret void
}
int halving(unsigned min, unsigned max) { return (max + min) / 2; }


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

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

LLVM IR (-O0):
define i32 @halving(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %5, %6
%8 = udiv i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @halving(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = lshr i32 %3, 1
ret i32 %4
}
int test_imm_9Eint8_mem(signed char *val) {
  return ((*val) & (0x9E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Eint8_mem>:
testb  $0x9e,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Eint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 158
%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_9Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -98
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned func3(void) {
  unsigned j;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @func3() {
%1 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @func3() {
ret i32 0
}
/* Variables and functions */
int abs(int);
int distance(int i, int j) { return abs(i - j); }


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

x86 assembly (clang, -O2):
<distance>:
sub    %esi,%edi
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @distance(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @llvm.abs.i32(i32 %3, i1 true)
ret i32 %4
}
/* Variables and functions */
double exp(double);
double pow10(double x) { return exp(x * 2.30258509299404568402); }


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

x86 assembly (clang, -O2):
<pow10>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @pow10(double %0) {
%2 = fmul double %0, 0x40026BB1BBB55516
%3 = tail call double @exp(double %2)
ret double %3
}
int chroot(char *dir) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @chroot(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ floor(double);
int pmod(int /*<<< orphan*/, double);
int MinFromTime(double t) { return pmod(floor(t / (60.0 * 1000.0)), 60.0); }


x86 assembly (clang, -O0):
<MinFromTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
mov    %eax,%edi
movsd  0xeb3(%rip),%xmm0
call   1040 <pmod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MinFromTime>:
push   %rax
divsd  0xed7(%rip),%xmm0
call   1030 <floor@plt>
movsd  0xed2(%rip),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1040 <pmod@plt>

LLVM IR (-O0):
define i32 @MinFromTime(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 6.000000e+04
%5 = call i32 @floor(double %4)
%6 = call i32 @pmod(i32 %5, double 6.000000e+01)
ret i32 %6
}

LLVM IR (-O2):
define i32 @MinFromTime(double %0) {
%2 = fdiv double %0, 6.000000e+04
%3 = tail call i32 @floor(double %2)
%4 = tail call i32 @pmod(i32 %3, double 6.000000e+01)
ret i32 %4
}
/* Type definitions */
struct t_list {
  int dummy;
};

/* Variables and functions */
struct t_list *add_front_int(struct t_list *, int);
struct t_list *push_int(struct t_list *plist, int num) {
  return add_front_int(plist, num);
}


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

x86 assembly (clang, -O2):
<push_int>:
jmp    1030 <add_front_int@plt>

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

LLVM IR (-O2):
%struct.t_list = type { i32 }
define %struct.t_list* @push_int(%struct.t_list* %0, i32 %1) {
%3 = tail call %struct.t_list* @add_front_int(%struct.t_list* %0, i32 %1)
ret %struct.t_list* %3
}
int Add(int x, int y) {
  if (y == 0)
    return x;
  else
    return Add(x ^ y, (x & y) << 1);
}


x86 assembly (clang, -O0):
<Add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <Add+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <Add+0x3a>
mov    -0x8(%rbp),%edi
xor    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
and    -0xc(%rbp),%esi
shl    $0x1,%esi
call   1030 <Add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Add>:
test   %esi,%esi
je     111d <Add+0x1d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %esi,%eax
xor    %edi,%eax
and    %edi,%esi
mov    %eax,%edi
add    %esi,%esi
jne    1110 <Add+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Add(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = xor i32 %5, %6
%8 = and i32 %5, %6
%9 = shl i32 %8, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ %0, %2 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int my_power(int, int);
int my_handler(int a) { return my_power(a, 2); }


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

x86 assembly (clang, -O2):
<my_handler>:
mov    $0x2,%esi
jmp    1030 <my_power@plt>

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

LLVM IR (-O2):
define i32 @my_handler(i32 %0) {
%2 = tail call i32 @my_power(i32 %0, i32 2)
ret i32 %2
}
float GTR2(float NdotH, float a) {
  float a2 = a * a;
  float t = 1 + (a2 - 1) * NdotH * NdotH;
  return a2 / (3.14159265358979323846264 * t * t);
}


x86 assembly (clang, -O0):
<GTR2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xede(%rip),%xmm1
subss  %xmm1,%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xec4(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe99(%rip),%xmm1
mulsd  %xmm2,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GTR2>:
mulss  %xmm1,%xmm1
cvtss2sd %xmm1,%xmm2
addss  0xef0(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
addss  0xee4(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
divsd  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @GTR2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
store float %9, float* %5
%10 = load float, float* %5
%11 = fsub float %10, 1.000000e+00
%12 = load float, float* %3
%13 = fmul float %11, %12
%14 = load float, float* %3
%15 = call float @llvm.fmuladd.f32(float %13, float %14, float 1.000000e+00)
store float %15, float* %6
%16 = load float, float* %5
%17 = fpext float %16 to double
%18 = load float, float* %6
%19 = fpext float %18 to double
%20 = fmul double 0x400921FB54442D18, %19
%21 = load float, float* %6
%22 = fpext float %21 to double
%23 = fmul double %20, %22
%24 = fdiv double %17, %23
%25 = fptrunc double %24 to float
ret float %25
}

LLVM IR (-O2):
define float @GTR2(float %0, float %1) {
%3 = fmul float %1, %1
%4 = fadd float %3, -1.000000e+00
%5 = fmul float %4, %0
%6 = tail call float @llvm.fmuladd.f32(float %5, float %0, float 1.000000e+00)
%7 = fpext float %3 to double
%8 = fpext float %6 to double
%9 = fmul double %8, 0x400921FB54442D18
%10 = fmul double %9, %8
%11 = fdiv double %7, %10
%12 = fptrunc double %11 to float
ret float %12
}
/* Variables and functions */
int sl_select_ex(int, int, int /*<<< orphan*/);
int sl_select(int fd, int msec) { return sl_select_ex(fd, msec, 0); }


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

x86 assembly (clang, -O2):
<sl_select>:
xor    %edx,%edx
jmp    1030 <sl_select_ex@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ dll_rewind(int /*<<< orphan*/ *);
void __wrap_rewind(FILE *stream) { dll_rewind(stream); }


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

x86 assembly (clang, -O2):
<__wrap_rewind>:
jmp    1030 <dll_rewind@plt>

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

LLVM IR (-O2):
define void @__wrap_rewind(i32* %0) {
%2 = tail call i32 @dll_rewind(i32* %0)
ret void
}
int test_imm_DAuint8_reg(unsigned char val) {
  return ((val) & (0xDA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DAuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 218
%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_DAuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -38
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int is_slash(int c) { return c == '/' || c == '\\'; }


x86 assembly (clang, -O0):
<is_slash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x2f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <is_slash+0x20>
cmpl   $0x5c,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_slash>:
cmp    $0x2f,%edi
sete   %al
cmp    $0x5c,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_slash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 47
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 92
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_slash(i32 %0) {
%2 = icmp eq i32 %0, 47
%3 = icmp eq i32 %0, 92
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int fib(int n) {
  if (n > 1) {
    return fib(n - 1) + fib(n - 2);
  }
  return n;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114d <fib+0x3d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib+0x43>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1136 <fib+0x26>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1120 <fib+0x10>
jmp    1138 <fib+0x28>
mov    %ebx,%ecx
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ugt i32 %4, 3
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ ioperm(int, int, int);
int /*<<< orphan*/ outb(int, int);
int main(void) {
  ioperm(0x340, 0x342, 1);
  outb(0x340, 0x0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x340,%edi
mov    $0x342,%esi
mov    $0x1,%edx
call   1040 <ioperm@plt>
mov    $0x340,%edi
xor    %esi,%esi
call   1030 <outb@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x340,%edi
mov    $0x342,%esi
mov    $0x1,%edx
call   1040 <ioperm@plt>
mov    $0x340,%edi
xor    %esi,%esi
call   1030 <outb@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ioperm(i32 832, i32 834, i32 1)
%3 = call i32 @outb(i32 832, i32 0)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ioperm(i32 832, i32 834, i32 1)
%2 = tail call i32 @outb(i32 832, i32 0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
int fun1333() { return 1333; }


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

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

LLVM IR (-O0):
define i32 @fun1333() {
ret i32 1333
}

LLVM IR (-O2):
define i32 @fun1333() {
ret i32 1333
}
int fibonacci(int n) {
  if (n == 1 || n == 2) {
    return 1;
  } else {
    return fibonacci(n - 1) + fibonacci(n - 2);
  }
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     112f <fibonacci+0x1f>
cmpl   $0x2,-0x8(%rbp)
jne    113b <fibonacci+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    115e <fibonacci+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
cmp    $0x2,%ebp
jb     1144 <fibonacci+0x34>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <fibonacci@plt>
add    %eax,%ebx
add    $0xfffffffe,%ebp
cmp    $0x1,%ebp
ja     1130 <fibonacci+0x20>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i32 @fibonacci(i32 %5)
%9 = add nsw i32 %6, -2
%10 = add nsw i32 %8, %7
%11 = add i32 %6, -3
%12 = icmp ult i32 %11, 2
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i32 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 1, %1 ], [ %14, %13 ]
ret i32 %16
}
/* Type definitions */
struct search_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ generic_search(struct search_info *, int,
                                  int /*<<< orphan*/);
void dfs(struct search_info *results, int root) {
  generic_search(results, root, 0);
}


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

x86 assembly (clang, -O2):
<dfs>:
xor    %edx,%edx
jmp    1030 <generic_search@plt>

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

LLVM IR (-O2):
%struct.search_info = type { i32 }
define void @dfs(%struct.search_info* %0, i32 %1) {
%3 = tail call i32 @generic_search(%struct.search_info* %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
long long f(long long);
long long m(int n) {
  if (n == 0) {
    return 0;
  }
  return n - f(m(n - 1));
}


x86 assembly (clang, -O0):
<m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1142 <m+0x22>
movq   $0x0,-0x8(%rbp)
jmp    116b <m+0x4b>
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1040 <m@plt>
mov    %rax,%rdi
call   1030 <f@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m>:
push   %rbx
test   %edi,%edi
je     113d <m+0x1d>
movslq %edi,%rbx
add    $0xffffffff,%edi
call   1040 <m@plt>
mov    %rax,%rdi
call   1030 <f@plt>
sub    %rax,%rbx
jmp    113f <m+0x1f>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @m(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %10, %5 ], [ 0, %1 ]
ret i64 %4
5: ; preds = %1
%6 = sext i32 %0 to i64
%7 = add nsw i32 %0, -1
%8 = tail call i64 @m(i32 %7)
%9 = tail call i64 @f(i64 %8)
%10 = sub nsw i64 %6, %9
br label %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int width;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
void set_XSizeHints_width(void *_p, int _v) {
  ((XSizeHints *)_p)->width = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XSizeHints_width>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XSizeHints_width(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XSizeHints_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
__attribute__((always_)) unsigned *WriteUnsigned2(unsigned *ptr, unsigned out0,
                                                  unsigned out1) {
  *(unsigned long long *)(ptr) = out0 | ((unsigned long long)(out1) << 32);
  return ptr + 2;
}


x86 assembly (clang, -O0):
<WriteUnsigned2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    $0x20,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteUnsigned2>:
mov    %esi,%eax
shl    $0x20,%rdx
or     %rax,%rdx
mov    %rdx,(%rdi)
lea    0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @WriteUnsigned2(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 = zext i32 %7 to i64
%9 = load i32, i32* %6
%10 = zext i32 %9 to i64
%11 = shl i64 %10, 32
%12 = or i64 %8, %11
%13 = load i32*, i32** %4
%14 = bitcast i32* %13 to i64*
store i64 %12, i64* %14
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 2
ret i32* %16
}

LLVM IR (-O2):
define i32* @WriteUnsigned2(i32* writeonly %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = zext i32 %2 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
%8 = bitcast i32* %0 to i64*
store i64 %7, i64* %8
%9 = getelementptr inbounds i32, i32* %0, i64 2
ret i32* %9
}