xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ myprintf(char *, ...);
main() {
  int v = 5;
  myprintf("vector:%djik\n", v);
  myprintf("dfufhdufhd\n");
  myprintf("%s", "fahad");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <myprintf@plt>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <myprintf@plt>
lea    0xed5(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <myprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <myprintf@plt>
lea    0xee3(%rip),%rdi
xor    %eax,%eax
call   1030 <myprintf@plt>
lea    0xee1(%rip),%rdi
lea    0xedd(%rip),%rsi
xor    %eax,%eax
call   1030 <myprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"vector:%djik\0A\00"
@.str.1 = [12 x i8] c"dfufhdufhd\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [6 x i8] c"fahad\00"
define i32 @main() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* %1
%3 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"vector:%djik\0A\00"
@.str.1 = [12 x i8] c"dfufhdufhd\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [6 x i8] c"fahad\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double length_of_3vector(double *r) {
  return sqrt(r[0] * r[0] + r[1] * r[1] + r[2] * r[2]);
}


x86 assembly (clang, -O0):
<length_of_3vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<length_of_3vector>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <length_of_3vector+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @length_of_3vector(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @sqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @length_of_3vector(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
void pmu_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @pmu_iomux_config() {
ret void
}
/* Variables and functions */
int PAPI_accum_counters(long long *, int);
void papif_accum_counters(long long *values, int *array_len, int *check) {
  *check = PAPI_accum_counters(values, *array_len);
}


x86 assembly (clang, -O0):
<papif_accum_counters>:
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),%rax
mov    (%rax),%esi
call   1030 <PAPI_accum_counters@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_accum_counters>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%esi
call   1030 <PAPI_accum_counters@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_accum_counters(i64* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @PAPI_accum_counters(i64* %0, i32 %4)
store i32 %5, i32* %2
ret void
}
int mul(int f, int s) { return (f * s); }


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

x86 assembly (clang, -O2):
<mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
int ft_isascii(int c) {
  if (c <= 127 && c >= 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jg     1127 <ft_isascii+0x27>
cmpl   $0x0,-0x8(%rbp)
jl     1127 <ft_isascii+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isascii+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\nUsage: cssrc2html [-options] filename"
         "\noptions:"
         "\n  -tn  set tab spacing to n (default 4)"
         "\n  -v   display version number and exit"
         "\n  -h or -? display this help message and exit"
         "\n\n");
}


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

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

LLVM IR (-O0):
@.str = [175 x i8] c"\0AUsage: cssrc2html [-options] filename\0Aoptions:\0A -tn set tab spacing to n (default 4)\0A -v display version number and exit\0A -h or -? display this help message and exit\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [174 x i8] c"\0AUsage: cssrc2html [-options] filename\0Aoptions:\0A -tn set tab spacing to n (default 4)\0A -v display version number and exit\0A -h or -? display this help message and exit\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([174 x i8], [174 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void st_u16_le(void *x, uint16_t u) {
  ((((uint8_t *)x)[1]) = ((u) >> 8) % 256, (((uint8_t *)x)[0]) = ((u) % 256));
}


x86 assembly (clang, -O0):
<st_u16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,0x4(%rax)
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_u16_le>:
mov    %esi,%eax
sar    $0x8,%eax
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
lea    0xff(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
mov    %eax,0x4(%rdi)
and    $0xffffff00,%ecx
sub    %ecx,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @st_u16_le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = srem i32 %6, 256
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 1
store i32 %7, i32* %10
%11 = load i32, i32* %4
%12 = srem i32 %11, 256
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 %12, i32* %15
ret void
}

LLVM IR (-O2):
define void @st_u16_le(i8* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = srem i32 %3, 256
%5 = bitcast i8* %0 to i32*
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = bitcast i8* %6 to i32*
store i32 %4, i32* %7
%8 = srem i32 %1, 256
store i32 %8, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, char *);
void test_memcpy_nowarn(char *d) { memcpy(d, d + 2, ""); }


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

x86 assembly (clang, -O2):
<test_memcpy_nowarn>:
lea    0x2(%rdi),%rsi
lea    0xee5(%rip),%rdx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @test_memcpy_nowarn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 2
%6 = call i32 @memcpy(i8* %3, i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @test_memcpy_nowarn(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = tail call i32 @memcpy(i8* %0, i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lenum(int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ verificamaior(int, int, int *);
main() {
  int num1, num2, maior;
  lenum(&num1);
  lenum(&num2);
  verificamaior(num1, num2, &maior);
  printf("Maior numero e: %d", maior);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <lenum@plt>
lea    -0x8(%rbp),%rdi
call   1040 <lenum@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdx
call   1050 <verificamaior@plt>
mov    -0xc(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rdi
call   1040 <lenum@plt>
lea    0x10(%rsp),%rdi
call   1040 <lenum@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
lea    0xc(%rsp),%rdx
call   1050 <verificamaior@plt>
mov    0xc(%rsp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Maior numero e: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @lenum(i32* %1)
%5 = call i32 @lenum(i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @verificamaior(i32 %6, i32 %7, i32* %3)
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Maior numero e: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @lenum(i32* %1)
%8 = call i32 @lenum(i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @verificamaior(i32 %9, i32 %10, i32* %3)
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}
void blow_up(int unused) {
  char *message = "rad days";
  *message = 's';
}


x86 assembly (clang, -O0):
<blow_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x73,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"rad days\00"
define void @blow_up(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
store i8 115, i8* %4
ret void
}

LLVM IR (-O2):
define void @blow_up(i32 %0) {
ret void
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
int xwrite(int, void const *, int);
ssize_t xawrite(int fd, const void *buf, size_t count) {
  int nwritten, remain;
  for (remain = count; remain; remain -= nwritten)
    buf += (nwritten = xwrite(fd, buf, remain));
  return count;
}


x86 assembly (clang, -O0):
<xawrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1166 <xawrite+0x56>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1030 <xwrite@plt>
mov    %eax,%ecx
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
jmp    112a <xawrite+0x1a>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xawrite>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
test   %r14d,%r14d
je     1146 <xawrite+0x36>
mov    %rsi,%rbx
mov    %edi,%r15d
mov    %r14d,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <xwrite@plt>
cltq
add    %rax,%rbx
sub    %eax,%ebp
jne    1130 <xawrite+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @xawrite(i32 %0, i8* %1, i64 returned %2) {
%4 = trunc i64 %2 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %12, %6 ], [ %4, %3 ]
%8 = phi i8* [ %11, %6 ], [ %1, %3 ]
%9 = tail call i32 @xwrite(i32 %0, i8* %8, i32 %7)
%10 = sext i32 %9 to i64
%11 = getelementptr i8, i8* %8, i64 %10
%12 = sub nsw i32 %7, %9
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3
ret i64 %2
}
/* Variables and functions */
double __ocml_add_rtp_f64(double, double);
double __dadd_rd(double x, double y) { return __ocml_add_rtp_f64(x, y); }


x86 assembly (clang, -O0):
<__dadd_rd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__ocml_add_rtp_f64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dadd_rd>:
jmp    1030 <__ocml_add_rtp_f64@plt>

LLVM IR (-O0):
define double @__dadd_rd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__ocml_add_rtp_f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__dadd_rd(double %0, double %1) {
%3 = tail call double @__ocml_add_rtp_f64(double %0, double %1)
ret double %3
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ cmd;
};
typedef TYPE_1__ osd_cmd_t;

/* Variables and functions */
int /*<<< orphan*/ OSD_Query;
int /*<<< orphan*/ OSD_SEND_CMD;
int ioctl(int, int /*<<< orphan*/, TYPE_1__ *);
int OSDQuery(int dev) {
  osd_cmd_t dc;
  dc.cmd = OSD_Query;
  return ioctl(dev, OSD_SEND_CMD, &dc);
}


x86 assembly (clang, -O0):
<OSDQuery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSDQuery>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@OSD_Query = global i32 0
@OSD_SEND_CMD = global i32 0
define i32 @OSDQuery(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.TYPE_3__
store i32 %0, i32* %2
%4 = load i32, i32* @OSD_Query
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* @OSD_SEND_CMD
%8 = call i32 @ioctl(i32 %6, i32 %7, %struct.TYPE_3__* %3)
ret i32 %8
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@OSD_Query = global i32 0
@OSD_SEND_CMD = global i32 0
define i32 @OSDQuery(i32 %0) {
%2 = alloca %struct.TYPE_3__
%3 = bitcast %struct.TYPE_3__* %2 to i8*
%4 = load i32, i32* @OSD_Query
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @OSD_SEND_CMD
%7 = call i32 @ioctl(i32 %0, i32 %6, %struct.TYPE_3__* %2)
ret i32 %7
}
void TOP_LEVEL_usecases_gmm_Qtimesv_test_d(int unitVar0, int unitVar0_d) {
  return;
}


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

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

LLVM IR (-O0):
define void @TOP_LEVEL_usecases_gmm_Qtimesv_test_d(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @TOP_LEVEL_usecases_gmm_Qtimesv_test_d(i32 %0, i32 %1) {
ret void
}
int kvmppc_spapr_enable_inkernel_multitce(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @kvmppc_spapr_enable_inkernel_multitce() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @kvmppc_spapr_enable_inkernel_multitce() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void callback(double *x, size_t xlen) {
  size_t i;
  for (i = 0; i < xlen; i++) {
    printf("%.2f ", x[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1162 <callback+0x52>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <callback+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1159 <callback+0x39>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <callback+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.2f \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @callback(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds double, double* %11, i64 %12
%14 = load double, double* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f \00"
define void @callback(double* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = load double, double* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void DisplayUsage() {
  printf("=============== WAV2BGM ===============\n");
  printf("Converts a mono WAV file to BGM format.\n\n======\n");
  printf("Usage:\n======\nwav2bgm \"yourwavfile.wav\" \"yourbgmfile.bgm\"\n");
}


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

x86 assembly (clang, -O2):
<DisplayUsage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
lea    0xf28(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"=============== WAV2BGM ===============\0A\00"
@.str.1 = [49 x i8] c"Converts a mono WAV file to BGM format.\0A\0A======\0A\00"
@.str.2 = [59 x i8] c"Usage:\0A======\0Awav2bgm \22yourwavfile.wav\22 \22yourbgmfile.bgm\22\0A\00"
define void @DisplayUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"=============== WAV2BGM ===============\00"
@str.3 = [48 x i8] c"Converts a mono WAV file to BGM format.\0A\0A======\00"
@str.4 = [58 x i8] c"Usage:\0A======\0Awav2bgm \22yourwavfile.wav\22 \22yourbgmfile.bgm\22\00"
define void @DisplayUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lex(char *);
int main() {
  char *mystr1 = "select mycol1, mycol2 from mytable where mycol1 <= 10;";
  lex(mystr1);
  char *mystr2 = "select mycol1, mycol2 from mytable where city = \"Sydney\";";
  lex(mystr2);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"select mycol1, mycol2 from mytable where mycol1 <= 10;\00"
@.str.1 = [58 x i8] c"select mycol1, mycol2 from mytable where city = \22Sydney\22;\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @lex(i8* %4)
store i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @lex(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"select mycol1, mycol2 from mytable where mycol1 <= 10;\00"
@.str.1 = [58 x i8] c"select mycol1, mycol2 from mytable where city = \22Sydney\22;\00"
define i32 @main() {
%1 = tail call i32 @lex(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @lex(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
unsigned int nul_byte_index_l32(unsigned int mask) {
  int32_t a;
  mask = (mask - 1) & ~mask;
  mask >>= 7;
  a = 0x0ff4000 + mask;
  a >>= 23;
  return a & mask;
}


x86 assembly (clang, -O0):
<nul_byte_index_l32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x7,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xff4000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x17,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nul_byte_index_l32>:
lea    -0x1(%rdi),%ecx
not    %edi
and    %edi,%ecx
shr    $0x7,%ecx
lea    0xff4000(%rcx),%eax
shr    $0x17,%eax
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @nul_byte_index_l32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = load i32, i32* %2
%7 = xor i32 %6, -1
%8 = and i32 %5, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 7
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = add i32 16728064, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = ashr i32 %13, 23
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = and i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @nul_byte_index_l32(i32 %0) {
%2 = add i32 %0, -1
%3 = xor i32 %0, -1
%4 = and i32 %2, %3
%5 = lshr i32 %4, 7
%6 = add nuw nsw i32 %5, 16728064
%7 = lshr i32 %6, 23
%8 = and i32 %7, %5
ret i32 %8
}
/* Variables and functions */
char *doubleToString(int /*<<< orphan*/);
int /*<<< orphan*/ parseNum(char *, int);
int /*<<< orphan*/ pow(int /*<<< orphan*/, int /*<<< orphan*/);
char *wum_exp(char *a, char *b) {
  return doubleToString((pow(parseNum(a, 10), parseNum(b, 10))));
}


x86 assembly (clang, -O0):
<wum_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <parseNum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <parseNum@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <pow@plt>
mov    %eax,%edi
call   1050 <doubleToString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wum_exp>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    $0xa,%esi
call   1030 <parseNum@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <parseNum@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <pow@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <doubleToString@plt>

LLVM IR (-O0):
define i8* @wum_exp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @parseNum(i8* %5, i32 10)
%7 = load i8*, i8** %4
%8 = call i32 @parseNum(i8* %7, i32 10)
%9 = call i32 @pow(i32 %6, i32 %8)
%10 = call i8* @doubleToString(i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @wum_exp(i8* %0, i8* %1) {
%3 = tail call i32 @parseNum(i8* %0, i32 10)
%4 = tail call i32 @parseNum(i8* %1, i32 10)
%5 = tail call i32 @pow(i32 %3, i32 %4)
%6 = tail call i8* @doubleToString(i32 %5)
ret i8* %6
}
/* Variables and functions */
int plusandminus(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int n;
  scanf("%d", &n);
  printf("%d\n", plusandminus(n));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @plusandminus(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int cairo_code_draw_casFMLabel_get_height() { return 12; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casFMLabel_get_height() {
ret i32 12
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casFMLabel_get_height() {
ret i32 12
}
void __ipipe_init_threadinfo(struct ipipe_threadinfo *p) {}


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

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

LLVM IR (-O0):
%struct.ipipe_threadinfo = type opaque
define void @__ipipe_init_threadinfo(%struct.ipipe_threadinfo* %0) {
%2 = alloca %struct.ipipe_threadinfo*
store %struct.ipipe_threadinfo* %0, %struct.ipipe_threadinfo** %2
ret void
}

LLVM IR (-O2):
%struct.ipipe_threadinfo = type opaque
define void @__ipipe_init_threadinfo(%struct.ipipe_threadinfo* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 9384;
  do {
    printf("%d ", i);
    i /= 10;
  } while (i > 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x24a8,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x24a8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3aa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5d,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9384)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 938)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 93)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
int main() {
  int j = 1;
  for (int i = 10000; i - j >= 1; i--) {
    j++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2710,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x1,%eax
jl     113f <main+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 10000, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = sub nsw i32 %5, %6
%8 = icmp sge i32 %7, 1
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, -1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %1
ret i32 %16
}

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

/* Variables and functions */
int /*<<< orphan*/ cc_free(struct cc_options *);
void cc_options_free(struct cc_options *options) { cc_free(options); }


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

x86 assembly (clang, -O2):
<cc_options_free>:
jmp    1030 <cc_free@plt>

LLVM IR (-O0):
%struct.cc_options = type { i32 }
define void @cc_options_free(%struct.cc_options* %0) {
%2 = alloca %struct.cc_options*
store %struct.cc_options* %0, %struct.cc_options** %2
%3 = load %struct.cc_options*, %struct.cc_options** %2
%4 = call i32 @cc_free(%struct.cc_options* %3)
ret void
}

LLVM IR (-O2):
%struct.cc_options = type { i32 }
define void @cc_options_free(%struct.cc_options* %0) {
%2 = tail call i32 @cc_free(%struct.cc_options* %0)
ret void
}
const char *rcsid(const char *p) {
  return rcsid(
      p = "@(#)$File: readcdf.c,v 1.18 2009/05/06 20:48:22 christos Exp $");
}


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

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

LLVM IR (-O0):
@.str = [63 x i8] c"@(#)$File: readcdf.c,v 1.18 2009/05/06 20:48:22 christos Exp $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void BandPassSSE(struct BandPassInfo *ip, float *inbuffer, float *outbuffer,
                 unsigned long samples) {}


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

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

LLVM IR (-O0):
%struct.BandPassInfo = type opaque
define void @BandPassSSE(%struct.BandPassInfo* %0, float* %1, float* %2, i64 %3) {
%5 = alloca %struct.BandPassInfo*
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64
store %struct.BandPassInfo* %0, %struct.BandPassInfo** %5
store float* %1, float** %6
store float* %2, float** %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
%struct.BandPassInfo = type opaque
define void @BandPassSSE(%struct.BandPassInfo* nocapture %0, float* nocapture %1, float* nocapture %2, i64 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void HandleKey(int keycode, int bDown) {
  printf("Key: %d %d\n", keycode, bDown);
}


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

x86 assembly (clang, -O2):
<HandleKey>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"Key: %d %d\0A\00"
define void @HandleKey(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
void append_sequence(char *seq, char **aln, int seq_num) {}


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

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

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

LLVM IR (-O2):
define void @append_sequence(i8* nocapture %0, i8** nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
bool nrf51_errata_78(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_78() {
ret i32 0
}
/* Variables and functions */
bool is_leap_year(int year) {
  if (year % 4 == 0) {
    if (year % 400 == 0) {
      return true;
    }
    if (year % 100 == 0) {
      return false;
    }
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <is_leap_year+0x67>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113b <is_leap_year+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    116e <is_leap_year+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115b <is_leap_year+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    116e <is_leap_year+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    116e <is_leap_year+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
jb     1130 <is_leap_year+0x30>
ror    $0x2,%ecx
xor    %eax,%eax
cmp    $0x28f5c29,%ecx
setae  %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = srem i32 %0, 100
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7, %4
%12 = phi i32 [ 1, %4 ], [ %10, %7 ], [ 0, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void c(int *x) {
  printf("halving *x from %d to %d\n", *x, *x / 2);
  *x = *x / 2;
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
mov    %esi,%edx
shr    $0x1f,%edx
add    %esi,%edx
sar    %edx
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    %ecx,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"halving *x from %d to %d\0A\00"
define void @c(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 2
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7)
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 2
%12 = load i32*, i32** %2
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"halving *x from %d to %d\0A\00"
define void @c(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sdiv i32 %2, 2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = load i32, i32* %0
%6 = sdiv i32 %5, 2
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
int /*<<< orphan*/ pr_info(char *);
int myinit(void) {
  pr_info("panic myinit\n");
  panic("hello panic");
  pr_info("panic after\n");
  return 0;
}


x86 assembly (clang, -O0):
<myinit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <pr_info@plt>
lea    0xed7(%rip),%rdi
call   1040 <panic@plt>
lea    0xed7(%rip),%rdi
call   1030 <pr_info@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myinit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <pr_info@plt>
lea    0xeda(%rip),%rdi
call   1040 <panic@plt>
lea    0xeda(%rip),%rdi
call   1030 <pr_info@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"panic myinit\0A\00"
@.str.1 = [12 x i8] c"hello panic\00"
@.str.2 = [13 x i8] c"panic after\0A\00"
define i32 @myinit() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @panic(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @pr_info(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"panic myinit\0A\00"
@.str.1 = [12 x i8] c"hello panic\00"
@.str.2 = [13 x i8] c"panic after\0A\00"
define i32 @myinit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @panic(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @pr_info(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}