xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(double **);
int /*<<< orphan*/ free1_d(double *);
void free2_d(double **m, int dim1) {
  int i;
  for (i = 0; i < dim1; ++i) {
    free1_d(m[i]);
  }
  free(m);
}


x86 assembly (clang, -O0):
<free2_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <free2_d+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <free1_d@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <free2_d+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free2_d>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1152 <free2_d+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1040 <free1_d@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <free2_d+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free2_d(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = load double*, double** %8
%10 = tail call i32 @free1_d(double* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @free(double** %0)
ret void
}
double relu_gradient(const double x) { return (x > 0); }


x86 assembly (clang, -O0):
<relu_gradient>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<relu_gradient>:
xorpd  %xmm1,%xmm1
cmpltsd %xmm0,%xmm1
movsd  0xeef(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @relu_gradient(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @relu_gradient(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = uitofp i1 %2 to double
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u32;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_2_be(int, int /*<<< orphan*/ *);
void __put_unaligned_4_be(__u32 __v, register __u8 *__p) {
  __put_unaligned_2_be(__v >> 16, __p);
  __put_unaligned_2_be(__v, __p + 2);
}


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

x86 assembly (clang, -O2):
<__put_unaligned_4_be>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x10,%edi
call   1030 <__put_unaligned_2_be@plt>
add    $0x8,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__put_unaligned_2_be@plt>

LLVM IR (-O0):
define void @__put_unaligned_4_be(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 16
%7 = load i32*, i32** %4
%8 = call i32 @__put_unaligned_2_be(i32 %6, i32* %7)
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = call i32 @__put_unaligned_2_be(i32 %9, i32* %11)
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_4_be(i32 %0, i32* %1) {
%3 = ashr i32 %0, 16
%4 = tail call i32 @__put_unaligned_2_be(i32 %3, i32* %1)
%5 = getelementptr inbounds i32, i32* %1, i64 2
%6 = tail call i32 @__put_unaligned_2_be(i32 %0, i32* %5)
ret void
}
/* Variables and functions */
scalar_t__ isnan(double);
int /*<<< orphan*/ libt_add_timeouta(scalar_t__, void (*)(void *),
                                     void const *);
scalar_t__ libt_now();
void libt_add_timeout(double timeout, void (*fn)(void *), const void *dat) {
  if (isnan(timeout))
    return;
  libt_add_timeouta(timeout + libt_now(), fn, dat);
}


x86 assembly (clang, -O0):
<libt_add_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <isnan@plt>
cmp    $0x0,%rax
je     115e <libt_add_timeout+0x2e>
jmp    118f <libt_add_timeout+0x5f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <libt_now@plt>
movsd  -0x20(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <libt_add_timeouta@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libt_add_timeout>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1050 <isnan@plt>
test   %rax,%rax
je     1151 <libt_add_timeout+0x21>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
call   1030 <libt_now@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <libt_add_timeouta@plt>

LLVM IR (-O0):
define void @libt_add_timeout(double %0, void (i8*)* %1, i8* %2) {
%4 = alloca double
%5 = alloca void (i8*)*
%6 = alloca i8*
store double %0, double* %4
store void (i8*)* %1, void (i8*)** %5
store i8* %2, i8** %6
%7 = load double, double* %4
%8 = call i64 @isnan(double %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
br label %20
11: ; preds = %3
%12 = load double, double* %4
%13 = call i64 (...) @libt_now()
%14 = sitofp i64 %13 to double
%15 = fadd double %12, %14
%16 = fptosi double %15 to i64
%17 = load void (i8*)*, void (i8*)** %5
%18 = load i8*, i8** %6
%19 = call i32 @libt_add_timeouta(i64 %16, void (i8*)* %17, i8* %18)
br label %20
20: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @libt_add_timeout(double %0, void (i8*)* %1, i8* %2) {
%4 = tail call i64 @isnan(double %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = tail call i64 (...) @libt_now()
%8 = sitofp i64 %7 to double
%9 = fadd double %8, %0
%10 = fptosi double %9 to i64
%11 = tail call i32 @libt_add_timeouta(i64 %10, void (i8*)* %1, i8* %2)
br label %12
12: ; preds = %3, %6
ret void
}
void mp_png_backend_initialize(void *mp) { return; }


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

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

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

LLVM IR (-O2):
define void @mp_png_backend_initialize(i8* nocapture %0) {
ret void
}
int msm8994_unclamp_secondary_arm_cpu(unsigned int cpu) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm8994_unclamp_secondary_arm_cpu(i32 %0) {
ret i32 0
}
/* Variables and functions */
int funCountFromFile();
int /*<<< orphan*/ printf(char *);
int main() {
  if (funCountFromFile() != -1) {
    printf("\nOK\n");
  } else {
    printf("\nerror\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <funCountFromFile@plt>
cmp    $0xffffffff,%eax
je     1150 <main+0x30>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
jmp    1168 <main+0x48>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <main+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <funCountFromFile@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
sete   %bl
lea    0xec9(%rip),%rax
lea    0xec9(%rip),%rdi
cmove  %rax,%rdi
neg    %ebx
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0AOK\0A\00"
@.str.1 = [8 x i8] c"\0Aerror\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @funCountFromFile()
%3 = icmp ne i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %9
8: ; preds = %4
store i32 0, i32* %1
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@str = [7 x i8] c"\0Aerror\00"
@str.2 = [4 x i8] c"\0AOK\00"
define i32 @main() {
%1 = tail call i32 (...) @funCountFromFile()
%2 = icmp eq i32 %1, -1
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0)
%4 = sext i1 %2 to i32
%5 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 %4
}
int list_defcmp(void *d1, void *d2, void *private) { return (d1 != d2); }


x86 assembly (clang, -O0):
<list_defcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_defcmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @list_defcmp(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp ne i8* %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @list_defcmp(i8* readnone %0, i8* readnone %1, i8* nocapture readnone %2) {
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_heximal(int n) {
  if (n < 10)
    printf("%d", n);
  else
    printf("%c", 87 + n);
}


x86 assembly (clang, -O0):
<print_heximal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1139 <print_heximal+0x29>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    114b <print_heximal+0x3b>
mov    -0x4(%rbp),%esi
add    $0x57,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_heximal>:
mov    %edi,%esi
cmp    $0x9,%edi
jg     1123 <print_heximal+0x13>
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>
add    $0x57,%esi
lea    0xed6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
define void @print_heximal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = add nsw i32 87, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
define void @print_heximal(i32 %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
5: ; preds = %1
%6 = add nuw nsw i32 %0, 87
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ refresh();
void nmstermio_refresh(void) { refresh(); }


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

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

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

LLVM IR (-O2):
define void @nmstermio_refresh() {
%1 = tail call i32 (...) @refresh()
ret void
}
void gdk_keymap_get_for_display() {}


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

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

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

LLVM IR (-O2):
define void @gdk_keymap_get_for_display() {
ret void
}
/* Type definitions */
struct icmp {
  int /*<<< orphan*/ icmp_seq;
};

/* Variables and functions */
int htons(int /*<<< orphan*/);
int get_icmp_seq(struct icmp *self) { return htons(self->icmp_seq); }


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

x86 assembly (clang, -O2):
<get_icmp_seq>:
mov    (%rdi),%edi
jmp    1030 <htons@plt>

LLVM IR (-O0):
%struct.icmp = type { i32 }
define i32 @get_icmp_seq(%struct.icmp* %0) {
%2 = alloca %struct.icmp*
store %struct.icmp* %0, %struct.icmp** %2
%3 = load %struct.icmp*, %struct.icmp** %2
%4 = getelementptr inbounds %struct.icmp, %struct.icmp* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @htons(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.icmp = type { i32 }
define i32 @get_icmp_seq(%struct.icmp* nocapture %0) {
%2 = getelementptr inbounds %struct.icmp, %struct.icmp* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @htons(i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
double CalculateCostOfIntegers(int /*<<< orphan*/ *, int, int, int);
double CalculateCostOfIntegers1(FILE *fh, int count, int shift) {
  return CalculateCostOfIntegers(fh, count, shift, 4);
}


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

x86 assembly (clang, -O2):
<CalculateCostOfIntegers1>:
mov    $0x4,%ecx
jmp    1030 <CalculateCostOfIntegers@plt>

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

LLVM IR (-O2):
define double @CalculateCostOfIntegers1(i32* %0, i32 %1, i32 %2) {
%4 = tail call double @CalculateCostOfIntegers(i32* %0, i32 %1, i32 %2, i32 4)
ret double %4
}
unsigned hash(unsigned ipv4) {
  unsigned result;
  result = ipv4;
  result += ipv4 >> 23;
  result ^= ipv4 << 7;
  return result;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x17,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x7,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %edi,%eax
shr    $0x17,%eax
add    %edi,%eax
shl    $0x7,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @hash(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = lshr i32 %5, 23
%7 = load i32, i32* %3
%8 = add i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = shl i32 %9, 7
%11 = load i32, i32* %3
%12 = xor i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = lshr i32 %0, 23
%3 = add i32 %2, %0
%4 = shl i32 %0, 7
%5 = xor i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
int process_exec(const char *_commandLine) {
  size_t lengthOfCommandLine = strlen(_commandLine);
  char *commandLine = malloc(lengthOfCommandLine + 6);
  memcpy(commandLine, "sh -c ", 5);
  memcpy(commandLine + 5, _commandLine, lengthOfCommandLine + 1);
  free(commandLine);
  return -1;
}


x86 assembly (clang, -O0):
<process_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x6,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe8b(%rip),%rsi
mov    $0x5,%edx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rdi
add    $0x5,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_exec>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%rbx
lea    0x6(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%r15
lea    0xe9d(%rip),%rsi
mov    $0x5,%edx
mov    %rax,%rdi
call   1050 <memcpy@plt>
lea    0x5(%r15),%rdi
add    $0x1,%rbx
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <memcpy@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"sh -c \00"
define i32 @process_exec(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 6
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @memcpy(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 5)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 5
%14 = load i8*, i8** %2
%15 = load i64, i64* %3
%16 = add i64 %15, 1
%17 = call i32 @memcpy(i8* %13, i8* %14, i64 %16)
%18 = load i8*, i8** %4
%19 = call i32 @free(i8* %18)
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"sh -c \00"
define i32 @process_exec(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 6
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 5)
%6 = getelementptr inbounds i8, i8* %4, i64 5
%7 = add i64 %2, 1
%8 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %7)
%9 = tail call i32 @free(i8* %4)
ret i32 -1
}
int iscntrl(int c) { return c == 0x7F || c < 0x20; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x7f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <iscntrl+0x20>
cmpl   $0x20,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x7f,%edi
sete   %al
cmp    $0x20,%edi
setl   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 127
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 32
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp eq i32 %0, 127
%3 = icmp slt i32 %0, 32
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: monikor <config.yml>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: monikor <config.yml>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: monikor <config.yml>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ print_str(char *);
void task3_func(void) {
  print_str("task3: Created!\n");
  while (1) {
    print_str("task3: Running...\n");
    delay(1000);
  }
}


x86 assembly (clang, -O0):
<task3_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <print_str@plt>
lea    0xeda(%rip),%rdi
call   1040 <print_str@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
jmp    1130 <task3_func+0x10>

x86 assembly (clang, -O2):
<task3_func>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <print_str@plt>
lea    0xedd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <print_str@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
jmp    1140 <task3_func+0x20>

LLVM IR (-O0):
@.str = [17 x i8] c"task3: Created!\0A\00"
@.str.1 = [19 x i8] c"task3: Running...\0A\00"
define void @task3_func() {
%1 = call i32 @print_str(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = call i32 @print_str(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @delay(i32 1000)
br label %2
}

LLVM IR (-O2):
@.str = [17 x i8] c"task3: Created!\0A\00"
@.str.1 = [19 x i8] c"task3: Running...\0A\00"
define void @task3_func() {
%1 = tail call i32 @print_str(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @print_str(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @delay(i32 1000)
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *getcwd(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
void firstPwd() {
  char buf[1024];
  char *cwd = getcwd(buf, sizeof(buf));
  if (NULL == cwd) {
    perror("Get current working directory fail. \n");
    exit(-1);
  } else {
    printf("Current working directory is : %s\n", cwd);
  }
}


x86 assembly (clang, -O0):
<firstPwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
mov    %rax,-0x408(%rbp)
xor    %eax,%eax
cmp    -0x408(%rbp),%rax
jne    1188 <firstPwd+0x48>
lea    0xe87(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x408(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstPwd>:
sub    $0x408,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
test   %rax,%rax
je     1170 <firstPwd+0x30>
lea    0xec6(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x408,%rsp
ret
lea    0xe89(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Get current working directory fail. \0A\00"
@.str.1 = [35 x i8] c"Current working directory is : %s\0A\00"
define void @firstPwd() {
%1 = alloca [1024 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = call i8* @getcwd(i8* %3, i32 1024)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp eq i8* null, %5
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %0
%11 = load i8*, i8** %2
%12 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Get current working directory fail. \0A\00"
@.str.1 = [35 x i8] c"Current working directory is : %s\0A\00"
define void @firstPwd() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i8* @getcwd(i8* %2, i32 1024)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 -1)
unreachable
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int id3v1_del_tag(int const);
int id3v2_del_tag(int const, int /*<<< orphan*/ *);
int mp_del_tags_from_fd(const int fd) {
  int ret = 0;
  ret |= id3v1_del_tag(fd);
  ret |= id3v2_del_tag(fd, NULL);
  return ret;
}


x86 assembly (clang, -O0):
<mp_del_tags_from_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <id3v1_del_tag@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <id3v2_del_tag@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_del_tags_from_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <id3v1_del_tag@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <id3v2_del_tag@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mp_del_tags_from_fd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @id3v1_del_tag(i32 %4)
%6 = load i32, i32* %3
%7 = or i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @id3v2_del_tag(i32 %8, i32* null)
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @mp_del_tags_from_fd(i32 %0) {
%2 = tail call i32 @id3v1_del_tag(i32 %0)
%3 = tail call i32 @id3v2_del_tag(i32 %0, i32* null)
%4 = or i32 %3, %2
ret i32 %4
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  int /*<<< orphan*/ key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_DELETE_ELEM;
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_delete_elem(int fd, void *key) {
  union bpf_attr attr;
  attr.map_fd = fd;
  attr.key = ptr_to_u64(key);
  return syscall(321, BPF_MAP_DELETE_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_delete_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
lea    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1040 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_delete_elem>:
push   %rax
mov    %rsi,%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,(%rsp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x141,%edi
mov    $0x4,%ecx
call   1040 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_MAP_DELETE_ELEM = global i32 0
define i32 @bpf_delete_elem(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = bitcast %union.bpf_attr* %5 to i32*
store i32 %6, i32* %7
%8 = load i8*, i8** %4
%9 = call i32 @ptr_to_u64(i8* %8)
%10 = bitcast %union.bpf_attr* %5 to i32*
store i32 %9, i32* %10
%11 = load i32, i32* @BPF_MAP_DELETE_ELEM
%12 = call i32 @syscall(i32 321, i32 %11, %union.bpf_attr* %5, i32 4)
ret i32 %12
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_MAP_DELETE_ELEM = global i32 0
define i32 @bpf_delete_elem(i32 %0, i8* %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
%6 = tail call i32 @ptr_to_u64(i8* %1)
store i32 %6, i32* %5
%7 = load i32, i32* @BPF_MAP_DELETE_ELEM
%8 = call i32 @syscall(i32 321, i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ return_to_prog();
void _returnFromException() { return_to_prog(); }


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

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

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

LLVM IR (-O2):
define void @_returnFromException() {
%1 = tail call i32 (...) @return_to_prog()
ret void
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t rol64(uint64_t data, unsigned int rotation) {
  return ((data << rotation) | (data >> (64 - rotation)));
}


x86 assembly (clang, -O0):
<rol64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol64>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 64, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol64(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 64, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void to_my_3(int value, char *m) {
  m[2] = value >> 16;
  m[1] = value >> 8;
  m[0] = value;
}


x86 assembly (clang, -O0):
<to_my_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_my_3>:
mov    %edi,%eax
mov    %edi,%ecx
shr    $0x10,%ecx
mov    %cl,0x2(%rsi)
mov    %ah,0x1(%rsi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @to_my_3(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 = ashr i32 %5, 16
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i32, i32* %3
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 0
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
define void @to_my_3(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 16
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %4, i8* %5
%6 = lshr i32 %0, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %8
%9 = trunc i32 %0 to i8
store i8 %9, i8* %1
ret void
}
int is_null(float x) {
  if (x == 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<is_null>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112c <is_null+0x2c>
jp     112c <is_null+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1133 <is_null+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_null>:
xorps  %xmm1,%xmm1
cmpneqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_null(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oeq float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_null(float %0) {
%2 = fcmp une float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
void serial_putc(char ch) {
  while (!((*((volatile unsigned char *)0x05FFFECC)) & 0x80)) {
    ;
  }
  (*((volatile unsigned char *)0x05FFFECB)) = ch;
  (*((volatile unsigned char *)0x05FFFECC)) &= ~0x80;
}


x86 assembly (clang, -O0):
<serial_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x5fffecc,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112e <serial_putc+0x2e>
jmp    1133 <serial_putc+0x33>
jmp    110a <serial_putc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x5fffecb,%eax
mov    %cl,(%rax)
mov    $0x5fffecc,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0xffffff7f,%eax
mov    %al,%cl
mov    $0x5fffecc,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_putc>:
cmpb   $0x0,0x5fffecc
jns    1100 <serial_putc>
mov    %dil,0x5fffecb
05
andb   $0x7f,0x5fffecc
7f
ret

LLVM IR (-O0):
define void @serial_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %9, %1
%4 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i8, i8* %2
store volatile i8 %11, i8* inttoptr (i64 100662987 to i8*)
%12 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%13 = zext i8 %12 to i32
%14 = and i32 %13, -129
%15 = trunc i32 %14 to i8
store volatile i8 %15, i8* inttoptr (i64 100662988 to i8*)
ret void
}

LLVM IR (-O2):
define void @serial_putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%4 = icmp sgt i8 %3, -1
br i1 %4, label %2, label %5
5: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 100662987 to i8*)
%6 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%7 = and i8 %6, 127
store volatile i8 %7, i8* inttoptr (i64 100662988 to i8*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t read_reg16(volatile uint16_t *reg) {
  return ((*((volatile uint32_t *)(reg))));
}


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

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

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

LLVM IR (-O2):
define i32 @read_reg16(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverseEscape(char *, char *);
int main() {
  char msg[] = "Tab here\no\tk";
  char to[1000];
  reverseEscape(to, msg);
  printf("%s\n", to);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec0(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x400(%rbp),%rdi
lea    -0x11(%rbp),%rsi
call   1040 <reverseEscape@plt>
lea    -0x400(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
movabs $0x6b096f0a657265,%rax
mov    %rax,0x5(%rsp)
movabs $0x6572656820626154,%rax
65 72 65
mov    %rax,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <reverseEscape@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.msg = [13 x i8] c"Tab here\0Ao\09k\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = alloca [1000 x i8]
store i32 0, i32* %1
%4 = bitcast [13 x i8]* %2 to i8*
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%7 = call i32 @reverseEscape(i8* %5, i8* %6)
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.msg = [13 x i8] c"Tab here\0Ao\09k\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @reverseEscape(i8* %4, i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int tolc(char c) {
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';
  return c;
}


x86 assembly (clang, -O0):
<tolc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <tolc+0x36>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <tolc+0x36>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <tolc+0x3d>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolc>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%cl
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @tolc(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
%5 = add nsw i32 %2, 32
%6 = select i1 %4, i32 %5, i32 %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void int2str(int i, char *s) { sprintf(s, "%d", i); }


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

x86 assembly (clang, -O2):
<int2str>:
mov    %rsi,%rax
mov    %edi,%edx
lea    0xee4(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @int2str(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("Hello, World!");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
int is_rTRG(int id) { return ((id == 168) || (id == 169)); }


x86 assembly (clang, -O0):
<is_rTRG>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xa8,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1126 <is_rTRG+0x26>
cmpl   $0xa9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_rTRG>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0xa8,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_rTRG(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 168
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 169
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_rTRG(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 168
%4 = zext i1 %3 to i32
ret i32 %4
}
void XtRegisterDrawable() {}


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

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

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

LLVM IR (-O2):
define void @XtRegisterDrawable() {
ret void
}
/* Variables and functions */
scalar_t__ init_bt_io();
scalar_t__ init_task_queue();
int /*<<< orphan*/ uninit_task_queue();
int init(void *data) {
  if (init_task_queue() < 0)
    goto err_init_task_queue;
  if (init_bt_io() < 0)
    goto err_init_bt_io;
  return 0;
err_init_bt_io:
  uninit_task_queue();
err_init_task_queue:
  return -1;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <init_task_queue@plt>
cmp    $0x0,%rax
jge    1152 <init+0x22>
jmp    117b <init+0x4b>
mov    $0x0,%al
call   1040 <init_bt_io@plt>
cmp    $0x0,%rax
jge    1168 <init+0x38>
jmp    1174 <init+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1182 <init+0x52>
mov    $0x0,%al
call   1050 <uninit_task_queue@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <init_task_queue@plt>
test   %rax,%rax
js     1152 <init+0x22>
xor    %eax,%eax
call   1040 <init_bt_io@plt>
test   %rax,%rax
jns    1157 <init+0x27>
xor    %eax,%eax
call   1050 <uninit_task_queue@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @init(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @init_task_queue()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %14
7: ; preds = %1
%8 = call i64 (...) @init_bt_io()
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %12
11: ; preds = %7
store i32 0, i32* %2
br label %15
12: ; preds = %10
%13 = call i32 (...) @uninit_task_queue()
br label %14
14: ; preds = %12, %6
store i32 -1, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @init(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @init_task_queue()
%3 = icmp slt i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 (...) @init_bt_io()
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @uninit_task_queue()
br label %9
9: ; preds = %7, %1, %4
%10 = phi i32 [ 0, %4 ], [ -1, %1 ], [ -1, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ brp_free_internal(void *, void *, int);
void brp_free_1(void *storage, void *ptr) {
  brp_free_internal(storage, ptr, 1);
}


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

x86 assembly (clang, -O2):
<brp_free_1>:
mov    $0x1,%edx
jmp    1030 <brp_free_internal@plt>

LLVM IR (-O0):
define void @brp_free_1(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 @brp_free_internal(i8* %5, i8* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @brp_free_1(i8* %0, i8* %1) {
%3 = tail call i32 @brp_free_internal(i8* %0, i8* %1, i32 1)
ret void
}