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

/* Variables and functions */
int /*<<< orphan*/ set_rounding(int /*<<< orphan*/ const *);
float sqrtf(float const);
void sqrt_s(const uint32_t *fcr31, const float *source, float *target) {
  set_rounding(fcr31);
  *target = sqrtf(*source);
}


x86 assembly (clang, -O0):
<sqrt_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <set_rounding@plt>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <sqrtf@plt>
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_s>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <set_rounding@plt>
movss  (%rbx),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1141 <sqrt_s+0x21>
sqrtss %xmm0,%xmm0
jmp    1146 <sqrt_s+0x26>
call   1030 <sqrtf@plt>
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sqrt_s(i32* %0, float* %1, float* %2) {
%4 = alloca i32*
%5 = alloca float*
%6 = alloca float*
store i32* %0, i32** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load i32*, i32** %4
%8 = call i32 @set_rounding(i32* %7)
%9 = load float*, float** %5
%10 = load float, float* %9
%11 = call float @sqrtf(float %10)
%12 = load float*, float** %6
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @sqrt_s(i32* %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = tail call i32 @set_rounding(i32* %0)
%5 = load float, float* %1
%6 = tail call float @sqrtf(float %5)
store float %6, float* %2
ret void
}
float y(float x) { return 1 / (1 + x); }


x86 assembly (clang, -O0):
<y>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm1
addss  -0x4(%rbp),%xmm1
movss  0xee2(%rip),%xmm0
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<y>:
movss  0xef8(%rip),%xmm1
addss  %xmm1,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @y(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float 1.000000e+00, %3
%5 = fdiv float 1.000000e+00, %4
ret float %5
}

LLVM IR (-O2):
define float @y(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fdiv float 1.000000e+00, %2
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ towers_of_hanoi(int, char, char, char);
int main() {
  towers_of_hanoi(5, 's', 'd', 't');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x73,%esi
mov    $0x64,%edx
mov    $0x74,%ecx
call   1030 <towers_of_hanoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x73,%esi
mov    $0x64,%edx
mov    $0x74,%ecx
call   1030 <towers_of_hanoi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @towers_of_hanoi(i32 5, i8 signext 115, i8 signext 100, i8 signext 116)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @towers_of_hanoi(i32 5, i8 signext 115, i8 signext 100, i8 signext 116)
ret i32 0
}
/* Type definitions */
struct btf_type {
  int dummy;
};
struct btf_array {
  int dummy;
};

/* Variables and functions */
struct btf_array *btf_array(const struct btf_type *t) {
  return (struct btf_array *)(t + 1);
}


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

x86 assembly (clang, -O2):
<btf_array>:
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
%struct.btf_array = type { i32 }
%struct.btf_type = type { i32 }
define %struct.btf_array* @btf_array(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %3, i64 1
%5 = bitcast %struct.btf_type* %4 to %struct.btf_array*
ret %struct.btf_array* %5
}

LLVM IR (-O2):
%struct.btf_array = type { i32 }
%struct.btf_type = type { i32 }
define %struct.btf_array* @btf_array(%struct.btf_type* readnone %0) {
%2 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %0, i64 1
%3 = bitcast %struct.btf_type* %2 to %struct.btf_array*
ret %struct.btf_array* %3
}
void udfexample_reinit() {}


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

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

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

LLVM IR (-O2):
define void @udfexample_reinit() {
ret void
}
unsigned long round8(unsigned long v) {
  if (v % 8 != 0) {
    v += 8 - (v % 8);
  }
  return v;
}


x86 assembly (clang, -O0):
<round8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7,%rax
cmp    $0x0,%rax
je     1132 <round8+0x32>
mov    -0x8(%rbp),%rcx
and    $0x7,%rcx
mov    $0x8,%eax
sub    %rcx,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round8>:
mov    %edi,%ecx
and    $0x7,%ecx
mov    $0x8,%eax
sub    %rcx,%rax
test   %rcx,%rcx
cmove  %rcx,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @round8(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = urem i64 %3, 8
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i64, i64* %2
%8 = urem i64 %7, 8
%9 = sub i64 8, %8
%10 = load i64, i64* %2
%11 = add i64 %10, %9
store i64 %11, i64* %2
br label %12
12: ; preds = %6, %1
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
define i64 @round8(i64 %0) {
%2 = and i64 %0, 7
%3 = icmp eq i64 %2, 0
%4 = sub nuw nsw i64 8, %2
%5 = select i1 %3, i64 0, i64 %4
%6 = add i64 %5, %0
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ fputc(int, char);
int print_str(int fd, char *str) {
  int count = 0;
  char c;
  while ((c = *str++) != 0) {
    fputc(fd, c);
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x15(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1160 <print_str+0x50>
mov    -0x4(%rbp),%edi
movsbl -0x15(%rbp),%esi
call   1030 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_str+0x16>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %rbp
push   %r14
push   %rbx
mov    (%rsi),%al
test   %al,%al
je     114a <print_str+0x3a>
mov    %rsi,%r14
mov    %edi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %ebp,%edi
call   1030 <fputc@plt>
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <print_str+0x20>
jmp    114c <print_str+0x3c>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @print_str(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = tail call i32 @fputc(i32 %0, i8 signext %6)
%11 = add nuw nsw i32 %8, 1
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xf3() {
  Assert_real((isgraph(243) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1220, ("isgraph should be 0 for 0xf3"));
}


x86 assembly (clang, -O0):
<t_isgraph_0xf3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf3,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4c4,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0xf3>:
push   %rax
mov    $0xf3,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4c4,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf3\00"
define void @t_isgraph_0xf3() {
%1 = call i64 @isgraph(i32 243)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1220, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf3\00"
define void @t_isgraph_0xf3() {
%1 = tail call i64 @isgraph(i32 243)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1220, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int R(int /*<<< orphan*/);
int /*<<< orphan*/ cudaFreeHost(void *);
int /*<<< orphan*/ msg_print(char *);
int FreeHost(void *hstPtr) {
  msg_print("[FreeHost]");
  return R(cudaFreeHost(hstPtr));
}


x86 assembly (clang, -O0):
<FreeHost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <msg_print@plt>
mov    -0x8(%rbp),%rdi
call   1050 <cudaFreeHost@plt>
mov    %eax,%edi
call   1030 <R@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeHost>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <msg_print@plt>
mov    %rbx,%rdi
call   1050 <cudaFreeHost@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <R@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"[FreeHost]\00"
define i32 @FreeHost(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @msg_print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @cudaFreeHost(i8* %4)
%6 = call i32 @R(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"[FreeHost]\00"
define i32 @FreeHost(i8* %0) {
%2 = tail call i32 @msg_print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @cudaFreeHost(i8* %0)
%4 = tail call i32 @R(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ rt_InitInfAndNaN(unsigned int);
void transform_mag_initialize(void) { rt_InitInfAndNaN(8U); }


x86 assembly (clang, -O0):
<transform_mag_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <rt_InitInfAndNaN@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform_mag_initialize>:
mov    $0x8,%edi
jmp    1030 <rt_InitInfAndNaN@plt>

LLVM IR (-O0):
define void @transform_mag_initialize() {
%1 = call i32 @rt_InitInfAndNaN(i32 8)
ret void
}

LLVM IR (-O2):
define void @transform_mag_initialize() {
%1 = tail call i32 @rt_InitInfAndNaN(i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XClassHint;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XClassHint(void *_p) {
  if (_p == NULL)
    abort();
  free((XClassHint *)_p);
}


x86 assembly (clang, -O0):
<free_XClassHint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XClassHint+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XClassHint>:
test   %rdi,%rdi
je     112a <free_XClassHint+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XClassHint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XClassHint(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned int);
void vp8cx_vertical_band_2_1_scale_c(unsigned char *source,
                                     unsigned int src_pitch,
                                     unsigned char *dest,
                                     unsigned int dest_pitch,
                                     unsigned int dest_width) {
  (void)dest_pitch;
  (void)src_pitch;
  memcpy(dest, source, dest_width);
}


x86 assembly (clang, -O0):
<vp8cx_vertical_band_2_1_scale_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8cx_vertical_band_2_1_scale_c>:
mov    %rdi,%rsi
mov    %rdx,%rdi
mov    %r8d,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @vp8cx_vertical_band_2_1_scale_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @memcpy(i8* %2, i8* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_pid_get_session(pid_t pid,
                                                              char **session) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_pid_get_session>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_pid_get_session>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_pid_get_session(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_pid_get_session(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
double __nv_normcdfinv(double);
double normcdfinv(double __a) { return __nv_normcdfinv(__a); }


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

x86 assembly (clang, -O2):
<normcdfinv>:
jmp    1030 <__nv_normcdfinv@plt>

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

LLVM IR (-O2):
define double @normcdfinv(double %0) {
%2 = tail call double @__nv_normcdfinv(double %0)
ret double %2
}
/* Variables and functions */
int *leak_pointer();
int *malloc(int);
int /*<<< orphan*/ puts(char *);
scalar_t__ test_equal(int *, int *);
int equals_after_stack_free() {
  int *x = leak_pointer();
  int *y = malloc(sizeof(int));
  if (test_equal(x, y)) {
    puts("EQ!");
  }
  return 1;
}


x86 assembly (clang, -O0):
<equals_after_stack_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <leak_pointer@plt>
mov    %rax,-0x8(%rbp)
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <test_equal@plt>
cmp    $0x0,%rax
je     1184 <equals_after_stack_free+0x44>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equals_after_stack_free>:
push   %rbx
xor    %eax,%eax
call   1050 <leak_pointer@plt>
mov    %rax,%rbx
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <test_equal@plt>
test   %rax,%rax
je     1171 <equals_after_stack_free+0x31>
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"EQ!\00"
define i32 @equals_after_stack_free() {
%1 = tail call i32* (...) @leak_pointer()
%2 = tail call i32* @malloc(i32 4)
%3 = tail call i64 @test_equal(i32* %1, i32* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("utsl... HAHAHA YOU'VE BEEN SUFFIELDED\n"); }


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"utsl... HAHAHA YOU'VE BEEN SUFFIELDED\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"utsl... HAHAHA YOU'VE BEEN SUFFIELDED\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret void
}
int main() {
  int *p = p;
  *p = 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = load i32*, i32** %1
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store i32 0, i32* %3
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int factor_tail(int);
int term();
int factor() {
  int lvalue = term();
  return factor_tail(lvalue);
}


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

x86 assembly (clang, -O2):
<factor>:
push   %rax
xor    %eax,%eax
call   1030 <term@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <factor_tail@plt>

LLVM IR (-O0):
define i32 @factor() {
%1 = alloca i32
%2 = call i32 (...) @term()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @factor_tail(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @factor() {
%1 = tail call i32 (...) @term()
%2 = tail call i32 @factor_tail(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
size_t mbsrtowcs(int /*<<< orphan*/ *, char const **, size_t,
                 int /*<<< orphan*/ *);
size_t mbstowcs(wchar_t *dst, const char *src, size_t len) {
  return mbsrtowcs(dst, &src, len, NULL);
}


x86 assembly (clang, -O0):
<mbstowcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <mbsrtowcs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbstowcs>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
xor    %ecx,%ecx
call   1030 <mbsrtowcs@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @mbstowcs(i32* %0, i8* %1, i64 %2) {
%4 = alloca i8*
store i8* %1, i8** %4
%5 = call i64 @mbsrtowcs(i32* %0, i8** %4, i64 %2, i32* null)
ret i64 %5
}
void declsOnly() {
  enum __attribute__((aligned)) T *p0;
  enum __attribute__((may_alias)) T *p1;
  enum T *p2;
  enum __attribute__((deprecated(""))) T *p3;
  enum T *p4;
}


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

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

LLVM IR (-O0):
define void @declsOnly() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
ret void
}

LLVM IR (-O2):
define void @declsOnly() {
ret void
}
/* Variables and functions */
int bitvec_byte_size(size_t length) { return (length + 7) >> 3; }


x86 assembly (clang, -O0):
<bitvec_byte_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x7,%rax
shr    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitvec_byte_size>:
lea    0x7(%rdi),%rax
shr    $0x3,%rax
ret

LLVM IR (-O0):
define i32 @bitvec_byte_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 7
%5 = lshr i64 %4, 3
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @bitvec_byte_size(i64 %0) {
%2 = add i64 %0, 7
%3 = lshr i64 %2, 3
%4 = trunc i64 %3 to i32
ret i32 %4
}
void sys_exit(int status) {
  asm volatile("int %0\n" : : "i"(49), "a"(status) : "cc", "memory");
loop:
  goto loop;
}


x86 assembly (clang, -O0):
<sys_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
int    $0x31
jmp    110c <sys_exit+0xc>

x86 assembly (clang, -O2):
<sys_exit>:
mov    %edi,%eax
int    $0x31
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1110 <sys_exit+0x10>

LLVM IR (-O0):
define void @sys_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %1
br label %4
}

LLVM IR (-O2):
define void @sys_exit(i32 %0) {
tail call void asm sideeffect "int $0\0A", "i,{ax},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 49, i32 %0)
br label %2
2: ; preds = %2, %1
br label %2
}
int cmpStrInc(const void *pa, const void *pb) {
  char *p1 = (char *)pa;
  char *p2 = (char *)pb;
  return *p1 - *p2;
}


x86 assembly (clang, -O0):
<cmpStrInc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpStrInc>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpStrInc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i8*, i8** %6
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmpStrInc(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int main() {
  int a, b;
  a = b + b + b + b + b + b + b;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_daem_usr_handle(int signal) {
  printf("Receive a signal from other process!\n");
}


x86 assembly (clang, -O0):
<sig_daem_usr_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"Receive a signal from other process!\0A\00"
define void @sig_daem_usr_handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Receive a signal from other process!\00"
define void @sig_daem_usr_handle(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
char *smart_str_print_unsigned(char *buf, long num) {
  char *r;
  do {
    char *__p = (buf);
    unsigned long __num = (num);
    *__p = '\0';
    do {
      *--__p = (char)(__num % 10) + '0';
      __num /= 10;
    } while (__num > 0);
    r = __p;
  } while (0);
  return r;
}


x86 assembly (clang, -O0):
<smart_str_print_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x28(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
ja     1123 <smart_str_print_unsigned+0x23>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smart_str_print_unsigned>:
movb   $0x0,(%rdi)
movabs $0xcccccccccccccccd,%r8
cc cc cc
nopl   (%rax)
mov    %rsi,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %esi,%ecx
sub    %eax,%ecx
or     $0x30,%cl
mov    %cl,-0x1(%rdi)
add    $0xffffffffffffffff,%rdi
cmp    $0x9,%rsi
mov    %rdx,%rsi
ja     1110 <smart_str_print_unsigned+0x10>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @smart_str_print_unsigned(i8* writeonly %0, i64 %1) {
store i8 0, i8* %0
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = phi i64 [ %1, %2 ], [ %10, %3 ]
%6 = urem i64 %5, 10
%7 = trunc i64 %6 to i8
%8 = or i8 %7, 48
%9 = getelementptr inbounds i8, i8* %4, i64 -1
store i8 %8, i8* %9
%10 = udiv i64 %5, 10
%11 = icmp ult i64 %5, 10
br i1 %11, label %12, label %3
12: ; preds = %3
ret i8* %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t is_ebx_inuse(uint32_t bitmap) { return (bitmap & (0x1 << 1)); }


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

x86 assembly (clang, -O2):
<is_ebx_inuse>:
mov    %edi,%eax
and    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @is_ebx_inuse(i32 %0) {
%2 = and i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void test2(void) {
  float a = 4.12345f;
  unsigned int temp = *(unsigned int *)&a;
  temp &= 0x7fffffff;
  printf("%f\n", *(float *)&temp);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
lea    0xeed(%rip),%rdi
movss  0xee1(%rip),%xmm0
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define void @test2() {
%1 = alloca float
%2 = alloca i32
store float 0x40107E69A0000000, float* %1
%3 = bitcast float* %1 to i32*
%4 = load i32, i32* %3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 2147483647
store i32 %6, i32* %2
%7 = bitcast i32* %2 to float*
%8 = load float, float* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @test2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x40107E69A0000000)
ret void
}
unsigned xrop3_154_0_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 = ~S;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_154_0_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    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_154_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %eax
and    %esi,%eax
xor    $0xff,%esi
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_154_0_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* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = or i32 %33, %37
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = and i32 %42, %43
%45 = or i32 %38, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_154_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %4, -1
%7 = xor i32 %5, 255
%8 = or i32 %7, %3
%9 = and i32 %6, %5
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
unsigned long blz_hash4_bits(unsigned char const *, int);
unsigned long blz_hash4(const unsigned char *p) {
  return blz_hash4_bits(p, 17);
}


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

x86 assembly (clang, -O2):
<blz_hash4>:
mov    $0x11,%esi
jmp    1030 <blz_hash4_bits@plt>

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

LLVM IR (-O2):
define i64 @blz_hash4(i8* %0) {
%2 = tail call i64 @blz_hash4_bits(i8* %0, i32 17)
ret i64 %2
}
int test_imm_B5uint8_mem(unsigned char *val) {
  return ((*val) & (0xB5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B5uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 181
%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_B5uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -75
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int ac, char **av) {
  printf("test5\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"test5\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cgltf_default_free(void *user, void *ptr) {
  (void)user;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<cgltf_default_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @cgltf_default_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_destroy(pthread_attr_t *__attr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_destroy(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ box_boolean(int);
int /*<<< orphan*/ dpop();
double untag_float_fast(int /*<<< orphan*/);
void primitive_float_greater(void) {
  double y = untag_float_fast(dpop());
  double x = untag_float_fast(dpop());
  ;
  box_boolean(x > y);
}


x86 assembly (clang, -O0):
<primitive_float_greater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <box_boolean@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_float_greater>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
xor    %edi,%edi
ucomisd (%rsp),%xmm0
seta   %dil
pop    %rax
jmp    1040 <box_boolean@plt>

LLVM IR (-O0):
define void @primitive_float_greater() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (...) @dpop()
%4 = call double @untag_float_fast(i32 %3)
store double %4, double* %1
%5 = call i32 (...) @dpop()
%6 = call double @untag_float_fast(i32 %5)
store double %6, double* %2
%7 = load double, double* %2
%8 = load double, double* %1
%9 = fcmp ogt double %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @box_boolean(i32 %10)
ret void
}

LLVM IR (-O2):
define void @primitive_float_greater() {
%1 = tail call i32 (...) @dpop()
%2 = tail call double @untag_float_fast(i32 %1)
%3 = tail call i32 (...) @dpop()
%4 = tail call double @untag_float_fast(i32 %3)
%5 = fcmp ogt double %4, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 @box_boolean(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ extract_xml(char *, char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void GetCurrentTransportActions(char *res) {
  char actions[256];
  fprintf(stderr, "#\tactions\n");
  extract_xml(actions, res, "Actions");
  fprintf(stderr, "Act: %s\n");
}


x86 assembly (clang, -O0):
<GetCurrentTransportActions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1040 <fprintf@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdx
call   1030 <extract_xml@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCurrentTransportActions>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    0x2eac(%rip),%r14
mov    (%r14),%edi
lea    0xec2(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xec1(%rip),%rdx
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1030 <extract_xml@plt>
mov    (%r14),%edi
lea    0xeb4(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"#\09actions\0A\00"
@.str.1 = [8 x i8] c"Actions\00"
@.str.2 = [9 x i8] c"Act: %s\0A\00"
define void @GetCurrentTransportActions(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @extract_xml(i8* %6, i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"#\09actions\0A\00"
@.str.1 = [8 x i8] c"Actions\00"
@.str.2 = [9 x i8] c"Act: %s\0A\00"
define void @GetCurrentTransportActions(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @extract_xml(i8* %3, i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() {
  printf("===============================================\n");
  printf("My name is Wu Xiale\n");
  printf("Thank you for your using my program\n");
}


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

x86 assembly (clang, -O2):
<hello>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf14(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"===============================================\0A\00"
@.str.1 = [21 x i8] c"My name is Wu Xiale\0A\00"
@.str.2 = [37 x i8] c"Thank you for your using my program\0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c"===============================================\00"
@str.3 = [20 x i8] c"My name is Wu Xiale\00"
@str.4 = [36 x i8] c"Thank you for your using my program\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wcsprintf(char *, char const *, ...);
void wcsprt_auxc(const char *name, const char *value) {
  if (value[0] == '\0') {
    wcsprintf("   %s: UNDEFINED\n", name);
  } else {
    wcsprintf("   %s: \"%s\"\n", name, value);
  }
}


x86 assembly (clang, -O0):
<wcsprt_auxc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1147 <wcsprt_auxc+0x37>
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <wcsprintf@plt>
jmp    115d <wcsprt_auxc+0x4d>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <wcsprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsprt_auxc>:
mov    %rsi,%rdx
mov    %rdi,%rsi
cmpb   $0x0,(%rdx)
je     1129 <wcsprt_auxc+0x19>
lea    0xef0(%rip),%rdi
xor    %eax,%eax
jmp    1030 <wcsprintf@plt>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
jmp    1030 <wcsprintf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c" %s: UNDEFINED\0A\00"
@.str.1 = [13 x i8] c" %s: \22%s\22\0A\00"
define void @wcsprt_auxc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 (i8*, i8*, ...) @wcsprintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %17
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 (i8*, i8*, ...) @wcsprintf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* %15)
br label %17
17: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c" %s: UNDEFINED\0A\00"
@.str.1 = [13 x i8] c" %s: \22%s\22\0A\00"
define void @wcsprt_auxc(i8* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i8*, i8*, ...) @wcsprintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 (i8*, i8*, ...) @wcsprintf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
ret void
}
int GFX_createSurface(int width, int height) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @GFX_createSurface(i32 %0, i32 %1) {
ret i32 0
}