xunge/DecIR huggingface dataset:
/* Variables and functions */
double foo(double);
double bar(float n) { return n + foo((double)n); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <foo@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rsp)
call   1030 <foo@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bar(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = call double @foo(double %6)
%8 = fadd double %4, %7
ret double %8
}

LLVM IR (-O2):
define double @bar(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @foo(double %2)
%4 = fadd double %3, %2
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void err_dup2(int err) {
  fprintf(stderr, "DUP2 FAILED: %d!\n", err);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<err_dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_dup2>:
push   %rbx
mov    %edi,%edx
mov    0x2eb6(%rip),%rbx
mov    (%rbx),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"DUP2 FAILED: %d!\0A\00"
define void @err_dup2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"DUP2 FAILED: %d!\0A\00"
define void @err_dup2(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ isspace(int);
char *str_skip_ws(char *s) {
  while (*s && isspace((int)(unsigned char)*s))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<str_skip_ws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <str_skip_ws+0x37>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <str_skip_ws+0x47>
jmp    1168 <str_skip_ws+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <str_skip_ws+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_skip_ws>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <str_skip_ws+0x29>
nopw   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <str_skip_ws+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <str_skip_ws+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @str_skip_ws(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = call i64 @isspace(i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @str_skip_ws(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
%7 = zext i8 %5 to i32
%8 = tail call i64 @isspace(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %10, %1
%15 = phi i8* [ %0, %1 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
int func() {
  int i;
  int c[100];
#pragma xmp align c[i] with t(i)
#pragma xmp loop(i) on t(i)
  for (i = 0; i < 100; i++) {
    c[i] = 0;
  }
  {
    int c = 4;
    c *= 2;
    return c;
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1139 <func+0x39>
movslq -0x4(%rbp),%rax
movl   $0x0,-0x1a0(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <func+0x12>
movl   $0x4,-0x1a4(%rbp)
mov    -0x1a4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
mov    -0x1a4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 8
}
/* Variables and functions */
double **crea_espacio(long);
int /*<<< orphan*/ inicia(double **, long);
double **obten_matriz(long size) {
  double **m = crea_espacio(size);
  inicia(m, size);
  return m;
}


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

x86 assembly (clang, -O2):
<obten_matriz>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <crea_espacio@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <inicia@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double** @obten_matriz(i64 %0) {
%2 = alloca i64
%3 = alloca double**
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call double** @crea_espacio(i64 %4)
store double** %5, double*** %3
%6 = load double**, double*** %3
%7 = load i64, i64* %2
%8 = call i32 @inicia(double** %6, i64 %7)
%9 = load double**, double*** %3
ret double** %9
}

LLVM IR (-O2):
define double** @obten_matriz(i64 %0) {
%2 = tail call double** @crea_espacio(i64 %0)
%3 = tail call i32 @inicia(double** %2, i64 %0)
ret double** %2
}
int f() {
  int a;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @f() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef size_t int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printem(uint8_t *x, int32_t num) {
  int32_t i;
  for (i = 0; i < num; i++) {
    printf("%i ", x[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1160 <printem+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printem+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printem>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <printem+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printem+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%i \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printem(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i \00"
define void @printem(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
scalar_t__ rmdir(char *);
int main(int argc, char **argv) {
  if (argc == 1)
    exit(0);
  if (rmdir(argv[1]) < 0)
    printf("romve dictionary failed!\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)
cmpl   $0x1,-0x8(%rbp)
jne    1157 <main+0x27>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <rmdir@plt>
cmp    $0x0,%rax
jge    117a <main+0x4a>
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     1154 <main+0x24>
mov    0x8(%rsi),%rdi
call   1040 <rmdir@plt>
test   %rax,%rax
jns    1150 <main+0x20>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"romve dictionary failed!\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 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @rmdir(i8* %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %10
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"romve dictionary failed!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @rmdir(i8* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %13
13: ; preds = %11, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, unsigned int, unsigned int, double);
void print_double(char *s, double f) {
  unsigned int *u;
  u = (unsigned int *)&f;
  printf("%20s %8x %8x %.20g\n", s, *u, *(u + 1), f);
  printf("%20s %8x %8x %.20g\n", s, *(u + 1), *u, f);
}


x86 assembly (clang, -O0):
<print_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
movsd  -0x10(%rbp),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
movsd  -0x10(%rbp),%xmm0
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_double>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
movq   %xmm0,%r15
movq   %xmm0,(%rsp)
mov    %r15,%rbx
shr    $0x20,%rbx
lea    0xecd(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %r15d,%ecx
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%20s %8x %8x %.20g\0A\00"
define void @print_double(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca i32*
store i8* %0, i8** %3
store double %1, double* %4
%6 = bitcast double* %4 to i32*
store i32* %6, i32** %5
%7 = load i8*, i8** %3
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = load double, double* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %9, i32 %12, double %13)
%15 = load i8*, i8** %3
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = load double, double* %4
%22 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %18, i32 %20, double %21)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%20s %8x %8x %.20g\0A\00"
define void @print_double(i8* %0, double %1) {
%3 = bitcast double %1 to i64
%4 = trunc i64 %3 to i32
%5 = lshr i64 %3, 32
%6 = trunc i64 %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4, i32 %6, double %1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %6, i32 %4, double %1)
ret void
}
void _tr_tally(void) {}


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

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

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

LLVM IR (-O2):
define void @_tr_tally() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mrf24j40_write_short_ctrl_reg(int, int);
void mrf24j40_mac_reset(void) { mrf24j40_write_short_ctrl_reg(0x2A, (1)); }


x86 assembly (clang, -O0):
<mrf24j40_mac_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
mov    $0x1,%esi
call   1030 <mrf24j40_write_short_ctrl_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrf24j40_mac_reset>:
mov    $0x2a,%edi
mov    $0x1,%esi
jmp    1030 <mrf24j40_write_short_ctrl_reg@plt>

LLVM IR (-O0):
define void @mrf24j40_mac_reset() {
%1 = call i32 @mrf24j40_write_short_ctrl_reg(i32 42, i32 1)
ret void
}

LLVM IR (-O2):
define void @mrf24j40_mac_reset() {
%1 = tail call i32 @mrf24j40_write_short_ctrl_reg(i32 42, i32 1)
ret void
}
double poly(double x, double c) {
  return x * (1 - x * (0.5 - x * (c + x * 0.25)));
}


x86 assembly (clang, -O0):
<poly>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm4
movsd  -0x8(%rbp),%xmm3
movsd  0xee1(%rip),%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
movsd  0xeae(%rip),%xmm3
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe7f(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeec(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xee4(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @poly(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = load double, double* %4
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double %9, double 2.500000e-01, double %8)
%11 = fneg double %7
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double 5.000000e-01)
%13 = fneg double %6
%14 = call double @llvm.fmuladd.f64(double %13, double %12, double 1.000000e+00)
%15 = fmul double %5, %14
ret double %15
}

LLVM IR (-O2):
define double @poly(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double 2.500000e-01, double %1)
%4 = fneg double %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double %3, double 5.000000e-01)
%6 = tail call double @llvm.fmuladd.f64(double %4, double %5, double 1.000000e+00)
%7 = fmul double %6, %0
ret double %7
}
void makesix(int a) { a = 6; }


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

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

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

LLVM IR (-O2):
define void @makesix(i32 %0) {
ret void
}
unsigned int st_relayfs_getindex(unsigned int source) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @st_relayfs_getindex(i32 %0) {
ret i32 0
}
/* Variables and functions */
long aroma_isexist_mem(void *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, long);
int /*<<< orphan*/ unlink(char *);
void aroma_unlink_memaddr(void *x) {
  long fz = aroma_isexist_mem(x);
  if (fz) {
    char pn[256];
    snprintf(pn, 256, "%s/%i", "/tmp/aroma-memory", (long)x);
    unlink(pn);
  }
}


x86 assembly (clang, -O0):
<aroma_unlink_memaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <aroma_isexist_mem@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1186 <aroma_unlink_memaddr+0x56>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    $0x100,%esi
lea    0xe92(%rip),%rdx
lea    0xe91(%rip),%rcx
call   1040 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aroma_unlink_memaddr>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
call   1050 <aroma_isexist_mem@plt>
test   %rax,%rax
je     1170 <aroma_unlink_memaddr+0x40>
lea    0xeb2(%rip),%rdx
lea    0xeb1(%rip),%rcx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
mov    %rbx,%r8
call   1040 <snprintf@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%i\00"
@.str.1 = [18 x i8] c"/tmp/aroma-memory\00"
define void @aroma_unlink_memaddr(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca [256 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @aroma_isexist_mem(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%11 = load i8*, i8** %2
%12 = ptrtoint i8* %11 to i64
%13 = call i32 @snprintf(i8* %10, i32 256, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 %12)
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%15 = call i32 @unlink(i8* %14)
br label %16
16: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%i\00"
@.str.1 = [18 x i8] c"/tmp/aroma-memory\00"
define void @aroma_unlink_memaddr(i8* %0) {
%2 = alloca [256 x i8]
%3 = tail call i64 @aroma_isexist_mem(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = ptrtoint i8* %0 to i64
%8 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 %7)
%9 = call i32 @unlink(i8* %6)
br label %10
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x18() {
  Assert_real((isodigit(24) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              125, ("isodigit should be 0 for 0x18"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x18>:
push   %rbp
mov    %rsp,%rbp
mov    $0x18,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x7d,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x18>:
push   %rax
mov    $0x18,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x7d,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x18\00"
define void @t_isodigit_0x18() {
%1 = call i64 @isodigit(i32 24)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x18\00"
define void @t_isodigit_0x18() {
%1 = tail call i64 @isodigit(i32 24)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void genj() {}


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

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

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

LLVM IR (-O2):
define void @genj() {
ret void
}
int chomp_trailing_dir_sep(const char *path, int len) {
  while (len && ((path[len - 1]) == '/'))
    len--;
  return len;
}


x86 assembly (clang, -O0):
<chomp_trailing_dir_sep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1134 <chomp_trailing_dir_sep+0x34>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <chomp_trailing_dir_sep+0x44>
jmp    1152 <chomp_trailing_dir_sep+0x52>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <chomp_trailing_dir_sep+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp_trailing_dir_sep>:
movslq %esi,%rcx
lea    0x1(%rcx),%eax
mov    %rcx,%rdx
nopl   0x0(%rax)
sub    $0x1,%rdx
jb     1124 <chomp_trailing_dir_sep+0x24>
add    $0xffffffff,%eax
cmpb   $0x2f,-0x1(%rdi,%rcx,1)
mov    %rdx,%rcx
je     1110 <chomp_trailing_dir_sep+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @chomp_trailing_dir_sep(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %7, %2
%5 = phi i64 [ %8, %7 ], [ %3, %2 ]
%6 = icmp eq i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = add nsw i64 %5, -1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 47
br i1 %11, label %4, label %12
12: ; preds = %7
%13 = trunc i64 %5 to i32
br label %14
14: ; preds = %4, %12
%15 = phi i32 [ %13, %12 ], [ 0, %4 ]
ret i32 %15
}
void clock_init(void) {}


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

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

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

LLVM IR (-O2):
define void @clock_init() {
ret void
}
int isletter(int c) {
  if (c >= 'A' && c <= 'Z')
    c += 'a' - 'A';
  if (c >= 'a' && c <= 'z')
    return c;
  return 0;
}


x86 assembly (clang, -O0):
<isletter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1124 <isletter+0x24>
cmpl   $0x5a,-0x8(%rbp)
jg     1124 <isletter+0x24>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1143 <isletter+0x43>
cmpl   $0x7a,-0x8(%rbp)
jg     1143 <isletter+0x43>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <isletter+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isletter>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%eax
cmovae %edi,%ecx
lea    -0x61(%rcx),%edx
xor    %eax,%eax
cmp    $0x1a,%edx
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isletter(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
%6 = add i32 %5, -97
%7 = icmp ult i32 %6, 26
%8 = select i1 %7, i32 %5, i32 0
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int uint8_t;

/* Variables and functions */
int bios_load(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int, int, int, int);
int bios_load_linear_combined(wchar_t *fn1, wchar_t *fn2, int sz, int off) {
  uint8_t ret = 0;
  ret = bios_load(fn1, NULL, 0x000f0000, 131072, 128, 0);
  ret &= bios_load(fn2, NULL, 0x000e0000, sz - 65536, 128, 4);
  return ret;
}


x86 assembly (clang, -O0):
<bios_load_linear_combined>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xf0000,%edx
mov    $0x20000,%ecx
mov    $0x80,%r8d
xor    %r9d,%r9d
call   1030 <bios_load@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
sub    $0x10000,%ecx
xor    %eax,%eax
mov    %eax,%esi
mov    $0xe0000,%edx
mov    $0x80,%r8d
mov    $0x4,%r9d
call   1030 <bios_load@plt>
and    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bios_load_linear_combined>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
xor    %esi,%esi
mov    $0xf0000,%edx
mov    $0x20000,%ecx
mov    $0x80,%r8d
xor    %r9d,%r9d
call   1030 <bios_load@plt>
mov    %eax,%ebp
add    $0xffff0000,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xe0000,%edx
mov    %ebx,%ecx
mov    $0x80,%r8d
mov    $0x4,%r9d
call   1030 <bios_load@plt>
and    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bios_load_linear_combined(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32*, i32** %5
%11 = call i32 @bios_load(i32* %10, i32* null, i32 983040, i32 131072, i32 128, i32 0)
store i32 %11, i32* %9
%12 = load i32*, i32** %6
%13 = load i32, i32* %7
%14 = sub nsw i32 %13, 65536
%15 = call i32 @bios_load(i32* %12, i32* null, i32 917504, i32 %14, i32 128, i32 4)
%16 = load i32, i32* %9
%17 = and i32 %16, %15
store i32 %17, i32* %9
%18 = load i32, i32* %9
ret i32 %18
}

LLVM IR (-O2):
define i32 @bios_load_linear_combined(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @bios_load(i32* %0, i32* null, i32 983040, i32 131072, i32 128, i32 0)
%6 = add nsw i32 %2, -65536
%7 = tail call i32 @bios_load(i32* %1, i32* null, i32 917504, i32 %6, i32 128, i32 4)
%8 = and i32 %7, %5
ret i32 %8
}
int smallest(int a, int b, int c) {
  int result = 0;
  while (a != 0 && b != 0 && c != 0) {
    result++;
    a--;
    b--;
    c--;
  }
  return result;
}


x86 assembly (clang, -O0):
<smallest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
je     113c <smallest+0x3c>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     113c <smallest+0x3c>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114c <smallest+0x4c>
jmp    1175 <smallest+0x75>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <smallest+0x14>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smallest>:
xor    %eax,%eax
test   %edi,%edi
je     1135 <smallest+0x35>
test   %esi,%esi
je     1135 <smallest+0x35>
test   %edx,%edx
je     1135 <smallest+0x35>
add    $0xffffffff,%edi
add    $0xffffffff,%esi
add    $0xffffffff,%edx
cmp    %esi,%edx
cmovae %esi,%edx
cmp    %edi,%edx
cmovae %edi,%edx
add    $0x1,%edx
test   %esi,%esi
mov    $0x1,%eax
cmove  %eax,%edx
test   %edi,%edi
cmove  %eax,%edx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @smallest(i32 %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %0, 0
%5 = icmp ne i32 %1, 0
%6 = and i1 %4, %5
%7 = icmp ne i32 %2, 0
%8 = and i1 %6, %7
br i1 %8, label %9, label %20
9: ; preds = %3
%10 = add i32 %0, -1
%11 = add i32 %1, -1
%12 = add i32 %2, -1
%13 = icmp eq i32 %10, 0
%14 = icmp eq i32 %11, 0
%15 = or i1 %13, %14
%16 = call i32 @llvm.umin.i32(i32 %12, i32 %11)
%17 = call i32 @llvm.umin.i32(i32 %16, i32 %10)
%18 = add nuw i32 %17, 1
%19 = select i1 %15, i32 1, i32 %18
br label %20
20: ; preds = %9, %3
%21 = phi i32 [ 0, %3 ], [ %19, %9 ]
ret i32 %21
}
void do_state_27(char c, int *state, char *word, int *length) {
  word[(*length)++] = c;
  if (c >= '0' && c <= '9') {
    *state = 28;
  } else {
    *state = -1;
  }
}


x86 assembly (clang, -O0):
<do_state_27>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1159 <do_state_27+0x59>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1159 <do_state_27+0x59>
mov    -0x10(%rbp),%rax
movl   $0x1c,(%rax)
jmp    1163 <do_state_27+0x63>
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_state_27>:
movslq (%rcx),%r8
lea    0x1(%r8),%eax
mov    %eax,(%rcx)
mov    %dil,(%rdx,%r8,1)
add    $0xd0,%dil
cmp    $0xa,%dil
mov    $0x1c,%eax
mov    $0xffffffff,%ecx
cmovb  %eax,%ecx
mov    %ecx,(%rsi)
ret

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

LLVM IR (-O2):
define void @do_state_27(i8 signext %0, i32* nocapture writeonly %1, i8* nocapture writeonly %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
store i8 %0, i8* %8
%9 = add i8 %0, -48
%10 = icmp ult i8 %9, 10
%11 = select i1 %10, i32 28, i32 -1
store i32 %11, i32* %1
ret void
}
int brcmf_debug_attach(struct brcmf_pub *drvr) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
define i32 @brcmf_debug_attach(%struct.brcmf_pub* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int LIS(int *, int);
int /*<<< orphan*/ printf(char *, int);
void LISmain(void) {
  int nums[] = {1, -1, 2, -2, 0, 1, 1};
  int len = sizeof(nums) / sizeof(nums[0]);
  printf("%d\n", LIS(nums, len));
}


x86 assembly (clang, -O0):
<LISmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <LIS@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LISmain>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1040 <LIS@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.LISmain.nums = [7 x i32] [i32 1, i32 -1, i32 2, i32 -2, i32 0, i32 1, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define void @LISmain() {
%1 = alloca [7 x i32]
%2 = alloca i32
%3 = bitcast [7 x i32]* %1 to i8*
store i32 7, i32* %2
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @LIS(i32* %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@__const.LISmain.nums = [7 x i32] [i32 1, i32 -1, i32 2, i32 -2, i32 0, i32 1, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define void @LISmain() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @LIS(i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
unsigned long I2CDataGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000010))));
}


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

x86 assembly (clang, -O2):
<I2CDataGet>:
mov    0x10(%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @I2CDataGet(i64 %0) {
%2 = add i64 %0, 16
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
unsigned int unsignedint_ignoring_longlongint(unsigned int x, long long int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @unsignedint_ignoring_longlongint(i32 returned %0, i64 %1) {
ret i32 %0
}
int mul_it(int suc, int value) { return suc * value; }


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

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

LLVM IR (-O0):
define i32 @mul_it(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul_it(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
double sqr(double num) { return num * num; }


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

x86 assembly (clang, -O2):
<sqr>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @sqr(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
ret double %5
}

LLVM IR (-O2):
define double @sqr(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
unsigned char toupper(unsigned char);
void uppercase(unsigned char *str) {
  while (*str) {
    *str = toupper(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <uppercase+0x3e>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <uppercase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <uppercase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uppercase+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call zeroext i8 @toupper(i8 zeroext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
char *strcpy(char *dest, char const *src) {
  char *tmp = dest;
  while ((*dest++ = *src++) != '\0')
    ;
  return tmp;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %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
store i8* %6, i8** %5
br label %7
7: ; preds = %15, %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
%13 = sext i8 %10 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %7
br label %7
16: ; preds = %7
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
size_t strlen(char const *);
__attribute__((__weak__, __always___)) size_t
softboundmpx_strlen(const char *s) {
  return strlen(s);
}


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

x86 assembly (clang, -O2):
<softboundmpx_strlen>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define weak i64 @softboundmpx_strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define weak i64 @softboundmpx_strlen(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *fornamn = "Patrik";
  printf("Hej jag heter %s\n", fornamn);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedf(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Patrik\00"
@.str.1 = [18 x i8] c"Hej jag heter %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Patrik\00"
@.str.1 = [18 x i8] c"Hej jag heter %s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
void RTStrToUni(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToUni() {
ret void
}
int ath9k_debug_create_root(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ath9k_debug_create_root() {
ret i32 0
}