xunge/DecIR huggingface dataset:
void swap(int *array, int indexA, int indexB) {
  int temp = array[indexA];
  array[indexA] = array[indexB];
  array[indexB] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int sarwaitbar_std_open();
int sarwaitbar_open(void) { return sarwaitbar_std_open(); }


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

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

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

LLVM IR (-O2):
define i32 @sarwaitbar_open() {
%1 = tail call i32 (...) @sarwaitbar_std_open()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("n=");
  scanf("%d", &n);
  is_prime(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <is_prime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <is_prime@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"n=\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @is_prime(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ restore_db();
int main() {
  restore_db();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @restore_db()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ bcm2835_st_read();
void bcm2835_st_delay(uint64_t offset_micros, uint64_t micros) {
  uint64_t compare = offset_micros + micros;
  while (bcm2835_st_read() < compare)
    ;
}


x86 assembly (clang, -O0):
<bcm2835_st_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <bcm2835_st_read@plt>
cmp    -0x18(%rbp),%rax
jge    1142 <bcm2835_st_delay+0x32>
jmp    112c <bcm2835_st_delay+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcm2835_st_delay>:
push   %rbx
mov    %rdi,%rbx
add    %rsi,%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <bcm2835_st_read@plt>
cmp    %rbx,%rax
jl     1120 <bcm2835_st_delay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @bcm2835_st_delay(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add nsw i64 %6, %7
store i64 %8, i64* %5
br label %9
9: ; preds = %13, %2
%10 = call i64 (...) @bcm2835_st_read()
%11 = load i64, i64* %5
%12 = icmp slt i64 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @bcm2835_st_delay(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
br label %4
4: ; preds = %4, %2
%5 = tail call i64 (...) @bcm2835_st_read()
%6 = icmp slt i64 %5, %3
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ init();
int /*<<< orphan*/ intro();
int /*<<< orphan*/ play();
int main(void) {
  intro();
  init();
  play();
  getchar();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <intro@plt>
mov    $0x0,%al
call   1060 <init@plt>
mov    $0x0,%al
call   1050 <play@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <intro@plt>
xor    %eax,%eax
call   1060 <init@plt>
xor    %eax,%eax
call   1050 <play@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @intro()
%3 = call i32 (...) @init()
%4 = call i32 (...) @play()
%5 = call i32 (...) @getchar()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @intro()
%2 = tail call i32 (...) @init()
%3 = tail call i32 (...) @play()
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 @exit(i32 0)
unreachable
}
long int labs(long int n) { return (n > 0) ? n : -n; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <labs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ min_height;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
int get_XSizeHints_min_height(void *_p) {
  return (int)((XSizeHints *)_p)->min_height;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XSizeHints_min_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void set_bit(int nr, volatile void *addr) {
  asm volatile("btsl %1, %0" : "=m"(*(volatile long *)addr) : "Ir"(nr));
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bts    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
bts    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @set_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
tail call void asm sideeffect "btsl $1, $0", "=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello! This is a test program.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Hello! This is a test program.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"Hello! This is a test program.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ flu64_do_encode(char *, int, char *);
int strlen(char *);
char *flu64_encode(char *in, ssize_t l) {
  if (l < 0)
    l = strlen(in);
  char *out = calloc(l * 2, sizeof(char));
  flu64_do_encode(in, l, out);
  return out;
}


x86 assembly (clang, -O0):
<flu64_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1155 <flu64_encode+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
shl    $0x1,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1050 <flu64_do_encode@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu64_encode>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
test   %esi,%esi
jns    114a <flu64_encode+0x1a>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%r15d
lea    (%r15,%r15,1),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rax,%rdx
call   1050 <flu64_do_encode@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @flu64_encode(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %0)
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ %5, %4 ], [ %1, %2 ]
%8 = shl nsw i32 %7, 1
%9 = tail call i8* @calloc(i32 %8, i32 1)
%10 = tail call i32 @flu64_do_encode(i8* %0, i32 %7, i8* %9)
ret i8* %9
}
void restoreCrashHandler(void *oldac) {}


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

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

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

LLVM IR (-O2):
define void @restoreCrashHandler(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ rgb_to_hsv_floats(float *, float *);
int rgb2hsv(float *y, float *x, int n) {
  assert(n == 3);
  rgb_to_hsv_floats(y, x);
  return 3;
}


x86 assembly (clang, -O0):
<rgb2hsv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rgb_to_hsv_floats@plt>
mov    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb2hsv>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x3,%edx
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <rgb_to_hsv_floats@plt>
mov    $0x3,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @rgb2hsv(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 3
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load float*, float** %4
%12 = load float*, float** %5
%13 = call i32 @rgb_to_hsv_floats(float* %11, float* %12)
ret i32 3
}

LLVM IR (-O2):
define i32 @rgb2hsv(float* %0, float* %1, i32 %2) {
%4 = icmp eq i32 %2, 3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @rgb_to_hsv_floats(float* %0, float* %1)
ret i32 3
}
int Check_CPU_support_AES() {
  unsigned int a;
  __asm__ __volatile__("cpuid" : "=c"(a) : "a"(1));
  ;
  return (a & 0x2000000);
}


x86 assembly (clang, -O0):
<Check_CPU_support_AES>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
cpuid
mov    %ecx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2000000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Check_CPU_support_AES>:
mov    $0x1,%eax
cpuid
mov    %ecx,%eax
and    $0x2000000,%eax
ret

LLVM IR (-O0):
define i32 @Check_CPU_support_AES() {
%1 = alloca i32
%2 = call i32 asm sideeffect "cpuid", "={cx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 33554432
ret i32 %4
}

LLVM IR (-O2):
define i32 @Check_CPU_support_AES() {
%1 = tail call i32 asm sideeffect "cpuid", "={cx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 1)
%2 = and i32 %1, 33554432
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ time_t;
typedef int /*<<< orphan*/ out_msg;

/* Variables and functions */
int /*<<< orphan*/ _xmit(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char *);
scalar_t__ time(int /*<<< orphan*/ *);
void _get_nodes(void) {
  time_t now = time(NULL);
  char out_msg[128];
  snprintf(out_msg, sizeof(out_msg), "TS=%u AUTH=root DT=%s", (uint32_t)now,
           "CMD=GETNODES ARG=0:ALL");
  _xmit(out_msg);
}


x86 assembly (clang, -O0):
<_get_nodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x80,%esi
lea    0xe9f(%rip),%rdx
lea    0xeae(%rip),%r8
call   1030 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <_xmit@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_nodes>:
push   %rbx
sub    $0x80,%rsp
xor    %edi,%edi
call   1050 <time@plt>
lea    0xeba(%rip),%rdx
lea    0xec9(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %eax,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <_xmit@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"TS=%u AUTH=root DT=%s\00"
@.str.1 = [23 x i8] c"CMD=GETNODES ARG=0:ALL\00"
define void @_get_nodes() {
%1 = alloca i64
%2 = alloca [128 x i8]
%3 = call i64 @time(i32* null)
store i64 %3, i64* %1
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = load i64, i64* %1
%6 = trunc i64 %5 to i32
%7 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%9 = call i32 @_xmit(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"TS=%u AUTH=root DT=%s\00"
@.str.1 = [23 x i8] c"CMD=GETNODES ARG=0:ALL\00"
define void @_get_nodes() {
%1 = alloca [128 x i8]
%2 = tail call i64 @time(i32* null)
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = trunc i64 %2 to i32
%5 = call i32 @snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @_xmit(i8* %3)
ret void
}
int suma(int numero1, int numero2) { return numero1 + numero2; }


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

x86 assembly (clang, -O2):
<suma>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @suma(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @suma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int fib(void *p, int i) {
  int (*foo)(void *, int) = (int (*)(void *, int))p;
  if (i == 0)
    return 1;
  if (i == 1)
    return 1;
  return foo(foo, i - 1) + foo(foo, i - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    112d <fib+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1170 <fib+0x70>
cmpl   $0x1,-0x14(%rbp)
jne    1143 <fib+0x43>
movl   $0x1,-0x4(%rbp)
jmp    1170 <fib+0x70>
mov    -0x20(%rbp),%rax
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   *%rax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x2,%esi
call   *%rax
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
mov    $0x1,%eax
cmp    $0x2,%esi
jb     112b <fib+0x2b>
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x1(%rbx),%esi
call   *%rdi
mov    %eax,%ebp
add    $0xfffffffe,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   *%r14
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32 (i8*, i32)*
%4 = icmp ult i32 %1, 2
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = add nsw i32 %1, -1
%7 = tail call i32 %3(i8* %0, i32 %6)
%8 = add nsw i32 %1, -2
%9 = tail call i32 %3(i8* %0, i32 %8)
%10 = add nsw i32 %9, %7
br label %11
11: ; preds = %2, %5
%12 = phi i32 [ %10, %5 ], [ 1, %2 ]
ret i32 %12
}
int mp_islower(char c) { return c >= 'a' && c <= 'z'; }


x86 assembly (clang, -O0):
<mp_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <mp_islower+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_islower>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @mp_islower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
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, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @mp_islower(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void RNDResponseSink_ContentDirectory_GetSortCapabilities(
    struct UPnPService *Service, int ErrorCode, void *User, char *SortCaps) {
  printf("RND Invoke Response: "
         "ContentDirectory/GetSortCapabilities[ErrorCode:%d](%s)\r\n",
         ErrorCode, SortCaps);
}


x86 assembly (clang, -O0):
<RNDResponseSink_ContentDirectory_GetSortCapabilities>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: ContentDirectory/GetSortCapabilities[ErrorCode:%d](%s)\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_GetSortCapabilities(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %8
%11 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: ContentDirectory/GetSortCapabilities[ErrorCode:%d](%s)\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_GetSortCapabilities(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3)
ret void
}
void divide_error() {
  __asm__ __volatile__("cli");
  SetTextColor(0x04 | 0x08, 0x00);
  kprintf("\nERROR: Divide by zero.\n");
  do {
    __asm__ __volatile__("cli  \n\t"
                         "hlt");
  } while (1 == 1);
}


x86 assembly (clang, -O0):
<divide_error>:
push   %rbp
mov    %rsp,%rbp
cli
mov    $0xc,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <SetTextColor@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <kprintf@plt>
cli
hlt
mov    $0x1,%al
test   $0x1,%al
jne    1141 <divide_error+0x21>
jmp    1152 <divide_error+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_error>:
push   %rax
cli
mov    $0xc,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <SetTextColor@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <kprintf@plt>
xchg   %ax,%ax
cli
hlt
jmp    1140 <divide_error+0x20>

LLVM IR (-O0):
@.str = [25 x i8] c"\0AERROR: Divide by zero.\0A\00"
define void @divide_error() {
%1 = call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %4, %0
br label %4
4: ; preds = %3
br i1 true, label %3, label %5
5: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0AERROR: Divide by zero.\0A\00"
define void @divide_error() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
tail call void asm sideeffect "cli \0A\09hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %3
}
void single_stop(struct seq_file *p, void *v) {}


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

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

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

LLVM IR (-O2):
%struct.seq_file = type opaque
define void @single_stop(%struct.seq_file* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MENU(int, int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int MAX;
  printf("\nEnter the size of stack : ");
  scanf("%d", &MAX);
  int STACK[MAX];
  MENU(MAX, STACK);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <MENU@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    %rsp,%rbx
mov    -0xc(%rbp),%eax
mov    %rsp,%rsi
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rsi
mov    %rsi,%rsp
mov    -0xc(%rbp),%edi
call   1040 <MENU@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0AEnter the size of stack : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i32, i64 %8
store i64 %8, i64* %4
%11 = load i32, i32* %2
%12 = call i32 @MENU(i32 %11, i32* %10)
store i32 0, i32* %1
%13 = load i8*, i8** %3
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0AEnter the size of stack : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
%8 = alloca i32, i64 %6
%9 = load i32, i32* %1
%10 = call i32 @MENU(i32 %9, i32* %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xfe() {
  Assert_real((isodigit(254) == 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_isodigit.c",
              1275, ("isodigit should be 0 for 0xfe"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xfe>:
push   %rax
mov    $0xfe,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4fb,%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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xfe\00"
define void @t_isodigit_0xfe() {
%1 = call i64 @isodigit(i32 254)
%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 1275, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xfe\00"
define void @t_isodigit_0xfe() {
%1 = tail call i64 @isodigit(i32 254)
%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 1275, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int arduino_write_rtc(int, unsigned long, int, int);
int arduino_set_time(int client, time_t time) {
  unsigned long itime;
  itime = (unsigned long)time;
  return arduino_write_rtc(client, itime, 0x00, 4);
}


x86 assembly (clang, -O0):
<arduino_set_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <arduino_write_rtc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arduino_set_time>:
xor    %edx,%edx
mov    $0x4,%ecx
jmp    1030 <arduino_write_rtc@plt>

LLVM IR (-O0):
define i32 @arduino_set_time(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
store i64 %6, i64* %5
%7 = load i32, i32* %3
%8 = load i64, i64* %5
%9 = call i32 @arduino_write_rtc(i32 %7, i64 %8, i32 0, i32 4)
ret i32 %9
}

LLVM IR (-O2):
define i32 @arduino_set_time(i32 %0, i64 %1) {
%3 = tail call i32 @arduino_write_rtc(i32 %0, i64 %1, i32 0, i32 4)
ret i32 %3
}
main() {
  int len, tag;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
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
store i32 0, i32* %1
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(scalar_t__ volatile);
uint32_t UARTClockSourceGet(uint32_t ui32Base) {
  ASSERT(_UARTBaseValid(ui32Base));
  return ((*((volatile uint32_t *)(ui32Base + 0x00000FC8))));
}


x86 assembly (clang, -O0):
<UARTClockSourceGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0xfc8(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTClockSourceGet>:
push   %rax
mov    %rdi,(%rsp)
mov    (%rsp),%rdi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    (%rsp),%rax
mov    0xfc8(%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @UARTClockSourceGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = call i32 @_UARTBaseValid(i64 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load volatile i64, i64* %2
%7 = add nsw i64 %6, 4040
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @UARTClockSourceGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = tail call i32 @_UARTBaseValid(i64 %3)
%5 = tail call i32 @ASSERT(i32 %4)
%6 = load volatile i64, i64* %2
%7 = add nsw i64 %6, 4040
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Variables and functions */
void unload_material(void const *key, size_t len, void *data, void *link) {
  (void)key;
  (void)len;
  (void)data;
  (void)link;
}


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

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

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

LLVM IR (-O2):
define void @unload_material(i8* nocapture %0, i64 %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, void *, int *, int, void **, int /*<<< orphan*/);
int /*<<< orphan*/ kill(int, int);
int exec(void *entry_point, int cargs, void **pargs, int giveFg) {
  int pid;
  int80(27, entry_point, &pid, cargs, pargs, 0);
  if (giveFg) {
    kill(pid, 3);
  }
  return pid;
}


x86 assembly (clang, -O0):
<exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    $0x1b,%edi
lea    -0x20(%rbp),%rdx
xor    %r9d,%r9d
call   1040 <int80@plt>
cmpl   $0x0,-0x1c(%rbp)
je     1169 <exec+0x49>
mov    -0x20(%rbp),%edi
mov    $0x3,%esi
call   1030 <kill@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec>:
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%ebx
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rsi
lea    0xc(%rsp),%rdx
mov    $0x1b,%edi
xor    %r9d,%r9d
call   1040 <int80@plt>
test   %ebx,%ebx
je     1153 <exec+0x33>
mov    0xc(%rsp),%edi
mov    $0x3,%esi
call   1030 <kill@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @exec(i8* %0, i32 %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = call i32 @int80(i32 27, i8* %0, i32* %5, i32 %1, i8** %2, i32 0)
%8 = icmp eq i32 %3, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i32, i32* %5
%11 = call i32 @kill(i32 %10, i32 3)
br label %12
12: ; preds = %9, %4
%13 = load i32, i32* %5
ret i32 %13
}
/* Variables and functions */
int open(char const *, int, unsigned int);
int tor_open_cloexec(const char *path, int flags, unsigned mode) {
  int fd;
  fd = open(path, flags, mode);
  return fd;
}


x86 assembly (clang, -O0):
<tor_open_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tor_open_cloexec>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @tor_open_cloexec(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
char toupper(char);
const char *_strupr(char *n) {
  const char *m = n;
  while (*n != '\0') {
    *n = toupper(*n);
    n++;
  }
  return m;
}


x86 assembly (clang, -O0):
<_strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <_strupr+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <_strupr+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <_strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <_strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_strupr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = call signext i8 @toupper(i8 signext %12)
%14 = load i8*, i8** %2
store i8 %13, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %2
br label %5
17: ; preds = %5
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @_strupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
float *mat4_adjugate(float *result, float *m) {
  result = m;
  return result;
}


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

x86 assembly (clang, -O2):
<mat4_adjugate>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define float* @mat4_adjugate(float* nocapture readnone %0, float* readnone returned %1) {
ret float* %1
}
/* Variables and functions */
int /*<<< orphan*/ cpu_reset(int /*<<< orphan*/);
int /*<<< orphan*/ s5pv210_wdt_reset();
void arch_reset(char mode, const char *cmd) {
  if (mode != 's')
    s5pv210_wdt_reset();
  cpu_reset(0);
}


x86 assembly (clang, -O0):
<arch_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x73,%eax
je     1146 <arch_reset+0x26>
mov    $0x0,%al
call   1030 <s5pv210_wdt_reset@plt>
xor    %edi,%edi
call   1040 <cpu_reset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_reset>:
cmp    $0x73,%dil
je     1132 <arch_reset+0x12>
push   %rax
xor    %eax,%eax
call   1030 <s5pv210_wdt_reset@plt>
add    $0x8,%rsp
xor    %edi,%edi
jmp    1040 <cpu_reset@plt>

LLVM IR (-O0):
define void @arch_reset(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 115
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @s5pv210_wdt_reset()
br label %10
10: ; preds = %8, %2
%11 = call i32 @cpu_reset(i32 0)
ret void
}

LLVM IR (-O2):
define void @arch_reset(i8 signext %0, i8* nocapture readnone %1) {
%3 = icmp eq i8 %0, 115
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @s5pv210_wdt_reset()
br label %6
6: ; preds = %4, %2
%7 = tail call i32 @cpu_reset(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void write_error(void) {
  (void)fprintf(stderr, "error: couldn't write to standard output: %s\n",
                strerror(errno));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<write_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<write_error>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb1(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"error: couldn't write to standard output: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @write_error() {
%1 = load i32, i32* @stderr
%2 = load i32, i32* @errno
%3 = call i8* @strerror(i32 %2)
%4 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"error: couldn't write to standard output: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @write_error() {
%1 = load i32, i32* @stderr
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
float sqrtf(float);
float GetMag(float x, float y, float z) { return sqrtf(x * x + y * y + z * z); }


x86 assembly (clang, -O0):
<GetMag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMag>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
jb     1134 <GetMag+0x24>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
ret
movaps %xmm2,%xmm0
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @GetMag(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %4
%9 = load float, float* %5
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %7, float %8, float %11)
%13 = load float, float* %6
%14 = load float, float* %6
%15 = call float @llvm.fmuladd.f32(float %13, float %14, float %12)
%16 = call float @sqrtf(float %15)
ret float %16
}

LLVM IR (-O2):
define float @GetMag(float %0, float %1, float %2) {
%4 = fmul float %1, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = tail call float @sqrtf(float %6)
ret float %7
}
/* Variables and functions */
float floor(float x) { return (float)((int)x); }


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
cvttps2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @floor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = sitofp i32 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @floor(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
ret float %3
}