xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_current_pid();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ sleep(int);
int sys_sleep(int sec) {
  printf("process %d will sleep for %d seconds\n", get_current_pid(), sec);
  sleep(sec * 1000);
  return 0;
}


x86 assembly (clang, -O0):
<sys_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_current_pid@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
imul   $0x3e8,-0x4(%rbp),%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_sleep>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_current_pid@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
imul   $0x3e8,%ebx,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"process %d will sleep for %d seconds\0A\00"
define i32 @sys_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @get_current_pid()
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 1000
%8 = call i32 @sleep(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"process %d will sleep for %d seconds\0A\00"
define i32 @sys_sleep(i32 %0) {
%2 = tail call i32 (...) @get_current_pid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
%4 = mul nsw i32 %0, 1000
%5 = tail call i32 @sleep(i32 %4)
ret i32 0
}
/* Type definitions */
struct vect2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct vect2 *);
void clearVt2(struct vect2 **obj) {
  if (obj != NULL) {
    if (*obj != NULL) {
      free(*obj);
      *obj = NULL;
    } else {
    }
  } else {
  }
}


x86 assembly (clang, -O0):
<clearVt2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115b <clearVt2+0x4b>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1151 <clearVt2+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
jmp    1156 <clearVt2+0x46>
jmp    1156 <clearVt2+0x46>
jmp    1160 <clearVt2+0x50>
jmp    1160 <clearVt2+0x50>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearVt2>:
push   %rbx
test   %rdi,%rdi
je     112d <clearVt2+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <clearVt2+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.vect2 = type { i32 }
define void @clearVt2(%struct.vect2** %0) {
%2 = icmp eq %struct.vect2** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load %struct.vect2*, %struct.vect2** %0
%5 = icmp eq %struct.vect2* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(%struct.vect2* %4)
store %struct.vect2* null, %struct.vect2** %0
br label %8
8: ; preds = %1, %6, %3
ret void
}
/* Variables and functions */
int randomized_partition(int *, int, int);
void quick_sort_randomized(int *data_set, int f, int k) {
  if (f < k) {
    int q = randomized_partition(data_set, f, k);
    quick_sort_randomized(data_set, f, q - 1);
    quick_sort_randomized(data_set, q + 1, k);
  }
}


