xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "Usage:\t%s [<num-of-bytes>] [<num-of-loops>] [<fill-byte>]\n", prog);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"Usage:\09%s [<num-of-bytes>] [<num-of-loops>] [<fill-byte>]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"Usage:\09%s [<num-of-bytes>] [<num-of-loops>] [<fill-byte>]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
unsigned char fanout(unsigned char a, unsigned char b) {
  unsigned char v =
      a * (b & 0x1) | a * (b & 0x2) | a * (b & 0x4) | a * (b & 0x8);
  return (v | (v >> 4)) & 0xf;
}


x86 assembly (clang, -O0):
<fanout>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
and    $0x1,%ecx
imul   %ecx,%eax
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%edx
and    $0x2,%edx
imul   %edx,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%edx
and    $0x4,%edx
imul   %edx,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%edx
and    $0x8,%edx
imul   %edx,%ecx
or     %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x3(%rbp),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
and    $0xf,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fanout>:
mov    %esi,%eax
and    $0x1,%al
mul    %dil
mov    %eax,%ecx
mov    %esi,%eax
and    $0x2,%al
mul    %dil
mov    %eax,%edx
or     %cl,%dl
mov    %esi,%eax
and    $0x4,%al
mul    %dil
mov    %eax,%ecx
and    $0x8,%sil
mov    %esi,%eax
mul    %dil
or     %cl,%al
or     %dl,%al
mov    %eax,%ecx
shr    $0x4,%cl
and    $0xf,%al
or     %cl,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @fanout(i8 zeroext %0, i8 zeroext %1) {
%3 = and i8 %1, 1
%4 = mul nuw nsw i8 %3, %0
%5 = and i8 %1, 2
%6 = mul i8 %5, %0
%7 = or i8 %4, %6
%8 = and i8 %1, 4
%9 = mul i8 %8, %0
%10 = or i8 %7, %9
%11 = and i8 %1, 8
%12 = mul i8 %11, %0
%13 = or i8 %10, %12
%14 = lshr i8 %13, 4
%15 = and i8 %13, 15
%16 = or i8 %14, %15
ret i8 %16
}
void __attribute__((warning("curl_easy_setopt expects a string (char* or "
                            "char[]) argument for this option")))
__attribute__((unused)) __attribute__((no)) _curl_easy_setopt_err_string(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_string() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
double Function1Double(double x) { return x + 42.0; }


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

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

LLVM IR (-O0):
define double @Function1Double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 4.200000e+01
ret double %4
}

