xunge/DecIR huggingface dataset:
/* Variables and functions */
void *defaultPayloadCloner(void *payload) {
  if (payload == NULL) {
    return NULL;
  }
  return payload;
}


x86 assembly (clang, -O0):
<defaultPayloadCloner>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <defaultPayloadCloner+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1128 <defaultPayloadCloner+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @defaultPayloadCloner(i8* %0) {
%2 = alloca i8*
%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 i8* null, i8** %2
br label %9
7: ; preds = %1
%8 = load i8*, i8** %3
store i8* %8, i8** %2
br label %9
9: ; preds = %7, %6
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
define i8* @defaultPayloadCloner(i8* readnone %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rib_fromfile(void) { printf("\nTODO\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"\0ATODO\00"
define void @rib_fromfile() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  if (4 > 5) {
    scanf("%d", &a);
    printf("%d", 4 - a);
  } else
    printf("%d", 5);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test_kill_handler(int sig) { printf("signal: %d\n", sig); }


x86 assembly (clang, -O0):
<test_kill_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_kill_handler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"signal: %d\0A\00"
define void @test_kill_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_reg_op();
int /*<<< orphan*/ arm_memio_strb(int /*<<< orphan*/);
void arm_strb_reg() { arm_memio_strb(arm_memio_reg_op()); }


x86 assembly (clang, -O0):
<arm_strb_reg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_memio_reg_op@plt>
mov    %eax,%edi
call   1040 <arm_memio_strb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_strb_reg>:
push   %rax
xor    %eax,%eax
call   1030 <arm_memio_reg_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_memio_strb@plt>

LLVM IR (-O0):
define void @arm_strb_reg() {
%1 = call i32 (...) @arm_memio_reg_op()
%2 = call i32 @arm_memio_strb(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_strb_reg() {
%1 = tail call i32 (...) @arm_memio_reg_op()
%2 = tail call i32 @arm_memio_strb(i32 %1)
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/iamrekcah/"
                        "cyclone/refs/heads/master/bin/genfiles/specsfile.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/iamrekcah/cyclone/refs/heads/master/bin/genfiles/specsfile.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/iamrekcah/cyclone/refs/heads/master/bin/genfiles/specsfile.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void Free_buf(char **buf, int *max, int *len) {
  if (*buf)
    free(*buf);
  *buf = 0;
  *len = 0;
  *max = 0;
}


x86 assembly (clang, -O0):
<Free_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     113e <Free_buf+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Free_buf>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112b <Free_buf+0x1b>
call   1030 <free@plt>
movq   $0x0,(%rbx)
movl   $0x0,(%r14)
movl   $0x0,(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Free_buf(i8** %0, i32* %1, i32* %2) {
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32*
store i8** %0, i8*** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8**, i8*** %4
%12 = load i8*, i8** %11
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %10, %3
%15 = load i8**, i8*** %4
store i8* null, i8** %15
%16 = load i32*, i32** %6
store i32 0, i32* %16
%17 = load i32*, i32** %5
store i32 0, i32* %17
ret void
}

LLVM IR (-O2):
define void @Free_buf(i8** nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
br label %8
8: ; preds = %6, %3
store i8* null, i8** %0
store i32 0, i32* %2
store i32 0, i32* %1
ret void
}
/* Variables and functions */
char *bool_to_str(int);
scalar_t__ make_version_cmp(int *, char const *, unsigned int, char **);
char *make_version_lt(char const *nm, unsigned int argc, char **argv) {
  bool err = false;
  bool res;
  res = (make_version_cmp(&err, nm, argc, argv) < 0);
  if (err)
    return NULL;
  return bool_to_str(res);
}


x86 assembly (clang, -O0):
<make_version_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%rdi
call   1030 <make_version_cmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1174 <make_version_lt+0x54>
movq   $0x0,-0x8(%rbp)
jmp    1180 <make_version_lt+0x60>
mov    -0x28(%rbp),%edi
call   1040 <bool_to_str@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_version_lt>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <make_version_cmp@plt>
cmpl   $0x0,0x4(%rsp)
je     1146 <make_version_lt+0x26>
xor    %eax,%eax
pop    %rcx
ret
shr    $0x3f,%rax
mov    %eax,%edi
call   1040 <bool_to_str@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @make_version_lt(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 0, i32* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = call i64 @make_version_cmp(i32* %8, i8* %10, i32 %11, i8** %12)
%14 = icmp slt i64 %13, 0
%15 = zext i1 %14 to i32
store i32 %15, i32* %9
%16 = load i32, i32* %8
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %3
store i8* null, i8** %4
br label %22
19: ; preds = %3
%20 = load i32, i32* %9
%21 = call i8* @bool_to_str(i32 %20)
store i8* %21, i8** %4
br label %22
22: ; preds = %19, %18
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @make_version_lt(i8* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i64 @make_version_cmp(i32* %4, i8* %0, i32 %1, i8** %2)
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = lshr i64 %6, 63
%11 = trunc i64 %10 to i32
%12 = call i8* @bool_to_str(i32 %11)
br label %13
13: ; preds = %3, %9
%14 = phi i8* [ %12, %9 ], [ null, %3 ]
ret i8* %14
}
/* Variables and functions */
int __raw_readb(int);
int is_ts9420_installed(void) { return !!(__raw_readb(0xfebfd000) & 0x04); }


x86 assembly (clang, -O0):
<is_ts9420_installed>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfebfd000,%edi
call   1030 <__raw_readb@plt>
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ts9420_installed>:
push   %rax
mov    $0xfebfd000,%edi
call   1030 <__raw_readb@plt>
shr    $0x2,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_ts9420_installed() {
%1 = call i32 @__raw_readb(i32 -20983808)
%2 = and i32 %1, 4
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_ts9420_installed() {
%1 = tail call i32 @__raw_readb(i32 -20983808)
%2 = lshr i32 %1, 2
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int bitmap_n_longs(size_t);
size_t bitmap_n_bytes(size_t n_bits) {
  return bitmap_n_longs(n_bits) * sizeof(unsigned long int);
}


x86 assembly (clang, -O0):
<bitmap_n_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bitmap_n_longs@plt>
cltq
shl    $0x3,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_n_bytes>:
push   %rax
call   1030 <bitmap_n_longs@plt>
cltq
shl    $0x3,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @bitmap_n_bytes(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @bitmap_n_longs(i64 %3)
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 8
ret i64 %6
}

LLVM IR (-O2):
define i64 @bitmap_n_bytes(i64 %0) {
%2 = tail call i32 @bitmap_n_longs(i64 %0)
%3 = sext i32 %2 to i64
%4 = shl nsw i64 %3, 3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
long long _wtoi64(int /*<<< orphan*/ const *);
long long wtoll(const wchar_t *_w) { return _wtoi64(_w); }


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

x86 assembly (clang, -O2):
<wtoll>:
jmp    1030 <_wtoi64@plt>

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

LLVM IR (-O2):
define i64 @wtoll(i32* %0) {
%2 = tail call i64 @_wtoi64(i32* %0)
ret i64 %2
}
int leftmostW(char *array, int n) {
  for (int i = 0; i < n; i++) {
    if (array[i] == 'W') {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<leftmostW>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1151 <leftmostW+0x51>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x57,%eax
jne    113e <leftmostW+0x3e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <leftmostW+0x58>
jmp    1143 <leftmostW+0x43>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <leftmostW+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftmostW>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111f <leftmostW+0x1f>
mov    %esi,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmpb   $0x57,(%rdi,%rcx,1)
je     1120 <leftmostW+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <leftmostW+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @leftmostW(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 87
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %16, label %6
14: ; preds = %6
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %11, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %11 ]
ret i32 %17
}
int ext3_acl_chmod(struct _inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct._inode = type opaque
define i32 @ext3_acl_chmod(%struct._inode* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int copy(void *dst, void *src) {
  *((uint64_t *)dst) = *((uint64_t *)src);
  return 0;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @copy(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret i32 0
}

LLVM IR (-O2):
define i32 @copy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret i32 0
}
void __attribute__((weak)) dma1_channel5_isr() { debug_handler(__FUNCTION__); }


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

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

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

LLVM IR (-O2):
@__FUNCTION__.dma1_channel5_isr = [18 x i8] c"dma1_channel5_isr\00"
define weak void @dma1_channel5_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.dma1_channel5_isr, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned int EOF;
int /*<<< orphan*/ error(char *);
int fgetc(int /*<<< orphan*/ *);
unsigned int read_lsb_word(FILE *stream) {
  unsigned int c = fgetc(stream) + (fgetc(stream) << 8);
  if (c == EOF)
    error("premature end of file");
  return c;
}


x86 assembly (clang, -O0):
<read_lsb_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%eax
jne    116c <read_lsb_word+0x4c>
lea    0xe99(%rip),%rdi
call   1040 <error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_lsb_word>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
add    %ebp,%ebx
mov    0x2ea5(%rip),%rax
cmp    (%rax),%ebx
jne    1153 <read_lsb_word+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <error@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [22 x i8] c"premature end of file\00"
define i32 @read_lsb_word(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @fgetc(i32* %6)
%8 = shl i32 %7, 8
%9 = add nsw i32 %5, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [22 x i8] c"premature end of file\00"
define i32 @read_lsb_word(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = add nsw i32 %4, %2
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *def_alloc_func(void *opaque, size_t items, size_t size) {
  (void)opaque, (void)items, (void)size;
  void *ret = malloc(items * size);
  memset(ret, 0, items * size);
  return ret;
}


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

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

LLVM IR (-O0):
define i8* @def_alloc_func(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = mul i64 %11, %12
%14 = call i8* @malloc(i64 %13)
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = mul i64 %16, %17
%19 = call i32 @memset(i8* %15, i32 0, i64 %18)
%20 = load i8*, i8** %7
ret i8* %20
}

LLVM IR (-O2):
define i8* @def_alloc_func(i8* nocapture readnone %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @memset(i8* %5, i32 0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printfspace(int deepth) {
  int temp = 0;
  while (temp < deepth) {
    printf("    ");
    temp++;
  }
}


x86 assembly (clang, -O0):
<printfspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <printfspace+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printfspace+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printfspace>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <printfspace+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <printfspace+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
define void @printfspace(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
short return_short_negative_one() { return -1; }


x86 assembly (clang, -O0):
<return_short_negative_one>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffff,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_short_negative_one>:
mov    $0xffff,%ax
ret

LLVM IR (-O0):
define signext i16 @return_short_negative_one() {
ret i16 -1
}

LLVM IR (-O2):
define signext i16 @return_short_negative_one() {
ret i16 -1
}
void trace_invoke(struct compilation_unit *cu) {}


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

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

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

LLVM IR (-O2):
%struct.compilation_unit = type opaque
define void @trace_invoke(%struct.compilation_unit* nocapture %0) {
ret void
}
/* Type definitions */
struct stack {
  int dummy;
};

/* Variables and functions */
scalar_t__ isEmpty(struct stack *);
int pop(struct stack *);
int /*<<< orphan*/ push(struct stack *, int);
void insertAtBottom(struct stack *stack, int elem) {
  if (isEmpty(stack)) {
    push(stack, elem);
  } else {
    int tmp = pop(stack);
    insertAtBottom(stack, elem);
    push(stack, tmp);
  }
}


x86 assembly (clang, -O0):
<insertAtBottom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <isEmpty@plt>
cmp    $0x0,%rax
je     1173 <insertAtBottom+0x33>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <push@plt>
jmp    1197 <insertAtBottom+0x57>
mov    -0x8(%rbp),%rdi
call   1030 <pop@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <insertAtBottom@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1060 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertAtBottom>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <isEmpty@plt>
test   %rax,%rax
jne    116b <insertAtBottom+0x2b>
mov    %rbx,%rdi
call   1030 <pop@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <insertAtBottom@plt>
mov    %r14d,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <push@plt>

LLVM IR (-O0):
%struct.stack = type { i32 }
define void @insertAtBottom(%struct.stack* %0, i32 %1) {
%3 = alloca %struct.stack*
%4 = alloca i32
%5 = alloca i32
store %struct.stack* %0, %struct.stack** %3
store i32 %1, i32* %4
%6 = load %struct.stack*, %struct.stack** %3
%7 = call i64 @isEmpty(%struct.stack* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load %struct.stack*, %struct.stack** %3
%11 = load i32, i32* %4
%12 = call i32 @push(%struct.stack* %10, i32 %11)
br label %21
13: ; preds = %2
%14 = load %struct.stack*, %struct.stack** %3
%15 = call i32 @pop(%struct.stack* %14)
store i32 %15, i32* %5
%16 = load %struct.stack*, %struct.stack** %3
%17 = load i32, i32* %4
%18 = load %struct.stack*, %struct.stack** %3
%19 = load i32, i32* %5
%20 = call i32 @push(%struct.stack* %18, i32 %19)
br label %21
21: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
%struct.stack = type { i32 }
define void @insertAtBottom(%struct.stack* %0, i32 %1) {
%3 = tail call i64 @isEmpty(%struct.stack* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2, %8
%6 = phi i32 [ %9, %8 ], [ %1, %2 ]
%7 = tail call i32 @push(%struct.stack* %0, i32 %6)
ret void
8: ; preds = %2
%9 = tail call i32 @pop(%struct.stack* %0)
tail call void @insertAtBottom(%struct.stack* %0, i32 %1)
br label %5
}
/* Variables and functions */
double RAND_MAX;
double rand();
int ignuin(int rangeLow, int rangeHigh) {
  double myRand = rand() / (1.0 + RAND_MAX);
  int range = rangeHigh - rangeLow + 1;
  int myRand_scaled = (myRand * range) + rangeLow;
  return myRand_scaled;
}


x86 assembly (clang, -O0):
<ignuin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xed3(%rip),%xmm1
mov    0x2eb4(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm2
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignuin>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec3(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
sub    %ebp,%ebx
add    $0x1,%ebx
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
cvtsi2sd %ebp,%xmm2
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @ignuin(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = call double (...) @rand()
%9 = load double, double* @RAND_MAX
%10 = fadd double 1.000000e+00, %9
%11 = fdiv double %8, %10
store double %11, double* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
%16 = load double, double* %5
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to double
%19 = load i32, i32* %3
%20 = sitofp i32 %19 to double
%21 = call double @llvm.fmuladd.f64(double %16, double %18, double %20)
%22 = fptosi double %21 to i32
store i32 %22, i32* %7
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @ignuin(i32 %0, i32 %1) {
%3 = tail call double (...) @rand()
%4 = load double, double* @RAND_MAX
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %3, %5
%7 = sub i32 1, %0
%8 = add i32 %7, %1
%9 = sitofp i32 %8 to double
%10 = sitofp i32 %0 to double
%11 = tail call double @llvm.fmuladd.f64(double %6, double %9, double %10)
%12 = fptosi double %11 to i32
ret i32 %12
}
const char *get_type_name_castable(struct castable *castable) {
  return "castable";
}


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

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

LLVM IR (-O0):
%struct.castable = type opaque
@.str = [9 x i8] c"castable\00"
define i8* @get_type_name_castable(%struct.castable* %0) {
%2 = alloca %struct.castable*
store %struct.castable* %0, %struct.castable** %2
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.castable = type opaque
@.str = [9 x i8] c"castable\00"
define i8* @get_type_name_castable(%struct.castable* nocapture readnone %0) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, void *);
uint64_t get_ticks(void) {
  struct timeval tv;
  gettimeofday(&tv, ((void *)0));
  return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<get_ticks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ticks>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @get_ticks() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i8* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @get_ticks() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i8* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void iface1_func1(void) { printf("A - version 0 func1\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"A - version 0 func1\0A\00"
define void @iface1_func1() {
%1 = 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"A - version 0 func1\00"
define void @iface1_func1() {
%1 = 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 */
size_t kpt_relocate_dense_BZ_grid_address(int **, size_t *, int **, int const *,
                                          double **, int const *);
size_t spg_relocate_dense_BZ_grid_address(
    int bz_grid_address[][3], size_t bz_map[], int grid_address[][3],
    const int mesh[3], double rec_lattice[3][3], const int is_shift[3]) {
  return kpt_relocate_dense_BZ_grid_address(
      bz_grid_address, bz_map, grid_address, mesh, rec_lattice, is_shift);
}


x86 assembly (clang, -O0):
<spg_relocate_dense_BZ_grid_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <kpt_relocate_dense_BZ_grid_address@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spg_relocate_dense_BZ_grid_address>:
jmp    1030 <kpt_relocate_dense_BZ_grid_address@plt>

LLVM IR (-O0):
define i64 @spg_relocate_dense_BZ_grid_address([3 x i32]* %0, i64* %1, [3 x i32]* %2, i32* %3, [3 x double]* %4, i32* %5) {
%7 = alloca [3 x i32]*
%8 = alloca i64*
%9 = alloca [3 x i32]*
%10 = alloca i32*
%11 = alloca [3 x double]*
%12 = alloca i32*
store [3 x i32]* %0, [3 x i32]** %7
store i64* %1, i64** %8
store [3 x i32]* %2, [3 x i32]** %9
store i32* %3, i32** %10
store [3 x double]* %4, [3 x double]** %11
store i32* %5, i32** %12
%13 = load [3 x i32]*, [3 x i32]** %7
%14 = bitcast [3 x i32]* %13 to i32**
%15 = load i64*, i64** %8
%16 = load [3 x i32]*, [3 x i32]** %9
%17 = bitcast [3 x i32]* %16 to i32**
%18 = load i32*, i32** %10
%19 = load [3 x double]*, [3 x double]** %11
%20 = bitcast [3 x double]* %19 to double**
%21 = load i32*, i32** %12
%22 = call i64 @kpt_relocate_dense_BZ_grid_address(i32** %14, i64* %15, i32** %17, i32* %18, double** %20, i32* %21)
ret i64 %22
}

LLVM IR (-O2):
define i64 @spg_relocate_dense_BZ_grid_address([3 x i32]* %0, i64* %1, [3 x i32]* %2, i32* %3, [3 x double]* %4, i32* %5) {
%7 = bitcast [3 x i32]* %0 to i32**
%8 = bitcast [3 x i32]* %2 to i32**
%9 = bitcast [3 x double]* %4 to double**
%10 = tail call i64 @kpt_relocate_dense_BZ_grid_address(i32** %7, i64* %1, i32** %8, i32* %3, double** %9, i32* %5)
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long ftell(int /*<<< orphan*/ *);
long c_ftell(void *stream) { return ftell((FILE *)stream); }


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

x86 assembly (clang, -O2):
<c_ftell>:
jmp    1030 <ftell@plt>

LLVM IR (-O0):
define i64 @c_ftell(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i64 @ftell(i32* %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @c_ftell(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @ftell(i32* %2)
ret i64 %3
}
/* Type definitions */
struct zc_sb_v0 {
  int dummy;
};

/* Variables and functions */
_Bool zc_sb_v0_check(struct zc_sb_v0 const *const, int /*<<< orphan*/,
                     int /*<<< orphan*/ *);
_Bool zc_sb_v0_is_valid(const struct zc_sb_v0 *const sb) {
  return zc_sb_v0_check(sb, 0, NULL);
}


x86 assembly (clang, -O0):
<zc_sb_v0_is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <zc_sb_v0_check@plt>
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zc_sb_v0_is_valid>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <zc_sb_v0_check@plt>

LLVM IR (-O0):
%struct.zc_sb_v0 = type { i32 }
define zeroext i1 @zc_sb_v0_is_valid(%struct.zc_sb_v0* %0) {
%2 = alloca %struct.zc_sb_v0*
store %struct.zc_sb_v0* %0, %struct.zc_sb_v0** %2
%3 = load %struct.zc_sb_v0*, %struct.zc_sb_v0** %2
%4 = call zeroext i1 @zc_sb_v0_check(%struct.zc_sb_v0* %3, i32 0, i32* null)
ret i1 %4
}

LLVM IR (-O2):
%struct.zc_sb_v0 = type { i32 }
define zeroext i1 @zc_sb_v0_is_valid(%struct.zc_sb_v0* %0) {
%2 = tail call zeroext i1 @zc_sb_v0_check(%struct.zc_sb_v0* %0, i32 0, i32* null)
ret i1 %2
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int);
void _merge_sort(int *vet, int size) {
  if (size < 2)
    return;
  int m = size / 2;
  _merge_sort(vet, m);
  _merge_sort(vet + m, size - m);
  merge(vet, size, m);
}


x86 assembly (clang, -O0):
<_merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    113e <_merge_sort+0x1e>
jmp    1181 <_merge_sort+0x61>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <_merge_sort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1030 <_merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <merge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_merge_sort>:
cmp    $0x1,%esi
jg     1126 <_merge_sort+0x6>
ret
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
mov    %ebx,%esi
call   1030 <_merge_sort@plt>
lea    (%r14,%rbx,4),%rdi
mov    %ebp,%esi
sub    %ebx,%esi
call   1030 <_merge_sort@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <merge@plt>

LLVM IR (-O0):
define void @_merge_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
br label %25
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 2
store i32 %11, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = sub nsw i32 %18, %19
%21 = load i32*, i32** %3
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = call i32 @merge(i32* %21, i32 %22, i32 %23)
br label %25
25: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @_merge_sort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %4, label %5
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = lshr i32 %1, 1
tail call void @_merge_sort(i32* %0, i32 %6)
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = sub nsw i32 %1, %6
tail call void @_merge_sort(i32* %8, i32 %9)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %6)
br label %4
}
/* Variables and functions */
int max(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 1;
  int b = 3;
  printf("the bigger is %d\n", max(a, b));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"the bigger is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @max(i32 1, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void show_sidtab(struct s_sidtab *UNUSED_sidtab __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
%struct.s_sidtab = type opaque
define void @show_sidtab(%struct.s_sidtab* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ buflist_bar_item_update();
int buflist_config_signal_buffer_cb(const void *pointer, void *data,
                                    const char *signal, const char *type_data,
                                    void *signal_data) {
  (void)pointer;
  (void)data;
  (void)signal;
  (void)type_data;
  (void)signal_data;
  buflist_bar_item_update();
  return 0;
}


x86 assembly (clang, -O0):
<buflist_config_signal_buffer_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    $0x0,%al
call   1030 <buflist_bar_item_update@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @buflist_config_signal_buffer_cb(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 (...) @buflist_bar_item_update()
ret i32 0
}

LLVM IR (-O2):
define i32 @buflist_config_signal_buffer_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
%6 = tail call i32 (...) @buflist_bar_item_update()
ret i32 0
}
int target_isinf(double x) {
  union {
    double d;
    struct {
      unsigned mantissa2;
      unsigned mantissa1 : 20;
      unsigned exponent : 11;
      unsigned sign : 1;
    } big_endian;
  } u;
  u.d = x;
  return (u.big_endian.exponent == 2047 && u.big_endian.mantissa1 == 0 &&
          u.big_endian.mantissa2 == 0);
}


x86 assembly (clang, -O0):
<target_isinf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
shr    $0x14,%ecx
and    $0x7ff,%ecx
xor    %eax,%eax
cmp    $0x7ff,%ecx
mov    %al,-0x11(%rbp)
jne    1151 <target_isinf+0x51>
mov    -0xc(%rbp),%ecx
and    $0xfffff,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    1151 <target_isinf+0x51>
cmpl   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<target_isinf>:
movq   %xmm0,%rax
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
and    %rax,%rcx
movabs $0x7ff0000000000000,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
sete   %al
ret

LLVM IR (-O0):
%union.anon = type { double }
%struct.anon = type { i32, i32 }
define i32 @target_isinf(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast %union.anon* %3 to double*
store double %4, double* %5
%6 = bitcast %union.anon* %3 to %struct.anon*
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = lshr i32 %8, 20
%10 = and i32 %9, 2047
%11 = icmp eq i32 %10, 2047
br i1 %11, label %12, label %23
12: ; preds = %1
%13 = bitcast %union.anon* %3 to %struct.anon*
%14 = getelementptr inbounds %struct.anon, %struct.anon* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = and i32 %15, 1048575
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %12
%19 = bitcast %union.anon* %3 to %struct.anon*
%20 = getelementptr inbounds %struct.anon, %struct.anon* %19, i32 0, i32 0
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, 0
br label %23
23: ; preds = %18, %12, %1
%24 = phi i1 [ false, %12 ], [ false, %1 ], [ %22, %18 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @target_isinf(double %0) {
%2 = bitcast double %0 to i64
%3 = and i64 %2, 9223372036854775807
%4 = icmp eq i64 %3, 9218868437227405312
%5 = zext i1 %4 to i32
ret i32 %5
}