xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
char gcharand(char x, char y) {
  x &= y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<gcharand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%ecx
movsbl -0x1(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
jne    1144 <gcharand+0x34>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcharand>:
push   %rbx
mov    %edi,%ebx
and    %esi,%ebx
test   %bl,%bl
jne    1120 <gcharand+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @gcharand(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = and i32 %8, %6
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = icmp ne i8 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 @foo(i8* null)
br label %15
15: ; preds = %13, %2
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @gcharand(i8 signext %0, i8 signext %1) {
%3 = and i8 %1, %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i8 %3
}
double st_minf(double x, double y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<st_minf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <st_minf+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <st_minf+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_minf>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @st_minf(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @st_minf(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char const *);
int strcmp(int /*<<< orphan*/, char const *);
int function1() {
  const char *a1 = "PATH";
  const char *a2 = "WHATEVER";
  return strcmp(getenv(a1), a2);
}


x86 assembly (clang, -O0):
<function1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <strcmp@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"PATH\00"
@.str.1 = [9 x i8] c"WHATEVER\00"
define i32 @function1() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = call i32 @getenv(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @strcmp(i32 %4, i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"PATH\00"
@.str.1 = [9 x i8] c"WHATEVER\00"
define i32 @function1() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @strcmp(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 %2
}
void av_opt_freep_ranges() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_freep_ranges() {
ret void
}
void X509_NAME_oneline(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_oneline() {
ret void
}
int codec_choose_arm(struct codec *codec) {
  (void)codec;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.codec = type opaque
define i32 @codec_choose_arm(%struct.codec* %0) {
%2 = alloca %struct.codec*
store %struct.codec* %0, %struct.codec** %2
%3 = load %struct.codec*, %struct.codec** %2
ret i32 0
}

LLVM IR (-O2):
%struct.codec = type opaque
define i32 @codec_choose_arm(%struct.codec* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _glp_lib_xfree(void *);
void glp_free(void *ptr) {
  _glp_lib_xfree(ptr);
  return;
}


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

x86 assembly (clang, -O2):
<glp_free>:
jmp    1030 <_glp_lib_xfree@plt>

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

LLVM IR (-O2):
define void @glp_free(i8* %0) {
%2 = tail call i32 @_glp_lib_xfree(i8* %0)
ret void
}
void benchmark_init(void) {}


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

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

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

LLVM IR (-O2):
define void @benchmark_init() {
ret void
}
void strip_newline(char *string, int len) {
  if (string[len - 1] == '\n')
    string[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<strip_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1136 <strip_newline+0x36>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_newline>:
movslq %esi,%rax
cmpb   $0xa,-0x1(%rax,%rdi,1)
jne    110f <strip_newline+0xf>
movb   $0x0,-0x1(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @strip_newline(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %2
store i8 0, i8* %5
br label %9
9: ; preds = %8, %2
ret void
}
extern unsigned long virt_to_bus(volatile void *address) {
  if (address == (void *)0)
    return 0;
  return ((unsigned long)((long)address - 0x90000000 + 0x80000000));
}


x86 assembly (clang, -O0):
<virt_to_bus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <virt_to_bus+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1142 <virt_to_bus+0x42>
mov    -0x10(%rbp),%rax
movabs $0x90000000,%rcx
sub    %rcx,%rax
movabs $0x80000000,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<virt_to_bus>:
lea    -0x10000000(%rdi),%rax
test   %rdi,%rdi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @virt_to_bus(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %2
br label %12
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %8 to i64
%10 = sub nsw i64 %9, 2415919104
%11 = add nsw i64 %10, 2147483648
store i64 %11, i64* %2
br label %12
12: ; preds = %7, %6
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
define i64 @virt_to_bus(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = ptrtoint i8* %0 to i64
%4 = add nsw i64 %3, -268435456
%5 = select i1 %2, i64 0, i64 %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ exit_prepare();
void exit_wrapper(int returnCode) {
  exit_prepare();
  exit(returnCode);
}


x86 assembly (clang, -O0):
<exit_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <exit_prepare@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_wrapper>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <exit_prepare@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @exit_wrapper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @exit_prepare()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @exit_wrapper(i32 %0) {
%2 = tail call i32 (...) @exit_prepare()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
void *__attribute__((warn_unused_result)) ERR_PTR(long error) {
  return (void *)error;
}


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

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

LLVM IR (-O0):
define i8* @ERR_PTR(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @ERR_PTR(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
/* Variables and functions */
int bs_size_ue(int);
int bs_size_te(int x, int val) {
  if (x == 1) {
    return 1;
  } else if (x > 1) {
    return bs_size_ue(val);
  }
  return 0;
}


x86 assembly (clang, -O0):
<bs_size_te>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1134 <bs_size_te+0x24>
movl   $0x1,-0x4(%rbp)
jmp    115a <bs_size_te+0x4a>
cmpl   $0x1,-0x8(%rbp)
jle    114e <bs_size_te+0x3e>
mov    -0xc(%rbp),%edi
call   1030 <bs_size_ue@plt>
mov    %eax,-0x4(%rbp)
jmp    115a <bs_size_te+0x4a>
jmp    1153 <bs_size_te+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_size_te>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     1128 <bs_size_te+0x18>
xor    %eax,%eax
cmp    $0x2,%edi
jl     1128 <bs_size_te+0x18>
mov    %esi,%edi
jmp    1030 <bs_size_ue@plt>
ret

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

LLVM IR (-O2):
define i32 @bs_size_te(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @bs_size_ue(i32 %1)
br label %8
8: ; preds = %4, %2, %6
%9 = phi i32 [ %7, %6 ], [ 1, %2 ], [ 0, %4 ]
ret i32 %9
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ ungetch(char);
void ungets(char s[]) {
  int i = strlen(s);
  while (i-- > 0) {
    ungetch(s[i]);
  }
}


x86 assembly (clang, -O0):
<ungets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1162 <ungets+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <ungetch@plt>
jmp    1138 <ungets+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungets>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <ungets+0x37>
mov    %eax,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
movsbl (%r14,%rax,1),%edi
call   1040 <ungetch@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1140 <ungets+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ungets(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, -1
store i32 %8, i32* %3
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @ungetch(i8 signext %15)
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ungets(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @ungetch(i8 signext %11)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %1
ret void
}
int main() {
  int a[3] = {2, 3, 4};
  a[0] = a[0] * 2 + a[1] - a[2];
  return a[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
add    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 2
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%11 = load i32, i32* %10
%12 = sub nsw i32 %9, %11
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 %12, i32* %13
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ yuvPlanartoyuy2_C(int /*<<< orphan*/ const *,
                                     int /*<<< orphan*/ const *,
                                     int /*<<< orphan*/ const *,
                                     int /*<<< orphan*/ *, unsigned int,
                                     unsigned int, int, int, int, int);
void yv12toyuy2_C(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc,
                  uint8_t *dst, unsigned int width, unsigned int height,
                  int lumStride, int chromStride, int dstStride) {
  yuvPlanartoyuy2_C(ysrc, usrc, vsrc, dst, width, height, lumStride,
                    chromStride, dstStride, 2);
}


x86 assembly (clang, -O0):
<yv12toyuy2_C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    0x10(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x20(%rbp),%eax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
movl   $0x2,0x18(%rsp)
call   1030 <yuvPlanartoyuy2_C@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yv12toyuy2_C>:
push   %rax
mov    0x10(%rsp),%r10d
mov    0x18(%rsp),%r11d
mov    0x20(%rsp),%eax
push   $0x2
push   %rax
push   %r11
push   %r10
call   1030 <yuvPlanartoyuy2_C@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @yv12toyuy2_C(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32* %0, i32** %10
store i32* %1, i32** %11
store i32* %2, i32** %12
store i32* %3, i32** %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32*, i32** %10
%20 = load i32*, i32** %11
%21 = load i32*, i32** %12
%22 = load i32*, i32** %13
%23 = load i32, i32* %14
%24 = load i32, i32* %15
%25 = load i32, i32* %16
%26 = load i32, i32* %17
%27 = load i32, i32* %18
%28 = call i32 @yuvPlanartoyuy2_C(i32* %19, i32* %20, i32* %21, i32* %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, i32 2)
ret void
}

LLVM IR (-O2):
define void @yv12toyuy2_C(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = tail call i32 @yuvPlanartoyuy2_C(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ array_weight();
int /*<<< orphan*/ array_weightless();
int /*<<< orphan*/ test_alloc_free();
int /*<<< orphan*/ test_utils();
int main(int argc, char **argv) {
  test_alloc_free();
  array_weightless();
  array_weight();
  test_utils();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_alloc_free@plt>
xor    %eax,%eax
call   1030 <array_weightless@plt>
xor    %eax,%eax
call   1050 <array_weight@plt>
xor    %eax,%eax
call   1040 <test_utils@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_alloc_free()
%7 = call i32 (...) @array_weightless()
%8 = call i32 (...) @array_weight()
%9 = call i32 (...) @test_utils()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_alloc_free()
%4 = tail call i32 (...) @array_weightless()
%5 = tail call i32 (...) @array_weight()
%6 = tail call i32 (...) @test_utils()
ret i32 0
}
/* Variables and functions */
void *_kmalloc(unsigned int, int, int /*<<< orphan*/);
void *kmalloc_a(unsigned size) { return _kmalloc(size, 1, 0); }


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

x86 assembly (clang, -O2):
<kmalloc_a>:
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <_kmalloc@plt>

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

LLVM IR (-O2):
define i8* @kmalloc_a(i32 %0) {
%2 = tail call i8* @_kmalloc(i32 %0, i32 1, i32 0)
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ia_setbit8(uint8_t byte, int i) { return byte | (1 << i); }


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

x86 assembly (clang, -O2):
<ia_setbit8>:
mov    %edi,%eax
bts    %esi,%eax
ret

LLVM IR (-O0):
define i32 @ia_setbit8(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 1, %6
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ia_setbit8(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Merge(int *, int, int, int);
void MergeSort(int A[], int p, int r) {
  if (p < r) {
    int q = (p + r) / 2;
    MergeSort(A, p, q);
    MergeSort(A, q + 1, r);
    Merge(A, p, q, r);
  }
}


x86 assembly (clang, -O0):
<MergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <MergeSort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <MergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <MergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <Merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MergeSort>:
cmp    %edx,%esi
jge    1172 <MergeSort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <MergeSort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <MergeSort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <Merge@plt>
ret

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

LLVM IR (-O2):
define void @MergeSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @MergeSort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @MergeSort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @Merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void sayHello(char *tag) { printf("%s: Hello!\n", tag); }


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

x86 assembly (clang, -O2):
<sayHello>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s: Hello!\0A\00"
define void @sayHello(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s: Hello!\0A\00"
define void @sayHello(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void sig_act_handler(int signo) {}


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

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

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

LLVM IR (-O2):
define void @sig_act_handler(i32 %0) {
ret void
}
double floor(double x) {
  double rgv;
  if (x < 0)
    rgv = (int)x - 1;
  else
    rgv = (int)x;
  return rgv;
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112d <floor+0x2d>
cvttsd2si -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    113b <floor+0x3b>
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
cvttsd2si %xmm0,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %2
%8 = fptosi double %7 to i32
%9 = sub nsw i32 %8, 1
%10 = sitofp i32 %9 to double
store double %10, double* %3
br label %15
11: ; preds = %1
%12 = load double, double* %2
%13 = fptosi double %12 to i32
%14 = sitofp i32 %13 to double
store double %14, double* %3
br label %15
15: ; preds = %11, %6
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fptosi double %0 to i32
%4 = sext i1 %2 to i32
%5 = add nsw i32 %4, %3
%6 = sitofp i32 %5 to double
ret double %6
}
int ProcGetPriority(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ProcGetPriority() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ prune_sub2(int);
void call_prune_sub2_2_Bad() { prune_sub2(10); }


x86 assembly (clang, -O0):
<call_prune_sub2_2_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <prune_sub2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_prune_sub2_2_Bad>:
mov    $0xa,%edi
jmp    1030 <prune_sub2@plt>

LLVM IR (-O0):
define void @call_prune_sub2_2_Bad() {
%1 = call i32 @prune_sub2(i32 10)
ret void
}

LLVM IR (-O2):
define void @call_prune_sub2_2_Bad() {
%1 = tail call i32 @prune_sub2(i32 10)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void mcnet_write_uint32(uint8_t *out, uint32_t in) {
  out[0] = ((in >> 24) & 0xFF);
  out[1] = ((in >> 16) & 0xFF);
  out[2] = ((in >> 8) & 0xFF);
  out[3] = ((in >> 0) & 0xFF);
}


x86 assembly (clang, -O0):
<mcnet_write_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcnet_write_uint32>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @mcnet_write_uint32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = ashr i32 %20, 0
%22 = and i32 %21, 255
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 3
store i32 %22, i32* %24
ret void
}

LLVM IR (-O2):
define void @mcnet_write_uint32(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
store i32 %3, i32* %0
%4 = lshr i32 %1, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = and i32 %1, 255
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t fixmul16(int32_t x, int32_t y) {
  int64_t temp;
  temp = x;
  temp *= y;
  temp >>= 16;
  return (int32_t)temp;
}


x86 assembly (clang, -O0):
<fixmul16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixmul16>:
mov    %edi,%eax
imul   %esi,%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @fixmul16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, %7
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = ashr i32 %10, 16
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @fixmul16(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = ashr i32 %3, 16
ret i32 %4
}
/* Variables and functions */
long rom__muldi3(int, long);
long __muldi3(long a, long b) { return rom__muldi3(1, b); }


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

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

LLVM IR (-O0):
define i64 @__muldi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i64 @rom__muldi3(i32 1, i64 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @__muldi3(i64 %0, i64 %1) {
%3 = tail call i64 @rom__muldi3(i32 1, i64 %1)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void update_rev(char *rev_path, int new_rev) {
  FILE *rev_file = fopen(rev_path, "w+");
  char rev_str[10];
  sprintf(rev_str, "%d", new_rev);
  fprintf(rev_file, "%s", rev_str);
  fclose(rev_file);
}


x86 assembly (clang, -O0):
<update_rev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    -0x22(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe92(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x22(%rbp),%rdx
lea    0xe81(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_rev>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
lea    0xeaf(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xea3(%rip),%rsi
lea    0x6(%rsp),%r14
mov    %r14,%rdi
mov    %ebp,%edx
call   1060 <sprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"w+\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"%s\00"
define void @update_rev(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca [10 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %5
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%14 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = load i32*, i32** %5
%16 = call i32 @fclose(i32* %15)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"w+\00"
@.str.1 = [3 x i8] c"%d\00"
define void @update_rev(i8* nocapture %0, i32 %1) {
%3 = alloca [10 x i8]
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%7 = call i32 @fputs(i8* %5, i32* %4)
%8 = tail call i32 @fclose(i32* %4)
ret void
}
/* Type definitions */
struct ui_out {
  int dummy;
};

/* Variables and functions */
void mi_spaces(struct ui_out *uiout, int numspaces) {}


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

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

LLVM IR (-O0):
%struct.ui_out = type { i32 }
define void @mi_spaces(%struct.ui_out* %0, i32 %1) {
%3 = alloca %struct.ui_out*
%4 = alloca i32
store %struct.ui_out* %0, %struct.ui_out** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.ui_out = type { i32 }
define void @mi_spaces(%struct.ui_out* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hal_rtc_init();
void __attribute__((deprecated("use hal_rtc_init() instead"), always_))
HAL_RTC_Configuration(void) {
  hal_rtc_init();
}


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

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

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

LLVM IR (-O2):
define void @HAL_RTC_Configuration() {
%1 = tail call i32 (...) @hal_rtc_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Q_strncpyz(char *, char *, int);
char *Sys_GetClipboardData();
int /*<<< orphan*/ Z_Free(char *);
void CL_GetClipboardData(char *buf, int buflen) {
  char *cbd;
  cbd = Sys_GetClipboardData();
  if (!cbd) {
    *buf = '\0';
    return;
  }
  Q_strncpyz(buf, cbd, buflen);
  Z_Free(cbd);
}


x86 assembly (clang, -O0):
<CL_GetClipboardData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <Sys_GetClipboardData@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <CL_GetClipboardData+0x31>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    117a <CL_GetClipboardData+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <Q_strncpyz@plt>
mov    -0x18(%rbp),%rdi
call   1030 <Z_Free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_GetClipboardData>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <Sys_GetClipboardData@plt>
test   %rax,%rax
je     1163 <CL_GetClipboardData+0x33>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14d,%edx
call   1050 <Q_strncpyz@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <Z_Free@plt>
movb   $0x0,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @CL_GetClipboardData(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i8* (...) @Sys_GetClipboardData()
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = load i8*, i8** %3
store i8 0, i8* %10
br label %18
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i8*, i8** %5
%14 = load i32, i32* %4
%15 = call i32 @Q_strncpyz(i8* %12, i8* %13, i32 %14)
%16 = load i8*, i8** %5
%17 = call i32 @Z_Free(i8* %16)
br label %18
18: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @CL_GetClipboardData(i8* %0, i32 %1) {
%3 = tail call i8* (...) @Sys_GetClipboardData()
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %2
store i8 0, i8* %0
br label %9
6: ; preds = %2
%7 = tail call i32 @Q_strncpyz(i8* %0, i8* %3, i32 %1)
%8 = tail call i32 @Z_Free(i8* %3)
br label %9
9: ; preds = %6, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t CondSwapToBus16(uint16_t d) { return d; }


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

x86 assembly (clang, -O2):
<CondSwapToBus16>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @CondSwapToBus16(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
bool nrf52_errata_244(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_244() {
ret i32 0
}
__attribute__((no, noclone)) int c(int q) { return q + 1; }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @c(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _quicksort(void *, size_t, size_t,
                              int (*)(void const *, void const *, void *),
                              void *);
void ejdbqsort(void *a, size_t nel, size_t width,
               int (*compare)(const void *, const void *, void *opaque),
               void *opaque) {
  _quicksort(a, nel, width, compare, opaque);
}


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

x86 assembly (clang, -O2):
<ejdbqsort>:
jmp    1030 <_quicksort@plt>

LLVM IR (-O0):
define void @ejdbqsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*, i8*)* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32 (i8*, i8*, i8*)*
%10 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i32 (i8*, i8*, i8*)* %3, i32 (i8*, i8*, i8*)** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i32 (i8*, i8*, i8*)*, i32 (i8*, i8*, i8*)** %9
%15 = load i8*, i8** %10
%16 = call i32 @_quicksort(i8* %11, i64 %12, i64 %13, i32 (i8*, i8*, i8*)* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @ejdbqsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*, i8*)* %3, i8* %4) {
%6 = tail call i32 @_quicksort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*, i8*)* %3, i8* %4)
ret void
}
/* Type definitions */
struct ibv_comp_channel {
  int dummy;
};

/* Variables and functions */
int ibv_destroy_comp_channel(struct ibv_comp_channel *);
int mlx4_glue_destroy_comp_channel(struct ibv_comp_channel *channel) {
  return ibv_destroy_comp_channel(channel);
}


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

x86 assembly (clang, -O2):
<mlx4_glue_destroy_comp_channel>:
jmp    1030 <ibv_destroy_comp_channel@plt>

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

LLVM IR (-O2):
%struct.ibv_comp_channel = type { i32 }
define i32 @mlx4_glue_destroy_comp_channel(%struct.ibv_comp_channel* %0) {
%2 = tail call i32 @ibv_destroy_comp_channel(%struct.ibv_comp_channel* %0)
ret i32 %2
}
int SDL_imageFilterBitNegationMMX(unsigned char *Src1, unsigned char *Dest,
                                  unsigned int SrcLength) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterBitNegationMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SDL_imageFilterBitNegationMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
float ceill(float);
float ceilf(float x) { return ceill(x); }


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

x86 assembly (clang, -O2):
<ceilf>:
jmp    1030 <ceill@plt>

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

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = tail call float @ceill(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ handleC(char);
int handleS(const char *s) {
  char c;
  while (c = *s++) {
    handleC(c);
  }
}


x86 assembly (clang, -O0):
<handleS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1146 <handleS+0x36>
movsbl -0x11(%rbp),%edi
call   1030 <handleC@plt>
jmp    111c <handleS+0xc>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleS>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <handleS+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <handleC@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <handleS+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @handleS(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
%8 = load i8, i8* %6
store i8 %8, i8* %4
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8, i8* %4
%12 = call i32 @handleC(i8 signext %11)
br label %5
13: ; preds = %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @handleS(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @handleC(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ IO_put_string(char *);
void visass_ab3_illegals(void) {
  IO_put_string("; ToACME: Adding pseudo opcode to enable undocumented "
                "(\"illegal\") opcodes:\n"
                "\t!cpu 6510\n"
                "; ToACME: Support for illegal opcodes is somewhat broken in "
                "VisAss/AssBlaster.\n"
                "; ToACME:   Make sure you read the ToACME docs to know what "
                "you'll have to\n"
                "; ToACME:   look out for.\n"
                "; ToACME:   Should work: DCP, DOP, ISC, JAM (called KIL in "
                "VisAss/AssBlaster),\n"
                "; ToACME:     RLA, RRA, SBX (was called AXS in AssBlaster), "
                "SLO, SRE, TOP.\n"
                "; ToACME:   Trouble: ARR, ASR, LAX, SAX (called AAX in "
                "VisAss/AssBlaster).\n");
}


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

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

LLVM IR (-O0):
@.str = [496 x i8] c"; ToACME: Adding pseudo opcode to enable undocumented (\22illegal\22) opcodes:\0A\09!cpu 6510\0A; ToACME: Support for illegal opcodes is somewhat broken in VisAss/AssBlaster.\0A; ToACME: Make sure you read the ToACME docs to know what you'll have to\0A; ToACME: look out for.\0A; ToACME: Should work: DCP, DOP, ISC, JAM (called KIL in VisAss/AssBlaster),\0A; ToACME: RLA, RRA, SBX (was called AXS in AssBlaster), SLO, SRE, TOP.\0A; ToACME: Trouble: ARR, ASR, LAX, SAX (called AAX in VisAss/AssBlaster).\0A\00"
define void @visass_ab3_illegals() {
%1 = call i32 @IO_put_string(i8* getelementptr inbounds ([496 x i8], [496 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [496 x i8] c"; ToACME: Adding pseudo opcode to enable undocumented (\22illegal\22) opcodes:\0A\09!cpu 6510\0A; ToACME: Support for illegal opcodes is somewhat broken in VisAss/AssBlaster.\0A; ToACME: Make sure you read the ToACME docs to know what you'll have to\0A; ToACME: look out for.\0A; ToACME: Should work: DCP, DOP, ISC, JAM (called KIL in VisAss/AssBlaster),\0A; ToACME: RLA, RRA, SBX (was called AXS in AssBlaster), SLO, SRE, TOP.\0A; ToACME: Trouble: ARR, ASR, LAX, SAX (called AAX in VisAss/AssBlaster).\0A\00"
define void @visass_ab3_illegals() {
%1 = tail call i32 @IO_put_string(i8* getelementptr inbounds ([496 x i8], [496 x i8]* @.str, i64 0, i64 0))
ret void
}