xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long UpdateCRC(long, unsigned char const *, int);
unsigned long CRC(const unsigned char *buf, int len) {
  return UpdateCRC(0L, buf, len);
}


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

x86 assembly (clang, -O2):
<CRC>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <UpdateCRC@plt>

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

LLVM IR (-O2):
define i64 @CRC(i8* %0, i32 %1) {
%3 = tail call i64 @UpdateCRC(i64 0, i8* %0, i32 %1)
ret i64 %3
}
unsigned int hashStr(const char *s) {
  unsigned int h = 0;
  int i;
  for (i = 0; s[i]; i++) {
    h += s[i] * i;
  }
  return h % 255;
}


x86 assembly (clang, -O0):
<hashStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114c <hashStr+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hashStr+0x16>
mov    -0xc(%rbp),%eax
mov    $0xff,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashStr>:
mov    (%rdi),%dl
xor    %eax,%eax
test   %dl,%dl
je     113d <hashStr+0x3d>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movsbl %dl,%edx
imul   %eax,%edx
add    %edx,%ecx
movzbl 0x1(%rdi,%rax,1),%edx
add    $0x1,%rax
test   %dl,%dl
jne    1110 <hashStr+0x10>
mov    %ecx,%edx
mov    $0x80808081,%eax
imul   %rdx,%rax
shr    $0x27,%rax
mov    %eax,%edx
shl    $0x8,%edx
sub    %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hashStr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = trunc i64 %5 to i32
%10 = mul nsw i32 %9, %8
%11 = add i32 %10, %7
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = urem i32 %11, 255
br label %18
18: ; preds = %16, %1
%19 = phi i32 [ 0, %1 ], [ %17, %16 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int pn(int n) {
  printf("%d", n);
  return n;
}


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

x86 assembly (clang, -O2):
<pn>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @pn(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
int clean_call_beyond_mcontext(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @clean_call_beyond_mcontext() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int utype;
};
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef TYPE_1__ ASN1_ITEM;

/* Variables and functions */
int asn1_set_choice_selector(ASN1_VALUE **pval, int value,
                             const ASN1_ITEM *it) {
  int *sel, ret;
  sel = (void *)(((char *)*pval) + it->utype);
  ret = *sel;
  *sel = value;
  return ret;
}


x86 assembly (clang, -O0):
<asn1_set_choice_selector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_set_choice_selector>:
mov    (%rdi),%rcx
movslq (%rdx),%rdx
mov    (%rcx,%rdx,1),%eax
mov    %esi,(%rcx,%rdx,1)
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @asn1_set_choice_selector(i32** %0, i32 %1, %struct.TYPE_3__* %2) {
%4 = alloca i32**
%5 = alloca i32
%6 = alloca %struct.TYPE_3__*
%7 = alloca i32*
%8 = alloca i32
store i32** %0, i32*** %4
store i32 %1, i32* %5
store %struct.TYPE_3__* %2, %struct.TYPE_3__** %6
%9 = load i32**, i32*** %4
%10 = load i32*, i32** %9
%11 = bitcast i32* %10 to i8*
%12 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
%17 = bitcast i8* %16 to i32*
store i32* %17, i32** %7
%18 = load i32*, i32** %7
%19 = load i32, i32* %18
store i32 %19, i32* %8
%20 = load i32, i32* %5
%21 = load i32*, i32** %7
store i32 %20, i32* %21
%22 = load i32, i32* %8
ret i32 %22
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @asn1_set_choice_selector(i32** nocapture %0, i32 %1, %struct.TYPE_3__* nocapture %2) {
%4 = bitcast i32** %0 to i8**
%5 = load i8*, i8** %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
store i32 %1, i32* %10
ret i32 %11
}
int test_imm_CDint32_reg(int val) { return ((val) & (0xCD << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_CDint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xcd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_CDint32_reg(i32 %0) {
%2 = and i32 %0, 205
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int d_ge_mm1(double *a1, double *a2) { return (((*a1) >= (*a2))); }


x86 assembly (clang, -O0):
<d_ge_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ge_mm1>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @d_ge_mm1(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp oge double %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_ge_mm1(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp oge double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char const *);
void perror(const char *what) { syslog(LOG_ERR, "%s: %m", what); }


x86 assembly (clang, -O0):
<perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror>:
mov    %rdi,%rdx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [7 x i8] c"%s: %m\00"
define void @perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_ERR
%4 = load i8*, i8** %2
%5 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [7 x i8] c"%s: %m\00"
define void @perror(i8* %0) {
%2 = load i32, i32* @LOG_ERR
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdout;
int vfprintf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vprintf(const char *format, va_list arguments) {
  return vfprintf(stdout, format, arguments);
}


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

x86 assembly (clang, -O2):
<vprintf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @vfprintf(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @vprintf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *reallocf(void *ptr, size_t newSize) {
  void *result = realloc(ptr, newSize);
  if (!result)
    free(ptr);
  return result;
}


x86 assembly (clang, -O0):
<reallocf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <reallocf+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocf>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <reallocf+0x1c>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @reallocf(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_dmatrix(double **m, int nrl, int nrh, int ncl, int nch) {
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
mov    (%rdi,%rbx,8),%rax
movslq %ecx,%rcx
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%r14,%rbx,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dmatrix(double** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store double** %0, double*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double*, double** %11, i64 %13
%15 = load double*, double** %14
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = getelementptr inbounds double, double* %18, i64 -1
%20 = bitcast double* %19 to i8*
%21 = call i32 @free(i8* %20)
%22 = load double**, double*** %6
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double*, double** %22, i64 %24
%26 = getelementptr inbounds double*, double** %25, i64 -1
%27 = bitcast double** %26 to i8*
%28 = call i32 @free(i8* %27)
ret void
}

LLVM IR (-O2):
define void @free_dmatrix(double** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double*, double** %0, i64 %6
%8 = load double*, double** %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds double, double* %8, i64 %9
%11 = getelementptr inbounds double, double* %10, i64 -1
%12 = bitcast double* %11 to i8*
%13 = tail call i32 @free(i8* %12)
%14 = getelementptr inbounds double*, double** %7, i64 -1
%15 = bitcast double** %14 to i8*
%16 = tail call i32 @free(i8* %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void gprsharp_sizeof_timespec() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<gprsharp_sizeof_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<gprsharp_sizeof_timespec>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @gprsharp_sizeof_timespec() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @gprsharp_sizeof_timespec() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int internal_to_upper(int);
__attribute__((visibility("default"))) int trio_to_upper(int source) {
  return internal_to_upper(source);
}


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

x86 assembly (clang, -O2):
<trio_to_upper>:
jmp    1030 <internal_to_upper@plt>

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

LLVM IR (-O2):
define i32 @trio_to_upper(i32 %0) {
%2 = tail call i32 @internal_to_upper(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gfx_color(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ gfx_fill_rectangle(int, int, int, int);
void my_gfx_cleararea(int x, int y, int w, int h) {
  gfx_color(0, 0, 0);
  gfx_fill_rectangle(x, y, w, h);
  return;
}


x86 assembly (clang, -O0):
<my_gfx_cleararea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <gfx_color@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <gfx_fill_rectangle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_gfx_cleararea>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <gfx_color@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <gfx_fill_rectangle@plt>

LLVM IR (-O0):
define void @my_gfx_cleararea(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 = call i32 @gfx_color(i32 0, i32 0, i32 0)
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @gfx_fill_rectangle(i32 %10, i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @my_gfx_cleararea(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @gfx_color(i32 0, i32 0, i32 0)
%6 = tail call i32 @gfx_fill_rectangle(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
void nand_cmd(unsigned char cmd) {
  volatile int i;
  (*((volatile unsigned char *)0x4E000008)) = cmd;
  for (i = 0; i < 10; i++)
    ;
}


x86 assembly (clang, -O0):
<nand_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x4e000008,%eax
mov    %cl,(%rax)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0xa,%eax
jge    113a <nand_cmd+0x3a>
jmp    112c <nand_cmd+0x2c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111b <nand_cmd+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_cmd>:
mov    %dil,0x4e000008
4e
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x9,%eax
jg     112e <nand_cmd+0x2e>
nopl   0x0(%rax)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0xa,%eax
jl     1120 <nand_cmd+0x20>
ret

LLVM IR (-O0):
define void @nand_cmd(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
store volatile i8 %4, i8* inttoptr (i64 1308622856 to i8*)
store volatile i32 0, i32* %3
br label %5
5: ; preds = %9, %1
%6 = load volatile i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %5
br label %9
9: ; preds = %8
%10 = load volatile i32, i32* %3
%11 = add nsw i32 %10, 1
store volatile i32 %11, i32* %3
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @nand_cmd(i8 zeroext %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i8 %0, i8* inttoptr (i64 1308622856 to i8*)
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp slt i32 %9, 10
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
/* Variables and functions */
short ENDSWAP_16(short);
void endswap_short_array(short *ptr, int len) {
  short temp;
  while (--len >= 0) {
    temp = ptr[len];
    ptr[len] = ENDSWAP_16(temp);
  };
}


x86 assembly (clang, -O0):
<endswap_short_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     115e <endswap_short_array+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,2),%ax
mov    %ax,-0xe(%rbp)
movswl -0xe(%rbp),%edi
call   1030 <ENDSWAP_16@plt>
mov    %ax,%dx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
jmp    111f <endswap_short_array+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endswap_short_array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114d <endswap_short_array+0x3d>
mov    %rdi,%r14
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbx),%r15d
movswl (%r14,%r15,2),%edi
call   1030 <ENDSWAP_16@plt>
mov    %ax,(%r14,%r15,2)
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <endswap_short_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @endswap_short_array(i16* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i16, i16* %0, i64 %9
%11 = load i16, i16* %10
%12 = tail call signext i16 @ENDSWAP_16(i16 signext %11)
store i16 %12, i16* %10
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x9a() {
  Assert_real((isupper(154) == 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_isupper.c",
              775, ("isupper should be 0 for 0x9a"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x9a>:
push   %rax
mov    $0x9a,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x307,%edx
pop    %rax
jmp    1040 <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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x9a\00"
define void @t_isupper_0x9a() {
%1 = call i64 @isupper(i32 154)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([29 x i8], [29 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x9a\00"
define void @t_isupper_0x9a() {
%1 = tail call i64 @isupper(i32 154)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int exit_section(const char *name) {
  if (strcmp(name, ".exit.text") == 0)
    return 1;
  if (strcmp(name, ".exit.data") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<exit_section>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <exit_section+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <exit_section+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <exit_section+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <exit_section+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_section>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <exit_section+0x31>
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c".exit.text\00"
@.str.1 = [11 x i8] c".exit.data\00"
define i32 @exit_section(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c".exit.text\00"
@.str.1 = [11 x i8] c".exit.data\00"
define i32 @exit_section(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
char *corta_string(char *apuntador) {
  int i = 0;
  while (*(apuntador + i) != '\0')
    i++;
  if (i > 1) {
    apuntador = apuntador + 1;
    return apuntador;
  } else
    return "Error: La cadena es muy corta\n";
}


x86 assembly (clang, -O0):
<corta_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <corta_string+0x32>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <corta_string+0xf>
cmpl   $0x1,-0x14(%rbp)
jle    1155 <corta_string+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <corta_string+0x60>
lea    0xea4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<corta_string>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <corta_string+0x10>
add    $0x1,%rdi
test   $0xfffffffe,%eax
lea    0xed5(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Error: La cadena es muy corta\0A\00"
define i8* @corta_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 1
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8* %21, i8** %3
%22 = load i8*, i8** %3
store i8* %22, i8** %2
br label %24
23: ; preds = %16
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %2
br label %24
24: ; preds = %23, %19
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
@.str = [31 x i8] c"Error: La cadena es muy corta\0A\00"
define i8* @corta_string(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967294
%10 = icmp eq i64 %9, 0
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = select i1 %10, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %11
ret i8* %12
}
extern char **_swift_FreeBSD_getEnv() {
  extern char **environ;
  return environ;
}


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

x86 assembly (clang, -O2):
<_swift_FreeBSD_getEnv>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@environ = external global i8**
define i8** @_swift_FreeBSD_getEnv() {
%1 = load i8**, i8*** @environ
ret i8** %1
}

LLVM IR (-O2):
@environ = external global i8**
define i8** @_swift_FreeBSD_getEnv() {
%1 = load i8**, i8*** @environ
ret i8** %1
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *str_dup(const char *s) {
  char *result = (char *)malloc(strlen(s) + 1);
  strcpy(result, s);
  return result;
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @str_dup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ basicStatement();
void subStatement() {
  basicStatement();
  return;
}


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

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

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

LLVM IR (-O2):
define void @subStatement() {
%1 = tail call i32 (...) @basicStatement()
ret void
}
unsigned long stwu(unsigned char rs, unsigned short d, unsigned char ra) {
  return (37 << 26) | (rs << 21) | (ra << 16) | d;
}


x86 assembly (clang, -O0):
<stwu>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %si,%cx
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cx,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x15,%eax
or     $0x94000000,%eax
movzbl -0x5(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzwl -0x4(%rbp),%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<stwu>:
shl    $0x15,%edi
shl    $0x10,%edx
or     %esi,%edi
or     %edx,%edi
or     $0x94000000,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @stwu(i8 zeroext %0, i16 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i16
%6 = alloca i8
store i8 %0, i8* %4
store i16 %1, i16* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 21
%10 = or i32 -1811939328, %9
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %10, %13
%15 = load i16, i16* %5
%16 = zext i16 %15 to i32
%17 = or i32 %14, %16
%18 = sext i32 %17 to i64
ret i64 %18
}

LLVM IR (-O2):
define i64 @stwu(i8 zeroext %0, i16 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %0 to i32
%5 = shl nuw nsw i32 %4, 21
%6 = zext i8 %2 to i32
%7 = shl nuw nsw i32 %6, 16
%8 = zext i16 %1 to i32
%9 = or i32 %5, %8
%10 = or i32 %9, %7
%11 = or i32 %10, -1811939328
%12 = sext i32 %11 to i64
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_devbox_io(int file_desc) { close(file_desc); }


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

x86 assembly (clang, -O2):
<close_devbox_io>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_devbox_io(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RI_CTX_clear_free(void *);
void wrap_ri_ctx_clear_free(void *ctx) { RI_CTX_clear_free(ctx); }


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

x86 assembly (clang, -O2):
<wrap_ri_ctx_clear_free>:
jmp    1030 <RI_CTX_clear_free@plt>

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

LLVM IR (-O2):
define void @wrap_ri_ctx_clear_free(i8* %0) {
%2 = tail call i32 @RI_CTX_clear_free(i8* %0)
ret void
}
/* Variables and functions */
float expm1f(float);
float test4f(float x) { return expm1f(x); }


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

x86 assembly (clang, -O2):
<test4f>:
jmp    1030 <expm1f@plt>

LLVM IR (-O0):
define float @test4f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @expm1f(float %3)
ret float %4
}

LLVM IR (-O2):
define float @test4f(float %0) {
%2 = tail call float @expm1f(float %0)
ret float %2
}
void gtk_notebook_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_notebook_new() {
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int validate_tree_helper(struct node *, struct node *);
bool validate_tree(struct node *leaf) {
  struct node *prev = NULL;
  return validate_tree_helper(leaf, prev);
}


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

x86 assembly (clang, -O2):
<validate_tree>:
xor    %esi,%esi
jmp    1030 <validate_tree_helper@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @validate_tree(%struct.node* %0) {
%2 = alloca %struct.node*
%3 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
store %struct.node* null, %struct.node** %3
%4 = load %struct.node*, %struct.node** %2
%5 = load %struct.node*, %struct.node** %3
%6 = call i32 @validate_tree_helper(%struct.node* %4, %struct.node* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @validate_tree(%struct.node* %0) {
%2 = tail call i32 @validate_tree_helper(%struct.node* %0, %struct.node* null)
ret i32 %2
}
XGetKeyboardControl() {}


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

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

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

LLVM IR (-O2):
define i32 @XGetKeyboardControl() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void login_exit(int sig) { exit(1); }


x86 assembly (clang, -O0):
<login_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<login_exit>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @login_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @login_exit(i32 %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
int check_power_of_two(int bsize) {
  if (bsize & (bsize - 1)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1127 <check_power_of_two+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <check_power_of_two+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_power_of_two>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check_power_of_two(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int string_equals(const char *a, const char *b) { return strcmp(a, b) == 0; }


x86 assembly (clang, -O0):
<string_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_equals>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_equals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @string_equals(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int be_seeing_you();
int main(void) { return be_seeing_you() == 6 ? 0 : 1; }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <be_seeing_you@plt>
xor    %ecx,%ecx
cmp    $0x6,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @be_seeing_you()
%3 = icmp eq i32 %2, 6
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 0, i32 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @be_seeing_you()
%2 = icmp ne i32 %1, 6
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned int tv_nsec;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void rarch_sleep(unsigned msec) {
  struct timespec tv = {0};
  tv.tv_sec = msec / 1000;
  tv.tv_nsec = (msec % 1000) * 1000000;
  nanosleep(&tv, NULL);
}


x86 assembly (clang, -O0):
<rarch_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rarch_sleep>:
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %eax,0x8(%rsp)
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
imul   $0xf4240,%edi,%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32, i32 }
define void @rarch_sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = bitcast %struct.timespec* %3 to i8*
%5 = load i32, i32* %2
%6 = udiv i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %2
%9 = urem i32 %8, 1000
%10 = mul i32 %9, 1000000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %10, i32* %11
%12 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32, i32 }
define void @rarch_sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 2
store i32 0, i32* %4
%5 = udiv i32 %0, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = urem i32 %0, 1000
%8 = mul nuw nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clock_init_hal();
void clock_init(void) { clock_init_hal(); }


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

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

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

LLVM IR (-O2):
define void @clock_init() {
%1 = tail call i32 (...) @clock_init_hal()
ret void
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *mempcpy(void *dest, const void *src, size_t n) {
  return memcpy(dest, src, n) + n;
}


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

x86 assembly (clang, -O2):
<mempcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <memcpy@plt>
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mempcpy(i8* %0, i8* %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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i64, i64* %6
%11 = getelementptr i8, i8* %7, i64 %10
ret i8* %11
}

LLVM IR (-O2):
define i8* @mempcpy(i8* writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
%4 = getelementptr i8, i8* %0, i64 %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ DefDriverProcedure(int);
char *DefCanDrvInfo(void) {
  DefDriverProcedure(1);
  return (NULL);
}


x86 assembly (clang, -O0):
<DefCanDrvInfo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <DefDriverProcedure@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DefCanDrvInfo>:
push   %rax
mov    $0x1,%edi
call   1030 <DefDriverProcedure@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @DefCanDrvInfo() {
%1 = call i32 @DefDriverProcedure(i32 1)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @DefCanDrvInfo() {
%1 = tail call i32 @DefDriverProcedure(i32 1)
ret i8* null
}