xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int log_sense_param_flags(int *);
uint8_t log_sense_param_fmt(uint8_t *param) {
  return log_sense_param_flags(param) & 0x03;
}


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

x86 assembly (clang, -O2):
<log_sense_param_fmt>:
push   %rax
call   1030 <log_sense_param_flags@plt>
and    $0x3,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @log_sense_param_fmt(i32* %0) {
%2 = tail call i32 @log_sense_param_flags(i32* %0)
%3 = and i32 %2, 3
ret i32 %3
}
double cos(double x) {
  const double a0 = 9.99959174689540053e-1;
  const double a1 = 1.35263438100583208e-5;
  const double a2 = -4.99238704253639242e-1;
  const double a3 = -5.43517523575486391e-5;
  const double a4 = 3.95818354322389060e-2;
  return a0 + x * (a1 + x * (a2 + x * (a3 + x * a4)));
}


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
movsd  0xeb2(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xeae(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe8e(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe76(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5e(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xee8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
store double 0x3FEFFFAA62140E23, double* %3
store double 0x3EEC5DE6899D53E7, double* %4
store double 0xBFDFF386E4EAACCC, double* %5
store double 0xBF0C7EF7FDA831DC, double* %6
store double 0x3FA444120164ECEE, double* %7
%8 = load double, double* %2
%9 = load double, double* %2
%10 = load double, double* %2
%11 = load double, double* %2
%12 = call double @llvm.fmuladd.f64(double %11, double 0x3FA444120164ECEE, double 0xBF0C7EF7FDA831DC)
%13 = call double @llvm.fmuladd.f64(double %10, double %12, double 0xBFDFF386E4EAACCC)
%14 = call double @llvm.fmuladd.f64(double %9, double %13, double 0x3EEC5DE6899D53E7)
%15 = call double @llvm.fmuladd.f64(double %8, double %14, double 0x3FEFFFAA62140E23)
ret double %15
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x3FA444120164ECEE, double 0xBF0C7EF7FDA831DC)
%3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double 0xBFDFF386E4EAACCC)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %3, double 0x3EEC5DE6899D53E7)
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double 0x3FEFFFAA62140E23)
ret double %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _write_decimal(scalar_t__);
void _write_decimal_10000(uint32_t value) {
  uint8_t decimal_10000 = (value % 100000) / 10000;
  if (decimal_10000 != 0) {
    _write_decimal(decimal_10000);
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x186a0,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <_write_decimal_10000+0x3a>
mov    -0x10(%rbp),%rdi
call   1030 <_write_decimal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
movslq %edi,%rax
imul   $0x14f8b589,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2d,%rax
add    %ecx,%eax
imul   $0x186a0,%eax,%eax
mov    %eax,%ecx
neg    %ecx
add    %edi,%ecx
add    $0x270f,%ecx
cmp    $0x4e1f,%ecx
jae    1142 <_write_decimal_10000+0x32>
ret
sub    %eax,%edi
movslq %edi,%rax
imul   $0x68db8bad,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rax
add    %ecx,%eax
movslq %eax,%rdi
jmp    1030 <_write_decimal@plt>

LLVM IR (-O0):
define void @_write_decimal_10000(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 100000
%6 = sdiv i32 %5, 10000
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i64, i64* %3
%12 = call i32 @_write_decimal(i64 %11)
br label %13
13: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
define void @_write_decimal_10000(i32 %0) {
%2 = srem i32 %0, 100000
%3 = add nsw i32 %2, 9999
%4 = icmp ult i32 %3, 19999
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = sdiv i32 %2, 10000
%7 = sext i32 %6 to i64
%8 = tail call i32 @_write_decimal(i64 %7)
br label %9
9: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glb_error(char *);
int earth_range(double baseline) {
  if (baseline < 0) {
    glb_error("The baseline may not be negative");
    return -1;
  }
  if (baseline > 2 * 6371.0) {
    glb_error("The baseline may not exceed 2*GLB_EARTH_RADIUS");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<earth_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1143 <earth_range+0x33>
lea    0xed6(%rip),%rdi
call   1030 <glb_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <earth_range+0x69>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1172 <earth_range+0x62>
lea    0xec8(%rip),%rdi
call   1030 <glb_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <earth_range+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<earth_range>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1124 <earth_range+0x14>
lea    0xee6(%rip),%rdi
jmp    1137 <earth_range+0x27>
xor    %eax,%eax
ucomisd 0xed2(%rip),%xmm0
jbe    1141 <earth_range+0x31>
lea    0xef2(%rip),%rdi
call   1030 <glb_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"The baseline may not be negative\00"
@.str.1 = [47 x i8] c"The baseline may not exceed 2*GLB_EARTH_RADIUS\00"
define i32 @earth_range(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @glb_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %14
8: ; preds = %1
%9 = load double, double* %3
%10 = fcmp ogt double %9, 1.274200e+04
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @glb_error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %11, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [33 x i8] c"The baseline may not be negative\00"
@.str.1 = [47 x i8] c"The baseline may not exceed 2*GLB_EARTH_RADIUS\00"
define i32 @earth_range(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 1.274200e+04
br i1 %4, label %5, label %8
5: ; preds = %3, %1
%6 = phi i8* [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), %3 ]
%7 = tail call i32 @glb_error(i8* %6)
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ 0, %3 ], [ -1, %5 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int setegid(gid_t __attribute__((unused)) gid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setegid(i32 %0) {
ret i32 0
}
void func2(int var1, int var2) {
  var1 = var2 << 1;
  var1 = var2 << 1;
  var1 = var2 << 1;
  var1 = var2 >> 1;
  var1 = var2 >> 1;
  var1 = var2 >> 1;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func2(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 = shl i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = shl i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %4
%10 = shl i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = ashr i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = ashr i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = ashr i32 %15, 1
store i32 %16, i32* %3
ret void
}

LLVM IR (-O2):
define void @func2(i32 %0, i32 %1) {
ret void
}
const char *strnpchr(const char *start, const char *end, int ch) {
  while (start != end) {
    if (*start == ch) {
      return start;
    }
    ++start;
  }
  return 0;
}


x86 assembly (clang, -O0):
<strnpchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     114b <strnpchr+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x1c(%rbp),%eax
jne    113a <strnpchr+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <strnpchr+0x53>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <strnpchr+0xf>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnpchr>:
cmp    %rsi,%rdi
je     1120 <strnpchr+0x20>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
movsbl (%rax),%ecx
cmp    %edx,%ecx
je     1122 <strnpchr+0x22>
add    $0x1,%rax
cmp    %rsi,%rax
jne    1110 <strnpchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strnpchr(i8* %0, i8* readnone %1, i32 %2) {
%4 = icmp eq i8* %0, %1
br i1 %4, label %13, label %5
5: ; preds = %3, %10
%6 = phi i8* [ %11, %10 ], [ %0, %3 ]
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, %2
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i8* %11, %1
br i1 %12, label %13, label %5
13: ; preds = %5, %10, %3
%14 = phi i8* [ null, %3 ], [ null, %10 ], [ %6, %5 ]
ret i8* %14
}
/* Type definitions */
typedef int uint_least16_t;

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


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_COPY_uint_least16_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_uint_least16_t>:
mov    %esi,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_COPY_uint_least16_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_uint_least16_t(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 1
}
int matchString(const char **strptr, const char *against) {
  const char *str = *strptr;
  while (*against != 0) {
    if (*str != *against)
      return 0;
    str++;
    against++;
  }
  *strptr = str;
  return 1;
}


x86 assembly (clang, -O0):
<matchString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1166 <matchString+0x66>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1149 <matchString+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1178 <matchString+0x78>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <matchString+0x17>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchString>:
mov    (%rdi),%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1123 <matchString+0x23>
add    $0x1,%rsi
nopl   (%rax)
cmp    %cl,(%rax)
jne    112c <matchString+0x2c>
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <matchString+0x10>
mov    %rax,(%rdi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @matchString(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %2, %12
%7 = phi i8 [ %15, %12 ], [ %4, %2 ]
%8 = phi i8* [ %13, %12 ], [ %3, %2 ]
%9 = phi i8* [ %14, %12 ], [ %1, %2 ]
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, %7
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %12, %2
%18 = phi i8* [ %3, %2 ], [ %13, %12 ]
store i8* %18, i8** %0
br label %19
19: ; preds = %6, %17
%20 = phi i32 [ 1, %17 ], [ 0, %6 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ VIA1_ExtraTimeBegin();
void ExtraTimeBeginNotify(void) { VIA1_ExtraTimeBegin(); }


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

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

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

LLVM IR (-O2):
define void @ExtraTimeBeginNotify() {
%1 = tail call i32 (...) @VIA1_ExtraTimeBegin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void *xmalloc(size_t);
__attribute__((visibility("hidden"))) void *xmallocz(size_t size) {
  void *ptr;
  if (size + 1 < size)
    panic("xmallocz: data too large to fit "
          "into virtual memory space\n");
  ptr = xmalloc(size + 1);
  ((char *)ptr)[size] = 0;
  return ptr;
}


x86 assembly (clang, -O0):
<xmallocz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
cmp    -0x8(%rbp),%rax
jae    114a <xmallocz+0x2a>
lea    0xebb(%rip),%rdi
call   1030 <panic@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmallocz>:
push   %rbx
mov    %rdi,%rbx
cmp    $0xffffffffffffffff,%rdi
jne    1136 <xmallocz+0x16>
lea    0xecf(%rip),%rdi
call   1030 <panic@plt>
lea    0x1(%rbx),%rdi
call   1040 <xmalloc@plt>
movb   $0x0,(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [59 x i8] c"xmallocz: data too large to fit into virtual memory space\0A\00"
define hidden i8* @xmallocz(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 1
%6 = load i64, i64* %2
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @panic(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i64, i64* %2
%12 = add i64 %11, 1
%13 = call i8* @xmalloc(i64 %12)
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = load i64, i64* %2
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [59 x i8] c"xmallocz: data too large to fit into virtual memory space\0A\00"
define hidden i8* @xmallocz(i64 %0) {
%2 = icmp eq i64 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @panic(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = add i64 %0, 1
%7 = tail call i8* @xmalloc(i64 %6)
%8 = getelementptr inbounds i8, i8* %7, i64 %0
store i8 0, i8* %8
ret i8* %7
}
/* Variables and functions */
float ANTweenTimingFunctionBackOut(float, int /*<<< orphan*/, int, float);
float ANTweenProgressTimingFunctionBackOut(float time, float duration) {
  return ANTweenTimingFunctionBackOut(time, 0, 1, duration);
}


x86 assembly (clang, -O0):
<ANTweenProgressTimingFunctionBackOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <ANTweenTimingFunctionBackOut@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenProgressTimingFunctionBackOut>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <ANTweenTimingFunctionBackOut@plt>

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

LLVM IR (-O2):
define float @ANTweenProgressTimingFunctionBackOut(float %0, float %1) {
%3 = tail call float @ANTweenTimingFunctionBackOut(float %0, i32 0, i32 1, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char *, int);
void strncat_empty() {
  char dst[8] = "123";
  char src[] = "";
  strncat(dst, src, 4);
}


x86 assembly (clang, -O0):
<strncat_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x9(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
lea    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x4,%edx
call   1040 <strncat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat_empty>:
sub    $0x18,%rsp
movq   $0x333231,0x10(%rsp)
movb   $0x0,0xf(%rsp)
lea    0x10(%rsp),%rdi
lea    0xf(%rsp),%rsi
mov    $0x4,%edx
call   1030 <strncat@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.strncat_empty.dst = [8 x i8] c"123\00\00\00\00\00"
define void @strncat_empty() {
%1 = alloca [8 x i8]
%2 = alloca [1 x i8]
%3 = bitcast [8 x i8]* %1 to i8*
%4 = bitcast [1 x i8]* %2 to i8*
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%7 = call i32 @strncat(i8* %5, i8* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @strncat_empty() {
%1 = alloca i64
%2 = alloca [1 x i8]
%3 = bitcast i64* %1 to i8*
store i64 3355185, i64* %1
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 0, i8* %4
%5 = call i32 @strncat(i8* %3, i8* %4, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetL1OsculatingCoor(double, double, int, double *);
void GetL1Coor(double jd, int body, double *xyz) {
  GetL1OsculatingCoor(jd, jd, body, xyz);
}


x86 assembly (clang, -O0):
<GetL1Coor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <GetL1OsculatingCoor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetL1Coor>:
movaps %xmm0,%xmm1
jmp    1030 <GetL1OsculatingCoor@plt>

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

LLVM IR (-O2):
define void @GetL1Coor(double %0, i32 %1, double* %2) {
%4 = tail call i32 @GetL1OsculatingCoor(double %0, double %0, i32 %1, double* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void start2() {
  int i = 200;
  while (1) {
    printf("t2 %d\n", i++);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<start2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc8,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112f <start2+0xf>

x86 assembly (clang, -O2):
<start2>:
push   %rbp
push   %rbx
push   %rax
mov    $0xc8,%esi
lea    0xed1(%rip),%rbx
nop
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %ebp,%esi
jmp    1130 <start2+0x10>

LLVM IR (-O0):
@.str = [7 x i8] c"t2 %d\0A\00"
define void @start2() {
%1 = alloca i32
store i32 200, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@.str = [7 x i8] c"t2 %d\0A\00"
define void @start2() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 200, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solve_by_quaddobl_Laurent_homotopy_continuation(int number_of_tasks) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(776, &number_of_tasks, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solve_by_quaddobl_Laurent_homotopy_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x308,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_by_quaddobl_Laurent_homotopy_continuation>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x308,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solve_by_quaddobl_Laurent_homotopy_continuation(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 776, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @solve_by_quaddobl_Laurent_homotopy_continuation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 776, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
void selinux_relabel_path(const char *path, const char *inside_path) {
  (void)path;
  (void)inside_path;
}


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

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

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

LLVM IR (-O2):
define void @selinux_relabel_path(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void int32_ttolocal(int32_t *l) { (void)l; }


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

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

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

LLVM IR (-O2):
define void @int32_ttolocal(i32* nocapture %0) {
ret void
}
/* Type definitions */
struct completion {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __wait_completion(struct completion *);
int wait_for_completion_interruptible(struct completion *work) {
  __wait_completion(work);
  return 0;
}


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

x86 assembly (clang, -O2):
<wait_for_completion_interruptible>:
push   %rax
call   1030 <__wait_completion@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.completion = type { i32 }
define i32 @wait_for_completion_interruptible(%struct.completion* %0) {
%2 = tail call i32 @__wait_completion(%struct.completion* %0)
ret i32 0
}
/* Variables and functions */
size_t triangle(size_t n) { return (n * (n + 1)) / 2; }


x86 assembly (clang, -O0):
<triangle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
shr    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangle>:
lea    0x1(%rdi),%rax
imul   %rdi,%rax
shr    %rax
ret

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

LLVM IR (-O2):
define i64 @triangle(i64 %0) {
%2 = add i64 %0, 1
%3 = mul i64 %2, %0
%4 = lshr i64 %3, 1
ret i64 %4
}
void I422ToRGB24Row_NEON() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ alloc_x86_reg(struct regstat *, int, int, int);
void alloc_cc(struct regstat *cur, int i) { alloc_x86_reg(cur, i, 23, 6); }


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

x86 assembly (clang, -O2):
<alloc_cc>:
mov    $0x17,%edx
mov    $0x6,%ecx
jmp    1030 <alloc_x86_reg@plt>

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

LLVM IR (-O2):
%struct.regstat = type { i32 }
define void @alloc_cc(%struct.regstat* %0, i32 %1) {
%3 = tail call i32 @alloc_x86_reg(%struct.regstat* %0, i32 %1, i32 23, i32 6)
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, int);
void main() {
  char xx;
  xx = getchar();
  printf("%c", xx);
  int d;
  scanf("%d", d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
lea    0xeb7(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1050 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1050 <scanf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret void
}
int bitcount(unsigned num) {
  int x = num;
  int cont;
  while (x != 0) {
    if (num != (x &= (x - 1)))
      ++cont;
  }
  return cont;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113c <bitcount+0x3c>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    -0x8(%rbp),%ecx
mov    %ecx,-0x8(%rbp)
cmp    %ecx,%eax
je     1137 <bitcount+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110d <bitcount+0xd>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
test   %edi,%edi
je     1129 <bitcount+0x29>
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rcx),%edx
mov    %edx,%esi
and    %ecx,%esi
xor    %r8d,%r8d
cmp    %edi,%esi
setne  %r8b
add    %r8d,%eax
and    %ecx,%edx
mov    %edx,%ecx
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ undef, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %5
%8 = icmp ne i32 %7, %0
%9 = zext i1 %8 to i32
%10 = add nsw i32 %4, %9
%11 = icmp eq i32 %7, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ undef, %1 ], [ %10, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int mkfifo(char *, int);
int /*<<< orphan*/ printf(char *);
int main3(int argc, char **argv) {
  int fd;
  fd = mkfifo(argv[1], 0666);
  if (fd < 0) {
    printf("ERROR mkfifo\n");
    exit(1);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x1b6,%esi
call   1040 <mkfifo@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1174 <main3+0x44>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main3>:
push   %rax
mov    0x8(%rsi),%rdi
mov    $0x1b6,%esi
call   1040 <mkfifo@plt>
test   %eax,%eax
jns    1159 <main3+0x29>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"ERROR mkfifo\0A\00"
define i32 @main3(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @mkfifo(i8* %8, i32 438)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"ERROR mkfifo\00"
define i32 @main3(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @mkfifo(i8* %4, i32 438)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int tolower(int c) {
  uint8_t cb = c;
  if ((cb >= 'A') && (cb <= 'Z'))
    cb ^= 0x20;
  return cb;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1131 <tolower+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1131 <tolower+0x31>
movsbl -0x5(%rbp),%eax
xor    $0x20,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
movsbl %dil,%ecx
shl    $0x18,%edi
add    $0xbfffffff,%edi
mov    %ecx,%eax
xor    $0x20,%eax
cmp    $0x1affffff,%edi
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %18
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 90
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = xor i32 %15, 32
%17 = trunc i32 %16 to i8
store i8 %17, i8* %3
br label %18
18: ; preds = %13, %9, %1
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1073741825
%4 = icmp ult i32 %3, 452984831
%5 = ashr exact i32 %2, 24
%6 = xor i32 %5, 32
%7 = select i1 %4, i32 %6, i32 %5
ret i32 %7
}
void expand_args(argcp, argvp) int *argcp;
char ***argvp;
{
  if (argcp || argvp)
    return;
}


x86 assembly (clang, -O0):
<expand_args>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1122 <expand_args+0x22>
cmpq   $0x0,-0x10(%rbp)
je     1127 <expand_args+0x27>
jmp    1127 <expand_args+0x27>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @expand_args(i32* nocapture %0, i8*** nocapture %1) {
ret void
}
/* Type definitions */
struct wb_str_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strdup(char const *);
struct wb_str_list *wb_list_new_elem(int /*<<< orphan*/, struct wb_str_list *);
struct wb_str_list *wb_list_prepend(struct wb_str_list *list, const char *str) {
  struct wb_str_list *new;
  new = wb_list_new_elem(strdup(str), list);
  return new;
}


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

x86 assembly (clang, -O2):
<wb_list_prepend>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strdup@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <wb_list_new_elem@plt>

LLVM IR (-O0):
%struct.wb_str_list = type { i32 }
define %struct.wb_str_list* @wb_list_prepend(%struct.wb_str_list* %0, i8* %1) {
%3 = alloca %struct.wb_str_list*
%4 = alloca i8*
%5 = alloca %struct.wb_str_list*
store %struct.wb_str_list* %0, %struct.wb_str_list** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strdup(i8* %6)
%8 = load %struct.wb_str_list*, %struct.wb_str_list** %3
%9 = call %struct.wb_str_list* @wb_list_new_elem(i32 %7, %struct.wb_str_list* %8)
store %struct.wb_str_list* %9, %struct.wb_str_list** %5
%10 = load %struct.wb_str_list*, %struct.wb_str_list** %5
ret %struct.wb_str_list* %10
}

LLVM IR (-O2):
%struct.wb_str_list = type { i32 }
define %struct.wb_str_list* @wb_list_prepend(%struct.wb_str_list* %0, i8* %1) {
%3 = tail call i32 @strdup(i8* %1)
%4 = tail call %struct.wb_str_list* @wb_list_new_elem(i32 %3, %struct.wb_str_list* %0)
ret %struct.wb_str_list* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help03(void) {
  printf("  u                 unassemble 16 instrs starting at PC\n");
  printf("  u  <addr>         unassemble 16 instrs starting at <addr>\n");
  printf("  u  <addr> <cnt>   unassemble <cnt> instrs starting at <addr>\n");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c" u unassemble 16 instrs starting at PC\0A\00"
@.str.1 = [61 x i8] c" u <addr> unassemble 16 instrs starting at <addr>\0A\00"
@.str.2 = [64 x i8] c" u <addr> <cnt> unassemble <cnt> instrs starting at <addr>\0A\00"
define void @help03() {
%1 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [56 x i8] c" u unassemble 16 instrs starting at PC\00"
@str.3 = [60 x i8] c" u <addr> unassemble 16 instrs starting at <addr>\00"
@str.4 = [63 x i8] c" u <addr> <cnt> unassemble <cnt> instrs starting at <addr>\00"
define void @help03() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __builtin_mips_cabs_un_d(double, double);
int test1(double a, double b) { return __builtin_mips_cabs_un_d(a, b); }


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

x86 assembly (clang, -O2):
<test1>:
jmp    1030 <__builtin_mips_cabs_un_d@plt>

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

LLVM IR (-O2):
define i32 @test1(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_un_d(double %0, double %1)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int is_header_to_fix(uint8_t *header_buffer) {
  if (header_buffer[7] & 0x3F)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_header_to_fix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x3f,%eax
cmp    $0x0,%eax
je     1127 <is_header_to_fix+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_header_to_fix+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_header_to_fix>:
xor    %eax,%eax
testb  $0x3f,0x1c(%rdi)
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_header_to_fix(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = and i32 %3, 63
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int __ffssi2(long i) {
  int b;
  if (i == 0)
    return 0;
  for (b = 1; !(i & 1); ++b)
    i = (unsigned int)i >> 1;
  return b;
}


x86 assembly (clang, -O0):
<__ffssi2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <__ffssi2+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1165 <__ffssi2+0x65>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <__ffssi2+0x44>
jmp    115f <__ffssi2+0x5f>
mov    -0x10(%rbp),%rax
shr    $0x1,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <__ffssi2+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ffssi2>:
test   %rdi,%rdi
je     1131 <__ffssi2+0x31>
mov    $0x1,%eax
test   $0x1,%dil
jne    1130 <__ffssi2+0x30>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%ecx
shr    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %rcx,%rdi
je     1120 <__ffssi2+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @__ffssi2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = and i64 %0, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3, %6
%7 = phi i32 [ %11, %6 ], [ 1, %3 ]
%8 = phi i64 [ %10, %6 ], [ %0, %3 ]
%9 = lshr i64 %8, 1
%10 = and i64 %9, 2147483647
%11 = add nuw nsw i32 %7, 1
%12 = and i64 %8, 2
%13 = icmp eq i64 %12, 0
br i1 %13, label %6, label %14
14: ; preds = %6, %3, %1
%15 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %11, %6 ]
ret i32 %15
}
void YOUNG_Echanger(int *p, int *q) {
  int tmp = *p;
  *p = *q;
  *q = tmp;
}


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

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

LLVM IR (-O0):
define void @YOUNG_Echanger(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @YOUNG_Echanger(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
long int parent(long int index) { return (long int)(index / 2); }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %rdi,%rax
shr    $0x3f,%rax
add    %rdi,%rax
sar    %rax
ret

LLVM IR (-O0):
define i64 @parent(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sdiv i64 %3, 2
ret i64 %4
}

LLVM IR (-O2):
define i64 @parent(i64 %0) {
%2 = sdiv i64 %0, 2
ret i64 %2
}