xunge/DecIR huggingface dataset:
/* Variables and functions */
int ssds_get_gen_name(int, char *, char *, char *, char *, int);
int ssds_get_item_name(int pcfd, char *class_def, char *res, int len) {
  return ssds_get_gen_name(pcfd, class_def, "gi", "i_name", res, len);
}


x86 assembly (clang, -O0):
<ssds_get_item_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
lea    0xec4(%rip),%rdx
lea    0xec0(%rip),%rcx
call   1030 <ssds_get_gen_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_item_name>:
mov    %ecx,%r9d
mov    %rdx,%r8
lea    0xee3(%rip),%rdx
lea    0xedf(%rip),%rcx
jmp    1030 <ssds_get_gen_name@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"gi\00"
@.str.1 = [7 x i8] c"i_name\00"
define i32 @ssds_get_item_name(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @ssds_get_gen_name(i32 %9, i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"gi\00"
@.str.1 = [7 x i8] c"i_name\00"
define i32 @ssds_get_item_name(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @ssds_get_gen_name(i32 %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %3)
ret i32 %5
}
int test_imm_21int64_midword_reg(long long val) {
  return ((val >> 16) & (0x21 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_21int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x21,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_21int64_midword_reg>:
test   $0x210000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_21int64_midword_reg(i64 %0) {
%2 = and i64 %0, 2162688
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void size_of_stuff() {
  char s[] = "how big is it";
  char *p = s;
  printf("size of arry %i\n", sizeof(s));
  printf("size of pointer %i\n", p);
}


x86 assembly (clang, -O0):
<size_of_stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xed9(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xe(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xec8(%rip),%rdi
mov    $0xe,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_of_stuff>:
sub    $0x18,%rsp
movabs $0x74692073692067,%rax
mov    %rax,0xe(%rsp)
movabs $0x2067696220776f68,%rax
69 67 20
mov    %rax,0x8(%rsp)
lea    0xed5(%rip),%rdi
mov    $0xe,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.size_of_stuff.s = [14 x i8] c"how big is it\00"
@.str = [17 x i8] c"size of arry %i\0A\00"
@.str.1 = [20 x i8] c"size of pointer %i\0A\00"
define void @size_of_stuff() {
%1 = alloca [14 x i8]
%2 = alloca i8*
%3 = bitcast [14 x i8]* %1 to i8*
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
store i8* %4, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 14)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@__const.size_of_stuff.s = [14 x i8] c"how big is it\00"
@.str = [17 x i8] c"size of arry %i\0A\00"
@.str.1 = [20 x i8] c"size of pointer %i\0A\00"
define void @size_of_stuff() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 14)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
int midi_getflag(int mode, int index) { return 0; }


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

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

LLVM IR (-O0):
define i32 @midi_getflag(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 @midi_getflag(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  double c;
  scanf("%d%d", &a, &b);
  c = a * b;
  printf("%.3lf\n", c / 12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%eax
imul   0x4(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xeb7(%rip),%xmm0
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = sitofp i32 %8 to double
store double %9, double* %4
%10 = load double, double* %4
%11 = fdiv double %10, 1.200000e+01
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %6
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.200000e+01
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
int jmp_on_uninit(void) {
  int uninit[27];
  __asm__ __volatile("" ::: "cc", "memory");
  if (uninit[13]) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<jmp_on_uninit>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,-0x3c(%rbp)
je     111a <jmp_on_uninit+0x1a>
movl   $0x1,-0x4(%rbp)
jmp    1121 <jmp_on_uninit+0x21>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @jmp_on_uninit() {
%1 = alloca i32
%2 = alloca [27 x i32]
%3 = getelementptr inbounds [27 x i32], [27 x i32]* %2, i64 0, i64 13
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @jmp_on_uninit() {
tail call void asm sideeffect "", "~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void version() {
  fprintf(stderr, "Mutant 1.0\n");
  fprintf(stderr, "Copyright (C) 2015 Michał Muskała\n");
  fprintf(stderr, "License MIT: <url>\n");
  fprintf(stderr, "Please report bugs to: <url>\n");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xee2(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xedd(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef4(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefa(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"Mutant 1.0\0A\00"
@.str.1 = [37 x i8] c"Copyright (C) 2015 Micha\C5\82 Muska\C5\82a\0A\00"
@.str.2 = [20 x i8] c"License MIT: <url>\0A\00"
@.str.3 = [30 x i8] c"Please report bugs to: <url>\0A\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Mutant 1.0\0A\00"
@.str.1 = [37 x i8] c"Copyright (C) 2015 Micha\C5\82 Muska\C5\82a\0A\00"
@.str.2 = [20 x i8] c"License MIT: <url>\0A\00"
@.str.3 = [30 x i8] c"Please report bugs to: <url>\0A\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int exists(const char *fname) { return access(fname, F_OK) == 0; }


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

x86 assembly (clang, -O2):
<exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i64 @access(i8* %3, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @exists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void clear(long N, float *vec) {
  for (long i = 0; i < N; i++)
    vec[i] = 0.;
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1143 <clear+0x43>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <clear+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
test   %rdi,%rdi
jle    112b <clear+0x1b>
push   %rax
mov    %rdi,%rdx
shl    $0x2,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @clear(i64 %0, float* %1) {
%3 = alloca i64
%4 = alloca float*
%5 = alloca i64
store i64 %0, i64* %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %14, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %3
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load float*, float** %4
%12 = load i64, i64* %5
%13 = getelementptr inbounds float, float* %11, i64 %12
store float 0.000000e+00, float* %13
br label %14
14: ; preds = %10
%15 = load i64, i64* %5
%16 = add nsw i64 %15, 1
store i64 %16, i64* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @clear(i64 %0, float* nocapture writeonly %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = bitcast float* %1 to i8*
%6 = shl nuw i64 %0, 2
br label %7
7: ; preds = %4, %2
ret void
}
float invSqrt(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f3759d5 - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  return x;
}


x86 assembly (clang, -O0):
<invSqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759d5,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<invSqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759d5,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @invSqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597462997, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @invSqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597462997, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
int string_is_empty(const char *str) { return *str == '\0'; }


x86 assembly (clang, -O0):
<string_is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_is_empty>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @string_is_empty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @string_is_empty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int count_leading_0(uint32_t val) {
  int count = 0;
  while (val != 0) {
    val >>= 1;
    count++;
  }
  return 32 - count;
}


x86 assembly (clang, -O0):
<count_leading_0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <count_leading_0+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <count_leading_0+0xe>
mov    $0x20,%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_leading_0>:
mov    $0x20,%eax
test   %edi,%edi
je     111c <count_leading_0+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0xffffffff,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <count_leading_0+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_leading_0(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = sub nsw i32 31, %4
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 32, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ percolate_down(int, double *, int *, int *, int);
void initialize_heap(double *data, int *INDEX, int *INDEX2, int N) {
  int i;
  for (i = (N - 1) >> 1; i >= 0; i--)
    percolate_down(i, data, INDEX, INDEX2, N);
}


x86 assembly (clang, -O0):
<initialize_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
sar    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     1163 <initialize_heap+0x53>
mov    -0x20(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <percolate_down@plt>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1133 <initialize_heap+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_heap>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %ecx,%ecx
jle    1148 <initialize_heap+0x38>
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    -0x1(%rbx),%ebp
shr    %ebp
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %ebx,%r8d
call   1030 <percolate_down@plt>
add    $0xffffffff,%ebp
jb     1130 <initialize_heap+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @initialize_heap(double* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca double*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store double* %0, double** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = sub nsw i32 %10, 1
%12 = ashr i32 %11, 1
store i32 %12, i32* %9
br label %13
13: ; preds = %23, %4
%14 = load i32, i32* %9
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load i32, i32* %9
%18 = load double*, double** %5
%19 = load i32*, i32** %6
%20 = load i32*, i32** %7
%21 = load i32, i32* %8
%22 = call i32 @percolate_down(i32 %17, double* %18, i32* %19, i32* %20, i32 %21)
br label %23
23: ; preds = %16
%24 = load i32, i32* %9
%25 = add nsw i32 %24, -1
store i32 %25, i32* %9
br label %13
26: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @initialize_heap(double* %0, i32* %1, i32* %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = add nsw i32 %3, -1
%8 = lshr i32 %7, 1
br label %9
9: ; preds = %6, %9
%10 = phi i32 [ %12, %9 ], [ %8, %6 ]
%11 = tail call i32 @percolate_down(i32 %10, double* %0, i32* %1, i32* %2, i32 %3)
%12 = add nsw i32 %10, -1
%13 = icmp eq i32 %10, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %4
ret void
}
void ebsa110_unmask_irq(unsigned int irq) {
  *((volatile unsigned char *)0xf2c00000) = 1 << irq;
}


x86 assembly (clang, -O0):
<ebsa110_unmask_irq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,%cl
mov    $0xf2c00000,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ebsa110_unmask_irq>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    $0xf2c00000,%ecx
mov    %al,(%rcx)
ret

LLVM IR (-O0):
define void @ebsa110_unmask_irq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = trunc i32 %4 to i8
store volatile i8 %5, i8* inttoptr (i64 4072669184 to i8*)
ret void
}

LLVM IR (-O2):
define void @ebsa110_unmask_irq(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = trunc i32 %2 to i8
store volatile i8 %3, i8* inttoptr (i64 4072669184 to i8*)
ret void
}
regx0reg1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[x0]) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
movzwl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     1143 <regx0reg1+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <regx0reg1+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0reg1>:
movslq %edx,%rax
movzwl (%r8,%rax,2),%ecx
movzwl %si,%edx
xor    %eax,%eax
cmp    %ecx,%edx
setae  %al
ret

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

LLVM IR (-O2):
define i32 @regx0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = and i32 %1, 65535
%12 = icmp uge i32 %11, %10
%13 = zext i1 %12 to i32
ret i32 %13
}
void br_multicast_del_port(struct net_bridge_port *port) {}


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

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

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

LLVM IR (-O2):
%struct.net_bridge_port = type opaque
define void @br_multicast_del_port(%struct.net_bridge_port* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ store_hook(char *, void *);
void storeprint_hook(char *line, void *data) {
  store_hook(line, data);
  printf(line);
}


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

x86 assembly (clang, -O2):
<storeprint_hook>:
push   %rbx
mov    %rdi,%rbx
call   1040 <store_hook@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @storeprint_hook(i8* %0, i8* %1) {
%3 = tail call i32 @store_hook(i8* %0, i8* %1)
%4 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ escape(char const *, char *);
char *malloc(int);
char *quote_and_escape(const char *src) {
  int newlen = 2 + escape(src, NULL);
  char *dest = malloc(newlen);
  dest[0] = '"';
  escape(src, &dest[1]);
  return dest;
}


x86 assembly (clang, -O0):
<quote_and_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <escape@plt>
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x22,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1040 <escape@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quote_and_escape>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %esi,%esi
call   1040 <escape@plt>
lea    0x2(%rax),%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
movb   $0x22,(%rax)
lea    0x1(%rax),%rsi
mov    %r14,%rdi
call   1040 <escape@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @quote_and_escape(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @escape(i8* %5, i8* null)
%7 = add nsw i32 2, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 34, i8* %11
%12 = load i8*, i8** %2
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = call i32 @escape(i8* %12, i8* %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @quote_and_escape(i8* %0) {
%2 = tail call i32 @escape(i8* %0, i8* null)
%3 = add nsw i32 %2, 2
%4 = tail call i8* @malloc(i32 %3)
store i8 34, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = tail call i32 @escape(i8* %0, i8* %5)
ret i8* %4
}
/* Type definitions */
struct ev_token_bucket_cfg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_mm_free_(struct ev_token_bucket_cfg *);
void ev_token_bucket_cfg_free(struct ev_token_bucket_cfg *cfg) {
  event_mm_free_(cfg);
}


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

x86 assembly (clang, -O2):
<ev_token_bucket_cfg_free>:
jmp    1030 <event_mm_free_@plt>

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

LLVM IR (-O2):
%struct.ev_token_bucket_cfg = type { i32 }
define void @ev_token_bucket_cfg_free(%struct.ev_token_bucket_cfg* %0) {
%2 = tail call i32 @event_mm_free_(%struct.ev_token_bucket_cfg* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void signal_hdl(int sig) { printf("Signalled\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Signalled\0A\00"
define void @signal_hdl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"Signalled\00"
define void @signal_hdl(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ht_get_excluded_ips();
char *u642str(int /*<<< orphan*/, int /*<<< orphan*/);
char *get_str_excluded_ips(void) { return u642str(ht_get_excluded_ips(), 0); }


x86 assembly (clang, -O0):
<get_str_excluded_ips>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ht_get_excluded_ips@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <u642str@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_str_excluded_ips>:
push   %rax
xor    %eax,%eax
call   1040 <ht_get_excluded_ips@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <u642str@plt>

LLVM IR (-O0):
define i8* @get_str_excluded_ips() {
%1 = call i32 (...) @ht_get_excluded_ips()
%2 = call i8* @u642str(i32 %1, i32 0)
ret i8* %2
}

LLVM IR (-O2):
define i8* @get_str_excluded_ips() {
%1 = tail call i32 (...) @ht_get_excluded_ips()
%2 = tail call i8* @u642str(i32 %1, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void safeExit(void) { printf("Don't really exit\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Don't really exit\0A\00"
define void @safeExit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Don't really exit\00"
define void @safeExit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
long f(int x) {
  if (1 == x || 0 == x) {
    return x;
  } else {
    return f(x - 1) + f(x - 2);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x1,%eax
cmp    -0xc(%rbp),%eax
je     1134 <f+0x24>
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jne    1141 <f+0x31>
movslq -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <f+0x59>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <f@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %r14d,%r14d
cmp    $0x2,%edi
jb     1133 <f+0x23>
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <f@plt>
add    $0xfffffffe,%ebx
add    %rax,%r14
cmp    $0x2,%ebx
jae    1120 <f+0x10>
mov    %ebx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @f(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %3, label %8
3: ; preds = %8, %1
%4 = phi i64 [ 0, %1 ], [ %14, %8 ]
%5 = phi i32 [ %0, %1 ], [ %13, %8 ]
%6 = zext i32 %5 to i64
%7 = add nsw i64 %4, %6
ret i64 %7
8: ; preds = %1, %8
%9 = phi i32 [ %13, %8 ], [ %0, %1 ]
%10 = phi i64 [ %14, %8 ], [ 0, %1 ]
%11 = add nsw i32 %9, -1
%12 = tail call i64 @f(i32 %11)
%13 = add nsw i32 %9, -2
%14 = add nsw i64 %12, %10
%15 = icmp ult i32 %13, 2
br i1 %15, label %3, label %8
}
/* Variables and functions */
size_t packet_size_2gfsk_rx() { return (0x00 << 8) + 0x7C; }


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

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

LLVM IR (-O0):
define i64 @packet_size_2gfsk_rx() {
ret i64 124
}

LLVM IR (-O2):
define i64 @packet_size_2gfsk_rx() {
ret i64 124
}
int Mini_LutNodeConst0() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Mini_LutNodeConst0() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t read_be16(const void *src) {
  const uint8_t *s = src;
  return (((uint16_t)s[0]) << 8) | (((uint16_t)s[1]) << 0);
}


x86 assembly (clang, -O0):
<read_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_be16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read_be16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = or i32 %5, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL) {
    perror("xmalloc: out of memory.\n");
    abort();
    return NULL;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <xmalloc+0x37>
lea    0xea5(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"xmalloc: out of memory.\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [25 x i8] c"xmalloc: out of memory.\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret i8* %2
}
struct my_inet_request_sock *my_inet_rsk(const struct my_request_sock *sk) {
  return (struct my_inet_request_sock *)sk;
}


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

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

LLVM IR (-O0):
%struct.my_inet_request_sock = type opaque
%struct.my_request_sock = type opaque
define %struct.my_inet_request_sock* @my_inet_rsk(%struct.my_request_sock* %0) {
%2 = alloca %struct.my_request_sock*
store %struct.my_request_sock* %0, %struct.my_request_sock** %2
%3 = load %struct.my_request_sock*, %struct.my_request_sock** %2
%4 = bitcast %struct.my_request_sock* %3 to %struct.my_inet_request_sock*
ret %struct.my_inet_request_sock* %4
}

LLVM IR (-O2):
%struct.my_inet_request_sock = type opaque
%struct.my_request_sock = type opaque
define %struct.my_inet_request_sock* @my_inet_rsk(%struct.my_request_sock* readnone %0) {
%2 = bitcast %struct.my_request_sock* %0 to %struct.my_inet_request_sock*
ret %struct.my_inet_request_sock* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char s[10] = "ABCDE";
  strcpy(s + 2, "ABCDE");
  printf("%d", s[0] - s[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rdi
add    $0x2,%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcpy@plt>
movsbl -0xe(%rbp),%eax
movsbl -0xc(%rbp),%ecx
sub    %ecx,%eax
lea    0xea6(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x4544434241,%rax
mov    %rax,0x8(%rsp)
movw   $0x0,0x10(%rsp)
lea    0xa(%rsp),%rdi
lea    0xec4(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x8(%rsp),%al
sub    0xa(%rsp),%al
movsbl %al,%esi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [10 x i8] c"ABCDE\00\00\00\00\00"
@.str = [6 x i8] c"ABCDE\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = bitcast [10 x i8]* %2 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds i8, i8* %4, i64 2
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %9, %12
%14 = trunc i32 %13 to i8
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [10 x i8] c"ABCDE\00\00\00\00\00"
@.str = [6 x i8] c"ABCDE\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8, i8* %2
%6 = load i8, i8* %3
%7 = sub i8 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %7)
ret i32 0
}
float Procent(float x1, float x2) { return x1 * (x2 / 100); }


x86 assembly (clang, -O0):
<Procent>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xee0(%rip),%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Procent>:
divss  0xef8(%rip),%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Procent(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fdiv float %6, 1.000000e+02
%8 = fmul float %5, %7
ret float %8
}

LLVM IR (-O2):
define float @Procent(float %0, float %1) {
%3 = fdiv float %1, 1.000000e+02
%4 = fmul float %3, %0
ret float %4
}
void hware_set_ptt(int state) { (void)state; }


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

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

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

LLVM IR (-O2):
define void @hware_set_ptt(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t I2CSlaveIntStatusEx(uint32_t ui32Base, bool bMasked) {
  ;
  if (bMasked) {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000814))));
  } else {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000810))));
  }
}


x86 assembly (clang, -O0):
<I2CSlaveIntStatusEx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1129 <I2CSlaveIntStatusEx+0x29>
mov    -0x10(%rbp),%rax
mov    0x814(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1138 <I2CSlaveIntStatusEx+0x38>
mov    -0x10(%rbp),%rax
mov    0x810(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntStatusEx>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    -0x8(%rsp),%rcx
mov    0x810(%rcx,%rax,4),%rax
ret

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

LLVM IR (-O2):
define i64 @I2CSlaveIntStatusEx(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = icmp eq i32 %1, 0
%5 = load volatile i64, i64* %3
%6 = select i1 %4, i64 2064, i64 2068
%7 = add nsw i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int sig_catch(int, int /*<<< orphan*/);
int sig_reset(int sig) { return sig_catch(sig, SIG_DFL); }


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

x86 assembly (clang, -O2):
<sig_reset>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <sig_catch@plt>

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

LLVM IR (-O2):
@SIG_DFL = global i32 0
define i32 @sig_reset(i32 %0) {
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @sig_catch(i32 %0, i32 %2)
ret i32 %3
}
int get_n_pTasks(int p, int rank, int n_blocks) {
  int remainBlocks = n_blocks % p;
  int n_pTasks = n_blocks / p;
  if (rank < remainBlocks)
    n_pTasks += 1;
  return n_pTasks;
}


x86 assembly (clang, -O0):
<get_n_pTasks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1136 <get_n_pTasks+0x36>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_n_pTasks>:
mov    %edx,%eax
cltd
idiv   %edi
xor    %ecx,%ecx
cmp    %esi,%edx
setg   %cl
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_n_pTasks(i32 %0, i32 %1, i32 %2) {
%4 = srem i32 %2, %0
%5 = sdiv i32 %2, %0
%6 = icmp sgt i32 %4, %1
%7 = zext i1 %6 to i32
%8 = add nsw i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void a(void) { printf("a"); }


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

x86 assembly (clang, -O2):
<a>:
mov    $0x61,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @a() {
%1 = tail call i32 @putchar(i32 97)
ret void
}