xunge/DecIR huggingface dataset:
void swap(int array[], int j) {
  int t = array[j];
  array[j] = array[j + 1];
  array[j + 1] = t;
}


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

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
rolq   $0x20,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %3
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 %16, i32* %20
%21 = load i32, i32* %5
%22 = load i32*, i32** %3
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %22, i64 %25
store i32 %21, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = add nsw i32 %1, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %4
store i32 %5, i32* %8
ret void
}
void lcd_init() {}


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

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

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

LLVM IR (-O2):
define void @lcd_init() {
ret void
}
/* Variables and functions */
char *TableStrRegister2(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *TableStrRegister(const char *Str) {
  return TableStrRegister2(Str, strlen((char *)Str));
}


x86 assembly (clang, -O0):
<TableStrRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <TableStrRegister2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TableStrRegister>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <TableStrRegister2@plt>

LLVM IR (-O0):
define i8* @TableStrRegister(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @TableStrRegister2(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @TableStrRegister(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @TableStrRegister2(i8* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CSlaveBaseValid(unsigned long);
void I2CSlaveIntDisableEx(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(I2CSlaveBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<I2CSlaveIntDisableEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0xc(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntDisableEx>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
not    %rbx
and    %rbx,0xc(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I2CSlaveIntDisableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @I2CSlaveBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = xor i64 %8, -1
%10 = load i64, i64* %3
%11 = add i64 %10, 12
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntDisableEx(i64 %0, i64 %1) {
%3 = tail call i32 @I2CSlaveBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = xor i64 %1, -1
%6 = add i64 %0, 12
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ _alarm(unsigned int);
int /*<<< orphan*/ _pause();
unsigned sleep(unsigned secs) {
  extern time_t time(time_t *);
  time_t t = time(0);
  _alarm(secs);
  _pause();
  return (time(0) - t);
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_alarm@plt>
mov    $0x0,%al
call   1050 <_pause@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
sub    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <_alarm@plt>
xor    %eax,%eax
call   1050 <_pause@plt>
xor    %edi,%edi
call   1040 <time@plt>
sub    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @time(i32* null)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i32 @_alarm(i32 %5)
%7 = call i32 (...) @_pause()
%8 = call i32 @time(i32* null)
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @sleep(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @_alarm(i32 %0)
%4 = tail call i32 (...) @_pause()
%5 = tail call i32 @time(i32* null)
%6 = sub nsw i32 %5, %2
ret i32 %6
}
void reset_bitarray(register int *vector, register int dim) {
  register int i;
  for (i = 0; i < dim; i++)
    *(vector + i) = 0;
}


x86 assembly (clang, -O0):
<reset_bitarray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <reset_bitarray+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <reset_bitarray+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_bitarray>:
test   %esi,%esi
jle    1126 <reset_bitarray+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @reset_bitarray(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_32(int /*<<< orphan*/);
uint32_t be32toh(uint32_t big_endian_32bits) {
  return bswap_32(big_endian_32bits);
}


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

x86 assembly (clang, -O2):
<be32toh>:
jmp    1030 <bswap_32@plt>

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

LLVM IR (-O2):
define i32 @be32toh(i32 %0) {
%2 = tail call i32 @bswap_32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void escreveNumerosDesc(int a, int b) {
  for (a = a; a >= b; --a) {
    printf("%d\t", a);
  }
}


x86 assembly (clang, -O0):
<escreveNumerosDesc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     114d <escreveNumerosDesc+0x3d>
mov    -0x4(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <escreveNumerosDesc+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escreveNumerosDesc>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jl     1143 <escreveNumerosDesc+0x33>
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xedd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    -0x1(%rbx),%eax
cmp    %ebp,%ebx
mov    %eax,%ebx
jg     1130 <escreveNumerosDesc+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
define void @escreveNumerosDesc(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
store i32 %5, i32* %3
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add nsw i32 %14, -1
store i32 %15, i32* %3
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @escreveNumerosDesc(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nsw i32 %5, -1
%8 = icmp sgt i32 %5, %1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trace_free(void *, char *);
void trace_free_gmp(void *ptr, size_t size) { trace_free(ptr, "GMP"); }


x86 assembly (clang, -O0):
<trace_free_gmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <trace_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_free_gmp>:
lea    0xee9(%rip),%rsi
jmp    1030 <trace_free@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"GMP\00"
define void @trace_free_gmp(i8* %0, i64 %1) {
%3 = tail call i32 @trace_free(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) { printf("Usage: ./receive -p <PORTNUM>\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Usage: ./receive -p <PORTNUM>\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"Usage: ./receive -p <PORTNUM>\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pow(int, double);
int q4(int nt) {
  double a = 98.96, b = -0.2232, c = -0.006457, q4;
  q4 = a * pow(nt, (b + (c * nt)));
}


x86 assembly (clang, -O0):
<q4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%edi
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q4>:
cvtsi2sd %edi,%xmm0
mulsd  0xee4(%rip),%xmm0
addsd  0xee4(%rip),%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define i32 @q4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %3
store double 0x4058BD70A3D70A3D, double* %4
store double -2.232000e-01, double* %5
store double -6.457000e-03, double* %6
%8 = load double, double* %4
%9 = load i32, i32* %3
%10 = load double, double* %5
%11 = load double, double* %6
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to double
%14 = call double @llvm.fmuladd.f64(double %11, double %13, double %10)
%15 = call double @pow(i32 %9, double %14)
%16 = fmul double %8, %15
store double %16, double* %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @q4(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double -6.457000e-03, double -2.232000e-01)
%4 = tail call double @pow(i32 %0, double %3)
ret i32 undef
}
void safe_setuid_drop(void) {}


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

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

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

LLVM IR (-O2):
define void @safe_setuid_drop() {
ret void
}
void foo592() {}


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

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

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

LLVM IR (-O2):
define void @foo592() {
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
char tolower(char);
void SU_Make_Lowercase(char *The_String) {
  int i;
  for (i = 0; i < (int)strlen(The_String); i++) {
    The_String[i] = tolower(The_String[i]);
  }
}


x86 assembly (clang, -O0):
<SU_Make_Lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117c <SU_Make_Lowercase+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <SU_Make_Lowercase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SU_Make_Lowercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <SU_Make_Lowercase+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <SU_Make_Lowercase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @SU_Make_Lowercase(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call signext i8 @tolower(i8 signext %8)
store i8 %9, i8* %7
%10 = add nuw nsw i64 %6, 1
%11 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%12 = shl i64 %11, 32
%13 = ashr exact i64 %12, 32
%14 = icmp slt i64 %10, %13
br i1 %14, label %5, label %15
15: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tx_char(int);
int /*<<< orphan*/ tx_rdy();
void putDebugChar(int c) {
  while (!tx_rdy())
    ;
  tx_char(c);
}


x86 assembly (clang, -O0):
<putDebugChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <tx_rdy@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1147 <putDebugChar+0x27>
jmp    114c <putDebugChar+0x2c>
jmp    112b <putDebugChar+0xb>
mov    -0x4(%rbp),%edi
call   1030 <tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putDebugChar>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <tx_rdy@plt>
test   %eax,%eax
je     1130 <putDebugChar+0x10>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tx_char@plt>

LLVM IR (-O0):
define void @putDebugChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = call i32 (...) @tx_rdy()
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i32, i32* %2
%10 = call i32 @tx_char(i32 %9)
ret void
}

LLVM IR (-O2):
define void @putDebugChar(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @tx_rdy()
%4 = icmp eq i32 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @tx_char(i32 %0)
ret void
}
unsigned int bkdrHash(char *str) {
  unsigned int seed = 131;
  unsigned int hash = 0;
  while (*str) {
    hash = hash * seed + (*str++);
  }
  return (hash % 42737);
}


x86 assembly (clang, -O0):
<bkdrHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x83,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <bkdrHash+0x46>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <bkdrHash+0x16>
mov    -0x10(%rbp),%eax
mov    $0xa6f1,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bkdrHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113c <bkdrHash+0x3c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x83,%eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <bkdrHash+0x10>
mov    %eax,%ecx
imul   $0x31123439,%rcx,%rcx
shr    $0x2d,%rcx
imul   $0xa6f1,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @bkdrHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 131
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %11, 42737
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
int test_imm_26uint32_mem(unsigned int *val) {
  return ((*val) & (0x26 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_26uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x26,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_26uint32_mem>:
testb  $0x26,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_26uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 38
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main(void) {
  int foo = 6;
  printf("\nfoo = %d\n", foo);
  if (foo = 5)
    printf("\nfoo je jednako sa 5");
  foo == 7;
  if (foo == 7)
    printf("\nfoo je jednako sa 7\n");
  else
    printf("\nfoo nije jednako sa 7\n");
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x5,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1146 <main+0x36>
jmp    1154 <main+0x44>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x7,-0x4(%rbp)
jne    1171 <main+0x61>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117f <main+0x6f>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\0Afoo = %d\0A\00"
@.str.1 = [21 x i8] c"\0Afoo je jednako sa 5\00"
@.str.2 = [22 x i8] c"\0Afoo je jednako sa 7\0A\00"
@.str.3 = [24 x i8] c"\0Afoo nije jednako sa 7\0A\00"
define void @main() {
%1 = alloca i32
store i32 6, i32* %1
%2 = load i32, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 5, i32* %1
br i1 true, label %4, label %6
4: ; preds = %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 7
%9 = zext i1 %8 to i32
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 7
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %16
14: ; preds = %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0Afoo = %d\0A\00"
@.str.1 = [21 x i8] c"\0Afoo je jednako sa 5\00"
@str = [23 x i8] c"\0Afoo nije jednako sa 7\00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 6)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void strerr(const char *s) { write(2, s, strlen(s)); }


x86 assembly (clang, -O0):
<strerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @strerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @strerr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ error_exit(int, char *, char const *, char const *);
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *open_file(const char *file, const char *mode,
                const char *mode_description) {
  FILE *fp = fopen(file, mode);
  if (!fp)
    error_exit(1, "could not open file %s for %s", file, mode_description);
  return fp;
}


x86 assembly (clang, -O0):
<open_file>:
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    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1169 <open_file+0x49>
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
lea    0xe9c(%rip),%rsi
call   1030 <error_exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%r15
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114f <open_file+0x2f>
lea    0xec1(%rip),%rsi
mov    $0x1,%edi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <error_exit@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"could not open file %s for %s\00"
define i32* @open_file(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32* @fopen(i8* %8, i8* %9)
store i32* %10, i32** %7
%11 = load i32*, i32** %7
%12 = icmp ne i32* %11, null
br i1 %12, label %17, label %13
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = load i8*, i8** %6
%16 = call i32 @error_exit(i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
br label %17
17: ; preds = %13, %3
%18 = load i32*, i32** %7
ret i32* %18
}

LLVM IR (-O2):
@.str = [30 x i8] c"could not open file %s for %s\00"
define noalias i32* @open_file(i8* %0, i8* nocapture %1, i8* %2) {
%4 = tail call i32* @fopen(i8* %0, i8* %1)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error_exit(i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2)
br label %8
8: ; preds = %6, %3
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ hoic_sw(int, int);
int hdoip_free_buffer(int fd, int fdr, char **argv, int argc) {
  hoic_sw(fd, (0x3400000b));
  return 0;
}


x86 assembly (clang, -O0):
<hdoip_free_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3400000b,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdoip_free_buffer>:
push   %rax
mov    $0x3400000b,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hdoip_free_buffer(i32 %0, i32 %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = call i32 @hoic_sw(i32 %9, i32 872415243)
ret i32 0
}

LLVM IR (-O2):
define i32 @hdoip_free_buffer(i32 %0, i32 %1, i8** nocapture readnone %2, i32 %3) {
%5 = tail call i32 @hoic_sw(i32 %0, i32 872415243)
ret i32 0
}
/* Variables and functions */
int get_num();
int /*<<< orphan*/ printf(char *, int);
void do_gosub() { printf("\tcall l%i\n", get_num()); }


x86 assembly (clang, -O0):
<do_gosub>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_num@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_gosub>:
push   %rax
xor    %eax,%eax
call   1030 <get_num@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\09call l%i\0A\00"
define void @do_gosub() {
%1 = call i32 (...) @get_num()
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\09call l%i\0A\00"
define void @do_gosub() {
%1 = tail call i32 (...) @get_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void pathcon_nm2_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathcon_nm2_decref() {
ret void
}
float obdConvert_31(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return (float)A * 256.0f + (float)B;
}


x86 assembly (clang, -O0):
<obdConvert_31>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm1
movss  0xed8(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_31>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mov    %esi,%eax
cvtsi2ss %rax,%xmm1
mulss  0xeea(%rip),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_31(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = load i32, i32* %6
%12 = uitofp i32 %11 to float
%13 = call float @llvm.fmuladd.f32(float %10, float 2.560000e+02, float %12)
ret float %13
}

LLVM IR (-O2):
define float @obdConvert_31(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = uitofp i32 %1 to float
%7 = tail call float @llvm.fmuladd.f32(float %5, float 2.560000e+02, float %6)
ret float %7
}
void *specialMalloc(int n) {
  int *p;
  p = malloc(n + 8);
  if (p) {
    p[0] = n;
    p++;
  }
  return p;
}


x86 assembly (clang, -O0):
<specialMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
movslq %eax,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <specialMalloc+0x3d>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<specialMalloc>:
push   %rbx
mov    %edi,%ebx
lea    0x8(%rbx),%eax
movslq %eax,%rdi
call   1030 <malloc@plt>
test   %rax,%rax
je     112b <specialMalloc+0x1b>
mov    %ebx,(%rax)
add    $0x4,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @specialMalloc(i32 %0) {
%2 = add nsw i32 %0, 8
%3 = sext i32 %2 to i64
%4 = tail call i8* @malloc(i64 %3)
%5 = bitcast i8* %4 to i32*
%6 = icmp eq i8* %4, null
br i1 %6, label %10, label %7
7: ; preds = %1
store i32 %0, i32* %5
%8 = getelementptr inbounds i32, i32* %5, i64 1
%9 = bitcast i32* %8 to i8*
br label %10
10: ; preds = %7, %1
%11 = phi i8* [ %9, %7 ], [ null, %1 ]
ret i8* %11
}
char *signed_hex(i)
long i;
{
  static char buf[80];
  if (i < 0)
    sprintf(buf, "-%#x", -i);
  else
    sprintf(buf, "%#x", i);
  return buf;
}


x86 assembly (clang, -O0):
<signed_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1149 <signed_hex+0x39>
xor    %eax,%eax
mov    %eax,%edx
sub    -0x8(%rbp),%rdx
lea    0x2f0a(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    1162 <signed_hex+0x52>
mov    -0x8(%rbp),%rdx
lea    0x2eec(%rip),%rdi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2ed7(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_hex>:
push   %rax
mov    %rdi,%rdx
test   %rdi,%rdi
js     1129 <signed_hex+0x19>
lea    0x2f20(%rip),%rdi
lea    0xeda(%rip),%rsi
jmp    113a <signed_hex+0x2a>
neg    %rdx
lea    0x2f0d(%rip),%rdi
lea    0xec6(%rip),%rsi
xor    %eax,%eax
call   1030 <sprintf@plt>
lea    0x2ef8(%rip),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@signed_hex.buf = internal global [80 x i8] zeroinitializer
@.str = [5 x i8] c"-%#x\00"
@.str.1 = [4 x i8] c"%#x\00"
define i8* @signed_hex(i64 %0) {
%2 = icmp slt i64 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = sub nsw i64 0, %0
%5 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @signed_hex.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
br label %8
6: ; preds = %1
%7 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @signed_hex.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %0)
br label %8
8: ; preds = %6, %3
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @signed_hex.buf, i64 0, i64 0)
}
/* Type definitions */
struct tokens {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ chdir(int /*<<< orphan*/);
int /*<<< orphan*/ tokens_get_token(struct tokens *, int);
int cmd_cd(struct tokens *tokens) {
  chdir(tokens_get_token(tokens, 1));
  return 1;
}


x86 assembly (clang, -O0):
<cmd_cd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <tokens_get_token@plt>
mov    %eax,%edi
call   1030 <chdir@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_cd>:
push   %rax
mov    $0x1,%esi
call   1040 <tokens_get_token@plt>
mov    %eax,%edi
call   1030 <chdir@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tokens = type { i32 }
define i32 @cmd_cd(%struct.tokens* %0) {
%2 = alloca %struct.tokens*
store %struct.tokens* %0, %struct.tokens** %2
%3 = load %struct.tokens*, %struct.tokens** %2
%4 = call i32 @tokens_get_token(%struct.tokens* %3, i32 1)
%5 = call i32 @chdir(i32 %4)
ret i32 1
}

LLVM IR (-O2):
%struct.tokens = type { i32 }
define i32 @cmd_cd(%struct.tokens* %0) {
%2 = tail call i32 @tokens_get_token(%struct.tokens* %0, i32 1)
%3 = tail call i32 @chdir(i32 %2)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xca() {
  Assert_real((isodigit(202) == 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",
              1015, ("isodigit should be 0 for 0xca"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xca>:
push   %rax
mov    $0xca,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3f7,%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 0xca\00"
define void @t_isodigit_0xca() {
%1 = call i64 @isodigit(i32 202)
%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 1015, 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 0xca\00"
define void @t_isodigit_0xca() {
%1 = tail call i64 @isodigit(i32 202)
%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 1015, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int uart_control_read();
int uart_writable(void) { return ((uart_control_read() & 0xffff0000) != 0); }


x86 assembly (clang, -O0):
<uart_writable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <uart_control_read@plt>
and    $0xffff0000,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_writable>:
push   %rax
xor    %eax,%eax
call   1030 <uart_control_read@plt>
xor    %ecx,%ecx
cmp    $0x10000,%eax
setae  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @uart_writable() {
%1 = call i32 (...) @uart_control_read()
%2 = and i32 %1, -65536
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @uart_writable() {
%1 = tail call i32 (...) @uart_control_read()
%2 = icmp ugt i32 %1, 65535
%3 = zext i1 %2 to i32
ret i32 %3
}
char *langDbgDevRtc() { return "RTC"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"RTC\00"
define i8* @langDbgDevRtc() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ testfunc();
int main(void) {
  testfunc();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testfunc()
ret i32 0
}
/* Variables and functions */
int ioInitSecurity();
int initialiseModule(void) { return ioInitSecurity(); }


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

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

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

LLVM IR (-O2):
define i32 @initialiseModule() {
%1 = tail call i32 (...) @ioInitSecurity()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *arquivo;
  arquivo = fopen("saida.txt", "w");
  fprintf(arquivo, "\nHello World\n\n");
  fclose(arquivo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"saida.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [15 x i8] c"\0AHello World\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"saida.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [15 x i8] c"\0AHello World\0A\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i64 14, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Type definitions */
struct spqueue_t {
  int dummy;
};
struct pqueue_t {
  int dummy;
};

/* Variables and functions */
void *spqueue_top(struct spqueue_t *);
void *pqueue_top(struct pqueue_t *pqueue) {
  return spqueue_top((struct spqueue_t *)pqueue);
}


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

x86 assembly (clang, -O2):
<pqueue_top>:
jmp    1030 <spqueue_top@plt>

LLVM IR (-O0):
%struct.pqueue_t = type { i32 }
%struct.spqueue_t = type { i32 }
define i8* @pqueue_top(%struct.pqueue_t* %0) {
%2 = alloca %struct.pqueue_t*
store %struct.pqueue_t* %0, %struct.pqueue_t** %2
%3 = load %struct.pqueue_t*, %struct.pqueue_t** %2
%4 = bitcast %struct.pqueue_t* %3 to %struct.spqueue_t*
%5 = call i8* @spqueue_top(%struct.spqueue_t* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.pqueue_t = type { i32 }
%struct.spqueue_t = type { i32 }
define i8* @pqueue_top(%struct.pqueue_t* %0) {
%2 = bitcast %struct.pqueue_t* %0 to %struct.spqueue_t*
%3 = tail call i8* @spqueue_top(%struct.spqueue_t* %2)
ret i8* %3
}
/* Variables and functions */
bool nrf52_errata_75(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_75() {
ret i32 0
}
/* Type definitions */
struct evhttp_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void on_connection_close(struct evhttp_connection *c, void *arg) {
  fprintf(stderr, "connection closed\n");
}


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

x86 assembly (clang, -O2):
<on_connection_close>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.evhttp_connection = type { i32 }
@stderr = global i32 0
@.str = [19 x i8] c"connection closed\0A\00"
define void @on_connection_close(%struct.evhttp_connection* %0, i8* %1) {
%3 = alloca %struct.evhttp_connection*
%4 = alloca i8*
store %struct.evhttp_connection* %0, %struct.evhttp_connection** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.evhttp_connection = type { i32 }
@stderr = global i32 0
@.str = [19 x i8] c"connection closed\0A\00"
define void @on_connection_close(%struct.evhttp_connection* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}