xunge/DecIR huggingface dataset:
short latitudeInterpolationMultiplier(double latitude) {
  const int degreeResolution = 10;
  short difference =
      (short)(latitude >= 55 ? (degreeResolution * (latitude - 55) + 0.5)
                             : (degreeResolution * (55 - latitude) + 0.5));
  short multiplier = (difference << 8) / (((55 + 5) - 55) * degreeResolution);
  return multiplier;
}


x86 assembly (clang, -O0):
<latitudeInterpolationMultiplier>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     115a <latitudeInterpolationMultiplier+0x5a>
movsd  -0x8(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec4(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1184 <latitudeInterpolationMultiplier+0x84>
movsd  0xe9e(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xe99(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,-0xe(%rbp)
movswl -0xe(%rbp),%eax
shl    $0x8,%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %ax,-0x10(%rbp)
movswl -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<latitudeInterpolationMultiplier>:
movsd  0xef8(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
cmpnlesd %xmm0,%xmm1
addsd  0xeeb(%rip),%xmm0
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
mulsd  0xedf(%rip),%xmm1
addsd  0xedf(%rip),%xmm1
cvttsd2si %xmm1,%eax
cwtl
shl    $0x8,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x24,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @latitudeInterpolationMultiplier(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
store double %0, double* %2
store i32 10, i32* %3
%6 = load double, double* %2
%7 = fcmp oge double %6, 5.500000e+01
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load double, double* %2
%10 = fsub double %9, 5.500000e+01
%11 = call double @llvm.fmuladd.f64(double 1.000000e+01, double %10, double 5.000000e-01)
br label %16
12: ; preds = %1
%13 = load double, double* %2
%14 = fsub double 5.500000e+01, %13
%15 = call double @llvm.fmuladd.f64(double 1.000000e+01, double %14, double 5.000000e-01)
br label %16
16: ; preds = %12, %8
%17 = phi double [ %11, %8 ], [ %15, %12 ]
%18 = fptosi double %17 to i16
store i16 %18, i16* %4
%19 = load i16, i16* %4
%20 = sext i16 %19 to i32
%21 = shl i32 %20, 8
%22 = sdiv i32 %21, 50
%23 = trunc i32 %22 to i16
store i16 %23, i16* %5
%24 = load i16, i16* %5
ret i16 %24
}

LLVM IR (-O2):
define signext i16 @latitudeInterpolationMultiplier(double %0) {
%2 = fcmp ult double %0, 5.500000e+01
%3 = fsub double 5.500000e+01, %0
%4 = fadd double %0, -5.500000e+01
%5 = select i1 %2, double %3, double %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e+01, double 5.000000e-01)
%7 = fptosi double %6 to i16
%8 = sext i16 %7 to i32
%9 = shl nsw i32 %8, 8
%10 = sdiv i32 %9, 50
%11 = trunc i32 %10 to i16
ret i16 %11
}
/* Variables and functions */
float __nv_truncf(float);
float truncf(float __a) { return __nv_truncf(__a); }


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

x86 assembly (clang, -O2):
<truncf>:
jmp    1030 <__nv_truncf@plt>

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

LLVM IR (-O2):
define float @truncf(float %0) {
%2 = tail call float @__nv_truncf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIO_getEventDio(int /*<<< orphan*/);
uint32_t IOCIntStatus(uint32_t ui32IOId) {
  ;
  return (GPIO_getEventDio(ui32IOId));
}


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

x86 assembly (clang, -O2):
<IOCIntStatus>:
jmp    1030 <GPIO_getEventDio@plt>

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

LLVM IR (-O2):
define i32 @IOCIntStatus(i32 %0) {
%2 = tail call i32 @GPIO_getEventDio(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int socket_udp(void) { return socket(PF_INET, SOCK_DGRAM, 0); }


x86 assembly (clang, -O0):
<socket_udp>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_udp>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @socket_udp() {
%1 = load i32, i32* @PF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @socket_udp() {
%1 = load i32, i32* @PF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
chreg(opc, reg) int opc, reg;
{
  switch (opc) {
  case 0xB10A:
  case 0x1B00:
  case 0x1900:
    if (reg & 1)
      regerr();
    break;
  case 0xB107:
  case 0x1A00:
  case 0x1800:
    if (reg & 3)
      regerr();
    break;
  }
}


x86 assembly (clang, -O0):
<chreg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1800,%eax
je     11ae <chreg+0x9e>
jmp    1134 <chreg+0x24>
mov    -0x10(%rbp),%eax
sub    $0x1900,%eax
je     1193 <chreg+0x83>
jmp    1147 <chreg+0x37>
mov    -0x10(%rbp),%eax
sub    $0x1a00,%eax
je     11ae <chreg+0x9e>
jmp    115a <chreg+0x4a>
mov    -0x10(%rbp),%eax
sub    $0x1b00,%eax
je     1193 <chreg+0x83>
jmp    116d <chreg+0x5d>
mov    -0x10(%rbp),%eax
sub    $0xb107,%eax
je     11ae <chreg+0x9e>
jmp    1180 <chreg+0x70>
mov    -0x10(%rbp),%eax
sub    $0xb10a,%eax
jne    11c9 <chreg+0xb9>
jmp    1193 <chreg+0x83>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11a9 <chreg+0x99>
mov    $0x0,%al
call   1030 <regerr@plt>
jmp    11c9 <chreg+0xb9>
mov    -0xc(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     11c4 <chreg+0xb4>
mov    $0x0,%al
call   1030 <regerr@plt>
jmp    11c9 <chreg+0xb9>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chreg>:
cmp    $0x1aff,%edi
jg     1131 <chreg+0x21>
cmp    $0x1800,%edi
je     1151 <chreg+0x41>
cmp    $0x1900,%edi
je     1149 <chreg+0x39>
cmp    $0x1a00,%edi
je     1151 <chreg+0x41>
ret
cmp    $0xb10a,%edi
je     1149 <chreg+0x39>
cmp    $0xb107,%edi
je     1151 <chreg+0x41>
cmp    $0x1b00,%edi
jne    1130 <chreg+0x20>
test   $0x1,%sil
je     1130 <chreg+0x20>
jmp    1157 <chreg+0x47>
test   $0x3,%sil
je     1130 <chreg+0x20>
push   %rax
xor    %eax,%eax
call   1030 <regerr@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @chreg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %21 [
i32 45322, label %7
i32 6912, label %7
i32 6400, label %7
i32 45319, label %14
i32 6656, label %14
i32 6144, label %14
]
7: ; preds = %2, %2, %2
%8 = load i32, i32* %5
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (...) @regerr()
br label %13
13: ; preds = %11, %7
br label %21
14: ; preds = %2, %2, %2
%15 = load i32, i32* %5
%16 = and i32 %15, 3
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 (...) @regerr()
br label %20
20: ; preds = %18, %14
br label %21
21: ; preds = %2, %20, %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @chreg(i32 %0, i32 %1) {
switch i32 %0, label %11 [
i32 45322, label %3
i32 6912, label %3
i32 6400, label %3
i32 45319, label %6
i32 6656, label %6
i32 6144, label %6
]
3: ; preds = %2, %2, %2
%4 = and i32 %1, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %9
6: ; preds = %2, %2, %2
%7 = and i32 %1, 3
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6, %3
%10 = tail call i32 (...) @regerr()
br label %11
11: ; preds = %9, %6, %3, %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
void Dormi(int time) {
  char temp[10];
  sprintf(temp, "sleep %.2f", time / 1000.0);
  system(temp);
}


x86 assembly (clang, -O0):
<Dormi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
lea    0xebd(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xe(%rbp),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dormi>:
push   %rbx
sub    $0x10,%rsp
cvtsi2sd %edi,%xmm0
divsd  0xecf(%rip),%xmm0
cvttsd2si %xmm0,%edx
lea    0xecc(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"sleep %.2f\00"
define void @Dormi(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.000000e+03
%8 = fptosi double %7 to i32
%9 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"sleep %.2f\00"
define void @Dormi(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = sitofp i32 %0 to double
%5 = fdiv double %4, 1.000000e+03
%6 = fptosi double %5 to i32
%7 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @system(i8* %3)
ret void
}
void ASN1_item_d2i(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_item_d2i() {
ret void
}
/* Variables and functions */
scalar_t__ sqrt(double);
float rect_dist(int bx, int by, int tx, int ty) {
  float ret, diff;
  diff = bx - tx;
  ret = diff * diff;
  diff = by - ty;
  ret += diff * diff;
  ret = (float)sqrt((double)ret);
  return (ret);
}


x86 assembly (clang, -O0):
<rect_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rect_dist>:
push   %rax
sub    %edx,%edi
cvtsi2ss %edi,%xmm0
sub    %ecx,%esi
cvtsi2ss %esi,%xmm1
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rect_dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
%10 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
%14 = sitofp i32 %13 to float
store float %14, float* %10
%15 = load float, float* %10
%16 = load float, float* %10
%17 = fmul float %15, %16
store float %17, float* %9
%18 = load i32, i32* %6
%19 = load i32, i32* %8
%20 = sub nsw i32 %18, %19
%21 = sitofp i32 %20 to float
store float %21, float* %10
%22 = load float, float* %10
%23 = load float, float* %10
%24 = load float, float* %9
%25 = call float @llvm.fmuladd.f32(float %22, float %23, float %24)
store float %25, float* %9
%26 = load float, float* %9
%27 = fpext float %26 to double
%28 = call i64 @sqrt(double %27)
%29 = sitofp i64 %28 to float
store float %29, float* %9
%30 = load float, float* %9
ret float %30
}

LLVM IR (-O2):
define float @rect_dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = sitofp i32 %5 to float
%7 = fmul float %6, %6
%8 = sub nsw i32 %1, %3
%9 = sitofp i32 %8 to float
%10 = tail call float @llvm.fmuladd.f32(float %9, float %9, float %7)
%11 = fpext float %10 to double
%12 = tail call i64 @sqrt(double %11)
%13 = sitofp i64 %12 to float
ret float %13
}
long long int gcd(long long int x, long long int y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <gcd+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <gcd+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %5, %4 ], [ %0, %2 ]
%7 = srem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %5, %4 ]
ret i64 %10
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int, int, int);
void print_pids(int pid) {
  printf("Own pid: %d, parent pid: %d, fork returned: %d\n", getpid(),
         getppid(), pid);
}


x86 assembly (clang, -O0):
<print_pids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
mov    -0x4(%rbp),%ecx
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pids>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xeb4(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Own pid: %d, parent pid: %d, fork returned: %d\0A\00"
define void @print_pids(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = call i32 (...) @getppid()
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Own pid: %d, parent pid: %d, fork returned: %d\0A\00"
define void @print_pids(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (...) @getppid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dprintf(int, char *, char const *);
int usage(const char *argv0) {
  dprintf(2,
          "usage: %s file\n\n"
          "all filenames inside file will be deleted\n"
          "filename may be '-' to indicate stdin\n",
          argv0);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xed4(%rip),%rsi
call   1030 <dprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    $0x2,%edi
call   1030 <dprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [97 x i8] c"usage: %s file\0A\0Aall filenames inside file will be deleted\0Afilename may be '-' to indicate stdin\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @dprintf(i32 2, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}

LLVM IR (-O2):
@.str = [97 x i8] c"usage: %s file\0A\0Aall filenames inside file will be deleted\0Afilename may be '-' to indicate stdin\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i32 @dprintf(i32 2, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrefixToPostfix() { printf("hey i am PrefixToPostfix"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"hey i am PrefixToPostfix\00"
define void @PrefixToPostfix() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"hey i am PrefixToPostfix\00"
define void @PrefixToPostfix() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ensure_max_threads_not_exceeded();
void mypaint_init(void) { ensure_max_threads_not_exceeded(); }


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

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

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

LLVM IR (-O2):
define void @mypaint_init() {
%1 = tail call i32 (...) @ensure_max_threads_not_exceeded()
ret void
}
/* Variables and functions */
int ispunct(unsigned char);
int ispunct_c(char c) { return ispunct((unsigned char)c); }


x86 assembly (clang, -O0):
<ispunct_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <ispunct@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct_c>:
movzbl %dil,%edi
jmp    1030 <ispunct@plt>

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

LLVM IR (-O2):
define i32 @ispunct_c(i8 signext %0) {
%2 = tail call i32 @ispunct(i8 zeroext %0)
ret i32 %2
}
char *strcpy(char *restrict s1, char const *restrict s2) {
  for (char *i = s1; (*i = *s2); ++i, ++s2) {
  }
  return s1;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     114a <strcpy+0x4a>
jmp    112d <strcpy+0x2d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     111f <strcpy+0x1f>
mov    $0x1,%ecx
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %2
ret i8* %0
6: ; preds = %2, %6
%7 = phi i8* [ %9, %6 ], [ %0, %2 ]
%8 = phi i8* [ %10, %6 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
store i8 %11, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %5, label %6
}
void foo482() {}


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

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

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

LLVM IR (-O2):
define void @foo482() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void trap() { write(1, "Ouch!!\n", 7); }


x86 assembly (clang, -O0):
<trap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x7,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trap>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x7,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Ouch!!\0A\00"
define void @trap() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Ouch!!\0A\00"
define void @trap() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test19_head() {
  do {
    printf("test19");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test19_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test19_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test19_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test19\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test19_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test19\00"
define void @test19_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ os_bell();
void beep(void) { os_bell(); }


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

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

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

LLVM IR (-O2):
define void @beep() {
%1 = tail call i32 (...) @os_bell()
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *list_find(struct list const *const, void const *,
                              int (*)(void const *, void const *));
int list_contains(const struct list *const l, const void *data,
                  int (*compar)(const void *, const void *)) {
  return list_find(l, data, compar) != NULL;
}


x86 assembly (clang, -O0):
<list_contains>:
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
call   1030 <list_find@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_contains>:
push   %rax
call   1030 <list_find@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define i32 @list_contains(%struct.list* %0, i8* %1, i32 (i8*, i8*)* %2) {
%4 = alloca %struct.list*
%5 = alloca i8*
%6 = alloca i32 (i8*, i8*)*
store %struct.list* %0, %struct.list** %4
store i8* %1, i8** %5
store i32 (i8*, i8*)* %2, i32 (i8*, i8*)** %6
%7 = load %struct.list*, %struct.list** %4
%8 = load i8*, i8** %5
%9 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %6
%10 = call i32* @list_find(%struct.list* %7, i8* %8, i32 (i8*, i8*)* %9)
%11 = icmp ne i32* %10, null
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.list = type { i32 }
define i32 @list_contains(%struct.list* %0, i8* %1, i32 (i8*, i8*)* %2) {
%4 = tail call i32* @list_find(%struct.list* %0, i8* %1, i32 (i8*, i8*)* %2)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
void RAWToRGB24Row_C() {}


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

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

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

LLVM IR (-O2):
define void @RAWToRGB24Row_C() {
ret void
}
int f(int i) {
  static int si = 3;
  return i + si;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    0x2f10(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x3(%rdi),%eax
ret

LLVM IR (-O0):
@f.si = internal global i32 3
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @f.si
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void fail(void) { raise(SIGABRT); }


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @fail() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @raise(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @fail() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @raise(i32 %1)
ret void
}
/* Variables and functions */
void *calloc(unsigned long, int);
int /*<<< orphan*/ free(void *);
void f5(int i) {
  unsigned long j;
  j = 10;
  if (i > 0) {
    void *ptr = calloc(j, i);
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0xa,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1156 <f5+0x36>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
test   %edi,%edi
jle    113a <f5+0x1a>
push   %rax
mov    %edi,%esi
mov    $0xa,%edi
call   1040 <calloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @f5(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i8*
store i32 %0, i32* %2
store i64 10, i64* %3
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i64, i64* %3
%9 = load i32, i32* %2
%10 = call i8* @calloc(i64 %8, i32 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @f5(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i8* @calloc(i64 10, i32 %0)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int getmaxx(int /*<<< orphan*/ const *);
int find_center_start(const WINDOW *win, size_t length) {
  int max_x = getmaxx(win);
  int half = length / 2;
  return max_x / 2 - half;
}


x86 assembly (clang, -O0):
<find_center_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getmaxx@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_center_start>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getmaxx@plt>
shr    %rbx
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @find_center_start(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i64 %1, i64* %4
%7 = load i32*, i32** %3
%8 = call i32 @getmaxx(i32* %7)
store i32 %8, i32* %5
%9 = load i64, i64* %4
%10 = udiv i64 %9, 2
%11 = trunc i64 %10 to i32
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = sdiv i32 %12, 2
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @find_center_start(i32* %0, i64 %1) {
%3 = tail call i32 @getmaxx(i32* %0)
%4 = lshr i64 %1, 1
%5 = trunc i64 %4 to i32
%6 = sdiv i32 %3, 2
%7 = sub nsw i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ WriteByteManchester(int, int /*<<< orphan*/);
void WriteSync() {
  for (int i = 0; i < 100; i++) {
    WriteByteManchester(0x54, 0);
  }
  WriteByteManchester(0xC3, 0);
}


x86 assembly (clang, -O0):
<WriteSync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1143 <WriteSync+0x33>
mov    $0x54,%edi
xor    %esi,%esi
call   1030 <WriteByteManchester@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <WriteSync+0xf>
mov    $0xc3,%edi
xor    %esi,%esi
call   1030 <WriteByteManchester@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteSync>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x54,%edi
xor    %esi,%esi
call   1030 <WriteByteManchester@plt>
add    $0xffffffff,%ebx
jne    1120 <WriteSync+0x10>
mov    $0xc3,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <WriteByteManchester@plt>

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

LLVM IR (-O2):
define void @WriteSync() {
br label %3
1: ; preds = %3
%2 = tail call i32 @WriteByteManchester(i32 195, i32 0)
ret void
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @WriteByteManchester(i32 84, i32 0)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 100
br i1 %7, label %1, label %3
}
/* Variables and functions */
int /*<<< orphan*/ insert_entry(unsigned int, unsigned short);
char k_free(unsigned int address, unsigned short blocks) {
  insert_entry(address, blocks);
  return 1;
}


x86 assembly (clang, -O0):
<k_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
movzwl -0x6(%rbp),%esi
call   1030 <insert_entry@plt>
mov    $0x1,%al
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_free>:
push   %rax
call   1030 <insert_entry@plt>
mov    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @k_free(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
%7 = call i32 @insert_entry(i32 %5, i16 zeroext %6)
ret i8 1
}

LLVM IR (-O2):
define signext i8 @k_free(i32 %0, i16 zeroext %1) {
%3 = tail call i32 @insert_entry(i32 %0, i16 zeroext %1)
ret i8 1
}
int fd_add(int x, int y) {
  int c = 0;
  c = x + y;
  return c;
}


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

x86 assembly (clang, -O2):
<fd_add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @fd_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void av_filename_number_test() {}


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

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

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

LLVM IR (-O2):
define void @av_filename_number_test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_content_cpim();
int /*<<< orphan*/ test_content_dummy();
int /*<<< orphan*/ test_content_text_plain();
void test_contents() {
  test_content_dummy();
  test_content_text_plain();
  test_content_cpim();
}


x86 assembly (clang, -O0):
<test_contents>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_content_dummy@plt>
mov    $0x0,%al
call   1040 <test_content_text_plain@plt>
mov    $0x0,%al
call   1030 <test_content_cpim@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_contents>:
push   %rax
xor    %eax,%eax
call   1050 <test_content_dummy@plt>
xor    %eax,%eax
call   1040 <test_content_text_plain@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_content_cpim@plt>

LLVM IR (-O0):
define void @test_contents() {
%1 = call i32 (...) @test_content_dummy()
%2 = call i32 (...) @test_content_text_plain()
%3 = call i32 (...) @test_content_cpim()
ret void
}

LLVM IR (-O2):
define void @test_contents() {
%1 = tail call i32 (...) @test_content_dummy()
%2 = tail call i32 (...) @test_content_text_plain()
%3 = tail call i32 (...) @test_content_cpim()
ret void
}
/* Type definitions */
typedef double int32_t;

/* Variables and functions */
void raycoord_norm(int32_t lat0, int32_t lon0, double *lat, double *lon) {
  *lat = lat0 / 107.1709342;
  *lon = lon0 / ((double)0x7fffffff) * 180.0;
}


x86 assembly (clang, -O0):
<raycoord_norm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeed(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb8(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<raycoord_norm>:
divsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm1
movsd  %xmm0,(%rdi)
mulsd  0xef4(%rip),%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @raycoord_norm(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = fdiv double %9, 0x405ACAF095FFB126
%11 = load double*, double** %7
store double %10, double* %11
%12 = load double, double* %6
%13 = fdiv double %12, 0x41DFFFFFFFC00000
%14 = fmul double %13, 1.800000e+02
%15 = load double*, double** %8
store double %14, double* %15
ret void
}

LLVM IR (-O2):
define void @raycoord_norm(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fdiv double %0, 0x405ACAF095FFB126
store double %5, double* %2
%6 = fdiv double %1, 0x41DFFFFFFFC00000
%7 = fmul double %6, 1.800000e+02
store double %7, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(void *, char const *);
scalar_t__ strlen(char const *);
void *libopm_strdup(const char *s) {
  void *ret = malloc(strlen(s) + 1);
  assert(ret);
  strcpy(ret, s);
  return ret;
}


x86 assembly (clang, -O0):
<libopm_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libopm_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @libopm_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @assert(i8* %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @libopm_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @assert(i8* %4)
%6 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void sysfs_remove_file(struct kobject *k, const struct attribute *a) { ; }


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
%struct.attribute = type opaque
define void @sysfs_remove_file(%struct.kobject* %0, %struct.attribute* %1) {
%3 = alloca %struct.kobject*
%4 = alloca %struct.attribute*
store %struct.kobject* %0, %struct.kobject** %3
store %struct.attribute* %1, %struct.attribute** %4
ret void
}

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute = type opaque
define void @sysfs_remove_file(%struct.kobject* nocapture %0, %struct.attribute* nocapture %1) {
ret void
}
/* Variables and functions */
unsigned short isprint(char c) { return (c >= 0x20 && c <= 0x7E); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isprint+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xe0,%dil
xor    %eax,%eax
cmp    $0x5f,%dil
setb   %al
ret

LLVM IR (-O0):
define zeroext i16 @isprint(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 126
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @isprint(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = zext i1 %3 to i16
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void forward_ref(void) { printf("forward ok\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"forward ok\00"
define void @forward_ref() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void blink_long() { printf("dah "); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"dah \00"
define void @blink_long() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lol();
int main(int argc, char const *argv[]) {
  lol();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @lol()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ output(char *, int);
int /*<<< orphan*/ sscanf(char const *, char *, int *);
void printCPUxWaitInfo(const char *cmd) {
  int id;
  sscanf(cmd + 7, "%d", &id);
  output("CPU %d Wait Load\t0\t100\t%%\n", id + 1);
}


x86 assembly (clang, -O0):
<printCPUxWaitInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
lea    0xec5(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xeb2(%rip),%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCPUxWaitInfo>:
push   %rax
add    $0x7,%rdi
lea    0xed4(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%esi
lea    0xebf(%rip),%rdi
call   1030 <output@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [27 x i8] c"CPU %d Wait Load\090\09100\09%%\0A\00"
define void @printCPUxWaitInfo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 7
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i32 @output(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [27 x i8] c"CPU %d Wait Load\090\09100\09%%\0A\00"
define void @printCPUxWaitInfo(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 7
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = call i32 @output(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
scalar_t__ islower(char);
scalar_t__ isupper(char);
int computeSymbolIndex(char token) {
  int idx = -1;
  if (islower(token)) {
    idx = token - 'a' + 26;
  } else if (isupper(token)) {
    idx = token - 'A';
  }
  return idx;
}


x86 assembly (clang, -O0):
<computeSymbolIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     115a <computeSymbolIndex+0x3a>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0x1a,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <computeSymbolIndex+0x5c>
movsbl -0x1(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1177 <computeSymbolIndex+0x57>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <computeSymbolIndex+0x5c>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeSymbolIndex>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
movsbl %bl,%ebx
test   %rax,%rax
je     1135 <computeSymbolIndex+0x15>
add    $0xffffffb9,%ebx
jmp    114b <computeSymbolIndex+0x2b>
mov    %ebx,%edi
call   1040 <isupper@plt>
test   %rax,%rax
je     1146 <computeSymbolIndex+0x26>
add    $0xffffffbf,%ebx
jmp    114b <computeSymbolIndex+0x2b>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @computeSymbolIndex(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 -1, i32* %3
%4 = load i8, i8* %2
%5 = call i64 @islower(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 97
%11 = add nsw i32 %10, 26
store i32 %11, i32* %3
br label %21
12: ; preds = %1
%13 = load i8, i8* %2
%14 = call i64 @isupper(i8 signext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 65
store i32 %19, i32* %3
br label %20
20: ; preds = %16, %12
br label %21
21: ; preds = %20, %7
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @computeSymbolIndex(i8 signext %0) {
%2 = tail call i64 @islower(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = sext i8 %0 to i32
%6 = add nsw i32 %5, -71
br label %13
7: ; preds = %1
%8 = tail call i64 @isupper(i8 signext %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = sext i8 %0 to i32
%12 = add nsw i32 %11, -65
br label %13
13: ; preds = %7, %10, %4
%14 = phi i32 [ %6, %4 ], [ %12, %10 ], [ -1, %7 ]
ret i32 %14
}