xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ drp_disable(int);
int /*<<< orphan*/ drp_set(int, int);
void drp_init() {
  drp_set(0x0, 0);
  drp_set(0x0, 1);
  drp_set(0x0, 2);
  drp_set(0x0, 3);
  drp_disable(0);
  drp_disable(1);
  drp_disable(2);
  drp_disable(3);
  drp_set(0x0, 6);
}


x86 assembly (clang, -O0):
<drp_init>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1040 <drp_set@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <drp_set@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <drp_set@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <drp_set@plt>
xor    %edi,%edi
call   1030 <drp_disable@plt>
mov    $0x1,%edi
call   1030 <drp_disable@plt>
mov    $0x2,%edi
call   1030 <drp_disable@plt>
mov    $0x3,%edi
call   1030 <drp_disable@plt>
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <drp_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drp_init>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <drp_set@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <drp_set@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <drp_set@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <drp_set@plt>
xor    %edi,%edi
call   1030 <drp_disable@plt>
mov    $0x1,%edi
call   1030 <drp_disable@plt>
mov    $0x2,%edi
call   1030 <drp_disable@plt>
mov    $0x3,%edi
call   1030 <drp_disable@plt>
xor    %edi,%edi
mov    $0x6,%esi
pop    %rax
jmp    1040 <drp_set@plt>

LLVM IR (-O0):
define void @drp_init() {
%1 = call i32 @drp_set(i32 0, i32 0)
%2 = call i32 @drp_set(i32 0, i32 1)
%3 = call i32 @drp_set(i32 0, i32 2)
%4 = call i32 @drp_set(i32 0, i32 3)
%5 = call i32 @drp_disable(i32 0)
%6 = call i32 @drp_disable(i32 1)
%7 = call i32 @drp_disable(i32 2)
%8 = call i32 @drp_disable(i32 3)
%9 = call i32 @drp_set(i32 0, i32 6)
ret void
}

LLVM IR (-O2):
define void @drp_init() {
%1 = tail call i32 @drp_set(i32 0, i32 0)
%2 = tail call i32 @drp_set(i32 0, i32 1)
%3 = tail call i32 @drp_set(i32 0, i32 2)
%4 = tail call i32 @drp_set(i32 0, i32 3)
%5 = tail call i32 @drp_disable(i32 0)
%6 = tail call i32 @drp_disable(i32 1)
%7 = tail call i32 @drp_disable(i32 2)
%8 = tail call i32 @drp_disable(i32 3)
%9 = tail call i32 @drp_set(i32 0, i32 6)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int tvdiff(struct timeval *tv1, struct timeval *tv2) {
  return (tv2->tv_sec - tv1->tv_sec) * ((1000000 + 1023) >> 10) +
         ((tv2->tv_usec - tv1->tv_usec) >> 10);
}


x86 assembly (clang, -O0):
<tvdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
imul   $0x3d1,%eax,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x8(%rbp),%rdx
sub    0x4(%rdx),%ecx
sar    $0xa,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tvdiff>:
mov    (%rsi),%ecx
mov    0x4(%rsi),%eax
sub    (%rdi),%ecx
imul   $0x3d1,%ecx,%ecx
sub    0x4(%rdi),%eax
sar    $0xa,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @tvdiff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 977
%13 = load %struct.timeval*, %struct.timeval** %4
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.timeval*, %struct.timeval** %3
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = sub nsw i32 %15, %18
%20 = ashr i32 %19, 10
%21 = add nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @tvdiff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 977
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%12 = load i32, i32* %11
%13 = sub nsw i32 %10, %12
%14 = ashr i32 %13, 10
%15 = add nsw i32 %14, %8
ret i32 %15
}
void foo364() {}


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

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

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

