xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ readIntoBuffer(int /*<<< orphan*/ *);
void lexer() {
  FILE *fp;
  fp = fopen("testing.txt", "r");
  readIntoBuffer(fp);
}


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

x86 assembly (clang, -O2):
<lexer>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <readIntoBuffer@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"testing.txt\00"
@.str.1 = [2 x i8] c"r\00"
define void @lexer() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @readIntoBuffer(i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"testing.txt\00"
@.str.1 = [2 x i8] c"r\00"
define void @lexer() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @readIntoBuffer(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
char *realloc(char *, int);
char *sm_realloc(char *p, int n) {
  p = realloc(p, n);
  if (p == NULL)
    error("out of memory\n");
  return (p);
}


x86 assembly (clang, -O0):
<sm_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <sm_realloc+0x36>
lea    0xeaf(%rip),%rdi
call   1040 <error@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sm_realloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <sm_realloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @sm_realloc(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 i8* @realloc(i8* %5, i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @sm_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ system(char *);
int main() {
  chdir("/mnt/user/code/Events/bin");
  system("/mnt/user/jvm/java Main");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <chdir@plt>
lea    0xee3(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <chdir@plt>
lea    0xee6(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"/mnt/user/code/Events/bin\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @chdir(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"/mnt/user/code/Events/bin\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @chdir(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void exch2(int *a, int *b) {
  *a = *a ^ *b;
  *b = *a ^ *b;
  *a = *a ^ *b;
}


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

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

LLVM IR (-O0):
define void @exch2(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = xor i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = xor i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = xor i32 %18, %20
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @exch2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = xor i32 %8, %7
store i32 %9, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AllocateDatabaseGlobal();
int /*<<< orphan*/ InitializeGlobals();
int /*<<< orphan*/ MotifGlobalInitialize();
int /*<<< orphan*/ PlotInit();
void AllocateSubStructures(void) {
  PlotInit();
  AllocateDatabaseGlobal();
  MotifGlobalInitialize();
  InitializeGlobals();
}


x86 assembly (clang, -O0):
<AllocateSubStructures>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <PlotInit@plt>
mov    $0x0,%al
call   1030 <AllocateDatabaseGlobal@plt>
mov    $0x0,%al
call   1050 <MotifGlobalInitialize@plt>
mov    $0x0,%al
call   1060 <InitializeGlobals@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AllocateSubStructures>:
push   %rax
xor    %eax,%eax
call   1040 <PlotInit@plt>
xor    %eax,%eax
call   1030 <AllocateDatabaseGlobal@plt>
xor    %eax,%eax
call   1050 <MotifGlobalInitialize@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <InitializeGlobals@plt>

LLVM IR (-O0):
define void @AllocateSubStructures() {
%1 = call i32 (...) @PlotInit()
%2 = call i32 (...) @AllocateDatabaseGlobal()
%3 = call i32 (...) @MotifGlobalInitialize()
%4 = call i32 (...) @InitializeGlobals()
ret void
}

LLVM IR (-O2):
define void @AllocateSubStructures() {
%1 = tail call i32 (...) @PlotInit()
%2 = tail call i32 (...) @AllocateDatabaseGlobal()
%3 = tail call i32 (...) @MotifGlobalInitialize()
%4 = tail call i32 (...) @InitializeGlobals()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int HashKey(char);
void Add(uint8_t table[], char c) {
  int index;
  index = HashKey(c);
  table[index]++;
}


x86 assembly (clang, -O0):
<Add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <HashKey@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Add>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <HashKey@plt>
cltq
addl   $0x1,(%rbx,%rax,4)
pop    %rbx
ret

LLVM IR (-O0):
define void @Add(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
store i32* %0, i32** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = call i32 @HashKey(i8 signext %6)
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @Add(i32* nocapture %0, i8 signext %1) {
%3 = tail call i32 @HashKey(i8 signext %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
ret void
}
R0AX1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if (r0 <= (((double *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0AX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm1
movslq -0x20(%rbp),%rcx
mov    $0xa98ac7,%eax
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     1145 <R0AX1+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <R0AX1+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0AX1>:
movslq %esi,%rax
movsd  0xa98ac7(,%rax,8),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @R0AX1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* %8
%15 = load i32, i32* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %16
%18 = load double, double* %17
%19 = fcmp ole double %14, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @R0AX1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %7
%9 = load double, double* %8
%10 = fcmp oge double %9, %0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t QEIVelocityGet(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x4002C000) || (ui32Base == 0x4002D000));
  return ((*((volatile uint32_t *)(ui32Base + 0x0000001C))));
}


x86 assembly (clang, -O0):
<QEIVelocityGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x4002c000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <QEIVelocityGet+0x2a>
cmpl   $0x4002d000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x1c,%eax
cltq
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIVelocityGet>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x4002c000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x1c(%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @QEIVelocityGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073922048
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073926144
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 28
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @QEIVelocityGet(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073922048
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 28
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
ret i32 %9
}
/* Variables and functions */
char *malloc(int);
char *char_to_str(char src) {
  char *ret = malloc(sizeof(char) * 2);
  *ret = src;
  *(ret + 1) = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<char_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_str>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %bl,(%rax)
movb   $0x0,0x1(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @char_to_str(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = call i8* @malloc(i32 2)
store i8* %4, i8** %3
%5 = load i8, i8* %2
%6 = load i8*, i8** %3
store i8 %5, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %8
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @char_to_str(i8 signext %0) {
%2 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
store i8 %0, i8* %2
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %3
ret i8* %2
}
void hal_debug_init_rcc(void) {}


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

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

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

LLVM IR (-O2):
define void @hal_debug_init_rcc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void ec_bad_exit(char *msg) {
  (void)write(2, msg, strlen(msg));
  (void)write(2, "\n", 1);
  exit(-1);
}


x86 assembly (clang, -O0):
<ec_bad_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x2,%edi
lea    0xe97(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<ec_bad_exit>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xeb1(%rip),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ec_bad_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
%7 = call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ec_bad_exit(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
%4 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
void RTAvlGCPhysRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlGCPhysRemove() {
ret void
}
/* Variables and functions */
int owTouchBits(int, int, int, int);
int owTouchByte(int portnum, int sendbyte) {
  return owTouchBits(portnum, 5, 8, sendbyte);
}


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

x86 assembly (clang, -O2):
<owTouchByte>:
mov    %esi,%ecx
mov    $0x5,%esi
mov    $0x8,%edx
jmp    1030 <owTouchBits@plt>

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

LLVM IR (-O2):
define i32 @owTouchByte(i32 %0, i32 %1) {
%3 = tail call i32 @owTouchBits(i32 %0, i32 5, i32 8, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int w, h;
  scanf("%d%d", &w, &h);
  printf("%.1f", 10000. * w / (h * h));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xeb0(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm0
mulsd  0xebd(%rip),%xmm0
mov    (%rsp),%eax
imul   %eax,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [5 x i8] c"%.1f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = fmul double 1.000000e+04, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %7, %11
%13 = fptosi double %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [5 x i8] c"%.1f\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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 1.000000e+04
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %8, %11
%13 = fptosi double %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}
char *langRomTypePlayBall() { return "Sony Playball"; }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Sony Playball\00"
define i8* @langRomTypePlayBall() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"Sony Playball\00"
define i8* @langRomTypePlayBall() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
int f3(int x, int y) {
  return ((x & (-0x7fffffff - 1)) ^ (-0x7fffffff - 1)) ==
         ((y & (-0x7fffffff - 1)) ^ (-0x7fffffff - 1));
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80000000,%eax
xor    $0x80000000,%eax
mov    -0x8(%rbp),%ecx
and    $0x80000000,%ecx
xor    $0x80000000,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %edi,%eax
xor    %esi,%eax
not    %eax
shr    $0x1f,%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 = and i32 %5, -2147483648
%7 = xor i32 %6, -2147483648
%8 = load i32, i32* %4
%9 = and i32 %8, -2147483648
%10 = xor i32 %9, -2147483648
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i32 %1) {
%3 = xor i32 %0, %1
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
/* Variables and functions */
char *strchr(char const *, int);
int strpos(const char *s, int c) {
  char *p = strchr(s, c);
  if (p)
    return (p - s);
  return -1;
}


x86 assembly (clang, -O0):
<strpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114d <strpos+0x3d>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1154 <strpos+0x44>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @strpos(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
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i8* @strchr(i8* %7, i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %19
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%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* %3
br label %20
19: ; preds = %2
store i32 -1, i32* %3
br label %20
20: ; preds = %19, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @strpos(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int btest_l(int *, int *);
int intr_wrap_504(int p1, int p2) { return btest_l(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_504>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <btest_l@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_504>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <btest_l@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @intr_wrap_504(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @btest_l(i32* %3, i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @intr_wrap_504(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @btest_l(i32* %3, i32* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SUB_HOST_REG_L(int, int);
int CMP_HOST_REG_L(int dst_reg, int src_reg) {
  SUB_HOST_REG_L(dst_reg, src_reg);
  return dst_reg;
}


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

x86 assembly (clang, -O2):
<CMP_HOST_REG_L>:
push   %rbx
mov    %edi,%ebx
call   1030 <SUB_HOST_REG_L@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CMP_HOST_REG_L(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 @SUB_HOST_REG_L(i32 %5, i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @CMP_HOST_REG_L(i32 returned %0, i32 %1) {
%3 = tail call i32 @SUB_HOST_REG_L(i32 %0, i32 %1)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *);
void usage(void) {
  extern char *__progname;
  fatal("Usage: %s [-v]\n", __progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%rsi
lea    0xedb(%rip),%rdi
call   1030 <fatal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%rsi
lea    0xedf(%rip),%rdi
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Usage: %s [-v]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i8*, i8** @__progname
%2 = call i32 @fatal(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Usage: %s [-v]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i8*, i8** @__progname
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void foo_2_2_2_2_2_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_2_2_1_2_2() {
ret void
}
double JHKeyframeAnimationFunctionEaseInCubic(double t, double b, double c,
                                              double d) {
  return c * (t /= d) * t * t + b;
}


x86 assembly (clang, -O0):
<JHKeyframeAnimationFunctionEaseInCubic>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,-0x8(%rbp)
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<JHKeyframeAnimationFunctionEaseInCubic>:
divsd  %xmm3,%xmm0
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @JHKeyframeAnimationFunctionEaseInCubic(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = load double, double* %5
%12 = fdiv double %11, %10
store double %12, double* %5
%13 = fmul double %9, %12
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = load double, double* %5
%17 = load double, double* %6
%18 = call double @llvm.fmuladd.f64(double %15, double %16, double %17)
ret double %18
}

LLVM IR (-O2):
define double @JHKeyframeAnimationFunctionEaseInCubic(double %0, double %1, double %2, double %3) {
%5 = fdiv double %0, %3
%6 = fmul double %5, %2
%7 = fmul double %5, %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double %5, double %1)
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *fgets_unlocked(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ flockfile(int /*<<< orphan*/ *);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/ *);
char *fgets(char *restrict buffer, int size, FILE *restrict file) {
  flockfile(file);
  char *result = fgets_unlocked(buffer, size, file);
  funlockfile(file);
  return result;
}


x86 assembly (clang, -O0):
<fgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <flockfile@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1050 <fgets_unlocked@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <funlockfile@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1040 <flockfile@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1050 <fgets_unlocked@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <funlockfile@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @fgets(i8* noalias %0, i32 %1, i32* noalias %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = call i32 @flockfile(i32* %8)
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i32*, i32** %6
%13 = call i8* @fgets_unlocked(i8* %10, i32 %11, i32* %12)
store i8* %13, i8** %7
%14 = load i32*, i32** %6
%15 = call i32 @funlockfile(i32* %14)
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
define i8* @fgets(i8* noalias %0, i32 %1, i32* noalias nocapture %2) {
%4 = tail call i32 @flockfile(i32* %2)
%5 = tail call i8* @fgets_unlocked(i8* %0, i32 %1, i32* %2)
%6 = tail call i32 @funlockfile(i32* %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void putint(int x) { printf("%d", x); }


x86 assembly (clang, -O0):
<putint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putint>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @putint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int is_blank(int c) { return (c == ' ' || c == '\t'); }


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

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

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

LLVM IR (-O2):
define i32 @is_blank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int any(int ch, const char str[]) {
  register int c = ch;
  register const char *cp = str;
  while (*cp)
    if (*cp++ == c)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<any>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <any+0x52>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    114d <any+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1159 <any+0x59>
jmp    1119 <any+0x19>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any>:
movsbl (%rsi),%eax
test   %eax,%eax
je     1115 <any+0x15>
add    $0x1,%rsi
cmp    %edi,%eax
jne    1100 <any>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @any(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = sext i8 %5 to i32
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr,
                          size_t stacksize) {
  ;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_setstack(i32* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ __le64;

/* Variables and functions */
void *nla_reserve(void **, int, int);
void nla_put_le64(void **ctx, int t, __le64 var) {
  void *data = nla_reserve(ctx, t, sizeof(__le64));
  *(__le64 *)data = var;
}


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

x86 assembly (clang, -O2):
<nla_put_le64>:
push   %rbx
mov    %edx,%ebx
mov    $0x4,%edx
call   1030 <nla_reserve@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @nla_put_le64(i8** %0, i32 %1, i32 %2) {
%4 = tail call i8* @nla_reserve(i8** %0, i32 %1, i32 4)
%5 = bitcast i8* %4 to i32*
store i32 %2, i32* %5
ret void
}
int fusion_double_read(double *p) { return p[0x12345]; }


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

x86 assembly (clang, -O2):
<fusion_double_read>:
cvttsd2si 0x91a28(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @fusion_double_read(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 74565
%5 = load double, double* %4
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @fusion_double_read(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 74565
%3 = load double, double* %2
%4 = fptosi double %3 to i32
ret i32 %4
}
int test_imm_D2uint16_mem(unsigned short *val) {
  return ((*val) & (0xD2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D2uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xd2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_D2uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 210
%7 = icmp ne i32 %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_D2uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 210
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void I444ToARGBRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @I444ToARGBRow_Any_AVX2() {
ret void
}
const char *simplify_path(const char *file) {
  while (file) {
    char c = file[0];
    if ((c != '.') && (c != '/') && (c != '\\'))
      break;
    file++;
  }
  return file;
}


x86 assembly (clang, -O0):
<simplify_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <simplify_path+0x59>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x2e,%eax
je     1148 <simplify_path+0x48>
movsbl -0x9(%rbp),%eax
cmp    $0x2f,%eax
je     1148 <simplify_path+0x48>
movsbl -0x9(%rbp),%eax
cmp    $0x5c,%eax
je     1148 <simplify_path+0x48>
jmp    1159 <simplify_path+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <simplify_path+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simplify_path>:
test   %rdi,%rdi
je     113a <simplify_path+0x3a>
mov    %rdi,%rax
movabs $0x400000000003,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rax),%edx
add    $0xd2,%dl
cmp    $0x2e,%dl
ja     113c <simplify_path+0x3c>
movzbl %dl,%edx
bt     %rdx,%rcx
jae    113c <simplify_path+0x3c>
add    $0x1,%rax
jmp    1120 <simplify_path+0x20>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @simplify_path(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 92, label %6
i8 47, label %6
i8 46, label %6
]
6: ; preds = %3, %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ AdmTcpBind(char *);
void AdmTcpInit(char *port) { AdmTcpBind(port); }


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

x86 assembly (clang, -O2):
<AdmTcpInit>:
jmp    1030 <AdmTcpBind@plt>

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

LLVM IR (-O2):
define void @AdmTcpInit(i8* %0) {
%2 = tail call i32 @AdmTcpBind(i8* %0)
ret void
}
/* Variables and functions */
long long getusecs();
void spinme(int usecs) {
  long long s = getusecs();
  while (getusecs() - s < usecs)
    ;
}


x86 assembly (clang, -O0):
<spinme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getusecs@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getusecs@plt>
sub    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jge    1143 <spinme+0x33>
jmp    1126 <spinme+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spinme>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <getusecs@plt>
mov    %rax,%rbx
movslq %ebp,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getusecs@plt>
sub    %rbx,%rax
cmp    %rbp,%rax
jl     1130 <spinme+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @spinme(i32 %0) {
%2 = tail call i64 (...) @getusecs()
%3 = sext i32 %0 to i64
br label %4
4: ; preds = %4, %1
%5 = tail call i64 (...) @getusecs()
%6 = sub nsw i64 %5, %2
%7 = icmp slt i64 %6, %3
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
int Locate_Node(int *array, int data) {
  int i = 0;
  while (*array != data) {
    i++;
    array++;
  }
  return i;
}


x86 assembly (clang, -O0):
<Locate_Node>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
je     113b <Locate_Node+0x3b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <Locate_Node+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Locate_Node>:
xor    %eax,%eax
cmp    %esi,(%rdi)
je     111d <Locate_Node+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0x1,%rax
cmp    %esi,0x4(%rdi,%rcx,4)
jne    1110 <Locate_Node+0x10>
ret

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

LLVM IR (-O2):
define i32 @Locate_Node(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, %1
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = phi i32* [ %9, %5 ], [ %0, %2 ]
%8 = add nuw nsw i32 %6, 1
%9 = getelementptr inbounds i32, i32* %7, i64 1
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *, double);
void encode_json_dfmt(FILE *fp, const char *label, double value, char *fmt,
                      int first) {
  fprintf(fp, fmt, label, value);
}


x86 assembly (clang, -O0):
<encode_json_dfmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_json_dfmt>:
mov    %rsi,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
define void @encode_json_dfmt(i32* nocapture %0, i8* %1, double %2, i8* nocapture %3, i32 %4) {
%6 = tail call i32 @fprintf(i32* %0, i8* %3, i8* %1, double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testBinarySearch();
void test123() { testBinarySearch(); }


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

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

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

LLVM IR (-O2):
define void @test123() {
%1 = tail call i32 (...) @testBinarySearch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int cd_disc_length();
int /*<<< orphan*/ cd_first_track();
int /*<<< orphan*/ cd_play_disc(int /*<<< orphan*/);
int /*<<< orphan*/ cd_stop();
int /*<<< orphan*/ pause();
void loop_disc(void) {
  while (1) {
    int len = cd_disc_length();
    cd_stop();
    cd_play_disc(cd_first_track());
    alarm(len + 0 + 1);
    pause();
  }
}


x86 assembly (clang, -O0):
<loop_disc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1080 <cd_disc_length@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <cd_stop@plt>
mov    $0x0,%al
call   1030 <cd_first_track@plt>
mov    %eax,%edi
call   1050 <cd_play_disc@plt>
mov    -0x4(%rbp),%edi
add    $0x0,%edi
mov    %edi,-0xc(%rbp)
add    $0x1,%edi
mov    %edi,-0x8(%rbp)
call   1060 <alarm@plt>
mov    $0x0,%al
call   1070 <pause@plt>
jmp    1168 <loop_disc+0x8>

x86 assembly (clang, -O2):
<loop_disc>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <cd_disc_length@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <cd_stop@plt>
xor    %eax,%eax
call   1030 <cd_first_track@plt>
mov    %eax,%edi
call   1050 <cd_play_disc@plt>
add    $0x1,%ebx
mov    %ebx,%edi
call   1060 <alarm@plt>
xor    %eax,%eax
call   1070 <pause@plt>
jmp    1170 <loop_disc+0x10>

LLVM IR (-O0):
define void @loop_disc() {
%1 = alloca i32
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @cd_disc_length()
store i32 %3, i32* %1
%4 = call i32 (...) @cd_stop()
%5 = call i32 (...) @cd_first_track()
%6 = call i32 @cd_play_disc(i32 %5)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 0
%9 = add nsw i32 %8, 1
%10 = call i32 @alarm(i32 %9)
%11 = call i32 (...) @pause()
br label %2
}

LLVM IR (-O2):
define void @loop_disc() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @cd_disc_length()
%3 = tail call i32 (...) @cd_stop()
%4 = tail call i32 (...) @cd_first_track()
%5 = tail call i32 @cd_play_disc(i32 %4)
%6 = add nsw i32 %2, 1
%7 = tail call i32 @alarm(i32 %6)
%8 = tail call i32 (...) @pause()
br label %1
}