xunge/DecIR huggingface dataset:
double retta(int x1, double y1, int x2, double y2, int x) {
  double m = (y2 - y1) / (x2 - x1);
  return m * (x - x1) + y1;
}


x86 assembly (clang, -O0):
<retta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x24(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<retta>:
subsd  %xmm0,%xmm1
sub    %edi,%esi
cvtsi2sd %esi,%xmm2
divsd  %xmm2,%xmm1
sub    %edi,%edx
xorps  %xmm2,%xmm2
cvtsi2sd %edx,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @retta(i32 %0, double %1, i32 %2, double %3, i32 %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
%11 = alloca double
store i32 %0, i32* %6
store double %1, double* %7
store i32 %2, i32* %8
store double %3, double* %9
store i32 %4, i32* %10
%12 = load double, double* %9
%13 = load double, double* %7
%14 = fsub double %12, %13
%15 = load i32, i32* %8
%16 = load i32, i32* %6
%17 = sub nsw i32 %15, %16
%18 = sitofp i32 %17 to double
%19 = fdiv double %14, %18
store double %19, double* %11
%20 = load double, double* %11
%21 = load i32, i32* %10
%22 = load i32, i32* %6
%23 = sub nsw i32 %21, %22
%24 = sitofp i32 %23 to double
%25 = load double, double* %7
%26 = call double @llvm.fmuladd.f64(double %20, double %24, double %25)
ret double %26
}

LLVM IR (-O2):
define double @retta(i32 %0, double %1, i32 %2, double %3, i32 %4) {
%6 = fsub double %3, %1
%7 = sub nsw i32 %2, %0
%8 = sitofp i32 %7 to double
%9 = fdiv double %6, %8
%10 = sub nsw i32 %4, %0
%11 = sitofp i32 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %9, double %11, double %1)
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double mutlak() {
  double a;
  printf("Mutlak degeri alinacak bir deger veriniz.\n");
  scanf("%lf", &a);
  if (a < 0) {
    return a * (-1);
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<mutlak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1169 <mutlak+0x49>
movsd  0xea6(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1173 <mutlak+0x53>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutlak>:
push   %rax
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movapd 0xeb7(%rip),%xmm2
xorpd  %xmm1,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm1,%xmm0
cmpltsd %xmm3,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Mutlak degeri alinacak bir deger veriniz.\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
define double @mutlak() {
%1 = alloca double
%2 = alloca double
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load double, double* %2
%9 = fmul double %8, -1.000000e+00
store double %9, double* %1
br label %12
10: ; preds = %0
%11 = load double, double* %2
store double %11, double* %1
br label %12
12: ; preds = %10, %7
%13 = load double, double* %1
ret double %13
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@str = [42 x i8] c"Mutlak degeri alinacak bir deger veriniz.\00"
define double @mutlak() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fcmp olt double %5, 0.000000e+00
%7 = fneg double %5
%8 = select i1 %6, double %7, double %5
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
FILE *d_open_file(char *fname) {
  FILE *fp;
  fp = fopen(fname, "r");
  if (fp == NULL) {
    perror("File open failed\n");
    exit(1);
  }
  return fp;
}


x86 assembly (clang, -O0):
<d_open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <d_open_file+0x41>
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_open_file>:
push   %rax
lea    0xec8(%rip),%rsi
call   1030 <fopen@plt>
test   %rax,%rax
je     1144 <d_open_file+0x14>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [18 x i8] c"File open failed\0A\00"
define i32* @d_open_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [18 x i8] c"File open failed\0A\00"
define noalias i32* @d_open_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i32* %2
}
int pi_close_lib(void *handle) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pi_close_lib(i8* nocapture readnone %0) {
ret i32 1
}
int isValidPc(unsigned long pc) {
  if (pc > (0x00180000 - 1))
    return 0;
  if (pc & 0x1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isValidPc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x17ffff,-0x10(%rbp)
jbe    1122 <isValidPc+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1147 <isValidPc+0x47>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1140 <isValidPc+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1147 <isValidPc+0x47>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidPc>:
mov    %edi,%ecx
not    %ecx
and    $0x1,%ecx
xor    %eax,%eax
cmp    $0x180000,%rdi
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isValidPc(i64 %0) {
%2 = icmp ugt i64 %0, 1572863
%3 = trunc i64 %0 to i32
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
%6 = select i1 %2, i32 0, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u32x4_murmur32v_data64(int /*<<< orphan*/ const *,
                                               size_t, uintptr_t,
                                               int /*<<< orphan*/ *);
void rgph_u32x4_murmur32v_u64a(const uint64_t *key, size_t len, uintptr_t seed,
                               uint32_t *h) {
  rgph_u32x4_murmur32v_data64(key, len, seed, h);
}


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

x86 assembly (clang, -O2):
<rgph_u32x4_murmur32v_u64a>:
jmp    1030 <rgph_u32x4_murmur32v_data64@plt>

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

LLVM IR (-O2):
define void @rgph_u32x4_murmur32v_u64a(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i32 @rgph_u32x4_murmur32v_data64(i32* %0, i64 %1, i64 %2, i32* %3)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
__attribute__((unused)) int string_compare(const char *str1, const char *str2) {
  if (str1 == str2) {
    return 1;
  }
  if (str1 == NULL || str2 == NULL) {
    return 0;
  }
  return strcmp(str1, str2) == 0;
}


x86 assembly (clang, -O0):
<string_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113a <string_compare+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1178 <string_compare+0x68>
cmpq   $0x0,-0x10(%rbp)
je     1150 <string_compare+0x40>
cmpq   $0x0,-0x18(%rbp)
jne    115c <string_compare+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1178 <string_compare+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_compare>:
cmp    %rsi,%rdi
je     1137 <string_compare+0x27>
xor    %eax,%eax
test   %rdi,%rdi
je     1136 <string_compare+0x26>
test   %rsi,%rsi
je     1136 <string_compare+0x26>
push   %rax
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @string_compare(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = icmp eq i8* %0, null
%6 = icmp eq i8* %1, null
%7 = or i1 %5, %6
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = tail call i64 @strcmp(i8* %0, i8* %1)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %2, %8
%13 = phi i32 [ %11, %8 ], [ 1, %2 ], [ 0, %4 ]
ret i32 %13
}
/* Variables and functions */
int log(float);
float sigmund_powtodb(float f) {
  if (f <= 0)
    return (0);
  else {
    float val = 100 + 10. / 2.302585092994 * log(f);
    return (val < 0 ? 0 : val);
  }
}


x86 assembly (clang, -O0):
<sigmund_powtodb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1137 <sigmund_powtodb+0x27>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1194 <sigmund_powtodb+0x84>
movss  -0x8(%rbp),%xmm0
call   1030 <log@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1180 <sigmund_powtodb+0x70>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    118a <sigmund_powtodb+0x7a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmund_powtodb>:
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
jae    114d <sigmund_powtodb+0x3d>
push   %rax
movaps %xmm1,%xmm0
call   1030 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xecd(%rip),%xmm0
addsd  0xecd(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
xorps  %xmm0,%xmm0
maxss  %xmm1,%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define float @sigmund_powtodb(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fcmp ole float %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %21
8: ; preds = %1
%9 = load float, float* %3
%10 = call i32 @log(float %9)
%11 = sitofp i32 %10 to double
%12 = call double @llvm.fmuladd.f64(double 0x40115F2CED384F8A, double %11, double 1.000000e+02)
%13 = fptrunc double %12 to float
store float %13, float* %4
%14 = load float, float* %4
%15 = fcmp olt float %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %8
br label %19
17: ; preds = %8
%18 = load float, float* %4
br label %19
19: ; preds = %17, %16
%20 = phi float [ 0.000000e+00, %16 ], [ %18, %17 ]
store float %20, float* %2
br label %21
21: ; preds = %19, %7
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @sigmund_powtodb(float %0) {
%2 = fcmp ugt float %0, 0.000000e+00
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = tail call i32 @log(float %0)
%5 = sitofp i32 %4 to double
%6 = tail call double @llvm.fmuladd.f64(double %5, double 0x40115F2CED384F8A, double 1.000000e+02)
%7 = fptrunc double %6 to float
%8 = fcmp olt float %7, 0.000000e+00
%9 = select i1 %8, float 0.000000e+00, float %7
br label %10
10: ; preds = %1, %3
%11 = phi float [ %9, %3 ], [ 0.000000e+00, %1 ]
ret float %11
}
/* Variables and functions */
int __dlinfo(void *, int, void *);
int dlinfo(void *dso, int req, void *res) { return __dlinfo(dso, req, res); }


x86 assembly (clang, -O0):
<dlinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <__dlinfo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlinfo>:
jmp    1030 <__dlinfo@plt>

LLVM IR (-O0):
define i32 @dlinfo(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @__dlinfo(i8* %7, i32 %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @dlinfo(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @__dlinfo(i8* %0, i32 %1, i8* %2)
ret i32 %4
}
void gdk_gc_set_line_attributes() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gc_set_line_attributes() {
ret void
}
void glGetActiveUniformsiv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetActiveUniformsiv() {
ret void
}
int encryptBlock(int *block, int *key) {
  block = G(block, getkeydirective(key), getkeywidth(key));
  block = H(block, key);
  return block;
}


x86 assembly (clang, -O0):
<encryptBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <getkeydirective@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <getkeywidth@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
mov    $0x0,%al
call   1060 <G@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <H@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encryptBlock>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
xor    %eax,%eax
call   1050 <getkeydirective@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <getkeywidth@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <G@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <H@plt>

LLVM IR (-O0):
define i32 @encryptBlock(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @getkeydirective to i32 (i32*, ...)*)(i32* %6)
%8 = load i32*, i32** %4
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @getkeywidth to i32 (i32*, ...)*)(i32* %8)
%10 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @G to i32 (i32*, i32, i32, ...)*)(i32* %5, i32 %7, i32 %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %3
%13 = load i32*, i32** %3
%14 = load i32*, i32** %4
%15 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @H to i32 (i32*, i32*, ...)*)(i32* %13, i32* %14)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store i32* %17, i32** %3
%18 = load i32*, i32** %3
%19 = ptrtoint i32* %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @encryptBlock(i32* %0, i32* %1) {
%3 = tail call i32 (i32*, ...) bitcast (i32 (...)* @getkeydirective to i32 (i32*, ...)*)(i32* %1)
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @getkeywidth to i32 (i32*, ...)*)(i32* %1)
%5 = tail call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @G to i32 (i32*, i32, i32, ...)*)(i32* %0, i32 %3, i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = tail call i32 (i32*, i32*, ...) bitcast (i32 (...)* @H to i32 (i32*, i32*, ...)*)(i32* %7, i32* %1)
ret i32 %8
}
int main(void) {
  5 << -1;
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo339() {
ret void
}
long int factorial(int n) {
  if (n <= 1)
    return 1;
  else
    n *= factorial(n - 1);
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     1132 <factorial+0x22>
movq   $0x1,-0x8(%rbp)
jmp    114b <factorial+0x3b>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @factorial(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i64 @factorial(i32 %9)
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = mul nsw i64 %12, %10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %3
br label %15
15: ; preds = %6, %7
%16 = load i64, i64* %2
ret i64 %16
}

LLVM IR (-O2):
define i64 @factorial(i32 %0) {
ret i64 1
}
int(isspace)(int c) { return isspace(c); }


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

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

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
ret i32 undef
}
cbuf6(f, n) { return (cbuf(f, n, 6)); }


x86 assembly (clang, -O0):
<cbuf6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x6,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf6>:
mov    $0x6,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf6(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 6)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ KernelStart();
int main(void) {
  KernelStart();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <KernelStart@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <KernelStart@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @KernelStart()
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @KernelStart()
br label %2
2: ; preds = %0, %2
br label %2
}
void GB_ISLT_f_FP64(double *z, const double *x, const double *y) {
  (*z) = ((*x) < (*y));
}


x86 assembly (clang, -O0):
<GB_ISLT_f_FP64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_ISLT_f_FP64>:
movsd  (%rsi),%xmm0
cmpltsd (%rdx),%xmm0
movsd  0xeef(%rip),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,(%rdi)
ret

LLVM IR (-O0):
define void @GB_ISLT_f_FP64(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = load double*, double** %6
%10 = load double, double* %9
%11 = fcmp olt double %8, %10
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
%14 = load double*, double** %4
store double %13, double* %14
ret void
}

LLVM IR (-O2):
define void @GB_ISLT_f_FP64(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fcmp olt double %4, %5
%7 = uitofp i1 %6 to double
store double %7, double* %0
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
struct tm {
  int tm_isdst;
};

/* Variables and functions */
struct tm *__dst_adjust(struct tm *);
int /*<<< orphan*/ __time_to_tm(scalar_t__ const, struct tm *);
scalar_t__ const __timezone;
int /*<<< orphan*/ __tzset();
struct tm *localtime(const time_t *t) {
  static struct tm tm;
  __tzset();
  __time_to_tm(*t - __timezone, &tm);
  tm.tm_isdst = -1;
  return __dst_adjust(&tm);
}


x86 assembly (clang, -O0):
<localtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__tzset@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    0x2e97(%rip),%rax
sub    (%rax),%rdi
lea    0x2ee1(%rip),%rsi
call   1050 <__time_to_tm@plt>
movl   $0xffffffff,0x2ed2(%rip)
ff ff ff
lea    0x2ecb(%rip),%rdi
call   1040 <__dst_adjust@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localtime>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__tzset@plt>
mov    (%rbx),%rdi
lea    0x2ef7(%rip),%rbx
mov    %rbx,%rsi
call   1050 <__time_to_tm@plt>
movl   $0xffffffff,0x2ee5(%rip)
ff ff ff
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <__dst_adjust@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@localtime.tm = internal global %struct.tm zeroinitializer
@__timezone = constant i64 0
define %struct.tm* @localtime(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i32 (...) @__tzset()
%4 = load i64*, i64** %2
%5 = load i64, i64* %4
%6 = load i64, i64* @__timezone
%7 = sub nsw i64 %5, %6
%8 = call i32 @__time_to_tm(i64 %7, %struct.tm* @localtime.tm)
store i32 -1, i32* getelementptr inbounds (%struct.tm, %struct.tm* @localtime.tm, i32 0, i32 0)
%9 = call %struct.tm* @__dst_adjust(%struct.tm* @localtime.tm)
ret %struct.tm* %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@localtime.tm = internal global %struct.tm zeroinitializer
@__timezone = constant i64 0
define %struct.tm* @localtime(i64* nocapture %0) {
%2 = tail call i32 (...) @__tzset()
%3 = load i64, i64* %0
%4 = tail call i32 @__time_to_tm(i64 %3, %struct.tm* @localtime.tm)
store i32 -1, i32* getelementptr inbounds (%struct.tm, %struct.tm* @localtime.tm, i64 0, i32 0)
%5 = tail call %struct.tm* @__dst_adjust(%struct.tm* @localtime.tm)
ret %struct.tm* %5
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c))
    return 'a' - 'A' + c;
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
unsigned int hs_halfToFloatRep(unsigned short);
float hs_halfToFloat(unsigned short c) {
  union {
    float d;
    unsigned int i;
  } u;
  u.i = hs_halfToFloatRep(c);
  return u.d;
}


x86 assembly (clang, -O0):
<hs_halfToFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <hs_halfToFloatRep@plt>
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hs_halfToFloat>:
push   %rax
call   1030 <hs_halfToFloatRep@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @hs_halfToFloat(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca %union.anon
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 @hs_halfToFloatRep(i16 zeroext %4)
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to float*
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @hs_halfToFloat(i16 zeroext %0) {
%2 = tail call i32 @hs_halfToFloatRep(i16 zeroext %0)
%3 = bitcast i32 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ stderr;
void *safe_malloc(int size) {
  void *mem;
  if (size) {
    if ((mem = (void *)malloc((size_t)size)) == NULL)
      fprintf(stderr, "safe_malloc: Error in alloc of %i bytes", size);
  } else
    mem = NULL;
  return (mem);
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1169 <safe_malloc+0x49>
movslq -0x4(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1164 <safe_malloc+0x44>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1171 <safe_malloc+0x51>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
test   %edi,%edi
je     114d <safe_malloc+0x2d>
mov    %edi,%ebx
movslq %edi,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1136 <safe_malloc+0x16>
pop    %rbx
ret
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"safe_malloc: Error in alloc of %i bytes\00"
define i8* @safe_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %6
%13 = load i32, i32* @stderr
%14 = load i32, i32* %2
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %12, %6
br label %18
17: ; preds = %1
store i8* null, i8** %3
br label %18
18: ; preds = %17, %16
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"safe_malloc: Error in alloc of %i bytes\00"
define i8* @safe_malloc(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %11
11: ; preds = %1, %3, %8
%12 = phi i8* [ null, %8 ], [ %6, %3 ], [ null, %1 ]
ret i8* %12
}
long labs(long n) { return (n < 0) ? -n : n; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
char *skip_nulls(char *pointer) {
  while (*pointer == '\0') {
    pointer++;
  }
  return pointer;
}


x86 assembly (clang, -O0):
<skip_nulls>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1129 <skip_nulls+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_nulls+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_nulls>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <skip_nulls+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_nulls(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
int main() {
  int foo[10];
  foo[9] = 0;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
store i32 0, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void mov_reg32_preg32preg32pimm32(int reg1, int reg2, int reg3,
                                  unsigned long imm32) {
  put8(0x8B);
  put8((reg1 << 3) | 0x84);
  put8(reg2 | (reg3 << 3));
  put32(imm32);
}


x86 assembly (clang, -O0):
<mov_reg32_preg32preg32pimm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x8b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x84,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <put8@plt>
mov    -0x18(%rbp),%rdi
call   1040 <put32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg32_preg32preg32pimm32>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %esi,%r15d
mov    %edi,%ebx
mov    $0x8b,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     $0x84,%ebx
mov    %ebx,%edi
call   1030 <put8@plt>
shl    $0x3,%ebp
or     %r15d,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_reg32_preg32preg32pimm32(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = call i32 @put8(i32 139)
%10 = load i32, i32* %5
%11 = shl i32 %10, 3
%12 = or i32 %11, 132
%13 = call i32 @put8(i32 %12)
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = shl i32 %15, 3
%17 = or i32 %14, %16
%18 = call i32 @put8(i32 %17)
%19 = load i64, i64* %8
%20 = call i32 @put32(i64 %19)
ret void
}

LLVM IR (-O2):
define void @mov_reg32_preg32preg32pimm32(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i32 @put8(i32 139)
%6 = shl i32 %0, 3
%7 = or i32 %6, 132
%8 = tail call i32 @put8(i32 %7)
%9 = shl i32 %2, 3
%10 = or i32 %9, %1
%11 = tail call i32 @put8(i32 %10)
%12 = tail call i32 @put32(i64 %3)
ret void
}
int cairo_code_draw_lushGraphYBound_get_width() { return 21; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_lushGraphYBound_get_width() {
ret i32 21
}

LLVM IR (-O2):
define i32 @cairo_code_draw_lushGraphYBound_get_width() {
ret i32 21
}
/* Variables and functions */
int syscall(int, int, int);
int flock(int fd, int op) { return syscall(143, fd, op); }


x86 assembly (clang, -O0):
<flock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x8f,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flock>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x8f,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @flock(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 143, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void test100_Test_pollen__run__E() { exit(0); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @test100_Test_pollen__run__E() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @test100_Test_pollen__run__E() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
int sys$erase(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(8), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$erase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x8,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$erase>:
mov    $0x8,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$erase"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 8, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$erase"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 8, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_terminate(struct wpa_ctrl *ctrl, int argc, const char *argv[]) {
  return wpa_ctrl_command(ctrl, "TERMINATE");
}


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

x86 assembly (clang, -O2):
<wpa_cli_cmd_terminate>:
lea    0xee9(%rip),%rsi
jmp    1030 <wpa_ctrl_command@plt>

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

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [10 x i8] c"TERMINATE\00"
define i32 @wpa_cli_cmd_terminate(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void cdiWarning(const char *caller, const char *fmt, va_list ap) {
  fprintf(stderr, "Warning (%s) : ", caller);
  vfprintf(stderr, fmt, ap);
  fputc('\n', stderr);
}


x86 assembly (clang, -O0):
<cdiWarning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <vfprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdiWarning>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    0x2e9d(%rip),%r14
mov    (%r14),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1050 <vfprintf@plt>
mov    (%r14),%esi
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Warning (%s) : \00"
define void @cdiWarning(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @vfprintf(i32 %10, i8* %11, i32 %12)
%14 = load i32, i32* @stderr
%15 = call i32 @fputc(i8 signext 10, i32 %14)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Warning (%s) : \00"
define void @cdiWarning(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 @vfprintf(i32 %6, i8* %1, i32 %2)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fputc(i8 signext 10, i32 %8)
ret void
}
/* Variables and functions */
int a_func0(int);
int main() { return a_func0(1); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
jmp    1030 <a_func0@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a_func0(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ locate(int /*<<< orphan*/);
void op_locates() { locate(0); }


x86 assembly (clang, -O0):
<op_locates>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <locate@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @op_locates() {
%1 = call i32 @locate(i32 0)
ret void
}

LLVM IR (-O2):
define void @op_locates() {
%1 = tail call i32 @locate(i32 0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
int QCBOR_Int64ToUInt64(int64_t src, uint64_t *dest) {
  if (src > 0) {
    return -1;
  } else {
    *dest = (uint64_t)src;
  }
  return 0;
}


x86 assembly (clang, -O0):
<QCBOR_Int64ToUInt64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1123 <QCBOR_Int64ToUInt64+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1135 <QCBOR_Int64ToUInt64+0x35>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QCBOR_Int64ToUInt64>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
jle    110b <QCBOR_Int64ToUInt64+0xb>
ret
mov    %rdi,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @QCBOR_Int64ToUInt64(i64 %0, i64* nocapture writeonly %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %5, label %4
4: ; preds = %2
store i64 %0, i64* %1
br label %5
5: ; preds = %2, %4
%6 = phi i32 [ 0, %4 ], [ -1, %2 ]
ret i32 %6
}
void I2CStretchClockDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000080;
}


x86 assembly (clang, -O0):
<I2CStretchClockDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xffffffffffffff7f,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CStretchClockDisable>:
andq   $0xffffffffffffff7f,(%rdi)
ret

LLVM IR (-O0):
define void @I2CStretchClockDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -129
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CStretchClockDisable(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = and i64 %3, -129
store volatile i64 %4, i64* %2
ret void
}