xunge/DecIR huggingface dataset:
unsigned int __umulsi3(a, b)
register unsigned int a, b;
{
  register result = 0;
  do {
    if (a & 1) {
      result += b;
    }
    a >>= 1;
    b <<= 1;
  } while (a | b);
  return result;
}


x86 assembly (clang, -O0):
<__umulsi3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1129 <__umulsi3+0x29>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    1111 <__umulsi3+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__umulsi3>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%ecx
and    $0x1,%ecx
neg    %ecx
and    %esi,%ecx
add    %ecx,%eax
shr    %edi
add    %esi,%esi
mov    %esi,%ecx
or     %edi,%ecx
jne    1110 <__umulsi3+0x10>
ret

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

LLVM IR (-O2):
define i32 @__umulsi3(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %11, %3 ]
%5 = phi i32 [ %1, %2 ], [ %12, %3 ]
%6 = phi i32 [ 0, %2 ], [ %10, %3 ]
%7 = and i32 %4, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 0, i32 %5
%10 = add i32 %9, %6
%11 = lshr i32 %4, 1
%12 = shl i32 %5, 1
%13 = or i32 %12, %11
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %3
15: ; preds = %3
ret i32 %10
}
void __clear_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % (sizeof(long) * 8)));
  unsigned long *p = ((unsigned long *)addr) + ((nr) / (sizeof(long) * 8));
  *p &= ~mask;
}


