xunge/DecIR huggingface dataset:
void setPin(const unsigned int port, const unsigned int pin) {
  const unsigned int bits = 0x00000001 << pin;
  switch (port) {
  case 0:
    (*((volatile unsigned int *const)(0x40040000 + 0x0004))) = bits;
    break;
  case 1:
    (*((volatile unsigned int *const)(0x40040100 + 0x0004))) = bits;
    break;
  case 2:
    (*((volatile unsigned int *const)(0x40040200 + 0x0004))) = bits;
    break;
  }
}


x86 assembly (clang, -O0):
<setPin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%cl
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     114c <setPin+0x4c>
jmp    112a <setPin+0x2a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     115b <setPin+0x5b>
jmp    113b <setPin+0x3b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     116a <setPin+0x6a>
jmp    1174 <setPin+0x74>
mov    -0xc(%rbp),%ecx
mov    $0x40040004,%eax
mov    %ecx,(%rax)
jmp    1174 <setPin+0x74>
mov    -0xc(%rbp),%ecx
mov    $0x40040104,%eax
mov    %ecx,(%rax)
jmp    1174 <setPin+0x74>
mov    -0xc(%rbp),%ecx
mov    $0x40040204,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPin>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
test   %edi,%edi
je     111e <setPin+0x1e>
cmp    $0x2,%edi
je     1125 <setPin+0x25>
cmp    $0x1,%edi
jne    112c <setPin+0x2c>
mov    $0x40040104,%ecx
jmp    112a <setPin+0x2a>
mov    $0x40040004,%ecx
jmp    112a <setPin+0x2a>
mov    $0x40040204,%ecx
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @setPin(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 1, %6
store i32 %7, i32* %5
%8 = load i32, i32* %3
switch i32 %8, label %15 [
i32 0, label %9
i32 1, label %11
i32 2, label %13
]
9: ; preds = %2
%10 = load i32, i32* %5
store volatile i32 %10, i32* inttoptr (i64 1074003972 to i32*)
br label %15
11: ; preds = %2
%12 = load i32, i32* %5
store volatile i32 %12, i32* inttoptr (i64 1074004228 to i32*)
br label %15
13: ; preds = %2
%14 = load i32, i32* %5
store volatile i32 %14, i32* inttoptr (i64 1074004484 to i32*)
br label %15
15: ; preds = %2, %13, %11, %9
ret void
}

LLVM IR (-O2):
define void @setPin(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
switch i32 %0, label %8 [
i32 0, label %6
i32 1, label %4
i32 2, label %5
]
4: ; preds = %2
br label %6
5: ; preds = %2
br label %6
6: ; preds = %2, %4, %5
%7 = phi i32* [ inttoptr (i64 1074004484 to i32*), %5 ], [ inttoptr (i64 1074004228 to i32*), %4 ], [ inttoptr (i64 1074003972 to i32*), %2 ]
store volatile i32 %3, i32* %7
br label %8
8: ; preds = %6, %2
ret void
}
void hisi_irqaffinity_status(void) { return; }


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

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

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

LLVM IR (-O2):
define void @hisi_irqaffinity_status() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int err = 0, err2 = 0;
  printf("This is"
         "ver 0");
  error(err2);
  error(err);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"This isver 0\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @error(i32 0)
