xunge/DecIR huggingface dataset:
int map2MP3Frequency(int freq) {
  if (freq <= 16000)
    return 16000;
  if (freq <= 22050)
    return 22050;
  if (freq <= 24000)
    return 24000;
  if (freq <= 32000)
    return 32000;
  if (freq <= 44100)
    return 44100;
  return 48000;
}


x86 assembly (clang, -O0):
<map2MP3Frequency>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3e80,-0x8(%rbp)
jg     1120 <map2MP3Frequency+0x20>
movl   $0x3e80,-0x4(%rbp)
jmp    118b <map2MP3Frequency+0x8b>
cmpl   $0x5622,-0x8(%rbp)
jg     1139 <map2MP3Frequency+0x39>
movl   $0x5622,-0x4(%rbp)
jmp    118b <map2MP3Frequency+0x8b>
cmpl   $0x5dc0,-0x8(%rbp)
jg     1152 <map2MP3Frequency+0x52>
movl   $0x5dc0,-0x4(%rbp)
jmp    118b <map2MP3Frequency+0x8b>
cmpl   $0x7d00,-0x8(%rbp)
jg     116b <map2MP3Frequency+0x6b>
movl   $0x7d00,-0x4(%rbp)
jmp    118b <map2MP3Frequency+0x8b>
cmpl   $0xac44,-0x8(%rbp)
jg     1184 <map2MP3Frequency+0x84>
movl   $0xac44,-0x4(%rbp)
jmp    118b <map2MP3Frequency+0x8b>
movl   $0xbb80,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map2MP3Frequency>:
mov    $0x3e80,%eax
cmp    $0x3e81,%edi
jl     1147 <map2MP3Frequency+0x47>
mov    $0x5622,%eax
cmp    $0x5623,%edi
jb     1147 <map2MP3Frequency+0x47>
mov    $0x5dc0,%eax
cmp    $0x5dc1,%edi
jb     1147 <map2MP3Frequency+0x47>
mov    $0x7d00,%eax
cmp    $0x7d01,%edi
jb     1147 <map2MP3Frequency+0x47>
cmp    $0xac45,%edi
mov    $0xbb80,%ecx
mov    $0xac44,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @map2MP3Frequency(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 16000
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 16000, i32* %2
br label %24
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 22050
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 22050, i32* %2
br label %24
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 24000
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 24000, i32* %2
br label %24
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 32000
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 32000, i32* %2
br label %24
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp sle i32 %20, 44100
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 44100, i32* %2
br label %24
23: ; preds = %19
store i32 48000, i32* %2
br label %24
24: ; preds = %23, %22, %18, %14, %10, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @map2MP3Frequency(i32 %0) {
%2 = icmp slt i32 %0, 16001
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 22051
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 24001
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 32001
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ugt i32 %0, 44100
%11 = select i1 %10, i32 48000, i32 44100
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi i32 [ 16000, %1 ], [ 22050, %3 ], [ 24000, %5 ], [ 32000, %7 ], [ %11, %9 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int fibo1(int);
int main() {
  int x = 4;
  int result = fibo1(x);
  if (result != 3) {
    __VERIFIER_error();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fibo1@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
je     1152 <main+0x32>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <fibo1@plt>
cmp    $0x3,%eax
je     1137 <main+0x17>
xor    %eax,%eax
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fibo1(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @__VERIFIER_error()
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fibo1(i32 4)
%2 = icmp eq i32 %1, 3
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double rad(double x, double y, double z) { return sqrt(x * x + y * y + z * z); }


x86 assembly (clang, -O0):
<rad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1136 <rad+0x26>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
ret
movapd %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @rad(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* %4
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %6
%14 = load double, double* %6
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double %12)
%16 = call double @sqrt(double %15)
ret double %16
}

LLVM IR (-O2):
define double @rad(double %0, double %1, double %2) {
%4 = fmul double %1, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = tail call double @sqrt(double %6)
ret double %7
}
/* Variables and functions */
char *doasprintf(char *, char const *, char const *);
int /*<<< orphan*/ warn(char *);
char *json_fmt_challenge(const char *token, const char *thumb) {
  char *p;
  p = doasprintf("{"
                 "\"resource\": \"challenge\", "
                 "\"keyAuthorization\": \"%s.%s\""
                 "}",
                 token, thumb);
  if (NULL == p)
    warn("asprintf");
  return (p);
}


x86 assembly (clang, -O0):
<json_fmt_challenge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1040 <doasprintf@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1160 <json_fmt_challenge+0x40>
lea    0xedc(%rip),%rdi
call   1030 <warn@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_fmt_challenge>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1040 <doasprintf@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <json_fmt_challenge+0x27>
lea    0xef5(%rip),%rdi
call   1030 <warn@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"{\22resource\22: \22challenge\22, \22keyAuthorization\22: \22%s.%s\22}\00"
@.str.1 = [9 x i8] c"asprintf\00"
define i8* @json_fmt_challenge(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @doasprintf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* null, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @warn(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [55 x i8] c"{\22resource\22: \22challenge\22, \22keyAuthorization\22: \22%s.%s\22}\00"
@.str.1 = [9 x i8] c"asprintf\00"
define i8* @json_fmt_challenge(i8* %0, i8* %1) {
%3 = tail call i8* @doasprintf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @warn(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void av_encryption_info_add_side_data() {}


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

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

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

LLVM IR (-O2):
define void @av_encryption_info_add_side_data() {
ret void
}
void d_fetchsb(register const unsigned char **ptr, register signed char *dest) {
  *dest = *(*ptr)++;
}


x86 assembly (clang, -O0):
<d_fetchsb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_fetchsb>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    (%rax),%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @d_fetchsb(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %5
%8 = load i8, i8* %6
%9 = load i8*, i8** %4
store i8 %8, i8* %9
ret void
}

LLVM IR (-O2):
define void @d_fetchsb(i8** nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %0
%5 = load i8, i8* %3
store i8 %5, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nested_function(int);
int main() {
  nested_function(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @nested_function(i32 1)
ret i32 0
}
long int test_long_tmin() { return 1L << (8 * sizeof(long) - 1); }


x86 assembly (clang, -O0):
<test_long_tmin>:
push   %rbp
mov    %rsp,%rbp
movabs $0x8000000000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_long_tmin>:
movabs $0x8000000000000000,%rax
ret

LLVM IR (-O0):
define i64 @test_long_tmin() {
ret i64 -9223372036854775808
}

LLVM IR (-O2):
define i64 @test_long_tmin() {
ret i64 -9223372036854775808
}
int direct_compare(const void *p, const void *q) {
  if (p < q) {
    return -1;
  }
  if (p > q) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<direct_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1126 <direct_compare+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <direct_compare+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1140 <direct_compare+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <direct_compare+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_compare>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @direct_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
int DeMUX2way(int A, int select_bit) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DeMUX2way(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int NiveauxAvancement() {
  int avancement;
  FILE *fichier = fopen("avancement.txt", "a+");
  fscanf(fichier, "%d", &avancement);
  fclose(fichier);
  return avancement;
}


x86 assembly (clang, -O0):
<NiveauxAvancement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
lea    -0x4(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NiveauxAvancement>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"avancement.txt\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @NiveauxAvancement() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [15 x i8] c"avancement.txt\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @NiveauxAvancement() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = call i32 @fclose(i32* %3)
%6 = load i32, i32* %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ prdata(char const *);
int /*<<< orphan*/ prinfo(char const *);
void print_banner(int forceprint) {
  const char *str = "Broadcom-SSB SPROM data modification tool.\n"
                    "\n"
                    "Copyright (C) Michael Buesch\n"
                    "Licensed under the GNU/GPL version 2 or later\n"
                    "\n"
                    "Be exceedingly careful with this tool. Improper"
                    " usage WILL BRICK YOUR DEVICE.\n";
  if (forceprint)
    prdata(str);
  else
    prinfo(str);
}


x86 assembly (clang, -O0):
<print_banner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114e <print_banner+0x2e>
mov    -0x10(%rbp),%rdi
call   1040 <prdata@plt>
jmp    1157 <print_banner+0x37>
mov    -0x10(%rbp),%rdi
call   1030 <prinfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_banner>:
test   %edi,%edi
je     1130 <print_banner+0x10>
lea    0xed5(%rip),%rdi
jmp    1040 <prdata@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <prinfo@plt>

LLVM IR (-O0):
@.str = [199 x i8] c"Broadcom-SSB SPROM data modification tool.\0A\0ACopyright (C) Michael Buesch\0ALicensed under the GNU/GPL version 2 or later\0A\0ABe exceedingly careful with this tool. Improper usage WILL BRICK YOUR DEVICE.\0A\00"
define void @print_banner(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @prdata(i8* %7)
br label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @prinfo(i8* %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [199 x i8] c"Broadcom-SSB SPROM data modification tool.\0A\0ACopyright (C) Michael Buesch\0ALicensed under the GNU/GPL version 2 or later\0A\0ABe exceedingly careful with this tool. Improper usage WILL BRICK YOUR DEVICE.\0A\00"
define void @print_banner(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @prdata(i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @prinfo(i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
int EVP_CipherInit(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                   unsigned char const *, unsigned char const *,
                   int /*<<< orphan*/);
int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
                    const unsigned char *key, const unsigned char *iv) {
  return EVP_CipherInit(ctx, cipher, key, iv, 0);
}


x86 assembly (clang, -O0):
<EVP_DecryptInit>:
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
xor    %r8d,%r8d
call   1030 <EVP_CipherInit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_DecryptInit>:
xor    %r8d,%r8d
jmp    1030 <EVP_CipherInit@plt>

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

LLVM IR (-O2):
define i32 @EVP_DecryptInit(i32* %0, i32* %1, i8* %2, i8* %3) {
%5 = tail call i32 @EVP_CipherInit(i32* %0, i32* %1, i8* %2, i8* %3, i32 0)
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
scalar_t__ memcpy(void *, char const *, size_t);
int strlen(char const *);
char *ptw32_strdup(const char *s) {
  size_t len = strlen(s) + 1;
  void *newptr = malloc(len);
  if (newptr == NULL)
    return NULL;
  return (char *)memcpy(newptr, s, len);
}


x86 assembly (clang, -O0):
<ptw32_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <ptw32_strdup+0x43>
movq   $0x0,-0x8(%rbp)
jmp    1188 <ptw32_strdup+0x58>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptw32_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <ptw32_strdup+0x2f>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
jmp    1161 <ptw32_strdup+0x31>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ptw32_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = tail call i64 @memcpy(i8* %5, i8* %0, i64 %4)
%9 = inttoptr i64 %8 to i8*
br label %10
10: ; preds = %1, %7
%11 = phi i8* [ %9, %7 ], [ null, %1 ]
ret i8* %11
}
void *test_anti_range_133(short n) {
  extern void *alloc_anti_range_133(short) __attribute__((alloc_size(1)));
  if ((-0x7fff - 1) + 2 <= n && n <= 2)
    n = (-0x7fff - 1) + 2 - 1;
  return alloc_anti_range_133(n);
}


x86 assembly (clang, -O0):
<test_anti_range_133>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0xffff8002,%eax
cmp    %ecx,%eax
jg     1143 <test_anti_range_133+0x33>
movswl -0x2(%rbp),%eax
cmp    $0x2,%eax
jg     1143 <test_anti_range_133+0x33>
movw   $0x8001,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_133@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_133>:
lea    0x7ffe(%rdi),%eax
movzwl %ax,%eax
cmp    $0x8001,%eax
mov    $0x8001,%eax
cmovae %edi,%eax
movswl %ax,%edi
jmp    1030 <alloc_anti_range_133@plt>

LLVM IR (-O0):
define i8* @test_anti_range_133(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 -32766, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -32767, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_133(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_133(i16 signext %0) {
%2 = add i16 %0, 32766
%3 = icmp ult i16 %2, -32767
%4 = select i1 %3, i16 -32767, i16 %0
%5 = tail call i8* @alloc_anti_range_133(i16 signext %4)
ret i8* %5
}
void g_list_length() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdout;
void uninitvar_fputc(void) {
  int i;
  FILE *fp;
  fputc('a', stdout);
  fputc(i, stdout);
  fputc('a', fp);
}


x86 assembly (clang, -O0):
<uninitvar_fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%rsi
mov    $0x61,%edi
call   1030 <fputc@plt>
mov    -0x4(%rbp),%eax
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%rsi
mov    $0x61,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_fputc>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%rsi
mov    $0x61,%edi
call   1030 <fputc@plt>
mov    (%rbx),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    $0x61,%edi
pop    %rbx
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32* null
define void @uninitvar_fputc() {
%1 = alloca i32
%2 = alloca i32*
%3 = load i32*, i32** @stdout
%4 = call i32 @fputc(i8 signext 97, i32* %3)
%5 = load i32, i32* %1
%6 = trunc i32 %5 to i8
%7 = load i32*, i32** @stdout
%8 = call i32 @fputc(i8 signext %6, i32* %7)
%9 = load i32*, i32** %2
%10 = call i32 @fputc(i8 signext 97, i32* %9)
ret void
}

LLVM IR (-O2):
@stdout = global i32* null
define void @uninitvar_fputc() {
%1 = load i32*, i32** @stdout
%2 = tail call i32 @fputc(i8 signext 97, i32* %1)
%3 = load i32*, i32** @stdout
%4 = tail call i32 @fputc(i8 signext undef, i32* %3)
%5 = tail call i32 @fputc(i8 signext 97, i32* undef)
ret void
}
int strcmp(const char *s1, const char *s2) {
  char *s1p = (char *)s1;
  char *s2p = (char *)s2;
  while (*s2p != '\0') {
    if (*s1p != *s2p)
      break;
    ++s1p;
    ++s2p;
  }
  return (*s1p - *s2p);
}


x86 assembly (clang, -O0):
<strcmp>:
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,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <strcmp+0x64>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <strcmp+0x1c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rsi),%cl
test   %cl,%cl
je     1123 <strcmp+0x23>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
cmp    %cl,(%rdi)
jne    1125 <strcmp+0x25>
add    $0x1,%rdi
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcmp+0x10>
xor    %ecx,%ecx
movsbl (%rdi),%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %6
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %11, %5, %2
%17 = phi i8* [ %0, %2 ], [ %8, %5 ], [ %12, %11 ]
%18 = phi i8 [ 0, %2 ], [ %6, %5 ], [ 0, %11 ]
%19 = load i8, i8* %17
%20 = sext i8 %19 to i32
%21 = sext i8 %18 to i32
%22 = sub nsw i32 %20, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void call_blue() {
  printf("signal blue\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<call_blue>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_blue>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"signal blue\0A\00"
@stdout = global i32 0
define void @call_blue() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [12 x i8] c"signal blue\00"
define void @call_blue() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ insch(char);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_insch(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_return(insch(args[0][0]));
}


x86 assembly (clang, -O0):
<cmd_insch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    116a <cmd_insch+0x2a>
jmp    118a <cmd_insch+0x4a>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1060 <insch@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_insch>:
push   %rbx
mov    %rsi,%rbx
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1155 <cmd_insch+0x15>
pop    %rbx
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    (%rbx),%rax
movsbl (%rax),%edi
call   1060 <insch@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_insch(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %18
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = call i32 @insch(i8 signext %15)
%17 = call i32 @report_return(i32 %16)
br label %18
18: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_insch(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = load i8*, i8** %1
%8 = load i8, i8* %7
%9 = tail call i32 @insch(i8 signext %8)
%10 = tail call i32 @report_return(i32 %9)
br label %11
11: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned char flags_retrieve_word(unsigned short p_flags, unsigned char pos) {
  assert(pos >= 0 && pos <= 15);
  unsigned char value = 0;
  unsigned char to_or = (0b0000000000000000 | pos);
  value = ((p_flags | to_or) != 0);
  return value;
}


x86 assembly (clang, -O0):
<flags_retrieve_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x6(%rbp)
jl     1144 <flags_retrieve_word+0x34>
movzbl -0x3(%rbp),%eax
cmp    $0xf,%eax
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movb   $0x0,-0x4(%rbp)
movzbl -0x3(%rbp),%eax
or     $0x0,%eax
mov    %al,-0x5(%rbp)
movzwl -0x2(%rbp),%eax
movzbl -0x5(%rbp),%ecx
or     %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x4(%rbp)
movzbl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flags_retrieve_word>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x10,%bl
setb   %dil
call   1030 <assert@plt>
or     %ebx,%ebp
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @flags_retrieve_word(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = icmp sle i32 %12, 15
br label %14
14: ; preds = %10, %2
%15 = phi i1 [ false, %2 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
store i8 0, i8* %5
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 0, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %6
%22 = load i16, i16* %3
%23 = zext i16 %22 to i32
%24 = load i8, i8* %6
%25 = zext i8 %24 to i32
%26 = or i32 %23, %25
%27 = icmp ne i32 %26, 0
%28 = zext i1 %27 to i32
%29 = trunc i32 %28 to i8
store i8 %29, i8* %5
%30 = load i8, i8* %5
ret i8 %30
}

LLVM IR (-O2):
define zeroext i8 @flags_retrieve_word(i16 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = icmp ult i8 %1, 16
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = zext i16 %0 to i32
%8 = or i32 %3, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i8
ret i8 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, size_t);
ssize_t async_read_stdin(char *buffer, size_t len) {
  return read(STDIN_FILENO, buffer, len);
}


x86 assembly (clang, -O0):
<async_read_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<async_read_stdin>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <read@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i32 @async_read_stdin(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @STDIN_FILENO
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @read(i32 %5, i8* %6, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @async_read_stdin(i8* nocapture %0, i64 %1) {
%3 = load i32, i32* @STDIN_FILENO
%4 = tail call i32 @read(i32 %3, i8* %0, i64 %1)
ret i32 %4
}
/* Variables and functions */
double ddot_(int *, double *, int *, double *, int *);
double ddot(int n, double *x, int incx, double *y, int incy) {
  return ddot_(&n, x, &incx, y, &incy);
}


x86 assembly (clang, -O0):
<ddot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x24(%rbp),%r8
call   1030 <ddot_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddot>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <ddot_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ddot(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
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
%11 = load double*, double** %7
%12 = load double*, double** %9
%13 = call double @ddot_(i32* %6, double* %11, i32* %8, double* %12, i32* %10)
ret double %13
}

LLVM IR (-O2):
define double @ddot(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %6
store i32 %2, i32* %7
store i32 %4, i32* %8
%9 = call double @ddot_(i32* %6, double* %1, i32* %7, double* %3, i32* %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(void *);
int /*<<< orphan*/ sleep(int);
void *thread_function(void *arg) {
  printf("thread_function is running. Argument was %d\n", *(int *)arg);
  sleep(3);
  *(int *)arg = 1;
  pthread_exit(arg);
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_function>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
movl   $0x1,(%rbx)
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"thread_function is running. Argument was %d\0A\00"
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @sleep(i32 3)
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
store i32 1, i32* %10
%11 = load i8*, i8** %3
%12 = call i32 @pthread_exit(i8* %11)
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [45 x i8] c"thread_function is running. Argument was %d\0A\00"
define noalias i8* @thread_function(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @sleep(i32 3)
store i32 1, i32* %2
%6 = tail call i32 @pthread_exit(i8* %0)
ret i8* undef
}
void ble_rsp_hardware_analog_comparator_config_irq(
    const struct ble_msg_hardware_analog_comparator_config_irq_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_hardware_analog_comparator_config_irq_rsp_t = type opaque
define void @ble_rsp_hardware_analog_comparator_config_irq(%struct.ble_msg_hardware_analog_comparator_config_irq_rsp_t* nocapture %0) {
ret void
}
void glutShowWindow(void) {}


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

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

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

LLVM IR (-O2):
define void @glutShowWindow() {
ret void
}
/* Variables and functions */
int getpagesize();
bool is_multiple_of_page_size(size_t value) {
  return ((getpagesize() - 1) & value) == 0;
}


x86 assembly (clang, -O0):
<is_multiple_of_page_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpagesize@plt>
sub    $0x1,%eax
cltq
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_multiple_of_page_size>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpagesize@plt>
add    $0xffffffff,%eax
movslq %eax,%rcx
xor    %eax,%eax
test   %rbx,%rcx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_multiple_of_page_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @getpagesize()
%4 = sub nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = load i64, i64* %2
%7 = and i64 %5, %6
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_multiple_of_page_size(i64 %0) {
%2 = tail call i32 (...) @getpagesize()
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = and i64 %4, %0
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
float TukeyWindow(float, float, float);
float Window(float window_duration, float transition, float t) {
  const float result = TukeyWindow(window_duration, transition, t);
  return result * result;
}


x86 assembly (clang, -O0):
<Window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <TukeyWindow@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Window>:
push   %rax
call   1030 <TukeyWindow@plt>
mulss  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Window(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = load float, float* %6
%11 = call float @TukeyWindow(float %8, float %9, float %10)
store float %11, float* %7
%12 = load float, float* %7
%13 = load float, float* %7
%14 = fmul float %12, %13
ret float %14
}

LLVM IR (-O2):
define float @Window(float %0, float %1, float %2) {
%4 = tail call float @TukeyWindow(float %0, float %1, float %2)
%5 = fmul float %4, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *exec) {
  printf("%s [options] [<rate>]\n\n", exec);
  printf("Options:\n");
  printf("    -c,--color  Show message part colorings\n");
  printf("    -h,--help   Print this help message\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%s [options] [<rate>]\0A\0A\00"
@.str.1 = [10 x i8] c"Options:\0A\00"
@.str.2 = [45 x i8] c" -c,--color Show message part colorings\0A\00"
@.str.3 = [41 x i8] c" -h,--help Print this help message\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s [options] [<rate>]\0A\0A\00"
@str = [9 x i8] c"Options:\00"
@str.4 = [44 x i8] c" -c,--color Show message part colorings\00"
@str.5 = [40 x i8] c" -h,--help Print this help message\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.5, i64 0, i64 0))
ret void
}
int bp_sw_stupid_3SS_eval(int type, void *data, char *seq) {
  if (*(seq - 1) == 'A' && *(seq) == 'G')
    return 0;
  else
    return (-10000000);
}


x86 assembly (clang, -O0):
<bp_sw_stupid_3SS_eval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x41,%eax
jne    113c <bp_sw_stupid_3SS_eval+0x3c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x47,%eax
jne    113c <bp_sw_stupid_3SS_eval+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1143 <bp_sw_stupid_3SS_eval+0x43>
movl   $0xff676980,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bp_sw_stupid_3SS_eval>:
cmpb   $0x41,-0x1(%rdx)
jne    110d <bp_sw_stupid_3SS_eval+0xd>
xor    %eax,%eax
cmpb   $0x47,(%rdx)
je     1112 <bp_sw_stupid_3SS_eval+0x12>
mov    $0xff676980,%eax
ret

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

LLVM IR (-O2):
define i32 @bp_sw_stupid_3SS_eval(i32 %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = getelementptr inbounds i8, i8* %2, i64 -1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 65
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8, i8* %2
%9 = icmp eq i8 %8, 71
br i1 %9, label %11, label %10
10: ; preds = %7, %3
br label %11
11: ; preds = %7, %10
%12 = phi i32 [ -10000000, %10 ], [ 0, %7 ]
ret i32 %12
}