xunge/DecIR huggingface dataset:
void __attribute__((weak)) exti1_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<exti1_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exti1_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.exti1_isr = [10 x i8] c"exti1_isr\00"
define weak void @exti1_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.exti1_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.exti1_isr = [10 x i8] c"exti1_isr\00"
define weak void @exti1_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.exti1_isr, i64 0, i64 0))
ret void
}
int fun488() { return 488; }


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

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

LLVM IR (-O0):
define i32 @fun488() {
ret i32 488
}

LLVM IR (-O2):
define i32 @fun488() {
ret i32 488
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void I2SRxEnable(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  (*((volatile unsigned long *)(ulBase + 0x00000810))) = 0x00000001;
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) |= 0x00000002;
}


x86 assembly (clang, -O0):
<I2SRxEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
movq   $0x1,0x810(%rax)
mov    -0x8(%rbp),%rax
mov    0xc00(%rax),%rcx
or     $0x2,%rcx
mov    %rcx,0xc00(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SRxEnable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
movq   $0x1,0x810(%rbx)
orq    $0x2,0xc00(%rbx)
02
pop    %rbx
ret

LLVM IR (-O0):
define void @I2SRxEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074085888
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 2064
%9 = inttoptr i64 %8 to i64*
store volatile i64 1, i64* %9
%10 = load i64, i64* %2
%11 = add i64 %10, 3072
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = or i64 %13, 2
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @I2SRxEnable(i64 %0) {
%2 = icmp eq i64 %0, 1074085888
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 2064
%6 = inttoptr i64 %5 to i64*
store volatile i64 1, i64* %6
%7 = add i64 %0, 3072
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, 2
store volatile i64 %10, i64* %8
ret void
}
int main() {
  char c[5];
  int i;
  i = c[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
store i32 %5, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ initial_ident_char(char);
bool ident_char(char c) {
  return initial_ident_char(c) || (c >= '0' && c <= '9');
}


x86 assembly (clang, -O0):
<ident_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <initial_ident_char@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115e <ident_char+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x3(%rbp)
jl     1158 <ident_char+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ident_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <initial_ident_char@plt>
test   %rax,%rax
setne  %al
lea    -0x30(%rbx),%ecx
cmp    $0xa,%cl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ident_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @initial_ident_char(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @ident_char(i8 signext %0) {
%2 = tail call i64 @initial_ident_char(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = add i8 %0, -48
%5 = icmp ult i8 %4, 10
%6 = or i1 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
void foo465() {}


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

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

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

LLVM IR (-O2):
define void @foo465() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zipPrevDecodeLength(unsigned char *, unsigned int *);
int zipPrevEncodeLength(int /*<<< orphan*/ *, unsigned int);
int zipPrevLenByteDiff(unsigned char *p, unsigned int len) {
  unsigned int prevlensize;
  zipPrevDecodeLength(p, &prevlensize);
  return zipPrevEncodeLength(NULL, len) - prevlensize;
}


x86 assembly (clang, -O0):
<zipPrevLenByteDiff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <zipPrevDecodeLength@plt>
mov    -0xc(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <zipPrevEncodeLength@plt>
sub    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zipPrevLenByteDiff>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0xc(%rsp),%rsi
call   1040 <zipPrevDecodeLength@plt>
xor    %edi,%edi
mov    %ebx,%esi
call   1030 <zipPrevEncodeLength@plt>
sub    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @zipPrevLenByteDiff(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @zipPrevDecodeLength(i8* %6, i32* %5)
%8 = load i32, i32* %4
%9 = call i32 @zipPrevEncodeLength(i32* null, i32 %8)
%10 = load i32, i32* %5
%11 = sub i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @zipPrevLenByteDiff(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @zipPrevDecodeLength(i8* %0, i32* %3)
%6 = call i32 @zipPrevEncodeLength(i32* null, i32 %1)
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CSlaveACKValueSet(uint32_t ui32Base, bool bACK) {
  ;
  if (bACK) {
    (*((volatile unsigned long *)(ui32Base + 0x00000820))) &= ~0x00000002;
  } else {
    (*((volatile unsigned long *)(ui32Base + 0x00000820))) |= 0x00000002;
  }
}


x86 assembly (clang, -O0):
<I2CSlaveACKValueSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1130 <I2CSlaveACKValueSet+0x30>
mov    -0x8(%rbp),%rax
mov    0x820(%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    %rcx,0x820(%rax)
jmp    1146 <I2CSlaveACKValueSet+0x46>
mov    -0x8(%rbp),%rax
mov    0x820(%rax),%rcx
or     $0x2,%rcx
mov    %rcx,0x820(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveACKValueSet>:
xor    %eax,%eax
test   %esi,%esi
sete   %al
mov    0x820(%rdi),%rcx
and    $0xfffffffffffffffd,%rcx
lea    (%rcx,%rax,2),%rax
mov    %rax,0x820(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveACKValueSet(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 2080
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, -3
store volatile i64 %12, i64* %10
br label %19
13: ; preds = %2
%14 = load i64, i64* %3
%15 = add nsw i64 %14, 2080
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
%18 = or i64 %17, 2
store volatile i64 %18, i64* %16
br label %19
19: ; preds = %13, %7
ret void
}

LLVM IR (-O2):
define void @I2CSlaveACKValueSet(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = add nsw i64 %0, 2080
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -3
%8 = select i1 %3, i64 2, i64 0
%9 = or i64 %7, %8
store volatile i64 %9, i64* %5
ret void
}
float approx_pi(int n) {
  int tmp = 1;
  float sum = 0;
  for (int i = 0; i < n; i++) {
    int div = 2 * i + 1;
    sum += tmp * (4.0 / div);
    tmp *= -1;
  }
  return sum;
}


x86 assembly (clang, -O0):
<approx_pi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117a <approx_pi+0x7a>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xeb9(%rip),%xmm2
divsd  %xmm1,%xmm2
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <approx_pi+0x1d>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<approx_pi>:
xorps  %xmm0,%xmm0
test   %edi,%edi
jle    1150 <approx_pi+0x50>
mov    $0x1,%eax
movsd  0xeec(%rip),%xmm1
mov    $0x1,%ecx
nopl   0x0(%rax)
xorps  %xmm2,%xmm2
cvtsi2sd %ecx,%xmm2
xorps  %xmm3,%xmm3
cvtsi2sd %eax,%xmm3
movapd %xmm1,%xmm4
divsd  %xmm3,%xmm4
mulsd  %xmm2,%xmm4
cvtss2sd %xmm0,%xmm0
addsd  %xmm4,%xmm0
cvtsd2ss %xmm0,%xmm0
neg    %ecx
add    $0x2,%eax
add    $0xffffffff,%edi
jne    1120 <approx_pi+0x20>
ret

LLVM IR (-O0):
define float @approx_pi(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store float 0.000000e+00, float* %4
store i32 0, i32* %5
br label %7
7: ; preds = %26, %1
%8 = load i32, i32* %5
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %29
11: ; preds = %7
%12 = load i32, i32* %5
%13 = mul nsw i32 2, %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to double
%19 = fdiv double 4.000000e+00, %18
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = call double @llvm.fmuladd.f64(double %16, double %19, double %21)
%23 = fptrunc double %22 to float
store float %23, float* %4
%24 = load i32, i32* %3
%25 = mul nsw i32 %24, -1
store i32 %25, i32* %3
br label %26
26: ; preds = %11
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %7
29: ; preds = %7
%30 = load float, float* %4
ret float %30
}

LLVM IR (-O2):
define float @approx_pi(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = phi float [ 0.000000e+00, %1 ], [ %16, %5 ]
ret float %4
5: ; preds = %1, %5
%6 = phi i32 [ %17, %5 ], [ 1, %1 ]
%7 = phi i32 [ %18, %5 ], [ 0, %1 ]
%8 = phi float [ %16, %5 ], [ 0.000000e+00, %1 ]
%9 = shl nuw nsw i32 %7, 1
%10 = or i32 %9, 1
%11 = sitofp i32 %6 to double
%12 = sitofp i32 %10 to double
%13 = fdiv double 4.000000e+00, %12
%14 = fpext float %8 to double
%15 = tail call double @llvm.fmuladd.f64(double %11, double %13, double %14)
%16 = fptrunc double %15 to float
%17 = sub nsw i32 0, %6
%18 = add nuw nsw i32 %7, 1
%19 = icmp eq i32 %18, %0
br i1 %19, label %3, label %5
}
/* Variables and functions */
size_t fread(void *, int, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int stdin_getchar(void *ctx, size_t count, void *c) {
  return (fread(c, 1, count, stdin) != count);
}


x86 assembly (clang, -O0):
<stdin_getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1030 <fread@plt>
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdin_getchar>:
push   %rbx
mov    %rdx,%rdi
mov    %rsi,%rbx
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
mov    %rbx,%rdx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @stdin_getchar(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i64, i64* %5
%9 = load i32, i32* @stdin
%10 = call i64 @fread(i8* %7, i32 1, i64 %8, i32 %9)
%11 = load i64, i64* %5
%12 = icmp ne i64 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @stdin_getchar(i8* nocapture readnone %0, i64 %1, i8* %2) {
%4 = load i32, i32* @stdin
%5 = tail call i64 @fread(i8* %2, i32 1, i64 %1, i32 %4)
%6 = icmp ne i64 %5, %1
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ PushMarkArgumentSyntaxMapping(int, long);
void PushOutMarkArgumentSyntaxMapping(long p_index) {
  PushMarkArgumentSyntaxMapping(1, p_index);
}


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

x86 assembly (clang, -O2):
<PushOutMarkArgumentSyntaxMapping>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <PushMarkArgumentSyntaxMapping@plt>

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

LLVM IR (-O2):
define void @PushOutMarkArgumentSyntaxMapping(i64 %0) {
%2 = tail call i32 @PushMarkArgumentSyntaxMapping(i32 1, i64 %0)
ret void
}
int base2() { return 4; }


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

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

LLVM IR (-O0):
define i32 @base2() {
ret i32 4
}

LLVM IR (-O2):
define i32 @base2() {
ret i32 4
}
int modulo(int size, int position) {
  if (position < 0)
    position += size;
  return position;
}


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <modulo+0x1d>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
mov    %esi,%eax
sar    $0x1f,%eax
and    %edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @modulo(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %9, %8
store i32 %10, i32* %4
br label %11
11: ; preds = %7, %2
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
%4 = select i1 %3, i32 %0, i32 0
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int u_munmap(void *addr, size_t len, ...) { return 1; }


x86 assembly (clang, -O0):
<u_munmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @u_munmap(i8* nocapture readnone %0, i64 %1, ...) {
ret i32 1
}
int usagecheck_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @usagecheck_shutdown() {
ret i32 0
}
void ARGBSubtractRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBSubtractRow_Any_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insertionStep(int, int *);
int /*<<< orphan*/ print_arr(int, int *);
void insertionSort(int ar_size, int *ar) {
  for (int i = 2; i <= ar_size; i++) {
    insertionStep(i, ar);
    print_arr(ar_size, ar);
  }
}


x86 assembly (clang, -O0):
<insertionSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1168 <insertionSort+0x48>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <insertionStep@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <print_arr@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <insertionSort+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertionSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1168 <insertionSort+0x48>
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %edi,%r15d
neg    %r15d
mov    $0x2,%ebp
nopl   (%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <insertionStep@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1040 <print_arr@plt>
lea    (%r15,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
jne    1140 <insertionSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @insertionSort(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 2, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
%13 = call i32 @insertionStep(i32 %11, i32* %12)
%14 = load i32, i32* %3
%15 = load i32*, i32** %4
%16 = call i32 @print_arr(i32 %14, i32* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @insertionSort(i32 %0, i32* %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 2, %2 ]
%7 = tail call i32 @insertionStep(i32 %6, i32* %1)
%8 = tail call i32 @print_arr(i32 %0, i32* %1)
%9 = add nuw i32 %6, 1
%10 = icmp eq i32 %6, %0
br i1 %10, label %4, label %5
}
void release_transport() {
  ;
  ;
  ;

  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @release_transport() {
ret void
}
int c003(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c003() {
ret i32 0
}
/* Variables and functions */
int sqrt(int);
int lv(int a, int c) { return (-1 + sqrt(1 + 2 * (c - a))) / 2; }


x86 assembly (clang, -O0):
<lv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%edi
call   1030 <sqrt@plt>
add    $0xffffffff,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lv>:
push   %rax
sub    %edi,%esi
lea    (%rsi,%rsi,1),%edi
add    $0x1,%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
add    $0xffffffff,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xffffffff,%eax
sar    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lv(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 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = mul nsw i32 2, %7
%9 = add nsw i32 1, %8
%10 = call i32 @sqrt(i32 %9)
%11 = add nsw i32 -1, %10
%12 = sdiv i32 %11, 2
ret i32 %12
}

LLVM IR (-O2):
define i32 @lv(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl nsw i32 %3, 1
%5 = or i32 %4, 1
%6 = tail call i32 @sqrt(i32 %5)
%7 = add nsw i32 %6, -1
%8 = sdiv i32 %7, 2
ret i32 %8
}
const char *hstrerror(int err) { return "foo"; }


x86 assembly (clang, -O0):
<hstrerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i8* @hstrerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i8* @hstrerror(i32 %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTHORITY_KEYID;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ AUTHORITY_KEYID_it;
AUTHORITY_KEYID *d2i_AUTHORITY_KEYID(AUTHORITY_KEYID **a,
                                     const unsigned char **in, long len) {
  return (AUTHORITY_KEYID *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                          &AUTHORITY_KEYID_it);
}


x86 assembly (clang, -O0):
<d2i_AUTHORITY_KEYID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_AUTHORITY_KEYID>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@AUTHORITY_KEYID_it = global i32 0
define i32* @d2i_AUTHORITY_KEYID(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @AUTHORITY_KEYID_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@AUTHORITY_KEYID_it = global i32 0
define i32* @d2i_AUTHORITY_KEYID(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @AUTHORITY_KEYID_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void setbit(void *v, int p) {
  ((int *)v)[p / (sizeof(int) * 8)] |= 1 << (p & ((sizeof(int) * 8) - 1));
}


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
and    $0x1f,%rax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shr    $0x5,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbit>:
movslq %esi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x5,%rcx
or     %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @setbit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = and i64 %6, 31
%8 = trunc i64 %7 to i32
%9 = shl i32 1, %8
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = udiv i64 %13, 32
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = or i32 %16, %9
store i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @setbit(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = and i32 %1, 31
%5 = shl nuw i32 1, %4
%6 = bitcast i8* %0 to i32*
%7 = lshr i64 %3, 5
%8 = getelementptr inbounds i32, i32* %6, i64 %7
%9 = load i32, i32* %8
%10 = or i32 %9, %5
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void getStartupText(void) {
  printf("%s", "###############################################################"
               "############\n"
               "Welcome to the Complex Calculator. ©2015 Gur Telem.\n"
               "###############################################################"
               "############\n"
               "Type 'help' for instructions.");
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [235 x i8] c"###########################################################################\0AWelcome to the Complex Calculator. \C2\A92015 Gur Telem.\0A###########################################################################\0AType 'help' for instructions.\00"
define void @getStartupText() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [235 x i8] c"###########################################################################\0AWelcome to the Complex Calculator. \C2\A92015 Gur Telem.\0A###########################################################################\0AType 'help' for instructions.\00"
define void @getStartupText() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_E8uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xE8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E8uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xe8,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E8uint64_highword_reg>:
movabs $0xe800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E8uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 996432412672
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int _fneg(int a) { return a == 0 ? 0 : a ^ 0x80000000; }


x86 assembly (clang, -O0):
<_fneg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <_fneg+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <_fneg+0x26>
mov    -0x4(%rbp),%eax
xor    $0x80000000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fneg>:
mov    %edi,%eax
xor    $0x80000000,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @_fneg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = xor i32 %7, -2147483648
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ 0, %5 ], [ %8, %6 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @_fneg(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = xor i32 %0, -2147483648
%4 = select i1 %2, i32 0, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  int x = 5;
  foo(x);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @foo(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5)
ret i32 0
}
float *quat(float *result, float x, float y, float z, float w) {
  result[0] = x;
  result[1] = y;
  result[2] = z;
  result[3] = w;
  return result;
}


x86 assembly (clang, -O0):
<quat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat>:
mov    %rdi,%rax
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
movss  %xmm2,0x8(%rdi)
movss  %xmm3,0xc(%rdi)
ret

LLVM IR (-O0):
define float* @quat(float* %0, float %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %7
%12 = load float*, float** %6
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float, float* %8
%15 = load float*, float** %6
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float, float* %9
%18 = load float*, float** %6
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
%20 = load float, float* %10
%21 = load float*, float** %6
%22 = getelementptr inbounds float, float* %21, i64 3
store float %20, float* %22
%23 = load float*, float** %6
ret float* %23
}

LLVM IR (-O2):
define float* @quat(float* returned writeonly %0, float %1, float %2, float %3, float %4) {
store float %1, float* %0
%6 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
store float %3, float* %7
%8 = getelementptr inbounds float, float* %0, i64 3
store float %4, float* %8
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void padding(char ch, int n) {
  int i;
  for (i = 0; i < n; i++) {
    putchar(ch);
  }
}


x86 assembly (clang, -O0):
<padding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114b <padding+0x3b>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <padding+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padding>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <padding+0x1c>
mov    %esi,%ebx
movsbl %dil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <padding+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @padding(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @putchar(i8 signext %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_COPY_int64_t(int64_t *const dest, int64_t const src) {
  return (((*dest) = src), true);
}


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

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_COPY_int64_t>:
mov    %esi,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_COPY_int64_t(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 = load i32*, i32** %3
store i32 %5, i32* %6
ret i32 1
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_COPY_int64_t(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 1
}
unsigned __int128 __attribute__((no, noclone)) foo(unsigned long long x) {
  unsigned __int128 y = ~0ULL;
  x >>= 63;
  return y / (x | 1);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0xffffffffffffffff,-0x30(%rbp)
ff
mov    -0x18(%rbp),%rax
shr    $0x3f,%rax
mov    %rax,-0x18(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
or     $0x1,%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1160 <__udivti3>
mov    %rdx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<foo>:
mov    $0xffffffffffffffff,%rax
xor    %edx,%edx
ret

LLVM IR (-O0):
define { i64, i64 } @foo(i64 %0) {
%2 = alloca i128
%3 = alloca i64
%4 = alloca i128
store i64 %0, i64* %3
store i128 18446744073709551615, i128* %4
%5 = load i64, i64* %3
%6 = lshr i64 %5, 63
store i64 %6, i64* %3
%7 = load i128, i128* %4
%8 = load i64, i64* %3
%9 = or i64 %8, 1
%10 = zext i64 %9 to i128
%11 = udiv i128 %7, %10
store i128 %11, i128* %2
%12 = bitcast i128* %2 to { i64, i64 }*
%13 = load { i64, i64 }, { i64, i64 }* %12
ret { i64, i64 } %13
}

LLVM IR (-O2):
define { i64, i64 } @foo(i64 %0) {
ret { i64, i64 } { i64 -1, i64 0 }
}
void swap(unsigned char **a, unsigned char **b) {
  unsigned char *tmp = *a;
  *a = *b;
  *b = tmp;
}


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    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
void syscall_handler() {}


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

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

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

LLVM IR (-O2):
define void @syscall_handler() {
ret void
}
/* Variables and functions */
int _mkdir(char const *);
int makedir(const char *dir) { return _mkdir(dir); }


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

x86 assembly (clang, -O2):
<makedir>:
jmp    1030 <_mkdir@plt>

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

LLVM IR (-O2):
define i32 @makedir(i8* %0) {
%2 = tail call i32 @_mkdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ f(int);
int main(int argc, char *argv[]) {
  f(3);
  return EXIT_SUCCESS;
}


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    $0x3,%edi
call   1030 <f@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <f@plt>
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 @f(i32 3)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @f(i32 3)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
int config_READER_IRDETO(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_READER_IRDETO() {
ret i32 0
}
int main() {
  char a[10] = "abc";
  void *foo = L"AB";
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xef2(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    0xeeb(%rip),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [10 x i8] c"abc\00\00\00\00\00\00\00"
@.str = [3 x i32] [i32 65, i32 66, i32 0]
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca i8*
%3 = bitcast [10 x i8]* %1 to i8*
store i8* bitcast ([3 x i32]* @.str to i8*), i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void ssl_sigpipe_handle(int x) {}


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

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

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

LLVM IR (-O2):
define void @ssl_sigpipe_handle(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_OK;
int scmCheckReservedLock(sqlite3_file *pFile, int *pResOut) {
  *pResOut = 0;
  return SQLITE_OK;
}


x86 assembly (clang, -O0):
<scmCheckReservedLock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scmCheckReservedLock>:
movl   $0x0,(%rsi)
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SQLITE_OK = global i32 0
define i32 @scmCheckReservedLock(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
store i32 0, i32* %5
%6 = load i32, i32* @SQLITE_OK
ret i32 %6
}

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @scmCheckReservedLock(i32* nocapture readnone %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
%3 = load i32, i32* @SQLITE_OK
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned long *);
unsigned long get_unsignedlong(char *info, unsigned long z) {
  unsigned long x;
  printf(info);
  scanf("%lu", &x);
  if (x > z) {
    printf("ERROR: cannot be greater than %u\n", z);
    exit(1);
  }
  return x;
}


x86 assembly (clang, -O0):
<get_unsignedlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1185 <get_unsignedlong+0x55>
mov    -0x10(%rbp),%rsi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unsignedlong>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%rax
cmp    %rbx,%rax
ja     1160 <get_unsignedlong+0x30>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%lu\00"
@.str.1 = [34 x i8] c"ERROR: cannot be greater than %u\0A\00"
define i64 @get_unsignedlong(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* %6)
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %5)
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = icmp ugt i64 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i64, i64* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i64 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i64, i64* %5
ret i64 %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
@.str.1 = [34 x i8] c"ERROR: cannot be greater than %u\0A\00"
define i64 @get_unsignedlong(i8* nocapture %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0)
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %3)
%7 = load i64, i64* %3
%8 = icmp ugt i64 %7, %1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i64 %1)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ DPRINT();
void closelog(void) { DPRINT(); }


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

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

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

LLVM IR (-O2):
define void @closelog() {
%1 = tail call i32 (...) @DPRINT()
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("Enter some character.\n");
  printf("'getchar() != EOF' value : %d\n", getchar() != EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e9d(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter some character.\0A\00"
@.str.1 = [31 x i8] c"'getchar() != EOF' value : %d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [31 x i8] c"'getchar() != EOF' value : %d\0A\00"
@EOF = global i64 0
@str = [22 x i8] c"Enter some character.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void foo1e() {}


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

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

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

LLVM IR (-O2):
define void @foo1e() {
ret void
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *,
                                          int /*<<< orphan*/,
                                          struct wl_resource *);
void wl_surface_send_enter(struct wl_resource *resource_,
                           struct wl_resource *output) {
  wl_resource_post_event(resource_, 0, output);
}


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

x86 assembly (clang, -O2):
<wl_surface_send_enter>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_surface_send_enter(%struct.wl_resource* %0, %struct.wl_resource* %1) {
%3 = alloca %struct.wl_resource*
%4 = alloca %struct.wl_resource*
store %struct.wl_resource* %0, %struct.wl_resource** %3
store %struct.wl_resource* %1, %struct.wl_resource** %4
%5 = load %struct.wl_resource*, %struct.wl_resource** %3
%6 = load %struct.wl_resource*, %struct.wl_resource** %4
%7 = call i32 @wl_resource_post_event(%struct.wl_resource* %5, i32 0, %struct.wl_resource* %6)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_surface_send_enter(%struct.wl_resource* %0, %struct.wl_resource* %1) {
%3 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 0, %struct.wl_resource* %1)
ret void
}