xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct ndarray {
  int dummy;
};
typedef int int8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int stdlib_ndarray_get_ptr_int8(int /*<<< orphan*/ *, int *);
int /*<<< orphan*/ *stdlib_ndarray_iget_ptr(struct ndarray const *,
                                            int /*<<< orphan*/ const);
int8_t stdlib_ndarray_iget_int8(const struct ndarray *arr, const int64_t idx,
                                int8_t *out) {
  uint8_t *ptr = stdlib_ndarray_iget_ptr(arr, idx);
  if (ptr == NULL) {
    return -1;
  }
  return stdlib_ndarray_get_ptr_int8(ptr, out);
}


x86 assembly (clang, -O0):
<stdlib_ndarray_iget_int8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <stdlib_ndarray_iget_ptr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115a <stdlib_ndarray_iget_int8+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <stdlib_ndarray_iget_int8+0x4a>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <stdlib_ndarray_get_ptr_int8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_ndarray_iget_int8>:
push   %rbx
mov    %rdx,%rbx
call   1030 <stdlib_ndarray_iget_ptr@plt>
test   %rax,%rax
je     113a <stdlib_ndarray_iget_int8+0x1a>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <stdlib_ndarray_get_ptr_int8@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.ndarray = type { i32 }
define i32 @stdlib_ndarray_iget_int8(%struct.ndarray* %0, i32 %1, i32* %2) {
%4 = tail call i32* @stdlib_ndarray_iget_ptr(%struct.ndarray* %0, i32 %1)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @stdlib_ndarray_get_ptr_int8(i32* %4, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ oak_record(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *,
                              int /*<<< orphan*/);
void end_doc(FILE *fp) { oak_record(fp, 0x0B, NULL, 0); }


x86 assembly (clang, -O0):
<end_doc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <oak_record@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_doc>:
mov    $0xb,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <oak_record@plt>

LLVM IR (-O0):
define void @end_doc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @oak_record(i32* %3, i32 11, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @end_doc(i32* %0) {
%2 = tail call i32 @oak_record(i32* %0, i32 11, i32* null, i32 0)
ret void
}
int ceillog2(unsigned v) {
  union {
    unsigned int u[2];
    double d;
  } t;
  t.u[1] = 0x43300000;
  t.u[!1] = v;
  t.d -= 4503599627370496.0;
  return ((t.u[1] >> 20) - 0x3FF) + ((v & (v - 1)) != 0);
}


x86 assembly (clang, -O0):
<ceillog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x43300000,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x14,%eax
sub    $0x3ff,%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
and    %edx,%ecx
cmp    $0x0,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceillog2>:
mov    %edi,%eax
movabs $0x4330000000000000,%rcx
or     %rax,%rcx
movq   %rcx,%xmm0
addsd  0xee4(%rip),%xmm0
movq   %xmm0,%rax
shr    $0x34,%rax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
cmp    $0x1,%ecx
sbb    $0xffffffff,%eax
add    $0xfffffc01,%eax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @ceillog2(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = bitcast %union.anon* %3 to [2 x i32]*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 1127219200, i32* %5
%6 = load i32, i32* %2
%7 = bitcast %union.anon* %3 to [2 x i32]*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 %6, i32* %8
%9 = bitcast %union.anon* %3 to double*
%10 = load double, double* %9
%11 = fsub double %10, 0x4330000000000000
store double %11, double* %9
%12 = bitcast %union.anon* %3 to [2 x i32]*
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 1
%14 = load i32, i32* %13
%15 = lshr i32 %14, 20
%16 = sub i32 %15, 1023
%17 = load i32, i32* %2
%18 = load i32, i32* %2
%19 = sub i32 %18, 1
%20 = and i32 %17, %19
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
%23 = add i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @ceillog2(i32 %0) {
%2 = zext i32 %0 to i64
%3 = or i64 %2, 4841369599423283200
%4 = bitcast i64 %3 to double
%5 = fadd double %4, 0xC330000000000000
%6 = bitcast double %5 to i64
%7 = lshr i64 %6, 52
%8 = trunc i64 %7 to i32
%9 = tail call i32 @llvm.ctpop.i32(i32 %0)
%10 = icmp ugt i32 %9, 1
%11 = select i1 %10, i32 -1022, i32 -1023
%12 = add nsw i32 %11, %8
ret i32 %12
}
void printcalib(struct streak *streak, int nstreak, struct star *star,
                int nstar, double foclen, double pixpitch, int w, int h,
                double rot[3][3], double *param, int nparam) {}


x86 assembly (clang, -O0):
<printcalib>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    %r8d,-0x34(%rbp)
mov    %r9d,-0x38(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.streak = type opaque
%struct.star = type opaque
define void @printcalib(%struct.streak* %0, i32 %1, %struct.star* %2, i32 %3, double %4, double %5, i32 %6, i32 %7, [3 x double]* %8, double* %9, i32 %10) {
%12 = alloca %struct.streak*
%13 = alloca i32
%14 = alloca %struct.star*
%15 = alloca i32
%16 = alloca double
%17 = alloca double
%18 = alloca i32
%19 = alloca i32
%20 = alloca [3 x double]*
%21 = alloca double*
%22 = alloca i32
store %struct.streak* %0, %struct.streak** %12
store i32 %1, i32* %13
store %struct.star* %2, %struct.star** %14
store i32 %3, i32* %15
store double %4, double* %16
store double %5, double* %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store [3 x double]* %8, [3 x double]** %20
store double* %9, double** %21
store i32 %10, i32* %22
ret void
}

LLVM IR (-O2):
%struct.streak = type opaque
%struct.star = type opaque
define void @printcalib(%struct.streak* nocapture %0, i32 %1, %struct.star* nocapture %2, i32 %3, double %4, double %5, i32 %6, i32 %7, [3 x double]* nocapture %8, double* nocapture %9, i32 %10) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sweep_get_dobldobl_target(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 1;
  ptos[1] = 1;
  fail = _ada_use_c2phc(619, ptos, &n, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_get_dobldobl_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26b,%edi
lea    -0x4(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_get_dobldobl_target>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26b,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_get_dobldobl_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 1, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc(i32 619, i32* %9, i32* %3, double* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_get_dobldobl_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 1, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 1, i32* %7
%8 = call i32 @_ada_use_c2phc(i32 619, i32* %6, i32* %3, double* %1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
char *removeDuplicateLetters(char *);
int /*<<< orphan*/ system(char *);
int main() {
  char *s = "abacb\0";
  char *result = removeDuplicateLetters(s);
  puts(result);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <removeDuplicateLetters@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <puts@plt>
lea    0xea0(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <removeDuplicateLetters@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
lea    0xebb(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"abacb\00\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @removeDuplicateLetters(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @puts(i8* %6)
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"abacb\00\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i8* @removeDuplicateLetters(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) %1)
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void UART4_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @UART4_IRQHandler() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
bool streq(const char *l, const char *r) { return strcmp(l, r) == 0; }


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __CPROVER_assert(int, char *);
int main() {
  unsigned int arrayOfInt[2];
  int diff1 = &arrayOfInt[1] - arrayOfInt;
  __CPROVER_assert(diff1 == 1, "pointer diff1");
  unsigned int diff2 = &arrayOfInt[1] - arrayOfInt;
  __CPROVER_assert(diff2 == 1, "pointer diff2");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rax
add    $0x4,%rax
lea    -0xc(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeb8(%rip),%rsi
call   1030 <__CPROVER_assert@plt>
lea    -0xc(%rbp),%rax
add    $0x4,%rax
lea    -0xc(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe98(%rip),%rsi
call   1030 <__CPROVER_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
call   1030 <__CPROVER_assert@plt>
lea    0xee5(%rip),%rsi
mov    $0x1,%edi
call   1030 <__CPROVER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"pointer diff1\00"
@.str.1 = [14 x i8] c"pointer diff2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%7 = ptrtoint i32* %5 to i64
%8 = ptrtoint i32* %6 to i64
%9 = sub i64 %7, %8
%10 = sdiv exact i64 %9, 4
%11 = trunc i64 %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 1
%14 = zext i1 %13 to i32
%15 = call i32 @__CPROVER_assert(i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%18 = ptrtoint i32* %16 to i64
%19 = ptrtoint i32* %17 to i64
%20 = sub i64 %18, %19
%21 = sdiv exact i64 %20, 4
%22 = trunc i64 %21 to i32
store i32 %22, i32* %4
%23 = load i32, i32* %4
%24 = icmp eq i32 %23, 1
%25 = zext i1 %24 to i32
%26 = call i32 @__CPROVER_assert(i32 %25, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"pointer diff1\00"
@.str.1 = [14 x i8] c"pointer diff2\00"
define i32 @main() {
%1 = tail call i32 @__CPROVER_assert(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @__CPROVER_assert(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void init_serial() {
  outb(0x3f8 + 1, 0x00);
  outb(0x3f8 + 3, 0x80);
  outb(0x3f8 + 0, 0x03);
  outb(0x3f8 + 1, 0x00);
  outb(0x3f8 + 3, 0x03);
  outb(0x3f8 + 2, 0xC7);
  outb(0x3f8 + 4, 0x0B);
}


x86 assembly (clang, -O0):
<init_serial>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3fa,%edi
mov    $0xc7,%esi
call   1030 <outb@plt>
mov    $0x3fc,%edi
mov    $0xb,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_serial>:
push   %rax
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3fa,%edi
mov    $0xc7,%esi
call   1030 <outb@plt>
mov    $0x3fc,%edi
mov    $0xb,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @init_serial() {
%1 = call i32 @outb(i32 1017, i32 0)
%2 = call i32 @outb(i32 1019, i32 128)
%3 = call i32 @outb(i32 1016, i32 3)
%4 = call i32 @outb(i32 1017, i32 0)
%5 = call i32 @outb(i32 1019, i32 3)
%6 = call i32 @outb(i32 1018, i32 199)
%7 = call i32 @outb(i32 1020, i32 11)
ret void
}

LLVM IR (-O2):
define void @init_serial() {
%1 = tail call i32 @outb(i32 1017, i32 0)
%2 = tail call i32 @outb(i32 1019, i32 128)
%3 = tail call i32 @outb(i32 1016, i32 3)
%4 = tail call i32 @outb(i32 1017, i32 0)
%5 = tail call i32 @outb(i32 1019, i32 3)
%6 = tail call i32 @outb(i32 1018, i32 199)
%7 = tail call i32 @outb(i32 1020, i32 11)
ret void
}
void g_type_check_class_cast() {}


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

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

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

LLVM IR (-O2):
define void @g_type_check_class_cast() {
ret void
}
void XDisplayString() {}


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

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

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

LLVM IR (-O2):
define void @XDisplayString() {
ret void
}
void plugin_exit_statfs(void) {}


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

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

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

LLVM IR (-O2):
define void @plugin_exit_statfs() {
ret void
}
int sanerror(const char *s) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sanerror(i8* nocapture readnone %0) {
ret i32 1
}
int fn2(int c) {
  if (c < 0)
    return 1;
  else if (--c == 0)
    return 2;
  else if (c < 0)
    return 3;
  return 0;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <fn2+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1162 <fn2+0x62>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    113b <fn2+0x3b>
movl   $0x2,-0x4(%rbp)
jmp    1162 <fn2+0x62>
cmpl   $0x0,-0x8(%rbp)
jge    1151 <fn2+0x51>
movl   $0x3,-0x4(%rbp)
jmp    1162 <fn2+0x62>
jmp    1156 <fn2+0x56>
jmp    115b <fn2+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
test   %edi,%edi
js     1119 <fn2+0x19>
mov    $0x2,%eax
cmp    $0x1,%edi
je     1118 <fn2+0x18>
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    (%rax,%rax,2),%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @fn2(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 1
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp eq i32 %0, 0
%7 = select i1 %6, i32 3, i32 0
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 1, %1 ], [ 2, %3 ], [ %7, %5 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x88() {
  Assert_real((isalnum(136) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              685, ("isalnum should be 0 for 0x88"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x88>:
push   %rax
mov    $0x88,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2ad,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x88\00"
define void @t_isalnum_0x88() {
%1 = call i64 @isalnum(i32 136)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 685, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x88\00"
define void @t_isalnum_0x88() {
%1 = tail call i64 @isalnum(i32 136)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 685, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
broken(thing) char *thing;
{
  clear_screen();
  reset_term();
  printf("Internal error: %s\n", thing);
  exit(1);
}


x86 assembly (clang, -O0):
<broken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <clear_screen@plt>
mov    $0x0,%al
call   1050 <reset_term@plt>
mov    -0x8(%rbp),%rsi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<broken>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <clear_screen@plt>
xor    %eax,%eax
call   1050 <reset_term@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Internal error: %s\0A\00"
define i32 @broken(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @clear_screen()
%4 = call i32 (...) @reset_term()
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"Internal error: %s\0A\00"
define i32 @broken(i8* %0) {
%2 = tail call i32 (...) @clear_screen()
%3 = tail call i32 (...) @reset_term()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
tail call void @exit(i32 1)
unreachable
}
int index_right(int index) { return (index << 1) + 1; }


x86 assembly (clang, -O0):
<index_right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_right>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @index_right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @index_right(i32 %0) {
%2 = shl i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void INT_Excep_PERIA_INTA247(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA247() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("argv[%d] = %s\n", i, argv[i]);
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"argv[%d] = %s\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
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"argv[%d] = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int arr[], int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printArray(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ int8_t;

/* Variables and functions */
void incDecRange(uint8_t *val, int8_t dir, uint8_t min, uint8_t max) {
  if (dir < 0) {
    if (*val > min) {
      *val += dir;
    }
  } else {
    if (*val < max) {
      *val += dir;
    }
  }
}


x86 assembly (clang, -O0):
<incDecRange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1143 <incDecRange+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jle    113e <incDecRange+0x3e>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
jmp    1167 <incDecRange+0x67>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jge    1162 <incDecRange+0x62>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
jmp    1167 <incDecRange+0x67>
pop    %rbp
ret

x86 assembly (clang, -O2):
<incDecRange>:
mov    (%rdi),%rax
test   %rsi,%rsi
js     1114 <incDecRange+0x14>
cmp    %rcx,%rax
jge    1113 <incDecRange+0x13>
add    %rsi,%rax
mov    %rax,(%rdi)
ret
cmp    %rdx,%rax
jg     110d <incDecRange+0xd>
jmp    1113 <incDecRange+0x13>

LLVM IR (-O0):
define void @incDecRange(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
%9 = load i64, i64* %6
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %4
%12 = load i64*, i64** %5
%13 = load i64, i64* %12
%14 = load i64, i64* %7
%15 = icmp sgt i64 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i64, i64* %6
%18 = load i64*, i64** %5
%19 = load i64, i64* %18
%20 = add nsw i64 %19, %17
store i64 %20, i64* %18
br label %21
21: ; preds = %16, %11
br label %33
22: ; preds = %4
%23 = load i64*, i64** %5
%24 = load i64, i64* %23
%25 = load i64, i64* %8
%26 = icmp slt i64 %24, %25
br i1 %26, label %27, label %32
27: ; preds = %22
%28 = load i64, i64* %6
%29 = load i64*, i64** %5
%30 = load i64, i64* %29
%31 = add nsw i64 %30, %28
store i64 %31, i64* %29
br label %32
32: ; preds = %27, %22
br label %33
33: ; preds = %32, %21
ret void
}

LLVM IR (-O2):
define void @incDecRange(i64* nocapture %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp slt i64 %1, 0
%6 = load i64, i64* %0
br i1 %5, label %7, label %9
7: ; preds = %4
%8 = icmp sgt i64 %6, %2
br i1 %8, label %11, label %13
9: ; preds = %4
%10 = icmp slt i64 %6, %3
br i1 %10, label %11, label %13
11: ; preds = %9, %7
%12 = add nsw i64 %6, %1
store i64 %12, i64* %0
br label %13
13: ; preds = %11, %9, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daxpy_(int *, double *, double const *, int *, double *,
                          int *);
void daxpy(int n, double alpha, const double *x, double *y) {
  int one = 1;
  daxpy_(&n, &alpha, x, &one, y, &one);
}


x86 assembly (clang, -O0):
<daxpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x24(%rbp),%r9
mov    %r9,%rcx
call   1030 <daxpy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daxpy>:
sub    $0x18,%rsp
mov    %rdx,%r8
mov    %rsi,%rdx
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
movl   $0x1,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
mov    %rcx,%r9
call   1030 <daxpy_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @daxpy(i32 %0, double %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
store i32 1, i32* %9
%10 = load double*, double** %7
%11 = load double*, double** %8
%12 = call i32 @daxpy_(i32* %5, double* %6, double* %10, i32* %9, double* %11, i32* %9)
ret void
}

LLVM IR (-O2):
define void @daxpy(i32 %0, double %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
%8 = bitcast i32* %7 to i8*
store i32 1, i32* %7
%9 = call i32 @daxpy_(i32* %5, double* %6, double* %2, i32* %7, double* %3, i32* %7)
ret void
}
int sd_script_letter_to_frame(char letter) { return (int)(letter - 'A'); }


x86 assembly (clang, -O0):
<sd_script_letter_to_frame>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_script_letter_to_frame>:
lea    -0x41(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @sd_script_letter_to_frame(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 65
ret i32 %5
}

LLVM IR (-O2):
define i32 @sd_script_letter_to_frame(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -65
ret i32 %3
}
int speyear(int year) {
  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
    return 29;
  } else {
    return 28;
  }
}


x86 assembly (clang, -O0):
<speyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <speyear+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <speyear+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <speyear+0x4f>
movl   $0x1d,-0x4(%rbp)
jmp    1156 <speyear+0x56>
movl   $0x1c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<speyear>:
test   $0x3,%dil
sete   %al
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
cmp    $0x28f5c29,%edx
setae  %dl
and    %al,%dl
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
setb   %al
or     %dl,%al
movzbl %al,%eax
or     $0x1c,%eax
ret

LLVM IR (-O0):
define i32 @speyear(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 eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 100
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7, %1
%12 = load i32, i32* %3
%13 = srem i32 %12, 400
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 29, i32* %2
br label %17
16: ; preds = %11
store i32 28, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @speyear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp ne i32 %4, 0
%6 = and i1 %3, %5
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
%10 = select i1 %9, i32 29, i32 28
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: screen-getty <tty> [baud] -c <cmd>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Usage: screen-getty <tty> [baud] -c <cmd>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [42 x i8] c"Usage: screen-getty <tty> [baud] -c <cmd>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pAndP1Hald(int, double, int, int, double *, double *);
void pAndP1Hald_R_wrapper(int *gen, double *mu, int *n, int *N0, double *prob,
                          double *prob1) {
  pAndP1Hald(*gen, *mu, *n, *N0, prob, prob1);
}


x86 assembly (clang, -O0):
<pAndP1Hald_R_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1030 <pAndP1Hald@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pAndP1Hald_R_wrapper>:
mov    (%rdi),%edi
movsd  (%rsi),%xmm0
mov    (%rdx),%esi
mov    (%rcx),%edx
mov    %r8,%rcx
mov    %r9,%r8
jmp    1030 <pAndP1Hald@plt>

LLVM IR (-O0):
define void @pAndP1Hald_R_wrapper(i32* %0, double* %1, i32* %2, i32* %3, double* %4, double* %5) {
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca double*
%12 = alloca double*
store i32* %0, i32** %7
store double* %1, double** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load double*, double** %8
%16 = load double, double* %15
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = load double*, double** %11
%22 = load double*, double** %12
%23 = call i32 @pAndP1Hald(i32 %14, double %16, i32 %18, i32 %20, double* %21, double* %22)
ret void
}

LLVM IR (-O2):
define void @pAndP1Hald_R_wrapper(i32* nocapture %0, double* nocapture %1, i32* nocapture %2, i32* nocapture %3, double* %4, double* %5) {
%7 = load i32, i32* %0
%8 = load double, double* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = tail call i32 @pAndP1Hald(i32 %7, double %8, i32 %9, i32 %10, double* %4, double* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ vafunction(int, int, int, int, int, int, int, int, int, int,
                              int);
int main(void) {
  vafunction(888., 999., 1., 2., 3., 4., 5., 6., 7., 8., 9.);
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x378,%edi
mov    $0x3e7,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x4,%r9d
movl   $0x5,(%rsp)
movl   $0x6,0x8(%rsp)
movl   $0x7,0x10(%rsp)
movl   $0x8,0x18(%rsp)
movl   $0x9,0x20(%rsp)
call   1030 <vafunction@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
mov    $0x378,%edi
mov    $0x3e7,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x4,%r9d
push   $0x9
push   $0x8
push   $0x7
push   $0x6
push   $0x5
call   1030 <vafunction@plt>
add    $0x30,%rsp
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @vafunction(i32 888, i32 999, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @vafunction(i32 888, i32 999, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *safe_malloc(size_t size) {
  void *x = malloc(size);
  if (x == NULL) {
    perror("malloc()");
    exit(-1);
  }
  return x;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <safe_malloc+0x3a>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <safe_malloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"malloc()\00"
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [9 x i8] c"malloc()\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i8* %2
}
int init_redpine(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @init_redpine() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @init_redpine() {
ret i32 -1
}
/* Type definitions */
struct trace_seq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ trace_seq_printf(struct trace_seq *, char *, char const *,
                                    char const *);
void print_op_data(struct trace_seq *s, const char *name, const char *op) {
  if (op)
    trace_seq_printf(s, "%8s:\t%s\n", name, op);
}


x86 assembly (clang, -O0):
<print_op_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <print_op_data+0x37>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xebe(%rip),%rsi
call   1030 <trace_seq_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_op_data>:
mov    %rdx,%rcx
test   %rdx,%rdx
je     1127 <print_op_data+0x17>
mov    %rsi,%rdx
lea    0xede(%rip),%rsi
jmp    1030 <trace_seq_printf@plt>
ret

LLVM IR (-O0):
%struct.trace_seq = type { i32 }
@.str = [9 x i8] c"%8s:\09%s\0A\00"
define void @print_op_data(%struct.trace_seq* %0, i8* %1, i8* %2) {
%4 = alloca %struct.trace_seq*
%5 = alloca i8*
%6 = alloca i8*
store %struct.trace_seq* %0, %struct.trace_seq** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load %struct.trace_seq*, %struct.trace_seq** %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i32 @trace_seq_printf(%struct.trace_seq* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
br label %14
14: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
%struct.trace_seq = type { i32 }
@.str = [9 x i8] c"%8s:\09%s\0A\00"
define void @print_op_data(%struct.trace_seq* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int fibI(int);
int fibR(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int N;
  N = 34;
  printf("fib: %d = %d\n", fibR(N), fibI(N));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x22,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fibR@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <fibI@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x22,%edi
call   1030 <fibR@plt>
mov    %eax,%ebx
mov    $0x22,%edi
call   1050 <fibI@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"fib: %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 34, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @fibR(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @fibI(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"fib: %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @fibR(i32 34)
%2 = tail call i32 @fibI(i32 34)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}