%3 = tail call i32 @error(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void sig_int(int what) {
  printf("We have received SIGINT: Will sleep for 2 seconds and continue\n");
  sleep(2);
  printf(" done sleeping 2 seconds\n");
}


x86 assembly (clang, -O0):
<sig_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_int>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xf01(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"We have received SIGINT: Will sleep for 2 seconds and continue\0A\00"
@.str.1 = [26 x i8] c" done sleeping 2 seconds\0A\00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"We have received SIGINT: Will sleep for 2 seconds and continue\00"
@str.2 = [25 x i8] c" done sleeping 2 seconds\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
ret void
}
void Lut_Lut2XYZ(double *out, double *in) {
  out[0] = in[0] * (1.0 + 32767.0 / 32768);
  out[1] = in[1] * (1.0 + 32767.0 / 32768);
  out[2] = in[2] * (1.0 + 32767.0 / 32768);
}


x86 assembly (clang, -O0):
<Lut_Lut2XYZ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xee8(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xed0(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xeb6(%rip),%xmm0
mulsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lut_Lut2XYZ>:
movsd  0xef8(%rip),%xmm0
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movsd  0x8(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rdi)
mulsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @Lut_Lut2XYZ(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fmul double %7, 0x3FFFFFE000000000
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
store double %8, double* %10
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fmul double %13, 0x3FFFFFE000000000
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
store double %14, double* %16
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = fmul double %19, 0x3FFFFFE000000000
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 2
store double %20, double* %22
ret void
}

LLVM IR (-O2):
define void @Lut_Lut2XYZ(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fmul double %3, 0x3FFFFFE000000000
store double %4, double* %0
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = fmul double %6, 0x3FFFFFE000000000
%8 = getelementptr inbounds double, double* %0, i64 1
store double %7, double* %8
%9 = getelementptr inbounds double, double* %1, i64 2
%10 = load double, double* %9
%11 = fmul double %10, 0x3FFFFFE000000000
%12 = getelementptr inbounds double, double* %0, i64 2
store double %11, double* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ library_func2();
int foo(void) {
  library_func2();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 (...) @library_func2()
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @library_func2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ find_sum(int, int *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int size_of_fact(int);
int main() {
  int size = size_of_fact(100);
  printf("The number of digits in 100! are %d\n", size);
  int *fact = (int *)malloc(size * sizeof(int));
  find_sum(100, fact, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1050 <size_of_fact@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    $0x64,%edi
call   1060 <find_sum@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1050 <size_of_fact@plt>
mov    %eax,%ebx
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    $0x64,%edi
mov    %rax,%rsi
mov    %ebx,%edx
call   1060 <find_sum@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"The number of digits in 100! are %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 @size_of_fact(i32 100)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %3
%13 = load i32*, i32** %3
%14 = load i32, i32* %2
%15 = call i32 @find_sum(i32 100, i32* %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"The number of digits in 100! are %d\0A\00"
define i32 @main() {
%1 = tail call i32 @size_of_fact(i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = shl i32 %1, 2
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @find_sum(i32 100, i32* %5, i32 %1)
ret i32 0
}
/* Variables and functions */
int write(int, char *, int);
char writeSerialPort(int fd, char *buffer, int count) {
  int res = 0;
  if ((res = write(fd, buffer, count)) < 0)
    ;
  return (res);
}


x86 assembly (clang, -O0):
<writeSerialPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1149 <writeSerialPort+0x39>
jmp    1149 <writeSerialPort+0x39>
mov    -0x18(%rbp),%eax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeSerialPort>:
push   %rax
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @writeSerialPort(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %3
br label %14
14: ; preds = %13, %3
%15 = load i32, i32* %7
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @writeSerialPort(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = trunc i32 %4 to i8
ret i8 %5
}
unsigned long __ffs(unsigned long word) {
  asm("rep; bsf %1,%0" : "=r"(word) : "rm"(word));
  return word;
}


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

x86 assembly (clang, -O2):
<__ffs>:
mov    %rdi,-0x8(%rsp)
tzcnt  -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @__ffs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 asm "rep; bsf $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
define i64 @__ffs(i64 %0) {
%2 = tail call i64 asm "rep; bsf $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void Feedback(FILE *out, char *prefix, char *string, va_list arg,
              char *suffix) {
  fprintf(out, "%s", prefix);
  vfprintf(out, string, arg);
  fprintf(out, "%s", suffix);
}


x86 assembly (clang, -O0):
<Feedback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <vfprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Feedback>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %ecx,%r15d
mov    %rdx,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
mov    %rbp,%rsi
call   1030 <fputs@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1040 <vfprintf@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @Feedback(i32* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32*, i32** %6
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = call i32 @vfprintf(i32* %14, i8* %15, i32 %16)
%18 = load i32*, i32** %6
%19 = load i8*, i8** %10
%20 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %19)
ret void
}

LLVM IR (-O2):
define void @Feedback(i32* nocapture %0, i8* nocapture %1, i8* nocapture %2, i32 %3, i8* nocapture %4) {
%6 = tail call i32 @fputs(i8* %1, i32* %0)
%7 = tail call i32 @vfprintf(i32* %0, i8* %2, i32 %3)
%8 = tail call i32 @fputs(i8* %4, i32* %0)
ret void
}
int get_rx_data() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_rx_data() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int os_perf_callchain_start(pid_t pid __attribute__((unused)),
                            int lwpid __attribute__((unused))) {
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @os_perf_callchain_start(i32 %0, i32 %1) {
ret i32 0
}
short int isLowerRegularLetter(char chrsource) {
  if ((chrsource >= 97) && (chrsource <= 122))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isLowerRegularLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
cmp    $0x61,%eax
jl     112f <isLowerRegularLetter+0x2f>
movsbl -0x3(%rbp),%eax
cmp    $0x7a,%eax
jg     112f <isLowerRegularLetter+0x2f>
movw   $0x1,-0x2(%rbp)
jmp    1135 <isLowerRegularLetter+0x35>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @isLowerRegularLetter(i8 signext %0) {
%2 = alloca i16
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %12
11: ; preds = %7
store i16 1, i16* %2
br label %13
12: ; preds = %7, %1
store i16 0, i16* %2
br label %13
13: ; preds = %12, %11
%14 = load i16, i16* %2
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @isLowerRegularLetter(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i16
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x = 12;
  printf("value:   %d \n", x);
  printf("address: %p \n", &x);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xc,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"value: %d \0A\00"
@.str.1 = [14 x i8] c"address: %p \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 12, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 12)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void PRINT_USAGE(char *p) {
  fprintf(stderr, "Usage:\t%s [options] input-file [output-file]\n", (p));
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Usage:\09%s [options] input-file [output-file]\0A\00"
define void @PRINT_USAGE(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Usage:\09%s [options] input-file [output-file]\0A\00"
define void @PRINT_USAGE(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void dbg_dump_budg(struct ubifs_info *c) { return; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define void @dbg_dump_budg(%struct.ubifs_info* nocapture %0) {
ret void
}
void vec4_copy(float *dst, float *a) {
  dst[0] = a[0];
  dst[1] = a[1];
  dst[2] = a[2];
  dst[3] = a[3];
}


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

x86 assembly (clang, -O2):
<vec4_copy>:
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
movss  %xmm0,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @vec4_copy(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 2
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 3
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %0, i64 3
store float %11, float* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
char *malloc(int);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ stderr;
int main(void) {
  char *ptr;
  int nb_blocs = 0;
  while (1) {
    ptr = malloc(1024 * 1024);
    if (ptr == NULL)
      break;
    nb_blocs++;
  }
  fprintf(stderr, "Allocation de %d Mo... Ok\n", nb_blocs);
  pause();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x100000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <main+0x34>
jmp    1172 <main+0x42>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <main+0x16>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xe7b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <pause@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Allocation de %d Mo... Ok\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %0, %9
%5 = call i8* @malloc(i32 1048576)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %4
br label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %8
%13 = load i32, i32* @stderr
%14 = load i32, i32* %3
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = call i32 (...) @pause()
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
unsigned xrop3_56_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D | T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_56_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_56_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
lea    (%rsi,%rax,1),%edx
or     $0xff,%eax
and    %ecx,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_56_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_56_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = or i32 %6, 255
%9 = and i32 %8, %4
%10 = xor i32 %9, %7
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ strcmp(char *, char const *);
char *string_change_case(char const *);
int test_string_change_case(const char *input, const char *expected_output) {
  char *output = string_change_case(input);
  int result = strcmp(output, expected_output) == 0;
  free(output);
  return result;
}


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

x86 assembly (clang, -O2):
<test_string_change_case>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
call   1050 <string_change_case@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test_string_change_case(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @string_change_case(i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %4
%11 = call i64 @strcmp(i8* %9, i8* %10)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %6
%14 = load i8*, i8** %5
%15 = call i32 @free(i8* %14)
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_string_change_case(i8* %0, i8* %1) {
%3 = tail call i8* @string_change_case(i8* %0)
%4 = tail call i64 @strcmp(i8* %3, i8* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @free(i8* %3)
ret i32 %6
}
OP(ed, c6) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @terminate_work() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void SeedRandomNumberGenerator() { srand((unsigned int)time(NULL)); }


x86 assembly (clang, -O0):
<SeedRandomNumberGenerator>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SeedRandomNumberGenerator>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @SeedRandomNumberGenerator() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @SeedRandomNumberGenerator() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
/* Type definitions */
typedef char *uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint64_t rdpmc(void) {
  union {
    uint64_t val;
    struct {
      uint32_t lo_32;
      uint32_t hi_32;
    };
  } tsc;
  asm volatile("rdtsc"
               : "=a"(tsc.lo_32), "=d"(tsc.hi_32)
               : "c"(0xFA)
               : "memory");
  return tsc.val;
}


x86 assembly (clang, -O0):
<rdpmc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfa,%ecx
rdtsc
mov    %eax,-0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdpmc>:
mov    $0xfa,%ecx
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
%union.anon = type { i8* }
%struct.anon = type { i32, i32 }
define i8* @rdpmc() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to %struct.anon*
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%4 = bitcast %union.anon* %1 to %struct.anon*
%5 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 1
%6 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 250)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %5
%9 = bitcast %union.anon* %1 to i8**
%10 = load i8*, i8** %9
ret i8* %10
}

LLVM IR (-O2):
define i8* @rdpmc() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 250)
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
/* Type definitions */
struct abuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct abuf *);
void a_free(struct abuf *a) {
  free(a);
  return;
}


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

x86 assembly (clang, -O2):
<a_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.abuf = type { i32 }
define void @a_free(%struct.abuf* nocapture %0) {
%2 = tail call i32 @free(%struct.abuf* %0)
ret void
}
int find_sm_depth(int row, int len) {
  if (row < (15)) {
    return row;
  }
  if (len - (row + 1) < (15)) {
    return (((15) * 2) - (len - (row + 1)));
  }
  return (15);
}


x86 assembly (clang, -O0):
<find_sm_depth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xf,-0x8(%rbp)
jge    111f <find_sm_depth+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <find_sm_depth+0x54>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    %ecx,%eax
cmp    $0xf,%eax
jge    114d <find_sm_depth+0x4d>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sub    %eax,%ecx
mov    $0x1e,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <find_sm_depth+0x54>
movl   $0xf,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_sm_depth>:
mov    %edi,%eax
cmp    $0xf,%edi
jl     111d <find_sm_depth+0x1d>
not    %eax
add    %esi,%eax
mov    $0x1e,%ecx
sub    %eax,%ecx
cmp    $0xf,%eax
mov    $0xf,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @find_sm_depth(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 15
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %23
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
%14 = sub nsw i32 %11, %13
%15 = icmp slt i32 %14, 15
br i1 %15, label %16, label %22
16: ; preds = %10
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
%20 = sub nsw i32 %17, %19
%21 = sub nsw i32 30, %20
store i32 %21, i32* %3
br label %23
22: ; preds = %10
store i32 15, i32* %3
br label %23
23: ; preds = %22, %16, %8
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @find_sm_depth(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 15
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = xor i32 %0, -1
%6 = add i32 %5, %1
%7 = icmp slt i32 %6, 15
%8 = sub nsw i32 30, %6
%9 = select i1 %7, i32 %8, i32 15
br label %10
10: ; preds = %4, %2
%11 = phi i32 [ %0, %2 ], [ %9, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int vchis, kr;
  scanf("\n%d", &vchis);
  kr = vchis * vchis;
  printf("\n%d", kr);
  kr = kr * vchis;
  printf("\n%d", kr);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
imul   %ebp,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
imul   0x4(%rsp),%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %5
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
float _sub_cost_1(const char *str1, const int str1_idx, const char *str2,
                  const int str2_idx) {
  if (str1[str1_idx] == str2[str2_idx])
    return ((float)0);
  else
    return ((float)1);
}


x86 assembly (clang, -O0):
<_sub_cost_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
movslq -0x24(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    113f <_sub_cost_1+0x3f>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    114c <_sub_cost_1+0x4c>
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sub_cost_1>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%al
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
cmp    (%rdx,%rcx,1),%al
je     1119 <_sub_cost_1+0x19>
movss  0xee7(%rip),%xmm0
ret

LLVM IR (-O0):
define float @_sub_cost_1(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca float
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8*, i8** %8
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %15, %21
br i1 %22, label %23, label %24
23: ; preds = %4
store float 0.000000e+00, float* %5
br label %25
24: ; preds = %4
store float 1.000000e+00, float* %5
br label %25
25: ; preds = %24, %23
%26 = load float, float* %5
ret float %26
}

LLVM IR (-O2):
define float @_sub_cost_1(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* %2, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %7, %10
%12 = select i1 %11, float 0.000000e+00, float 1.000000e+00
ret float %12
}
int compare(const void *first, const void *second) {
  int a = *(int *)first;
  int b = *(int *)second;
  return a - b;
}


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

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

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ avgs;

/* Variables and functions */
int getloadavg(double *, int);
double ttgetloadavg(void) {
  double avgs[3];
  int anum = getloadavg(avgs, sizeof(avgs) / sizeof(*avgs));
  if (anum < 1)
    return 0.0;
  return anum == 1 ? avgs[0] : avgs[1];
}


x86 assembly (clang, -O0):
<ttgetloadavg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
mov    $0x3,%esi
call   1030 <getloadavg@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x1,-0x24(%rbp)
jge    1140 <ttgetloadavg+0x30>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116d <ttgetloadavg+0x5d>
cmpl   $0x1,-0x24(%rbp)
jne    1159 <ttgetloadavg+0x49>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1163 <ttgetloadavg+0x53>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttgetloadavg>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <getloadavg@plt>
lea    0x8(%rsp),%rcx
xorps  %xmm0,%xmm0
cmp    $0x1,%eax
cmove  %rbx,%rcx
jl     113a <ttgetloadavg+0x2a>
movsd  (%rcx),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @ttgetloadavg() {
%1 = alloca double
%2 = alloca [3 x double]
%3 = alloca i32
%4 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%5 = call i32 @getloadavg(double* %4, i32 3)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %0
store double 0.000000e+00, double* %1
br label %20
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%14 = load double, double* %13
br label %18
15: ; preds = %9
%16 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
%17 = load double, double* %16
br label %18
18: ; preds = %15, %12
%19 = phi double [ %14, %12 ], [ %17, %15 ]
store double %19, double* %1
br label %20
20: ; preds = %18, %8
%21 = load double, double* %1
ret double %21
}

LLVM IR (-O2):
define double @ttgetloadavg() {
%1 = alloca [3 x double]
%2 = bitcast [3 x double]* %1 to i8*
%3 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%4 = call i32 @getloadavg(double* %3, i32 3)
%5 = icmp slt i32 %4, 1
%6 = icmp eq i32 %4, 1
%7 = load double, double* %3
%8 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%9 = load double, double* %8
%10 = select i1 %6, double %7, double %9
%11 = select i1 %5, double 0.000000e+00, double %10
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stdout;
FILE *get_output(void) { return stdout; }


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

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

LLVM IR (-O0):
@stdout = global i32* null
define i32* @get_output() {
%1 = load i32*, i32** @stdout
ret i32* %1
}

LLVM IR (-O2):
@stdout = global i32* null
define i32* @get_output() {
%1 = load i32*, i32** @stdout
ret i32* %1
}
long long cpucycles_x86cpuinfo(void) {
  long long result;
  asm volatile(".byte 15;.byte 49" : "=A"(result));
  return result;
}


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

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

LLVM IR (-O0):
define i64 @cpucycles_x86cpuinfo() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 15;.byte 49", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @cpucycles_x86cpuinfo() {
%1 = tail call i64 asm sideeffect ".byte 15;.byte 49", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void __VERIFIER_assume(int expression) {
  if (!expression) {
    fprintf(stderr, "__VERIFIER_assume(): Assumption not met. Exiting\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<__VERIFIER_assume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1151 <__VERIFIER_assume+0x31>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_assume>:
test   %edi,%edi
je     1125 <__VERIFIER_assume+0x5>
ret
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"__VERIFIER_assume(): Assumption not met. Exiting\0A\00"
define void @__VERIFIER_assume(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"__VERIFIER_assume(): Assumption not met. Exiting\0A\00"
define void @__VERIFIER_assume(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}