xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void kattach_wdog_zombie(int sig) {
  while (waitpid(-1, NULL, WNOHANG) > 0) {
  }
  return;
}


x86 assembly (clang, -O0):
<kattach_wdog_zombie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <kattach_wdog_zombie+0x31>
jmp    111b <kattach_wdog_zombie+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kattach_wdog_zombie>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <kattach_wdog_zombie+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @kattach_wdog_zombie(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @kattach_wdog_zombie(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ __chk_fail();
scalar_t__ __glibc_unlikely(int);
scalar_t__ memmove(char *, char *, size_t);
wchar_t *__wmemmove_chk(wchar_t *s1, const wchar_t *s2, size_t n, size_t ns1) {
  if (__glibc_unlikely(ns1 < n))
    __chk_fail();
  return (wchar_t *)memmove((char *)s1, (char *)s2, n * sizeof(wchar_t));
}


x86 assembly (clang, -O0):
<__wmemmove_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__glibc_unlikely@plt>
cmp    $0x0,%rax
je     116e <__wmemmove_chk+0x3e>
mov    $0x0,%al
call   1030 <__chk_fail@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
shl    $0x2,%rdx
call   1050 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wmemmove_chk>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
cmp    %rdx,%rcx
setb   %dil
call   1040 <__glibc_unlikely@plt>
test   %rax,%rax
je     1158 <__wmemmove_chk+0x28>
xor    %eax,%eax
call   1030 <__chk_fail@plt>
shl    $0x2,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <memmove@plt>

LLVM IR (-O0):
define i32* @__wmemmove_chk(i32* %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %7
%11 = icmp ult i64 %9, %10
%12 = zext i1 %11 to i32
%13 = call i64 @__glibc_unlikely(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %4
%16 = call i32 (...) @__chk_fail()
br label %17
17: ; preds = %15, %4
%18 = load i32*, i32** %5
%19 = bitcast i32* %18 to i8*
%20 = load i32*, i32** %6
%21 = bitcast i32* %20 to i8*
%22 = load i64, i64* %7
%23 = mul i64 %22, 4
%24 = call i64 @memmove(i8* %19, i8* %21, i64 %23)
%25 = inttoptr i64 %24 to i32*
ret i32* %25
}

LLVM IR (-O2):
define i32* @__wmemmove_chk(i32* %0, i32* %1, i64 %2, i64 %3) {
%5 = icmp ult i64 %3, %2
%6 = zext i1 %5 to i32
%7 = tail call i64 @__glibc_unlikely(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 (...) @__chk_fail()
br label %11
11: ; preds = %9, %4
%12 = bitcast i32* %0 to i8*
%13 = bitcast i32* %1 to i8*
%14 = shl i64 %2, 2
%15 = tail call i64 @memmove(i8* %12, i8* %13, i64 %14)
%16 = inttoptr i64 %15 to i32*
ret i32* %16
}
int c044(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c044() {
ret i32 0
}
int make_pair(int x, int y) { return x | (y << 10); }


x86 assembly (clang, -O0):
<make_pair>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0xa,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_pair>:
mov    %esi,%eax
shl    $0xa,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @make_pair(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 = shl i32 %6, 10
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @make_pair(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = or i32 %3, %0
ret i32 %4
}
double _trunc(f)
double f;
{
  long d;
  d = f;
  f = d;
  return (f);
}


x86 assembly (clang, -O0):
<_trunc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_trunc>:
cvttsd2si %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @_trunc(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to double
store double %7, double* %2
%8 = load double, double* %2
ret double %8
}

LLVM IR (-O2):
define double @_trunc(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ dis_GpG_to_ffsol();
int /*<<< orphan*/ dis_print_less_PERT_ffsol(char *);
void dis_print_less_PERT_GpG(char *fact_file_name) {
  dis_GpG_to_ffsol();
  dis_print_less_PERT_ffsol(fact_file_name);
}


x86 assembly (clang, -O0):
<dis_print_less_PERT_GpG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <dis_GpG_to_ffsol@plt>
mov    -0x8(%rbp),%rdi
call   1030 <dis_print_less_PERT_ffsol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dis_print_less_PERT_GpG>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dis_GpG_to_ffsol@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <dis_print_less_PERT_ffsol@plt>

LLVM IR (-O0):
define void @dis_print_less_PERT_GpG(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @dis_GpG_to_ffsol()
%4 = load i8*, i8** %2
%5 = call i32 @dis_print_less_PERT_ffsol(i8* %4)
ret void
}

LLVM IR (-O2):
define void @dis_print_less_PERT_GpG(i8* %0) {
%2 = tail call i32 (...) @dis_GpG_to_ffsol()
%3 = tail call i32 @dis_print_less_PERT_ffsol(i8* %0)
ret void
}
long double _Complex add_long_double_cr(long double _Complex a, long double b) {
  return a + b;
}


x86 assembly (clang, -O0):
<add_long_double_cr>:
push   %rbp
mov    %rsp,%rbp
fldt   0x30(%rbp)
lea    0x10(%rbp),%rax
fstpt  -0x30(%rbp)
fldt   (%rax)
fldt   0x10(%rax)
fldt   -0x30(%rbp)
faddp  %st,%st(2)
fxch   %st(1)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_long_double_cr>:
fldt   0x28(%rsp)
fldt   0x8(%rsp)
faddp  %st,%st(1)
fldt   0x18(%rsp)
fxch   %st(1)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @add_long_double_cr({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0, x86_fp80 %1) {
%3 = alloca { x86_fp80, x86_fp80 }
%4 = alloca x86_fp80
store x86_fp80 %1, x86_fp80* %4
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%6 = load x86_fp80, x86_fp80* %5
%7 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%8 = load x86_fp80, x86_fp80* %7
%9 = load x86_fp80, x86_fp80* %4
%10 = fadd x86_fp80 %6, %9
%11 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%12 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %10, x86_fp80* %11
store x86_fp80 %8, x86_fp80* %12
%13 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3
ret { x86_fp80, x86_fp80 } %13
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @add_long_double_cr({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0, x86_fp80 %1) {
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = fadd x86_fp80 %4, %1
%8 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %7, 0
%9 = insertvalue { x86_fp80, x86_fp80 } %8, x86_fp80 %6, 1
ret { x86_fp80, x86_fp80 } %9
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t *wcscpy(wchar_t *s1, const wchar_t *s2) {
  wchar_t *p;
  for (p = s1; (*p = *s2) != L'\0'; ++p, ++s2)
    ;
  return s1;
}


x86 assembly (clang, -O0):
<wcscpy>:
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),%eax
mov    -0x18(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0x0,%eax
je     114b <wcscpy+0x4b>
jmp    112e <wcscpy+0x2e>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <wcscpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcscpy>:
mov    %rdi,%rax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
test   %ecx,%ecx
je     111e <wcscpy+0x1e>
mov    $0x4,%ecx
mov    (%rsi,%rcx,1),%edx
mov    %edx,(%rax,%rcx,1)
add    $0x4,%rcx
test   %edx,%edx
jne    1110 <wcscpy+0x10>
ret

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

LLVM IR (-O2):
define i32* @wcscpy(i32* returned writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
store i32 %3, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32* [ %8, %5 ], [ %0, %2 ]
%7 = phi i32* [ %9, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = getelementptr inbounds i32, i32* %7, i64 1
%10 = load i32, i32* %9
store i32 %10, i32* %8
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i32* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void gen_flat_bloop_access(FILE *outfile) { fprintf(outfile, "[_i]"); }


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

x86 assembly (clang, -O2):
<gen_flat_bloop_access>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"[_i]\00"
define void @gen_flat_bloop_access(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"[_i]\00"
define void @gen_flat_bloop_access(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int a = 5;
  int b = 1;
  int *pa = &a;
  int *pb = &b;
  swap(pa, pb);
  return *pa * 2 + *pb;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <swap@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
shl    $0x1,%eax
mov    -0x20(%rbp),%rcx
add    (%rcx),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0x1,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <swap@plt>
mov    0x4(%rsp),%eax
add    %eax,%eax
add    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%5 = call i32 @swap(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = shl nsw i32 %6, 1
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int **, int *, int *, int *, int);
void a(int *a[]) {
  printf("addr a %p, addr a[0] %p, *a %p, *(a+1) %p, *a[0] %d\n", a, a[0], *a,
         *(a + 1), *a[0]);
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%r8
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%r9d
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
mov    %rdi,%rsi
mov    (%rdi),%rcx
mov    0x8(%rdi),%r8
mov    (%rcx),%r9d
lea    0xedc(%rip),%rdi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"addr a %p, addr a[0] %p, *a %p, *(a+1) %p, *a[0] %d\0A\00"
define void @a(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32**, i32*** %2
%5 = getelementptr inbounds i32*, i32** %4, i64 0
%6 = load i32*, i32** %5
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = load i32**, i32*** %2
%10 = getelementptr inbounds i32*, i32** %9, i64 1
%11 = load i32*, i32** %10
%12 = load i32**, i32*** %2
%13 = getelementptr inbounds i32*, i32** %12, i64 0
%14 = load i32*, i32** %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32** %3, i32* %6, i32* %8, i32* %11, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"addr a %p, addr a[0] %p, *a %p, *(a+1) %p, *a[0] %d\0A\00"
define void @a(i32** %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32*, i32** %0, i64 1
%4 = load i32*, i32** %3
%5 = load i32, i32* %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32** %0, i32* %2, i32* %2, i32* %4, i32 %5)
ret void
}
int test_imm_0Buint16_reg(unsigned short val) {
  return ((val) & (-0x0B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Buint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -11
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned long insert_sh6(insn, value, errmsg)
unsigned long insn;
long value;
const char **errmsg;
{ return insn | ((value & 0x1f) << 11) | ((value & 0x20) >> 4); }


x86 assembly (clang, -O0):
<insert_sh6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    $0xb,%rcx
or     %rcx,%rax
mov    -0x10(%rbp),%rcx
and    $0x20,%rcx
sar    $0x4,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_sh6>:
mov    %esi,%eax
shl    $0xb,%eax
movzwl %ax,%eax
or     %rdi,%rax
shr    $0x4,%rsi
and    $0x2,%esi
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @insert_sh6(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = and i64 %8, 31
%10 = shl i64 %9, 11
%11 = or i64 %7, %10
%12 = load i64, i64* %5
%13 = and i64 %12, 32
%14 = ashr i64 %13, 4
%15 = or i64 %11, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @insert_sh6(i64 %0, i64 %1, i8** nocapture readnone %2) {
%4 = shl i64 %1, 11
%5 = and i64 %4, 63488
%6 = or i64 %5, %0
%7 = lshr i64 %1, 4
%8 = and i64 %7, 2
%9 = or i64 %6, %8
ret i64 %9
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cintern(char *);
int /*<<< orphan*/ setvar(int /*<<< orphan*/, int /*<<< orphan*/, struct obj *);
void init_slibu_version(void) {
  setvar(cintern("*slibu-version*"),
         cintern("$Id: slibu.c,v 1.18 2002/12/10 08:08:53 nehalmistry Exp $"),
         ((struct obj *)0));
}


x86 assembly (clang, -O0):
<init_slibu_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,-0x4(%rbp)
lea    0xed2(%rip),%rdi
call   1040 <cintern@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setvar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_slibu_version>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,%ebx
lea    0xeda(%rip),%rdi
call   1040 <cintern@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <setvar@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [16 x i8] c"*slibu-version*\00"
@.str.1 = [58 x i8] c"$Id: slibu.c,v 1.18 2002/12/10 08:08:53 nehalmistry Exp $\00"
define void @init_slibu_version() {
%1 = call i32 @cintern(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cintern(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [16 x i8] c"*slibu-version*\00"
@.str.1 = [58 x i8] c"$Id: slibu.c,v 1.18 2002/12/10 08:08:53 nehalmistry Exp $\00"
define void @init_slibu_version() {
%1 = tail call i32 @cintern(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cintern(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}
/* Variables and functions */
double atof(char *);
int numcmp_decrease(char *s1, char *s2) {
  double v1, v2;
  v1 = atof(s1);
  v2 = atof(s2);
  if (v1 == v2)
    return 0;
  if (v1 < v2)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<numcmp_decrease>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    115e <numcmp_decrease+0x4e>
jp     115e <numcmp_decrease+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1185 <numcmp_decrease+0x75>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    117e <numcmp_decrease+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1185 <numcmp_decrease+0x75>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp_decrease>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <atof@plt>
xor    %ecx,%ecx
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm0
seta   %cl
xor    %eax,%eax
ucomisd %xmm0,%xmm1
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @numcmp_decrease(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call double @atof(i8* %0)
%4 = tail call double @atof(i8* %1)
%5 = fcmp oeq double %3, %4
%6 = fcmp olt double %3, %4
%7 = select i1 %6, i32 1, i32 -1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void am_free_realnums(double *farr, int size) { free(farr); }


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

x86 assembly (clang, -O2):
<am_free_realnums>:
jmp    1030 <free@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void sigchld_handler(int signo) {
  pid_t pid;
  int stat;
  while ((pid = waitpid(-1, &stat, WNOHANG)) > 0) {
  }
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1030 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1143 <sigchld_handler+0x33>
jmp    111b <sigchld_handler+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handler>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
lea    0x4(%rsp),%rbx
mov    (%r14),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1030 <waitpid@plt>
test   %eax,%eax
jg     1120 <sigchld_handler+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* %2, i32 %5)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strcpy(char *, char const *);
size_t ft_strlen(char *);
char *ft_strcat(char *dest, const char *src) {
  ft_strcpy(&dest[ft_strlen(dest)], src);
  return (dest);
}


x86 assembly (clang, -O0):
<ft_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
lea    (%rax,%rbx,1),%rdi
mov    %r14,%rsi
call   1030 <ft_strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strcat(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** %3
%7 = call i64 @ft_strlen(i8* %6)
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8*, i8** %4
%10 = call i32 @ft_strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @ft_strcat(i8* returned %0, i8* %1) {
%3 = tail call i64 @ft_strlen(i8* %0)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @ft_strcpy(i8* %4, i8* %1)
ret i8* %0
}
/* Variables and functions */
int get_nonopt_index(int, int, char **);
int get_pgm_index(int argc, char **argv) {
  int hostname_index = get_nonopt_index(0, argc, argv);
  if (hostname_index == -1)
    return -1;
  return get_nonopt_index(hostname_index + 1, argc, argv);
}


x86 assembly (clang, -O0):
<get_pgm_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <get_nonopt_index@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1146 <get_pgm_index+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <get_pgm_index+0x4b>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <get_nonopt_index@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pgm_index>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <get_nonopt_index@plt>
cmp    $0xffffffff,%eax
je     113e <get_pgm_index+0x2e>
add    $0x1,%eax
mov    %eax,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <get_nonopt_index@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get_pgm_index(i32 %0, i8** %1) {
%3 = tail call i32 @get_nonopt_index(i32 0, i32 %0, i8** %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = add nuw nsw i32 %3, 1
%7 = tail call i32 @get_nonopt_index(i32 %6, i32 %0, i8** %1)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ -1, %2 ]
ret i32 %9
}
void subr2(int *a) {
  int i;
  int f[8];
#pragma acc declare copyout(f)
#pragma acc parallel copy(a [0:N])
  {
    for (i = 0; i < 8; i++) {
      f[i] = a[i];
      a[i] = f[i] + f[i] + f[i];
    }
  }
}


x86 assembly (clang, -O0):
<subr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    115d <subr2+0x5d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
movslq -0xc(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
movslq -0xc(%rbp),%rax
add    -0x30(%rbp,%rax,4),%edx
movslq -0xc(%rbp),%rax
add    -0x30(%rbp,%rax,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <subr2+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<subr2>:
movdqu (%rdi),%xmm0
movdqu 0x10(%rdi),%xmm1
movdqa %xmm0,%xmm2
paddd  %xmm0,%xmm2
paddd  %xmm0,%xmm2
movdqu %xmm2,(%rdi)
movdqa %xmm1,%xmm0
paddd  %xmm1,%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @subr2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [8 x i32]
store i32* %0, i32** %2
store i32 0, i32* %3
br label %5
5: ; preds = %35, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %38
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %15
store i32 %13, i32* %16
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = add nsw i32 %20, %24
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = add nsw i32 %25, %29
%31 = load i32*, i32** %2
%32 = load i32, i32* %3
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %31, i64 %33
store i32 %30, i32* %34
br label %35
35: ; preds = %8
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %5
38: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @subr2(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = mul nsw <4 x i32> %3, <i32 3, i32 3, i32 3, i32 3>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = mul nsw <4 x i32> %8, <i32 3, i32 3, i32 3, i32 3>
%10 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %9, <4 x i32>* %10
ret void
}
void free_llong(long long *val) {}


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

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

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

LLVM IR (-O2):
define void @free_llong(i64* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int x() { printf("yo\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"yo\00"
define i32 @x() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ init_genrand(unsigned long);
void mt_init_genrand(unsigned long s) {
  init_genrand(s);
  return;
}


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

x86 assembly (clang, -O2):
<mt_init_genrand>:
jmp    1030 <init_genrand@plt>

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

LLVM IR (-O2):
define void @mt_init_genrand(i64 %0) {
%2 = tail call i32 @init_genrand(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itob(int, int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char testout[100];
  itob(300, 2, testout);
  printf("%s", testout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdx
mov    $0x12c,%edi
mov    $0x2,%esi
call   1040 <itob@plt>
lea    -0x70(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    $0x12c,%edi
mov    $0x2,%esi
mov    %rbx,%rdx
call   1040 <itob@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @itob(i32 300, i32 2, i8* %2)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @itob(i32 300, i32 2, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
double add(double x1, double x2) { return x1 + x2; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @add(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
void rop3_187_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~S;
  stk1 = *D | stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_187_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_187_0_0>:
not    %sil
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_187_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = load i8*, i8** %4
store i8 %20, i8* %21
ret void
}

LLVM IR (-O2):
define void @rop3_187_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
store i8 %6, i8* %0
ret void
}
void sig_handler(int signum) {}


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

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

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

LLVM IR (-O2):
define void @sig_handler(i32 %0) {
ret void
}
int cmp_callback_key(const void *x, const void *y) {
  return *(unsigned int *)x != *(unsigned int *)y;
}


x86 assembly (clang, -O0):
<cmp_callback_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_callback_key>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @cmp_callback_key(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp ne i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp_callback_key(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ne i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int test_imm_CCuint16_reg(unsigned short val) {
  return ((val) & (0xCC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CCuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 204
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *fcitx_utils_strdup(char *);
void utarray_str_cpy(void *dst, const void *src) {
  char **_src = (char **)src, **_dst = (char **)dst;
  *_dst = (*_src == NULL) ? NULL : fcitx_utils_strdup(*_src);
}


x86 assembly (clang, -O0):
<utarray_str_cpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1149 <utarray_str_cpy+0x39>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1159 <utarray_str_cpy+0x49>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fcitx_utils_strdup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utarray_str_cpy>:
push   %rbx
mov    %rdi,%rbx
mov    (%rsi),%rdi
test   %rdi,%rdi
je     1123 <utarray_str_cpy+0x13>
call   1030 <fcitx_utils_strdup@plt>
jmp    1125 <utarray_str_cpy+0x15>
xor    %eax,%eax
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @utarray_str_cpy(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** %4
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %2
br label %19
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = load i8*, i8** %16
%18 = call i8* @fcitx_utils_strdup(i8* %17)
br label %19
19: ; preds = %15, %14
%20 = phi i8* [ null, %14 ], [ %18, %15 ]
%21 = load i8**, i8*** %6
store i8* %20, i8** %21
ret void
}

LLVM IR (-O2):
define void @utarray_str_cpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @fcitx_utils_strdup(i8* %4)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
%10 = bitcast i8* %0 to i8**
store i8* %9, i8** %10
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x_root;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
void set_XEnterWindowEvent_x_root(void *_p, int _v) {
  ((XEnterWindowEvent *)_p)->x_root = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEnterWindowEvent_x_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void vsum(const double v1[3], const double v2[3], double result[3]) {
  result[0] = v1[0] + v2[0];
  result[1] = v1[1] + v2[1];
  result[2] = v1[2] + v2[2];
}


x86 assembly (clang, -O0):
<vsum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsum>:
movsd  (%rdi),%xmm0
addsd  (%rsi),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rdi),%xmm0
addsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  0x10(%rdi),%xmm0
addsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdx)
ret

LLVM IR (-O0):
define void @vsum(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fadd double %9, %12
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fadd double %18, %21
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %4
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fadd double %27, %30
%32 = load double*, double** %6
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @vsum(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fadd double %4, %5
store double %6, double* %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = getelementptr inbounds double, double* %2, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fadd double %14, %16
%18 = getelementptr inbounds double, double* %2, i64 2
store double %17, double* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void smg_free(void *ptr) {
  if (!ptr) {
    return;
  }
  free(ptr);
}


x86 assembly (clang, -O0):
<smg_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <smg_free+0x1c>
jmp    1135 <smg_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smg_free>:
test   %rdi,%rdi
je     111a <smg_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @smg_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void assert_alloc(void *p) {
  if (p == NULL) {
    puts("Out of memory.");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assert_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114d <assert_alloc+0x2d>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_alloc>:
test   %rdi,%rdi
je     1126 <assert_alloc+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory.\00"
define void @assert_alloc(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 %8
5: ; preds = %1
%6 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory.\00"
define void @assert_alloc(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
ret void
}
void bsp_coresight_save_cp_data(void) { return; }


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

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

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

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