xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strrchr(char *, char);
char *Basename(char *f) {
  char *sep = strrchr(f, '/');
  return sep ? sep + 1 : f;
}


x86 assembly (clang, -O0):
<Basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <Basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <Basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @Basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
void watchdog_init(void) {}


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

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

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

LLVM IR (-O2):
define void @watchdog_init() {
ret void
}
/* Variables and functions */
scalar_t__ nacl_startup_untar(char *, char *, char *);
int nacl_vim_main(int, char **);
int nacl_main(int argc, char *argv[]) {
  if (nacl_startup_untar(argv[0], "vim.tar", "/"))
    return 1;
  return nacl_vim_main(argc, argv);
}


x86 assembly (clang, -O0):
<nacl_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xec3(%rip),%rsi
lea    0xec4(%rip),%rdx
call   1030 <nacl_startup_untar@plt>
cmp    $0x0,%rax
je     115f <nacl_main+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    116e <nacl_main+0x4e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <nacl_vim_main@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nacl_main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
lea    0xece(%rip),%rsi
lea    0xecf(%rip),%rdx
call   1030 <nacl_startup_untar@plt>
test   %rax,%rax
je     114f <nacl_main+0x2f>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <nacl_vim_main@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"vim.tar\00"
@.str.1 = [2 x i8] c"/\00"
define i32 @nacl_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i64 @nacl_startup_untar(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %16
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @nacl_vim_main(i32 %13, i8** %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [8 x i8] c"vim.tar\00"
@.str.1 = [2 x i8] c"/\00"
define i32 @nacl_main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @nacl_startup_untar(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @nacl_vim_main(i32 %0, i8** %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 1, %2 ]
ret i32 %9
}
void initialize_bomb_solve(void) {}


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

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

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

LLVM IR (-O2):
define void @initialize_bomb_solve() {
ret void
}
signed int explicit_voidptr_to_signed_int(void *src) { return (signed int)src; }


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

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

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

LLVM IR (-O2):
define i32 @explicit_voidptr_to_signed_int(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
int bin(int dec) {
  if (dec < 2)
    return dec;
  else
    return (10 * bin(dec / 2)) + (dec % 2);
}


x86 assembly (clang, -O0):
<bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <bin+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <bin+0x4b>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <bin@plt>
imul   $0xa,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin>:
push   %rbx
mov    %edi,%ebx
cmp    $0x1,%edi
jle    112b <bin+0x1b>
mov    %ebx,%edi
shr    %edi
call   1030 <bin@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
and    $0x1,%ebx
or     %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bin(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %10, %5 ], [ %0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = lshr i32 %0, 1
%7 = tail call i32 @bin(i32 %6)
%8 = mul nsw i32 %7, 10
%9 = and i32 %0, 1
%10 = or i32 %8, %9
br label %3
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, size_t, int /*<<< orphan*/);
void *malloc_zero(size_t sz) {
  void *res = malloc(sz);
  memset(res, sz, 0);
  return res;
}


x86 assembly (clang, -O0):
<malloc_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_zero>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @malloc_zero(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i64 %7, i32 0)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @malloc_zero(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i64 %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf(
      "   Usage : plsa [options] ...\n		-h : help\n		-t : "
      "training mode\n		-e : test mode\n		-r : "
      "retraining mode\n		-d : document count\n		-w : "
      "word count\n		-o : topic count\n		-p : threads "
      "count, 1 by default\n		-m : maximum iteration count, 1000 by "
      "default\n		-s : save threshold, 800 by default\n	"
      "	-v : save step, 100 by default\n		-a : model "
      "file\n		-b : input file\n		-c : output file\n");
}


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

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

LLVM IR (-O0):
@.str = [372 x i8] c" Usage : plsa [options] ...\0A\09\09-h : help\0A\09\09-t : training mode\0A\09\09-e : test mode\0A\09\09-r : retraining mode\0A\09\09-d : document count\0A\09\09-w : word count\0A\09\09-o : topic count\0A\09\09-p : threads count, 1 by default\0A\09\09-m : maximum iteration count, 1000 by default\0A\09\09-s : save threshold, 800 by default\0A\09\09-v : save step, 100 by default\0A\09\09-a : model file\0A\09\09-b : input file\0A\09\09-c : output file\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([372 x i8], [372 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [371 x i8] c" Usage : plsa [options] ...\0A\09\09-h : help\0A\09\09-t : training mode\0A\09\09-e : test mode\0A\09\09-r : retraining mode\0A\09\09-d : document count\0A\09\09-w : word count\0A\09\09-o : topic count\0A\09\09-p : threads count, 1 by default\0A\09\09-m : maximum iteration count, 1000 by default\0A\09\09-s : save threshold, 800 by default\0A\09\09-v : save step, 100 by default\0A\09\09-a : model file\0A\09\09-b : input file\0A\09\09-c : output file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([371 x i8], [371 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgetc(int /*<<< orphan*/ *);
void advance(FILE *in, int by) {
  while (by-- > 0) {
    fgetc(in);
  }
}


x86 assembly (clang, -O0):
<advance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1141 <advance+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
jmp    111f <advance+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<advance>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1130 <advance+0x20>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
mov    %r14,%rdi
call   1030 <fgetc@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <advance+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @advance(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @fgetc(i32* %0)
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
int prodbin(int a, int b) {
  int x, y, z;
  x = a;
  y = b;
  z = 0;
  while (y != 0) {
    if (y % 2 == 1) {
      z = z + x;
    }
    x = 2 * x;
    y = y / 2;
  }
  return z;
}


x86 assembly (clang, -O0):
<prodbin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1160 <prodbin+0x60>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1144 <prodbin+0x44>
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
jmp    111d <prodbin+0x1d>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prodbin>:
xor    %eax,%eax
test   %esi,%esi
je     113c <prodbin+0x3c>
mov    %esi,%ecx
nopl   0x0(%rax,%rax,1)
shr    $0x1f,%ecx
add    %esi,%ecx
mov    %ecx,%r8d
and    $0xfffffffe,%r8d
mov    %esi,%edx
sub    %r8d,%edx
cmp    $0x1,%edx
mov    $0x0,%edx
cmove  %edi,%edx
add    %edx,%eax
add    %edi,%edi
sar    %ecx
add    $0x1,%esi
cmp    $0x2,%esi
mov    %ecx,%esi
ja     1110 <prodbin+0x10>
ret

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

LLVM IR (-O2):
define i32 @prodbin(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i32 [ %13, %4 ], [ %1, %2 ]
%7 = phi i32 [ %12, %4 ], [ %0, %2 ]
%8 = srem i32 %6, 2
%9 = icmp eq i32 %8, 1
%10 = select i1 %9, i32 %7, i32 0
%11 = add nsw i32 %10, %5
%12 = shl nsw i32 %7, 1
%13 = sdiv i32 %6, 2
%14 = add i32 %6, 1
%15 = icmp ult i32 %14, 3
br i1 %15, label %16, label %4
16: ; preds = %4, %2
%17 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %17
}
int test_imm_3Cint64_lowword_reg(long long val) {
  return ((val) & (0x3C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Cint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 60
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t write(int, char const *, size_t);
size_t callback(void *arg, const char *s, size_t length) {
  int *fd = arg;
  return write(*fd, s, length);
}


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

x86 assembly (clang, -O2):
<callback>:
mov    (%rdi),%edi
jmp    1030 <write@plt>

LLVM IR (-O0):
define i64 @callback(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i64 @write(i32 %11, i8* %12, i64 %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @callback(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i64 @write(i32 %5, i8* %1, i64 %2)
ret i64 %6
}
void delete_container(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @delete_container(i8* nocapture %0) {
ret void
}
/* Variables and functions */
double log(double);
double log_poisson(int k, double lambda) {
  return (double)k * (log(lambda) - log((double)k) + 1.0) -
         log(2.0 * 3.14159265358979323846 * (double)k) / 2.0 - lambda;
}


x86 assembly (clang, -O0):
<log_poisson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xe9b(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  -0x20(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe75(%rip),%xmm3
divsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_poisson>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
cvtsi2sd %edi,%xmm1
movsd  %xmm1,0x8(%rsp)
call   1030 <log@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
addsd  0xeb6(%rip),%xmm1
movsd  %xmm1,(%rsp)
movsd  0xeb1(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1030 <log@plt>
mulsd  0xea6(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
subsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @log_poisson(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = load double, double* %4
%8 = call double @log(double %7)
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = call double @log(double %10)
%12 = fsub double %8, %11
%13 = fadd double %12, 1.000000e+00
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to double
%16 = fmul double 0x401921FB54442D18, %15
%17 = call double @log(double %16)
%18 = fdiv double %17, 2.000000e+00
%19 = fneg double %18
%20 = call double @llvm.fmuladd.f64(double %6, double %13, double %19)
%21 = load double, double* %4
%22 = fsub double %20, %21
ret double %22
}

LLVM IR (-O2):
define double @log_poisson(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = tail call double @log(double %1)
%5 = tail call double @log(double %3)
%6 = fsub double %4, %5
%7 = fadd double %6, 1.000000e+00
%8 = fmul double %3, 0x401921FB54442D18
%9 = tail call double @log(double %8)
%10 = fmul double %9, -5.000000e-01
%11 = tail call double @llvm.fmuladd.f64(double %3, double %7, double %10)
%12 = fsub double %11, %1
ret double %12
}
void _irq_timer(void) {}


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

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

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

LLVM IR (-O2):
define void @_irq_timer() {
ret void
}
/* Variables and functions */
double asin(double);
double sqrt(double const);
extern double theta_of_accel(double an, double ae, double ad) {
  const double g2 = an * an + ae * ae + ad * ad;
  return -asin(an / sqrt(g2));
}


x86 assembly (clang, -O0):
<theta_of_accel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <asin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<theta_of_accel>:
push   %rax
movapd %xmm0,%xmm3
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     114c <theta_of_accel+0x2c>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    115f <theta_of_accel+0x3f>
movapd %xmm2,%xmm0
movsd  %xmm3,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm3
divsd  %xmm0,%xmm3
movapd %xmm3,%xmm0
call   1030 <asin@plt>
xorpd  0xe8c(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @theta_of_accel(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %4
%10 = load double, double* %5
%11 = load double, double* %5
%12 = fmul double %10, %11
%13 = call double @llvm.fmuladd.f64(double %8, double %9, double %12)
%14 = load double, double* %6
%15 = load double, double* %6
%16 = call double @llvm.fmuladd.f64(double %14, double %15, double %13)
store double %16, double* %7
%17 = load double, double* %4
%18 = load double, double* %7
%19 = call double @sqrt(double %18)
%20 = fdiv double %17, %19
%21 = call double @asin(double %20)
%22 = fneg double %21
ret double %22
}

LLVM IR (-O2):
define double @theta_of_accel(double %0, double %1, double %2) {
%4 = fmul double %1, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = tail call double @sqrt(double %6)
%8 = fdiv double %0, %7
%9 = tail call double @asin(double %8)
%10 = fneg double %9
ret double %10
}
/* Variables and functions */
int lib3();
int lib4() { return lib3(); }


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

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

LLVM IR (-O0):
define i32 @lib4() {
%1 = call i32 (...) @lib3()
ret i32 %1
}

LLVM IR (-O2):
define i32 @lib4() {
%1 = tail call i32 (...) @lib3()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
void print_local() {
  int local = 5;
  printf("Address of local, from function, is %p\n", &local);
}


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

x86 assembly (clang, -O2):
<print_local>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Address of local, from function, is %p\0A\00"
define void @print_local() {
%1 = alloca i32
store i32 5, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Address of local, from function, is %p\0A\00"
define void @print_local() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
int main() {
  int x;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fabd_d(double, double, double);
int /*<<< orphan*/ fabd_f(double, double, double);
int main() {
  fabd_d(10.0, 5.0, 5.0);
  fabd_d(5.0, 10.0, 5.0);
  fabd_f(10.0, 5.0, 5.0);
  fabd_f(5.0, 10.0, 5.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  0xec1(%rip),%xmm2
movaps %xmm2,%xmm1
call   1030 <fabd_d@plt>
movsd  0xeb1(%rip),%xmm2
movsd  0xeb1(%rip),%xmm1
movaps %xmm2,%xmm0
call   1030 <fabd_d@plt>
movsd  0xea1(%rip),%xmm0
movsd  0xe91(%rip),%xmm2
movaps %xmm2,%xmm1
call   1040 <fabd_f@plt>
movsd  0xe81(%rip),%xmm2
movsd  0xe81(%rip),%xmm1
movaps %xmm2,%xmm0
call   1040 <fabd_f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
movaps %xmm1,%xmm2
call   1030 <fabd_d@plt>
movsd  0xec7(%rip),%xmm0
movsd  0xeb7(%rip),%xmm1
movaps %xmm0,%xmm2
call   1030 <fabd_d@plt>
movsd  0xea7(%rip),%xmm0
movsd  0xea7(%rip),%xmm1
movaps %xmm1,%xmm2
call   1040 <fabd_f@plt>
movsd  0xe97(%rip),%xmm0
movsd  0xe87(%rip),%xmm1
movaps %xmm0,%xmm2
call   1040 <fabd_f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fabd_d(double 1.000000e+01, double 5.000000e+00, double 5.000000e+00)
%3 = call i32 @fabd_d(double 5.000000e+00, double 1.000000e+01, double 5.000000e+00)
%4 = call i32 @fabd_f(double 1.000000e+01, double 5.000000e+00, double 5.000000e+00)
%5 = call i32 @fabd_f(double 5.000000e+00, double 1.000000e+01, double 5.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fabd_d(double 1.000000e+01, double 5.000000e+00, double 5.000000e+00)
%2 = tail call i32 @fabd_d(double 5.000000e+00, double 1.000000e+01, double 5.000000e+00)
%3 = tail call i32 @fabd_f(double 1.000000e+01, double 5.000000e+00, double 5.000000e+00)
%4 = tail call i32 @fabd_f(double 5.000000e+00, double 1.000000e+01, double 5.000000e+00)
ret i32 0
}
int cmp(const void *a, const void *b) { return *(int *)a > *(int *)b ? -1 : 1; }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setle  %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @cmp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = select i1 %7, i32 -1, i32 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int /*<<< orphan*/ stderr;
int error(const char *msg) {
  char fmsg[1024];
  sprintf(fmsg, "%s", msg);
  fprintf(stderr, fmsg);
  return -1;
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@stderr = global i32 0
define i32 @error(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @stderr
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i32 @fprintf(i32 %7, i8* %8)
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @error(i8* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i8* @strcpy(i8* %3, i8* dereferenceable(1) %0)
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* %3)
ret i32 -1
}
void testClosureULrV(void (*closure)(unsigned long), unsigned long a1) {
  (*closure)(a1);
}


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

x86 assembly (clang, -O2):
<testClosureULrV>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureULrV(void (i64)* %0, i64 %1) {
%3 = alloca void (i64)*
%4 = alloca i64
store void (i64)* %0, void (i64)** %3
store i64 %1, i64* %4
%5 = load void (i64)*, void (i64)** %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @testClosureULrV(void (i64)* nocapture %0, i64 %1) {
tail call void %0(i64 %1)
ret void
}
void X509_PUBKEY_free(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_PUBKEY_free() {
ret void
}
/* Variables and functions */
int new_rand();
char getBaseRandom(int row) {
  char base[4][3] = {
      {'A', 'T', 'C'}, {'A', 'T', 'G'}, {'A', 'C', 'G'}, {'T', 'C', 'G'}};
  int col = new_rand() % 3;
  char ch = base[row][col];
  return ch;
}


x86 assembly (clang, -O0):
<getBaseRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <new_rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
movslq -0x4(%rbp),%rcx
lea    -0x10(%rbp),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBaseRandom>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <new_rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
movslq %ebx,%rcx
cltq
lea    (%rcx,%rcx,2),%rcx
lea    0xebb(%rip),%rdx
add    %rcx,%rdx
mov    (%rax,%rdx,1),%al
pop    %rbx
ret

LLVM IR (-O0):
@__const.getBaseRandom.base = [4 x [3 x i8]] [[3 x i8] c"ATC", [3 x i8] c"ATG", [3 x i8] c"ACG", [3 x i8] c"TCG"]
define signext i8 @getBaseRandom(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x [3 x i8]]
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %2
%6 = bitcast [4 x [3 x i8]]* %3 to i8*
%7 = call i32 (...) @new_rand()
%8 = srem i32 %7, 3
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [4 x [3 x i8]], [4 x [3 x i8]]* %3, i64 0, i64 %10
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 %13
%15 = load i8, i8* %14
store i8 %15, i8* %5
%16 = load i8, i8* %5
ret i8 %16
}

LLVM IR (-O2):
@__const.getBaseRandom.base = [4 x [3 x i8]] [[3 x i8] c"ATC", [3 x i8] c"ATG", [3 x i8] c"ACG", [3 x i8] c"TCG"]
define signext i8 @getBaseRandom(i32 %0) {
%2 = tail call i32 (...) @new_rand()
%3 = srem i32 %2, 3
%4 = sext i32 %0 to i64
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds [4 x [3 x i8]], [4 x [3 x i8]]* @__const.getBaseRandom.base, i64 0, i64 %4, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}
int xisblack(int c) { return (c > 32u); }


x86 assembly (clang, -O0):
<xisblack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisblack>:
xor    %eax,%eax
cmp    $0x21,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @xisblack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 32
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @xisblack(i32 %0) {
%2 = icmp ugt i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
void liba() {
  printf("\n%s: \n", __func__);
  common1();
}


x86 assembly (clang, -O0):
<liba>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <common1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<liba>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <common1@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\0A%s: \0A\00"
@__func__.liba = [5 x i8] c"liba\00"
define void @liba() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.liba, i64 0, i64 0))
%2 = call i32 (...) @common1()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0A%s: \0A\00"
@__func__.liba = [5 x i8] c"liba\00"
define void @liba() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.liba, i64 0, i64 0))
%2 = tail call i32 (...) @common1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void ce_rd_init(const char *fname) {
  fatal("coastexp"
        ": This build excluded CoastalExplorer support because expat was not "
        "installed.\n");
}


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

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

LLVM IR (-O0):
@.str = [88 x i8] c"coastexp: This build excluded CoastalExplorer support because expat was not installed.\0A\00"
define void @ce_rd_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [88 x i8] c"coastexp: This build excluded CoastalExplorer support because expat was not installed.\0A\00"
define void @ce_rd_init(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_DDint8_mem(signed char *val) {
  return ((*val) & (0xDD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DDint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -35
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HalTimerDeInitRtl8195aV02(void *);
void HalTimerDeInit(void *Data) { HalTimerDeInitRtl8195aV02(Data); }


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

x86 assembly (clang, -O2):
<HalTimerDeInit>:
jmp    1030 <HalTimerDeInitRtl8195aV02@plt>

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

LLVM IR (-O2):
define void @HalTimerDeInit(i8* %0) {
%2 = tail call i32 @HalTimerDeInitRtl8195aV02(i8* %0)
ret void
}
/* Variables and functions */
int strlen(char const *);
int g_strlen(const char *text) {
  if (text == 0) {
    return 0;
  }
  return strlen(text);
}


x86 assembly (clang, -O0):
<g_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <g_strlen+0x23>
movl   $0x0,-0x4(%rbp)
jmp    113f <g_strlen+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ end_buffer(int);
int /*<<< orphan*/ end_screen(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int exit_jerk(void) {
  end_screen(1);
  end_buffer(1);
  exit(0);
}


x86 assembly (clang, -O0):
<exit_jerk>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <end_screen@plt>
mov    $0x1,%edi
call   1030 <end_buffer@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exit_jerk>:
push   %rax
mov    $0x1,%edi
call   1040 <end_screen@plt>
mov    $0x1,%edi
call   1030 <end_buffer@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @exit_jerk() {
%1 = call i32 @end_screen(i32 1)
%2 = call i32 @end_buffer(i32 1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @exit_jerk() {
%1 = tail call i32 @end_screen(i32 1)
%2 = tail call i32 @end_buffer(i32 1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
unsigned short htons(hostshort)
unsigned short hostshort;
{ return (ntohs(hostshort)); }


x86 assembly (clang, -O0):
<htons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
mov    $0x0,%al
call   1030 <ntohs@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htons>:
push   %rax
movzwl %di,%edi
xor    %eax,%eax
call   1030 <ntohs@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @htons(i32 %0) {
%2 = alloca i16
%3 = trunc i32 %0 to i16
store i16 %3, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @ntohs to i32 (i32, ...)*)(i32 %5)
%7 = trunc i32 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @htons(i32 %0) {
%2 = and i32 %0, 65535
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @ntohs to i32 (i32, ...)*)(i32 %2)
%4 = trunc i32 %3 to i16
ret i16 %4
}
/* Variables and functions */
scalar_t__ atof(char const *);
int convert(const char str[]) {
  int rs = (int)atof(str);
  return (rs < 2 || rs > 100000) ? -1 : rs;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jl     113f <convert+0x2f>
cmpl   $0x186a0,-0xc(%rbp)
jle    114c <convert+0x3c>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <convert+0x42>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
push   %rax
call   1030 <atof@plt>
lea    -0x186a1(%rax),%ecx
cmp    $0xfffe7961,%ecx
mov    $0xffffffff,%ecx
cmovb  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @convert(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @atof(i8* %4)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 2
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 100000
br i1 %11, label %12, label %13
12: ; preds = %9, %1
br label %15
13: ; preds = %9
%14 = load i32, i32* %3
br label %15
15: ; preds = %13, %12
%16 = phi i32 [ -1, %12 ], [ %14, %13 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @convert(i8* nocapture %0) {
%2 = tail call i64 @atof(i8* %0)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, -100001
%5 = icmp ult i32 %4, -99999
%6 = select i1 %5, i32 -1, i32 %3
ret i32 %6
}
void INT_Excep_PERIB_INTB174(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB174() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t to_lower_simple(uint32_t c) {
  if (c < 0x100 || (c >= 0x410 && c <= 0x42f))
    c += 0x20;
  else
    c++;
  return c;
}


x86 assembly (clang, -O0):
<to_lower_simple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jl     112e <to_lower_simple+0x2e>
cmpl   $0x410,-0x4(%rbp)
jl     113c <to_lower_simple+0x3c>
cmpl   $0x42f,-0x4(%rbp)
jg     113c <to_lower_simple+0x3c>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <to_lower_simple+0x45>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_lower_simple>:
lea    -0x410(%rdi),%eax
cmp    $0x20,%eax
mov    $0x20,%ecx
mov    $0x1,%eax
cmovb  %ecx,%eax
cmp    $0x100,%edi
cmovl  %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @to_lower_simple(i32 %0) {
%2 = icmp slt i32 %0, 256
%3 = add i32 %0, -1040
%4 = icmp ult i32 %3, 32
%5 = or i1 %2, %4
%6 = select i1 %5, i32 32, i32 1
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  char msg[] = "Hello, world!\n";
  write(1, msg, sizeof(msg) - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rsi
mov    $0x1,%edi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0xa21646c726f77,%rax
mov    %rax,0xf(%rsp)
movabs $0x77202c6f6c6c6548,%rax
2c 20 77
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.msg = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
store i32 0, i32* %1
%3 = bitcast [15 x i8]* %2 to i8*
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = call i32 @write(i32 1, i8* %4, i32 14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.msg = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 1, i8* %2, i32 14)
ret i32 0
}
/* Type definitions */
struct serial_port {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
char const *strerror(int /*<<< orphan*/);
const char *serial_port_error_string(struct serial_port *port, ssize_t code) {
  return strerror(-code);
}


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

x86 assembly (clang, -O2):
<serial_port_error_string>:
mov    %esi,%edi
neg    %edi
jmp    1030 <strerror@plt>

LLVM IR (-O0):
%struct.serial_port = type { i32 }
define i8* @serial_port_error_string(%struct.serial_port* %0, i32 %1) {
%3 = alloca %struct.serial_port*
%4 = alloca i32
store %struct.serial_port* %0, %struct.serial_port** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub nsw i32 0, %5
%7 = call i8* @strerror(i32 %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.serial_port = type { i32 }
define i8* @serial_port_error_string(%struct.serial_port* nocapture readnone %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = tail call i8* @strerror(i32 %3)
ret i8* %4
}
long long signed_anti_range(long long min, long long max) {
  extern long long random_signed_value(void);
  long long val = random_signed_value();
  if (min <= val && val <= max)
    val = min - 1;
  return val;
}


x86 assembly (clang, -O0):
<signed_anti_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
call   1030 <random_signed_value@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1151 <signed_anti_range+0x41>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1151 <signed_anti_range+0x41>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_anti_range>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <random_signed_value@plt>
lea    -0x1(%rbx),%rcx
cmp    %r14,%rax
cmovg  %rax,%rcx
cmp    %rbx,%rax
cmovge %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @signed_anti_range(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = call i64 @random_signed_value()
store i64 %6, i64* %5
%7 = load i64, i64* %3
%8 = load i64, i64* %5
%9 = icmp sle i64 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = icmp sle i64 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i64, i64* %3
%16 = sub nsw i64 %15, 1
store i64 %16, i64* %5
br label %17
17: ; preds = %14, %10, %2
%18 = load i64, i64* %5
ret i64 %18
}

LLVM IR (-O2):
define i64 @signed_anti_range(i64 %0, i64 %1) {
%3 = tail call i64 @random_signed_value()
%4 = icmp slt i64 %3, %0
%5 = icmp sgt i64 %3, %1
%6 = or i1 %4, %5
%7 = add nsw i64 %0, -1
%8 = select i1 %6, i64 %3, i64 %7
ret i64 %8
}