xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int printf(char *, char *);
int main() {
  assert(printf("%s", "Hello, world!\n") == sizeof "Hello, world!\n" - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1030 <printf@plt>
cltq
cmp    $0xe,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 14
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Type definitions */
struct lisp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void gc(struct lisp *lisp, void *stack) { printf("GC!\n"); }


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

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

LLVM IR (-O0):
%struct.lisp = type { i32 }
@.str = [5 x i8] c"GC!\0A\00"
define void @gc(%struct.lisp* %0, i8* %1) {
%3 = alloca %struct.lisp*
%4 = alloca i8*
store %struct.lisp* %0, %struct.lisp** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.lisp = type { i32 }
@str = [4 x i8] c"GC!\00"
define void @gc(%struct.lisp* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, float);
char *ftoa(float number) {
  static char buffer[33];
  snprintf(buffer, sizeof(buffer), "%f", number);
  return buffer;
}


x86 assembly (clang, -O0):
<ftoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0x2f17(%rip),%rdi
mov    $0x21,%esi
lea    0xecb(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2eff(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftoa>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rdx
mov    %rbx,%rdi
mov    $0x21,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ftoa.buffer = internal global [33 x i8] zeroinitializer
@.str = [3 x i8] c"%f\00"
define i8* @ftoa(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ftoa.buffer, i64 0, i64 0), i32 33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %3)
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ftoa.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@ftoa.buffer = internal global [33 x i8] zeroinitializer
@.str = [3 x i8] c"%f\00"
define i8* @ftoa(float %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ftoa.buffer, i64 0, i64 0), i32 33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ftoa.buffer, i64 0, i64 0)
}
void *memset9(void *s, int c) { return __builtin_memset(s, c, 772); }


x86 assembly (clang, -O0):
<memset9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x304,%edx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset9>:
mov    $0x304,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @memset9(i8* returned writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(772) %0, i8 %3, i64 772, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main() {
  char ch;
  char *mem = (char *)malloc(20 * 1024 * 1024);
  int i;
  for (i = 0; i < 20 * 1024 * 1024; ++i) {
    ch = mem[i];
  }
  free(mem);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1400000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1400000,-0x14(%rbp)
jge    116d <main+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x5(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1400000,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
%5 = call i64 @malloc(i32 20971520)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
store i32 0, i32* %4
br label %7
7: ; preds = %16, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 20971520
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
store i8 %15, i8* %2
br label %16
16: ; preds = %10
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %7
19: ; preds = %7
%20 = load i8*, i8** %3
%21 = call i32 @free(i8* %20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 20971520)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
char *luaL_check_string(int);
scalar_t__ lua_lua2C(int);
char *luaL_opt_string(int numArg, char *def) {
  return (lua_lua2C(numArg) == 0) ? def : luaL_check_string(numArg);
}


x86 assembly (clang, -O0):
<luaL_opt_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <lua_lua2C@plt>
cmp    $0x0,%rax
jne    114e <luaL_opt_string+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    115a <luaL_opt_string+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <luaL_check_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaL_opt_string>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <lua_lua2C@plt>
test   %rax,%rax
je     113f <luaL_opt_string+0x1f>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <luaL_check_string@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @luaL_opt_string(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i64 @lua_lua2C(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i8*, i8** %4
br label %13
10: ; preds = %2
%11 = load i32, i32* %3
%12 = call i8* @luaL_check_string(i32 %11)
br label %13
13: ; preds = %10, %8
%14 = phi i8* [ %9, %8 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @luaL_opt_string(i32 %0, i8* readnone %1) {
%3 = tail call i64 @lua_lua2C(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @luaL_check_string(i32 %0)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ %1, %2 ]
ret i8* %8
}
int matrix_ref(int n, int i, int j, int k) { return i * (n * n) + j * n + k; }


x86 assembly (clang, -O0):
<matrix_ref>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
imul   %ecx,%eax
mov    -0xc(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    %ecx,%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_ref>:
imul   %edi,%esi
lea    (%rsi,%rdx,1),%eax
imul   %edi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @matrix_ref(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %5
%12 = mul nsw i32 %10, %11
%13 = mul nsw i32 %9, %12
%14 = load i32, i32* %7
%15 = load i32, i32* %5
%16 = mul nsw i32 %14, %15
%17 = add nsw i32 %13, %16
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @matrix_ref(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul i32 %1, %0
%6 = add i32 %5, %2
%7 = mul i32 %6, %0
%8 = add i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int __clone(int (*func)(void *), void *stack, int flags, void *arg, ...) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<__clone>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb5(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @__clone(i32 (i8*)* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, ...) {
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}
int ft_toupper(int c) {
  if (c >= 97 && c <= 122)
    c -= 32;
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <ft_toupper+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <ft_toupper+0x24>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int countBits(int const);
int compareHammingDistance(const void *A, const void *B) {
  const int *a = A;
  const int *b = B;
  return countBits(*a) - countBits(*b);
}


x86 assembly (clang, -O0):
<compareHammingDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1030 <countBits@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1030 <countBits@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareHammingDistance>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <countBits@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
call   1030 <countBits@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @compareHammingDistance(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = call i32 @countBits(i32 %12)
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = call i32 @countBits(i32 %15)
%17 = sub nsw i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @compareHammingDistance(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = tail call i32 @countBits(i32 %5)
%7 = load i32, i32* %4
%8 = tail call i32 @countBits(i32 %7)
%9 = sub nsw i32 %6, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ SRC_DriverIRQHandler();
__attribute__((weak)) void SRC_IRQHandler(void) { SRC_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @SRC_IRQHandler() {
%1 = call i32 (...) @SRC_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SRC_IRQHandler() {
%1 = tail call i32 (...) @SRC_DriverIRQHandler()
ret void
}
int ice_cmp_double(const void *a, const void *b) {
  double ia = *(double *)a;
  double ib = *(double *)b;
  if (ia < ib)
    return -1;
  if (ia > ib)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ice_cmp_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <ice_cmp_double+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <ice_cmp_double+0x69>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1162 <ice_cmp_double+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <ice_cmp_double+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ice_cmp_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ice_cmp_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ identity(int);
int bar(int x) {
  if (identity(x)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <identity@plt>
cmp    $0x0,%rax
je     1139 <bar+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1140 <bar+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i64 @identity(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int has3digitfactor(int n) {
  int i;
  for (i = 999; i > 99; --i) {
    if ((n / i) > 999 || n > i * i)
      return 0;
    if (!(n % i))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<has3digitfactor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x3e7,-0xc(%rbp)
cmpl   $0x63,-0xc(%rbp)
jle    1177 <has3digitfactor+0x77>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x3e7,%eax
jg     113c <has3digitfactor+0x3c>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jle    1148 <has3digitfactor+0x48>
movl   $0x0,-0x4(%rbp)
jmp    117e <has3digitfactor+0x7e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1164 <has3digitfactor+0x64>
movl   $0x1,-0x4(%rbp)
jmp    117e <has3digitfactor+0x7e>
jmp    1169 <has3digitfactor+0x69>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <has3digitfactor+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has3digitfactor>:
mov    $0x3e8,%esi
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffff,%esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x3e7,%ecx
jg     1136 <has3digitfactor+0x36>
mov    %esi,%ecx
imul   %esi,%ecx
cmp    %edi,%ecx
jl     1136 <has3digitfactor+0x36>
test   %edx,%edx
je     1137 <has3digitfactor+0x37>
cmp    $0x65,%esi
jae    1110 <has3digitfactor+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @has3digitfactor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 999, i32* %4
br label %5
5: ; preds = %27, %1
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 99
br i1 %7, label %8, label %30
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sdiv i32 %9, %10
%12 = icmp sgt i32 %11, 999
br i1 %12, label %19, label %13
13: ; preds = %8
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
%18 = icmp sgt i32 %14, %17
br i1 %18, label %19, label %20
19: ; preds = %13, %8
store i32 0, i32* %2
br label %31
20: ; preds = %13
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = srem i32 %21, %22
%24 = icmp ne i32 %23, 0
br i1 %24, label %26, label %25
25: ; preds = %20
store i32 1, i32* %2
br label %31
26: ; preds = %20
br label %27
27: ; preds = %26
%28 = load i32, i32* %4
%29 = add nsw i32 %28, -1
store i32 %29, i32* %4
br label %5
30: ; preds = %5
store i32 0, i32* %2
br label %31
31: ; preds = %30, %25, %19
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @has3digitfactor(i32 %0) {
br label %5
2: ; preds = %13
%3 = add nsw i32 %6, -1
%4 = icmp ugt i32 %6, 100
br i1 %4, label %5, label %15
5: ; preds = %1, %2
%6 = phi i32 [ 999, %1 ], [ %3, %2 ]
%7 = sdiv i32 %0, %6
%8 = srem i32 %0, %6
%9 = icmp sgt i32 %7, 999
%10 = mul nsw i32 %6, %6
%11 = icmp slt i32 %10, %0
%12 = select i1 %9, i1 true, i1 %11
br i1 %12, label %15, label %13
13: ; preds = %5
%14 = icmp eq i32 %8, 0
br i1 %14, label %15, label %2
15: ; preds = %2, %13, %5
%16 = phi i32 [ 0, %5 ], [ 1, %13 ], [ 0, %2 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_free(void *opaque, void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<my_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @my_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int invert(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", invert(80, 4, 3));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x50,%edi
mov    $0x4,%esi
mov    $0x3,%edx
call   1030 <invert@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @invert(i32 80, i32 4, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int mkostemp(char *, int);
int no_resourceLeak_mkostemp_02(char *template, int flags) {
  return mkostemp(template, flags);
}


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

x86 assembly (clang, -O2):
<no_resourceLeak_mkostemp_02>:
jmp    1030 <mkostemp@plt>

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

LLVM IR (-O2):
define i32 @no_resourceLeak_mkostemp_02(i8* %0, i32 %1) {
%3 = tail call i32 @mkostemp(i8* %0, i32 %1)
ret i32 %3
}
int tumbleweed_finalize(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tumbleweed_finalize() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_longdouble_get(long double *dest, const long double *src,
                                 size_t len, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_longdouble_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_longdouble_get(x86_fp80* %0, x86_fp80* %1, i64 %2, i32 %3) {
%5 = alloca x86_fp80*
%6 = alloca x86_fp80*
%7 = alloca i64
%8 = alloca i32
store x86_fp80* %0, x86_fp80** %5
store x86_fp80* %1, x86_fp80** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_longdouble_get(x86_fp80* nocapture readnone %0, x86_fp80* nocapture readnone %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x20() {
  Assert_real((isgraph(32) == 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_isgraph.c",
              165, ("isgraph should be 0 for  "));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x20>:
push   %rax
mov    $0x20,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xa5,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 0 for \00"
define void @t_isgraph_0x20() {
%1 = call i64 @isgraph(i32 32)
%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 165, i8* getelementptr inbounds ([26 x i8], [26 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 0 for \00"
define void @t_isgraph_0x20() {
%1 = tail call i64 @isgraph(i32 32)
%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 165, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int odd(int);
int even(int number) {
  if (number == 0)
    return 1;
  else
    return odd(number - 1);
}


x86 assembly (clang, -O0):
<even>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <even+0x21>
movl   $0x1,-0x4(%rbp)
jmp    113f <even+0x2f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <odd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<even>:
test   %edi,%edi
je     111c <even+0xc>
add    $0xffffffff,%edi
jmp    1030 <odd@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @even(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @odd(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 1, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
unsigned int _mm_encodekey256_u32(unsigned int, int /*<<< orphan*/,
                                  int /*<<< orphan*/, void *);
unsigned int test_encodekey256_u32(unsigned int htype, __m128i key_lo,
                                   __m128i key_hi, void *h) {
  return _mm_encodekey256_u32(htype, key_lo, key_hi, h);
}


x86 assembly (clang, -O0):
<test_encodekey256_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <_mm_encodekey256_u32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_encodekey256_u32>:
jmp    1030 <_mm_encodekey256_u32@plt>

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

LLVM IR (-O2):
define i32 @test_encodekey256_u32(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @_mm_encodekey256_u32(i32 %0, i32 %1, i32 %2, i8* %3)
ret i32 %5
}
void music_sheet_load_from_midi_file(struct music_sheet *self,
                                     struct file *file) {}


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

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

LLVM IR (-O0):
%struct.music_sheet = type opaque
%struct.file = type opaque
define void @music_sheet_load_from_midi_file(%struct.music_sheet* %0, %struct.file* %1) {
%3 = alloca %struct.music_sheet*
%4 = alloca %struct.file*
store %struct.music_sheet* %0, %struct.music_sheet** %3
store %struct.file* %1, %struct.file** %4
ret void
}

LLVM IR (-O2):
%struct.music_sheet = type opaque
%struct.file = type opaque
define void @music_sheet_load_from_midi_file(%struct.music_sheet* nocapture %0, %struct.file* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xe7() {
  Assert_real((isbdigit(231) == 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_isbdigit.c",
              1160, ("isbdigit should be 0 for 0xe7"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe7\00"
define void @t_isbdigit_0xe7() {
%1 = tail call i64 @isbdigit(i32 231)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1160, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ n_queen(int);
int main(int argc, char *argv[]) { n_queen(4); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <n_queen@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @n_queen(i32 4)
ret i32 0
}
void DCSMGrabFlashSectors(void) {
  volatile unsigned long temp;
  temp = (*((volatile unsigned long *)(0x00200000 + 0x00000018)));
  temp = (*((volatile unsigned long *)(0x00200000 + 0x002FFFE4)));
}


x86 assembly (clang, -O0):
<DCSMGrabFlashSectors>:
push   %rbp
mov    %rsp,%rbp
mov    $0x200018,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    $0x4fffe4,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCSMGrabFlashSectors>:
mov    0x200018,%rax
mov    %rax,-0x8(%rsp)
mov    0x4fffe4,%rax
mov    %rax,-0x8(%rsp)
ret

LLVM IR (-O0):
define void @DCSMGrabFlashSectors() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 2097176 to i64*)
store volatile i64 %2, i64* %1
%3 = load volatile i64, i64* inttoptr (i64 5242852 to i64*)
store volatile i64 %3, i64* %1
ret void
}

LLVM IR (-O2):
define void @DCSMGrabFlashSectors() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load volatile i64, i64* inttoptr (i64 2097176 to i64*)
store volatile i64 %3, i64* %1
%4 = load volatile i64, i64* inttoptr (i64 5242852 to i64*)
store volatile i64 %4, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_it();
scalar_t__ last();
__attribute__((no, noclone)) void f1(void) {
  for (;; do_it()) {
    if (last())
      break;
  }
  do_it();
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <f1+0x9>
mov    $0x0,%al
call   1030 <last@plt>
cmp    $0x0,%rax
je     113f <f1+0x1f>
jmp    1150 <f1+0x30>
jmp    1144 <f1+0x24>
mov    $0x0,%al
call   1040 <do_it@plt>
jmp    1129 <f1+0x9>
mov    $0x0,%al
call   1040 <do_it@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <last@plt>
test   %rax,%rax
jne    1145 <f1+0x25>
xor    %eax,%eax
call   1040 <do_it@plt>
jmp    1130 <f1+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1040 <do_it@plt>

LLVM IR (-O0):
define void @f1() {
br label %1
1: ; preds = %6, %0
%2 = call i64 (...) @last()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %8
5: ; preds = %1
br label %6
6: ; preds = %5
%7 = call i32 (...) @do_it()
br label %1
8: ; preds = %4
%9 = call i32 (...) @do_it()
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = tail call i64 (...) @last()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @do_it()
%5 = tail call i64 (...) @last()
%6 = icmp eq i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %0
%8 = tail call i32 (...) @do_it()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void delete (void *item) { free(item); }


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

x86 assembly (clang, -O2):
<delete>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int *geta2() {
  static int a = 0;
  return &a;
}


x86 assembly (clang, -O0):
<geta2>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f19(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<geta2>:
lea    0x2f1d(%rip),%rax
ret

LLVM IR (-O0):
@geta2.a = internal global i32 0
define i32* @geta2() {
ret i32* @geta2.a
}

LLVM IR (-O2):
@geta2.a = internal global i32 0
define i32* @geta2() {
ret i32* @geta2.a
}
void toggle_opt(void *val) {}


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

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

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

LLVM IR (-O2):
define void @toggle_opt(i8* nocapture %0) {
ret void
}
int test_imm_F0int64_midword_reg(long long val) {
  return ((val >> 16) & (0xF0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F0int64_midword_reg>:
test   $0xf00000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F0int64_midword_reg(i64 %0) {
%2 = and i64 %0, 15728640
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void HelloFunc() { printf("hello world\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define void @HelloFunc() {
%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 @HelloFunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void wait() {
  printf("\n");
  printf("Press the ENTER key...\n");
  fflush(stdout);
  getc(stdin);
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1060 <getc@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [24 x i8] c"Press the ENTER key...\0A\00"
@stdout = global i32 0
@stdin = global i32 0
define void @wait() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = load i32, i32* @stdin
%6 = call i32 @getc(i32 %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stdin = global i32 0
@str = [23 x i8] c"Press the ENTER key...\00"
define void @wait() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @stdin
%6 = tail call i32 @getc(i32 %5)
ret void
}
int test_imm_71int8_reg(signed char val) {
  return ((val) & (-0x71 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_71int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff8f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_71int8_reg(i8 signext %0) {
%2 = and i8 %0, -113
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int lookup_zone(char *qname) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @lookup_zone(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(int rc) {
  printf("usage: setmac [-hs?] [OPTION]...\n"
         "\t-b <base-mac>\n"
         "\t-s\n"
         "\t-f <flash-device>\n"
         "\t-m <mtd-name>\n"
         "\t-n <num-eth-interfaces>\n"
         "\t-o <offset>\n"
         "\t-p\n"
         "\t-r <redboot-config-name>\n");
  exit(rc);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [155 x i8] c"usage: setmac [-hs?] [OPTION]...\0A\09-b <base-mac>\0A\09-s\0A\09-f <flash-device>\0A\09-m <mtd-name>\0A\09-n <num-eth-interfaces>\0A\09-o <offset>\0A\09-p\0A\09-r <redboot-config-name>\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [154 x i8] c"usage: setmac [-hs?] [OPTION]...\0A\09-b <base-mac>\0A\09-s\0A\09-f <flash-device>\0A\09-m <mtd-name>\0A\09-n <num-eth-interfaces>\0A\09-o <offset>\0A\09-p\0A\09-r <redboot-config-name>\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([154 x i8], [154 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
scalar_t__ test__bswapdi2(int, int);
int main() {
  if (test__bswapdi2(0x123456789ABCDEF0LL, 0xF0DEBC9A78563412LL))
    return 1;
  if (test__bswapdi2(0x0000000100000002LL, 0x0200000001000000LL))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x9abcdef0,%edi
mov    $0x78563412,%esi
call   1030 <test__bswapdi2@plt>
cmp    $0x0,%rax
je     1144 <main+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x60>
mov    $0x2,%edi
mov    $0x1000000,%esi
call   1030 <test__bswapdi2@plt>
cmp    $0x0,%rax
je     1169 <main+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9abcdef0,%edi
mov    $0x78563412,%esi
call   1030 <test__bswapdi2@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     112f <main+0x1f>
pop    %rcx
ret
mov    $0x2,%edi
mov    $0x1000000,%esi
call   1030 <test__bswapdi2@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @test__bswapdi2(i32 -1698898192, i32 2018915346)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %10
5: ; preds = %0
%6 = call i64 @test__bswapdi2(i32 2, i32 16777216)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 1, i32* %1
br label %10
9: ; preds = %5
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @test__bswapdi2(i32 -1698898192, i32 2018915346)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 @test__bswapdi2(i32 2, i32 16777216)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
struct buffer_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __brelse(struct buffer_head *);
__attribute__((always_)) void brelse(struct buffer_head *bh) {
  if (bh)
    __brelse(bh);
}


x86 assembly (clang, -O0):
<brelse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <brelse+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <__brelse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brelse>:
test   %rdi,%rdi
je     111a <brelse+0xa>
jmp    1030 <__brelse@plt>
ret

LLVM IR (-O0):
%struct.buffer_head = type { i32 }
define void @brelse(%struct.buffer_head* %0) {
%2 = alloca %struct.buffer_head*
store %struct.buffer_head* %0, %struct.buffer_head** %2
%3 = load %struct.buffer_head*, %struct.buffer_head** %2
%4 = icmp ne %struct.buffer_head* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.buffer_head*, %struct.buffer_head** %2
%7 = call i32 @__brelse(%struct.buffer_head* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.buffer_head = type { i32 }
define void @brelse(%struct.buffer_head* %0) {
%2 = icmp eq %struct.buffer_head* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @__brelse(%struct.buffer_head* %0)
br label %5
5: ; preds = %3, %1
ret void
}