LLVM IR (-O2):
define void @foo364() {
ret void
}
void omap_vram_reserve_sdram_lmb(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_vram_reserve_sdram_lmb() {
ret void
}
/* Variables and functions */
int japi_button(int, char *);
int j_button(int arg0, char *arg1) { return (japi_button(arg0, arg1)); }


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

x86 assembly (clang, -O2):
<j_button>:
jmp    1030 <japi_button@plt>

LLVM IR (-O0):
define i32 @j_button(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 @japi_button(i32 %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @j_button(i32 %0, i8* %1) {
%3 = tail call i32 @japi_button(i32 %0, i8* %1)
ret i32 %3
}
int ilog2(int n) { return 32 - __builtin_clz(n) - 1; }


x86 assembly (clang, -O0):
<ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%ecx
xor    $0x1f,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog2>:
bsr    %edi,%eax
ret

LLVM IR (-O0):
define i32 @ilog2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = sub nsw i32 32, %4
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = xor i32 %2, 31
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t not_xtrail_0s(uint64_t u) { return -u & ~u; }


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

x86 assembly (clang, -O2):
<not_xtrail_0s>:
mov    %edi,%eax
neg    %eax
not    %edi
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @not_xtrail_0s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = load i32, i32* %2
%6 = xor i32 %5, -1
%7 = and i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @not_xtrail_0s(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = xor i32 %0, -1
%4 = and i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int getc();
int /*<<< orphan*/ putc(char);
int /*<<< orphan*/ puts(char *);
void AT91F_WaitKeyPressed(void) {
  int c;
  puts("KEY");
  c = getc();
  putc('\n');
}


x86 assembly (clang, -O0):
<AT91F_WaitKeyPressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <getc@plt>
mov    %eax,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT91F_WaitKeyPressed>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getc@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <putc@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"KEY\00"
define void @AT91F_WaitKeyPressed() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getc()
store i32 %3, i32* %1
%4 = call i32 @putc(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"KEY\00"
define void @AT91F_WaitKeyPressed() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getc()
%3 = tail call i32 @putc(i8 signext 10)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ state;
};
struct TYPE_4__ {
  TYPE_1__ xproperty;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xproperty_state(void *_p) {
  return (int)((XEvent *)_p)->xproperty.state;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xproperty_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xproperty_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void _exit(__attribute__((unused)) int status) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

x86 assembly (clang, -O2):
<_exit>:
jmp    1100 <_exit>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
void bst_reset(int *items, int *_size, int *left, int *right) { *_size = 0; }


x86 assembly (clang, -O0):
<bst_reset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bst_reset>:
movl   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @bst_reset(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %6
store i32 0, i32* %9
ret void
}

LLVM IR (-O2):
define void @bst_reset(i32* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
store i32 0, i32* %1
ret void
}
char *my_strcpy(char *dest, char *src) {
  int i;
  i = 0;
  while (src[i]) {
    dest[i] = src[i];
    i++;
  }
  dest[i] = '\0';
  return (dest);
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1149 <my_strcpy+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <my_strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <my_strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <my_strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @my_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
int is_hpet_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_hpet_enabled() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_neg(int /*<<< orphan*/, int /*<<< orphan*/);
void gmpint_negz(mpz_t *rop, mpz_t *op) { mpz_neg(*rop, *op); }


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

x86 assembly (clang, -O2):
<gmpint_negz>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <mpz_neg@plt>

LLVM IR (-O0):
define void @gmpint_negz(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @mpz_neg(i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @gmpint_negz(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @mpz_neg(i32 %3, i32 %4)
ret void
}
/* Variables and functions */
char const *umax_to_str(unsigned int);
const char *uint_to_str(unsigned int x) { return umax_to_str(x); }


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

x86 assembly (clang, -O2):
<uint_to_str>:
jmp    1030 <umax_to_str@plt>

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

LLVM IR (-O2):
define i8* @uint_to_str(i32 %0) {
%2 = tail call i8* @umax_to_str(i32 %0)
ret i8* %2
}
/* Variables and functions */
int CLOCKS_PER_SEC;
double clock();
double millisec(void) { return clock() / (double)(CLOCKS_PER_SEC / 1000); }


x86 assembly (clang, -O0):
<millisec>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<millisec>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    0x2ec9(%rip),%rax
movslq (%rax),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define double @millisec() {
%1 = call double (...) @clock()
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 %2, 1000
%4 = sitofp i32 %3 to double
%5 = fdiv double %1, %4
ret double %5
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define double @millisec() {
%1 = tail call double (...) @clock()
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 %2, 1000
%4 = sitofp i32 %3 to double
%5 = fdiv double %1, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ fn2();
void fn4(void) { fn2(); }


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

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

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

LLVM IR (-O2):
define void @fn4() {
%1 = tail call i32 (...) @fn2()
ret void
}
int xhtml_reservedchar(int c) {
  if (c == '&' || c == '<' || c == '>' || c == '"')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<xhtml_reservedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x26,-0x8(%rbp)
je     112f <xhtml_reservedchar+0x2f>
cmpl   $0x3c,-0x8(%rbp)
je     112f <xhtml_reservedchar+0x2f>
cmpl   $0x3e,-0x8(%rbp)
je     112f <xhtml_reservedchar+0x2f>
cmpl   $0x22,-0x8(%rbp)
jne    113b <xhtml_reservedchar+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <xhtml_reservedchar+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xhtml_reservedchar>:
cmp    $0x3e,%edi
ja     111d <xhtml_reservedchar+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x5000004400000000,%rdx
bt     %rcx,%rdx
jae    111d <xhtml_reservedchar+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @xhtml_reservedchar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 38
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 60
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 62
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 34
br i1 %14, label %15, label %16
15: ; preds = %12, %9, %6, %1
store i32 1, i32* %2
br label %17
16: ; preds = %12
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @xhtml_reservedchar(i32 %0) {
switch i32 %0, label %2 [
i32 62, label %3
i32 60, label %3
i32 38, label %3
i32 34, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ logGC();
int /*<<< orphan*/ vmemGCfirst();
int /*<<< orphan*/ vmemGCfourth();
int /*<<< orphan*/ vmemGCsecond();
int /*<<< orphan*/ vmemGCthird();
void vmemGC() {
  vmemGCfirst();
  vmemGCsecond();
  vmemGCthird();
  vmemGCfourth();
  logGC();
}


x86 assembly (clang, -O0):
<vmemGC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <vmemGCfirst@plt>
mov    $0x0,%al
call   1030 <vmemGCsecond@plt>
mov    $0x0,%al
call   1060 <vmemGCthird@plt>
mov    $0x0,%al
call   1050 <vmemGCfourth@plt>
mov    $0x0,%al
call   1070 <logGC@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmemGC>:
push   %rax
xor    %eax,%eax
call   1040 <vmemGCfirst@plt>
xor    %eax,%eax
call   1030 <vmemGCsecond@plt>
xor    %eax,%eax
call   1060 <vmemGCthird@plt>
xor    %eax,%eax
call   1050 <vmemGCfourth@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <logGC@plt>

LLVM IR (-O0):
define void @vmemGC() {
%1 = call i32 (...) @vmemGCfirst()
%2 = call i32 (...) @vmemGCsecond()
%3 = call i32 (...) @vmemGCthird()
%4 = call i32 (...) @vmemGCfourth()
%5 = call i32 (...) @logGC()
ret void
}

LLVM IR (-O2):
define void @vmemGC() {
%1 = tail call i32 (...) @vmemGCfirst()
%2 = tail call i32 (...) @vmemGCsecond()
%3 = tail call i32 (...) @vmemGCthird()
%4 = tail call i32 (...) @vmemGCfourth()
%5 = tail call i32 (...) @logGC()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outsl(unsigned int, void *, unsigned long);
void nsp32_multi_write4(unsigned int base, unsigned int reg, void *buf,
                        unsigned long count) {
  outsl(base + reg, buf, count);
}


x86 assembly (clang, -O0):
<nsp32_multi_write4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <outsl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsp32_multi_write4>:
add    %esi,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <outsl@plt>

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

LLVM IR (-O2):
define void @nsp32_multi_write4(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = add i32 %1, %0
%6 = tail call i32 @outsl(i32 %5, i8* %2, i64 %3)
ret void
}
/* Variables and functions */
float cblas_snrm2(int const, float const *, int const);
float c_snrm2(const int N, const float *X, const int stride) {
  return cblas_snrm2(N, X, stride);
}


x86 assembly (clang, -O0):
<c_snrm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <cblas_snrm2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_snrm2>:
jmp    1030 <cblas_snrm2@plt>

LLVM IR (-O0):
define float @c_snrm2(i32 %0, float* %1, i32 %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca i32
store i32 %0, i32* %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load float*, float** %5
%9 = load i32, i32* %6
%10 = call float @cblas_snrm2(i32 %7, float* %8, i32 %9)
ret float %10
}

LLVM IR (-O2):
define float @c_snrm2(i32 %0, float* %1, i32 %2) {
%4 = tail call float @cblas_snrm2(i32 %0, float* %1, i32 %2)
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ None;
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ XWarpPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int, int);
int /*<<< orphan*/ usleep(int);
void move(Display *display, int x, int y) {
  XWarpPointer(display, None, None, 0, 0, 0, 0, x, y);
  XFlush(display);
  usleep(1);
}


x86 assembly (clang, -O0):
<move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%r10d
mov    -0x10(%rbp),%eax
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <XWarpPointer@plt>
mov    -0x8(%rbp),%rdi
call   1040 <XFlush@plt>
mov    $0x1,%edi
call   1050 <usleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move>:
push   %rbx
mov    %edx,%eax
mov    %esi,%r10d
mov    %rdi,%rbx
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%edx
sub    $0x8,%rsp
mov    %edx,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
push   %r10
push   $0x0
call   1030 <XWarpPointer@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
call   1040 <XFlush@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1050 <usleep@plt>

LLVM IR (-O0):
@None = global i32 0
define void @move(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* @None
%9 = load i32, i32* @None
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @XWarpPointer(i32* %7, i32 %8, i32 %9, i32 0, i32 0, i32 0, i32 0, i32 %10, i32 %11)
%13 = load i32*, i32** %4
%14 = call i32 @XFlush(i32* %13)
%15 = call i32 @usleep(i32 1)
ret void
}

LLVM IR (-O2):
@None = global i32 0
define void @move(i32* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @None
%5 = tail call i32 @XWarpPointer(i32* %0, i32 %4, i32 %4, i32 0, i32 0, i32 0, i32 0, i32 %1, i32 %2)
%6 = tail call i32 @XFlush(i32* %0)
%7 = tail call i32 @usleep(i32 1)
ret void
}
/* Variables and functions */
float get_temp();
int /*<<< orphan*/ printf(char *, float);
int main(int argc, char **argv) {
  float temp = get_temp();
  printf("value=%.2f", temp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_temp@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"value=%.2f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float (...) @get_temp()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}
void g_get_application_name() {}


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

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

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

LLVM IR (-O2):
define void @g_get_application_name() {
ret void
}
/* Variables and functions */
double floor(double);
double mod_2pi(double th) {
  double u = th * (1 / (2 * 3.14159265358979323846));
  return 2 * 3.14159265358979323846 * (u - floor(u + 0.5));
}


x86 assembly (clang, -O0):
<mod_2pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec7(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movsd  -0x18(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xea4(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_2pi>:
push   %rax
movapd %xmm0,%xmm1
mulsd  0xee3(%rip),%xmm1
movsd  %xmm1,(%rsp)
movsd  0xede(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xecc(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mod_2pi(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 0x3FC45F306DC9C883
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fadd double %7, 5.000000e-01
%9 = call double @llvm.floor.f64(double %8)
%10 = fsub double %6, %9
%11 = fmul double 0x401921FB54442D18, %10
ret double %11
}

LLVM IR (-O2):
define double @mod_2pi(double %0) {
%2 = fmul double %0, 0x3FC45F306DC9C883
%3 = fadd double %2, 5.000000e-01
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fsub double %2, %4
%6 = fmul double %5, 0x401921FB54442D18
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ coreCleanupGPIO();
int /*<<< orphan*/ coreCleanupLaser();
void coreCleanup(void) {
  coreCleanupLaser();
  coreCleanupGPIO();
}


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

x86 assembly (clang, -O2):
<coreCleanup>:
push   %rax
xor    %eax,%eax
call   1030 <coreCleanupLaser@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <coreCleanupGPIO@plt>

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

LLVM IR (-O2):
define void @coreCleanup() {
%1 = tail call i32 (...) @coreCleanupLaser()
%2 = tail call i32 (...) @coreCleanupGPIO()
ret void
}
/* Variables and functions */
int tunit_main(int, char **, char *);
int main(int argc, char **argv) { return tunit_main(argc, argv, "Access"); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdx
jmp    1030 <tunit_main@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"Access\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @tunit_main(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
char *strncpy(char *__restrict __dest, __const char *__restrict __src,
              size_t __n) {
  while ((*__dest++ = *__src++) && __n--)
    ;
  return __dest;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     115c <strncpy+0x5c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    116c <strncpy+0x6c>
jmp    1171 <strncpy+0x71>
jmp    1110 <strncpy+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%r8d
mov    %r8b,(%rax,%rcx,1)
lea    0x1(%rcx),%rdi
test   %r8b,%r8b
je     112a <strncpy+0x2a>
cmp    %rcx,%rdx
mov    %rdi,%rcx
jne    1110 <strncpy+0x10>
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @strncpy(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
br label %7
7: ; preds = %21, %3
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %5
%10 = load i8, i8* %8
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
store i8 %10, i8* %11
%13 = sext i8 %10 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %7
%16 = load i64, i64* %6
%17 = add i64 %16, -1
store i64 %17, i64* %6
%18 = icmp ne i64 %16, 0
br label %19
19: ; preds = %15, %7
%20 = phi i1 [ false, %7 ], [ %18, %15 ]
br i1 %20, label %21, label %22
21: ; preds = %19
br label %7
22: ; preds = %19
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @strncpy(i8* noalias writeonly %0, i8* noalias nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i8* [ %0, %3 ], [ %9, %4 ]
%6 = phi i8* [ %1, %3 ], [ %11, %4 ]
%7 = phi i64 [ %2, %3 ], [ %12, %4 ]
%8 = load i8, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %5
%10 = icmp eq i8 %8, 0
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = add i64 %7, -1
%13 = icmp eq i64 %7, 0
%14 = select i1 %10, i1 true, i1 %13
br i1 %14, label %15, label %4
15: ; preds = %4
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ load_ccert();
int /*<<< orphan*/ printf(char *);
int main() {
  load_ccert();
  printf("end main \n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"end main \00"
define i32 @main() {
%1 = tail call i32 (...) @load_ccert()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ e_movri(int, int);
void co__mldi(int mr, int i) { e_movri(mr, i); }


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

x86 assembly (clang, -O2):
<co__mldi>:
jmp    1030 <e_movri@plt>

LLVM IR (-O0):
define void @co__mldi(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 = call i32 @e_movri(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @co__mldi(i32 %0, i32 %1) {
%3 = tail call i32 @e_movri(i32 %0, i32 %1)
ret void
}
unsigned int r2h_bits(int cmd) {
  unsigned int mask = (((cmd) > 0) ? (1 << ((cmd)-1)) : 0);
  if (cmd == 13)
    mask |= ((((14) > 0) ? (1 << ((14) - 1)) : 0) |
             (((15) > 0) ? (1 << ((15) - 1)) : 0) |
             (((9) > 0) ? (1 << ((9) - 1)) : 0) |
             (((16) > 0) ? (1 << ((16) - 1)) : 0) |
             (((4) > 0) ? (1 << ((4) - 1)) : 0));
  else if (cmd == 4)
    mask |= ((((14) > 0) ? (1 << ((14) - 1)) : 0) |
             (((15) > 0) ? (1 << ((15) - 1)) : 0) |
             (((13) > 0) ? (1 << ((13) - 1)) : 0));
  return (mask |= (((32) > 0) ? (1 << ((32) - 1)) : 0));
}


x86 assembly (clang, -O0):
<r2h_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1126 <r2h_bits+0x26>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <r2h_bits+0x30>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <r2h_bits+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xd,-0x4(%rbp)
jne    1150 <r2h_bits+0x50>
mov    -0x8(%rbp),%eax
or     $0xe108,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <r2h_bits+0x6a>
cmpl   $0x4,-0x4(%rbp)
jne    1165 <r2h_bits+0x65>
mov    -0x8(%rbp),%eax
or     $0x7000,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <r2h_bits+0x6a>
mov    -0x8(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<r2h_bits>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
test   %edi,%edi
cmovg  %edx,%eax
cmp    $0x4,%edi
je     1126 <r2h_bits+0x26>
cmp    $0xd,%edi
jne    112b <r2h_bits+0x2b>
or     $0xe108,%eax
or     $0x80000000,%eax
ret
or     $0x7000,%eax
or     $0x80000000,%eax
ret

LLVM IR (-O0):
define i32 @r2h_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ 0, %10 ]
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 13
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %3
%17 = or i32 %16, 57608
store i32 %17, i32* %3
br label %25
18: ; preds = %11
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 4
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = or i32 %22, 28672
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %18
br label %25
25: ; preds = %24, %15
%26 = load i32, i32* %3
%27 = or i32 %26, -2147483648
store i32 %27, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @r2h_bits(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = shl nuw i32 1, %3
%5 = select i1 %2, i32 %4, i32 0
switch i32 %0, label %10 [
i32 13, label %6
i32 4, label %8
]
6: ; preds = %1
%7 = or i32 %5, 57608
br label %10
8: ; preds = %1
%9 = or i32 %5, 28672
br label %10
10: ; preds = %1, %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ], [ %5, %1 ]
%12 = or i32 %11, -2147483648
ret i32 %12
}
/* Variables and functions */
long get_CPU_time_in_seconds();
int /*<<< orphan*/ kprint(char *);
int /*<<< orphan*/ kps(char *);
char *ltoca(long);
int cpu_time() {
  int funlen, tmp = 5;
  long seci = get_CPU_time_in_seconds();
  char *secc = ltoca(seci);
  char c;
  kprint("CPU TIME since last boot: ");
  kps(secc);
  kps(" s\n");
  return 1;
}


x86 assembly (clang, -O0):
<cpu_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5,-0x8(%rbp)
mov    $0x0,%al
call   1040 <get_CPU_time_in_seconds@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <ltoca@plt>
mov    %rax,-0x18(%rbp)
lea    0xe92(%rip),%rdi
call   1050 <kprint@plt>
mov    -0x18(%rbp),%rdi
call   1030 <kps@plt>
lea    0xe98(%rip),%rdi
call   1030 <kps@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_time>:
push   %rbx
xor    %eax,%eax
call   1040 <get_CPU_time_in_seconds@plt>
mov    %rax,%rdi
call   1060 <ltoca@plt>
mov    %rax,%rbx
lea    0xea6(%rip),%rdi
call   1050 <kprint@plt>
mov    %rbx,%rdi
call   1030 <kps@plt>
lea    0xead(%rip),%rdi
call   1030 <kps@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"CPU TIME since last boot: \00"
@.str.1 = [4 x i8] c" s\0A\00"
define i32 @cpu_time() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8
store i32 5, i32* %2
%6 = call i64 (...) @get_CPU_time_in_seconds()
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = call i8* @ltoca(i64 %7)
store i8* %8, i8** %4
%9 = call i32 @kprint(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %4
%11 = call i32 @kps(i8* %10)
%12 = call i32 @kps(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [27 x i8] c"CPU TIME since last boot: \00"
@.str.1 = [4 x i8] c" s\0A\00"
define i32 @cpu_time() {
%1 = tail call i64 (...) @get_CPU_time_in_seconds()
%2 = tail call i8* @ltoca(i64 %1)
%3 = tail call i32 @kprint(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @kps(i8* %2)
%5 = tail call i32 @kps(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ error1(char *, int);
int write(int, void *, int);
int xwrite(int fd, void *buffer, int size) {
  int n;
  if (size == 0)
    return 0;
  n = write(fd, buffer, size);
  if (n != size)
    error1("error writing %d bytes\n", size);
  return 0;
}


x86 assembly (clang, -O0):
<xwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1148 <xwrite+0x28>
movl   $0x0,-0x4(%rbp)
jmp    117c <xwrite+0x5c>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1175 <xwrite+0x55>
mov    -0x14(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1040 <error1@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xwrite>:
push   %rbx
test   %edx,%edx
je     113e <xwrite+0x1e>
mov    %edx,%ebx
call   1030 <write@plt>
cmp    %ebx,%eax
je     113e <xwrite+0x1e>
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
call   1040 <error1@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"error writing %d bytes\0A\00"
define i32 @xwrite(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %4
br label %24
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %12
%21 = load i32, i32* %7
%22 = call i32 @error1(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %12
store i32 0, i32* %4
br label %24
24: ; preds = %23, %11
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
@.str = [24 x i8] c"error writing %d bytes\0A\00"
define i32 @xwrite(i32 %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%7 = icmp eq i32 %6, %2
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @error1(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %10
10: ; preds = %5, %8, %3
ret i32 0
}
void EVP_EncryptFinal(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_EncryptFinal() {
ret void
}
char upper(char ch) {
  if (ch >= 'a' && ch <= 'z')
    return ch - 32;
  return ch;
}


x86 assembly (clang, -O0):
<upper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <upper+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <upper+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <upper+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @upper(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %18
16: ; preds = %7, %1
%17 = load i8, i8* %3
store i8 %17, i8* %2
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @upper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
int altinci(int i) { return ++i; }


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

x86 assembly (clang, -O2):
<altinci>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @altinci(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void __attribute__((noreturn)) __stack_chk_fail(void) {
  printf("Stack smashing detected!\n");
  exit(-2357);
}


x86 assembly (clang, -O0):
<__stack_chk_fail>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffff6cb,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<__stack_chk_fail>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffff6cb,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Stack smashing detected!\0A\00"
define void @__stack_chk_fail() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -2357)
unreachable
}

LLVM IR (-O2):
@str = [25 x i8] c"Stack smashing detected!\00"
define void @__stack_chk_fail() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -2357)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x58() {
  Assert_real((isgraph(88)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              445, ("isgraph should be 1 for X"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x58>:
push   %rbp
mov    %rsp,%rbp
mov    $0x58,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1bd,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x58>:
push   %rax
mov    $0x58,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1bd,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for X\00"
define void @t_isgraph_0x58() {
%1 = call i32 @isgraph(i32 88)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for X\00"
define void @t_isgraph_0x58() {
%1 = tail call i32 @isgraph(i32 88)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}