xunge/DecIR huggingface dataset:
/* Type definitions */
typedef double uint32_t;

/* Variables and functions */
double Quadratic(uint32_t Num, uint32_t Min, uint32_t Max) {
  uint32_t Mult = (Num - Min);
  uint32_t MaxMult = (Max - Min);
  Mult *= Mult;
  MaxMult *= MaxMult;
  return Mult / ((double)MaxMult);
}


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

x86 assembly (clang, -O2):
<Quadratic>:
unpcklpd %xmm2,%xmm0
unpcklpd %xmm1,%xmm1
subpd  %xmm1,%xmm0
mulpd  %xmm0,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Quadratic(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fsub double %9, %10
store double %11, double* %7
%12 = load double, double* %6
%13 = load double, double* %5
%14 = fsub double %12, %13
store double %14, double* %8
%15 = load double, double* %7
%16 = load double, double* %7
%17 = fmul double %16, %15
store double %17, double* %7
%18 = load double, double* %8
%19 = load double, double* %8
%20 = fmul double %19, %18
store double %20, double* %8
%21 = load double, double* %7
%22 = load double, double* %8
%23 = fdiv double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @Quadratic(double %0, double %1, double %2) {
%4 = insertelement <2 x double> poison, double %0, i64 0
%5 = insertelement <2 x double> %4, double %2, i64 1
%6 = insertelement <2 x double> poison, double %1, i64 0
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer
%8 = fsub <2 x double> %5, %7
%9 = fmul <2 x double> %8, %8
%10 = extractelement <2 x double> %9, i64 0
%11 = extractelement <2 x double> %9, i64 1
%12 = fdiv double %10, %11
ret double %12
}
/* Variables and functions */
double exp(double const);
double loggy_gradient(const double x) {
  double fx = exp(x);
  return (2 * fx) / ((fx + 1) * (fx + 1));
}


x86 assembly (clang, -O0):
<loggy_gradient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xed4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xeb2(%rip),%xmm2
addsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loggy_gradient>:
push   %rax
call   1030 <exp@plt>
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
addsd  0xeda(%rip),%xmm0
mulsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @loggy_gradient(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @exp(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = fmul double 2.000000e+00, %6
%8 = load double, double* %3
%9 = fadd double %8, 1.000000e+00
%10 = load double, double* %3
%11 = fadd double %10, 1.000000e+00
%12 = fmul double %9, %11
%13 = fdiv double %7, %12
ret double %13
}

LLVM IR (-O2):
define double @loggy_gradient(double %0) {
%2 = tail call double @exp(double %0)
%3 = fmul double %2, 2.000000e+00
%4 = fadd double %2, 1.000000e+00
%5 = fmul double %4, %4
%6 = fdiv double %3, %5
ret double %6
}
unsigned xrop3_0_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  stk1 = 0x0000;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_0_1_0>:
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)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_0_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %6
store i32 0, i32* %7
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = xor i32 %15, -1
%17 = and i32 %14, %16
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = and i32 %18, %19
%21 = or i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @xrop3_0_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
void measure_bitrate() {}


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

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

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

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

/* Variables and functions */
uint16_t tswap16(uint16_t s) { return s; }


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

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

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

LLVM IR (-O2):
define i32 @tswap16(i32 returned %0) {
ret i32 %0
}
int count_words(char *str) {
  int cnt;
  if (!str)
    return 0;
  cnt = 0;
  while (*str) {
    if (*str == ' ')
      cnt++;
    str++;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<count_words>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <count_words+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1163 <count_words+0x63>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <count_words+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    114c <count_words+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1126 <count_words+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_words>:
xor    %eax,%eax
test   %rdi,%rdi
jne    1117 <count_words+0x17>
jmp    1123 <count_words+0x23>
nopl   0x0(%rax)
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x20,%cl
je     1110 <count_words+0x10>
test   %cl,%cl
jne    1113 <count_words+0x13>
ret

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

LLVM IR (-O2):
define i32 @count_words(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %9
%4 = phi i8* [ %11, %9 ], [ %0, %1 ]
%5 = phi i32 [ %10, %9 ], [ 0, %1 ]
%6 = load i8, i8* %4
switch i8 %6, label %9 [
i8 0, label %12
i8 32, label %7
]
7: ; preds = %3
%8 = add nsw i32 %5, 1
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ %5, %3 ]
%11 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %5, %3 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ fileExists(char const *);
int /*<<< orphan*/ rename(char const *, char const *);
int /*<<< orphan*/ unlink(char const *);
void fileRename(const char *src, const char *dst) {
  if (fileExists(src) && fileExists(dst))
    unlink(dst);
  rename(src, dst);
}


x86 assembly (clang, -O0):
<fileRename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileExists@plt>
cmp    $0x0,%rax
je     116f <fileRename+0x3f>
mov    -0x10(%rbp),%rdi
call   1040 <fileExists@plt>
cmp    $0x0,%rax
je     116f <fileRename+0x3f>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <rename@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileRename>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <fileExists@plt>
test   %rax,%rax
je     1159 <fileRename+0x29>
mov    %r14,%rdi
call   1040 <fileExists@plt>
test   %rax,%rax
je     1159 <fileRename+0x29>
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <rename@plt>

LLVM IR (-O0):
define void @fileRename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @fileExists(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i64 @fileExists(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = call i32 @unlink(i8* %13)
br label %15
15: ; preds = %12, %8, %2
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 @rename(i8* %16, i8* %17)
ret void
}

LLVM IR (-O2):
define void @fileRename(i8* %0, i8* %1) {
%3 = tail call i64 @fileExists(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i64 @fileExists(i8* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @unlink(i8* %1)
br label %10
10: ; preds = %8, %5, %2
%11 = tail call i32 @rename(i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int make_keep_alive1_pkt1(uint8_t *buf, uint8_t cnt) {
  buf[0] = 0x07;
  buf[1] = cnt;
  buf[2] = 0x08;
  buf[3] = 0x00;
  buf[4] = 0x01;
  buf[5] = 0x00;
  buf[6] = 0x00;
  buf[7] = 0x00;
  return 8;
}


x86 assembly (clang, -O0):
<make_keep_alive1_pkt1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x7,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x8,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x14(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x18(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x1c(%rax)
mov    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_keep_alive1_pkt1>:
movl   $0x7,(%rdi)
mov    %esi,0x4(%rdi)
movaps 0xef0(%rip),%xmm0
movups %xmm0,0x8(%rdi)
movq   $0x0,0x18(%rdi)
mov    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @make_keep_alive1_pkt1(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 = getelementptr inbounds i32, i32* %5, i64 0
store i32 7, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %7, i32* %9
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 2
store i32 8, i32* %11
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 3
store i32 0, i32* %13
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 4
store i32 1, i32* %15
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 5
store i32 0, i32* %17
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 6
store i32 0, i32* %19
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 7
store i32 0, i32* %21
ret i32 8
}

LLVM IR (-O2):
define i32 @make_keep_alive1_pkt1(i32* nocapture writeonly %0, i32 %1) {
store i32 7, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %1, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 8, i32 0, i32 1, i32 0>, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 6
store i32 0, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 7
store i32 0, i32* %7
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int main() {
  printf("FORK TEST\n");
  fflush(stdout);
  fork();
  printf("hi %d\n", getpid());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1060 <fork@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1070 <fork@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe80(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"FORK TEST\0A\00"
@stdout = global i32 0
@.str.1 = [7 x i8] c"hi %d\0A\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call i32 (...) @fork()
%5 = call i32 (...) @getpid()
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [7 x i8] c"hi %d\0A\00"
@str = [10 x i8] c"FORK TEST\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 (...) @fork()
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
unsigned long read_cr0(void) {
  unsigned long cr0;
  asm volatile("movq %%cr0,%0" : "=r"(cr0));
  return cr0;
}


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

x86 assembly (clang, -O2):
<read_cr0>:
mov    %cr0,%rax
ret

LLVM IR (-O0):
define i64 @read_cr0() {
%1 = alloca i64
%2 = call i64 asm sideeffect "movq %cr0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @read_cr0() {
%1 = tail call i64 asm sideeffect "movq %cr0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ NOREF(void *);
void vbox_slirp_fprintf(void *ignored, char *format, ...) {
  NOREF(format);
  NOREF(ignored);
}


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

x86 assembly (clang, -O2):
<vbox_slirp_fprintf>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <NOREF@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <NOREF@plt>

LLVM IR (-O0):
define void @vbox_slirp_fprintf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @NOREF(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @NOREF(i8* %7)
ret void
}

LLVM IR (-O2):
define void @vbox_slirp_fprintf(i8* %0, i8* %1, ...) {
%3 = tail call i32 @NOREF(i8* %1)
%4 = tail call i32 @NOREF(i8* %0)
ret void
}
/* Variables and functions */
int fnv1_hash(void **, int);
int hash_integer(void *key) { return fnv1_hash(&key, sizeof(int)); }


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

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

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

LLVM IR (-O2):
define i32 @hash_integer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fnv1_hash(i8** %2, i32 4)
ret i32 %3
}
int vlc_ascii_toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return c + ('A' - 'a');
  else
    return c;
}


x86 assembly (clang, -O0):
<vlc_ascii_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1129 <vlc_ascii_toupper+0x29>
cmpl   $0x7a,-0x8(%rbp)
jg     1129 <vlc_ascii_toupper+0x29>
mov    -0x8(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <vlc_ascii_toupper+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlc_ascii_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @vlc_ascii_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, -32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @vlc_ascii_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
unsigned char convert_from_bytes_to_power_of_two(unsigned short NumberOfBytes) {
  unsigned char count = 0;
  while (NumberOfBytes != 1) {
    NumberOfBytes >>= 1;
    count++;
  }
  return (count);
}


x86 assembly (clang, -O0):
<convert_from_bytes_to_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x1,%eax
je     1134 <convert_from_bytes_to_power_of_two+0x34>
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %ax,-0x2(%rbp)
mov    -0x3(%rbp),%al
add    $0x1,%al
mov    %al,-0x3(%rbp)
jmp    110f <convert_from_bytes_to_power_of_two+0xf>
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_from_bytes_to_power_of_two>:
xor    %eax,%eax
cmp    $0x1,%di
je     111d <convert_from_bytes_to_power_of_two+0x1d>
nopl   0x0(%rax,%rax,1)
movzwl %di,%edi
shr    %edi
add    $0x1,%al
cmp    $0x1,%di
jne    1110 <convert_from_bytes_to_power_of_two+0x10>
ret

LLVM IR (-O0):
define zeroext i8 @convert_from_bytes_to_power_of_two(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
store i8 0, i8* %3
br label %4
4: ; preds = %8, %1
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 1
%12 = trunc i32 %11 to i16
store i16 %12, i16* %2
%13 = load i8, i8* %3
%14 = add i8 %13, 1
store i8 %14, i8* %3
br label %4
15: ; preds = %4
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @convert_from_bytes_to_power_of_two(i16 zeroext %0) {
%2 = icmp eq i16 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8 [ %7, %3 ], [ 0, %1 ]
%5 = phi i16 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i16 %5, 1
%7 = add i8 %4, 1
%8 = icmp eq i16 %6, 1
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i8 [ 0, %1 ], [ %7, %3 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usermode_list_blockcipher(int argc, char **argv) {
  printf("%s \n", "CRYPTO USERMODE LIST BLOCK CIPHERS");
  exit(0);
}


x86 assembly (clang, -O0):
<usermode_list_blockcipher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usermode_list_blockcipher>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s \0A\00"
@.str.1 = [35 x i8] c"CRYPTO USERMODE LIST BLOCK CIPHERS\00"
define void @usermode_list_blockcipher(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
@.str.1 = [35 x i8] c"CRYPTO USERMODE LIST BLOCK CIPHERS\00"
define void @usermode_list_blockcipher(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpackhi_epi32(int /*<<< orphan*/ const,
                                      int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_unpacklo_epi32(int /*<<< orphan*/ const,
                                      int /*<<< orphan*/ const);
__m128i pack_4(const __m128i in0, const __m128i in1) {
  const __m128i t0 = _mm_unpacklo_epi32(in0, in1);
  const __m128i t1 = _mm_unpackhi_epi32(in0, in1);
  return _mm_unpacklo_epi32(t0, t1);
}


x86 assembly (clang, -O0):
<pack_4>:
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_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_unpackhi_epi32@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <_mm_unpacklo_epi32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_4>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_mm_unpacklo_epi32@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <_mm_unpackhi_epi32@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_mm_unpacklo_epi32@plt>

LLVM IR (-O0):
define i32 @pack_4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @_mm_unpacklo_epi32(i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @_mm_unpackhi_epi32(i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @_mm_unpacklo_epi32(i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @pack_4(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpacklo_epi32(i32 %0, i32 %1)
%4 = tail call i32 @_mm_unpackhi_epi32(i32 %0, i32 %1)
%5 = tail call i32 @_mm_unpacklo_epi32(i32 %3, i32 %4)
ret i32 %5
}
double floor(double x) { return 0; }


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @floor(double %0) {
ret double 0.000000e+00
}
char *pstr(char *str, char *def) {
  if (str) {
    return (str);
  } else {
    if (def) {
      return (def);
    } else {
      return ("");
    }
  }
}


x86 assembly (clang, -O0):
<pstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1124 <pstr+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <pstr+0x47>
cmpq   $0x0,-0x18(%rbp)
je     113c <pstr+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <pstr+0x47>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstr>:
test   %rsi,%rsi
lea    0xef6(%rip),%rax
cmovne %rsi,%rax
test   %rdi,%rdi
cmovne %rdi,%rax
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @pstr(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%6 = select i1 %3, i8* %5, i8* %0
ret i8* %6
}
int putchar(int c) { *(volatile int *)((0x10500000 + 4)) = c; }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x10500004,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    %edi,0x10500004
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
store volatile i32 %4, i32* inttoptr (i64 273678340 to i32*)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 273678340 to i32*)
ret i32 undef
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t size = 0;
  while (*(str++) != 0)
    size++;
  return size;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <strlen+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, unsigned long);
char *strnpointerid(char *dest, const void *pointer, size_t len) {
  *dest = 0;
  if (pointer)
    snprintf(dest, len, ".x%lx", (unsigned long)pointer);
  return dest;
}


x86 assembly (clang, -O0):
<strnpointerid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     114e <strnpointerid+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rcx
lea    0xeb7(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnpointerid>:
push   %rbx
mov    %rdi,%rbx
movb   $0x0,(%rdi)
test   %rsi,%rsi
je     1134 <strnpointerid+0x24>
mov    %rsi,%rcx
lea    0xeda(%rip),%rax
mov    %rbx,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c".x%lx\00"
define i8* @strnpointerid(i8* returned %0, i8* %1, i64 %2) {
store i8 0, i8* %0
%4 = icmp eq i8* %1, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = ptrtoint i8* %1 to i64
%7 = tail call i32 @snprintf(i8* %0, i64 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %6)
br label %8
8: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ sn3218a_write_reg_single(int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void sn3218a_data_update(void) {
  if (sn3218a_write_reg_single(0x16, 0)) {
    fprintf(stderr, "Failed to update!\n");
  }
}


x86 assembly (clang, -O0):
<sn3218a_data_update>:
push   %rbp
mov    %rsp,%rbp
mov    $0x16,%edi
xor    %esi,%esi
call   1030 <sn3218a_write_reg_single@plt>
cmp    $0x0,%rax
je     114f <sn3218a_data_update+0x2f>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1040 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sn3218a_data_update>:
push   %rax
mov    $0x16,%edi
xor    %esi,%esi
call   1030 <sn3218a_write_reg_single@plt>
test   %rax,%rax
je     1148 <sn3218a_data_update+0x28>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Failed to update!\0A\00"
define void @sn3218a_data_update() {
%1 = call i64 @sn3218a_write_reg_single(i32 22, i32 0)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Failed to update!\0A\00"
define void @sn3218a_data_update() {
%1 = tail call i64 @sn3218a_write_reg_single(i32 22, i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %0
ret void
}
int max3(int x, int y, int z) {
  if (x >= y && x >= z)
    return x;
  else if (y >= z)
    return y;
  else
    return z;
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1130 <max3+0x30>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1130 <max3+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <max3+0x4d>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1147 <max3+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <max3+0x4d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
cmp    %edx,%esi
mov    %esi,%ecx
cmovl  %edx,%ecx
cmp    %edx,%edi
mov    %edi,%eax
cmovl  %ecx,%eax
cmp    %esi,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp slt i32 %0, %2
%6 = or i1 %4, %5
%7 = icmp slt i32 %1, %2
%8 = select i1 %7, i32 %2, i32 %1
%9 = select i1 %6, i32 %8, i32 %0
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_kill(pthread_t thread, int sig) { return 1; }


x86 assembly (clang, -O0):
<pthread_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pthread_kill(i32 %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 24;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x18,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 24, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 24)
ret i32 0
}
unsigned long bootstage_mark_early(const char *name) { return 0; }


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

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

LLVM IR (-O0):
define i64 @bootstage_mark_early(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i64 0
}

LLVM IR (-O2):
define i64 @bootstage_mark_early(i8* nocapture readnone %0) {
ret i64 0
}
double thermCondConst(double rho) {
  return (3.4e-003 -
          (3.4e-003 - 7.4e-004) * (1800.0 - rho) / (1800.0 - 1100.0));
}


x86 assembly (clang, -O0):
<thermCondConst>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xf07(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xede(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<thermCondConst>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm1
divsd  0xef4(%rip),%xmm1
addsd  0xef4(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @thermCondConst(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.800000e+03, %3
%5 = fmul double 2.660000e-03, %4
%6 = fdiv double %5, 7.000000e+02
%7 = fsub double 3.400000e-03, %6
ret double %7
}

LLVM IR (-O2):
define double @thermCondConst(double %0) {
%2 = fsub double 1.800000e+03, %0
%3 = fmul double %2, 2.660000e-03
%4 = fdiv double %3, 7.000000e+02
%5 = fsub double 3.400000e-03, %4
ret double %5
}
/* Type definitions */
struct passwd {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EINTR;
struct passwd *__tlg_getpwent(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
struct passwd *tlg_fgetpwent(FILE *file) {
  if (file == NULL) {
    errno = EINTR;
    return NULL;
  }
  return __tlg_getpwent(fileno(file));
}


x86 assembly (clang, -O0):
<tlg_fgetpwent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <tlg_fgetpwent+0x36>
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
mov    0x2e99(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    116a <tlg_fgetpwent+0x4a>
mov    -0x10(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
call   1040 <__tlg_getpwent@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlg_fgetpwent>:
push   %rax
test   %rdi,%rdi
je     1133 <tlg_fgetpwent+0x13>
call   1030 <fileno@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <__tlg_getpwent@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    0x2e9d(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
@EINTR = global i32 0
@errno = global i32 0
define %struct.passwd* @tlg_fgetpwent(i32* %0) {
%2 = alloca %struct.passwd*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @EINTR
store i32 %7, i32* @errno
store %struct.passwd* null, %struct.passwd** %2
br label %12
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @fileno(i32* %9)
%11 = call %struct.passwd* @__tlg_getpwent(i32 %10)
store %struct.passwd* %11, %struct.passwd** %2
br label %12
12: ; preds = %8, %6
%13 = load %struct.passwd*, %struct.passwd** %2
ret %struct.passwd* %13
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@EINTR = global i32 0
@errno = global i32 0
define %struct.passwd* @tlg_fgetpwent(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @EINTR
store i32 %4, i32* @errno
br label %8
5: ; preds = %1
%6 = tail call i32 @fileno(i32* %0)
%7 = tail call %struct.passwd* @__tlg_getpwent(i32 %6)
br label %8
8: ; preds = %5, %3
%9 = phi %struct.passwd* [ null, %3 ], [ %7, %5 ]
ret %struct.passwd* %9
}
int gy_pos(int j, int sep_x, int ny, int ny_whole, int ng, int td_num) {
  int gy_position = ((td_num / sep_x) * ny + j - ng + ny_whole) % ny_whole;
  return gy_position;
}


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

x86 assembly (clang, -O2):
<gy_pos>:
mov    %r9d,%eax
mov    %edx,%r9d
cltd
idiv   %esi
imul   %r9d,%eax
lea    (%rdi,%rcx,1),%edx
sub    %r8d,%edx
add    %edx,%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @gy_pos(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = sdiv i32 %5, %1
%8 = mul nsw i32 %7, %2
%9 = add i32 %3, %0
%10 = sub i32 %9, %4
%11 = add i32 %10, %8
%12 = srem i32 %11, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int, ...);
int main() {
  f(1, 2);
  f(1, 2, 3, 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x0,%al
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <f@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) @f(i32 1, i32 2)
%2 = tail call i32 (i32, i32, ...) @f(i32 1, i32 2, i32 3, i32 4)
ret i32 0
}
int sum(int x) {
  int result = 0;
  while (x--) {
    result += x;
  }
  return result;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1130 <sum+0x30>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110e <sum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
mov    %rax,%rdx
imul   %rcx,%rdx
shr    %rdx
imul   %edi,%eax
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = add i32 %0, -1
%3 = zext i32 %0 to i33
%4 = zext i32 %2 to i33
%5 = mul i33 %3, %4
%6 = lshr i33 %5, 1
%7 = trunc i33 %6 to i32
%8 = mul i32 %2, %0
%9 = sub i32 %8, %7
ret i32 %9
}
/* Variables and functions */
void puts(const char *s) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ log10f(int /*<<< orphan*/);
uint8_t bear_log10(uint8_t value) { return log10f(value); }


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

x86 assembly (clang, -O2):
<bear_log10>:
jmp    1030 <log10f@plt>

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

LLVM IR (-O2):
define i32 @bear_log10(i32 %0) {
%2 = tail call i32 @log10f(i32 %0)
ret i32 %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
int Sort_String(const void *a, const void *b) {
  return (strcmp((*(const char **)(a)), (*(const char **)(b))));
}


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

x86 assembly (clang, -O2):
<Sort_String>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @Sort_String(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @Sort_String(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}