xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int8_t stdlib_ndarray_get_ptr_int16(const uint8_t *idx, int16_t *out) {
  *out = *(int16_t *)idx;
  return 0;
}


x86 assembly (clang, -O0):
<stdlib_ndarray_get_ptr_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @stdlib_ndarray_get_ptr_int16(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
store i32 %3, i32* %1
ret i32 0
}
int foo(int i) {
  int j;
  switch (i) {
  case -0x7fffffff - 1 ... - 1:
    j = 6;
    break;
  case 0:
    j = 5;
    break;
  case 2 ... 0x7fffffff:
    j = 4;
    break;
  }
  return j;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     113e <foo+0x3e>
jmp    1156 <foo+0x56>
movl   $0x6,-0x8(%rbp)
jmp    116c <foo+0x6c>
mov    -0xc(%rbp),%eax
sub    $0x80000000,%eax
cmp    $0x7fffffff,%eax
jbe    111a <foo+0x1a>
jmp    116c <foo+0x6c>
movl   $0x5,-0x8(%rbp)
jmp    116c <foo+0x6c>
movl   $0x4,-0x8(%rbp)
jmp    116c <foo+0x6c>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
cmp    $0x7ffffffd,%eax
jbe    114a <foo+0x4a>
jmp    1126 <foo+0x26>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x2,%edi
setl   %al
test   %edi,%edi
lea    0x4(%rax,%rax,1),%ecx
mov    $0x5,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %11 [
i32 0, label %9
]
5: ; preds = %6
store i32 6, i32* %3
br label %14
6: ; preds = %11
%7 = sub i32 %4, -2147483648
%8 = icmp ule i32 %7, 2147483647
br i1 %8, label %5, label %14
9: ; preds = %1
store i32 5, i32* %3
br label %14
10: ; preds = %11
store i32 4, i32* %3
br label %14
11: ; preds = %1
%12 = sub i32 %4, 2
%13 = icmp ule i32 %12, 2147483645
br i1 %13, label %10, label %6
14: ; preds = %6, %10, %9, %5
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp sgt i32 %0, 1
%4 = select i1 %3, i32 4, i32 6
%5 = select i1 %2, i32 5, i32 %4
ret i32 %5
}
void popto() {}


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

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

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

LLVM IR (-O2):
define void @popto() {
ret void
}
void invd(void) { __asm__("invd"); }


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

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

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

