xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float a, b;
  double c = 123.456789e100, d = 3.4e-4;
  a = c;
  b = d;
  printf("%f\n", a);
  printf("%f\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef0(%rip),%rbx
movss  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xed4(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store double 0x5521A38175B3D14A, double* %4
store double 3.400000e-04, double* %5
%6 = load double, double* %4
%7 = fptrunc double %6 to float
store float %7, float* %2
%8 = load double, double* %5
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load float, float* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %10)
%12 = load float, float* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x7FF0000000000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x3F364840E0000000)
ret i32 0
}
/* Variables and functions */
void *memchr(const void *s, int c, size_t n) {
  const unsigned char *r = (const unsigned char *)s;
  while (n) {
    if (*r == ((unsigned char)c)) {
      return (void *)r;
    }
    ++r;
    --n;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1161 <memchr+0x61>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1144 <memchr+0x44>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <memchr+0x69>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %rdx,%rdx
je     111f <memchr+0x1f>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     1121 <memchr+0x21>
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %12
%8 = phi i8* [ %0, %5 ], [ %13, %12 ]
%9 = phi i64 [ %2, %5 ], [ %14, %12 ]
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, %6
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = add i64 %9, -1
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %12, %3
%17 = phi i8* [ null, %3 ], [ null, %12 ], [ %8, %7 ]
ret i8* %17
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
size_t write(int, char *, int /*<<< orphan*/);
size_t sendMessage(int socket, char *message) {
  return write(socket, message, strlen(message));
}


x86 assembly (clang, -O0):
<sendMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendMessage>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define i64 @sendMessage(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 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @write(i32 %5, i8* %6, i32 %8)
ret i64 %9
}

LLVM IR (-O2):
define i64 @sendMessage(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @write(i32 %0, i8* %1, i32 %3)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EINVAL;
int formatted_scan(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int vfscanf(FILE *stream, const char *format, va_list arg) {
  int retval;
  if (!stream || !format) {
    return (EINVAL);
  }
  retval = formatted_scan(stream, format, arg);
  return (retval);
}


x86 assembly (clang, -O0):
<vfscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <vfscanf+0x29>
cmpq   $0x0,-0x18(%rbp)
jne    114a <vfscanf+0x3a>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <vfscanf+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <formatted_scan@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfscanf>:
test   %rdi,%rdi
je     111f <vfscanf+0xf>
test   %rsi,%rsi
je     111f <vfscanf+0xf>
jmp    1030 <formatted_scan@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @vfscanf(i32* %0, i8* %1, i32 %2) {
%4 = icmp ne i32* %0, null
%5 = icmp ne i8* %1, null
%6 = and i1 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = load i32, i32* @EINVAL
br label %11
9: ; preds = %3
%10 = tail call i32 @formatted_scan(i32* %0, i8* %1, i32 %2)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %10, %9 ], [ %8, %7 ]
ret i32 %12
}
/* Type definitions */
struct net_device_stats {
  int dummy;
};
struct net_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ LOG_MSG(char *);
struct net_device_stats *rtl8169_get_stats(struct net_device *dev) {
  LOG_MSG("rtl8169_get_stats is called\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.net_device_stats = type { i32 }
%struct.net_device = type { i32 }
@.str = [29 x i8] c"rtl8169_get_stats is called\0A\00"
define %struct.net_device_stats* @rtl8169_get_stats(%struct.net_device* %0) {
%2 = alloca %struct.net_device*
store %struct.net_device* %0, %struct.net_device** %2
%3 = call i32 @LOG_MSG(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret %struct.net_device_stats* null
}

LLVM IR (-O2):
%struct.net_device_stats = type { i32 }
%struct.net_device = type { i32 }
@.str = [29 x i8] c"rtl8169_get_stats is called\0A\00"
define noalias %struct.net_device_stats* @rtl8169_get_stats(%struct.net_device* nocapture readnone %0) {
%2 = tail call i32 @LOG_MSG(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret %struct.net_device_stats* null
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_putnbstr(int *, int);
int /*<<< orphan*/ my_sort_int_tab(int *, int);
int main() {
  int str[6] = {3, 10, 100, 8, 2, 1};
  my_putnbstr(str, 6);
  my_putchar('\n');
  my_sort_int_tab(str, 6);
  my_putnbstr(str, 6);
  my_putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1050 <my_putnbstr@plt>
mov    $0xa,%edi
call   1040 <my_putchar@plt>
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1030 <my_sort_int_tab@plt>
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1050 <my_putnbstr@plt>
mov    $0xa,%edi
call   1040 <my_putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xed4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1050 <my_putnbstr@plt>
mov    $0xa,%edi
call   1040 <my_putchar@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <my_sort_int_tab@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1050 <my_putnbstr@plt>
mov    $0xa,%edi
call   1040 <my_putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [6 x i32] [i32 3, i32 10, i32 100, i32 8, i32 2, i32 1]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @my_putnbstr(i32* %3, i32 6)
%5 = call i32 @my_putchar(i8 signext 10)
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%7 = call i32 @my_sort_int_tab(i32* %6, i32 6)
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%9 = call i32 @my_putnbstr(i32* %8, i32 6)
%10 = call i32 @my_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [6 x i32] [i32 3, i32 10, i32 100, i32 8, i32 2, i32 1]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @my_putnbstr(i32* %3, i32 6)
%5 = call i32 @my_putchar(i8 signext 10)
%6 = call i32 @my_sort_int_tab(i32* %3, i32 6)
%7 = call i32 @my_putnbstr(i32* %3, i32 6)
%8 = call i32 @my_putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
void printf(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @printf(i8* nocapture %0, ...) {
ret void
}
void inc_zcache_flush_found(void) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_flush_found() {
ret void
}
float wrapf(float value, float limit) {
  if (value >= limit)
    return value - limit;
  else if (value < 0.0f)
    return value + limit;
  else
    return value;
}


x86 assembly (clang, -O0):
<wrapf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1131 <wrapf+0x31>
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115c <wrapf+0x5c>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1152 <wrapf+0x52>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115c <wrapf+0x5c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapf>:
ucomiss %xmm1,%xmm0
jae    1112 <wrapf+0x12>
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
jbe    1111 <wrapf+0x11>
addss  %xmm1,%xmm0
ret
subss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @wrapf(float %0, float %1) {
%3 = fcmp ult float %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = fsub float %0, %1
br label %10
6: ; preds = %2
%7 = fcmp olt float %0, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = fadd float %0, %1
br label %10
10: ; preds = %6, %8, %4
%11 = phi float [ %5, %4 ], [ %9, %8 ], [ %0, %6 ]
ret float %11
}
/* Variables and functions */
long llabs(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @llabs() {
ret i64 0
}

LLVM IR (-O2):
define i64 @llabs() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
void *realloc(void *, size_t);
void *erealloc(void *ptr, size_t new_size) {
  void *new_ptr;
  new_ptr = realloc(ptr, new_size);
  if (new_ptr == NULL) {
    fail("Unable to reallocate memory");
  }
  return new_ptr;
}


x86 assembly (clang, -O0):
<erealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <erealloc+0x38>
lea    0xead(%rip),%rdi
call   1030 <fail@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <erealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Unable to reallocate memory\00"
define i8* @erealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @fail(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [28 x i8] c"Unable to reallocate memory\00"
define noalias i8* @erealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fail(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void writeDevice(FILE *fpDeviceName, char A) { fputc(A, fpDeviceName); }


x86 assembly (clang, -O0):
<writeDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeDevice>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @writeDevice(i32* nocapture %0, i8 signext %1) {
%3 = tail call i32 @fputc(i8 signext %1, i32* %0)
ret void
}
const char *dog_get_name() { return "i am dog"; }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"i am dog\00"
define i8* @dog_get_name() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"i am dog\00"
define i8* @dog_get_name() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpunord_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpunord_sd(__m128d __a, __m128d __b) {
  return _mm_cmpunord_sd(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpunord_sd>:
jmp    1030 <_mm_cmpunord_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_cmpunord_sd(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 @_mm_cmpunord_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cmpunord_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpunord_sd(i32 %0, i32 %1)
ret i32 %3
}
const char *__attribute__((weak)) __attribute__((long_call))
__attribute__((section(".test.a"))) __attribute__((no)) weak_l2(void) {
  return "weak_l2";
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"weak_l2\00"
define weak i8* @weak_l2() section ".test.a" {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"weak_l2\00"
define weak i8* @weak_l2() section ".test.a" {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ e_absy();
int /*<<< orphan*/ e_lda();
void e_lda_absy() {
  e_absy();
  e_lda();
}


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

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

LLVM IR (-O0):
define void @e_lda_absy() {
%1 = call i32 (...) @e_absy()
%2 = call i32 (...) @e_lda()
ret void
}

LLVM IR (-O2):
define void @e_lda_absy() {
%1 = tail call i32 (...) @e_absy()
%2 = tail call i32 (...) @e_lda()
ret void
}
extern char *vendor_id2str(int vendor) {
  switch (vendor) {
  case 1:
    return "VENDOR_GAISLER";
  case 4:
    return "VENDOR_ESA";
  case 8:
    return "VENDOR_OPENCORES";
  case 2:
    return "VENDOR_PENDER";
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<vendor_id2str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x7,%eax
ja     1170 <vendor_id2str+0x70>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117d <vendor_id2str+0x7d>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117d <vendor_id2str+0x7d>
lea    0xee3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117d <vendor_id2str+0x7d>
lea    0xee4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117d <vendor_id2str+0x7d>
jmp    1175 <vendor_id2str+0x75>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vendor_id2str>:
add    $0xffffffff,%edi
cmp    $0x7,%edi
ja     1117 <vendor_id2str+0x17>
movslq %edi,%rax
lea    0x2cfe(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"VENDOR_GAISLER\00"
@.str.1 = [11 x i8] c"VENDOR_ESA\00"
@.str.2 = [17 x i8] c"VENDOR_OPENCORES\00"
@.str.3 = [14 x i8] c"VENDOR_PENDER\00"
define i8* @vendor_id2str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 1, label %5
i32 4, label %6
i32 8, label %7
i32 2, label %8
]
5: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
6: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %11
7: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %11
8: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %11
9: ; preds = %1
br label %10
10: ; preds = %9
store i8* null, i8** %2
br label %11
11: ; preds = %10, %8, %7, %6, %5
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [15 x i8] c"VENDOR_GAISLER\00"
@.str.1 = [11 x i8] c"VENDOR_ESA\00"
@.str.2 = [17 x i8] c"VENDOR_OPENCORES\00"
@.str.3 = [14 x i8] c"VENDOR_PENDER\00"
@switch.table.vendor_id2str = [8 x i8*] [i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* null, i8* null, i8* null, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0)]
define i8* @vendor_id2str(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i8*], [8 x i8*]* @switch.table.vendor_id2str, i64 0, i64 %5
%7 = load i8*, i8** %6
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ null, %1 ]
ret i8* %9
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xreparent_send_event(void *_p) {
  return (int)((XEvent *)_p)->xreparent.send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xreparent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int main(int argc, char **argv) {
  float a = 0.0f;
  a += ((__attribute__((unit(foo))) float)1.0f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xede(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0.000000e+00, float* %6
%7 = load float, float* %6
%8 = fadd float %7, 1.000000e+00
store float %8, float* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printPrompt() { printf("mshell > "); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"mshell > \00"
define void @printPrompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pow(double, double);
double Pow(double a, double b) { return pow(a, b); }


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

x86 assembly (clang, -O2):
<Pow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @Pow(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 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @Pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_restart_syscall(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_restart_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_restart_syscall>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_restart_syscall(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ draw_border();
int /*<<< orphan*/ msg_center(int, int, char *);
void display_lose(int nrow, int ncol) {
  clear();
  draw_border();
  msg_center(nrow, ncol, "YOU LOSE.");
}


x86 assembly (clang, -O0):
<display_lose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <clear@plt>
mov    $0x0,%al
call   1040 <draw_border@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdx
call   1030 <msg_center@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_lose>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1040 <draw_border@plt>
lea    0xeb4(%rip),%rdx
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <msg_center@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"YOU LOSE.\00"
define void @display_lose(i32 %0, i32 %1) {
%3 = tail call i32 (...) @clear()
%4 = tail call i32 (...) @draw_border()
%5 = tail call i32 @msg_center(i32 %0, i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcmp(char *, char *);
void where(char *tok) {
  if (!strcmp(tok, "where"))
    puts("Success! \n");
  else
    puts("Where error! \n");
}


x86 assembly (clang, -O0):
<where>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1156 <where+0x36>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
jmp    1162 <where+0x42>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<where>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
lea    0xed0(%rip),%rax
lea    0xed4(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"where\00"
@.str.1 = [11 x i8] c"Success! \0A\00"
@.str.2 = [15 x i8] c"Where error! \0A\00"
define void @where(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"where\00"
@.str.1 = [11 x i8] c"Success! \0A\00"
@.str.2 = [15 x i8] c"Where error! \0A\00"
define void @where(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_log_error(char *, char const *);
void my_assert_equalPtr(const char *description, const void *val1,
                        const void *val2) {
  if (val1 != val2)
    my_log_error("assert failed, \"%s\" pointers do not match\n", description);
}


x86 assembly (clang, -O0):
<my_assert_equalPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1142 <my_assert_equalPtr+0x32>
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <my_log_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_assert_equalPtr>:
cmp    %rdx,%rsi
je     1127 <my_assert_equalPtr+0x17>
mov    %rdi,%rax
lea    0xee1(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <my_log_error@plt>
ret

LLVM IR (-O0):
@.str = [43 x i8] c"assert failed, \22%s\22 pointers do not match\0A\00"
define void @my_assert_equalPtr(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = icmp ne i8* %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = call i32 @my_log_error(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"assert failed, \22%s\22 pointers do not match\0A\00"
define void @my_assert_equalPtr(i8* %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp eq i8* %1, %2
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @my_log_error(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
double exp(double);
double sqrt(int);
double gauss_density(double x) {
  return (1.0 / sqrt(2 * 3.14159265358979323846)) * exp(-0.5 * x * x);
}


x86 assembly (clang, -O0):
<gauss_density>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x6,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xead(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss_density>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
mov    $0x6,%edi
call   1040 <sqrt@plt>
movsd  0xec4(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xeba(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @gauss_density(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @sqrt(i32 6)
%4 = fdiv double 1.000000e+00, %3
%5 = load double, double* %2
%6 = fmul double -5.000000e-01, %5
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = call double @exp(double %8)
%10 = fmul double %4, %9
ret double %10
}

LLVM IR (-O2):
define double @gauss_density(double %0) {
%2 = tail call double @sqrt(i32 6)
%3 = fdiv double 1.000000e+00, %2
%4 = fmul double %0, -5.000000e-01
%5 = fmul double %4, %0
%6 = tail call double @exp(double %5)
%7 = fmul double %3, %6
ret double %7
}
unsigned xrop3_152_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | S;
  stk3 = ~stk3;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_152_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_152_1_1>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_152_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %5
%29 = load i32, i32* %10
%30 = or i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = xor i32 %34, -1
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %7
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %6
%45 = and i32 %43, %44
%46 = or i32 %42, %45
%47 = load i32, i32* %5
%48 = load i32, i32* %7
%49 = and i32 %47, %48
%50 = or i32 %46, %49
ret i32 %50
}

LLVM IR (-O2):
define i32 @xrop3_152_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EVP_cleanup();
int /*<<< orphan*/ printf(char *);
void cleanup_openssl() {
  printf("4\n");
  EVP_cleanup();
}


x86 assembly (clang, -O0):
<cleanup_openssl>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <EVP_cleanup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_openssl>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <EVP_cleanup@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"4\00"
define void @cleanup_openssl() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @EVP_cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xprintf(char *);
void lib_outofmemory(void) { xprintf("PANIC: out of memory!\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"PANIC: out of memory!\0A\00"
define void @lib_outofmemory() {
%1 = call i32 @xprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"PANIC: out of memory!\0A\00"
define void @lib_outofmemory() {
%1 = tail call i32 @xprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
int lib2t21(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @lib2t21() {
ret i32 3
}

LLVM IR (-O2):
define i32 @lib2t21() {
ret i32 3
}
void foo_2_2_1_2_1_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_1_2_2_1_1() {
ret void
}
void g_type_module_unuse() {}


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

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

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

LLVM IR (-O2):
define void @g_type_module_unuse() {
ret void
}
int nextEmptyNode(int *array, int index) {
  int i = index + 1;
  while (array[i] != -1) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<nextEmptyNode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1134 <nextEmptyNode+0x34>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <nextEmptyNode+0x14>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextEmptyNode>:
mov    %esi,%eax
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rcx
add    $0x4,%rcx
nopl   (%rax)
add    $0x1,%eax
cmpl   $0xffffffff,(%rcx)
lea    0x4(%rcx),%rcx
jne    1110 <nextEmptyNode+0x10>
ret

LLVM IR (-O0):
define i32 @nextEmptyNode(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* %4
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %15, %2
%9 = load i32*, i32** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %18
15: ; preds = %8
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %8
18: ; preds = %8
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @nextEmptyNode(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %6, %4 ], [ %3, %2 ]
%6 = add nsw i64 %5, 1
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
ret i32 %11
}
int taa_h264_inverse_cbp_code_i16(int i16mode_num) {
  int cbpy = (i16mode_num < 12) ? 0 : 0x0F;
  if (cbpy)
    i16mode_num -= 12;
  int cbpuv = (i16mode_num / 4);
  return (cbpuv << 4) | cbpy;
}


x86 assembly (clang, -O0):
<taa_h264_inverse_cbp_code_i16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xf,%eax
xor    %ecx,%ecx
cmp    $0xc,%edx
cmovl  %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112d <taa_h264_inverse_cbp_code_i16+0x2d>
mov    -0x4(%rbp),%eax
sub    $0xc,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<taa_h264_inverse_cbp_code_i16>:
lea    -0xc(%rdi),%eax
xor    %ecx,%ecx
cmp    $0xc,%edi
mov    $0xf,%edx
cmovl  %ecx,%edx
cmovl  %edi,%eax
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
lea    (%rdx,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @taa_h264_inverse_cbp_code_i16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 12
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 15
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 12
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %1
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 4
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = shl i32 %17, 4
%19 = load i32, i32* %3
%20 = or i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @taa_h264_inverse_cbp_code_i16(i32 %0) {
%2 = icmp slt i32 %0, 12
%3 = add nsw i32 %0, -12
%4 = select i1 %2, i32 0, i32 15
%5 = select i1 %2, i32 %0, i32 %3
%6 = sdiv i32 %5, 4
%7 = shl i32 %6, 4
%8 = or i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ write(int, long *, int);
void _writel(int fd, long l) { write(fd, &l, sizeof(long)); }


x86 assembly (clang, -O0):
<_writel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_writel>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_writel(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i64* %4, i32 8)
ret void
}

LLVM IR (-O2):
define void @_writel(i32 %0, i64 %1) {
%3 = alloca i64
store i64 %1, i64* %3
%4 = call i32 @write(i32 %0, i64* %3, i32 8)
ret void
}