xunge/DecIR huggingface dataset:
float Variance(int i, int j, float **delta) {
  if (i > j)
    return (delta[j][i]);
  else
    return (delta[i][j]);
}


x86 assembly (clang, -O0):
<Variance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1139 <Variance+0x39>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <Variance+0x53>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Variance>:
cmp    %esi,%edi
mov    %edi,%eax
cmovg  %esi,%eax
cmovg  %edi,%esi
cltq
mov    (%rdx,%rax,8),%rax
movslq %esi,%rcx
movss  (%rax,%rcx,4),%xmm0
ret

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

LLVM IR (-O2):
define float @Variance(i32 %0, i32 %1, float** nocapture %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = select i1 %4, i32 %0, i32 %1
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds float*, float** %2, i64 %7
%9 = load float*, float** %8
%10 = sext i32 %6 to i64
%11 = getelementptr inbounds float, float* %9, i64 %10
%12 = load float, float* %11
ret float %12
}
/* Variables and functions */
float mmapAdd(float *, long, float);
float mmapSub(float *addr, long i, float v) { return mmapAdd(addr, i, -v); }


x86 assembly (clang, -O0):
<mmapSub>:
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
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <mmapAdd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmapSub>:
xorps  0xee9(%rip),%xmm0
jmp    1030 <mmapAdd@plt>

LLVM IR (-O0):
define float @mmapSub(float* %0, i64 %1, float %2) {
%4 = alloca float*
%5 = alloca i64
%6 = alloca float
store float* %0, float** %4
store i64 %1, i64* %5
store float %2, float* %6
%7 = load float*, float** %4
%8 = load i64, i64* %5
%9 = load float, float* %6
%10 = fneg float %9
%11 = call float @mmapAdd(float* %7, i64 %8, float %10)
ret float %11
}

