xunge/DecIR huggingface dataset:
unsigned char f16(unsigned char x, unsigned long int y) {
  return (x << y) | (x >> ((-y) & (8 * sizeof(unsigned char) - 1)));
}


x86 assembly (clang, -O0):
<f16>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x7,%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f16>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0x7,%cl
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f16(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 0, %12
%14 = and i64 %13, 7
%15 = trunc i64 %14 to i32
%16 = ashr i32 %11, %15
%17 = or i32 %9, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f16(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 7
%8 = lshr i32 %3, %7
%9 = or i32 %8, %5
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Variables and functions */
int exp(int);
double I(int n) {
  if (n == 100) {
    return .00367843;
  } else {
    return (I(n + 1) + 1 / exp(1)) / (n + 1);
  }
}


x86 assembly (clang, -O0):
<I>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jne    1147 <I+0x27>
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118b <I+0x6b>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <I@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <exp@plt>
movsd  -0x18(%rbp),%xmm0
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x64,%edi
jne    1134 <I+0x14>
movsd  0xece(%rip),%xmm0
jmp    1170 <I+0x50>
mov    %edi,%ebx
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <I@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%edi
call   1030 <exp@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
addsd  0x8(%rsp),%xmm0
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @I(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %7
6: ; preds = %1
store double 3.678430e-03, double* %2
br label %19
7: ; preds = %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = call double @I(i32 %9)
%11 = call i32 @exp(i32 1)
%12 = sdiv i32 1, %11
%13 = sitofp i32 %12 to double
%14 = fadd double %10, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
%17 = sitofp i32 %16 to double
%18 = fdiv double %14, %17
store double %18, double* %2
br label %19
19: ; preds = %7, %6
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @I(i32 %0) {
%2 = icmp eq i32 %0, 100
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi double [ %15, %5 ], [ 3.678430e-03, %1 ]
ret double %4
5: ; preds = %1
%6 = add nsw i32 %0, 1
%7 = tail call double @I(i32 %6)
%8 = tail call i32 @exp(i32 1)
%9 = add i32 %8, 1
%10 = icmp ult i32 %9, 3
%11 = select i1 %10, i32 %8, i32 0
%12 = sitofp i32 %11 to double
%13 = fadd double %7, %12
%14 = sitofp i32 %6 to double
%15 = fdiv double %13, %14
br label %3
}
void sdr_thread_register(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @sdr_thread_register(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char f(char *);
main() { return f("abc") == 'c' ? 0 : 1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <f@plt>
movsbl %al,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x63,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <f@plt>
xor    %ecx,%ecx
cmp    $0x63,%al
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call signext i8 @f(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = sext i8 %2 to i32
%4 = icmp eq i32 %3, 99
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 0, i32 1
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i32 @main() {
%1 = tail call signext i8 @f(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i8 %1, 99
%3 = zext i1 %2 to i32
ret i32 %3
}
double int_to_double(int *p) { return (double)*p; }


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

x86 assembly (clang, -O2):
<int_to_double>:
cvtsi2sdl (%rdi),%xmm0
ret

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

LLVM IR (-O2):
define double @int_to_double(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sitofp i32 %2 to double
ret double %3
}
int leap(int year) {
  if (year % 4 != 0)
    return 0;
  if (year % 100 != 0)
    return 1;
  return (year % 400 == 0);
}


x86 assembly (clang, -O0):
<leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1127 <leap+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1160 <leap+0x60>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1147 <leap+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1160 <leap+0x60>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leap>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <leap+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <leap+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @leap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %1, %7
%12 = phi i32 [ %10, %7 ], [ 0, %1 ], [ 1, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t co_read16(void const *ptr16) { return *((uint16_t *)ptr16); }


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

x86 assembly (clang, -O2):
<co_read16>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @co_read16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void freeargv(char **vector) {
  register char **scan;
  if (vector != 0) {
    for (scan = vector; *scan != 0; scan++) {
      free(*scan);
    }
    free(vector);
  }
}


x86 assembly (clang, -O0):
<freeargv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <freeargv+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115a <freeargv+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <freeargv+0x1f>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeargv>:
test   %rdi,%rdi
je     1150 <freeargv+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <freeargv+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <freeargv+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @freeargv(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = icmp ne i8** %4, null
br i1 %5, label %6, label %21
6: ; preds = %1
%7 = load i8**, i8*** %2
store i8** %7, i8*** %3
br label %8
8: ; preds = %15, %6
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
br label %15
15: ; preds = %12
%16 = load i8**, i8*** %3
%17 = getelementptr inbounds i8*, i8** %16, i32 1
store i8** %17, i8*** %3
br label %8
18: ; preds = %8
%19 = load i8**, i8*** %2
%20 = bitcast i8** %19 to i8*
br label %21
21: ; preds = %18, %1
ret void
}

LLVM IR (-O2):
define void @freeargv(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
tail call void @free(i8* %7)
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
br label %14
14: ; preds = %12, %1
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, double);
double spectral_game(int);
int main(int argc, char *argv[]) {
  int N = ((argc >= 2) ? atoi(argv[1]) : 2000);
  printf("%.9f\n", spectral_game(N));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1165 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1172 <main+0x42>
mov    $0x7d0,%eax
mov    %eax,-0x18(%rbp)
jmp    1172 <main+0x42>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <spectral_game@plt>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0x7d0,%edi
cmp    $0x2,%eax
jl     1148 <main+0x18>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <spectral_game@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.9f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 2000, %2 ]
%10 = tail call double @spectral_game(i32 %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}
__attribute__((always_)) void refresh_cpu_vm_stats(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @refresh_cpu_vm_stats(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
char *strcat(char *s1, const char *s2) {
  char *s = s1;
  while (*s != '\0')
    s++;
  strcpy(s, s2);
  return s1;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <strcat+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <strcat+0x18>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi)
lea    0x1(%rdi),%rdi
jne    1120 <strcat+0x10>
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %4, i8* %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ timerTest();
int main(void) {
  timerTest();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @timerTest()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int lengthLongestIncreasingSubsequence(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int A[] = {0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15};
  printf("max length is %d\n", lengthLongestIncreasingSubsequence(A, 16));
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x10,%esi
call   1060 <lengthLongestIncreasingSubsequence@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x10,%esi
call   1050 <lengthLongestIncreasingSubsequence@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [16 x i32] [i32 0, i32 8, i32 4, i32 12, i32 2, i32 10, i32 6, i32 14, i32 1, i32 9, i32 5, i32 13, i32 3, i32 11, i32 7, i32 15]
@.str = [18 x i8] c"max length is %d\0A\00"
define i32 @main() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%4 = call i32 @lengthLongestIncreasingSubsequence(i32* %3, i32 16)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [16 x i32] [i32 0, i32 8, i32 4, i32 12, i32 2, i32 10, i32 6, i32 14, i32 1, i32 9, i32 5, i32 13, i32 3, i32 11, i32 7, i32 15]
@.str = [18 x i8] c"max length is %d\0A\00"
define i32 @main() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%4 = call i32 @lengthLongestIncreasingSubsequence(i32* %3, i32 16)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int atof(char *);
int atoi(char *);
int /*<<< orphan*/ *strchr(char *, char);
int roadmap_nmea_decode_numeric(char *value, int unit) {
  int result;
  if (strchr(value, '.') != NULL) {
    result = (int)(atof(value) * unit);
  } else {
    result = atoi(value) * unit;
  }
  return result;
}


x86 assembly (clang, -O0):
<roadmap_nmea_decode_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     116c <roadmap_nmea_decode_numeric+0x3c>
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    117c <roadmap_nmea_decode_numeric+0x4c>
mov    -0x8(%rbp),%rdi
call   1050 <atoi@plt>
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_nmea_decode_numeric>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1040 <strchr@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1151 <roadmap_nmea_decode_numeric+0x21>
call   1030 <atof@plt>
jmp    1156 <roadmap_nmea_decode_numeric+0x26>
call   1050 <atoi@plt>
imul   %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @roadmap_nmea_decode_numeric(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32* @strchr(i8* %6, i8 signext 46)
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @atof(i8* %10)
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %5
br label %19
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = call i32 @atoi(i8* %15)
%17 = load i32, i32* %4
%18 = mul nsw i32 %16, %17
store i32 %18, i32* %5
br label %19
19: ; preds = %14, %9
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @roadmap_nmea_decode_numeric(i8* %0, i32 %1) {
%3 = tail call i32* @strchr(i8* %0, i8 signext 46)
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @atof(i8* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @atoi(i8* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = mul nsw i32 %10, %1
ret i32 %11
}
/* Variables and functions */
float __log2(float);
float log2f(float x) { return __log2(x); }


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

x86 assembly (clang, -O2):
<log2f>:
jmp    1030 <__log2@plt>

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

LLVM IR (-O2):
define float @log2f(float %0) {
%2 = tail call float @__log2(float %0)
ret float %2
}
int *getBlockNum(int number) {}


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

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

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

LLVM IR (-O2):
define noalias i32* @getBlockNum(i32 %0) {
ret i32* undef
}
/* Variables and functions */
int /*<<< orphan*/ daemon(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
int main() {
  daemon(0, 0);
  pause();
  printf("got out of the pause\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1050 <daemon@plt>
mov    $0x0,%al
call   1040 <pause@plt>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1050 <daemon@plt>
xor    %eax,%eax
call   1040 <pause@plt>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"got out of the pause\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @daemon(i32 0, i32 0)
%3 = call i32 (...) @pause()
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"got out of the pause\00"
define i32 @main() {
%1 = tail call i32 @daemon(i32 0, i32 0)
%2 = tail call i32 (...) @pause()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
char *strchrnul(const char *s, int c) {
  unsigned char *r = (unsigned char *)s, a = (unsigned char)c;
  while (*r) {
    if (*r == a) {
      break;
    }
    r++;
  }
  return (char *)r;
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <strchrnul+0x4f>
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <strchrnul+0x3e>
jmp    114f <strchrnul+0x4f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1119 <strchrnul+0x19>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <strchrnul+0x21>
cmp    %sil,%cl
jne    1110 <strchrnul+0x10>
ret

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

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
%3 = trunc i32 %1 to i8
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ %0, %2 ], [ %10, %4 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, %3
%9 = or i1 %7, %8
%10 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %9, label %11, label %4
11: ; preds = %4
ret i8* %5
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *xmalloc(size_t);
char *xstrndup(const char *string, size_t n) {
  size_t len = strlen(string);
  char *res;
  if (n < len)
    len = n;
  res = xmalloc(len + 1);
  strncpy(res, string, len);
  res[len] = '\0';
  return res;
}


x86 assembly (clang, -O0):
<xstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1163 <xstrndup+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%rbx
cmp    %r15,%rax
cmova  %r15,%rbx
lea    0x1(%rbx),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%r15,%rbx,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i64, i64* %4
store i64 %13, i64* %5
br label %14
14: ; preds = %12, %2
%15 = load i64, i64* %5
%16 = add i64 %15, 1
%17 = call i8* @xmalloc(i64 %16)
store i8* %17, i8** %6
%18 = load i8*, i8** %6
%19 = load i8*, i8** %3
%20 = load i64, i64* %5
%21 = call i32 @strncpy(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %6
%23 = load i64, i64* %5
%24 = getelementptr inbounds i8, i8* %22, i64 %23
store i8 0, i8* %24
%25 = load i8*, i8** %6
ret i8* %25
}

LLVM IR (-O2):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp ugt i64 %3, %1
%5 = select i1 %4, i64 %1, i64 %3
%6 = add i64 %5, 1
%7 = tail call i8* @xmalloc(i64 %6)
%8 = tail call i32 @strncpy(i8* %7, i8* %0, i64 %5)
%9 = getelementptr inbounds i8, i8* %7, i64 %5
store i8 0, i8* %9
ret i8* %7
}
unsigned long USB_ETH_DrvSetDeviceAssembleParam(unsigned long ulEthTxMinNum,
                                                unsigned long ulEthTxTimeout,
                                                unsigned long ulEthRxMinNum,
                                                unsigned long ulEthRxTimeout) {
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @USB_ETH_DrvSetDeviceAssembleParam(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret i64 0
}

LLVM IR (-O2):
define i64 @USB_ETH_DrvSetDeviceAssembleParam(i64 %0, i64 %1, i64 %2, i64 %3) {
ret i64 0
}
int test_imm_02uint8_mem(unsigned char *val) {
  return ((*val) & (-0x02 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_02uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xfffffffe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_02uint8_mem>:
cmpb   $0x2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_02uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -2
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_02uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 2
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void INS_0F() {
  ;
  _c_setbyte(0x0f);
  ;
}


x86 assembly (clang, -O0):
<INS_0F>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <_c_setbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<INS_0F>:
mov    $0xf,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @INS_0F() {
%1 = call i32 @_c_setbyte(i32 15)
ret void
}

LLVM IR (-O2):
define void @INS_0F() {
%1 = tail call i32 @_c_setbyte(i32 15)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int __serialize_uint32(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int __serialize_uint64(uint8_t *out, int out_sz, uint64_t n) {
  out_sz = __serialize_uint32(out, out_sz, (uint32_t)(n & 0xFFFFFFFF));
  out_sz =
      __serialize_uint32(out + 4, out_sz, (uint32_t)((n >> 32) & 0xFFFFFFFF));
  return (out_sz);
}


x86 assembly (clang, -O0):
<__serialize_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
and    $0xffffffff,%edx
call   1030 <__serialize_uint32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
and    $0xffffffff,%edx
call   1030 <__serialize_uint32@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__serialize_uint64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__serialize_uint32@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <__serialize_uint32@plt>

LLVM IR (-O0):
define i32 @__serialize_uint64(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = and i32 %9, -1
%11 = call i32 @__serialize_uint32(i32* %7, i32 %8, i32 %10)
store i32 %11, i32* %5
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = ashr i32 %15, 32
%17 = and i32 %16, -1
%18 = call i32 @__serialize_uint32(i32* %13, i32 %14, i32 %17)
store i32 %18, i32* %5
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @__serialize_uint64(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @__serialize_uint32(i32* %0, i32 %1, i32 %2)
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = tail call i32 @__serialize_uint32(i32* %5, i32 %4, i32 poison)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x0d() {
  Assert_real((iscntrl(13)),
              "/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_iscntrl.c",
              70, ("iscntrl should be 1 for 0x0d"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x0d>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x46,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x0d>:
push   %rax
mov    $0xd,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x46,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x0d\00"
define void @t_iscntrl_0x0d() {
%1 = call i32 @iscntrl(i32 13)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 70, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x0d\00"
define void @t_iscntrl_0x0d() {
%1 = tail call i32 @iscntrl(i32 13)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 70, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void genbc1tl_idle() {}


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

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

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

LLVM IR (-O2):
define void @genbc1tl_idle() {
ret void
}
int s_scmp(char *s1, char *s2) {
  while (*s1 || *s2)
    if (*(char *)s1++ != *(char *)s2++)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<s_scmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
jne    1131 <s_scmp+0x31>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1141 <s_scmp+0x41>
jmp    117e <s_scmp+0x7e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1179 <s_scmp+0x79>
movl   $0x1,-0x4(%rbp)
jmp    1185 <s_scmp+0x85>
jmp    110c <s_scmp+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_scmp>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%r8d
movzbl (%rsi,%rcx,1),%r9d
mov    %r8d,%edx
or     %r9b,%dl
je     1130 <s_scmp+0x30>
add    $0x1,%rcx
cmp    %r9b,%r8b
je     1110 <s_scmp+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @s_scmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %11, %2
%4 = phi i8* [ %0, %2 ], [ %12, %11 ]
%5 = phi i8* [ %1, %2 ], [ %13, %11 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %15, label %11
11: ; preds = %3
%12 = getelementptr inbounds i8, i8* %4, i64 1
%13 = getelementptr inbounds i8, i8* %5, i64 1
%14 = icmp eq i8 %6, %8
br i1 %14, label %3, label %15
15: ; preds = %3, %11
%16 = phi i32 [ 1, %11 ], [ 0, %3 ]
ret i32 %16
}
int Cyc_Callgraph_visit_cg_f2(struct _tuple11 *env, struct Cyc_Absyn_Stmt *s) {
  return 1;
}


x86 assembly (clang, -O0):
<Cyc_Callgraph_visit_cg_f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct._tuple11 = type opaque
%struct.Cyc_Absyn_Stmt = type opaque
define i32 @Cyc_Callgraph_visit_cg_f2(%struct._tuple11* nocapture readnone %0, %struct.Cyc_Absyn_Stmt* nocapture readnone %1) {
ret i32 1
}
int test_imm_D2int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xD2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D2int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xd2,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D2int64_midword_mem>:
testb  $0xd2,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D2int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 210
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_D2int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13762560
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _endnetdnsent();
int /*<<< orphan*/ _endnethtent();
void endnetent() {
  _endnethtent();
  _endnetdnsent();
}


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

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

LLVM IR (-O0):
define void @endnetent() {
%1 = call i32 (...) @_endnethtent()
%2 = call i32 (...) @_endnetdnsent()
ret void
}

LLVM IR (-O2):
define void @endnetent() {
%1 = tail call i32 (...) @_endnethtent()
%2 = tail call i32 (...) @_endnetdnsent()
ret void
}
int ft_max3order(float n1, float n2, float n3) {
  if (n1 >= n2) {
    if (n1 >= n3)
      return (1);
    else
      return (3);
  } else {
    if (n2 >= n3)
      return (2);
    else
      return (3);
  }
}


x86 assembly (clang, -O0):
<ft_max3order>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1149 <ft_max3order+0x49>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     113d <ft_max3order+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    116b <ft_max3order+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <ft_max3order+0x6b>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     1164 <ft_max3order+0x64>
movl   $0x2,-0x4(%rbp)
jmp    116b <ft_max3order+0x6b>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_max3order>:
xor    %eax,%eax
ucomiss %xmm2,%xmm0
setb   %al
xor    %ecx,%ecx
ucomiss %xmm2,%xmm1
setb   %cl
or     $0x2,%ecx
ucomiss %xmm1,%xmm0
lea    0x1(%rax,%rax,1),%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_max3order(float %0, float %1, float %2) {
%4 = fcmp ult float %0, %1
%5 = fcmp ult float %0, %2
%6 = select i1 %5, i32 3, i32 1
%7 = fcmp ult float %1, %2
%8 = select i1 %7, i32 3, i32 2
%9 = select i1 %4, i32 %8, i32 %6
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void nvtx_push_range(const char name[], uint32_t color) {}


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

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

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

LLVM IR (-O2):
define void @nvtx_push_range(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ baz(int /*<<< orphan*/);
int /*<<< orphan*/ baz2(int /*<<< orphan*/);
int /*<<< orphan*/ baz3(int /*<<< orphan*/);
void test_baz() {
  baz(0);
  baz2(0);
  baz3(0);
}


x86 assembly (clang, -O0):
<test_baz>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <baz@plt>
xor    %edi,%edi
call   1040 <baz2@plt>
xor    %edi,%edi
call   1050 <baz3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_baz>:
push   %rax
xor    %edi,%edi
call   1030 <baz@plt>
xor    %edi,%edi
call   1040 <baz2@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <baz3@plt>

LLVM IR (-O0):
define void @test_baz() {
%1 = call i32 @baz(i32 0)
%2 = call i32 @baz2(i32 0)
%3 = call i32 @baz3(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_baz() {
%1 = tail call i32 @baz(i32 0)
%2 = tail call i32 @baz2(i32 0)
%3 = tail call i32 @baz3(i32 0)
ret void
}
/* Variables and functions */
char *strdup(char *);
char *tgetstr(char *, char **);
void capability(char **buf, char *code, char **var) {
  char *val = tgetstr(code, buf);
  if (!val)
    *var = NULL;
  else
    *var = strdup(val);
}


x86 assembly (clang, -O0):
<capability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <tgetstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1160 <capability+0x40>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
jmp    1173 <capability+0x53>
mov    -0x20(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capability>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <tgetstr@plt>
test   %rax,%rax
je     1141 <capability+0x21>
mov    %rax,%rdi
call   1040 <strdup@plt>
jmp    1143 <capability+0x23>
xor    %eax,%eax
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @capability(i8** %0, i8* %1, i8** nocapture writeonly %2) {
%4 = tail call i8* @tgetstr(i8* %1, i8** %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* @strdup(i8* %4)
br label %8
8: ; preds = %3, %6
%9 = phi i8* [ %7, %6 ], [ null, %3 ]
store i8* %9, i8** %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
__attribute__((always_)) void LEUnpackUint16(uint16_t *data,
                                             const uint8_t container[2]) {
  *data = (uint16_t)container[0] | ((uint16_t)container[1] << 8);
}


x86 assembly (clang, -O0):
<LEUnpackUint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEUnpackUint16>:
mov    0x8(%rsi),%eax
shl    $0x8,%eax
or     (%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @LEUnpackUint16(i32* %0, i64* %1) {
%3 = alloca i32*
%4 = alloca i64*
store i32* %0, i32** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = load i64*, i64** %4
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
%15 = load i32*, i32** %3
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @LEUnpackUint16(i32* nocapture writeonly %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i64, i64* %1, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
store i32 %9, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_goldfish_timer();
void module_init() { init_goldfish_timer(); }


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

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

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

LLVM IR (-O2):
define void @module_init() {
%1 = tail call i32 (...) @init_goldfish_timer()
ret void
}