xunge/DecIR huggingface dataset:
unsigned char hexchar(unsigned char c) {
  if (c > 16)
    return 'f';
  if (c >= 10)
    return c - 10 + 'a';
  return c + '0';
}


x86 assembly (clang, -O0):
<hexchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x10,%eax
jle    1120 <hexchar+0x20>
movb   $0x66,-0x1(%rbp)
jmp    1149 <hexchar+0x49>
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jl     113f <hexchar+0x3f>
movzbl -0x2(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1149 <hexchar+0x49>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexchar>:
mov    $0x66,%al
cmp    $0x10,%dil
ja     111a <hexchar+0x1a>
cmp    $0xa,%dil
jb     1114 <hexchar+0x14>
add    $0x57,%dil
jmp    1118 <hexchar+0x18>
add    $0x30,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @hexchar(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sgt i32 %5, 16
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 102, i8* %2
br label %23
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp sge i32 %10, 10
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = sub nsw i32 %14, 10
%16 = add nsw i32 %15, 97
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %23
18: ; preds = %8
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = add nsw i32 %20, 48
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
br label %23
23: ; preds = %18, %12, %7
%24 = load i8, i8* %2
ret i8 %24
}

LLVM IR (-O2):
define zeroext i8 @hexchar(i8 zeroext %0) {
%2 = icmp ugt i8 %0, 16
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = icmp ugt i8 %0, 9
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = add nuw nsw i8 %0, 87
br label %9
7: ; preds = %3
%8 = add nuw nsw i8 %0, 48
br label %9
9: ; preds = %1, %7, %5
%10 = phi i8 [ %6, %5 ], [ %8, %7 ], [ 102, %1 ]
ret i8 %10
}
/* Variables and functions */
int umath_double_sin(double);
double umath_double_csc(double x) { return 1 / umath_double_sin(x); }


x86 assembly (clang, -O0):
<umath_double_csc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <umath_double_sin@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umath_double_csc>:
push   %rax
call   1030 <umath_double_sin@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @umath_double_csc(double %0) {
%2 = tail call i32 @umath_double_sin(double %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to double
ret double %6
}
int ld_bge_rr1(long double a1, long double a2) {
  return (__builtin_isgreaterequal(a1, a2));
}


x86 assembly (clang, -O0):
<ld_bge_rr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bge_rr1>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @ld_bge_rr1(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp oge x86_fp80 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ld_bge_rr1(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp oge x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int hashString(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int main() {
  char string[80];
  puts("Enter the string of symbol:");
  gets(string);
  printf("Hash is %d.\n", hashString(string));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
lea    -0x60(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x60(%rbp),%rdi
call   1040 <hashString@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1040 <hashString@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter the string of symbol:\00"
@.str.1 = [13 x i8] c"Hash is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%7 = call i32 @hashString(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter the string of symbol:\00"
@.str.1 = [13 x i8] c"Hash is %d.\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @hashString(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int get(int a, int (*f)(int)) { return f(a); }


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
jmp    *%rsi

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

LLVM IR (-O2):
define i32 @get(i32 %0, i32 (i32)* nocapture %1) {
%3 = tail call i32 %1(i32 %0)
ret i32 %3
}
int main(int argc, char **argv) {
  void *ptr;
  unsigned long dst;
  unsigned long src = ~0;
  ptr = __builtin_memmove(&dst, &src, sizeof(dst));
  (void)ptr;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x28(%rbp)
ff
lea    -0x20(%rbp),%rax
lea    -0x28(%rbp),%rcx
mov    (%rcx),%rcx
mov    %rcx,(%rax)
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int fn_3(int flag) {
  int x = 4, y = 5;
  if (flag)
    x = 3;
  else
    x = 2;
  y = 2;
  return x * y;
}


x86 assembly (clang, -O0):
<fn_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112b <fn_3+0x2b>
movl   $0x3,-0x8(%rbp)
jmp    1132 <fn_3+0x32>
movl   $0x2,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_3>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
add    %eax,%eax
add    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @fn_3(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 4, i32 6
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
struct tm *localtime_r(int /*<<< orphan*/ const *, struct tm *);
int /*<<< orphan*/ printf(char *);
void cvtTime_t2Tm(struct tm *tm, const time_t *tv) {
  struct tm *rettm;
  rettm = localtime_r(tv, tm);
  if (rettm == NULL) {
    printf("Bad return value from localtime_r\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<cvtTime_t2Tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <cvtTime_t2Tm+0x42>
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvtTime_t2Tm>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <localtime_r@plt>
test   %rax,%rax
je     1146 <cvtTime_t2Tm+0x16>
pop    %rax
ret
lea    0xeb3(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [35 x i8] c"Bad return value from localtime_r\0A\00"
define void @cvtTime_t2Tm(%struct.tm* %0, i32* %1) {
%3 = alloca %struct.tm*
%4 = alloca i32*
%5 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load %struct.tm*, %struct.tm** %3
%8 = call %struct.tm* @localtime_r(i32* %6, %struct.tm* %7)
store %struct.tm* %8, %struct.tm** %5
%9 = load %struct.tm*, %struct.tm** %5
%10 = icmp eq %struct.tm* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@str = [34 x i8] c"Bad return value from localtime_r\00"
define void @cvtTime_t2Tm(%struct.tm* %0, i32* %1) {
%3 = tail call %struct.tm* @localtime_r(i32* %1, %struct.tm* %0)
%4 = icmp eq %struct.tm* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Absyn_bool_exp(int, unsigned int);
struct Cyc_Absyn_Exp *Cyc_Absyn_true_exp(unsigned loc) {
  return ({ Cyc_Absyn_bool_exp(1, loc); });
}


x86 assembly (clang, -O0):
<Cyc_Absyn_true_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <Cyc_Absyn_bool_exp@plt>
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyn_true_exp>:
push   %rax
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <Cyc_Absyn_bool_exp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_true_exp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @Cyc_Absyn_bool_exp(i32 1, i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct.Cyc_Absyn_Exp*
ret %struct.Cyc_Absyn_Exp* %8
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_true_exp(i32 %0) {
%2 = tail call i32 @Cyc_Absyn_bool_exp(i32 1, i32 %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct.Cyc_Absyn_Exp*
ret %struct.Cyc_Absyn_Exp* %4
}
void uDMAEnable(void) {
  (*((volatile unsigned long *)(0x400FF000 + 0x00000004))) = 0x00000001;
}


x86 assembly (clang, -O0):
<uDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400ff004,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAEnable>:
movq   $0x1,0x400ff004
ret

LLVM IR (-O0):
define void @uDMAEnable() {
store volatile i64 1, i64* inttoptr (i64 1074786308 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAEnable() {
store volatile i64 1, i64* inttoptr (i64 1074786308 to i64*)
ret void
}
float calculateCharges(float oreParcheggio) {
  float totaleParcheggio;
  if (oreParcheggio <= (float)3.00) {
    return (float)2.00;
  } else {
    totaleParcheggio = (float)2.00;
    oreParcheggio -= (float)3.00;
    totaleParcheggio += (oreParcheggio * (float)0.50);
    if (totaleParcheggio > (float)10.00) {
      return (float)10.00;
    } else {
      return totaleParcheggio;
    }
  }
}


x86 assembly (clang, -O0):
<calculateCharges>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     112d <calculateCharges+0x2d>
movss  0xee9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11a1 <calculateCharges+0xa1>
movss  0xed7(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeb9(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xea6(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe88(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1197 <calculateCharges+0x97>
movss  0xe77(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11a1 <calculateCharges+0xa1>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateCharges>:
movss  0xefc(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1135 <calculateCharges+0x35>
addss  0xef3(%rip),%xmm0
mulss  0xeef(%rip),%xmm0
addss  0xedb(%rip),%xmm0
movss  0xee3(%rip),%xmm1
minss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret
movss  0xec3(%rip),%xmm0
ret

LLVM IR (-O0):
define float @calculateCharges(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fcmp ole float %5, 3.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store float 2.000000e+00, float* %2
br label %19
8: ; preds = %1
store float 2.000000e+00, float* %4
%9 = load float, float* %3
%10 = fsub float %9, 3.000000e+00
store float %10, float* %3
%11 = load float, float* %3
%12 = load float, float* %4
%13 = call float @llvm.fmuladd.f32(float %11, float 5.000000e-01, float %12)
store float %13, float* %4
%14 = load float, float* %4
%15 = fcmp ogt float %14, 1.000000e+01
br i1 %15, label %16, label %17
16: ; preds = %8
store float 1.000000e+01, float* %2
br label %19
17: ; preds = %8
%18 = load float, float* %4
store float %18, float* %2
br label %19
19: ; preds = %17, %16, %7
%20 = load float, float* %2
ret float %20
}

LLVM IR (-O2):
define float @calculateCharges(float %0) {
%2 = fcmp ugt float %0, 3.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fadd float %0, -3.000000e+00
%5 = tail call float @llvm.fmuladd.f32(float %4, float 5.000000e-01, float 2.000000e+00)
%6 = fcmp ogt float %5, 1.000000e+01
%7 = select i1 %6, float 1.000000e+01, float %5
br label %8
8: ; preds = %3, %1
%9 = phi float [ 2.000000e+00, %1 ], [ %7, %3 ]
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ sort(int *, int /*<<< orphan*/, int);
void quickSort(int a[], int n) { sort(a, 0, n - 1); }


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <sort@plt>

LLVM IR (-O0):
define void @quickSort(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 = sub nsw i32 %6, 1
%8 = call i32 @sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @sort(i32* %0, i32 0, i32 %3)
ret void
}
int test_imm_1Fuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x1F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Fuint64_lowword_reg>:
test   $0x1f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Fuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 31
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dgemv(char, int, int, int, double *, int, double *, int,
                         int /*<<< orphan*/, double *, int);
int calcFitted(double *X, int n, int p, double *y, double *coef,
               double *fitted) {
  dgemv('n', n, p, 1, X, n, coef, 1, 0, fitted, 1);
  return 0;
}


x86 assembly (clang, -O0):
<calcFitted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%r9d
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
mov    $0x6e,%edi
mov    $0x1,%ecx
xor    %r11d,%r11d
mov    %r10,(%rsp)
movl   $0x1,0x8(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rax,0x18(%rsp)
movl   $0x1,0x20(%rsp)
call   1030 <dgemv@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcFitted>:
push   %rax
mov    %r9,%rax
mov    %r8,%r10
mov    %rdi,%r8
sub    $0x8,%rsp
mov    $0x6e,%edi
mov    $0x1,%ecx
mov    %esi,%r9d
push   $0x1
push   %rax
push   $0x0
push   $0x1
push   %r10
call   1030 <dgemv@plt>
add    $0x30,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @calcFitted(double* %0, i32 %1, i32 %2, double* %3, double* %4, double* %5) {
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
store double* %0, double** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load double*, double** %7
%16 = load i32, i32* %8
%17 = load double*, double** %11
%18 = load double*, double** %12
%19 = call i32 @dgemv(i8 signext 110, i32 %13, i32 %14, i32 1, double* %15, i32 %16, double* %17, i32 1, i32 0, double* %18, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @calcFitted(double* %0, i32 %1, i32 %2, double* nocapture readnone %3, double* %4, double* %5) {
%7 = tail call i32 @dgemv(i8 signext 110, i32 %1, i32 %2, i32 1, double* %0, i32 %1, double* %4, i32 1, i32 0, double* %5, i32 1)
ret i32 0
}
void CRYPTO_get_dynlock_destroy_callback(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int lchown(const char *path, uid_t owner, gid_t group) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<lchown>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lchown>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @lchown(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @lchown(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ init_devices(int);
int /*<<< orphan*/ init_exec();
int /*<<< orphan*/ init_memory(int);
int /*<<< orphan*/ init_opcodes();
int /*<<< orphan*/ init_registers();
int /*<<< orphan*/ init_stack();
int /*<<< orphan*/ init_symbols(int);
int /*<<< orphan*/ simple_program();
void init_vm() {
  init_memory(4096);
  init_symbols(256);
  init_devices(256);
  init_registers();
  init_stack();
  init_opcodes();
  init_exec();
  simple_program();
}


x86 assembly (clang, -O0):
<init_vm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1000,%edi
call   1060 <init_memory@plt>
mov    $0x100,%edi
call   10a0 <init_symbols@plt>
mov    $0x100,%edi
call   1050 <init_devices@plt>
mov    $0x0,%al
call   1090 <init_registers@plt>
mov    $0x0,%al
call   1080 <init_stack@plt>
mov    $0x0,%al
call   1040 <init_opcodes@plt>
mov    $0x0,%al
call   1030 <init_exec@plt>
mov    $0x0,%al
call   1070 <simple_program@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_vm>:
push   %rax
mov    $0x1000,%edi
call   1060 <init_memory@plt>
mov    $0x100,%edi
call   10a0 <init_symbols@plt>
mov    $0x100,%edi
call   1050 <init_devices@plt>
xor    %eax,%eax
call   1090 <init_registers@plt>
xor    %eax,%eax
call   1080 <init_stack@plt>
xor    %eax,%eax
call   1040 <init_opcodes@plt>
xor    %eax,%eax
call   1030 <init_exec@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <simple_program@plt>

LLVM IR (-O0):
define void @init_vm() {
%1 = call i32 @init_memory(i32 4096)
%2 = call i32 @init_symbols(i32 256)
%3 = call i32 @init_devices(i32 256)
%4 = call i32 (...) @init_registers()
%5 = call i32 (...) @init_stack()
%6 = call i32 (...) @init_opcodes()
%7 = call i32 (...) @init_exec()
%8 = call i32 (...) @simple_program()
ret void
}

LLVM IR (-O2):
define void @init_vm() {
%1 = tail call i32 @init_memory(i32 4096)
%2 = tail call i32 @init_symbols(i32 256)
%3 = tail call i32 @init_devices(i32 256)
%4 = tail call i32 (...) @init_registers()
%5 = tail call i32 (...) @init_stack()
%6 = tail call i32 (...) @init_opcodes()
%7 = tail call i32 (...) @init_exec()
%8 = tail call i32 (...) @simple_program()
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xgravity;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xgravity_type(void *_p) {
  return (int)((XEvent *)_p)->xgravity.type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xgravity_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xgravity_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void *AlignmentFill(void *p) {
  long isAligned = (long)p & 0x7;
  if (isAligned != 0)
    return (char *)p + 8 - isAligned;
  else
    return p;
}


x86 assembly (clang, -O0):
<AlignmentFill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1139 <AlignmentFill+0x39>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
xor    %ecx,%ecx
sub    -0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1141 <AlignmentFill+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AlignmentFill>:
mov    %rdi,%rax
and    $0xfffffffffffffff8,%rax
add    $0x8,%rax
test   $0x7,%dil
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @AlignmentFill(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 7
%4 = icmp eq i64 %3, 0
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = sub nsw i64 0, %3
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = select i1 %4, i8* %0, i8* %7
ret i8* %8
}
void __DELETE_nbody_nbody(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_nbody_nbody(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int isonum_731(char *p) {
  return ((p[0] & 0xff) | ((p[1] & 0xff) << 8) | ((p[2] & 0xff) << 16) |
          ((p[3] & 0xff) << 24));
}


x86 assembly (clang, -O0):
<isonum_731>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isonum_731(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = and i32 %6, 255
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = and i32 %18, 255
%20 = shl i32 %19, 16
%21 = or i32 %14, %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = and i32 %25, 255
%27 = shl i32 %26, 24
%28 = or i32 %21, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @isonum_731(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
void pushde_(dev, len) char *dev;
int len;
{ pushdev_(dev, len); }


x86 assembly (clang, -O0):
<pushde_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <pushdev_@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @pushde_(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @pushdev_ to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int rm_so;
  int rm_eo;
};
typedef TYPE_1__ regmatch_t;
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int regexec(int /*<<< orphan*/ *, char const *, int, TYPE_1__ *, int);
int Regexec(void *re, const char *str, int nm, int so, int eo, int flag) {
  int rcode;
  regmatch_t rm;
  rm.rm_so = so;
  rm.rm_eo = eo;
  rcode = regexec((regex_t *)re, str, nm, &rm, flag);
  return rcode;
}


x86 assembly (clang, -O0):
<Regexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%r8d
lea    -0x30(%rbp),%rcx
call   1030 <regexec@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Regexec>:
push   %rax
mov    %ecx,(%rsp)
mov    %r8d,0x4(%rsp)
mov    %rsp,%rcx
mov    %r9d,%r8d
call   1030 <regexec@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define i32 @Regexec(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca %struct.TYPE_3__
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%15 = load i32, i32* %10
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %14, i32 0, i32 0
store i32 %15, i32* %16
%17 = load i32, i32* %11
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %14, i32 0, i32 1
store i32 %17, i32* %18
%19 = load i8*, i8** %7
%20 = bitcast i8* %19 to i32*
%21 = load i8*, i8** %8
%22 = load i32, i32* %9
%23 = load i32, i32* %12
%24 = call i32 @regexec(i32* %20, i8* %21, i32 %22, %struct.TYPE_3__* %14, i32 %23)
store i32 %24, i32* %13
%25 = load i32, i32* %13
ret i32 %25
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
define i32 @Regexec(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca %struct.TYPE_3__
%8 = bitcast %struct.TYPE_3__* %7 to i8*
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i64 0, i32 0
store i32 %3, i32* %9
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i64 0, i32 1
store i32 %4, i32* %10
%11 = bitcast i8* %0 to i32*
%12 = call i32 @regexec(i32* %11, i8* %1, i32 %2, %struct.TYPE_3__* %7, i32 %5)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
void read_card(char card_name[]) {
  puts("Enter the card_name: ");
  scanf("%2s", card_name);
}


x86 assembly (clang, -O0):
<read_card>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_card>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xedf(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Enter the card_name: \00"
@.str.1 = [4 x i8] c"%2s\00"
define void @read_card(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter the card_name: \00"
@.str.1 = [4 x i8] c"%2s\00"
define void @read_card(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: fspin [-v][-s sec_per_iteration][-i iterations][-t "
                  "num_threads][-b cpu_list][-m memory(b|k|m)]\n");
  fprintf(stderr, "\twhere 'cpu_list' is comma and dash separated numbers with "
                  "no spaces\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xf1e(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf28(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [103 x i8] c"Usage: fspin [-v][-s sec_per_iteration][-i iterations][-t num_threads][-b cpu_list][-m memory(b|k|m)]\0A\00"
@.str.1 = [70 x i8] c"\09where 'cpu_list' is comma and dash separated numbers with no spaces\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [103 x i8] c"Usage: fspin [-v][-s sec_per_iteration][-i iterations][-t num_threads][-b cpu_list][-m memory(b|k|m)]\0A\00"
@.str.1 = [70 x i8] c"\09where 'cpu_list' is comma and dash separated numbers with no spaces\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
void tlbsync(void) { asm volatile("tlbsync" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @tlbsync() {
tail call void asm sideeffect "tlbsync", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
ScanError(msg) char *msg;
{
  long pos;
  yyGetPos(&pos);
  MESSAGE(msg, pos);
}


x86 assembly (clang, -O0):
<ScanError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <yyGetPos@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <MESSAGE@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScanError>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1040 <yyGetPos@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <MESSAGE@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ScanError(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = call i32 (i64*, ...) bitcast (i32 (...)* @yyGetPos to i32 (i64*, ...)*)(i64* %4)
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @MESSAGE to i32 (i8*, i64, ...)*)(i8* %6, i64 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @ScanError(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 (i64*, ...) bitcast (i32 (...)* @yyGetPos to i32 (i64*, ...)*)(i64* %2)
%5 = load i64, i64* %2
%6 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @MESSAGE to i32 (i8*, i64, ...)*)(i8* %0, i64 %5)
ret i32 undef
}
unsigned long USBModeGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned char *)(ulBase + 0x00000060))) &
          (0x00000080 | 0x00000004 | 0x00000001 | 0x00000018));
}


x86 assembly (clang, -O0):
<USBModeGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x60(%rax),%al
movzbl %al,%eax
and    $0x9d,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBModeGet>:
movzbl 0x60(%rdi),%eax
and    $0xffffff9d,%eax
ret

LLVM IR (-O0):
define i64 @USBModeGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 96
%5 = inttoptr i64 %4 to i8*
%6 = load volatile i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %7, 157
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @USBModeGet(i64 %0) {
%2 = add i64 %0, 96
%3 = inttoptr i64 %2 to i8*
%4 = load volatile i8, i8* %3
%5 = and i8 %4, -99
%6 = zext i8 %5 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ battleFieldClear();
void titleScreenClear() { battleFieldClear(); }


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

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

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

LLVM IR (-O2):
define void @titleScreenClear() {
%1 = tail call i32 (...) @battleFieldClear()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rdd08sdpa_get_line(uint8_t i_rdd08a) { return i_rdd08a & 0x1f; }


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

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

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

LLVM IR (-O2):
define i32 @rdd08sdpa_get_line(i32 %0) {
%2 = and i32 %0, 31
ret i32 %2
}
unsigned char APPL_StartOutputHandler(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @APPL_StartOutputHandler() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @APPL_StartOutputHandler() {
ret i8 0
}
int prefix(char *small, char *big) {
  int c;
  while ((c = *small++) == *big++)
    if (c == 0)
      return (1);
  return (c == 0);
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1156 <prefix+0x56>
cmpl   $0x0,-0x1c(%rbp)
jne    1151 <prefix+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1165 <prefix+0x65>
jmp    110c <prefix+0xc>
cmpl   $0x0,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
cmp    (%rsi,%rax,1),%cl
jne    1127 <prefix+0x27>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <prefix+0x10>
mov    $0x1,%eax
ret
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @prefix(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %7
7: ; preds = %21, %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 = sext i8 %10 to i32
store i32 %11, i32* %6
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %11, %15
br i1 %16, label %17, label %22
17: ; preds = %7
%18 = load i32, i32* %6
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %3
br label %26
21: ; preds = %17
br label %7
22: ; preds = %7
%23 = load i32, i32* %6
%24 = icmp eq i32 %23, 0
%25 = zext i1 %24 to i32
store i32 %25, i32* %3
br label %26
26: ; preds = %22, %20
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @prefix(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %16, label %3
13: ; preds = %3
%14 = icmp eq i8 %6, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %9, %13
%17 = phi i32 [ %15, %13 ], [ 1, %9 ]
ret i32 %17
}
int spellfix1Score(int iDistance, int iRank) {
  int iLog2;
  for (iLog2 = 0; iRank > 0; iLog2++, iRank >>= 1) {
  }
  return iDistance + 32 - iLog2;
}


x86 assembly (clang, -O0):
<spellfix1Score>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1137 <spellfix1Score+0x37>
jmp    1120 <spellfix1Score+0x20>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <spellfix1Score+0x11>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spellfix1Score>:
xor    %eax,%eax
test   %esi,%esi
jle    111c <spellfix1Score+0x1c>
mov    %esi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0xffffffff,%eax
cmp    $0x1,%esi
mov    %ecx,%esi
ja     1110 <spellfix1Score+0x10>
add    %edi,%eax
add    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @spellfix1Score(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = ashr i32 %13, 1
store i32 %14, i32* %4
br label %6
15: ; preds = %6
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 32
%18 = load i32, i32* %5
%19 = sub nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @spellfix1Score(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = phi i32 [ %8, %4 ], [ %1, %2 ]
%7 = add nuw nsw i32 %5, 1
%8 = lshr i32 %6, 1
%9 = icmp ult i32 %6, 2
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = xor i32 %5, -1
br label %12
12: ; preds = %10, %2
%13 = phi i32 [ 0, %2 ], [ %11, %10 ]
%14 = add nsw i32 %0, 32
%15 = add i32 %14, %13
ret i32 %15
}
/* Type definitions */
typedef int u_int16_t;
typedef int u_char;

/* Variables and functions */
u_int16_t dst_s_get_int16(const u_char *buf) {
  u_int16_t a = 0;
  a = ((u_int16_t)(buf[0] << 8)) | ((u_int16_t)(buf[1]));
  return (a);
}


x86 assembly (clang, -O0):
<dst_s_get_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dst_s_get_int16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int bar(unsigned long long);
int baz(char const *, unsigned int, unsigned short);
int foo(unsigned long long);
int test(const char *v, unsigned int w, unsigned long long int x) {
  unsigned short k;
  k = ((bar(x) & 0xff) << 8) | (foo(x) & 0xff);
  return baz(v, w, k);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <bar@plt>
and    $0xff,%eax
shl    $0x8,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <foo@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
and    $0xff,%ecx
or     %ecx,%eax
mov    %ax,-0x1a(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movzwl -0x1a(%rbp),%edx
call   1030 <baz@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <bar@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %rbx,%rdi
call   1050 <foo@plt>
movzbl %al,%eax
or     %ebp,%eax
movzwl %ax,%edx
mov    %r15,%rdi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <baz@plt>

LLVM IR (-O0):
define i32 @test(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i16
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = call i32 @bar(i64 %8)
%10 = and i32 %9, 255
%11 = shl i32 %10, 8
%12 = load i64, i64* %6
%13 = call i32 @foo(i64 %12)
%14 = and i32 %13, 255
%15 = or i32 %11, %14
%16 = trunc i32 %15 to i16
store i16 %16, i16* %7
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = load i16, i16* %7
%20 = call i32 @baz(i8* %17, i32 %18, i16 zeroext %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @test(i8* %0, i32 %1, i64 %2) {
%4 = tail call i32 @bar(i64 %2)
%5 = shl i32 %4, 8
%6 = tail call i32 @foo(i64 %2)
%7 = and i32 %6, 255
%8 = or i32 %7, %5
%9 = trunc i32 %8 to i16
%10 = tail call i32 @baz(i8* %0, i32 %1, i16 zeroext %9)
ret i32 %10
}