x86 assembly (clang, -O0):
<__clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x20(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__clear_bit>:
movslq %edi,%rcx
mov    %rcx,%rax
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
shr    $0x6,%rax
and    %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
define void @__clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = urem i64 %8, 64
%10 = shl i64 1, %9
store i64 %10, i64* %5
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = udiv i64 %13, 64
%15 = getelementptr inbounds i64, i64* %11, i64 %14
store i64* %15, i64** %6
%16 = load i64, i64* %5
%17 = xor i64 %16, -1
%18 = load i64*, i64** %6
%19 = load i64, i64* %18
%20 = and i64 %19, %17
store i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @__clear_bit(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = lshr i64 %3, 6
%7 = getelementptr inbounds i64, i64* %1, i64 %6
%8 = xor i64 %5, -1
%9 = load i64, i64* %7
%10 = and i64 %9, %8
store i64 %10, i64* %7
ret void
}
/* Variables and functions */
long getNum(char *, char const *, int, char const *);
long getLong(const char *arg, int flags, const char *name) {
  return getNum("getLong", arg, flags, name);
}


x86 assembly (clang, -O0):
<getLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <getNum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLong>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <getNum@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"getLong\00"
define i64 @getLong(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i64 @getNum(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
ret i64 %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"getLong\00"
define i64 @getLong(i8* %0, i32 %1, i8* %2) {
%4 = tail call i64 @getNum(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
ret i64 %4
}
/* Variables and functions */
int factorial(int);
combina(int n, int r) {
  return factorial(n) / (factorial(n - r) * factorial(r));
}


x86 assembly (clang, -O0):
<combina>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<combina>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <factorial@plt>
mov    %eax,%r14d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <factorial@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
imul   %ebp,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @combina(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 = call i32 @factorial(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
%10 = call i32 @factorial(i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @factorial(i32 %11)
%13 = mul nsw i32 %10, %12
%14 = sdiv i32 %6, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @combina(i32 %0, i32 %1) {
%3 = tail call i32 @factorial(i32 %0)
%4 = sub nsw i32 %0, %1
%5 = tail call i32 @factorial(i32 %4)
%6 = tail call i32 @factorial(i32 %1)
%7 = mul nsw i32 %6, %5
%8 = sdiv i32 %3, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeUSBAnalog(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000000);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000001, 0x00000000);
}


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

x86 assembly (clang, -O2):
<GPIOPinTypeUSBAnalog>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edx,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeUSBAnalog(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @GPIODirModeSet(i32 %5, i32 %6, i32 0)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeUSBAnalog(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 0)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 1, i32 0)
ret void
}
void foo805() {}


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

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

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

LLVM IR (-O2):
define void @foo805() {
ret void
}
const char *COM_GetExtension(const char *name) {
  const char *dot = strrchr(name, '.'), *slash;
  if (dot && ((slash = strrchr(name, '/')) == ((void *)0) || slash < dot))
    return dot + 1;
  else
    return "";
}


x86 assembly (clang, -O0):
<COM_GetExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1174 <COM_GetExtension+0x64>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1163 <COM_GetExtension+0x53>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1174 <COM_GetExtension+0x64>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    117f <COM_GetExtension+0x6f>
lea    0xe85(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_GetExtension>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0xed7(%rip),%r14
test   %rax,%rax
je     114f <COM_GetExtension+0x3f>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1148 <COM_GetExtension+0x38>
cmp    %rbx,%rax
jae    114f <COM_GetExtension+0x3f>
add    $0x1,%rbx
mov    %rbx,%r14
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @COM_GetExtension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @strrchr(i8* %6, i32 46)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %21
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i8* @strrchr(i8* %11, i32 47)
store i8* %12, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = load i8*, i8** %4
%17 = icmp ult i8* %15, %16
br i1 %17, label %18, label %21
18: ; preds = %14, %10
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 1
store i8* %20, i8** %2
br label %22
21: ; preds = %14, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %22
22: ; preds = %21, %18
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @COM_GetExtension(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%6 = icmp eq i8* %5, null
%7 = icmp ult i8* %5, %2
%8 = select i1 %6, i1 true, i1 %7
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %2, i64 1
br label %11
11: ; preds = %1, %4, %9
%12 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %12
}
/* Variables and functions */
int musmidi_unpause();
int mus_midi_unpause(void) { return musmidi_unpause(); }


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

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

LLVM IR (-O0):
define i32 @mus_midi_unpause() {
%1 = call i32 (...) @musmidi_unpause()
ret i32 %1
}

LLVM IR (-O2):
define i32 @mus_midi_unpause() {
%1 = tail call i32 (...) @musmidi_unpause()
ret i32 %1
}
unsigned movsi(void) { return 0xF0F00000U; }


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

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

LLVM IR (-O0):
define i32 @movsi() {
ret i32 -252706816
}

LLVM IR (-O2):
define i32 @movsi() {
ret i32 -252706816
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
double dot_vnvn(double const *, double const *, int /*<<< orphan*/ const);
int /*<<< orphan*/ mul_vnvn_fl(double *, double const *, double const,
                               int /*<<< orphan*/ const);
void project_vn_vnvn_normalized(double v_out[], const double p[],
                                const double v_proj[], const uint dims) {
  const double mul = dot_vnvn(p, v_proj, dims);
  mul_vnvn_fl(v_out, v_proj, mul, dims);
}


x86 assembly (clang, -O0):
<project_vn_vnvn_normalized>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <dot_vnvn@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movsd  -0x28(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
call   1040 <mul_vnvn_fl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<project_vn_vnvn_normalized>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebp
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <dot_vnvn@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <mul_vnvn_fl@plt>

LLVM IR (-O0):
define void @project_vn_vnvn_normalized(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%10 = load double*, double** %6
%11 = load double*, double** %7
%12 = load i32, i32* %8
%13 = call double @dot_vnvn(double* %10, double* %11, i32 %12)
store double %13, double* %9
%14 = load double*, double** %5
%15 = load double*, double** %7
%16 = load double, double* %9
%17 = load i32, i32* %8
%18 = call i32 @mul_vnvn_fl(double* %14, double* %15, double %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @project_vn_vnvn_normalized(double* %0, double* %1, double* %2, i32 %3) {
%5 = tail call double @dot_vnvn(double* %1, double* %2, i32 %3)
%6 = tail call i32 @mul_vnvn_fl(double* %0, double* %2, double %5, i32 %3)
ret void
}
/* Variables and functions */
int *malloc(int);
int *memcpy(int *, int *, int);
int *DuplicateList(int *list) {
  int *res;
  res = malloc(((list[0] + 2) / 16 + 1) * 16 * sizeof(int));
  res = memcpy(res, list, (list[0] + 1) * sizeof(int));
  return res;
}


x86 assembly (clang, -O0):
<DuplicateList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x2,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DuplicateList>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%ebx
lea    0x2(%rbx),%eax
lea    0x11(%rbx),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff0,%ecx
lea    0x40(,%rcx,4),%edi
call   1040 <malloc@plt>
lea    0x4(,%rbx,4),%edx
mov    %rax,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i32* @DuplicateList(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 2
%8 = sdiv i32 %7, 16
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %9, 16
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 4
%13 = trunc i64 %12 to i32
%14 = call i32* @malloc(i32 %13)
store i32* %14, i32** %3
%15 = load i32*, i32** %3
%16 = load i32*, i32** %2
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = mul i64 %21, 4
%23 = trunc i64 %22 to i32
%24 = call i32* @memcpy(i32* %15, i32* %16, i32 %23)
store i32* %24, i32** %3
%25 = load i32*, i32** %3
ret i32* %25
}

LLVM IR (-O2):
define i32* @DuplicateList(i32* %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 2
%4 = sdiv i32 %3, 16
%5 = shl i32 %4, 6
%6 = add i32 %5, 64
%7 = tail call i32* @malloc(i32 %6)
%8 = shl i32 %2, 2
%9 = add i32 %8, 4
%10 = tail call i32* @memcpy(i32* %7, i32* %0, i32 %9)
ret i32* %10
}
int common_divisor(int a, int b) {
  int c;
  if (a < b) {
    c = a;
    a = b;
    b = c;
  }
  while (a % b != 0) {
    a = a % b;
    c = a;
    a = b;
    b = c;
  }
  return b;
}


x86 assembly (clang, -O0):
<common_divisor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1128 <common_divisor+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <common_divisor+0x2d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     115e <common_divisor+0x5e>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <common_divisor+0x2d>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<common_divisor>:
mov    %esi,%edx
cmp    %esi,%edi
mov    %edi,%eax
cmovl  %esi,%eax
cmovl  %edi,%edx
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <common_divisor+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @common_divisor(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
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %4
store i32 %11, i32* %3
%12 = load i32, i32* %5
store i32 %12, i32* %4
br label %13
13: ; preds = %9, %2
br label %14
14: ; preds = %19, %13
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %14
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = srem i32 %20, %21
store i32 %22, i32* %3
%23 = load i32, i32* %3
store i32 %23, i32* %5
%24 = load i32, i32* %4
store i32 %24, i32* %3
%25 = load i32, i32* %5
store i32 %25, i32* %4
br label %14
26: ; preds = %14
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @common_divisor(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
%5 = select i1 %3, i32 %0, i32 %1
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ %4, %2 ], [ %8, %6 ]
%8 = phi i32 [ %5, %2 ], [ %9, %6 ]
%9 = srem i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 %8
}
void kill_time(int num) {
  int i;
  for (i = 0; i < num; i++) {
    asm("nop");
  }
}


x86 assembly (clang, -O0):
<kill_time>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1129 <kill_time+0x29>
nop
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <kill_time+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_time>:
test   %edi,%edi
jle    1116 <kill_time+0x16>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
nop
add    $0xffffffff,%edi
jne    1110 <kill_time+0x10>
ret

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

LLVM IR (-O2):
define void @kill_time(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ 0, %1 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%5 = add nuw nsw i32 %4, 1
%6 = icmp eq i32 %5, %0
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MIDI_SetSongTime(unsigned long);
void MUSIC_SetSongTime(unsigned long milliseconds) {
  MIDI_SetSongTime(milliseconds);
}


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

x86 assembly (clang, -O2):
<MUSIC_SetSongTime>:
jmp    1030 <MIDI_SetSongTime@plt>

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

LLVM IR (-O2):
define void @MUSIC_SetSongTime(i64 %0) {
%2 = tail call i32 @MIDI_SetSongTime(i64 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void OneWireIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000100))) &= ~ui32IntFlags;
}


x86 assembly (clang, -O0):
<OneWireIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x100(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x100(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<OneWireIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x100(%rcx)
ret

LLVM IR (-O0):
define void @OneWireIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 256
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @OneWireIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 256
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_resolve_query_ref(void *q) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_resolve_query_ref(i8* nocapture readnone %0) {
ret i8* null
}
void create_safe() {}


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

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

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

LLVM IR (-O2):
define void @create_safe() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ acc_device_t;

/* Variables and functions */
int /*<<< orphan*/ acc_init(int /*<<< orphan*/);
int main(int argc, char **argv) {
  acc_init((acc_device_t)99);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x63,%edi
call   1030 <acc_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @acc_init(i32 99)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @acc_init(i32 99)
ret i32 0
}
int test_imm_ABint8_mem(signed char *val) {
  return ((*val) & (0xAB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ABint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -85
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("no\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"no\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int PMPI_Error_class(int, int *);
int MPI_Error_class(int errorcode, int *errorclass) {
  ;
  return PMPI_Error_class(errorcode, errorclass);
}


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

x86 assembly (clang, -O2):
<MPI_Error_class>:
jmp    1030 <PMPI_Error_class@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ SPI_IOC_WR_MAX_SPEED_HZ;
scalar_t__ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int SPI_setMaxFrequency(int spidev_fd, uint32_t frequency) {
  if (ioctl(spidev_fd, SPI_IOC_WR_MAX_SPEED_HZ, &frequency) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<SPI_setMaxFrequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1149 <SPI_setMaxFrequency+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <SPI_setMaxFrequency+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_setMaxFrequency>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
@SPI_IOC_WR_MAX_SPEED_HZ = global i32 0
define i32 @SPI_setMaxFrequency(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* @SPI_IOC_WR_MAX_SPEED_HZ
%8 = call i64 @ioctl(i32 %6, i32 %7, i32* %5)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@SPI_IOC_WR_MAX_SPEED_HZ = global i32 0
define i32 @SPI_setMaxFrequency(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SPI_IOC_WR_MAX_SPEED_HZ
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %3)
%6 = ashr i64 %5, 63
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ reallocarray(int /*<<< orphan*/ *, int, int);
int main(void) { return !!reallocarray(NULL, 1, 1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <reallocarray@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <reallocarray@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @reallocarray(i32* null, i32 1, i32 1)
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @reallocarray(i32* null, i32 1, i32 1)
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct rdp_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tcoord_init(struct rdp_state *);
void tex_init(struct rdp_state *rdp) { tcoord_init(rdp); }


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

x86 assembly (clang, -O2):
<tex_init>:
jmp    1030 <tcoord_init@plt>

LLVM IR (-O0):
%struct.rdp_state = type { i32 }
define void @tex_init(%struct.rdp_state* %0) {
%2 = alloca %struct.rdp_state*
store %struct.rdp_state* %0, %struct.rdp_state** %2
%3 = load %struct.rdp_state*, %struct.rdp_state** %2
%4 = call i32 @tcoord_init(%struct.rdp_state* %3)
ret void
}

LLVM IR (-O2):
%struct.rdp_state = type { i32 }
define void @tex_init(%struct.rdp_state* %0) {
%2 = tail call i32 @tcoord_init(%struct.rdp_state* %0)
ret void
}
int lockd_lv_uses_lock(struct logical_volume *lv) { return 0; }


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

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

LLVM IR (-O0):
%struct.logical_volume = type opaque
define i32 @lockd_lv_uses_lock(%struct.logical_volume* %0) {
%2 = alloca %struct.logical_volume*
store %struct.logical_volume* %0, %struct.logical_volume** %2
ret i32 0
}

LLVM IR (-O2):
%struct.logical_volume = type opaque
define i32 @lockd_lv_uses_lock(%struct.logical_volume* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void out_of_mem(void) {
  fputs("Failed to allocate more memory!\n", stderr);
  abort();
}


x86 assembly (clang, -O0):
<out_of_mem>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<out_of_mem>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Failed to allocate more memory!\0A\00"
@stderr = global i32 0
define void @out_of_mem() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"Failed to allocate more memory!\0A\00"
@stderr = global i32 0
define void @out_of_mem() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @abort()
unreachable
}
void sys_getversion(int *major, int *minor, int *bugfix) {
  if (major)
    *major = 0;
  if (minor)
    *minor = 43;
  if (bugfix)
    *bugfix = 2;
}


x86 assembly (clang, -O0):
<sys_getversion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1125 <sys_getversion+0x25>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113a <sys_getversion+0x3a>
mov    -0x10(%rbp),%rax
movl   $0x2b,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     114f <sys_getversion+0x4f>
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_getversion>:
test   %rdi,%rdi
je     110b <sys_getversion+0xb>
movl   $0x0,(%rdi)
test   %rsi,%rsi
je     1116 <sys_getversion+0x16>
movl   $0x2b,(%rsi)
test   %rdx,%rdx
je     1121 <sys_getversion+0x21>
movl   $0x2,(%rdx)
ret

LLVM IR (-O0):
define void @sys_getversion(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** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i32*, i32** %4
store i32 0, i32* %10
br label %11
11: ; preds = %9, %3
%12 = load i32*, i32** %5
%13 = icmp ne i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32*, i32** %5
store i32 43, i32* %15
br label %16
16: ; preds = %14, %11
%17 = load i32*, i32** %6
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load i32*, i32** %6
store i32 2, i32* %20
br label %21
21: ; preds = %19, %16
ret void
}

LLVM IR (-O2):
define void @sys_getversion(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2) {
%4 = icmp eq i32* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i32 0, i32* %0
br label %6
6: ; preds = %5, %3
%7 = icmp eq i32* %1, null
br i1 %7, label %9, label %8
8: ; preds = %6
store i32 43, i32* %1
br label %9
9: ; preds = %8, %6
%10 = icmp eq i32* %2, null
br i1 %10, label %12, label %11
11: ; preds = %9
store i32 2, i32* %2
br label %12
12: ; preds = %11, %9
ret void
}
int path_getsep(const char *path) {
  while (*path) {
    if (((*path) == '/'))
      return *path;
    ++path;
  }
  return '\0';
}


x86 assembly (clang, -O0):
<path_getsep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <path_getsep+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1134 <path_getsep+0x34>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <path_getsep+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <path_getsep+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_getsep>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <path_getsep+0x11>
cmp    $0x2f,%al
je     1114 <path_getsep+0x14>
add    $0x1,%rdi
jmp    1100 <path_getsep>
xor    %eax,%eax
ret
mov    $0x2f,%eax
ret

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

LLVM IR (-O2):
define i32 @path_getsep(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 47, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 47, %7 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, int);
void poppointer8_(char *ppp) { popNarray(ppp, 8); }


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

x86 assembly (clang, -O2):
<poppointer8_>:
mov    $0x8,%esi
jmp    1030 <popNarray@plt>

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

LLVM IR (-O2):
define void @poppointer8_(i8* %0) {
%2 = tail call i32 @popNarray(i8* %0, i32 8)
ret void
}
void GPIOIntClear(unsigned long ulPort, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulPort + 0x0000041C))) = ulIntFlags;
}


x86 assembly (clang, -O0):
<GPIOIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x41c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOIntClear>:
mov    %rsi,0x41c(%rdi)
ret

LLVM IR (-O0):
define void @GPIOIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 1052
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @GPIOIntClear(i64 %0, i64 %1) {
%3 = add i64 %0, 1052
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core6_print(char *, char const *);
void U_EMRPOLYLINETO16_print(const char *contents) {
  core6_print("U_EMRPOLYLINETO16", contents);
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"U_EMRPOLYLINETO16\00"
define void @U_EMRPOLYLINETO16_print(i8* %0) {
%2 = tail call i32 @core6_print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void bitmap32_print(int32_t *bitmap, FILE *out) {
  fprintf(out, "Bitmap 32:\t");
  fprintf(out, "%d\t", *bitmap);
  fprintf(out, "\n");
}


x86 assembly (clang, -O0):
<bitmap32_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap32_print>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xebf(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    (%r14),%edx
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Bitmap 32:\09\00"
@.str.1 = [4 x i8] c"%d\09\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @bitmap32_print(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %4
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32*, i32** %4
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Bitmap 32:\09\00"
@.str.1 = [4 x i8] c"%d\09\00"
define void @bitmap32_print(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %1)
%4 = load i32, i32* %0
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @fputc(i32 10, i32* %1)
ret void
}
/* Variables and functions */
int i8086ReadStrConfig(char *, char const *, char const *);
int i8086NameExistsConfig(const char *filename, const char *name) {
  char str[256];
  return i8086ReadStrConfig(str, filename, name);
}


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

x86 assembly (clang, -O2):
<i8086NameExistsConfig>:
sub    $0x108,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <i8086ReadStrConfig@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @i8086NameExistsConfig(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @i8086ReadStrConfig(i8* %6, i8* %7, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @i8086NameExistsConfig(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @i8086ReadStrConfig(i8* %4, i8* %0, i8* %1)
ret i32 %5
}
extern void upcrt_after_barrier(int barrierval, int flag) {}


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

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

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

LLVM IR (-O2):
define void @upcrt_after_barrier(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int guess_winsize();
int win_size(int *win_width) {
  *win_width = 0;
  *win_width = guess_winsize();
  return 0;
}


x86 assembly (clang, -O0):
<win_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <guess_winsize@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<win_size>:
push   %rbx
mov    %rdi,%rbx
movl   $0x0,(%rdi)
xor    %eax,%eax
call   1030 <guess_winsize@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @win_size(i32* nocapture writeonly %0) {
store i32 0, i32* %0
%2 = tail call i32 (...) @guess_winsize()
store i32 %2, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_timers();
void Cset_timers() { set_timers(); }


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

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

LLVM IR (-O0):
define void @Cset_timers() {
%1 = call i32 (...) @set_timers()
ret void
}

LLVM IR (-O2):
define void @Cset_timers() {
%1 = tail call i32 (...) @set_timers()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I(int, int);
int /*<<< orphan*/ P(int);
int /*<<< orphan*/ putchar(int);
void Q(int x) {
  I(114, x / 100);
  putchar(67);
  P(x % 100);
}


x86 assembly (clang, -O0):
<Q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    $0x72,%edi
call   1050 <I@plt>
mov    $0x43,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <P@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q>:
push   %r14
push   %rbx
push   %rax
movslq %edi,%r14
imul   $0x51eb851f,%r14,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x25,%rbx
add    %eax,%ebx
mov    $0x72,%edi
mov    %ebx,%esi
call   1050 <I@plt>
mov    $0x43,%edi
call   1030 <putchar@plt>
imul   $0x64,%ebx,%eax
sub    %eax,%r14d
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <P@plt>

LLVM IR (-O0):
define void @Q(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 100
%5 = call i32 @I(i32 114, i32 %4)
%6 = call i32 @putchar(i32 67)
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = call i32 @P(i32 %8)
ret void
}

LLVM IR (-O2):
define void @Q(i32 %0) {
%2 = sdiv i32 %0, 100
%3 = tail call i32 @I(i32 114, i32 %2)
%4 = tail call i32 @putchar(i32 67)
%5 = srem i32 %0, 100
%6 = tail call i32 @P(i32 %5)
ret void
}
void Swap(unsigned long *a, unsigned long *b) {
  int temp;
  temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<Swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
movslq -0x14(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap>:
movslq (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @Swap(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
store i64 %4, i64* %0
%5 = shl i64 %3, 32
%6 = ashr exact i64 %5, 32
store i64 %6, i64* %1
ret void
}