LLVM IR (-O2):
define float @mmapSub(float* %0, i64 %1, float %2) {
%4 = fneg float %2
%5 = tail call float @mmapAdd(float* %0, i64 %1, float %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int main(int argc, char *argv[]) {
  print("Hello World!\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
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 = call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void writeln(const char *s) { printf("%s\n", s); }


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

x86 assembly (clang, -O2):
<writeln>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writeln(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned char saturateValue(float f) {
  return (unsigned char)(f >= 255 ? 255 : (f < 0 ? 0 : f));
}


x86 assembly (clang, -O0):
<saturateValue>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <saturateValue+0x31>
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    115f <saturateValue+0x5f>
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    114b <saturateValue+0x4b>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1155 <saturateValue+0x55>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<saturateValue>:
xorps  %xmm1,%xmm1
maxss  %xmm0,%xmm1
movss  0xef1(%rip),%xmm2
movaps %xmm2,%xmm3
cmpless %xmm0,%xmm3
movaps %xmm3,%xmm0
andnps %xmm1,%xmm0
andps  %xmm2,%xmm3
orps   %xmm0,%xmm3
cvttss2si %xmm3,%eax
ret

LLVM IR (-O0):
define zeroext i8 @saturateValue(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 2.550000e+02
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load float, float* %2
%8 = fcmp olt float %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load float, float* %2
br label %12
12: ; preds = %10, %9
%13 = phi float [ 0.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi float [ 2.550000e+02, %5 ], [ %13, %12 ]
%16 = fptoui float %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @saturateValue(float %0) {
%2 = fcmp oge float %0, 2.550000e+02
%3 = fcmp olt float %0, 0.000000e+00
%4 = select i1 %3, float 0.000000e+00, float %0
%5 = select i1 %2, float 2.550000e+02, float %4
%6 = fptoui float %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ DrawTextln130(char const *, unsigned long);
void drawtextln(const char *s, unsigned long cfg) { DrawTextln130(s, cfg); }


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

x86 assembly (clang, -O2):
<drawtextln>:
jmp    1030 <DrawTextln130@plt>

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

LLVM IR (-O2):
define void @drawtextln(i8* %0, i64 %1) {
%3 = tail call i32 @DrawTextln130(i8* %0, i64 %1)
ret void
}
char ptr_equals(const void *o1, const void *o2) { return o1 == o2; }


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

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

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

LLVM IR (-O2):
define signext i8 @ptr_equals(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int strcmp(char *, char *);
int smm_fncmp(char *dstname, char *srcname) { return strcmp(dstname, srcname); }


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

x86 assembly (clang, -O2):
<smm_fncmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @smm_fncmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
char *askStringQuestion(char *question, int maxLength) {
  char *answer = calloc(maxLength + 1, sizeof(char));
  printf("%s\n> ", question);
  fgets(answer, maxLength, stdin);
  fflush(stdin);
  return answer;
}


x86 assembly (clang, -O0):
<askStringQuestion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e67(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<askStringQuestion>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
lea    0xe9d(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    0x2e76(%rip),%r14
mov    (%r14),%edx
mov    %rbx,%rdi
mov    %r15d,%esi
call   1040 <fgets@plt>
mov    (%r14),%edi
call   1060 <fflush@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s\0A> \00"
@stdin = global i32 0
define i8* @askStringQuestion(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i8* @calloc(i32 %7, i32 1)
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %11, i32 %12, i32 %13)
%15 = load i32, i32* @stdin
%16 = call i32 @fflush(i32 %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s\0A> \00"
@stdin = global i32 0
define i8* @askStringQuestion(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @calloc(i32 %3, i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stdin
%7 = tail call i32 @fgets(i8* %4, i32 %1, i32 %6)
%8 = load i32, i32* @stdin
%9 = tail call i32 @fflush(i32 %8)
ret i8* %4
}
double kahan_accum(double accum, double *pcompensation, double x) {
  double y = x - *pcompensation;
  double t = accum + y;
  *pcompensation = (t - accum) - y;
  return t;
}


x86 assembly (clang, -O0):
<kahan_accum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kahan_accum>:
subsd  (%rdi),%xmm1
movapd %xmm1,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,%xmm3
subsd  %xmm0,%xmm3
subsd  %xmm1,%xmm3
movsd  %xmm3,(%rdi)
movapd %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @kahan_accum(double %0, double* nocapture %1, double %2) {
%4 = load double, double* %1
%5 = fsub double %2, %4
%6 = fadd double %5, %0
%7 = fsub double %6, %0
%8 = fsub double %7, %5
store double %8, double* %1
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ drop_caches();
int /*<<< orphan*/ sync();
void flush_disk_buffers(void) {
  sync();
  drop_caches();
}


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

x86 assembly (clang, -O2):
<flush_disk_buffers>:
push   %rax
xor    %eax,%eax
call   1030 <sync@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <drop_caches@plt>

LLVM IR (-O0):
define void @flush_disk_buffers() {
%1 = call i32 (...) @sync()
%2 = call i32 (...) @drop_caches()
ret void
}

LLVM IR (-O2):
define void @flush_disk_buffers() {
%1 = tail call i32 (...) @sync()
%2 = tail call i32 (...) @drop_caches()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xwrite(int);
name(int *s) {
  while (*s) {
    xwrite(*s);
    s = s + 1;
  }
}


x86 assembly (clang, -O0):
<name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1145 <name+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <xwrite@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <name+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     112f <name+0x1f>
add    $0x4,%rbx
xchg   %ax,%ax
call   1030 <xwrite@plt>
mov    (%rbx),%edi
add    $0x4,%rbx
test   %edi,%edi
jne    1120 <name+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @name(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ %2, %1 ]
%6 = phi i32* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @xwrite(i32 %5)
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void applytestfn(void *v) {
  char *item = v;
  printf("Item: %s\n", item);
}


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

x86 assembly (clang, -O2):
<applytestfn>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"Item: %s\0A\00"
define void @applytestfn(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void sendbyte(unsigned char byte) {
  unsigned short port = 0x3f5;
  unsigned char msr;
  while (1) {
    msr = inb(0x3f4) & 0xC0;
    if (msr == 0x80) {
      __asm__("outb %0,%1" ::"a"(byte), "d"(port));
      return;
    }
  }
}


x86 assembly (clang, -O0):
<sendbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movw   $0x3f5,-0x4(%rbp)
mov    $0x3f4,%edi
mov    $0x0,%al
call   1030 <inb@plt>
and    $0xc0,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x80,%eax
jne    1155 <sendbyte+0x45>
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
add    $0x10,%rsp
pop    %rbp
ret
jmp    1124 <sendbyte+0x14>

x86 assembly (clang, -O2):
<sendbyte>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x3f4,%edi
xor    %eax,%eax
call   1030 <inb@plt>
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1120 <sendbyte+0x10>
mov    %ebx,%eax
mov    $0x3f5,%dx
out    %al,(%dx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sendbyte(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i16
%4 = alloca i8
store i8 %0, i8* %2
store i16 1013, i16* %3
br label %5
5: ; preds = %1, %15
%6 = call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1012)
%7 = and i32 %6, 192
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 128
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = load i8, i8* %2
%14 = load i16, i16* %3
ret void
15: ; preds = %5
br label %5
}

LLVM IR (-O2):
define void @sendbyte(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1012)
%4 = and i32 %3, 192
%5 = icmp eq i32 %4, 128
br i1 %5, label %6, label %2
6: ; preds = %2
tail call void asm sideeffect "outb $0,$1", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 1013)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glLightfv_size(int /*<<< orphan*/);
GLint __glLightiv_size(GLenum pname) { return __glLightfv_size(pname); }


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

x86 assembly (clang, -O2):
<__glLightiv_size>:
jmp    1030 <__glLightfv_size@plt>

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

LLVM IR (-O2):
define i32 @__glLightiv_size(i32 %0) {
%2 = tail call i32 @__glLightfv_size(i32 %0)
ret i32 %2
}
void zoo_set_debug_level(int level) {}


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

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

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

LLVM IR (-O2):
define void @zoo_set_debug_level(i32 %0) {
ret void
}
int num_len(int num) {
  int i = 0;
  do {
    num /= 10;
    ++i;
  } while (num);
  return i;
}


x86 assembly (clang, -O0):
<num_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    110e <num_len+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_len>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <num_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @num_len(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = phi i32 [ 0, %1 ], [ %6, %2 ]
%5 = sdiv i32 %3, 10
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %3, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ call_me_from_arm();
int main(void) {
  call_me_from_arm();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @call_me_from_arm()
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int xio_thread_clock_gettime(clockid_t clk_id, struct timespec *ts) {
  if (clock_gettime(clk_id, ts) != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<xio_thread_clock_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
je     1141 <xio_thread_clock_gettime+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <xio_thread_clock_gettime+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xio_thread_clock_gettime>:
push   %rax
call   1030 <clock_gettime@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @xio_thread_clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timespec*
store i32 %0, i32* %4
store %struct.timespec* %1, %struct.timespec** %5
%6 = load i32, i32* %4
%7 = load %struct.timespec*, %struct.timespec** %5
%8 = call i64 @clock_gettime(i32 %6, %struct.timespec* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @xio_thread_clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = tail call i64 @clock_gettime(i32 %0, %struct.timespec* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ getc(int /*<<< orphan*/ *);
long getlong(FILE *f) {
  unsigned long value;
  value = (unsigned long)getc(f) << 24;
  value |= (unsigned long)getc(f) << 16;
  value |= (unsigned long)getc(f) << 8;
  value |= (unsigned long)getc(f);
  return value;
}


x86 assembly (clang, -O0):
<getlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x18,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x10,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x8,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlong>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <getc@plt>
mov    %rax,%r15
shl    $0x18,%r15
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %rax,%rbx
shl    $0x10,%rbx
or     %r15,%rbx
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %rax,%r15
shl    $0x8,%r15
mov    %r14,%rdi
call   1030 <getc@plt>
or     %r15,%rax
or     %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @getlong(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @getc(i32* %4)
%6 = shl i64 %5, 24
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = call i64 @getc(i32* %7)
%9 = shl i64 %8, 16
%10 = load i64, i64* %3
%11 = or i64 %10, %9
store i64 %11, i64* %3
%12 = load i32*, i32** %2
%13 = call i64 @getc(i32* %12)
%14 = shl i64 %13, 8
%15 = load i64, i64* %3
%16 = or i64 %15, %14
store i64 %16, i64* %3
%17 = load i32*, i32** %2
%18 = call i64 @getc(i32* %17)
%19 = load i64, i64* %3
%20 = or i64 %19, %18
store i64 %20, i64* %3
%21 = load i64, i64* %3
ret i64 %21
}

LLVM IR (-O2):
define i64 @getlong(i32* nocapture %0) {
%2 = tail call i64 @getc(i32* %0)
%3 = shl i64 %2, 24
%4 = tail call i64 @getc(i32* %0)
%5 = shl i64 %4, 16
%6 = or i64 %5, %3
%7 = tail call i64 @getc(i32* %0)
%8 = shl i64 %7, 8
%9 = or i64 %6, %8
%10 = tail call i64 @getc(i32* %0)
%11 = or i64 %9, %10
ret i64 %11
}
void RTStrAllocExTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrAllocExTag() {
ret void
}
void openSystemLog(void) {}


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

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

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

LLVM IR (-O2):
define void @openSystemLog() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA(int, int);
void RamAccFixMod(unsigned char UcAccMod) {
  switch (UcAccMod) {
  case 0x00:
    RegWriteA(0x018C, 0x00);
    break;
  case 0x01:
    RegWriteA(0x018C, 0x31);
    break;
  }
}


x86 assembly (clang, -O0):
<RamAccFixMod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1143 <RamAccFixMod+0x33>
jmp    1132 <RamAccFixMod+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1154 <RamAccFixMod+0x44>
jmp    1163 <RamAccFixMod+0x53>
mov    $0x18c,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
jmp    1163 <RamAccFixMod+0x53>
mov    $0x18c,%edi
mov    $0x31,%esi
call   1030 <RegWriteA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RamAccFixMod>:
test   %edi,%edi
je     1129 <RamAccFixMod+0x19>
cmp    $0x1,%dil
jne    1135 <RamAccFixMod+0x25>
mov    $0x31,%esi
mov    $0x18c,%edi
jmp    1030 <RegWriteA@plt>
xor    %esi,%esi
mov    $0x18c,%edi
jmp    1030 <RegWriteA@plt>
ret

LLVM IR (-O0):
define void @RamAccFixMod(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %7
]
5: ; preds = %1
%6 = call i32 @RegWriteA(i32 396, i32 0)
br label %9
7: ; preds = %1
%8 = call i32 @RegWriteA(i32 396, i32 49)
br label %9
9: ; preds = %1, %7, %5
ret void
}

LLVM IR (-O2):
define void @RamAccFixMod(i8 zeroext %0) {
switch i8 %0, label %6 [
i8 0, label %3
i8 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 49, %2 ], [ 0, %1 ]
%5 = tail call i32 @RegWriteA(i32 396, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
int is_num_char(char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<is_num_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_num_char+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num_char>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_num_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_num_char(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myprint() { printf("hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define void @myprint() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int inverse_factorial(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, ...);
void test_inverse(uint64_t f) {
  int n = inverse_factorial(f);
  if (n < 0) {
    printf("rf(%llu) = No Solution\n", f);
  } else {
    printf("rf(%llu) = %d\n", f, n);
  }
}


x86 assembly (clang, -O0):
<test_inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <inverse_factorial@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1156 <test_inverse+0x36>
mov    -0x4(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116a <test_inverse+0x4a>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_inverse>:
push   %rbx
mov    %edi,%ebx
call   1040 <inverse_factorial@plt>
test   %eax,%eax
js     113f <test_inverse+0x1f>
lea    0xee5(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"rf(%llu) = No Solution\0A\00"
@.str.1 = [15 x i8] c"rf(%llu) = %d\0A\00"
define void @test_inverse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @inverse_factorial(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %15
11: ; preds = %1
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13)
br label %15
15: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"rf(%llu) = No Solution\0A\00"
@.str.1 = [15 x i8] c"rf(%llu) = %d\0A\00"
define void @test_inverse(i32 %0) {
%2 = tail call i32 @inverse_factorial(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
6: ; preds = %1
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %2)
br label %8
8: ; preds = %6, %4
ret void
}
void audit_unsupported(struct ssh *ssh, int n) {}


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

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

LLVM IR (-O0):
%struct.ssh = type opaque
define void @audit_unsupported(%struct.ssh* %0, i32 %1) {
%3 = alloca %struct.ssh*
%4 = alloca i32
store %struct.ssh* %0, %struct.ssh** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.ssh = type opaque
define void @audit_unsupported(%struct.ssh* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int func_impl_alter() { printf("impl_alter\n"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"impl_alter\0A\00"
define i32 @func_impl_alter() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [11 x i8] c"impl_alter\00"
define i32 @func_impl_alter() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void foo(void) { puts("Testing\n"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Testing\0A\00"
define void @foo() {
%1 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Testing\0A\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
void regenerate_config(void) {}


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

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

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

LLVM IR (-O2):
define void @regenerate_config() {
ret void
}
char base64_encode_value(char value_in) {
  static const char *encoding =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  if (value_in > 63)
    return '=';
  return encoding[(int)value_in];
}


x86 assembly (clang, -O0):
<base64_encode_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x3f,%eax
jle    1120 <base64_encode_value+0x20>
movb   $0x3d,-0x1(%rbp)
jmp    1134 <base64_encode_value+0x34>
mov    0x2ef9(%rip),%rax
movsbl -0x2(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encode_value>:
mov    $0x3d,%al
cmp    $0x3f,%dil
jg     1116 <base64_encode_value+0x16>
movsbq %dil,%rax
lea    0xeed(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@base64_encode_value.encoding = internal global i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i32 0, i32 0)
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define signext i8 @base64_encode_value(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 63
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 61, i8* %2
br label %15
8: ; preds = %1
%9 = load i8*, i8** @base64_encode_value.encoding
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
store i8 %14, i8* %2
br label %15
15: ; preds = %8, %7
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define signext i8 @base64_encode_value(i8 signext %0) {
%2 = icmp sgt i8 %0, 63
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = sext i8 %0 to i64
%5 = getelementptr inbounds [65 x i8], [65 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 61, %1 ]
ret i8 %8
}
/* Type definitions */
struct zdap_ioctl {
  int dummy;
};
struct ifreq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_ioctl(int, struct ifreq *);
int read_mem(int sock, struct ifreq *req) {
  struct zdap_ioctl *zdreq = NULL;
  int i;
  if (!set_ioctl(sock, req))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<read_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <set_ioctl@plt>
cmp    $0x0,%eax
jne    1148 <read_mem+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <read_mem+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mem>:
push   %rax
call   1030 <set_ioctl@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ifreq = type { i32 }
%struct.zdap_ioctl = type { i32 }
define i32 @read_mem(i32 %0, %struct.ifreq* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.ifreq*
%6 = alloca %struct.zdap_ioctl*
%7 = alloca i32
store i32 %0, i32* %4
store %struct.ifreq* %1, %struct.ifreq** %5
store %struct.zdap_ioctl* null, %struct.zdap_ioctl** %6
%8 = load i32, i32* %4
%9 = load %struct.ifreq*, %struct.ifreq** %5
%10 = call i32 @set_ioctl(i32 %8, %struct.ifreq* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 -1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.ifreq = type { i32 }
%struct.zdap_ioctl = type { i32 }
define i32 @read_mem(i32 %0, %struct.ifreq* %1) {
%3 = tail call i32 @set_ioctl(i32 %0, %struct.ifreq* %1)
%4 = icmp eq i32 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char getchar();
char console_getc(void) { return getchar(); }


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

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

LLVM IR (-O0):
define signext i8 @console_getc() {
%1 = call signext i8 (...) @getchar()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @console_getc() {
%1 = tail call signext i8 (...) @getchar()
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_lround();
scalar_t__ lround(double);
void test_lround(double d) {
  if (lround(d) != lround(d))
    link_failure_lround();
}


x86 assembly (clang, -O0):
<test_lround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <lround@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <lround@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_lround+0x3c>
mov    $0x0,%al
call   1040 <link_failure_lround@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lround>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <lround@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <lround@plt>
cmp    %rax,%rbx
jne    1149 <test_lround+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_lround@plt>

LLVM IR (-O0):
define void @test_lround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @lround(double %3)
%5 = load double, double* %2
%6 = call i64 @lround(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_lround()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_lround(double %0) {
%2 = tail call i64 @lround(double %0)
%3 = tail call i64 @lround(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_lround()
br label %7
7: ; preds = %5, %1
ret void
}
void pthread_condattr_setpshared() {}


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

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

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

LLVM IR (-O2):
define void @pthread_condattr_setpshared() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int tcc_overlay_open(char *framebuffer) {
  int fb_dev_fd;
  fb_dev_fd = open(framebuffer, O_RDWR);
  if (fb_dev_fd < 0) {
    printf("Cound not open file\n");
    return -1;
  }
  return fb_dev_fd;
}


x86 assembly (clang, -O0):
<tcc_overlay_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1163 <tcc_overlay_open+0x43>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <tcc_overlay_open+0x49>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcc_overlay_open>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
test   %eax,%eax
js     1135 <tcc_overlay_open+0x15>
pop    %rcx
ret
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@.str = [21 x i8] c"Cound not open file\0A\00"
define i32 @tcc_overlay_open(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDWR
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@str = [20 x i8] c"Cound not open file\00"
define i32 @tcc_overlay_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ %3, %1 ]
ret i32 %8
}
/* Variables and functions */
void GOMP_ordered_end(void) {}


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

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

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

LLVM IR (-O2):
define void @GOMP_ordered_end() {
ret void
}
/* Variables and functions */
int ARSTREAM_MP4Sender_TestBenchMain(int, char **);
int main(int argc, char *argv[]) {
  return ARSTREAM_MP4Sender_TestBenchMain(argc, argv);
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ARSTREAM_MP4Sender_TestBenchMain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <ARSTREAM_MP4Sender_TestBenchMain@plt>

LLVM IR (-O0):
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* %4
%7 = load i8**, i8*** %5
%8 = call i32 @ARSTREAM_MP4Sender_TestBenchMain(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ARSTREAM_MP4Sender_TestBenchMain(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_copy_start_quaddobl_solution_to_container(int k, int i) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(599, &k, &i, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_copy_start_quaddobl_solution_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x257,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_copy_start_quaddobl_solution_to_container>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x257,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @celcon_copy_start_quaddobl_solution_to_container(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 599, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
int opng_islower(int ch) { return (ch >= 'a' && ch <= 'z'); }


x86 assembly (clang, -O0):
<opng_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <opng_islower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opng_islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @opng_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}