xunge/DecIR huggingface dataset:
char *message(void) {
  char *rv = "this is a test of the emergency broadcast system...\n";
  return rv;
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"this is a test of the emergency broadcast system...\0A\00"
define i8* @message() {
%1 = alloca i8*
store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [53 x i8] c"this is a test of the emergency broadcast system...\0A\00"
define i8* @message() {
ret i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int rand();
uint64_t _random64() {
  uint64_t r1 = rand();
  uint64_t r2 = rand();
  return (r1 << 32) | r2;
}


x86 assembly (clang, -O0):
<_random64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_random64() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @rand()
store i32 %3, i32* %1
%4 = call i32 (...) @rand()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = shl i32 %5, 32
%7 = load i32, i32* %2
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @_random64() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (...) @rand()
ret i32 poison
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_svariancepn(int, float, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_svariancepn(N, 1.0f, x, stride);
  printf("sample variance: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
movss  0xe8c(%rip),%xmm0
call   1040 <stdlib_strided_svariancepn@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movss  0xebd(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_svariancepn@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [21 x i8] c"sample variance: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_svariancepn(i32 %6, float 1.000000e+00, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [21 x i8] c"sample variance: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_svariancepn(i32 4, float 1.000000e+00, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *cnt_deque_malloc(size_t size) {
  void *ptr = malloc(size);
  return ptr;
}


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

x86 assembly (clang, -O2):
<cnt_deque_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @cnt_deque_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @cnt_deque_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
void set_timespec(struct timespec *tmr, unsigned long long ustime) {
  tmr->tv_sec = (time_t)(ustime / 1000000ULL);
  tmr->tv_nsec = (long)(1000ULL * (ustime % 1000000ULL));
}


x86 assembly (clang, -O0):
<set_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
imul   $0x3e8,%rdx,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_timespec>:
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rsi,%rax
mul    %rcx
shr    $0x12,%rdx
mov    %rdx,0x8(%rdi)
imul   $0xf4240,%rdx,%rax
sub    %rax,%rsi
imul   $0x3e8,%rsi,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @set_timespec(%struct.timespec* nocapture writeonly %0, i64 %1) {
%3 = udiv i64 %1, 1000000
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i64 %3, i64* %4
%5 = urem i64 %1, 1000000
%6 = mul nuw nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i64 %6, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void U_WMRNOTIMPLEMENTED_print(const char *contents) {
  (void)contents;
  printf("   Not Implemented!\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c" Not Implemented!\0A\00"
define void @U_WMRNOTIMPLEMENTED_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c" Not Implemented!\00"
define void @U_WMRNOTIMPLEMENTED_print(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *getenv(char *);
char *getHostname() {
  char *hostname;
  hostname = getenv("HOSTNAME");
  if (NULL == hostname) {
    hostname = getenv("COMPUTERNAME");
  }
  if (NULL == hostname) {
    hostname = "unknown";
  }
  return hostname;
}


x86 assembly (clang, -O0):
<getHostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    1144 <getHostname+0x34>
lea    0xece(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    115b <getHostname+0x4b>
lea    0xebf(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHostname>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
jne    112e <getHostname+0x1e>
lea    0xee0(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xede(%rip),%rcx
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"HOSTNAME\00"
@.str.1 = [13 x i8] c"COMPUTERNAME\00"
@.str.2 = [8 x i8] c"unknown\00"
define i8* @getHostname() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp eq i8* null, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i8* %6, i8** %1
br label %7
7: ; preds = %5, %0
%8 = load i8*, i8** %1
%9 = icmp eq i8* null, %8
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %11
11: ; preds = %10, %7
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@.str = [9 x i8] c"HOSTNAME\00"
@.str.1 = [13 x i8] c"COMPUTERNAME\00"
@.str.2 = [8 x i8] c"unknown\00"
define i8* @getHostname() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = phi i8* [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i8* %6, null
%8 = select i1 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %6
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ putCirclePicture(double, double, double);
void putInnerCircle(double cx, double cy, double r) {
  putCirclePicture(cx, cy, r * 2.0);
}


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

x86 assembly (clang, -O2):
<putInnerCircle>:
addsd  %xmm2,%xmm2
jmp    1030 <putCirclePicture@plt>

LLVM IR (-O0):
define void @putInnerCircle(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fmul double %9, 2.000000e+00
%11 = call i32 @putCirclePicture(double %7, double %8, double %10)
ret void
}

LLVM IR (-O2):
define void @putInnerCircle(double %0, double %1, double %2) {
%4 = fmul double %2, 2.000000e+00
%5 = tail call i32 @putCirclePicture(double %0, double %1, double %4)
ret void
}
/* Variables and functions */
long double pow(long double, int);
long double cgSpecularIntensity(long double dot_product,
                                long double specular_factor, int specular_focus,
                                long double light_intensity) {
  return (pow(dot_product, specular_focus) * specular_factor * light_intensity);
}


x86 assembly (clang, -O0):
<cgSpecularIntensity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
mov    %edi,-0x24(%rbp)
fstpt  -0x40(%rbp)
fldt   -0x10(%rbp)
mov    -0x24(%rbp),%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <pow@plt>
fldt   -0x20(%rbp)
fmulp  %st,%st(1)
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgSpecularIntensity>:
sub    $0x28,%rsp
fldt   0x50(%rsp)
fstpt  0x1c(%rsp)
fldt   0x40(%rsp)
fstpt  0x10(%rsp)
fldt   0x30(%rsp)
fstpt  (%rsp)
call   1030 <pow@plt>
fldt   0x10(%rsp)
fmulp  %st,%st(1)
fldt   0x1c(%rsp)
fmulp  %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @cgSpecularIntensity(x86_fp80 %0, x86_fp80 %1, i32 %2, x86_fp80 %3) {
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca i32
%8 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %5
store x86_fp80 %1, x86_fp80* %6
store i32 %2, i32* %7
store x86_fp80 %3, x86_fp80* %8
%9 = load x86_fp80, x86_fp80* %5
%10 = load i32, i32* %7
%11 = call x86_fp80 @pow(x86_fp80 %9, i32 %10)
%12 = load x86_fp80, x86_fp80* %6
%13 = fmul x86_fp80 %11, %12
%14 = load x86_fp80, x86_fp80* %8
%15 = fmul x86_fp80 %13, %14
ret x86_fp80 %15
}

LLVM IR (-O2):
define x86_fp80 @cgSpecularIntensity(x86_fp80 %0, x86_fp80 %1, i32 %2, x86_fp80 %3) {
%5 = tail call x86_fp80 @pow(x86_fp80 %0, i32 %2)
%6 = fmul x86_fp80 %5, %1
%7 = fmul x86_fp80 %6, %3
ret x86_fp80 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_to_bytes(uintptr_t, uintptr_t);
void fiat_secp256k1_to_bytes(uint8_t out1[32], const uint32_t arg1[8]) {
  internal_fiat_secp256k1_to_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


x86 assembly (clang, -O0):
<fiat_secp256k1_to_bytes>:
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 <internal_fiat_secp256k1_to_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_secp256k1_to_bytes>:
jmp    1030 <internal_fiat_secp256k1_to_bytes@plt>

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

LLVM IR (-O2):
define void @fiat_secp256k1_to_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_secp256k1_to_bytes(i64 %3, i64 %4)
ret void
}
/* Type definitions */
struct Data {
  int dummy;
};
typedef int /*<<< orphan*/ sqlite3_stmt;

/* Variables and functions */
int /*<<< orphan*/ finishedStmt(int /*<<< orphan*/ *);
int /*<<< orphan*/ *getStmt(char *);
struct Data *runSelect(int /*<<< orphan*/ *);
struct Data *calcMaxValues() {
  sqlite3_stmt *stmtMaxValues =
      getStmt("SELECT MAX(dl) AS dl, MAX(ul) AS ul FROM data");
  struct Data *result = runSelect(stmtMaxValues);
  finishedStmt(stmtMaxValues);
  return result;
}


x86 assembly (clang, -O0):
<calcMaxValues>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <getStmt@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <runSelect@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <finishedStmt@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcMaxValues>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1040 <getStmt@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <runSelect@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <finishedStmt@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.Data = type { i32 }
@.str = [46 x i8] c"SELECT MAX(dl) AS dl, MAX(ul) AS ul FROM data\00"
define %struct.Data* @calcMaxValues() {
%1 = alloca i32*
%2 = alloca %struct.Data*
%3 = call i32* @getStmt(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call %struct.Data* @runSelect(i32* %4)
store %struct.Data* %5, %struct.Data** %2
%6 = load i32*, i32** %1
%7 = call i32 @finishedStmt(i32* %6)
%8 = load %struct.Data*, %struct.Data** %2
ret %struct.Data* %8
}

LLVM IR (-O2):
%struct.Data = type { i32 }
@.str = [46 x i8] c"SELECT MAX(dl) AS dl, MAX(ul) AS ul FROM data\00"
define %struct.Data* @calcMaxValues() {
%1 = tail call i32* @getStmt(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = tail call %struct.Data* @runSelect(i32* %1)
%3 = tail call i32 @finishedStmt(i32* %1)
ret %struct.Data* %2
}
void g_arith_div_f(void *s, void *d, void *o) {
  *((float *)o) = *((float *)s) / *((float *)d);
}


x86 assembly (clang, -O0):
<g_arith_div_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_arith_div_f>:
movss  (%rdi),%xmm0
divss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @g_arith_div_f(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
%13 = fdiv float %9, %12
%14 = load i8*, i8** %6
%15 = bitcast i8* %14 to float*
store float %13, float* %15
ret void
}

LLVM IR (-O2):
define void @g_arith_div_f(i8* nocapture %0, i8* nocapture %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %0 to float*
%5 = load float, float* %4
%6 = bitcast i8* %1 to float*
%7 = load float, float* %6
%8 = fdiv float %5, %7
%9 = bitcast i8* %2 to float*
store float %8, float* %9
ret void
}
/* Variables and functions */
size_t do_cpuid2_return(int, char *);
size_t qsim_in_block(char *buf) {
  size_t s;
  s = do_cpuid2_return(0xc5b1fffd, buf);
  return s;
}


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

x86 assembly (clang, -O2):
<qsim_in_block>:
mov    %rdi,%rsi
mov    $0xc5b1fffd,%edi
jmp    1030 <do_cpuid2_return@plt>

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

LLVM IR (-O2):
define i64 @qsim_in_block(i8* %0) {
%2 = tail call i64 @do_cpuid2_return(i32 -978190339, i8* %0)
ret i64 %2
}
void ff_hevc_put_hevc_epel_hv12_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv12_8_sse4() {
ret void
}
void adt_free_nothing(void *src) {}


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

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

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

LLVM IR (-O2):
define void @adt_free_nothing(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c_fstr_sort_index(int *, int);
void FSTR_SORT_INDEX(int *index_data, int *n) {
  c_fstr_sort_index(index_data, *n);
}


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

x86 assembly (clang, -O2):
<FSTR_SORT_INDEX>:
mov    (%rsi),%esi
jmp    1030 <c_fstr_sort_index@plt>

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

LLVM IR (-O2):
define void @FSTR_SORT_INDEX(i32* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @c_fstr_sort_index(i32* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ write_flash(char *);
int erase() {
  char *buf = malloc((1024 * 16));
  memset(buf, 0, (1024 * 16));
  write_flash(buf);
  free(buf);
  return 0;
}


x86 assembly (clang, -O0):
<erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4000,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4000,%edx
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1040 <write_flash@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase>:
push   %rbx
mov    $0x4000,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x4000,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
call   1040 <write_flash@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @erase() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 16384)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @memset(i8* %3, i32 0, i32 16384)
%5 = load i8*, i8** %1
%6 = call i32 @write_flash(i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @erase() {
%1 = tail call dereferenceable_or_null(16384) i8* @malloc(i32 16384)
%2 = tail call i32 @memset(i8* %1, i32 0, i32 16384)
%3 = tail call i32 @write_flash(i8* %1)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nand_cmd(int);
int /*<<< orphan*/ nand_deselect();
int /*<<< orphan*/ nand_select();
int /*<<< orphan*/ wait_ready();
void nand_reset(void) {
  nand_select();
  nand_cmd(0xff);
  wait_ready();
  nand_deselect();
}


x86 assembly (clang, -O0):
<nand_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <nand_select@plt>
mov    $0xff,%edi
call   1040 <nand_cmd@plt>
mov    $0x0,%al
call   1050 <wait_ready@plt>
mov    $0x0,%al
call   1030 <nand_deselect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_reset>:
push   %rax
xor    %eax,%eax
call   1060 <nand_select@plt>
mov    $0xff,%edi
call   1040 <nand_cmd@plt>
xor    %eax,%eax
call   1050 <wait_ready@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nand_deselect@plt>

LLVM IR (-O0):
define void @nand_reset() {
%1 = call i32 (...) @nand_select()
%2 = call i32 @nand_cmd(i32 255)
%3 = call i32 (...) @wait_ready()
%4 = call i32 (...) @nand_deselect()
ret void
}

LLVM IR (-O2):
define void @nand_reset() {
%1 = tail call i32 (...) @nand_select()
%2 = tail call i32 @nand_cmd(i32 255)
%3 = tail call i32 (...) @wait_ready()
%4 = tail call i32 (...) @nand_deselect()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __cut_assert(int, char *, char *, int);
void __CUT__arr_test_dummy() {
  __cut_assert(
      !!(1),
      ("  %s:%d: ("
       "1"
       ") "
       ""
       "\n"),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/kr/cubby/refs/heads/master/check-arr.c",
      15);
}


x86 assembly (clang, -O0):
<__CUT__arr_test_dummy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
lea    0xee8(%rip),%rdx
mov    $0xf,%ecx
call   1030 <__cut_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__CUT__arr_test_dummy>:
lea    0xee9(%rip),%rsi
lea    0xef1(%rip),%rdx
mov    $0x1,%edi
mov    $0xf,%ecx
jmp    1030 <__cut_assert@plt>

LLVM IR (-O0):
@.str = [15 x i8] c" %s:%d: (1) \0A\00"
@.str.1 = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kr/cubby/refs/heads/master/check-arr.c\00"
define void @__CUT__arr_test_dummy() {
%1 = call i32 @__cut_assert(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str.1, i64 0, i64 0), i32 15)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c" %s:%d: (1) \0A\00"
@.str.1 = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kr/cubby/refs/heads/master/check-arr.c\00"
define void @__CUT__arr_test_dummy() {
%1 = tail call i32 @__cut_assert(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str.1, i64 0, i64 0), i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
void getValue(int *a) {
  printf("Enter The Coeff. A B C: ");
  scanf("%d %d %d", a, a + 1, a + 2);
}


x86 assembly (clang, -O0):
<getValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
add    $0x4,%rdx
mov    -0x8(%rbp),%rcx
add    $0x8,%rcx
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getValue>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rbx),%rdx
lea    0x8(%rbx),%rcx
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Enter The Coeff. A B C: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define void @getValue(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %6, i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Enter The Coeff. A B C: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define void @getValue(i32* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %0, i32* %3, i32* %4)
ret void
}
double dabs(double n) {
  if (n < 0) {
    n *= -1;
  }
  return n;
}


x86 assembly (clang, -O0):
<dabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <dabs+0x29>
movsd  0xee1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fmul double %6, -1.000000e+00
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @dabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int n_char(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void main() {
  int n;
  char string[50];
  strcpy(
      string,
      "Helsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"
      "ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"
      "ssssssssssssssssssssssssssssssssssssssssssssssssssssssso World");
  n = n_char(string);
  printf("Length of string = %d\n", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
call   1050 <n_char@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xf71(%rip),%rdi
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <n_char@plt>
lea    0xf79(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [207 x i8] c"Helsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssso World\00"
@.str.1 = [23 x i8] c"Length of string = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = call i32 @n_char(i8* %5)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [207 x i8] c"Helsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssso World\00"
@.str.1 = [23 x i8] c"Length of string = %d\0A\00"
define void @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @n_char(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}
int divide_and_round_up(int x, int y) { return (x + y - 1) / y; }


x86 assembly (clang, -O0):
<divide_and_round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_and_round_up>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @divide_and_round_up(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @divide_and_round_up(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sdiv i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ test_desordered_elements();
int /*<<< orphan*/ test_sorted();
int main() {
  test_desordered_elements();
  test_sorted();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_desordered_elements()
%2 = tail call i32 (...) @test_sorted()
ret i32 0
}
/* Variables and functions */
char *malloc(int);
void func1(void) {
  char *pointer = 0;
  pointer = malloc(64);
  return;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func1() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i8* @malloc(i32 64)
store i8* %2, i8** %1
ret void
}

LLVM IR (-O2):
define void @func1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i < 512; i++) {
    printf("%08d, 0x%08x\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jge    1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x200,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%08d, 0x%08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 512
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%08d, 0x%08x\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 512
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
int SM_init(int channel, int node, int verifier) { return -2; }


x86 assembly (clang, -O0):
<SM_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xfffffffe,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SM_init(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -2
}

LLVM IR (-O2):
define i32 @SM_init(i32 %0, i32 %1, i32 %2) {
ret i32 -2
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ writeaudio(char *);
int main(int argc, char *argv[]) {
  char *output = calloc(1, ((44100 * 2) * 60 * 3));
  writeaudio(output);
  fwrite(output, 1, ((44100 * 2) * 60 * 3), stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0xf23fa0,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <writeaudio@plt>
mov    -0x18(%rbp),%rdi
mov    0x2e73(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
mov    $0xf23fa0,%edx
call   1050 <fwrite@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0xf23fa0,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <writeaudio@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0xf23fa0,%edx
call   1050 <fwrite@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @calloc(i32 1, i32 15876000)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @writeaudio(i8* %8)
%10 = load i8*, i8** %6
%11 = load i32, i32* @stdout
%12 = call i32 @fwrite(i8* %10, i32 1, i32 15876000, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(15876000) i8* @calloc(i32 1, i32 15876000)
%4 = tail call i32 @writeaudio(i8* %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fwrite(i8* %3, i32 1, i32 15876000, i32 %5)
ret i32 0
}
/* Variables and functions */
double strtod(char const *, char **);
int ParseDouble(const char *s, const char **s_end, void *out) {
  *((double *)out) = strtod(s, (char **)s_end);
  return *s_end != s;
}


x86 assembly (clang, -O0):
<ParseDouble>:
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   1030 <strtod@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseDouble>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strtod@plt>
movsd  %xmm0,(%r14)
xor    %eax,%eax
cmp    %rbx,(%r15)
setne  %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ParseDouble(i8* %0, i8** %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = call double @strtod(i8* %7, i8** %8)
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to double*
store double %9, double* %11
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = load i8*, i8** %4
%15 = icmp ne i8* %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @ParseDouble(i8* %0, i8** nocapture %1, i8* nocapture writeonly %2) {
%4 = tail call double @strtod(i8* %0, i8** %1)
%5 = bitcast i8* %2 to double*
store double %4, double* %5
%6 = load i8*, i8** %1
%7 = icmp ne i8* %6, %0
%8 = zext i1 %7 to i32
ret i32 %8
}
int sysc() { asm("int $0x80" ::"a"(20)); }


x86 assembly (clang, -O0):
<sysc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%eax
int    $0x80
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysc>:
mov    $0x14,%eax
int    $0x80
ret

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

LLVM IR (-O2):
define i32 @sysc() {
tail call void asm sideeffect "int $$0x80", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 20)
ret i32 undef
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int ntohl(int);
int64_t ntoh64(int64_t val) {
  int64_t high, low;
  low = (int64_t)(val & 0x00000000FFFFFFFF);
  val >>= 32;
  high = (int64_t)(val & 0x00000000FFFFFFFF);
  low = ntohl(low);
  high = ntohl(high);
  return (int64_t)low << 32 | high;
}


x86 assembly (clang, -O0):
<ntoh64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ntohl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ntohl@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntoh64>:
push   %rax
call   1030 <ntohl@plt>
pop    %rax
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @ntoh64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, -1
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = ashr i32 %7, 32
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, -1
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @ntohl(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = call i32 @ntohl(i32 %13)
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = shl i32 %15, 32
%17 = load i32, i32* %3
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @ntoh64(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
%3 = tail call i32 @ntohl(i32 poison)
ret i32 poison
}
/* Variables and functions */
int mm_support();
extern int mmx_ok(void) { return (mm_support() & 0x1); }


x86 assembly (clang, -O0):
<mmx_ok>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mm_support@plt>
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmx_ok>:
push   %rax
xor    %eax,%eax
call   1030 <mm_support@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mmx_ok() {
%1 = call i32 (...) @mm_support()
%2 = and i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @mmx_ok() {
%1 = tail call i32 (...) @mm_support()
%2 = and i32 %1, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ z_stream;

/* Variables and functions */
int /*<<< orphan*/ Z_SYNC_FLUSH;
int deflate(int /*<<< orphan*/ *, int /*<<< orphan*/);
int streaming_commons_call_deflate_flush(z_stream *stream) {
  return deflate(stream, Z_SYNC_FLUSH);
}


x86 assembly (clang, -O0):
<streaming_commons_call_deflate_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <deflate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streaming_commons_call_deflate_flush>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <deflate@plt>

LLVM IR (-O0):
@Z_SYNC_FLUSH = global i32 0
define i32 @streaming_commons_call_deflate_flush(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @Z_SYNC_FLUSH
%5 = call i32 @deflate(i32* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@Z_SYNC_FLUSH = global i32 0
define i32 @streaming_commons_call_deflate_flush(i32* %0) {
%2 = load i32, i32* @Z_SYNC_FLUSH
%3 = tail call i32 @deflate(i32* %0, i32 %2)
ret i32 %3
}
unsigned int hash_value_def(const void *key) {
  unsigned int hash = 1315423911;
  hash ^= ((hash << 5) + (unsigned int)key + (hash >> 2));
  return (hash & 0xFFFFFFF);
}


x86 assembly (clang, -O0):
<hash_value_def>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x4e67c6a7,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_value_def>:
lea    0x92c689(%rdi),%eax
and    $0xfffffff,%eax
xor    $0xe67c6a7,%eax
ret

LLVM IR (-O0):
define i32 @hash_value_def(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1315423911, i32* %3
%4 = load i32, i32* %3
%5 = shl i32 %4, 5
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i32
%8 = add i32 %5, %7
%9 = load i32, i32* %3
%10 = lshr i32 %9, 2
%11 = add i32 %8, %10
%12 = load i32, i32* %3
%13 = xor i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = and i32 %14, 268435455
ret i32 %15
}

LLVM IR (-O2):
define i32 @hash_value_def(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 9619081
%5 = and i32 %4, 268435455
%6 = xor i32 %5, 241682087
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ write(int, char *, int);
void *safe_malloc(size_t size) {
  void *ptr;
  if (!(ptr = malloc(size))) {
    write(1, "Malloc failed. Exit.\n", 21);
    exit(EXIT_FAILURE);
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1177 <safe_malloc+0x47>
mov    $0x1,%edi
lea    0xea1(%rip),%rsi
mov    $0x15,%edx
call   1030 <write@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <safe_malloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rsi
mov    $0x1,%edi
mov    $0x15,%edx
call   1030 <write@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Malloc failed. Exit.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = call i32 @write(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 21)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [22 x i8] c"Malloc failed. Exit.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 21)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printBase(int, int);
void printDec(int value) { printBase(value, 10); }


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

x86 assembly (clang, -O2):
<printDec>:
mov    $0xa,%esi
jmp    1030 <printBase@plt>

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

LLVM IR (-O2):
define void @printDec(i32 %0) {
%2 = tail call i32 @printBase(i32 %0, i32 10)
ret void
}