xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) {
  fprintf(stderr, "%s", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void ppu_2C02_tick(struct _2C02 *ppu) { (void)ppu; }


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

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

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

LLVM IR (-O2):
%struct._2C02 = type opaque
define void @ppu_2C02_tick(%struct._2C02* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void g2(char *x) {
  if (x[0] != 42)
    abort();
}


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
je     1133 <g2+0x23>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
push   %rax
cmpb   $0x2a,(%rdi)
jne    1118 <g2+0x8>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @g2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 42
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @g2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 42
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ curve25519_test();
int main(void) {
  curve25519_test();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <curve25519_test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @curve25519_test()
ret i32 0
}
/* Variables and functions */
double ighmm_rand_normal_density_trunc(double, double, double, double);
double ighmm_rand_normal_density_pos(double x, double mean, double u) {
  return ighmm_rand_normal_density_trunc(x, mean, u, -0.1);
}


x86 assembly (clang, -O0):
<ighmm_rand_normal_density_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  0xec2(%rip),%xmm3
call   1030 <ighmm_rand_normal_density_trunc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ighmm_rand_normal_density_pos>:
movsd  0xee8(%rip),%xmm3
jmp    1030 <ighmm_rand_normal_density_trunc@plt>

LLVM IR (-O0):
define double @ighmm_rand_normal_density_pos(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @ighmm_rand_normal_density_trunc(double %7, double %8, double %9, double -1.000000e-01)
ret double %10
}

LLVM IR (-O2):
define double @ighmm_rand_normal_density_pos(double %0, double %1, double %2) {
%4 = tail call double @ighmm_rand_normal_density_trunc(double %0, double %1, double %2, double -1.000000e-01)
ret double %4
}
unsigned long atomic_cmpxchg(volatile void *ptr, unsigned long old,
                             unsigned long new) {
  unsigned long prev;
  asm volatile("lock; "
               "cmpxchgq %1,%2"
               : "=a"(prev)
               : "r"(new), "m"(*(volatile long *)ptr), "0"(old)
               : "memory");
  return prev;
}


x86 assembly (clang, -O0):
<atomic_cmpxchg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
lock cmpxchg %rcx,(%rdx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_cmpxchg>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i64 @atomic_cmpxchg(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %5
%12 = call i64 asm sideeffect "lock; cmpxchgq $1,$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %8, i64* elementtype(i64) %10, i64 %11)
store i64 %12, i64* %7
%13 = load i64, i64* %7
ret i64 %13
}

LLVM IR (-O2):
define i64 @atomic_cmpxchg(i8* %0, i64 %1, i64 %2) {
%4 = bitcast i8* %0 to i64*
%5 = tail call i64 asm sideeffect "lock; cmpxchgq $1,$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %2, i64* elementtype(i64) %4, i64 %1)
ret i64 %5
}
/* Variables and functions */
char *format_str(char *, char const *);
char *add_dquotes(const char match[]) { return format_str("\"%s\"", match); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\22%s\22\00"
define i8* @add_dquotes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @format_str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"\22%s\22\00"
define i8* @add_dquotes(i8* %0) {
%2 = tail call i8* @format_str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
int get_action_remorseless(int myRep, int hisRep) {
  if (hisRep == 1) {
    return 1;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<get_action_remorseless>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1120 <get_action_remorseless+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1127 <get_action_remorseless+0x27>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_action_remorseless>:
xor    %eax,%eax
cmp    $0x1,%esi
sete   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @get_action_remorseless(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* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_action_remorseless(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = select i1 %3, i32 1, i32 -1
ret i32 %4
}
/* Variables and functions */
int __nvvm_read_ptx_sreg_ctaid_w();
int __nvvm_read_ptx_sreg_ctaid_x();
int __nvvm_read_ptx_sreg_ctaid_y();
int __nvvm_read_ptx_sreg_ctaid_z();
__attribute__((device)) int read_ctaid() {
  int x = __nvvm_read_ptx_sreg_ctaid_x();
  int y = __nvvm_read_ptx_sreg_ctaid_y();
  int z = __nvvm_read_ptx_sreg_ctaid_z();
  int w = __nvvm_read_ptx_sreg_ctaid_w();
  return x + y + z + w;
}


x86 assembly (clang, -O0):
<read_ctaid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__nvvm_read_ptx_sreg_ctaid_x@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <__nvvm_read_ptx_sreg_ctaid_y@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__nvvm_read_ptx_sreg_ctaid_z@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <__nvvm_read_ptx_sreg_ctaid_w@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ctaid>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <__nvvm_read_ptx_sreg_ctaid_x@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1060 <__nvvm_read_ptx_sreg_ctaid_y@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <__nvvm_read_ptx_sreg_ctaid_z@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <__nvvm_read_ptx_sreg_ctaid_w@plt>
add    %r14d,%ebp
add    %ebx,%ebp
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_ctaid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @__nvvm_read_ptx_sreg_ctaid_x()
store i32 %5, i32* %1
%6 = call i32 (...) @__nvvm_read_ptx_sreg_ctaid_y()
store i32 %6, i32* %2
%7 = call i32 (...) @__nvvm_read_ptx_sreg_ctaid_z()
store i32 %7, i32* %3
%8 = call i32 (...) @__nvvm_read_ptx_sreg_ctaid_w()
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_ctaid() {
%1 = tail call i32 (...) @__nvvm_read_ptx_sreg_ctaid_x()
%2 = tail call i32 (...) @__nvvm_read_ptx_sreg_ctaid_y()
%3 = tail call i32 (...) @__nvvm_read_ptx_sreg_ctaid_z()
%4 = tail call i32 (...) @__nvvm_read_ptx_sreg_ctaid_w()
%5 = add nsw i32 %2, %1
%6 = add nsw i32 %5, %3
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() { printf("Usage: uviewbitmap [-a] bmp_file\n"); }


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"Usage: uviewbitmap [-a] bmp_file\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
void EXTENDED_KEY_USAGE_new(void) {}


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

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

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

LLVM IR (-O2):
define void @EXTENDED_KEY_USAGE_new() {
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
int cmpshuffle(const void *arg1, const void *arg2) {
  double s;
  s = (rand() / (double)RAND_MAX) - 0.5;
  return (s <= 0.0005) ? 1 : -11;
}


x86 assembly (clang, -O0):
<cmpshuffle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2eba(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  0xeab(%rip),%xmm0
mov    $0xfffffff5,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmovae %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpshuffle>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
addsd  0xed0(%rip),%xmm0
movsd  0xed0(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    $0x1,%ecx
mov    $0xfffffff5,%eax
cmovae %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @cmpshuffle(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call double (...) @rand()
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = fdiv double %6, %8
%10 = fsub double %9, 5.000000e-01
store double %10, double* %5
%11 = load double, double* %5
%12 = fcmp ole double %11, 5.000000e-04
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 -11
ret i32 %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @cmpshuffle(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call double (...) @rand()
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
%7 = fadd double %6, -5.000000e-01
%8 = fcmp ole double %7, 5.000000e-04
%9 = select i1 %8, i32 1, i32 -11
ret i32 %9
}
/* Variables and functions */
int digits(int);
int ILen(int i) { return digits(i) + 2; }


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

x86 assembly (clang, -O2):
<ILen>:
push   %rax
call   1030 <digits@plt>
add    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ILen(i32 %0) {
%2 = tail call i32 @digits(i32 %0)
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printPascalsTriangle(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int userSize;
  printf("Enter in size for Pascal's Triangle: ");
  scanf("%d", &userSize);
  printPascalsTriangle(userSize);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <printPascalsTriangle@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <printPascalsTriangle@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Enter in size for Pascal's Triangle: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @printPascalsTriangle(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Enter in size for Pascal's Triangle: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printPascalsTriangle(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _clear_error_stack();
int /*<<< orphan*/ _ptr_chain_free(void *);
void ptr_chain_free(void *buf) {
  { _clear_error_stack(); };
  _ptr_chain_free(buf);
}


x86 assembly (clang, -O0):
<ptr_chain_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_clear_error_stack@plt>
mov    -0x8(%rbp),%rdi
call   1040 <_ptr_chain_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_chain_free>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <_clear_error_stack@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <_ptr_chain_free@plt>

LLVM IR (-O0):
define void @ptr_chain_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @_clear_error_stack()
%4 = load i8*, i8** %2
%5 = call i32 @_ptr_chain_free(i8* %4)
ret void
}

LLVM IR (-O2):
define void @ptr_chain_free(i8* %0) {
%2 = tail call i32 (...) @_clear_error_stack()
%3 = tail call i32 @_ptr_chain_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void f1(char *str1) {
  printf("----------------------------------\n");
  printf("in f1 getted pointer:          %p;\n", str1);
  printf("in f1 getted pointer points to: %s;\n", str1);
  printf("----------------------------------\n");
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xf1b(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"----------------------------------\0A\00"
@.str.1 = [36 x i8] c"in f1 getted pointer: %p;\0A\00"
@.str.2 = [37 x i8] c"in f1 getted pointer points to: %s;\0A\00"
define void @f1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"in f1 getted pointer: %p;\0A\00"
@.str.2 = [37 x i8] c"in f1 getted pointer points to: %s;\0A\00"
@str.3 = [35 x i8] c"----------------------------------\00"
define void @f1(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.3, i64 0, i64 0))
ret void
}
void wpas_p2p_update_best_channels(struct wpa_supplicant *wpa_s, int freq_24,
                                   int freq_5, int freq_overall) {}


x86 assembly (clang, -O0):
<wpas_p2p_update_best_channels>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
define void @wpas_p2p_update_best_channels(%struct.wpa_supplicant* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.wpa_supplicant*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_p2p_update_best_channels(%struct.wpa_supplicant* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
void LinkFloat(void) {
  float a = 0, *b = &a;
  a = *b;
}


x86 assembly (clang, -O0):
<LinkFloat>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @LinkFloat() {
%1 = alloca float
%2 = alloca float*
store float 0.000000e+00, float* %1
store float* %1, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
store float %4, float* %1
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ sem_destroy(int /*<<< orphan*/ *);
void FF_DestroySemaphore(void *pSemaphore) {
  sem_t *pSem = (sem_t *)pSemaphore;
  sem_destroy(pSem);
  free(pSem);
}


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

x86 assembly (clang, -O2):
<FF_DestroySemaphore>:
push   %rbx
mov    %rdi,%rbx
call   1040 <sem_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FF_DestroySemaphore(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @sem_destroy(i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @free(i32* %8)
ret void
}

LLVM IR (-O2):
define void @FF_DestroySemaphore(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @sem_destroy(i32* %2)
%4 = tail call i32 @free(i32* %2)
ret void
}
double mpb_to_bpm(double mpb) { return 60000. / mpb; }


x86 assembly (clang, -O0):
<mpb_to_bpm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpb_to_bpm>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mpb_to_bpm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 6.000000e+04, %3
ret double %4
}

LLVM IR (-O2):
define double @mpb_to_bpm(double %0) {
%2 = fdiv double 6.000000e+04, %0
ret double %2
}
/* Type definitions */
typedef scalar_t__ val;
typedef int uint64_t;

/* Variables and functions */
uint64_t cpu_to_be64(uint64_t val) {
  return (
      (uint64_t)((((uint64_t)(val) & (uint64_t)0x00000000000000ffULL) << 56) |
                 (((uint64_t)(val) & (uint64_t)0x000000000000ff00ULL) << 40) |
                 (((uint64_t)(val) & (uint64_t)0x0000000000ff0000ULL) << 24) |
                 (((uint64_t)(val) & (uint64_t)0x00000000ff000000ULL) << 8) |
                 (((uint64_t)(val) & (uint64_t)0x000000ff00000000ULL) >> 8) |
                 (((uint64_t)(val) & (uint64_t)0x0000ff0000000000ULL) >> 24) |
                 (((uint64_t)(val) & (uint64_t)0x00ff000000000000ULL) >> 40) |
                 (((uint64_t)(val) & (uint64_t)0xff00000000000000ULL) >> 56)));
}


x86 assembly (clang, -O0):
<cpu_to_be64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
and    $0xff00,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x0,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x0,%ecx
sar    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0x0,%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0x0,%edx
mov    $0x38,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cpu_to_be64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 56
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 40
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = shl i32 %11, 24
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = shl i32 %15, 8
%17 = or i32 %13, %16
%18 = load i32, i32* %2
%19 = and i32 %18, 0
%20 = ashr i32 %19, 8
%21 = or i32 %17, %20
%22 = load i32, i32* %2
%23 = and i32 %22, 0
%24 = ashr i32 %23, 24
%25 = or i32 %21, %24
%26 = load i32, i32* %2
%27 = and i32 %26, 0
%28 = ashr i32 %27, 40
%29 = or i32 %25, %28
%30 = load i32, i32* %2
%31 = and i32 %30, 0
%32 = ashr i32 %31, 56
%33 = or i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @cpu_to_be64(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int mini(int, int *);
int /*<<< orphan*/ swapi(int *, int, int /*<<< orphan*/);
void bubblesort(int size, int *v) {
  for (; size > 1; --size, ++v) {
    int max = mini(size, v);
    swapi(v, max, 0);
  }
}


x86 assembly (clang, -O0):
<bubblesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1170 <bubblesort+0x50>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <mini@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1040 <swapi@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <bubblesort+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bubblesort>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1158 <bubblesort+0x38>
mov    %rsi,%rbx
mov    %edi,%r14d
nop
mov    %r14d,%edi
mov    %rbx,%rsi
call   1030 <mini@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <swapi@plt>
lea    -0x1(%r14),%eax
add    $0x4,%rbx
cmp    $0x2,%r14d
mov    %eax,%r14d
ja     1130 <bubblesort+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @bubblesort(i32 %0, i32* %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %0, %2 ]
%6 = phi i32* [ %10, %4 ], [ %1, %2 ]
%7 = tail call i32 @mini(i32 %5, i32* %6)
%8 = tail call i32 @swapi(i32* %6, i32 %7, i32 0)
%9 = add nsw i32 %5, -1
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = icmp ugt i32 %5, 2
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
int DL_BeginDownload(const char *localName, const char *remoteName, int debug) {
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @DL_BeginDownload(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 @DL_BeginDownload(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 1
}
void outportl(unsigned short _port, unsigned int _data) {
  asm volatile("outl %1, %0" ::"dN"(_port), "a"(_data));
}


x86 assembly (clang, -O0):
<outportl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x8(%rbp),%eax
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportl>:
mov    %esi,%eax
mov    %edi,%edx
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @outportl(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @outportl(i16 zeroext %0, i32 %1) {
tail call void asm sideeffect "outl $1, $0", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ base_test();
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
main() {
  int i;
  volatile unsigned long rgmiistatus;
  volatile unsigned long rgmiibuf[256];
  volatile unsigned long *rgmiistatusp = (unsigned long *)0x80001000;
  volatile unsigned long *rgmiiop = (unsigned long *)0x80001400;
  volatile unsigned long *rgmiiip = (unsigned long *)0x80001800;
  report_start();
  base_test();
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
mov    $0x80001000,%eax
mov    %rax,-0x818(%rbp)
mov    $0x80001400,%eax
mov    %rax,-0x820(%rbp)
mov    $0x80001800,%eax
mov    %rax,-0x828(%rbp)
mov    $0x0,%al
call   1050 <report_start@plt>
mov    $0x0,%al
call   1040 <base_test@plt>
mov    $0x0,%al
call   1030 <report_end@plt>
xor    %eax,%eax
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <report_start@plt>
xor    %eax,%eax
call   1040 <base_test@plt>
xor    %eax,%eax
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca [256 x i64]
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
store i64* inttoptr (i64 2147487744 to i64*), i64** %4
store i64* inttoptr (i64 2147488768 to i64*), i64** %5
store i64* inttoptr (i64 2147489792 to i64*), i64** %6
%7 = call i32 (...) @report_start()
%8 = call i32 (...) @base_test()
%9 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @base_test()
%3 = tail call i32 (...) @report_end()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ i;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
size_t write_uint16(FILE *fp, uint16_t i) {
  return fwrite(&i, sizeof(i), 1, fp);
}


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

x86 assembly (clang, -O2):
<write_uint16>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @write_uint16(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 = call i64 @fwrite(i32* %4, i32 4, i32 1, i32* %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @write_uint16(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i64 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("DLLMCFH(clone)\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"DLLMCFH(clone)\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
void gtk_window_set_auto_startup_notification() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_auto_startup_notification() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_display_loc();
void cg_clear_display_loc() { clear_display_loc(); }


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

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

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

LLVM IR (-O2):
define void @cg_clear_display_loc() {
%1 = tail call i32 (...) @clear_display_loc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no)) foo_s64(long long a, long long b) {
  if (a < -b)
    abort();
}


x86 assembly (clang, -O0):
<foo_s64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
cmp    %rcx,%rax
jge    113a <foo_s64+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_s64>:
neg    %rsi
cmp    %rdi,%rsi
jg     1119 <foo_s64+0x9>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo_s64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 0, %6
%8 = icmp slt i64 %5, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo_s64(i64 %0, i64 %1) {
%3 = sub nsw i64 0, %1
%4 = icmp sgt i64 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
scalar_t__ mkdir(char *, int);
int /*<<< orphan*/ printError(char *);
int main(int argc, char **argv) {
  char *fname = *++argv;
  if (mkdir(fname, 0777) < 0) {
    printError(fname);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
jge    116e <main+0x4e>
mov    -0x18(%rbp),%rdi
call   1040 <printError@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
test   %rax,%rax
jns    113f <main+0x1f>
mov    %rbx,%rdi
call   1040 <printError@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i32 1
store i8** %8, i8*** %5
%9 = load i8*, i8** %8
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = call i64 @mkdir(i8* %10, i32 511)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = call i32 @printError(i8* %14)
br label %16
16: ; preds = %13, %2
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @mkdir(i8* %4, i32 511)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @printError(i8* %4)
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
int d_eq_mm1(double *a1, double *a2) { return (((*a1) == (*a2))); }


x86 assembly (clang, -O0):
<d_eq_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_eq_mm1>:
movsd  (%rsi),%xmm0
cmpeqsd (%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_eq_mm1(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* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp oeq double %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_eq_mm1(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp oeq double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strstr(char *, char *);
void uninitvar_strstr(void) {
  char *cs;
  char *ct;
  (void)strstr(cs, ct);
}


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

x86 assembly (clang, -O2):
<uninitvar_strstr>:
jmp    1030 <strstr@plt>

LLVM IR (-O0):
define void @uninitvar_strstr() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strstr(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strstr() {
%1 = tail call i32 @strstr(i8* undef, i8* undef)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t FlashSectorSizeGet(void) {
  uint32_t ui32SectorSizeInKbyte;
  ui32SectorSizeInKbyte =
      ((*((volatile unsigned long *)(0x40030000 + 0x00002430))) & 0x0000000F) >>
      0;
  return (ui32SectorSizeInKbyte * 1024);
}


x86 assembly (clang, -O0):
<FlashSectorSizeGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40032430,%eax
mov    (%rax),%rax
and    $0xf,%rax
shr    $0x0,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashSectorSizeGet>:
mov    0x40032430,%rax
40
and    $0xf,%eax
shl    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @FlashSectorSizeGet() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 1073947696 to i64*)
%3 = and i64 %2, 15
%4 = lshr i64 %3, 0
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = mul nsw i32 %6, 1024
ret i32 %7
}

LLVM IR (-O2):
define i32 @FlashSectorSizeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1073947696 to i64*)
%2 = trunc i64 %1 to i32
%3 = shl i32 %2, 10
%4 = and i32 %3, 15360
ret i32 %4
}
/* Variables and functions */
size_t strlen(char *);
char *strrchr(char *, char);
void remove_newline(char *string) {
  char *newline;
  size_t position;
  size_t cpy_length;
  size_t str_length = strlen(string);
  if (NULL != (newline = strrchr(string, '\n'))) {
    cpy_length = strlen(newline);
    position = str_length - cpy_length;
    string[position] = '\0';
  }
}


x86 assembly (clang, -O0):
<remove_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strrchr@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     117e <remove_newline+0x5e>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_newline>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xa,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1155 <remove_newline+0x35>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
sub    %rax,%rbx
movb   $0x0,(%r14,%rbx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @remove_newline(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %6
%9 = load i8*, i8** %2
%10 = call i8* @strrchr(i8* %9, i8 signext 10)
store i8* %10, i8** %3
%11 = icmp ne i8* null, %10
br i1 %11, label %12, label %21
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i64 @strlen(i8* %13)
store i64 %14, i64* %5
%15 = load i64, i64* %6
%16 = load i64, i64* %5
%17 = sub i64 %15, %16
store i64 %17, i64* %4
%18 = load i8*, i8** %2
%19 = load i64, i64* %4
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 0, i8* %20
br label %21
21: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
define void @remove_newline(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = tail call i64 @strlen(i8* %2)
%7 = sub i64 %5, %6
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %9
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
void getLocaleInfo(char **locale, char **encoding) {
  *locale = NULL;
  *encoding = NULL;
}


x86 assembly (clang, -O0):
<getLocaleInfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLocaleInfo>:
movq   $0x0,(%rdi)
movq   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @getLocaleInfo(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
store i8* null, i8** %5
%6 = load i8**, i8*** %4
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @getLocaleInfo(i8** nocapture writeonly %0, i8** nocapture writeonly %1) {
store i8* null, i8** %0
store i8* null, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mempcpy(int *, int *, int);
void mempcpy9() {
  int a[4] = {0};
  mempcpy(a + 2, a + 1, 4);
  mempcpy(a + 1, a + 2, 4);
}


x86 assembly (clang, -O0):
<mempcpy9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x10(%rbp),%rdi
add    $0x8,%rdi
lea    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    $0x4,%edx
call   1040 <mempcpy@plt>
lea    -0x10(%rbp),%rdi
add    $0x4,%rdi
lea    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    $0x4,%edx
call   1040 <mempcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mempcpy9>:
push   %r14
push   %rbx
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0x8(%rsp),%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <mempcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <mempcpy@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mempcpy9() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = call i32 @mempcpy(i32* %4, i32* %6, i32 4)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = call i32 @mempcpy(i32* %9, i32* %11, i32 4)
ret void
}

LLVM IR (-O2):
define void @mempcpy9() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
%5 = call i32 @mempcpy(i32* %3, i32* %4, i32 4)
%6 = call i32 @mempcpy(i32* %4, i32* %3, i32 4)
ret void
}
adrreg0adrx1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (p0[10000000]) = (((float *)(11111111 & ~(__alignof__(float) - 1)))[x1]); }


x86 assembly (clang, -O0):
<adrreg0adrx1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac4,%eax
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x2625a00(%rax)
02
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adrx1_set>:
movslq %esi,%rax
movss  0xa98ac4(,%rax,4),%xmm0
movss  %xmm0,0x2625a00(%rdx)
02
ret

LLVM IR (-O0):
define i32 @adrreg0adrx1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* inttoptr (i64 11111108 to float*), i64 %17
%19 = load float, float* %18
%20 = load float*, float** %12
%21 = getelementptr inbounds float, float* %20, i64 10000000
store float %19, float* %21
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @adrreg0adrx1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds float, float* inttoptr (i64 11111108 to float*), i64 %7
%9 = load float, float* %8
%10 = getelementptr inbounds float, float* %4, i64 10000000
store float %9, float* %10
ret i32 undef
}