LLVM IR (-O2):
define double @Function1Double(double %0) {
%2 = fadd double %0, 4.200000e+01
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ matNf_print(float const *, int);
void mat4f_print(const float m[16]) { matNf_print(m, 4); }


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

x86 assembly (clang, -O2):
<mat4f_print>:
mov    $0x4,%esi
jmp    1030 <matNf_print@plt>

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

LLVM IR (-O2):
define void @mat4f_print(float* %0) {
%2 = tail call i32 @matNf_print(float* %0, i32 4)
ret void
}
int wordlength(void) {
  int i;
  unsigned v = (unsigned)~0;
  for (i = 0; (v = v >> 1) > 0; i++) {
    ;
  }
  return i;
}


x86 assembly (clang, -O0):
<wordlength>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jbe    1137 <wordlength+0x37>
jmp    1129 <wordlength+0x29>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <wordlength+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @wordlength() {
ret i32 31
}
/* Variables and functions */
scalar_t__ sqrt(float);
void Normalize2D(float v[2]) {
  float len;
  len = (float)sqrt(v[0] * v[0] + v[1] * v[1]);
  v[0] /= len;
  v[1] /= len;
}


x86 assembly (clang, -O0):
<Normalize2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Normalize2D>:
push   %rbx
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  (%rbx),%xmm1
movss  0x4(%rbx),%xmm2
divss  %xmm0,%xmm1
movss  %xmm1,(%rbx)
divss  %xmm0,%xmm2
movss  %xmm2,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @Normalize2D(float* %0) {
%2 = alloca float*
%3 = alloca float
store float* %0, float** %2
%4 = load float*, float** %2
%5 = getelementptr inbounds float, float* %4, i64 0
%6 = load float, float* %5
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %2
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
%15 = load float, float* %14
%16 = fmul float %12, %15
%17 = call float @llvm.fmuladd.f32(float %6, float %9, float %16)
%18 = call i64 @sqrt(float %17)
%19 = sitofp i64 %18 to float
store float %19, float* %3
%20 = load float, float* %3
%21 = load float*, float** %2
%22 = getelementptr inbounds float, float* %21, i64 0
%23 = load float, float* %22
%24 = fdiv float %23, %20
store float %24, float* %22
%25 = load float, float* %3
%26 = load float*, float** %2
%27 = getelementptr inbounds float, float* %26, i64 1
%28 = load float, float* %27
%29 = fdiv float %28, %25
store float %29, float* %27
ret void
}

LLVM IR (-O2):
define void @Normalize2D(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = tail call i64 @sqrt(float %6)
%8 = sitofp i64 %7 to float
%9 = load float, float* %0
%10 = fdiv float %9, %8
store float %10, float* %0
%11 = load float, float* %3
%12 = fdiv float %11, %8
store float %12, float* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CALC_appendString(char *);
void CALC_addAdd() { CALC_appendString("+"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"+\00"
define void @CALC_addAdd() {
%1 = call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"+\00"
define void @CALC_addAdd() {
%1 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(int);
scalar_t__ size_multiply_overflow(size_t, size_t);
__attribute__((__malloc__)) __attribute__((__alloc_size__(1, 2))) void *
malloc_multiply(size_t size, size_t need) {
  if (size_multiply_overflow(size, need))
    return NULL;
  return malloc(size * need ?: 1);
}


x86 assembly (clang, -O0):
<malloc_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <size_multiply_overflow@plt>
cmp    $0x0,%rax
je     1154 <malloc_multiply+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1195 <malloc_multiply+0x75>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1178 <malloc_multiply+0x58>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1186 <malloc_multiply+0x66>
mov    $0x1,%eax
mov    %rax,-0x28(%rbp)
jmp    1186 <malloc_multiply+0x66>
mov    -0x28(%rbp),%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_multiply>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <size_multiply_overflow@plt>
test   %rax,%rax
je     113e <malloc_multiply+0x1e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
imul   %r14,%rbx
test   %rbx,%rbx
mov    $0x1,%edi
cmovne %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define noalias i8* @malloc_multiply(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = call i64 @size_multiply_overflow(i64 %6, i64 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i8* null, i8** %3
br label %22
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = mul i64 %12, %13
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
br label %18
17: ; preds = %11
br label %18
18: ; preds = %17, %16
%19 = phi i64 [ %14, %16 ], [ 1, %17 ]
%20 = trunc i64 %19 to i32
%21 = call i8* @malloc(i32 %20)
store i8* %21, i8** %3
br label %22
22: ; preds = %18, %10
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define noalias i8* @malloc_multiply(i64 %0, i64 %1) {
%3 = tail call i64 @size_multiply_overflow(i64 %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = mul i64 %1, %0
%7 = icmp eq i64 %6, 0
%8 = trunc i64 %6 to i32
%9 = select i1 %7, i32 1, i32 %8
%10 = tail call i8* @malloc(i32 %9)
br label %11
11: ; preds = %2, %5
%12 = phi i8* [ %10, %5 ], [ null, %2 ]
ret i8* %12
}
/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ realpath(char *, char *);
char *strdup(char *);
char *strrchr(char *, char);
char *os_apppath(char *parm) {
  char path[PATH_MAX];
  realpath(parm, path);
  if (strrchr(path, '/')) {
    *strrchr(path, '/') = '\0';
  }
  return strdup(path);
}


x86 assembly (clang, -O0):
<os_apppath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0x20(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <realpath@plt>
mov    -0x20(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
cmp    $0x0,%rax
je     119a <os_apppath+0x6a>
mov    -0x20(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
call   1050 <strdup@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_apppath>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rsi
call   1040 <realpath@plt>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     116d <os_apppath+0x3d>
movb   $0x0,(%rax)
mov    %rbx,%rdi
call   1050 <strdup@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
define i8* @os_apppath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i32, i32* @PATH_MAX
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %2
%10 = call i32 @realpath(i8* %9, i8* %8)
%11 = call i8* @strrchr(i8* %8, i8 signext 47)
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i8* @strrchr(i8* %8, i8 signext 47)
store i8 0, i8* %14
br label %15
15: ; preds = %13, %1
%16 = call i8* @strdup(i8* %8)
%17 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
define noalias i8* @os_apppath(i8* nocapture %0) {
%2 = load i32, i32* @PATH_MAX
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = call i32 @realpath(i8* %0, i8* %4)
%6 = call i8* @strrchr(i8* %4, i8 signext 47)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8 0, i8* %6
br label %9
9: ; preds = %8, %1
%10 = call i8* @strdup(i8* %4)
ret i8* %10
}
unsigned int build_num(char *c) {
  unsigned int i = 0;
  int end_of_operand_flag = 0;
  return i;
}


x86 assembly (clang, -O0):
<build_num>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @build_num(i8* nocapture readnone %0) {
ret i32 0
}
int lonelyinteger(int a_size, int *a) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lonelyinteger(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct katcp_notice {
  int dummy;
};
struct katcp_dispatch {
  int dummy;
};

/* Variables and functions */
struct katcp_notice *create_parse_notice_katcp(struct katcp_dispatch *, char *,
                                               unsigned int,
                                               int /*<<< orphan*/ *);
struct katcp_notice *create_notice_katcp(struct katcp_dispatch *d, char *name,
                                         unsigned int tag) {
  struct katcp_notice *n;
  n = create_parse_notice_katcp(d, name, tag, NULL);
  if (n == NULL) {
    return NULL;
  }
  return n;
}


x86 assembly (clang, -O0):
<create_notice_katcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <create_parse_notice_katcp@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1153 <create_notice_katcp+0x43>
movq   $0x0,-0x8(%rbp)
jmp    115b <create_notice_katcp+0x4b>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_notice_katcp>:
xor    %ecx,%ecx
jmp    1030 <create_parse_notice_katcp@plt>

LLVM IR (-O0):
%struct.katcp_notice = type { i32 }
%struct.katcp_dispatch = type { i32 }
define %struct.katcp_notice* @create_notice_katcp(%struct.katcp_dispatch* %0, i8* %1, i32 %2) {
%4 = alloca %struct.katcp_notice*
%5 = alloca %struct.katcp_dispatch*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.katcp_notice*
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call %struct.katcp_notice* @create_parse_notice_katcp(%struct.katcp_dispatch* %9, i8* %10, i32 %11, i32* null)
store %struct.katcp_notice* %12, %struct.katcp_notice** %8
%13 = load %struct.katcp_notice*, %struct.katcp_notice** %8
%14 = icmp eq %struct.katcp_notice* %13, null
br i1 %14, label %15, label %16
15: ; preds = %3
store %struct.katcp_notice* null, %struct.katcp_notice** %4
br label %18
16: ; preds = %3
%17 = load %struct.katcp_notice*, %struct.katcp_notice** %8
store %struct.katcp_notice* %17, %struct.katcp_notice** %4
br label %18
18: ; preds = %16, %15
%19 = load %struct.katcp_notice*, %struct.katcp_notice** %4
ret %struct.katcp_notice* %19
}

LLVM IR (-O2):
%struct.katcp_notice = type { i32 }
%struct.katcp_dispatch = type { i32 }
define %struct.katcp_notice* @create_notice_katcp(%struct.katcp_dispatch* %0, i8* %1, i32 %2) {
%4 = tail call %struct.katcp_notice* @create_parse_notice_katcp(%struct.katcp_dispatch* %0, i8* %1, i32 %2, i32* null)
ret %struct.katcp_notice* %4
}
void __attribute__((visibility("protected"))) baz(void) {}


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

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

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

LLVM IR (-O2):
define protected void @baz() {
ret void
}
int function(int x) {
  if (x % 400 == 0) {
    return 29;
  } else if (x % 100 == 0) {
    return 28;
  } else if (x % 4 == 0) {
    return 29;
  } else {
    return 28;
  }
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <function+0x27>
movl   $0x1d,-0x4(%rbp)
jmp    116e <function+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <function+0x47>
movl   $0x1c,-0x4(%rbp)
jmp    116e <function+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <function+0x67>
movl   $0x1d,-0x4(%rbp)
jmp    116e <function+0x6e>
movl   $0x1c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112f <function+0x2f>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1135 <function+0x35>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
or     $0x1c,%eax
ret
mov    $0x1d,%eax
ret
mov    $0x1c,%eax
ret

LLVM IR (-O0):
define i32 @function(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 29, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = srem i32 %9, 100
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 28, i32* %2
br label %19
13: ; preds = %8
%14 = load i32, i32* %3
%15 = srem i32 %14, 4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 29, i32* %2
br label %19
18: ; preds = %13
store i32 28, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @function(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 29, i32 28
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 29, %1 ], [ 28, %4 ], [ %10, %7 ]
ret i32 %12
}
long double rintl(long double x) {
  __asm__("frndint" : "+t"(x));
  return x;
}


x86 assembly (clang, -O0):
<rintl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
frndint
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintl>:
fldt   0x8(%rsp)
frndint
ret

LLVM IR (-O0):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 asm "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %3)
store x86_fp80 %4, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = tail call x86_fp80 asm "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
ret x86_fp80 %2
}
int arg_const_int(const int i, const int j) {
  (void)j;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @arg_const_int(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ fn(int, int, int, int, int, int, int, int, int);
int main() {
  fn(0x123, 0x456, 0x789, 0xabc, 0xdef, 0x1234567887654321, 0xcba, 0xcba,
     0xcba);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x123,%edi
mov    $0x456,%esi
mov    $0x789,%edx
mov    $0xabc,%ecx
mov    $0xdef,%r8d
mov    $0x87654321,%r9d
movl   $0xcba,(%rsp)
movl   $0xcba,0x8(%rsp)
movl   $0xcba,0x10(%rsp)
call   1030 <fn@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
mov    $0x123,%edi
mov    $0x456,%esi
mov    $0x789,%edx
mov    $0xabc,%ecx
mov    $0xdef,%r8d
mov    $0x87654321,%r9d
push   $0xcba
push   $0xcba
push   $0xcba
call   1030 <fn@plt>
add    $0x20,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fn(i32 291, i32 1110, i32 1929, i32 2748, i32 3567, i32 -2023406815, i32 3258, i32 3258, i32 3258)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fn(i32 291, i32 1110, i32 1929, i32 2748, i32 3567, i32 -2023406815, i32 3258, i32 3258, i32 3258)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ getstr(char *, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
void do_system(void) {
  char line[512];
  getstr("\n\nEnter system command", line);
  if (*line != '\0')
    system(line);
  fprintf(stdout, "\n\n");
}


x86 assembly (clang, -O0):
<do_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x200(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <getstr@plt>
movsbl -0x200(%rbp),%eax
cmp    $0x0,%eax
je     116a <do_system+0x3a>
lea    -0x200(%rbp),%rdi
call   1030 <system@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_system>:
sub    $0x208,%rsp
lea    0xec2(%rip),%rdi
mov    %rsp,%rsi
call   1040 <getstr@plt>
cmpb   $0x0,(%rsp)
je     1154 <do_system+0x24>
mov    %rsp,%rdi
call   1030 <system@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x208,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0A\0AEnter system command\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"\0A\0A\00"
define void @do_system() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @getstr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%10 = call i32 @system(i8* %9)
br label %11
11: ; preds = %8, %0
%12 = load i32, i32* @stdout
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0A\0AEnter system command\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"\0A\0A\00"
define void @do_system() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @getstr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @system(i8* %2)
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* @stdout
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void _M2_termios_init(void) {}


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

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

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

LLVM IR (-O2):
define void @_M2_termios_init() {
ret void
}
double _airSanityHelper(double val) { return val * val * val; }


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

x86 assembly (clang, -O2):
<_airSanityHelper>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @_airSanityHelper(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
int GetGpioAddress() { return 0x20200000; }


x86 assembly (clang, -O0):
<GetGpioAddress>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20200000,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @GetGpioAddress() {
ret i32 538968064
}

LLVM IR (-O2):
define i32 @GetGpioAddress() {
ret i32 538968064
}
/* Variables and functions */
int log(double);
double logfactorial(int);
double log_dpoiss(int x, double lambda) {
  return x * log(lambda) - lambda - logfactorial(x);
}


x86 assembly (clang, -O0):
<log_dpoiss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <logfactorial@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_dpoiss>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %edi,%ebx
call   1040 <log@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
subsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1030 <logfactorial@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @log_dpoiss(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = load double, double* %4
%7 = call i32 @log(double %6)
%8 = mul nsw i32 %5, %7
%9 = sitofp i32 %8 to double
%10 = load double, double* %4
%11 = fsub double %9, %10
%12 = load i32, i32* %3
%13 = call double @logfactorial(i32 %12)
%14 = fsub double %11, %13
ret double %14
}

LLVM IR (-O2):
define double @log_dpoiss(i32 %0, double %1) {
%3 = tail call i32 @log(double %1)
%4 = mul nsw i32 %3, %0
%5 = sitofp i32 %4 to double
%6 = fsub double %5, %1
%7 = tail call double @logfactorial(i32 %0)
%8 = fsub double %6, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ windup();
void rnv_clear(void) { windup(); }


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

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

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

LLVM IR (-O2):
define void @rnv_clear() {
%1 = tail call i32 (...) @windup()
ret void
}
void foo_1() { printf("%s\n", __func__); }


x86 assembly (clang, -O0):
<foo_1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.foo_1 = [6 x i8] c"foo_1\00"
define void @foo_1() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.foo_1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.foo_1 = [6 x i8] c"foo_1\00"
define void @foo_1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.foo_1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char);
int httplex__is_key_char(char c) { return isalnum(c) || c == '-'; }


x86 assembly (clang, -O0):
<httplex__is_key_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <httplex__is_key_char+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<httplex__is_key_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x2d,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @httplex__is_key_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @httplex__is_key_char(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 45
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ drawellip(int, int);
void drawcirc(int d) { drawellip(d, d); }


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

x86 assembly (clang, -O2):
<drawcirc>:
mov    %edi,%esi
jmp    1030 <drawellip@plt>

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

LLVM IR (-O2):
define void @drawcirc(i32 %0) {
%2 = tail call i32 @drawellip(i32 %0, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gw_debug(char *, unsigned char *, unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
int serial_recv_process(unsigned char *read_buf, unsigned int n) {
  printf("serial read: FE %02x ", n + 2);
  gw_debug("", read_buf, n);
  char *zErrMsg = 0;
  char **azResult;
  int nrow, ncolumn;
  char tmp_buf[32], str_buf[256], str_sql[256];
  unsigned char write_buf[256];
  return 0;
}


x86 assembly (clang, -O0):
<serial_recv_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
add    $0x2,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1040 <gw_debug@plt>
movq   $0x0,-0x18(%rbp)
xor    %eax,%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_recv_process>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x2(%rbx),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <gw_debug@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"serial read: FE %02x \00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @serial_recv_process(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca [32 x i8]
%10 = alloca [256 x i8]
%11 = alloca [256 x i8]
%12 = alloca [256 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%13 = load i32, i32* %4
%14 = add i32 %13, 2
%15 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i8*, i8** %3
%17 = load i32, i32* %4
%18 = call i32 @gw_debug(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %16, i32 %17)
store i8* null, i8** %5
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"serial read: FE %02x \00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @serial_recv_process(i8* %0, i32 %1) {
%3 = add i32 %1, 2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @gw_debug(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1)
ret i32 0
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int vec3_is_nearly_equal(float *, float *, float);
__attribute__((always_)) bool
psvec3_is_nearly_equal(struct vec3 *a, struct vec3 *b, float epsilon) {
  return vec3_is_nearly_equal((float *)a, (float *)b, epsilon);
}


x86 assembly (clang, -O0):
<psvec3_is_nearly_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
call   1030 <vec3_is_nearly_equal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec3_is_nearly_equal>:
jmp    1030 <vec3_is_nearly_equal@plt>

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define i32 @psvec3_is_nearly_equal(%struct.vec3* %0, %struct.vec3* %1, float %2) {
%4 = alloca %struct.vec3*
%5 = alloca %struct.vec3*
%6 = alloca float
store %struct.vec3* %0, %struct.vec3** %4
store %struct.vec3* %1, %struct.vec3** %5
store float %2, float* %6
%7 = load %struct.vec3*, %struct.vec3** %4
%8 = bitcast %struct.vec3* %7 to float*
%9 = load %struct.vec3*, %struct.vec3** %5
%10 = bitcast %struct.vec3* %9 to float*
%11 = load float, float* %6
%12 = call i32 @vec3_is_nearly_equal(float* %8, float* %10, float %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define i32 @psvec3_is_nearly_equal(%struct.vec3* %0, %struct.vec3* %1, float %2) {
%4 = bitcast %struct.vec3* %0 to float*
%5 = bitcast %struct.vec3* %1 to float*
%6 = tail call i32 @vec3_is_nearly_equal(float* %4, float* %5, float %2)
ret i32 %6
}
__attribute__((visibility("default"))) unsigned long long int
udev_queue_get_kernel_seqnum(struct udev_queue *udev_queue) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.udev_queue = type opaque
define i64 @udev_queue_get_kernel_seqnum(%struct.udev_queue* %0) {
%2 = alloca %struct.udev_queue*
store %struct.udev_queue* %0, %struct.udev_queue** %2
ret i64 0
}

LLVM IR (-O2):
%struct.udev_queue = type opaque
define i64 @udev_queue_get_kernel_seqnum(%struct.udev_queue* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ do_cmd(char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  setbuf(stdout, NULL);
  while (--argc > 0) {
    do_cmd(*++argv);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1177 <main+0x57>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1040 <do_cmd@plt>
jmp    1148 <main+0x28>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
cmp    $0x2,%ebp
jl     1164 <main+0x44>
add    $0x8,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%rdi
call   1040 <do_cmd@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @setbuf(i32 %3, i32* null)
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i8** [ %10, %6 ], [ %1, %2 ]
%8 = phi i32 [ %9, %6 ], [ %0, %2 ]
%9 = add nsw i32 %8, -1
%10 = getelementptr inbounds i8*, i8** %7, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @do_cmd(i8* %11)
%13 = icmp ugt i32 %8, 2
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Name:    Liangming Chen\n");
  printf("Address: Kunming, Yunnan, China\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%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
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Name: Liangming Chen\0A\00"
@.str.1 = [33 x i8] c"Address: Kunming, Yunnan, China\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Name: Liangming Chen\00"
@str.2 = [32 x i8] c"Address: Kunming, Yunnan, China\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ nocbreak();
byebye() {
  nocbreak();
  exit(0);
}


x86 assembly (clang, -O0):
<byebye>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nocbreak@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<byebye>:
push   %rax
xor    %eax,%eax
call   1030 <nocbreak@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @byebye() {
%1 = call i32 (...) @nocbreak()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @byebye() {
%1 = tail call i32 (...) @nocbreak()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
size_t resdet_default_range() { return 12; }


x86 assembly (clang, -O0):
<resdet_default_range>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @resdet_default_range() {
ret i64 12
}

LLVM IR (-O2):
define i64 @resdet_default_range() {
ret i64 12
}
float Invsqrt(float x) {
  float xhalf = 0.5f * x;
  union {
    float x;
    int i;
  } u;
  u.x = x;
  u.i = 0x5f3759df - (u.i >> 1);
  u.x = u.x * (1.5f - xhalf * u.x * u.x);
  return u.x;
}


x86 assembly (clang, -O0):
<Invsqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe9e(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Invsqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @Invsqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca %union.anon
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = load float, float* %2
%8 = bitcast %union.anon* %4 to float*
store float %7, float* %8
%9 = bitcast %union.anon* %4 to i32*
%10 = load i32, i32* %9
%11 = ashr i32 %10, 1
%12 = sub nsw i32 1597463007, %11
%13 = bitcast %union.anon* %4 to i32*
store i32 %12, i32* %13
%14 = bitcast %union.anon* %4 to float*
%15 = load float, float* %14
%16 = load float, float* %3
%17 = bitcast %union.anon* %4 to float*
%18 = load float, float* %17
%19 = fmul float %16, %18
%20 = bitcast %union.anon* %4 to float*
%21 = load float, float* %20
%22 = fneg float %19
%23 = call float @llvm.fmuladd.f32(float %22, float %21, float 1.500000e+00)
%24 = fmul float %15, %23
%25 = bitcast %union.anon* %4 to float*
store float %24, float* %25
%26 = bitcast %union.anon* %4 to float*
%27 = load float, float* %26
ret float %27
}

LLVM IR (-O2):
define float @Invsqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ mdfour(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/);
void Com_BlockFullChecksum(void *buffer, int32_t len, uint8_t *outbuf) {
  mdfour(outbuf, (uint8_t *)buffer, len);
}


x86 assembly (clang, -O0):
<Com_BlockFullChecksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <mdfour@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_BlockFullChecksum>:
mov    %rdx,%rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rax,%rdi
jmp    1030 <mdfour@plt>

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

LLVM IR (-O2):
define void @Com_BlockFullChecksum(i8* %0, i32 %1, i32* %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @mdfour(i32* %2, i32* %4, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glmPow3fv(float *, float *, float const *);
void glmPow3fv_(float x[3], const float y[3]) { glmPow3fv(x, x, y); }


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

x86 assembly (clang, -O2):
<glmPow3fv_>:
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <glmPow3fv@plt>

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

LLVM IR (-O2):
define void @glmPow3fv_(float* %0, float* %1) {
%3 = tail call i32 @glmPow3fv(float* %0, float* %0, float* %1)
ret void
}