xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_EBPSAFE(int);
void window_track_manage_open() { RCT2_CALLPROC_EBPSAFE(0x006D348F); }


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

x86 assembly (clang, -O2):
<window_track_manage_open>:
mov    $0x6d348f,%edi
jmp    1030 <RCT2_CALLPROC_EBPSAFE@plt>

LLVM IR (-O0):
define void @window_track_manage_open() {
%1 = call i32 @RCT2_CALLPROC_EBPSAFE(i32 7156879)
ret void
}

LLVM IR (-O2):
define void @window_track_manage_open() {
%1 = tail call i32 @RCT2_CALLPROC_EBPSAFE(i32 7156879)
ret void
}
/* Variables and functions */
int i2cmaster_ReadN(int /*<<< orphan*/);
unsigned i2c0master_ReadN(void) { return i2cmaster_ReadN(0); }


x86 assembly (clang, -O0):
<i2c0master_ReadN>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <i2cmaster_ReadN@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c0master_ReadN>:
xor    %edi,%edi
jmp    1030 <i2cmaster_ReadN@plt>

LLVM IR (-O0):
define i32 @i2c0master_ReadN() {
%1 = call i32 @i2cmaster_ReadN(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @i2c0master_ReadN() {
%1 = tail call i32 @i2cmaster_ReadN(i32 0)
ret i32 %1
}
const char *eth_capabilities(void) { return "no Ethernet"; }


x86 assembly (clang, -O0):
<eth_capabilities>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eth_capabilities>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"no Ethernet\00"
define i8* @eth_capabilities() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"no Ethernet\00"
define i8* @eth_capabilities() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
int sign(double d) {
  if (d > 0.0)
    return 1;
  if (d < 0.0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1127 <sign+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1148 <sign+0x48>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1141 <sign+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <sign+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void carp_print_license() {
  puts("carp  Copyright (C) 2014  Maxwell Bernstein\n    This program comes "
       "with ABSOLUTELY NO WARRANTY; for details type `carp -w'.\n    This is "
       "free software, and you are welcome to redistribute it\n    under "
       "certain conditions; type `carp -c' for details.");
  puts("See LICENSE.txt or http://www.gnu.org/licenses/gpl-3.0.txt");
}


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

x86 assembly (clang, -O2):
<carp_print_license>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xfd4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [248 x i8] c"carp Copyright (C) 2014 Maxwell Bernstein\0A This program comes with ABSOLUTELY NO WARRANTY; for details type `carp -w'.\0A This is free software, and you are welcome to redistribute it\0A under certain conditions; type `carp -c' for details.\00"
@.str.1 = [59 x i8] c"See LICENSE.txt or http://www.gnu.org/licenses/gpl-3.0.txt\00"
define void @carp_print_license() {
%1 = call i32 @puts(i8* getelementptr inbounds ([248 x i8], [248 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [248 x i8] c"carp Copyright (C) 2014 Maxwell Bernstein\0A This program comes with ABSOLUTELY NO WARRANTY; for details type `carp -w'.\0A This is free software, and you are welcome to redistribute it\0A under certain conditions; type `carp -c' for details.\00"
@.str.1 = [59 x i8] c"See LICENSE.txt or http://www.gnu.org/licenses/gpl-3.0.txt\00"
define void @carp_print_license() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([248 x i8], [248 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int detectPresence(char *);
int playPresent() {
  static int lPlayPresent = -1;
  if (lPlayPresent < 0) {
    lPlayPresent = detectPresence("sox");
  }
  return lPlayPresent;
}


x86 assembly (clang, -O0):
<playPresent>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
jge    1133 <playPresent+0x23>
lea    0xed8(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef5(%rip)
mov    0x2eef(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<playPresent>:
push   %rax
mov    0x2f11(%rip),%eax
test   %eax,%eax
js     111d <playPresent+0xd>
pop    %rcx
ret
lea    0xedc(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef9(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@playPresent.lPlayPresent = internal global i32 -1
@.str = [4 x i8] c"sox\00"
define i32 @playPresent() {
%1 = load i32, i32* @playPresent.lPlayPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @playPresent.lPlayPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @playPresent.lPlayPresent
ret i32 %6
}

LLVM IR (-O2):
@playPresent.lPlayPresent = internal unnamed_addr global i32 -1
@.str = [4 x i8] c"sox\00"
define i32 @playPresent() {
%1 = load i32, i32* @playPresent.lPlayPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @playPresent.lPlayPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
void *_(void *_, void *__) { return __; }


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

x86 assembly (clang, -O2):
<_>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @_(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @_(i8* nocapture readnone %0, i8* readnone returned %1) {
ret i8* %1
}
void tr(char *str, char from, char to) {
  for (; *str; str++)
    if (*str == from)
      *str = to;
}


x86 assembly (clang, -O0):
<tr>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <tr+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113c <tr+0x3c>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1141 <tr+0x41>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <tr+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tr>:
mov    (%rdi),%al
test   %al,%al
je     1125 <tr+0x25>
add    $0x1,%rdi
jmp    111b <tr+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <tr+0x25>
cmp    %sil,%al
jne    1110 <tr+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <tr+0x10>
ret

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

LLVM IR (-O2):
define void @tr(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
int HelpItem45(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem45() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cs2scb(void *);
void cs2scb_(void *icbfn) { cs2scb(icbfn); }


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

x86 assembly (clang, -O2):
<cs2scb_>:
jmp    1030 <cs2scb@plt>

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

LLVM IR (-O2):
define void @cs2scb_(i8* %0) {
%2 = tail call i32 @cs2scb(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_uint_helper(unsigned int);
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void print_uint(unsigned int u) {
  if (u == 0)
    putchar('0');
  else
    print_uint_helper(u);
}


x86 assembly (clang, -O0):
<print_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1144 <print_uint+0x24>
mov    $0x30,%edi
call   1030 <putchar@plt>
jmp    114c <print_uint+0x2c>
mov    -0x4(%rbp),%edi
call   1040 <print_uint_helper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uint>:
test   %edi,%edi
je     1129 <print_uint+0x9>
jmp    1040 <print_uint_helper@plt>
mov    $0x30,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @print_uint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @putchar(i32 48)
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @print_uint_helper(i32 %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @print_uint(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @putchar(i32 48)
br label %7
5: ; preds = %1
%6 = tail call i32 @print_uint_helper(i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int memcmp(char const *, char const *, int);
int hashsg_cmp(const char *s1, const char *s2) { return memcmp(s1, s2, 20); }


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

x86 assembly (clang, -O2):
<hashsg_cmp>:
mov    $0x14,%edx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define i32 @hashsg_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @memcmp(i8* %5, i8* %6, i32 20)
ret i32 %7
}

LLVM IR (-O2):
define i32 @hashsg_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 20)
ret i32 %3
}
/* Variables and functions */
double fabs(double const);
double huber(const double x) {
  const double ax = fabs(x);
  if (ax <= 1.0)
    return 1.0;
  else
    return (1.0 / ax);
}


x86 assembly (clang, -O0):
<huber>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xefb(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeda(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1143 <huber+0x43>
movsd  0xec7(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <huber+0x55>
movsd  0xeb5(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<huber>:
andpd  0xef8(%rip),%xmm0
movsd  0xf00(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1122 <huber+0x22>
movsd  0xef2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @huber(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = call double @llvm.fabs.f64(double %5)
store double %6, double* %4
%7 = load double, double* %4
%8 = fcmp ole double %7, 1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %1
store double 1.000000e+00, double* %2
br label %13
10: ; preds = %1
%11 = load double, double* %4
%12 = fdiv double 1.000000e+00, %11
store double %12, double* %2
br label %13
13: ; preds = %10, %9
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @huber(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp ugt double %2, 1.000000e+00
%4 = fdiv double 1.000000e+00, %2
%5 = select i1 %3, double %4, double 1.000000e+00
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t be32_to_cpu(uint32_t be_val) { return be_val; }


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

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

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

LLVM IR (-O2):
define i32 @be32_to_cpu(i32 returned %0) {
ret i32 %0
}
char *getDasdPorts() { return 0; }


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

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

LLVM IR (-O0):
define i8* @getDasdPorts() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @getDasdPorts() {
ret i8* null
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t shl(uint64_t n, unsigned amt) {
  if (amt == 64) {
    return 0;
  }
  return n << amt;
}


x86 assembly (clang, -O0):
<shl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jne    1120 <shl+0x20>
movl   $0x0,-0x4(%rbp)
jmp    112b <shl+0x2b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl>:
mov    %esi,%ecx
shl    %cl,%edi
xor    %eax,%eax
cmp    $0x40,%esi
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @shl(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, 64
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @shl(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 64
%4 = shl i32 %0, %1
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ delay_us(float);
void delay(float time) { delay_us(time * 1000000.0); }


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mulss  0xee8(%rip),%xmm0
jmp    1030 <delay_us@plt>

LLVM IR (-O0):
define void @delay(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 1.000000e+06
%6 = fptrunc double %5 to float
%7 = call i32 @delay_us(float %6)
ret void
}

LLVM IR (-O2):
define void @delay(float %0) {
%2 = fmul float %0, 1.000000e+06
%3 = tail call i32 @delay_us(float %2)
ret void
}
/* Type definitions */
typedef char *__m128i;

/* Variables and functions */
char *_mm_mul_epu32(char *, char *);
__m128i __attribute__((no, unused)) test(__m128i s1, __m128i s2) {
  __asm("" : "+v"(s1), "+v"(s2));
  return _mm_mul_epu32(s1, s2);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
movq   %rcx,%xmm0
movq   %rax,%xmm1
movq   %xmm1,%rax
movq   %xmm0,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_mm_mul_epu32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
movq   %rdi,%xmm0
movq   %rsi,%xmm1
movq   %xmm0,%rdi
movq   %xmm1,%rsi
jmp    1030 <_mm_mul_epu32@plt>

LLVM IR (-O0):
define i8* @test(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call { i8*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %5, i8* %6)
%8 = extractvalue { i8*, i8* } %7, 0
%9 = extractvalue { i8*, i8* } %7, 1
store i8* %8, i8** %3
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i8* @_mm_mul_epu32(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @test(i8* %0, i8* %1) {
%3 = tail call { i8*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i8*, i8* } %3, 0
%5 = extractvalue { i8*, i8* } %3, 1
%6 = tail call i8* @_mm_mul_epu32(i8* %4, i8* %5)
ret i8* %6
}
void SteamAPI_ISteamHTMLSurface_ViewSource(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamHTMLSurface_ViewSource>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_ViewSource = [38 x i8] c"SteamAPI_ISteamHTMLSurface_ViewSource\00"
define void @SteamAPI_ISteamHTMLSurface_ViewSource(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_ViewSource, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_ViewSource = [38 x i8] c"SteamAPI_ISteamHTMLSurface_ViewSource\00"
define void @SteamAPI_ISteamHTMLSurface_ViewSource(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_ViewSource, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put_string(char const *);
int puts(const char *str) {
  put_string(str);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @put_string(i8* %0)
ret i32 0
}
int foo(int x) {
  int y = x + 3;
  int z = y + x;
  return z + x;
}


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

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rdi,2),%eax
add    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = shl i32 %0, 1
%3 = add i32 %0, 3
%4 = add i32 %3, %2
ret i32 %4
}
/* Type definitions */
typedef int ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
void check(void *a) {
  if (((ptrdiff_t)a & (32 - 1)) != 0)
    abort();
}


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

x86 assembly (clang, -O2):
<check>:
test   $0x1f,%dil
jne    1117 <check+0x7>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @check(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 31
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
double __nv_fma_rz(double, double, double);
double __fma_rz(double __a, double __b, double __c) {
  return __nv_fma_rz(__a, __b, __c);
}


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

x86 assembly (clang, -O2):
<__fma_rz>:
jmp    1030 <__nv_fma_rz@plt>

LLVM IR (-O0):
define double @__fma_rz(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 @__nv_fma_rz(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @__fma_rz(double %0, double %1, double %2) {
%4 = tail call double @__nv_fma_rz(double %0, double %1, double %2)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
void dgram_reset_rcv_timeout(BIO *b) {}


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

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

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

LLVM IR (-O2):
define void @dgram_reset_rcv_timeout(i32* nocapture %0) {
ret void
}
void nand_chip_disable(void) {
  (*(volatile unsigned int *)0x4E000004) |= (1 << 1);
}


x86 assembly (clang, -O0):
<nand_chip_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e000004,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0x4e000004,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_chip_disable>:
orl    $0x2,0x4e000004
02
ret

LLVM IR (-O0):
define void @nand_chip_disable() {
%1 = load volatile i32, i32* inttoptr (i64 1308622852 to i32*)
%2 = or i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 1308622852 to i32*)
ret void
}

LLVM IR (-O2):
define void @nand_chip_disable() {
%1 = load volatile i32, i32* inttoptr (i64 1308622852 to i32*)
%2 = or i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 1308622852 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ map_islegalvert(int);
int marker_down(int pos) {
  do {
    pos += 6;
    if (pos > 63)
      pos -= 60;
  } while (!map_islegalvert(pos));
  return pos;
}


x86 assembly (clang, -O0):
<marker_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x3f,-0x4(%rbp)
jle    1137 <marker_down+0x27>
mov    -0x4(%rbp),%eax
sub    $0x3c,%eax
mov    %eax,-0x4(%rbp)
jmp    113c <marker_down+0x2c>
mov    -0x4(%rbp),%edi
call   1030 <map_islegalvert@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    111b <marker_down+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<marker_down>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x6(%rbx),%eax
cmp    $0x3a,%ebx
lea    -0x36(%rbx),%ecx
mov    %ecx,%ebx
cmovl  %eax,%ebx
mov    %ebx,%edi
call   1030 <map_islegalvert@plt>
test   %eax,%eax
je     1120 <marker_down+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @marker_down(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %12, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 6
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 63
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 60
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %3
br label %12
12: ; preds = %11
%13 = load i32, i32* %2
%14 = call i32 @map_islegalvert(i32 %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %3, label %17
17: ; preds = %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @marker_down(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = icmp sgt i32 %3, 57
%5 = select i1 %4, i32 -54, i32 6
%6 = add nsw i32 %5, %3
%7 = tail call i32 @map_islegalvert(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 %6
}
unsigned int min(unsigned int a, unsigned int b) {
  if (a <= b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
ja     1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmova  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *,
                           char const *);
void write_po(FILE *po, const char *what, const char *s) {
  fprintf(po, "%s \"%s\"\n", what, s);
}


x86 assembly (clang, -O0):
<write_po>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_po>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s \22%s\22\0A\00"
define void @write_po(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s \22%s\22\0A\00"
define void @write_po(i32* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("\a");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"\07\00"
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 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 7)
ret i32 0
}
int xmlNop(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @xmlNop() {
ret i32 0
}
/* Variables and functions */
void *OP1_TYPECAST(void *);
void *OP2_TYPECAST(void *);
void *op_DIV(void *inp1, void *inp2) {
  inp1 = OP1_TYPECAST(inp1);
  inp2 = OP2_TYPECAST(inp2);
  int first = (int)inp1;
  int second = (int)inp2;
  return (void *)(first / second);
}


x86 assembly (clang, -O0):
<op_DIV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <OP1_TYPECAST@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <OP2_TYPECAST@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_DIV>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <OP1_TYPECAST@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <OP2_TYPECAST@plt>
mov    %rax,%rcx
mov    %r14d,%eax
cltd
idiv   %ecx
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @op_DIV(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @OP1_TYPECAST(i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %4
%10 = call i8* @OP2_TYPECAST(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %3
%12 = ptrtoint i8* %11 to i32
store i32 %12, i32* %5
%13 = load i8*, i8** %4
%14 = ptrtoint i8* %13 to i32
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = sdiv i32 %15, %16
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i8*
ret i8* %19
}

LLVM IR (-O2):
define i8* @op_DIV(i8* %0, i8* %1) {
%3 = tail call i8* @OP1_TYPECAST(i8* %0)
%4 = tail call i8* @OP2_TYPECAST(i8* %1)
%5 = ptrtoint i8* %3 to i64
%6 = trunc i64 %5 to i32
%7 = ptrtoint i8* %4 to i64
%8 = trunc i64 %7 to i32
%9 = sdiv i32 %6, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *const);
int system(char *);
char *tbz_escape_argv(char *, int, char *const *);
int main(int argc, char *const argv[]) {
  printf("Playing %s...\n", argv[0]);
  char *command = tbz_escape_argv("mpv", argc, argv);
  return system(command);
}


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),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xea8(%rip),%rdi
call   1050 <tbz_escape_argv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <system@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rsi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1050 <tbz_escape_argv@plt>
mov    %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Playing %s...\0A\00"
@.str.1 = [4 x i8] c"mpv\00"
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, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i8* @tbz_escape_argv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11, i8** %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = call i32 @system(i8* %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [15 x i8] c"Playing %s...\0A\00"
@.str.1 = [4 x i8] c"mpv\00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i8* @tbz_escape_argv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8** %1)
%6 = tail call i32 @system(i8* %5)
ret i32 %6
}
/* Variables and functions */
size_t utf8_strlen(char *s) {
  size_t i = 0, j = 0;
  while (s[i]) {
    if ((s[i] & 0xc0) != 0x80)
      j++;
    i++;
  }
  return j;
}


x86 assembly (clang, -O0):
<utf8_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1163 <utf8_strlen+0x63>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1152 <utf8_strlen+0x52>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <utf8_strlen+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_strlen>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <utf8_strlen+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
and    $0xc0,%cl
xor    %edx,%edx
cmp    $0x80,%cl
setne  %dl
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <utf8_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @utf8_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i64 [ %12, %4 ], [ 0, %1 ]
%8 = and i8 %5, -64
%9 = icmp ne i8 %8, -128
%10 = zext i1 %9 to i64
%11 = add i64 %6, %10
%12 = add i64 %7, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %17
}
char *isbigendian() {
  union {
    long l;
    char c[sizeof(long)];
  } u;
  u.l = 1;
  return (u.c[0] == 1) ? "no" : "yes";
}


x86 assembly (clang, -O0):
<isbigendian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%edx
lea    0xeec(%rip),%rax
lea    0xee2(%rip),%rcx
cmp    $0x1,%edx
cmove  %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbigendian>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%union.anon = type { i64 }
@.str = [3 x i8] c"no\00"
@.str.1 = [4 x i8] c"yes\00"
define i8* @isbigendian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i64*
store i64 1, i64* %2
%3 = bitcast %union.anon* %1 to [8 x i8]*
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"no\00"
define i8* @isbigendian() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ writeVAC(int, int);
void SetupUART(void) {
  writeVAC(0x1d, 0x77d0);
  writeVAC(0x1e, 7);
  writeVAC(0x1e, 7);
  writeVAC(0x1d, 0x77c0);
}


x86 assembly (clang, -O0):
<SetupUART>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1d,%edi
mov    $0x77d0,%esi
call   1030 <writeVAC@plt>
mov    $0x1e,%edi
mov    $0x7,%esi
call   1030 <writeVAC@plt>
mov    $0x1e,%edi
mov    $0x7,%esi
call   1030 <writeVAC@plt>
mov    $0x1d,%edi
mov    $0x77c0,%esi
call   1030 <writeVAC@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetupUART>:
push   %rax
mov    $0x1d,%edi
mov    $0x77d0,%esi
call   1030 <writeVAC@plt>
mov    $0x1e,%edi
mov    $0x7,%esi
call   1030 <writeVAC@plt>
mov    $0x1e,%edi
mov    $0x7,%esi
call   1030 <writeVAC@plt>
mov    $0x1d,%edi
mov    $0x77c0,%esi
pop    %rax
jmp    1030 <writeVAC@plt>

LLVM IR (-O0):
define void @SetupUART() {
%1 = call i32 @writeVAC(i32 29, i32 30672)
%2 = call i32 @writeVAC(i32 30, i32 7)
%3 = call i32 @writeVAC(i32 30, i32 7)
%4 = call i32 @writeVAC(i32 29, i32 30656)
ret void
}

LLVM IR (-O2):
define void @SetupUART() {
%1 = tail call i32 @writeVAC(i32 29, i32 30672)
%2 = tail call i32 @writeVAC(i32 30, i32 7)
%3 = tail call i32 @writeVAC(i32 30, i32 7)
%4 = tail call i32 @writeVAC(i32 29, i32 30656)
ret void
}
void path_sanitize(char *str) { (void)str; }


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

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

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

LLVM IR (-O2):
define void @path_sanitize(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef char GLubyte;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
char *gluErrorString(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void quadric_errorCallback(GLenum errorCode) {
  const GLubyte *estring;
  estring = gluErrorString(errorCode);
  fprintf(stderr, "Quadric Error: %s\n", estring);
  exit(0);
}


x86 assembly (clang, -O0):
<quadric_errorCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <gluErrorString@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<quadric_errorCallback>:
push   %rax
call   1040 <gluErrorString@plt>
mov    0x2ea3(%rip),%rcx
mov    (%rcx),%edi
lea    0xeba(%rip),%rsi
mov    %rax,%rdx
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Quadric Error: %s\0A\00"
define void @quadric_errorCallback(i32 %0) {
%2 = tail call i8* @gluErrorString(i32 %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_square_set_current(int);
int roadmap_square_first_point(int square) {
  roadmap_square_set_current(square);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @roadmap_square_first_point(i32 %0) {
%2 = tail call i32 @roadmap_square_set_current(i32 %0)
ret i32 0
}
int f3(int *p, int i) { return p[i]; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @f3(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f3(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int SDL_imageFilterMeanMMX(unsigned char *Src1, unsigned char *Src2,
                           unsigned char *Dest, unsigned int SrcLength,
                           unsigned char *Mask) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterMeanMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterMeanMMX(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
ret i32 -1
}

LLVM IR (-O2):
define i32 @SDL_imageFilterMeanMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4) {
ret i32 -1
}
int Bematech_FI_Moeda(Var, Retorno) {
  return Formata("\x1b|35|16|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_Moeda>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_Moeda>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B|35|16|\1B\00"
define i32 @Bematech_FI_Moeda(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 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|35|16|\1B\00"
define i32 @Bematech_FI_Moeda(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
void I422ToUYVYRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @I422ToUYVYRow_Any_SSE2() {
ret void
}
int *fk_sleep_enabled() {
  static int enabled = 1;
  return &enabled;
}


x86 assembly (clang, -O0):
<fk_sleep_enabled>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fk_sleep_enabled>:
lea    0x2f19(%rip),%rax
ret

LLVM IR (-O0):
@fk_sleep_enabled.enabled = internal global i32 1
define i32* @fk_sleep_enabled() {
ret i32* @fk_sleep_enabled.enabled
}

LLVM IR (-O2):
@fk_sleep_enabled.enabled = internal global i32 1
define i32* @fk_sleep_enabled() {
ret i32* @fk_sleep_enabled.enabled
}