xunge/DecIR huggingface dataset:
/* Variables and functions */
int getSum(int *, int);
int rangeSum(int l, int r, int BITree[]) {
  return getSum(BITree, r) - getSum(BITree, l);
}


x86 assembly (clang, -O0):
<rangeSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <getSum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <getSum@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rangeSum>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %edi,%r14d
mov    %rdx,%rdi
call   1030 <getSum@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <getSum@plt>
sub    %eax,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rangeSum(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %5
%9 = call i32 @getSum(i32* %7, i32 %8)
%10 = load i32*, i32** %6
%11 = load i32, i32* %4
%12 = call i32 @getSum(i32* %10, i32 %11)
%13 = sub nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @rangeSum(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @getSum(i32* %2, i32 %1)
%5 = tail call i32 @getSum(i32* %2, i32 %0)
%6 = sub nsw i32 %4, %5
ret i32 %6
}
sfill(str, cnt) char *str;
{
  register char *cp;
  register int i;
  cp = str;
  i = cnt;
  do
    *cp++ = ' ';
  while (--i);
}


x86 assembly (clang, -O0):
<sfill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x20,(%rax)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jne    1119 <sfill+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfill>:
push   %rax
lea    -0x1(%rsi),%edx
add    $0x1,%rdx
mov    $0x20,%esi
call   1030 <memset@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @sfill(i8* nocapture writeonly %0, i32 %1) {
%3 = add i32 %1, -1
%4 = zext i32 %3 to i64
%5 = add nuw nsw i64 %4, 1
ret i32 undef
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int lmc_does_file_exist(const char *fn) {
  struct stat st;
  return stat(fn, &st) != -1;
}


x86 assembly (clang, -O0):
<lmc_does_file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmc_does_file_exist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @lmc_does_file_exist(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @lmc_does_file_exist(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int strcmp(char *, char *);
int ds_cmp_str(void *s1, void *s2) { return strcmp((char *)s1, (char *)s2); }


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

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

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

LLVM IR (-O2):
define i32 @ds_cmp_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int foo(int a, int b) { return ((a & ~b) | (~a & b)); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(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 = xor i32 %6, -1
%8 = and i32 %5, %7
%9 = load i32, i32* %3
%10 = xor i32 %9, -1
%11 = load i32, i32* %4
%12 = and i32 %10, %11
%13 = or i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
void ClearMatrix(matrix) int *matrix;
{
  static char RoutineName[] = "ClearMatrix";
  int *mptr;
  for (mptr = matrix; mptr < matrix + 64; mptr++) {
    *mptr = 0;
  }
}


x86 assembly (clang, -O0):
<ClearMatrix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x100,%rcx
cmp    %rcx,%rax
jae    1143 <ClearMatrix+0x43>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ClearMatrix+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearMatrix>:
xorps  %xmm0,%xmm0
movups %xmm0,0xf0(%rdi)
movups %xmm0,0xe0(%rdi)
movups %xmm0,0xd0(%rdi)
movups %xmm0,0xc0(%rdi)
movups %xmm0,0xb0(%rdi)
movups %xmm0,0xa0(%rdi)
movups %xmm0,0x90(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
@ClearMatrix.RoutineName = internal global [12 x i8] c"ClearMatrix\00"
define void @ClearMatrix(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32* %4, i32** %3
br label %5
5: ; preds = %12, %1
%6 = load i32*, i32** %3
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 64
%9 = icmp ult i32* %6, %8
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i32*, i32** %3
store i32 0, i32* %11
br label %12
12: ; preds = %10
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i32 1
store i32* %14, i32** %3
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ClearMatrix(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ext();
void n8(int a, int b, int c, int d, int e, int f, int g, int h) { ext(); }


x86 assembly (clang, -O0):
<n8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    $0x0,%al
call   1030 <ext@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @n8(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = call i32 (...) @ext()
ret void
}

LLVM IR (-O2):
define void @n8(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 (...) @ext()
ret void
}
/* Type definitions */
struct xfs_inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ xfs_finish_inode_setup(struct xfs_inode *);
int /*<<< orphan*/ xfs_setup_inode(struct xfs_inode *);
int /*<<< orphan*/ xfs_setup_iops(struct xfs_inode *);
void xfs_setup_existing_inode(struct xfs_inode *ip) {
  xfs_setup_inode(ip);
  xfs_setup_iops(ip);
  xfs_finish_inode_setup(ip);
}


x86 assembly (clang, -O0):
<xfs_setup_existing_inode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xfs_setup_inode@plt>
mov    -0x8(%rbp),%rdi
call   1050 <xfs_setup_iops@plt>
mov    -0x8(%rbp),%rdi
call   1030 <xfs_finish_inode_setup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfs_setup_existing_inode>:
push   %rbx
mov    %rdi,%rbx
call   1040 <xfs_setup_inode@plt>
mov    %rbx,%rdi
call   1050 <xfs_setup_iops@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <xfs_finish_inode_setup@plt>

LLVM IR (-O0):
%struct.xfs_inode = type { i32 }
define void @xfs_setup_existing_inode(%struct.xfs_inode* %0) {
%2 = alloca %struct.xfs_inode*
store %struct.xfs_inode* %0, %struct.xfs_inode** %2
%3 = load %struct.xfs_inode*, %struct.xfs_inode** %2
%4 = call i32 @xfs_setup_inode(%struct.xfs_inode* %3)
%5 = load %struct.xfs_inode*, %struct.xfs_inode** %2
%6 = call i32 @xfs_setup_iops(%struct.xfs_inode* %5)
%7 = load %struct.xfs_inode*, %struct.xfs_inode** %2
%8 = call i32 @xfs_finish_inode_setup(%struct.xfs_inode* %7)
ret void
}

LLVM IR (-O2):
%struct.xfs_inode = type { i32 }
define void @xfs_setup_existing_inode(%struct.xfs_inode* %0) {
%2 = tail call i32 @xfs_setup_inode(%struct.xfs_inode* %0)
%3 = tail call i32 @xfs_setup_iops(%struct.xfs_inode* %0)
%4 = tail call i32 @xfs_finish_inode_setup(%struct.xfs_inode* %0)
ret void
}
void sigsys_handler(signo) int signo;
{ errx(1, "System V Shared Memory support is not present in the kernel"); }


x86 assembly (clang, -O0):
<sigsys_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigsys_handler>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"System V Shared Memory support is not present in the kernel\00"
define void @sigsys_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @errx to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"System V Shared Memory support is not present in the kernel\00"
define void @sigsys_handler(i32 %0) {
%2 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @errx to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}
void computeVariables(double *variables) {}


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

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

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

LLVM IR (-O2):
define void @computeVariables(double* nocapture %0) {
ret void
}
/* Variables and functions */
double pow(double, double);
double pow2(int exp) { return pow(2.0, (double)exp); }


x86 assembly (clang, -O0):
<pow2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed8(%rip),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <ldexp@plt>

LLVM IR (-O0):
define double @pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call double @pow(double 2.000000e+00, double %4)
ret double %5
}

LLVM IR (-O2):
define double @pow2(i32 %0) {
%2 = tail call double @ldexp(double 1.000000e+00, i32 %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main(int argc, char **argv) {
  int a = 2;
  int b = 3;
  swap(&a, &b);
  printf("a=%d, b=%d\n", a, b);
  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   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2,0x4(%rsp)
movl   $0x3,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %6
store i32 3, i32* %7
%8 = call i32 @swap(i32* %6, i32* %7)
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 2, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 3, i32* %4
%7 = call i32 @swap(i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}
/* Variables and functions */
scalar_t__ error();
int main() {
  const int t = 1;
  const int f = 0;
  int tmp;
  t || error();
  f &&error();
  if (t || error()) {
  }
  if (f && error()) {
  }
  tmp = t || error();
  tmp = f && error();
  tmp = (t || error()) ? (t || error()) : 0;
  tmp = (f && error()) ? 1 : (f && error());
  if (t > (f && error())) {
  }
  if (f < (t || error())) {
  }
  tmp = t > (f && error());
  tmp = f < (t || error());
  if (!!!(t || error())) {
  }
  if (!!!(f && error())) {
  }
  int test_multiple_operators_not_nested;
  (t || error()) + (f && error()) + tmp++;
  int test_expression_list_statement;
  return ({
    int __t = t;
    int __f = f;
    (f && error()) ? 1 : (f && error());
  });
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
store i32 0, i32* %4
store i32 1, i32* %4
store i32 0, i32* %4
store i32 1, i32* %4
store i32 1, i32* %4
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
%12 = add nsw i32 1, %10
store i32 1, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
%13 = load i32, i32* %9
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned int get_bios_ebda(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_bios_ebda() {
ret i32 0
}
unsigned long SIO1readMode32(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1readMode32() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1readMode32() {
ret i64 0
}
/* Variables and functions */
int ENOSYS;
int pthread_getconcurrency(void) { return -ENOSYS; }


x86 assembly (clang, -O0):
<pthread_getconcurrency>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2edb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_getconcurrency>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @pthread_getconcurrency() {
%1 = load i32, i32* @ENOSYS
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_getconcurrency() {
%1 = load i32, i32* @ENOSYS
%2 = sub nsw i32 0, %1
ret i32 %2
}
unsigned long long flip_unsigned_long_long(unsigned long long ull) {
  ull = ((ull >> 8) & 0x00FF00FF00FF00FF) | ((ull & 0x00FF00FF00FF00FF) << 8);
  ull = ((ull >> 16) & 0x0000FFFF0000FFFF) | ((ull & 0x0000FFFF0000FFFF) << 16);
  ull = ((ull >> 32)) | ((ull) << 32);
  return ull;
}


x86 assembly (clang, -O0):
<flip_unsigned_long_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
movabs $0xff00ff00ff00ff,%rcx
and    %rcx,%rax
movabs $0xff00ff00ff00ff,%rcx
and    -0x8(%rbp),%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
movabs $0xffff0000ffff,%rcx
and    %rcx,%rax
movabs $0xffff0000ffff,%rcx
and    -0x8(%rbp),%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
mov    -0x8(%rbp),%rcx
shl    $0x20,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip_unsigned_long_long>:
mov    %rdi,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @flip_unsigned_long_long(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 8
%5 = and i64 %4, 71777214294589695
%6 = load i64, i64* %2
%7 = and i64 %6, 71777214294589695
%8 = shl i64 %7, 8
%9 = or i64 %5, %8
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = lshr i64 %10, 16
%12 = and i64 %11, 281470681808895
%13 = load i64, i64* %2
%14 = and i64 %13, 281470681808895
%15 = shl i64 %14, 16
%16 = or i64 %12, %15
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = lshr i64 %17, 32
%19 = load i64, i64* %2
%20 = shl i64 %19, 32
%21 = or i64 %18, %20
store i64 %21, i64* %2
%22 = load i64, i64* %2
ret i64 %22
}

LLVM IR (-O2):
define i64 @flip_unsigned_long_long(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_load1_pd(double const *);
__m128d test_mm_load1_pd(double const *A) { return _mm_load1_pd(A); }


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

x86 assembly (clang, -O2):
<test_mm_load1_pd>:
jmp    1030 <_mm_load1_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_load1_pd(double* %0) {
%2 = tail call i32 @_mm_load1_pd(double* %0)
ret i32 %2
}
void print_to_console(const char *my_string) {
  while (*my_string != '\0') {
    while (*((volatile unsigned char *)(0x98010000 + 4)) == ((unsigned char)0))
      ;
    *((volatile unsigned char *)(0x98010000 + 3)) = *my_string;
    *((volatile unsigned char *)(0x98010000 + 5)) = ((unsigned char)1);
    my_string++;
  }
}


x86 assembly (clang, -O0):
<print_to_console>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115b <print_to_console+0x5b>
jmp    111d <print_to_console+0x1d>
mov    $0x98010004,%eax
mov    (%rax),%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    1135 <print_to_console+0x35>
jmp    111d <print_to_console+0x1d>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    $0x98010003,%eax
mov    %cl,(%rax)
mov    $0x98010005,%eax
movb   $0x1,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <print_to_console+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_to_console>:
mov    (%rdi),%al
test   %al,%al
je     1128 <print_to_console+0x28>
mov    $0x98010003,%ecx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rcx)
je     1110 <print_to_console+0x10>
mov    %al,(%rcx)
movb   $0x1,0x2(%rcx)
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <print_to_console+0x10>
ret

LLVM IR (-O0):
define void @print_to_console(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %14, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %3
br label %9
9: ; preds = %13, %8
%10 = load volatile i8, i8* inttoptr (i64 2550202372 to i8*)
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
store volatile i8 %16, i8* inttoptr (i64 2550202371 to i8*)
store volatile i8 1, i8* inttoptr (i64 2550202373 to i8*)
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @print_to_console(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
br label %7
7: ; preds = %4, %7
%8 = load volatile i8, i8* inttoptr (i64 2550202372 to i8*)
%9 = icmp eq i8 %8, 0
br i1 %9, label %7, label %10
10: ; preds = %7
store volatile i8 %5, i8* inttoptr (i64 2550202371 to i8*)
store volatile i8 1, i8* inttoptr (i64 2550202373 to i8*)
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %10, %1
ret void
}
void test4_f(a) char a;
{ int v[sizeof(a) == 1 ? 1 : -1]; }


x86 assembly (clang, -O0):
<test4_f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test4_f(i32 %0) {
%2 = alloca i8
%3 = alloca [1 x i32]
%4 = trunc i32 %0 to i8
store i8 %4, i8* %2
ret void
}

LLVM IR (-O2):
define void @test4_f(i32 %0) {
ret void
}
void __attribute__((weak)) exti2_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<exti2_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exti2_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.exti2_isr = [10 x i8] c"exti2_isr\00"
define weak void @exti2_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.exti2_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.exti2_isr = [10 x i8] c"exti2_isr\00"
define weak void @exti2_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.exti2_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
char EOF;
char getchar();
void MyFlush() {
  char ch;
  while ((ch = getchar() != '\n') && ch != EOF)
    ;
}


x86 assembly (clang, -O0):
<MyFlush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     1157 <MyFlush+0x47>
movsbl -0x1(%rbp),%eax
mov    0x2e9c(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1167 <MyFlush+0x57>
jmp    116c <MyFlush+0x5c>
jmp    1118 <MyFlush+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyFlush>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %ecx,%ecx
cmp    $0xa,%al
setne  %al
je     1139 <MyFlush+0x29>
mov    %al,%cl
movsbl (%rbx),%eax
cmp    %eax,%ecx
jne    1120 <MyFlush+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i8 0
define void @MyFlush() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp ne i8 %2, 10
%4 = zext i1 %3 to i32
%5 = load i8, i8* @EOF
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %4, %6
%8 = select i1 %3, i1 %7, i1 false
br i1 %8, label %1, label %9
9: ; preds = %1
ret void
}
void outb(int a, int b) {}


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

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

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

LLVM IR (-O2):
define void @outb(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printStats();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void onAlarm(int signo) {
  fprintf(stdout, "\n\n------TIME UP! put down your pencils------\n");
  sleep(1);
  printStats();
  sleep(2);
  kill(getpid(), SIGINT);
}


x86 assembly (clang, -O0):
<onAlarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <sleep@plt>
mov    $0x0,%al
call   1030 <printStats@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%edi
mov    0x2e4d(%rip),%rax
mov    (%rax),%esi
call   1060 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onAlarm>:
push   %rax
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
call   1030 <printStats@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
mov    0x2e59(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1060 <kill@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [46 x i8] c"\0A\0A------TIME UP! put down your pencils------\0A\00"
@SIGINT = global i32 0
define void @onAlarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 1)
%6 = call i32 (...) @printStats()
%7 = call i32 @sleep(i32 2)
%8 = call i32 (...) @getpid()
%9 = load i32, i32* @SIGINT
%10 = call i32 @kill(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [46 x i8] c"\0A\0A------TIME UP! put down your pencils------\0A\00"
@SIGINT = global i32 0
define void @onAlarm(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 (...) @printStats()
%6 = tail call i32 @sleep(i32 2)
%7 = tail call i32 (...) @getpid()
%8 = load i32, i32* @SIGINT
%9 = tail call i32 @kill(i32 %7, i32 %8)
ret void
}
int cidx_isident(char c) {
  return c < 0 || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') ||
         (c >= 'A' && c <= 'Z') || c == '_';
}


x86 assembly (clang, -O0):
<cidx_isident>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jl     1186 <cidx_isident+0x86>
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     113b <cidx_isident+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1186 <cidx_isident+0x86>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     115a <cidx_isident+0x5a>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1186 <cidx_isident+0x86>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1179 <cidx_isident+0x79>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1186 <cidx_isident+0x86>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cidx_isident>:
test   %dil,%dil
sets   %al
lea    -0x30(%rdi),%ecx
cmp    $0xa,%cl
setb   %cl
or     %al,%cl
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
or     %cl,%al
cmp    $0x5f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @cidx_isident(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp slt i32 %4, 0
br i1 %5, label %34, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br i1 %13, label %34, label %14
14: ; preds = %10, %6
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 97
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 122
br i1 %21, label %34, label %22
22: ; preds = %18, %14
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sge i32 %24, 65
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp sle i32 %28, 90
br i1 %29, label %34, label %30
30: ; preds = %26, %22
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 95
br label %34
34: ; preds = %30, %26, %18, %10, %1
%35 = phi i1 [ true, %26 ], [ true, %18 ], [ true, %10 ], [ true, %1 ], [ %33, %30 ]
%36 = zext i1 %35 to i32
ret i32 %36
}

LLVM IR (-O2):
define i32 @cidx_isident(i8 signext %0) {
%2 = icmp slt i8 %0, 0
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = or i1 %2, %4
%6 = and i8 %0, -33
%7 = add i8 %6, -65
%8 = icmp ult i8 %7, 26
%9 = or i1 %8, %5
%10 = icmp eq i8 %0, 95
%11 = or i1 %10, %9
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ runEventTest();
extern void runEventTests(void) { runEventTest(); }


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

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

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

LLVM IR (-O2):
define void @runEventTests() {
%1 = tail call i32 (...) @runEventTest()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hola!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"hola!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"hola!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hello() { printf("hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define void @say_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void pj_acquire_lock() {}


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

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

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

LLVM IR (-O2):
define void @pj_acquire_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xe0() {
  Assert_real((isupper(224) == 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_isupper.c",
              1125, ("isupper should be 0 for 0xe0"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xe0>:
push   %rax
mov    $0xe0,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x465,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe0\00"
define void @t_isupper_0xe0() {
%1 = call i64 @isupper(i32 224)
%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 1125, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe0\00"
define void @t_isupper_0xe0() {
%1 = tail call i64 @isupper(i32 224)
%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 1125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void run_motor(uint8_t number, uint8_t speed, uint8_t rotation) {}


x86 assembly (clang, -O0):
<run_motor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @run_motor(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR60_set(void) { return U_WMRCORENONE_set("U_WMR60"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR60\00"
define i8* @U_WMR60_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR60\00"
define i8* @U_WMR60_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int syscall(int, void const *, size_t);
int mlock(const void *addr, size_t len) { return syscall(150, addr, len); }


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

x86 assembly (clang, -O2):
<mlock>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x96,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @mlock(i8* %0, i64 %1) {
%3 = tail call i32 @syscall(i32 150, i8* %0, i64 %1)
ret i32 %3
}
/* Type definitions */
struct _fat_ptr {
  int dummy;
};

/* Variables and functions */
void *Cyc_Absyn_aggregate_type(unsigned int, struct _fat_ptr *);
void *Cyc_Absyn_union_typ(struct _fat_ptr *name) {
  void *_T0;
  _T0 = Cyc_Absyn_aggregate_type(1U, name);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_Absyn_union_typ>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <Cyc_Absyn_aggregate_type@plt>

LLVM IR (-O0):
%struct._fat_ptr = type { i32 }
define i8* @Cyc_Absyn_union_typ(%struct._fat_ptr* %0) {
%2 = alloca %struct._fat_ptr*
%3 = alloca i8*
store %struct._fat_ptr* %0, %struct._fat_ptr** %2
%4 = load %struct._fat_ptr*, %struct._fat_ptr** %2
%5 = call i8* @Cyc_Absyn_aggregate_type(i32 1, %struct._fat_ptr* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
%struct._fat_ptr = type { i32 }
define i8* @Cyc_Absyn_union_typ(%struct._fat_ptr* %0) {
%2 = tail call i8* @Cyc_Absyn_aggregate_type(i32 1, %struct._fat_ptr* %0)
ret i8* %2
}
__attribute__((no, noclone)) signed __int128 t110_2sub(signed __int128 y) {
  signed __int128 x = (2);
  signed __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t110_2sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x2,-0x40(%rbp)
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
seto   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t110_2sub+0x5e>
jmp    1175 <t110_2sub+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t110_2sub>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
mov    $0x2,%ebx
sub    %rdi,%rbx
sbb    %rsi,%r14
jno    112b <t110_2sub+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t110_2sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 2, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t110_2sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 2, i128 %6)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ ASRT_Mark(char *, int, char *);
scalar_t__ ASRT_Strz(char *, int /*<<< orphan*/ *);
int test_StrAndNull() {
  do {
    ASRT_Mark("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/"
              "src/asrt_tests.c",
              143,
              "\"xxx\""
              " == "
              "NULL");
    if (ASRT_Strz("xxx", NULL)) {
      return 1;
    };
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_StrAndNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x8f,%esi
lea    0xf55(%rip),%rdx
call   1040 <ASRT_Mark@plt>
lea    0xf57(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <ASRT_Strz@plt>
cmp    $0x0,%rax
je     1166 <test_StrAndNull+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1172 <test_StrAndNull+0x52>
jmp    116b <test_StrAndNull+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_StrAndNull>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf61(%rip),%rdx
mov    $0x8f,%esi
call   1040 <ASRT_Mark@plt>
lea    0xf5e(%rip),%rdi
xor    %esi,%esi
call   1030 <ASRT_Strz@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [14 x i8] c"\22xxx\22 == NULL\00"
@.str.2 = [4 x i8] c"xxx\00"
define i32 @test_StrAndNull() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 143, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = call i64 @ASRT_Strz(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* null)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 1, i32* %1
br label %9
7: ; preds = %2
br label %8
8: ; preds = %7
store i32 0, i32* %1
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [14 x i8] c"\22xxx\22 == NULL\00"
@.str.2 = [4 x i8] c"xxx\00"
define i32 @test_StrAndNull() {
%1 = tail call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 143, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @ASRT_Strz(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* null)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
unsigned char getbyte(FILE *inf) {
  unsigned char buf[1];
  fread(buf, 1, 1, inf);
  return (buf[0]);
}


x86 assembly (clang, -O0):
<getbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x9(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
movzbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbyte>:
push   %rax
mov    %rdi,%rcx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @getbyte(i32* %0) {
%2 = alloca i32*
%3 = alloca [1 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = call i32 @fread(i8* %4, i32 1, i32 1, i32* %5)
%7 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @getbyte(i32* nocapture %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = call i32 @fread(i8* %3, i32 1, i32 1, i32* %0)
%5 = load i8, i8* %3
ret i8 %5
}
int bgscan_notify_tx_failure(struct wpa_supplicant *wpa_s) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define i32 @bgscan_notify_tx_failure(%struct.wpa_supplicant* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fn(int);
int main(int argc, char *argv[]) {
  fn(argc);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fn(i32 %0)
ret i32 0
}