xunge/DecIR huggingface dataset:
double vdot(double v1[3], double v2[3]) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
}


x86 assembly (clang, -O0):
<vdot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdot>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @vdot(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @vdot(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int check_pwd(char path[100]) {
  if (strstr(path, "pwd") != NULL)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<check_pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <check_pwd+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <check_pwd+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pwd>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"pwd\00"
define i32 @check_pwd(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32* @strstr(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"pwd\00"
define i32 @check_pwd(i8* %0) {
%2 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_clr_C(FILE *stream) {
  fprintf(stream, "CLR   C                         ");
}


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

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

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

LLVM IR (-O2):
@.str = [33 x i8] c"CLR C \00"
define void @fprint_clr_C(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}
unsigned xrop3_195_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T ^ S;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_195_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_195_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_195_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
int state(struct globs *globs, struct prereq *goals, struct varscope *scope) {}


x86 assembly (clang, -O0):
<state>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.globs = type opaque
%struct.prereq = type opaque
%struct.varscope = type opaque
define i32 @state(%struct.globs* %0, %struct.prereq* %1, %struct.varscope* %2) {
%4 = alloca i32
%5 = alloca %struct.globs*
%6 = alloca %struct.prereq*
%7 = alloca %struct.varscope*
store %struct.globs* %0, %struct.globs** %5
store %struct.prereq* %1, %struct.prereq** %6
store %struct.varscope* %2, %struct.varscope** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.globs = type opaque
%struct.prereq = type opaque
%struct.varscope = type opaque
define i32 @state(%struct.globs* nocapture readnone %0, %struct.prereq* nocapture readnone %1, %struct.varscope* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
float poly(float, float, float, float, int);
float quadIn(float fraction, float start, float delta, float slope) {
  return poly(fraction, start, delta, slope, 2);
}


x86 assembly (clang, -O0):
<quadIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
mov    $0x2,%edi
call   1030 <poly@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadIn>:
mov    $0x2,%edi
jmp    1030 <poly@plt>

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

LLVM IR (-O2):
define float @quadIn(float %0, float %1, float %2, float %3) {
%5 = tail call float @poly(float %0, float %1, float %2, float %3, i32 2)
ret float %5
}
int libhalloc_lock() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @libhalloc_lock() {
ret i32 0
}
/* Variables and functions */
scalar_t__ GLeeInit();
int /*<<< orphan*/ pglBeginVertexShaderEXT();
void _Lazy_glBeginVertexShaderEXT(void) {
  if (GLeeInit())
    pglBeginVertexShaderEXT();
}


x86 assembly (clang, -O0):
<_Lazy_glBeginVertexShaderEXT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GLeeInit@plt>
cmp    $0x0,%rax
je     113c <_Lazy_glBeginVertexShaderEXT+0x1c>
mov    $0x0,%al
call   1040 <pglBeginVertexShaderEXT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glBeginVertexShaderEXT>:
push   %rax
xor    %eax,%eax
call   1030 <GLeeInit@plt>
test   %rax,%rax
je     1135 <_Lazy_glBeginVertexShaderEXT+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pglBeginVertexShaderEXT@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_Lazy_glBeginVertexShaderEXT() {
%1 = call i64 (...) @GLeeInit()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @pglBeginVertexShaderEXT()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @_Lazy_glBeginVertexShaderEXT() {
%1 = tail call i64 (...) @GLeeInit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @pglBeginVertexShaderEXT()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
bool commentLine(const char character) {
  return (character == ';') ? true : false;
}


x86 assembly (clang, -O0):
<commentLine>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x3b,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<commentLine>:
xor    %eax,%eax
cmp    $0x3b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @commentLine(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 59
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @commentLine(i8 signext %0) {
%2 = icmp eq i8 %0, 59
%3 = zext i1 %2 to i32
ret i32 %3
}
void __main() {
  extern int main();

#pragma message(                                                                                                                                \
    "\t"                                                                                                                                        \
    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/rrrfff/RLib/refs/heads/master/RLib/RLib_NoCRT.h" \
    "(23): warning C9999: exit the process explicitly")
}


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

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

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

LLVM IR (-O2):
define void @__main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int __detect_PLATFORM_ENV_CPU_FEATURE_DETAIL() {
  printf("(0");
  if (sizeof(void *) == 4) {
  } else if (sizeof(void *) == 8) {
    printf(" | TT_ENV_CPU_FEATURE_64BIT");
  }
  printf(")");
  return 0;
}


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

x86 assembly (clang, -O2):
<__detect_PLATFORM_ENV_CPU_FEATURE_DETAIL>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
mov    $0x29,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"(0\00"
@.str.1 = [28 x i8] c" | TT_ENV_CPU_FEATURE_64BIT\00"
@.str.2 = [2 x i8] c")\00"
define i32 @__detect_PLATFORM_ENV_CPU_FEATURE_DETAIL() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"(0\00"
@.str.1 = [28 x i8] c" | TT_ENV_CPU_FEATURE_64BIT\00"
define i32 @__detect_PLATFORM_ENV_CPU_FEATURE_DETAIL() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 41)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage:  makecosfile [-sg] [-ni] groupname [subname] \n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: makecosfile [-sg] [-ni] groupname [subname] \0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: makecosfile [-sg] [-ni] groupname [subname] \0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void post_user() { write("json-task.json", "}\n", NULL); }


x86 assembly (clang, -O0):
<post_user>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<post_user>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"}\0A\00"
define void @post_user() {
%1 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"}\0A\00"
define void @post_user() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpacklo_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_unpacklo_epi64(__m128i A, __m128i B) {
  return _mm_unpacklo_epi64(A, B);
}


x86 assembly (clang, -O0):
<test_mm_unpacklo_epi64>:
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 <_mm_unpacklo_epi64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_unpacklo_epi64>:
jmp    1030 <_mm_unpacklo_epi64@plt>

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

LLVM IR (-O2):
define i32 @test_mm_unpacklo_epi64(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpacklo_epi64(i32 %0, i32 %1)
ret i32 %3
}
void swap(int *array, int i, int j) {
  int temp = array[i];
  array[i] = array[j];
  array[j] = temp;
}


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

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void dummy(void (*fp)(void)) {
  if (fp) {
  };
}


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <dummy+0x18>
jmp    1118 <dummy+0x18>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dummy(void ()* nocapture %0) {
ret void
}
long msb(long x) {
  long r = 0;
  while (x) {
    r++;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<msb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <msb+0x38>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <msb+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msb>:
xor    %eax,%eax
test   %rdi,%rdi
je     1120 <msb+0x20>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
sar    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <msb+0x10>
ret

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

LLVM IR (-O2):
define i64 @msb(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i64 %4, 1
%7 = ashr i64 %5, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %10
}
const char *protobuf_c_version(void) { return "1.3.1"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"1.3.1\00"
define i8* @protobuf_c_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int f(int, int, int, int);
main() { return f(5, 2, 3, 4); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5, i32 2, i32 3, i32 4)
ret i32 %1
}
int cmp_neq(long arg1, long arg2) { return arg1 == arg2; }


x86 assembly (clang, -O0):
<cmp_neq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_neq>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @cmp_neq(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmp_neq(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int is_nan(d)
double d;
{
  char command[128];
  if (!(d == d))
    return 1;
  sprintf(command, "echo '%f' | egrep '[nN][aA][nN]|\\?' >/dev/null", d);
  return system(command) == 0;
}


x86 assembly (clang, -O0):
<is_nan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    114b <is_nan+0x2b>
jp     114b <is_nan+0x2b>
jmp    1157 <is_nan+0x37>
movl   $0x1,-0x4(%rbp)
jmp    118d <is_nan+0x6d>
lea    -0x90(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xe96(%rip),%rsi
mov    $0x1,%al
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_nan>:
ucomisd %xmm0,%xmm0
jp     115e <is_nan+0x3e>
push   %rbx
sub    $0x80,%rsp
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <system@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x80,%rsp
pop    %rbx
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [47 x i8] c"echo '%f' | egrep '[nN][aA][nN]|\\?' >/dev/null\00"
define i32 @is_nan(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca [128 x i8]
store double %0, double* %3
%5 = load double, double* %3
%6 = load double, double* %3
%7 = fcmp oeq double %5, %6
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 1, i32* %2
br label %17
9: ; preds = %1
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%11 = load double, double* %3
%12 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), double %11)
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %13)
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %9, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [47 x i8] c"echo '%f' | egrep '[nN][aA][nN]|\\?' >/dev/null\00"
define i32 @is_nan(double %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = fcmp ord double %0, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), double %0)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %3)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ 1, %1 ]
ret i32 %11
}
char *replace_chr(char *s, char search, char replace) {
  char ch;
  char *begin = s;
  while ((ch = *s)) {
    if (ch == search)
      *s = replace;
    else
      *s = ch;
    s++;
  }
  return begin;
}


x86 assembly (clang, -O0):
<replace_chr>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xb(%rbp)
cmp    $0x0,%al
je     1164 <replace_chr+0x64>
movsbl -0xb(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <replace_chr+0x4a>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1153 <replace_chr+0x53>
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111b <replace_chr+0x1b>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_chr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <replace_chr+0x25>
lea    0x1(%rax),%rdi
jmp    111b <replace_chr+0x1b>
nop
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     1125 <replace_chr+0x25>
cmp    %sil,%cl
jne    1110 <replace_chr+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <replace_chr+0x10>
ret

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

LLVM IR (-O2):
define i8* @replace_chr(i8* returned %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret i8* %0
}
/* Variables and functions */
double round_down(double, double);
double round_up(double, double);
double rs_rainflow_round_inf(double x, double scale) {
  return (x == 0.0 ? 0.0
                   : (x > 0.0 ? round_up(x, scale) : round_down(x, scale)));
}


x86 assembly (clang, -O0):
<rs_rainflow_round_inf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1157 <rs_rainflow_round_inf+0x37>
jp     1157 <rs_rainflow_round_inf+0x37>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11a0 <rs_rainflow_round_inf+0x80>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1182 <rs_rainflow_round_inf+0x62>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <round_up@plt>
movsd  %xmm0,-0x20(%rbp)
jmp    1196 <rs_rainflow_round_inf+0x76>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <round_down@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs_rainflow_round_inf>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    1131 <rs_rainflow_round_inf+0x11>
jp     1131 <rs_rainflow_round_inf+0x11>
xorpd  %xmm0,%xmm0
ret
jbe    1138 <rs_rainflow_round_inf+0x18>
jmp    1030 <round_up@plt>
jmp    1040 <round_down@plt>

LLVM IR (-O0):
define double @rs_rainflow_round_inf(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 = fcmp oeq double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %2
br label %21
8: ; preds = %2
%9 = load double, double* %3
%10 = fcmp ogt double %9, 0.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call double @round_up(double %12, double %13)
br label %19
15: ; preds = %8
%16 = load double, double* %3
%17 = load double, double* %4
%18 = call double @round_down(double %16, double %17)
br label %19
19: ; preds = %15, %11
%20 = phi double [ %14, %11 ], [ %18, %15 ]
br label %21
21: ; preds = %19, %7
%22 = phi double [ 0.000000e+00, %7 ], [ %20, %19 ]
ret double %22
}

LLVM IR (-O2):
define double @rs_rainflow_round_inf(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = fcmp ogt double %0, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call double @round_up(double %0, double %1)
br label %10
8: ; preds = %4
%9 = tail call double @round_down(double %0, double %1)
br label %10
10: ; preds = %6, %8, %2
%11 = phi double [ 0.000000e+00, %2 ], [ %7, %6 ], [ %9, %8 ]
ret double %11
}
/* Type definitions */
typedef enum board { ____Placeholder_board } board;

/* Variables and functions */
scalar_t__ occupied(int *, int);
int validate_coord(enum board *b, size_t board_size, int coord) {
  if (coord < 0)
    return 1;
  else if ((unsigned)coord >= board_size)
    return 2;
  else if (occupied(b, coord))
    return 3;
  return 0;
}


x86 assembly (clang, -O0):
<validate_coord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1139 <validate_coord+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1185 <validate_coord+0x75>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%rax
jb     1152 <validate_coord+0x42>
movl   $0x2,-0x4(%rbp)
jmp    1185 <validate_coord+0x75>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <occupied@plt>
cmp    $0x0,%rax
je     1174 <validate_coord+0x64>
movl   $0x3,-0x4(%rbp)
jmp    1185 <validate_coord+0x75>
jmp    1179 <validate_coord+0x69>
jmp    117e <validate_coord+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_coord>:
test   %edx,%edx
js     1138 <validate_coord+0x28>
mov    %edx,%ecx
mov    $0x2,%eax
cmp    %rsi,%rcx
jae    1137 <validate_coord+0x27>
push   %rax
mov    %edx,%esi
call   1030 <occupied@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rcx,2),%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @validate_coord(i32* %0, i64 %1, i32 %2) {
%4 = icmp slt i32 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = icmp ult i64 %6, %1
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @occupied(i32* %0, i32 %2)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i32 0, i32 3
br label %12
12: ; preds = %8, %5, %3
%13 = phi i32 [ 1, %3 ], [ 2, %5 ], [ %11, %8 ]
ret i32 %13
}
double MItoMM(double MI) { return MI * 1609344.0; }


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

x86 assembly (clang, -O2):
<MItoMM>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @MItoMM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x41388E8000000000
ret double %4
}

LLVM IR (-O2):
define double @MItoMM(double %0) {
%2 = fmul double %0, 0x41388E8000000000
ret double %2
}
int __spawnvp(mode, cmdname, argv)
int mode;
const char *cmdname;
char **argv;
{ _spawnvp(mode, cmdname, fix_argv(argv)); }


x86 assembly (clang, -O0):
<__spawnvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <fix_argv@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x0,%al
call   1040 <_spawnvp@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__spawnvp>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rdx,%rdi
xor    %eax,%eax
call   1030 <fix_argv@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_spawnvp@plt>

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

LLVM IR (-O2):
define i32 @__spawnvp(i32 %0, i8* %1, i8** %2) {
%4 = tail call i32 (i8**, ...) bitcast (i32 (...)* @fix_argv to i32 (i8**, ...)*)(i8** %2)
%5 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @_spawnvp to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %1, i32 %4)
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void volatile_clear_bit_u8(uint8_t *mask, uint8_t bit) {
  *((volatile uint8_t *)mask) &= ~(1 << bit);
}


x86 assembly (clang, -O0):
<volatile_clear_bit_u8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<volatile_clear_bit_u8>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @volatile_clear_bit_u8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32*, i32** %3
%9 = load volatile i32, i32* %8
%10 = and i32 %9, %7
store volatile i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @volatile_clear_bit_u8(i32* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* %0
%6 = and i32 %5, %4
store volatile i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("PROD = %d\n", 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
imul   -0xc(%rbp),%esi
lea    0xeb5(%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    (%rsp),%esi
imul   0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"PROD = %d\0A\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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"PROD = %d\0A\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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int split(int *, int, int);
void quicksort(int a[], int low, int high) {
  int middle;
  if (low >= high)
    return;
  middle = split(a, low, high);
  quicksort(a, low, middle - 1);
  quicksort(a, middle + 1, high);
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <quicksort+0x23>
jmp    1179 <quicksort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <split@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <split@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @split(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logMsg(int, char *, char *);
int /*<<< orphan*/ *strchr(char *, char);
int noDodgyChars(char *value) {
  if ((strchr(value, '<') != NULL) || (strchr(value, '>') != NULL)) {
    logMsg(4, "Suspicious characters detected in config value %s", value);
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<noDodgyChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3c,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    115c <noDodgyChars+0x3c>
mov    -0x10(%rbp),%rdi
mov    $0x3e,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     117d <noDodgyChars+0x5d>
mov    -0x10(%rbp),%rdx
mov    $0x4,%edi
lea    0xe94(%rip),%rsi
call   1040 <logMsg@plt>
movl   $0x0,-0x4(%rbp)
jmp    1184 <noDodgyChars+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noDodgyChars>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1145 <noDodgyChars+0x25>
mov    %rbx,%rdi
mov    $0x3e,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     115d <noDodgyChars+0x3d>
lea    0xeb4(%rip),%rsi
mov    $0x4,%edi
mov    %rbx,%rdx
call   1040 <logMsg@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Suspicious characters detected in config value %s\00"
define i32 @noDodgyChars(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32* @strchr(i8* %4, i8 signext 60)
%6 = icmp ne i32* %5, null
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32* @strchr(i8* %8, i8 signext 62)
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %7, %1
%12 = load i8*, i8** %3
%13 = call i32 @logMsg(i32 4, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 0, i32* %2
br label %15
14: ; preds = %7
store i32 1, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [50 x i8] c"Suspicious characters detected in config value %s\00"
define i32 @noDodgyChars(i8* %0) {
%2 = tail call i32* @strchr(i8* %0, i8 signext 60)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32* @strchr(i8* %0, i8 signext 62)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4, %1
%8 = tail call i32 @logMsg(i32 4, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ DymosimMessageDouble(char *, double);
int DymosimLog(char *message, double v) {
  DymosimMessageDouble(message, v);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @DymosimLog(i8* %0, double %1) {
%3 = tail call i32 @DymosimMessageDouble(i8* %0, double %1)
ret i32 0
}
int test_imm_CDint16_reg(short val) {
  return ((val) & (0xCD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CDint16_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, 205
%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_CDint16_reg(i16 signext %0) {
%2 = and i16 %0, 205
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_bpm_lower_bound();
int /*<<< orphan*/ test_bpm_nominal_value();
int /*<<< orphan*/ test_bpm_upper_bound();
void execute_tests() {
  test_bpm_lower_bound();
  test_bpm_upper_bound();
  test_bpm_nominal_value();
}


x86 assembly (clang, -O0):
<execute_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_bpm_lower_bound@plt>
mov    $0x0,%al
call   1030 <test_bpm_upper_bound@plt>
mov    $0x0,%al
call   1040 <test_bpm_nominal_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_tests>:
push   %rax
xor    %eax,%eax
call   1050 <test_bpm_lower_bound@plt>
xor    %eax,%eax
call   1030 <test_bpm_upper_bound@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_bpm_nominal_value@plt>

LLVM IR (-O0):
define void @execute_tests() {
%1 = call i32 (...) @test_bpm_lower_bound()
%2 = call i32 (...) @test_bpm_upper_bound()
%3 = call i32 (...) @test_bpm_nominal_value()
ret void
}

LLVM IR (-O2):
define void @execute_tests() {
%1 = tail call i32 (...) @test_bpm_lower_bound()
%2 = tail call i32 (...) @test_bpm_upper_bound()
%3 = tail call i32 (...) @test_bpm_nominal_value()
ret void
}