LLVM IR (-O2):
define void @invd() {
tail call void asm sideeffect "invd", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ QuickSort(double **, int, int, int);
void Sort(double **data, int first, int last, int col) {
  QuickSort(data, first, last, col);
  return;
}


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

x86 assembly (clang, -O2):
<Sort>:
jmp    1030 <QuickSort@plt>

LLVM IR (-O0):
define void @Sort(double** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double** %0, double*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double**, double*** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @QuickSort(double** %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @Sort(double** %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @QuickSort(double** %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
double atan2(double, double);
double fit_arc(double x, double y) {
  return atan2(y - 2 * x * y, y * y + x - x * x);
}


x86 assembly (clang, -O0):
<fit_arc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xed1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fit_arc>:
movsd  0xee8(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
movapd %xmm2,%xmm0
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @fit_arc(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fmul double 2.000000e+00, %6
%8 = load double, double* %4
%9 = fneg double %7
%10 = call double @llvm.fmuladd.f64(double %9, double %8, double %5)
%11 = load double, double* %4
%12 = load double, double* %4
%13 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double %11, double %12, double %13)
%15 = load double, double* %3
%16 = load double, double* %3
%17 = fneg double %15
%18 = call double @llvm.fmuladd.f64(double %17, double %16, double %14)
%19 = call double @atan2(double %10, double %18)
ret double %19
}

LLVM IR (-O2):
define double @fit_arc(double %0, double %1) {
%3 = fmul double %0, -2.000000e+00
%4 = tail call double @llvm.fmuladd.f64(double %3, double %1, double %1)
%5 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %0)
%6 = fneg double %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %5)
%8 = tail call double @atan2(double %4, double %7)
ret double %8
}
int exact_square(int num) {
  int counter, avr, br = 0;
  for (counter = 0; counter < num; counter++) {
    avr = counter * counter;
    if (avr == num) {
      br = 1;
      break;
    }
  }
  return br;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <exact_square+0x56>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1143 <exact_square+0x43>
movl   $0x1,-0x10(%rbp)
jmp    1156 <exact_square+0x56>
jmp    1148 <exact_square+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <exact_square+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
xor    %eax,%eax
test   %edi,%edi
jle    1128 <exact_square+0x28>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
imul   %eax,%ecx
cmp    %edi,%ecx
je     1123 <exact_square+0x23>
add    $0x1,%eax
cmp    %eax,%edi
jne    1110 <exact_square+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 0, %1 ]
%7 = mul nsw i32 %6, %6
%8 = icmp eq i32 %7, %0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %3, %5, %1
%11 = phi i32 [ 0, %1 ], [ 1, %5 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
void *runner(void *param) { pthread_exit(0); }


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

x86 assembly (clang, -O2):
<runner>:
xor    %edi,%edi
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define noalias i8* @runner(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32 0)
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Cursor;

/* Variables and functions */
int /*<<< orphan*/ XCreateFontCursor(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ XDefineCursor(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ XFreeCursor(int /*<<< orphan*/ *, int /*<<< orphan*/);
int vis5d_set_cursor_type(Display *dpy, Window win, int shape) {
  Cursor cursor;
  cursor = XCreateFontCursor(dpy, shape);
  XDefineCursor(dpy, win, cursor);
  XFreeCursor(dpy, cursor);
  return 1;
}


x86 assembly (clang, -O0):
<vis5d_set_cursor_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <XCreateFontCursor@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <XDefineCursor@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <XFreeCursor@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vis5d_set_cursor_type>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %edx,%esi
call   1030 <XCreateFontCursor@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %eax,%edx
call   1040 <XDefineCursor@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <XFreeCursor@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @vis5d_set_cursor_type(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @XCreateFontCursor(i32* %0, i32 %2)
%5 = tail call i32 @XDefineCursor(i32* %0, i32 %1, i32 %4)
%6 = tail call i32 @XFreeCursor(i32* %0, i32 %4)
ret i32 1
}
/* Variables and functions */
int TIOCM_DTR;
int get_mlines(int);
int get_dtr(int fd) {
  if (get_mlines(fd) & TIOCM_DTR)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<get_dtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <get_mlines@plt>
mov    0x2ebe(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1141 <get_dtr+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <get_dtr+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dtr>:
push   %rax
call   1030 <get_mlines@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
test   %eax,(%rdx)
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCM_DTR = global i32 0
define i32 @get_dtr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @get_mlines(i32 %4)
%6 = load i32, i32* @TIOCM_DTR
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@TIOCM_DTR = global i32 0
define i32 @get_dtr(i32 %0) {
%2 = tail call i32 @get_mlines(i32 %0)
%3 = load i32, i32* @TIOCM_DTR
%4 = and i32 %3, %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned q_space(unsigned head, unsigned tail, unsigned size) {
  return ((tail - (head + 1)) & (size - 1));
}


x86 assembly (clang, -O0):
<q_space>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
sub    %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_space>:
not    %edi
lea    (%rdi,%rsi,1),%ecx
lea    -0x1(%rdx),%eax
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @q_space(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = add i32 %8, 1
%10 = sub i32 %7, %9
%11 = load i32, i32* %6
%12 = sub i32 %11, 1
%13 = and i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @q_space(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %0, -1
%5 = add i32 %4, %1
%6 = add i32 %2, -1
%7 = and i32 %6, %5
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __UHASX(uint32_t x, uint32_t y) {
  int32_t r, s;
  r = ((((x << 16) >> 16) - ((y) >> 16)) >> 1) & 0x0000FFFF;
  s = ((((x) >> 16) + ((y << 16) >> 16)) >> 1) & 0x0000FFFF;
  return ((s << 16) | (r));
}


x86 assembly (clang, -O0):
<__UHASX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
sub    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
sar    $0x10,%ecx
add    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__UHASX>:
movswl %di,%ecx
movswl %si,%eax
sar    $0x10,%esi
sub    %esi,%ecx
shr    %ecx
movzwl %cx,%ecx
sar    $0x10,%edi
add    %edi,%eax
and    $0xfffffffe,%eax
shl    $0xf,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__UHASX(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = shl i32 %7, 16
%9 = ashr i32 %8, 16
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = sub nsw i32 %9, %11
%13 = ashr i32 %12, 1
%14 = and i32 %13, 65535
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = ashr i32 %15, 16
%17 = load i32, i32* %4
%18 = shl i32 %17, 16
%19 = ashr i32 %18, 16
%20 = add nsw i32 %16, %19
%21 = ashr i32 %20, 1
%22 = and i32 %21, 65535
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = shl i32 %23, 16
%25 = load i32, i32* %5
%26 = or i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @__UHASX(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = ashr i32 %1, 16
%6 = sub nsw i32 %4, %5
%7 = lshr i32 %6, 1
%8 = and i32 %7, 65535
%9 = ashr i32 %0, 16
%10 = shl i32 %1, 16
%11 = ashr exact i32 %10, 16
%12 = add nsw i32 %11, %9
%13 = shl nsw i32 %12, 15
%14 = and i32 %13, -65536
%15 = or i32 %14, %8
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ dump_out_shammx64(void *, unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, char *);
void dump_out_shammx64_msg(const void *msg, void *buf, unsigned int size,
                           unsigned int index) {
  printf("%s : ", (char *)msg);
  dump_out_shammx64(buf, size, index);
}


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

x86 assembly (clang, -O2):
<dump_out_shammx64_msg>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <dump_out_shammx64@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s : \00"
define void @dump_out_shammx64_msg(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @dump_out_shammx64(i8* %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s : \00"
define void @dump_out_shammx64_msg(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @dump_out_shammx64(i8* %1, i32 %2, i32 %3)
ret void
}
void dt2gst(date, time) double *date;
double *time;
{
  double dj, gsec;
  dj = dt2ts(*date, *time);
  gsec = jd2gst(dj);
  ts2dt(gsec, date, time);
  *date = 0.0;
  return;
}


x86 assembly (clang, -O0):
<dt2gst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    $0x2,%al
call   1040 <dt2ts@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1050 <jd2gst@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%al
call   1030 <ts2dt@plt>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt2gst>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    $0x2,%al
call   1040 <dt2ts@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1050 <jd2gst@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <ts2dt@plt>
movq   $0x0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @dt2gst(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%7 = load double*, double** %3
%8 = load double, double* %7
%9 = load double*, double** %4
%10 = load double, double* %9
%11 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2ts to i32 (double, double, ...)*)(double %8, double %10)
%12 = sitofp i32 %11 to double
store double %12, double* %5
%13 = load double, double* %5
%14 = call i32 (double, ...) bitcast (i32 (...)* @jd2gst to i32 (double, ...)*)(double %13)
%15 = sitofp i32 %14 to double
store double %15, double* %6
%16 = load double, double* %6
%17 = load double*, double** %3
%18 = load double*, double** %4
%19 = call i32 (double, double*, double*, ...) bitcast (i32 (...)* @ts2dt to i32 (double, double*, double*, ...)*)(double %16, double* %17, double* %18)
%20 = load double*, double** %3
store double 0.000000e+00, double* %20
ret void
}

LLVM IR (-O2):
define void @dt2gst(double* %0, double* %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call i32 (double, double, ...) bitcast (i32 (...)* @dt2ts to i32 (double, double, ...)*)(double %3, double %4)
%6 = sitofp i32 %5 to double
%7 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2gst to i32 (double, ...)*)(double %6)
%8 = sitofp i32 %7 to double
%9 = tail call i32 (double, double*, double*, ...) bitcast (i32 (...)* @ts2dt to i32 (double, double*, double*, ...)*)(double %8, double* %0, double* %1)
store double 0.000000e+00, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f(int);
main() {
  int sz = f(3);
  if (sz != 72)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <f@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x48,-0x8(%rbp)
je     114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <f@plt>
cmp    $0x48,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @f(i32 3)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 72
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 3)
%2 = icmp eq i32 %1, 72
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
scalar_t__ solveWithBacktracking(int *);
scalar_t__ solveWithConditions(int *);
int sudoku_solve(int *grid) {
  return solveWithConditions(grid) || solveWithBacktracking(grid);
}


x86 assembly (clang, -O0):
<sudoku_solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <solveWithConditions@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <sudoku_solve+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <solveWithBacktracking@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudoku_solve>:
push   %rbx
mov    %rdi,%rbx
call   1030 <solveWithConditions@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <sudoku_solve+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <solveWithBacktracking@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sudoku_solve(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @solveWithConditions(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i64 @solveWithBacktracking(i32* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @sudoku_solve(i32* %0) {
%2 = tail call i64 @solveWithConditions(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @solveWithBacktracking(i32* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void forensics_private_register_signal_handlers() {}


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

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

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

LLVM IR (-O2):
define void @forensics_private_register_signal_handlers() {
ret void
}
void unit_work(void) {
  int i;
  for (i = 0; i < 100; i++) {
  }
}


x86 assembly (clang, -O0):
<unit_work>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1128 <unit_work+0x28>
jmp    111a <unit_work+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <unit_work+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @unit_work() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @unit_work() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: %s [-s] [name-of-host]\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"usage: %s [-s] [name-of-host]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"usage: %s [-s] [name-of-host]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, intptr_t);
void *sbrk(intptr_t increment) {
  printf(">>> sbrk, increment - %d\n", increment);
  return NULL;
}


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

x86 assembly (clang, -O2):
<sbrk>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [26 x i8] c">>> sbrk, increment - %d\0A\00"
define noalias i8* @sbrk(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* null
}
/* Variables and functions */
int write(int, char *, int);
void send_reply(int fclient, int status) {
  int ret;
  if (status == 0)
    ret = write(fclient, "00\0", 3);
  else
    ret = write(fclient, "11\0", 3);
}


x86 assembly (clang, -O0):
<send_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1144 <send_reply+0x34>
mov    -0x4(%rbp),%edi
lea    0xece(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
jmp    115b <send_reply+0x4b>
mov    -0x4(%rbp),%edi
lea    0xeb6(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_reply>:
test   %esi,%esi
lea    0xee7(%rip),%rax
lea    0xee4(%rip),%rsi
cmove  %rax,%rsi
mov    $0x3,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"00\00\00"
@.str.1 = [4 x i8] c"11\00\00"
define void @send_reply(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @write(i32 %0, i8* %4, i32 3)
ret void
}
int divider(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<divider>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @divider(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
float test_coshf(float x) { return __builtin_coshf(x); }


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

x86 assembly (clang, -O2):
<test_coshf>:
jmp    1030 <coshf@plt>

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

LLVM IR (-O2):
define float @test_coshf(float %0) {
%2 = tail call float @coshf(float %0)
ret float %2
}
int main() {
  int a, b;
  int c = a + b;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
char const *strrchr(char const *, char);
void getFilename(const char *filename, char *fileSpec) {
  if (strrchr(filename, '/') != 0) {
    strcpy(fileSpec, strrchr(filename, '/') + 1);
  } else {
    strcpy(fileSpec, filename);
  }
}


x86 assembly (clang, -O0):
<getFilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
cmp    $0x0,%rax
je     1173 <getFilename+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
jmp    1180 <getFilename+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFilename>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1145 <getFilename+0x25>
add    $0x1,%rax
mov    %r14,%rdi
mov    %rax,%rsi
jmp    114b <getFilename+0x2b>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @getFilename(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 = call i8* @strrchr(i8* %5, i8 signext 47)
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = call i8* @strrchr(i8* %10, i8 signext 47)
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = call i32 @strcpy(i8* %9, i8* %12)
br label %18
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %15, i8* %16)
br label %18
18: ; preds = %14, %8
ret void
}

LLVM IR (-O2):
define void @getFilename(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = tail call i32 @strcpy(i8* %1, i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 @strcpy(i8* %1, i8* %0)
br label %10
10: ; preds = %8, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ T2Cam_errormsg();
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int T2Cam_InitializeLib() {
  T2Cam_errormsg();
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<T2Cam_InitializeLib>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <T2Cam_errormsg@plt>
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<T2Cam_InitializeLib>:
push   %rax
xor    %eax,%eax
call   1030 <T2Cam_errormsg@plt>
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @T2Cam_InitializeLib() {
%1 = call i32 (...) @T2Cam_errormsg()
%2 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @T2Cam_InitializeLib() {
%1 = tail call i32 (...) @T2Cam_errormsg()
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_varchargenfunc(void) { return GppcFinfoV1(); }


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

x86 assembly (clang, -O2):
<pg_finfo_varchargenfunc>:
xor    %eax,%eax
jmp    1030 <GppcFinfoV1@plt>

LLVM IR (-O0):
define i8* @pg_finfo_varchargenfunc() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_varchargenfunc() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int strlen(char *);
char *amino_acid_sequence(char *rna) {
  int len = strlen(rna);
  return rna;
}


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

x86 assembly (clang, -O2):
<amino_acid_sequence>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @amino_acid_sequence(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i8* %0
}
__attribute__((no, noclone)) unsigned __int128 t161_4sub(unsigned __int128 x) {
  unsigned __int128 y = (-1);
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t161_4sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0xffffffffffffffff,-0x38(%rbp)
ff
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
setb   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t161_4sub+0x5e>
jmp    1175 <t161_4sub+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t161_4sub>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
sub    $0xffffffffffffffff,%rbx
sbb    $0xffffffffffffffff,%r14
jae    112b <t161_4sub+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t161_4sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 -1, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t161_4sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %6, i128 -1)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
char *masprintf(char *, void *);
char *make_hash_key(void *addr) { return masprintf("%p", addr); }


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

x86 assembly (clang, -O2):
<make_hash_key>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <masprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define i8* @make_hash_key(i8* %0) {
%2 = tail call i8* @masprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCGETS;
scalar_t__ ioctl(int, int /*<<< orphan*/, struct termios *);
int _isatty(int fd) {
  struct termios termios;
  return ioctl(fd, TCGETS, &termios) == 0;
}


x86 assembly (clang, -O0):
<_isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isatty>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @_isatty(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.termios
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @TCGETS
%6 = call i64 @ioctl(i32 %4, i32 %5, %struct.termios* %3)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @_isatty(i32 %0) {
%2 = alloca %struct.termios
%3 = bitcast %struct.termios* %2 to i8*
%4 = load i32, i32* @TCGETS
%5 = call i64 @ioctl(i32 %0, i32 %4, %struct.termios* %2)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ header();
int /*<<< orphan*/ txt_ctrd(char *, char);
void loose_scr() {
  header();
  txt_ctrd("YOU LOOSE ! LOOSER !", '\n');
  txt_ctrd("Press a key to continue...", '\n');
  getchar();
}


x86 assembly (clang, -O0):
<loose_scr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <header@plt>
lea    0xebe(%rip),%rdi
mov    $0xa,%esi
call   1050 <txt_ctrd@plt>
lea    0xec2(%rip),%rdi
mov    $0xa,%esi
call   1050 <txt_ctrd@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<loose_scr>:
push   %rax
xor    %eax,%eax
call   1030 <header@plt>
lea    0xec1(%rip),%rdi
mov    $0xa,%esi
call   1050 <txt_ctrd@plt>
lea    0xec5(%rip),%rdi
mov    $0xa,%esi
call   1050 <txt_ctrd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"YOU LOOSE ! LOOSER !\00"
@.str.1 = [27 x i8] c"Press a key to continue...\00"
define void @loose_scr() {
%1 = call i32 (...) @header()
%2 = call i32 @txt_ctrd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext 10)
%3 = call i32 @txt_ctrd(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8 signext 10)
%4 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"YOU LOOSE ! LOOSER !\00"
@.str.1 = [27 x i8] c"Press a key to continue...\00"
define void @loose_scr() {
%1 = tail call i32 (...) @header()
%2 = tail call i32 @txt_ctrd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext 10)
%3 = tail call i32 @txt_ctrd(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8 signext 10)
%4 = tail call i32 (...) @getchar()
ret void
}
int raw() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @raw() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void printEscapeCode(char *s) { printf("%s%s", "\033[", s); }


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

x86 assembly (clang, -O2):
<printEscapeCode>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee4(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [3 x i8] c"\1B[\00"
define void @printEscapeCode(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
__attribute__((always_)) void tx_end(void) {
  printf("%s\n", "end transaction");
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [16 x i8] c"end transaction\00"
define void @tx_end() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check(int);
int aa(int b) {
  int a = 1;
  ;
  if (a == 1) {
    a = 2;
  }
  if (a == 2) {
    a = 3;
  } else {
    a = 4;
  }
  if (!check(a)) {
    a = 0;
  }
}


x86 assembly (clang, -O0):
<aa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1133 <aa+0x23>
movl   $0x2,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1149 <aa+0x39>
movl   $0x3,-0xc(%rbp)
jmp    1150 <aa+0x40>
movl   $0x4,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <check@plt>
cmp    $0x0,%eax
jne    1168 <aa+0x58>
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa>:
mov    $0x3,%edi
jmp    1030 <check@plt>

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

LLVM IR (-O2):
define i32 @aa(i32 %0) {
%2 = tail call i32 @check(i32 3)
ret i32 undef
}
/* Variables and functions */
double M1z_z(double, double, double, double);
double M3z_x(double sign, double xi, double et, double qq) {
  return M1z_z(sign, xi, et, qq);
}


x86 assembly (clang, -O0):
<M3z_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <M1z_z@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M3z_x>:
jmp    1030 <M1z_z@plt>

LLVM IR (-O0):
define double @M3z_x(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @M1z_z(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @M3z_x(double %0, double %1, double %2, double %3) {
%5 = tail call double @M1z_z(double %0, double %1, double %2, double %3)
ret double %5
}