xunge/DecIR huggingface dataset:
/* Variables and functions */
int open(char *, int);
int /*<<< orphan*/ sys_bashfilename(char *, char *);
int binbuf_doopen(char *s, int mode) {
  char namebuf[1000];
  sys_bashfilename(s, namebuf);
  return (open(namebuf, mode));
}


x86 assembly (clang, -O0):
<binbuf_doopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x400(%rbp),%rsi
call   1030 <sys_bashfilename@plt>
lea    -0x400(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <open@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binbuf_doopen>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %esi,%ebx
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <sys_bashfilename@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <open@plt>
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @binbuf_doopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1000 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%8 = call i32 @sys_bashfilename(i8* %6, i8* %7)
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @open(i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @binbuf_doopen(i8* %0, i32 %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @sys_bashfilename(i8* %0, i8* %4)
%6 = call i32 @open(i8* %4, i32 %1)
ret i32 %6
}
void foo() { void *p = foo; }


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

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i8*
store i8* bitcast (void ()* @foo to i8*), i8** %1
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
void SetMainClockToSubOscillator(void) {}


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

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

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

LLVM IR (-O2):
define void @SetMainClockToSubOscillator() {
ret void
}
/* Variables and functions */
scalar_t__ strcoll(char const *, char const *);
int __ltstring(const char *a, const char *b) { return strcoll(a, b) < 0; }


x86 assembly (clang, -O0):
<__ltstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcoll@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ltstring>:
push   %rax
call   1030 <strcoll@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__ltstring(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 i64 @strcoll(i8* %5, i8* %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @__ltstring(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcoll(i8* %0, i8* %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
double sqrt(double);
double dst(double num1, double num2) { return sqrt(num1 * num1 + num2 * num2); }


x86 assembly (clang, -O0):
<dst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dst>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <dst+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @dst(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* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @dst(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
double add(double x, double y) {
  double a = x + y;
  return a;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @add(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @add(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
int madd33(int a, int m, int b, int n, int c, int p) {
  int z;
  z = (a * m) + (b * n) + (c * p);
  return z;
}


x86 assembly (clang, -O0):
<madd33>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
mov    -0x14(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<madd33>:
imul   %esi,%edi
imul   %ecx,%edx
lea    (%rdx,%rdi,1),%eax
imul   %r9d,%r8d
add    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @madd33(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = mul nsw i32 %17, %18
%20 = add nsw i32 %16, %19
%21 = load i32, i32* %11
%22 = load i32, i32* %12
%23 = mul nsw i32 %21, %22
%24 = add nsw i32 %20, %23
store i32 %24, i32* %13
%25 = load i32, i32* %13
ret i32 %25
}

LLVM IR (-O2):
define i32 @madd33(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = mul nsw i32 %1, %0
%8 = mul nsw i32 %3, %2
%9 = add nsw i32 %8, %7
%10 = mul nsw i32 %5, %4
%11 = add nsw i32 %9, %10
ret i32 %11
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned int min_char_or_byte2;
};
typedef TYPE_1__ XFontStruct;

/* Variables and functions */
void set_XFontStruct_min_char_or_byte2(void *_p, unsigned _v) {
  ((XFontStruct *)_p)->min_char_or_byte2 = (unsigned)_v;
}


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

x86 assembly (clang, -O2):
<set_XFontStruct_min_char_or_byte2>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XFontStruct_min_char_or_byte2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XFontStruct_min_char_or_byte2(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void d2a_wait(void) { usleep(100); }


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

x86 assembly (clang, -O2):
<d2a_wait>:
mov    $0x64,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @d2a_wait() {
%1 = call i32 @usleep(i32 100)
ret void
}

LLVM IR (-O2):
define void @d2a_wait() {
%1 = tail call i32 @usleep(i32 100)
ret void
}
puke(s, a) char **s;
{
  char *c;
  while (c = *s++) {
    printf(c, a);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<puke>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1160 <puke+0x50>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111f <puke+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puke>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     115f <puke+0x3f>
mov    %esi,%ebp
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1140 <puke+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @puke(i8** %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
br label %7
7: ; preds = %12, %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i32 1
store i8** %9, i8*** %4
%10 = load i8*, i8** %8
store i8* %10, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i8*, i8** %6
%14 = load i32, i32* %5
%15 = call i32 (i8*, ...) @printf(i8* %13, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
17: ; preds = %7
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @puke(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %11, %5 ], [ %3, %2 ]
%7 = phi i8** [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = tail call i32 (i8*, ...) @printf(i8* %6, i32 %1)
%10 = tail call i32 @putchar(i32 10)
%11 = load i8*, i8** %8
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i32 undef
}
B(x) {
  int y[9949];
  return 3 + x;
}


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

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

LLVM IR (-O0):
define i32 @B(i32 %0) {
%2 = alloca i32
%3 = alloca [9949 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @B(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void DecompressPage(void *cut_start, void *compressed_start, void *page_start,
                    size_t page_size, void *buffer) {
  uint64_t delta = page_start - cut_start;
  void *compressed_page_start = compressed_start + delta;
  memcpy(buffer, compressed_page_start, page_size);
}


x86 assembly (clang, -O0):
<DecompressPage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecompressPage>:
sub    %edi,%edx
movslq %edx,%rax
add    %rax,%rsi
mov    %r8,%rdi
mov    %rcx,%rdx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @DecompressPage(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%13 = load i8*, i8** %8
%14 = load i8*, i8** %6
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
store i32 %18, i32* %11
%19 = load i8*, i8** %7
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
%22 = getelementptr i8, i8* %19, i64 %21
store i8* %22, i8** %12
%23 = load i8*, i8** %10
%24 = load i8*, i8** %12
%25 = load i64, i64* %9
%26 = call i32 @memcpy(i8* %23, i8* %24, i64 %25)
ret void
}

LLVM IR (-O2):
define void @DecompressPage(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = ptrtoint i8* %2 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = shl i64 %8, 32
%10 = ashr exact i64 %9, 32
%11 = getelementptr i8, i8* %1, i64 %10
%12 = tail call i32 @memcpy(i8* %4, i8* %11, i64 %3)
ret void
}
float cap(float a) {
  if (a < 0)
    return 0;
  if (a > 1)
    return 1;
  return a;
}


x86 assembly (clang, -O0):
<cap>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1123 <cap+0x23>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <cap+0x55>
movss  -0x8(%rbp),%xmm0
movss  0xed0(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    114b <cap+0x4b>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <cap+0x55>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cap>:
movss  0xef8(%rip),%xmm1
minss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm2,%xmm0
andnps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @cap(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float 0.000000e+00, float %4
ret float %5
}
void rop3_75_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = *D | stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_75_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_75_1_0>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
and    %sil,%r8b
mov    %esi,%eax
not    %al
or     %al,%cl
xor    %dl,%cl
and    %al,%cl
or     %r8b,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_75_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = and i32 %35, %37
%39 = or i32 %32, %38
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %4
store i8 %40, i8* %41
ret void
}

LLVM IR (-O2):
define void @rop3_75_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %6, %2
%8 = and i8 %5, %1
%9 = and i8 %7, %4
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b, i;
  scanf("%3d%*d%3d%*d", &a, &b);
  printf("%d %d", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%3d%*d%3d%*d\00"
@.str.1 = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
int test_imm_3Fint16_reg(short val) {
  return ((val) & (0x3F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Fint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x3f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Fint16_reg>:
test   $0x3f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Fint16_reg(i16 signext %0) {
%2 = and i16 %0, 63
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int a() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @a() {
ret i32 0
}
/* Variables and functions */
int is_option(char *argv_element, int only) {
  return ((argv_element == NULL) || (argv_element[0] == '-') ||
          (only && argv_element[0] == '+'));
}


x86 assembly (clang, -O0):
<is_option>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1155 <is_option+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0xd(%rbp)
je     1155 <is_option+0x55>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xe(%rbp)
je     114f <is_option+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
sete   %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_option>:
mov    $0x1,%eax
test   %rdi,%rdi
je     111d <is_option+0x1d>
mov    (%rdi),%cl
cmp    $0x2d,%cl
je     111d <is_option+0x1d>
xor    %eax,%eax
test   %esi,%esi
je     111d <is_option+0x1d>
cmp    $0x2b,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @is_option(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %24, label %7
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 45
br i1 %12, label %24, label %13
13: ; preds = %7
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 43
br label %22
22: ; preds = %16, %13
%23 = phi i1 [ false, %13 ], [ %21, %16 ]
br label %24
24: ; preds = %22, %7, %2
%25 = phi i1 [ true, %7 ], [ true, %2 ], [ %23, %22 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_option(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 45
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = icmp eq i32 %1, 0
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp eq i8 %5, 43
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %9, %4, %2
%13 = phi i32 [ 1, %4 ], [ 1, %2 ], [ 0, %7 ], [ %11, %9 ]
ret i32 %13
}
char *strrchr(sp, c)
register const char *sp;
register int c;
{
  register char *r;
  r = 0;
  do {
    if (*sp == c)
      r = (char *)sp;
  } while (*sp++);
  return (r);
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    112b <strrchr+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <strrchr+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi),%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %ecx,%ecx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = phi i8* [ null, %2 ], [ %9, %3 ]
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, %1
%9 = select i1 %8, i8* %4, i8* %5
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = icmp eq i8 %6, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ print_prime_factors(int);
int main(void) {
  print_prime_factors(77);
  print_prime_factors(84);
  print_prime_factors(429496729675917);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print_prime_factors(i32 77)
%3 = call i32 @print_prime_factors(i32 84)
%4 = call i32 @print_prime_factors(i32 75917)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_prime_factors(i32 77)
%2 = tail call i32 @print_prime_factors(i32 84)
%3 = tail call i32 @print_prime_factors(i32 75917)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_illegal_move1();
int /*<<< orphan*/ test_illegal_move2();
int main() {
  test_illegal_move1();
  test_illegal_move2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_illegal_move1()
%2 = tail call i32 (...) @test_illegal_move2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ literal_string_parameter(char *);
void call_literal_string_parameter1_Bad() {
  char *s = "hellp";
  literal_string_parameter(s);
}


x86 assembly (clang, -O0):
<call_literal_string_parameter1_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <literal_string_parameter@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hellp\00"
define void @call_literal_string_parameter1_Bad() {
%1 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @literal_string_parameter(i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hellp\00"
define void @call_literal_string_parameter1_Bad() {
%1 = tail call i32 @literal_string_parameter(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pmod(double, int);
double prutenic_mean_longitude_sol(double days_since_epoch) {
  static double simplex_radix =
      ((272) + (((29) + (((51) + (((32) + (55) / 60.)) / 60.)) / 60.)) / 60.);
  static double simplex_daily =
      ((359) +
       (((44) +
         (((49) +
           (((10) + (((28) + (((28) + (24) / 60.)) / 60.)) / 60.)) / 60.)) /
             60.)) /
           60.) /
      365;
  double mean_longitude =
      pmod(simplex_radix + days_since_epoch * simplex_daily, 360);
  return mean_longitude;
}


x86 assembly (clang, -O0):
<prutenic_mean_longitude_sol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0x2f03(%rip),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0x2efe(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x168,%edi
call   1030 <pmod@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prutenic_mean_longitude_sol>:
mulsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
mov    $0x168,%edi
jmp    1030 <pmod@plt>

LLVM IR (-O0):
@prutenic_mean_longitude_sol.simplex_radix = internal global double 0x407107F6625AC4F6
@prutenic_mean_longitude_sol.simplex_daily = internal global double 0x3FEF8A1A351DFC06
define double @prutenic_mean_longitude_sol(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* @prutenic_mean_longitude_sol.simplex_radix
%5 = load double, double* %2
%6 = load double, double* @prutenic_mean_longitude_sol.simplex_daily
%7 = call double @llvm.fmuladd.f64(double %5, double %6, double %4)
%8 = call double @pmod(double %7, i32 360)
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @prutenic_mean_longitude_sol(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x3FEF8A1A351DFC06, double 0x407107F6625AC4F6)
%3 = tail call double @pmod(double %2, i32 360)
ret double %3
}
void picos_delay(unsigned long cycles) {
  while (cycles != 0)
    cycles--;
}


x86 assembly (clang, -O0):
<picos_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1124 <picos_delay+0x24>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <picos_delay+0x8>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @picos_delay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %6, %1
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i64, i64* %2
%8 = add i64 %7, -1
store i64 %8, i64* %2
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @picos_delay(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fisica_regla1(char const *, char const *, char const *,
                                 char *);
void fisica_regla3(const char *paterno, const char *materno, const char *nombre,
                   char *result) {
  fisica_regla1(paterno, materno, nombre, result);
}


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

x86 assembly (clang, -O2):
<fisica_regla3>:
jmp    1030 <fisica_regla1@plt>

LLVM IR (-O0):
define void @fisica_regla3(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @fisica_regla1(i8* %9, i8* %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @fisica_regla3(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @fisica_regla1(i8* %0, i8* %1, i8* %2, i8* %3)
ret void
}
void SteamAPI_ISteamGameServer_SetHeartbeatInterval(void *self,
                                                    int iHeartbeatInterval) {
  xlogf("%s(self = %p, iHeartbeatInterval = %d)\n", __func__, self,
        iHeartbeatInterval);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamGameServer_SetHeartbeatInterval>:
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee4(%rip),%rdi
lea    0xf05(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"%s(self = %p, iHeartbeatInterval = %d)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetHeartbeatInterval = [47 x i8] c"SteamAPI_ISteamGameServer_SetHeartbeatInterval\00"
define void @SteamAPI_ISteamGameServer_SetHeartbeatInterval(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @__func__.SteamAPI_ISteamGameServer_SetHeartbeatInterval, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"%s(self = %p, iHeartbeatInterval = %d)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetHeartbeatInterval = [47 x i8] c"SteamAPI_ISteamGameServer_SetHeartbeatInterval\00"
define void @SteamAPI_ISteamGameServer_SetHeartbeatInterval(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @__func__.SteamAPI_ISteamGameServer_SetHeartbeatInterval, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void finish_data(void *pr_data) {
  FILE *fp = pr_data;
  fprintf(fp, "  </data>\n");
}


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

x86 assembly (clang, -O2):
<finish_data>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [11 x i8] c" </data>\0A\00"
define void @finish_data(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 @fprintf(i32* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c" </data>\0A\00"
define void @finish_data(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 10, i64 1, i32* %2)
ret void
}
/* Variables and functions */
float sqrtf(float const);
float RcpSqrt(const float x) {
  const float SMALLEST_NON_DENORMAL = 1.1754943508222875e-038f;
  const float rcp = (x >= SMALLEST_NON_DENORMAL) ? 1.0f / sqrtf(x) : 1.0f;
  return rcp;
}


x86 assembly (clang, -O0):
<RcpSqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xec9(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1163 <RcpSqrt+0x53>
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  0xeaf(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1175 <RcpSqrt+0x65>
movss  0xe99(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1175 <RcpSqrt+0x65>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RcpSqrt>:
push   %rax
ucomiss 0xeec(%rip),%xmm0
jae    1124 <RcpSqrt+0x14>
movss  0xede(%rip),%xmm1
jmp    1143 <RcpSqrt+0x33>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1132 <RcpSqrt+0x22>
sqrtss %xmm0,%xmm0
jmp    1137 <RcpSqrt+0x27>
call   1030 <sqrtf@plt>
movss  0xec1(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @RcpSqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
store float 0x3810000000000000, float* %3
%5 = load float, float* %2
%6 = fcmp oge float %5, 0x3810000000000000
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load float, float* %2
%9 = call float @sqrtf(float %8)
%10 = fdiv float 1.000000e+00, %9
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %7
%13 = phi float [ %10, %7 ], [ 1.000000e+00, %11 ]
store float %13, float* %4
%14 = load float, float* %4
ret float %14
}

LLVM IR (-O2):
define float @RcpSqrt(float %0) {
%2 = fcmp ult float %0, 0x3810000000000000
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call float @sqrtf(float %0)
%5 = fdiv float 1.000000e+00, %4
br label %6
6: ; preds = %1, %3
%7 = phi float [ %5, %3 ], [ 1.000000e+00, %1 ]
ret float %7
}
int loader_UNKNOWN_check(const char *filename, unsigned char *data, long size) {
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @loader_UNKNOWN_check(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ bfree(void *);
void *bmalloc(int);
int /*<<< orphan*/ print_buddy();
void test001() {
  void *p1, *p2;
  p1 = bmalloc(4);
  p2 = bmalloc(13);
  bfree(p2);
  bfree(p1);
  print_buddy();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <bmalloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0xd,%edi
call   1030 <bmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <bfree@plt>
mov    -0x8(%rbp),%rdi
call   1040 <bfree@plt>
mov    $0x0,%al
call   1050 <print_buddy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    $0x4,%edi
call   1030 <bmalloc@plt>
mov    %rax,%rbx
mov    $0xd,%edi
call   1030 <bmalloc@plt>
mov    %rax,%rdi
call   1040 <bfree@plt>
mov    %rbx,%rdi
call   1040 <bfree@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <print_buddy@plt>

LLVM IR (-O0):
define void @test001() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @bmalloc(i32 4)
store i8* %3, i8** %1
%4 = call i8* @bmalloc(i32 13)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @bfree(i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @bfree(i8* %7)
%9 = call i32 (...) @print_buddy()
ret void
}

LLVM IR (-O2):
define void @test001() {
%1 = tail call i8* @bmalloc(i32 4)
%2 = tail call i8* @bmalloc(i32 13)
%3 = tail call i32 @bfree(i8* %2)
%4 = tail call i32 @bfree(i8* %1)
%5 = tail call i32 (...) @print_buddy()
ret void
}
int numDigits(int num) {
  int factor = 10;
  int count = 0;
  while (num % factor != num) {
    count++;
    factor = factor * 10;
  }
  return count + 1;
}


x86 assembly (clang, -O0):
<numDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    -0x4(%rbp),%edx
je     113a <numDigits+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <numDigits+0x15>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numDigits>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    $0x1,%ecx
test   %eax,%eax
je     1141 <numDigits+0x41>
mov    $0xa,%esi
mov    $0x1,%ecx
nop
add    %esi,%esi
lea    (%rsi,%rsi,4),%esi
add    $0x1,%ecx
mov    %edi,%eax
cltd
idiv   %esi
cmp    %edi,%edx
jne    1130 <numDigits+0x30>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @numDigits(i32 %0) {
%2 = srem i32 %0, 10
%3 = icmp eq i32 %2, %0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ 10, %1 ]
%7 = mul nuw nsw i32 %6, 10
%8 = add i32 %5, 1
%9 = srem i32 %0, %7
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
void YM2612_writeReg(const unsigned short part, const unsigned char reg,
                     const unsigned char data) {
  volatile unsigned char *pb;
  unsigned short port;
  pb = (unsigned char *)0xA04000;
  port = (part << 1) & 2;
  pb[port + 0] = reg;
  pb[port + 1] = data;
}


x86 assembly (clang, -O0):
<YM2612_writeReg>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
mov    $0xa04000,%eax
mov    %rax,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x1,%eax
and    $0x2,%eax
mov    %ax,-0x12(%rbp)
mov    -0x3(%rbp),%dl
mov    -0x10(%rbp),%rax
movzwl -0x12(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%dl
mov    -0x10(%rbp),%rax
movzwl -0x12(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<YM2612_writeReg>:
and    $0x1,%edi
mov    %sil,0xa04000(%rdi,%rdi,1)
mov    %dl,0xa04001(%rdi,%rdi,1)
ret

LLVM IR (-O0):
define void @YM2612_writeReg(i16 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i16
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i16
store i16 %0, i16* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
store i8* inttoptr (i64 10502144 to i8*), i8** %7
%9 = load i16, i16* %4
%10 = zext i16 %9 to i32
%11 = shl i32 %10, 1
%12 = and i32 %11, 2
%13 = trunc i32 %12 to i16
store i16 %13, i16* %8
%14 = load i8, i8* %5
%15 = load i8*, i8** %7
%16 = load i16, i16* %8
%17 = zext i16 %16 to i32
%18 = add nsw i32 %17, 0
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %15, i64 %19
store volatile i8 %14, i8* %20
%21 = load i8, i8* %6
%22 = load i8*, i8** %7
%23 = load i16, i16* %8
%24 = zext i16 %23 to i32
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %22, i64 %26
store volatile i8 %21, i8* %27
ret void
}

LLVM IR (-O2):
define void @YM2612_writeReg(i16 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = shl i16 %0, 1
%5 = and i16 %4, 2
%6 = zext i16 %5 to i64
%7 = getelementptr inbounds i8, i8* inttoptr (i64 10502144 to i8*), i64 %6
store volatile i8 %1, i8* %7
%8 = or i16 %5, 1
%9 = zext i16 %8 to i64
%10 = getelementptr inbounds i8, i8* inttoptr (i64 10502144 to i8*), i64 %9
store volatile i8 %2, i8* %10
ret void
}
int test_imm_0Duint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x0D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Duint64_midword_mem>:
testb  $0xd,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Duint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 851968
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t oui_append_3o(unsigned char *cp, const unsigned long data) {
  *cp = (data >> 16) & 0xff;
  *(cp + 1) = (data >> 8) & 0xff;
  *(cp + 2) = data & 0xff;
  return 3;
}


x86 assembly (clang, -O0):
<oui_append_3o>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oui_append_3o>:
mov    %rsi,%rax
mov    %rsi,%rcx
shr    $0x10,%rcx
mov    %cl,(%rdi)
mov    %ah,0x1(%rdi)
mov    %al,0x2(%rdi)
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i64 @oui_append_3o(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = lshr i64 %5, 16
%7 = and i64 %6, 255
%8 = trunc i64 %7 to i8
%9 = load i8*, i8** %3
store i8 %8, i8* %9
%10 = load i64, i64* %4
%11 = lshr i64 %10, 8
%12 = and i64 %11, 255
%13 = trunc i64 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i64, i64* %4
%17 = and i64 %16, 255
%18 = trunc i64 %17 to i8
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
ret i64 3
}

LLVM IR (-O2):
define i64 @oui_append_3o(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 16
%4 = trunc i64 %3 to i8
store i8 %4, i8* %0
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = trunc i64 %1 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
ret i64 3
}
void test_synchronize(void) { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @test_synchronize() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @test_synchronize() {
fence seq_cst
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int wcstol(int /*<<< orphan*/ const *, int /*<<< orphan*/ **, int);
int _wtoi(const wchar_t *w) {
  wchar_t *endptr = 0;
  return wcstol(w, &endptr, 10);
}


x86 assembly (clang, -O0):
<_wtoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1030 <wcstol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wtoi>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <wcstol@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_wtoi(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
store i32* null, i32** %3
%4 = load i32*, i32** %2
%5 = call i32 @wcstol(i32* %4, i32** %3, i32 10)
ret i32 %5
}

LLVM IR (-O2):
define i32 @_wtoi(i32* %0) {
%2 = alloca i32*
%3 = bitcast i32** %2 to i8*
store i32* null, i32** %2
%4 = call i32 @wcstol(i32* %0, i32** %2, i32 10)
ret i32 %4
}