x86 assembly (clang, -O0):
<quick_sort_randomized>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort_randomized+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <randomized_partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <quick_sort_randomized@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <quick_sort_randomized@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort_randomized>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort_randomized+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <randomized_partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <quick_sort_randomized@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort_randomized+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort_randomized(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @randomized_partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort_randomized(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ mrtd_bac_kenc_kmac(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int /*<<< orphan*/ mrtd_crypto_sha1(int /*<<< orphan*/ const *, int,
                                    int /*<<< orphan*/ *);
void mrtd_bac_kmrz_to_kenc_kmac(const uint8_t *kmrz, uint8_t *kenc,
                                uint8_t *kmac) {
  uint8_t hash[20];
  mrtd_crypto_sha1(kmrz, 24, hash);
  mrtd_bac_kenc_kmac(hash, kenc, kmac);
}


x86 assembly (clang, -O0):
<mrtd_bac_kmrz_to_kenc_kmac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rdx
mov    $0x18,%esi
call   1030 <mrtd_crypto_sha1@plt>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <mrtd_bac_kenc_kmac@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrtd_bac_kmrz_to_kenc_kmac>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rsp,%r15
mov    $0x18,%esi
mov    %r15,%rdx
call   1030 <mrtd_crypto_sha1@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <mrtd_bac_kenc_kmac@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @mrtd_bac_kmrz_to_kenc_kmac(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [20 x i32]
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 0
%10 = call i32 @mrtd_crypto_sha1(i32* %8, i32 24, i32* %9)
%11 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 0
%12 = load i32*, i32** %5
%13 = load i32*, i32** %6
%14 = call i32 @mrtd_bac_kenc_kmac(i32* %11, i32* %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @mrtd_bac_kmrz_to_kenc_kmac(i32* %0, i32* %1, i32* %2) {
%4 = alloca [20 x i32]
%5 = bitcast [20 x i32]* %4 to i8*
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%7 = call i32 @mrtd_crypto_sha1(i32* %0, i32 24, i32* %6)
%8 = call i32 @mrtd_bac_kenc_kmac(i32* %6, i32* %1, i32* %2)
ret void
}
void foo524(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo524(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vdp_vsync();
void ar_delay_10ms() {
  vdp_vsync();
  vdp_vsync();
}


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

x86 assembly (clang, -O2):
<ar_delay_10ms>:
push   %rax
xor    %eax,%eax
call   1030 <vdp_vsync@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <vdp_vsync@plt>

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

LLVM IR (-O2):
define void @ar_delay_10ms() {
%1 = tail call i32 (...) @vdp_vsync()
%2 = tail call i32 (...) @vdp_vsync()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int __stdfix_sat_ur(int);
uint32_t __stdfix_smul_ur(uint32_t x, uint32_t y) {
  return (__stdfix_sat_ur(((uint32_t)x * (uint32_t)y) >> 16));
}


x86 assembly (clang, -O0):
<__stdfix_smul_ur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
sar    $0x10,%edi
call   1030 <__stdfix_sat_ur@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_smul_ur>:
imul   %esi,%edi
sar    $0x10,%edi
jmp    1030 <__stdfix_sat_ur@plt>

LLVM IR (-O0):
define i32 @__stdfix_smul_ur(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = ashr i32 %7, 16
%9 = call i32 @__stdfix_sat_ur(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @__stdfix_smul_ur(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = ashr i32 %3, 16
%5 = tail call i32 @__stdfix_sat_ur(i32 %4)
ret i32 %5
}
const char *todaysdate(void) { return "TODAY"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"TODAY\00"
define i8* @todaysdate() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"TODAY\00"
define i8* @todaysdate() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
void *nf(size_t size) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @nf(i64 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
scalar_t__ getpgrp();
scalar_t__ getpid();
scalar_t__ getppid();
int /*<<< orphan*/ printf(char *, char *, long, long, long, long);
scalar_t__ tcgetpgrp(int /*<<< orphan*/);
void pr_ids(char *name) {
  printf("%s: pid = %ld, ppid = %ld, pgrp = %ld, tpgrp = %ld\n", name,
         (long)getpid(), (long)getppid(), (long)getpgrp(),
         (long)tcgetpgrp(STDIN_FILENO));
}


x86 assembly (clang, -O0):
<pr_ids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1070 <getppid@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <getpgrp@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1050 <tcgetpgrp@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    %rax,%r9
lea    0xe53(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_ids>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1070 <getppid@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1060 <getpgrp@plt>
mov    %rax,%rbx
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <tcgetpgrp@plt>
lea    0xe72(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
mov    %rax,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"%s: pid = %ld, ppid = %ld, pgrp = %ld, tpgrp = %ld\0A\00"
@STDIN_FILENO = global i32 0
define void @pr_ids(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 (...) @getpid()
%5 = call i64 (...) @getppid()
%6 = call i64 (...) @getpgrp()
%7 = load i32, i32* @STDIN_FILENO
%8 = call i64 @tcgetpgrp(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %3, i64 %4, i64 %5, i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"%s: pid = %ld, ppid = %ld, pgrp = %ld, tpgrp = %ld\0A\00"
@STDIN_FILENO = global i32 0
define void @pr_ids(i8* %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i64 (...) @getppid()
%4 = tail call i64 (...) @getpgrp()
%5 = load i32, i32* @STDIN_FILENO
%6 = tail call i64 @tcgetpgrp(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %2, i64 %3, i64 %4, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setmode(char *);
void setbinary(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  setmode("octet");
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"octet\00"
define void @setbinary(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @setmode(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"octet\00"
define void @setbinary(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @setmode(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void null_close(void *ui) {}


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

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

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

LLVM IR (-O2):
define void @null_close(i8* nocapture %0) {
ret void
}
int main() {
  int i, j;
  i = 24;
  if (i) {
    float f[50][50];
    float b[10][500];
  } else {
    int pene[6000][6000][23];
  }
  while (i < 17000) {
    int a;
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc56990d0,%eax
sub    %rax,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x18,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1129 <main+0x29>
jmp    112e <main+0x2e>
jmp    112e <main+0x2e>
jmp    1133 <main+0x33>
cmpl   $0x4268,-0x8(%rbp)
jge    114e <main+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <main+0x33>
mov    -0x4(%rbp),%eax
add    $0x7fffffff,%rsp
add    $0x456990d1,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [50 x [50 x float]]
%5 = alloca [10 x [500 x float]]
%6 = alloca [6000 x [6000 x [23 x i32]]]
%7 = alloca i32
store i32 0, i32* %1
store i32 24, i32* %2
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
br label %12
11: ; preds = %0
br label %12
12: ; preds = %11, %10
br label %13
13: ; preds = %16, %12
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 17000
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %13
19: ; preds = %13
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t UARTIntStatus(uint32_t ui32Base, bool bMasked) {
  ;
  if (bMasked) {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000040))));
  } else {
    return ((*((volatile uint32_t *)(ui32Base + 0x0000003C))));
  }
}


x86 assembly (clang, -O0):
<UARTIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1126 <UARTIntStatus+0x26>
mov    -0x10(%rbp),%rax
mov    0x40(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <UARTIntStatus+0x32>
mov    -0x10(%rbp),%rax
mov    0x3c(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntStatus>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    -0x8(%rsp),%rcx
mov    0x3c(%rcx,%rax,4),%rax
ret

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

LLVM IR (-O2):
define i64 @UARTIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = icmp eq i32 %1, 0
%5 = load volatile i64, i64* %3
%6 = select i1 %4, i64 60, i64 64
%7 = add nsw i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
int abs(int j) { return j < 0 ? -j : j; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
double exp(double);
double xt_core_random_01();
unsigned long xt_core_random_poisson(double mean) {
  unsigned long k;
  double l;
  double p;
  k = 0;
  p = 1.0;
  l = exp(mean * -1.0);
  do {
    k++;
    p *= xt_core_random_01();
  } while (p >= l);
  return k - 1;
}


x86 assembly (clang, -O0):
<xt_core_random_poisson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <xt_core_random_01@plt>
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jae    1159 <xt_core_random_poisson+0x39>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xt_core_random_poisson>:
push   %rbx
sub    $0x10,%rsp
xorps  0xed4(%rip),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xed1(%rip),%xmm0
mov    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <xt_core_random_01@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  (%rsp),%xmm0
add    $0x1,%rbx
ucomisd 0x8(%rsp),%xmm0
jae    1150 <xt_core_random_poisson+0x30>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @xt_core_random_poisson(double %0) {
%2 = alloca double
%3 = alloca i64
%4 = alloca double
%5 = alloca double
store double %0, double* %2
store i64 0, i64* %3
store double 1.000000e+00, double* %5
%6 = load double, double* %2
%7 = fmul double %6, -1.000000e+00
%8 = call double @exp(double %7)
store double %8, double* %4
br label %9
9: ; preds = %15, %1
%10 = load i64, i64* %3
%11 = add i64 %10, 1
store i64 %11, i64* %3
%12 = call double (...) @xt_core_random_01()
%13 = load double, double* %5
%14 = fmul double %13, %12
store double %14, double* %5
br label %15
15: ; preds = %9
%16 = load double, double* %5
%17 = load double, double* %4
%18 = fcmp oge double %16, %17
br i1 %18, label %9, label %19
19: ; preds = %15
%20 = load i64, i64* %3
%21 = sub i64 %20, 1
ret i64 %21
}

LLVM IR (-O2):
define i64 @xt_core_random_poisson(double %0) {
%2 = fneg double %0
%3 = tail call double @exp(double %2)
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ 0, %1 ], [ %7, %4 ]
%6 = phi double [ 1.000000e+00, %1 ], [ %9, %4 ]
%7 = add i64 %5, 1
%8 = tail call double (...) @xt_core_random_01()
%9 = fmul double %6, %8
%10 = fcmp ult double %9, %3
br i1 %10, label %11, label %4
11: ; preds = %4
ret i64 %5
}
unsigned long otol(char *str) {
  unsigned long sum = 0L;
  char chh;
  while ((chh = *str) >= '0' && chh <= '7') {
    sum *= 8;
    sum += chh - '0';
    str++;
  }
  return (sum);
}


x86 assembly (clang, -O0):
<otol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x12(%rbp)
jl     1137 <otol+0x37>
movsbl -0x11(%rbp),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1147 <otol+0x47>
jmp    1175 <otol+0x75>
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %rax,-0x10(%rbp)
movsbl -0x11(%rbp),%eax
sub    $0x30,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <otol+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<otol>:
mov    (%rdi),%cl
mov    %ecx,%eax
and    $0xf8,%al
cmp    $0x30,%al
jne    112c <otol+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
movzbl %cl,%ecx
add    $0xffffffd0,%ecx
lea    (%rcx,%rax,8),%rax
movzbl (%rdi),%ecx
mov    %ecx,%edx
and    $0xf8,%dl
add    $0x1,%rdi
cmp    $0x30,%dl
je     1110 <otol+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @otol(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8
store i8* %0, i8** %2
store i64 0, i64* %3
br label %5
5: ; preds = %16, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
store i8 %7, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 55
br label %14
14: ; preds = %10, %5
%15 = phi i1 [ false, %5 ], [ %13, %10 ]
br i1 %15, label %16, label %27
16: ; preds = %14
%17 = load i64, i64* %3
%18 = mul i64 %17, 8
store i64 %18, i64* %3
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = sub nsw i32 %20, 48
%22 = sext i32 %21 to i64
%23 = load i64, i64* %3
%24 = add i64 %23, %22
store i64 %24, i64* %3
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %2
br label %5
27: ; preds = %14
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @otol(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -8
%4 = icmp eq i8 %3, 48
br i1 %4, label %5, label %18
5: ; preds = %1, %5
%6 = phi i8 [ %15, %5 ], [ %2, %1 ]
%7 = phi i8* [ %14, %5 ], [ %0, %1 ]
%8 = phi i64 [ %13, %5 ], [ 0, %1 ]
%9 = zext i8 %6 to i64
%10 = shl i64 %8, 3
%11 = add nuw nsw i64 %9, 4294967248
%12 = and i64 %11, 4294967295
%13 = add i64 %12, %10
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = load i8, i8* %14
%16 = and i8 %15, -8
%17 = icmp eq i8 %16, 48
br i1 %17, label %5, label %18
18: ; preds = %5, %1
%19 = phi i64 [ 0, %1 ], [ %13, %5 ]
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x60() {
  Assert_real((isbdigit(96) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              485, ("isbdigit should be 0 for `"));
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTManifestUnsetAttr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(int);
main() {
  struct {
    signed int bf0 : 17;
    signed int bf1 : 7;
  } bf;
  bf.bf1 = 7;
  f(bf.bf1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff01ffff,%eax
or     $0xe0000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0x8,%edi
sar    $0x19,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.anon = type { i24 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = bitcast %struct.anon* %2 to i32*
%4 = load i32, i32* %3
%5 = and i32 %4, -16646145
%6 = or i32 %5, 917504
store i32 %6, i32* %3
%7 = bitcast %struct.anon* %2 to i32*
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = ashr i32 %9, 25
%11 = call i32 @f(i32 %10)
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 7)
%2 = tail call i32 @exit(i32 0)
unreachable
}
char *myalloc(a, b)
int a, b;
{
  register char *i;
  i = calloc(a, b);
  if (i == 0)
    warning("OOPS - calloc returns a 0");
  else if (i == (char *)-1) {
    return (0);
  }
  return (i);
}


x86 assembly (clang, -O0):
<myalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movslq -0xc(%rbp),%rdi
movslq -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115d <myalloc+0x3d>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <warning@plt>
jmp    1180 <myalloc+0x60>
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x18(%rbp)
jne    117b <myalloc+0x5b>
movq   $0x0,-0x8(%rbp)
jmp    1188 <myalloc+0x68>
jmp    1180 <myalloc+0x60>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myalloc>:
push   %rbx
movslq %edi,%rdi
movslq %esi,%rsi
call   1040 <calloc@plt>
cmp    $0xffffffffffffffff,%rax
je     114a <myalloc+0x2a>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <myalloc+0x2c>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <warning@plt>
jmp    114c <myalloc+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"OOPS - calloc returns a 0\00"
define i8* @myalloc(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = call i8* @calloc(i64 %8, i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @warning to i32 (i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %21
16: ; preds = %2
%17 = load i8*, i8** %6
%18 = icmp eq i8* %17, inttoptr (i64 -1 to i8*)
br i1 %18, label %19, label %20
19: ; preds = %16
store i8* null, i8** %3
br label %23
20: ; preds = %16
br label %21
21: ; preds = %20, %14
%22 = load i8*, i8** %6
store i8* %22, i8** %3
br label %23
23: ; preds = %21, %19
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
@.str = [26 x i8] c"OOPS - calloc returns a 0\00"
define i8* @myalloc(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = tail call i8* @calloc(i64 %3, i64 %4)
%6 = ptrtoint i8* %5 to i64
switch i64 %6, label %9 [
i64 0, label %7
i64 -1, label %10
]
7: ; preds = %2
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @warning to i32 (i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %2, %7
br label %10
10: ; preds = %2, %9
%11 = phi i8* [ %5, %9 ], [ null, %2 ]
ret i8* %11
}
void gtk_cell_renderer_mode_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_renderer_mode_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _write(int, char *, int);
void _exit(int status) {
  status = status;
  _write(1, "exit", 4);
  while (1) {
    ;
  }
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed3(%rip),%rsi
mov    $0x4,%edx
call   1030 <_write@plt>
jmp    1137 <_exit+0x27>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1030 <_write@plt>
nopw   0x0(%rax,%rax,1)
jmp    1130 <_exit+0x20>

LLVM IR (-O0):
@.str = [5 x i8] c"exit\00"
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* %2
%4 = call i32 @_write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
@.str = [5 x i8] c"exit\00"
define void @_exit(i32 %0) {
%2 = tail call i32 @_write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
void *calloc(size_t, int);
int /*<<< orphan*/ nasm_error(int, char *);
void *nasm_zalloc(size_t size) {
  void *p = calloc(size, 1);
  if (!p)
    nasm_error(0x00000002 | 0x00000010, "out of memory");
  return p;
}


x86 assembly (clang, -O0):
<nasm_zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <nasm_zalloc+0x3a>
mov    $0x12,%edi
lea    0xeab(%rip),%rsi
call   1040 <nasm_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nasm_zalloc>:
push   %rbx
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1144 <nasm_zalloc+0x24>
lea    0xec6(%rip),%rsi
mov    $0x12,%edi
call   1040 <nasm_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @nasm_zalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i64 %4, i32 1)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @nasm_error(i32 18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @nasm_zalloc(i64 %0) {
%2 = tail call i8* @calloc(i64 %0, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @nasm_error(i32 18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int get_order(unsigned long size) {
  int order;
  size = (size - 1) >> (12 - 1);
  order = -1;
  do {
    size >>= 1;
    order++;
  } while (size);
  return order;
}


x86 assembly (clang, -O0):
<get_order>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
shr    $0xb,%rax
mov    %rax,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111f <get_order+0x1f>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_order>:
add    $0xffffffffffffffff,%rdi
shr    $0xb,%rdi
mov    $0xffffffff,%eax
mov    %rdi,%rcx
shr    %rcx
add    $0x1,%eax
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <get_order+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_order(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 11
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ %3, %1 ], [ %7, %4 ]
%6 = phi i32 [ -1, %1 ], [ %8, %4 ]
%7 = lshr i64 %5, 1
%8 = add nsw i32 %6, 1
%9 = icmp ult i64 %5, 2
br i1 %9, label %10, label %4
10: ; preds = %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void message_init_done(void) { printf("--> Init realizado con exito.\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"--> Init realizado con exito.\0A\00"
define void @message_init_done() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"--> Init realizado con exito.\00"
define void @message_init_done() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
MU_TEST(test_del_4) {}


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

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

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

LLVM IR (-O2):
define i32 @MU_TEST(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *del_intarray(int *array) {
  if (array)
    free(array);
  return NULL;
}


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

x86 assembly (clang, -O2):
<del_intarray>:
test   %rdi,%rdi
je     111f <del_intarray+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i32* @del_intarray(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i32* %0)
br label %5
5: ; preds = %3, %1
ret i32* null
}
A1_EvalXPathMatchParam() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @A1_EvalXPathMatchParam() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void print_help(char *prog_name) {
  printf("Usage: %s [-n] DEVNAME COMMAND\n", prog_name);
  printf("Usage: '-n' is an optional argument if you want to push a new line "
         "at the end of the text\n");
  printf("Usage: Will require 'sudo' to run if the executable is not setuid "
         "root\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_help>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf25(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Usage: %s [-n] DEVNAME COMMAND\0A\00"
@.str.1 = [91 x i8] c"Usage: '-n' is an optional argument if you want to push a new line at the end of the text\0A\00"
@.str.2 = [72 x i8] c"Usage: Will require 'sudo' to run if the executable is not setuid root\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"Usage: %s [-n] DEVNAME COMMAND\0A\00"
@str = [90 x i8] c"Usage: '-n' is an optional argument if you want to push a new line at the end of the text\00"
@str.3 = [71 x i8] c"Usage: Will require 'sudo' to run if the executable is not setuid root\00"
define void @print_help(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([90 x i8], [90 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
int onlyEnglish(char c) {
  return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
}


x86 assembly (clang, -O0):
<onlyEnglish>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     112d <onlyEnglish+0x2d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1156 <onlyEnglish+0x56>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     1150 <onlyEnglish+0x50>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onlyEnglish>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @onlyEnglish(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 65, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 97, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @onlyEnglish(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
int insy_gcm_mult_lenc_msb_csr_debug_set(
    unsigned int dev_id, union insy_gcm_mult_lenc_msb_csr_debug_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.insy_gcm_mult_lenc_msb_csr_debug_u = type opaque
define i32 @insy_gcm_mult_lenc_msb_csr_debug_set(i32 %0, %union.insy_gcm_mult_lenc_msb_csr_debug_u* %1) {
%3 = alloca i32
%4 = alloca %union.insy_gcm_mult_lenc_msb_csr_debug_u*
store i32 %0, i32* %3
store %union.insy_gcm_mult_lenc_msb_csr_debug_u* %1, %union.insy_gcm_mult_lenc_msb_csr_debug_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.insy_gcm_mult_lenc_msb_csr_debug_u = type opaque
define i32 @insy_gcm_mult_lenc_msb_csr_debug_set(i32 %0, %union.insy_gcm_mult_lenc_msb_csr_debug_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int printf(char *);
int header_accept_timeuri_ogg(void) {
  return printf("X-Accept-TimeURI: application/ogg\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"X-Accept-TimeURI: application/ogg\0A\00"
define i32 @header_accept_timeuri_ogg() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [35 x i8] c"X-Accept-TimeURI: application/ogg\0A\00"
define i32 @header_accept_timeuri_ogg() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ factor_iteration(int);
int /*<<< orphan*/ factor_recursion(int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
void question_two() {
  printf("The factorial(recursive) of %d is %lu\n", 10, factor_recursion(10));
  printf("The factorial(iteration) of %d is %lu\n", 10, factor_iteration(10));
}


x86 assembly (clang, -O0):
<question_two>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1050 <factor_recursion@plt>
mov    %eax,%edx
lea    0xeb9(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <factor_iteration@plt>
mov    %eax,%edx
lea    0xec3(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<question_two>:
push   %rax
mov    $0xa,%edi
call   1050 <factor_recursion@plt>
lea    0xebe(%rip),%rdi
mov    $0xa,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <factor_iteration@plt>
lea    0xec8(%rip),%rdi
mov    $0xa,%esi
mov    %eax,%edx
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"The factorial(recursive) of %d is %lu\0A\00"
@.str.1 = [39 x i8] c"The factorial(iteration) of %d is %lu\0A\00"
define void @question_two() {
%1 = call i32 @factor_recursion(i32 10)
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 10, i32 %1)
%3 = call i32 @factor_iteration(i32 10)
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"The factorial(recursive) of %d is %lu\0A\00"
@.str.1 = [39 x i8] c"The factorial(iteration) of %d is %lu\0A\00"
define void @question_two() {
%1 = tail call i32 @factor_recursion(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 10, i32 %1)
%3 = tail call i32 @factor_iteration(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 %3)
ret void
}
double bar(double i) { return i; }


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

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

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

LLVM IR (-O2):
define double @bar(double returned %0) {
ret double %0
}