xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ halt();
int /*<<< orphan*/ message(char *, int);
void dummyfun(int i) {
  message("Unhandled Exc or Int %d occured!!!\n", i);
  halt();
}


x86 assembly (clang, -O0):
<dummyfun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <message@plt>
mov    $0x0,%al
call   1040 <halt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummyfun>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <message@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <halt@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Unhandled Exc or Int %d occured!!!\0A\00"
define void @dummyfun(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @message(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @halt()
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Unhandled Exc or Int %d occured!!!\0A\00"
define void @dummyfun(i32 %0) {
%2 = tail call i32 @message(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @halt()
ret void
}
void native_runtime_execute(void *addr) {
  void (*cb)(void);
  *(void **)&(cb) = addr;
  cb();
}


x86 assembly (clang, -O0):
<native_runtime_execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_runtime_execute>:
jmp    *%rdi

LLVM IR (-O0):
define void @native_runtime_execute(i8* %0) {
%2 = alloca i8*
%3 = alloca void ()*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast void ()** %3 to i8**
store i8* %4, i8** %5
%6 = load void ()*, void ()** %3
ret void
}

LLVM IR (-O2):
define void @native_runtime_execute(i8* nocapture %0) {
%2 = bitcast i8* %0 to void ()*
tail call void %2()
ret void
}
void x87_checkexceptions() {}


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

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

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

LLVM IR (-O2):
define void @x87_checkexceptions() {
ret void
}
void first_String(_loc, _Base_String) int *_loc, *_Base_String;
{ String_FIRST_FNC_OBJ(_loc, _Base_String); }


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

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

LLVM IR (-O0):
define void @first_String(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 (i32*, i32*, ...) bitcast (i32 (...)* @String_FIRST_FNC_OBJ to i32 (i32*, i32*, ...)*)(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @first_String(i32* %0, i32* %1) {
%3 = tail call i32 (i32*, i32*, ...) bitcast (i32 (...)* @String_FIRST_FNC_OBJ to i32 (i32*, i32*, ...)*)(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int sumOfDigits(int);
int main(void) {
  int n, sum;
  scanf("%d", &n);
  sum = sumOfDigits(n);
  printf("%d\n", sum);
  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 <sumOfDigits@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9f(%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 <sumOfDigits@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
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @sumOfDigits(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
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 @sumOfDigits(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
}
void AddCPU(int *a, int *b, int *c) {
  int tid = 0;
  while (tid < 10)
    c[tid] = a[tid] + b[tid];
  tid += 1;
}


x86 assembly (clang, -O0):
<AddCPU>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    1147 <AddCPU+0x47>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1117 <AddCPU+0x17>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddCPU>:
mov    (%rsi),%eax
add    (%rdi),%eax
mov    %eax,(%rdx)
jmp    1100 <AddCPU>

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

LLVM IR (-O2):
define void @AddCPU(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
br label %4
4: ; preds = %4, %3
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = add nsw i32 %6, %5
store i32 %7, i32* %2
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void unari(void) {
  int n = 12;
  int *pn = &n;
  printf("Unari: %d\n", *pn + 8);
}


x86 assembly (clang, -O0):
<unari>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
add    $0x8,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unari>:
lea    0xee9(%rip),%rdi
mov    $0x14,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Unari: %d\0A\00"
define void @unari() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 20)
ret void
}
void rbuFileSuffix3(const char *zBase, char *z) {}


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

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

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

LLVM IR (-O2):
define void @rbuFileSuffix3(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fdi_s25fl116k_wait_while_busy();
int /*<<< orphan*/ fdi_spi_tx1(int, int);
void fdi_s25fl116k_enable_write(void) {
  fdi_s25fl116k_wait_while_busy();
  fdi_spi_tx1(23, 0x06);
}


x86 assembly (clang, -O0):
<fdi_s25fl116k_enable_write>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fdi_s25fl116k_wait_while_busy@plt>
mov    $0x17,%edi
mov    $0x6,%esi
call   1030 <fdi_spi_tx1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdi_s25fl116k_enable_write>:
push   %rax
xor    %eax,%eax
call   1040 <fdi_s25fl116k_wait_while_busy@plt>
mov    $0x17,%edi
mov    $0x6,%esi
pop    %rax
jmp    1030 <fdi_spi_tx1@plt>

LLVM IR (-O0):
define void @fdi_s25fl116k_enable_write() {
%1 = call i32 (...) @fdi_s25fl116k_wait_while_busy()
%2 = call i32 @fdi_spi_tx1(i32 23, i32 6)
ret void
}

LLVM IR (-O2):
define void @fdi_s25fl116k_enable_write() {
%1 = tail call i32 (...) @fdi_s25fl116k_wait_while_busy()
%2 = tail call i32 @fdi_spi_tx1(i32 23, i32 6)
ret void
}
/* Variables and functions */
scalar_t__ INT_MIN;
unsigned int test11u(unsigned int x) {
  unsigned int y = (unsigned int)INT_MIN;
  unsigned int z = 0x1234;
  return (x - y) ^ z;
}


x86 assembly (clang, -O0):
<test11u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0x8(%rbp)
movl   $0x1234,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test11u>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
sub    (%rcx),%eax
xor    $0x1234,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @test11u(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i64, i64* @INT_MIN
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
store i32 4660, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = sub i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @test11u(i32 %0) {
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = sub i32 %0, %3
%5 = xor i32 %4, 4660
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
void bar(int x) { foo(1, 3); }


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

x86 assembly (clang, -O2):
<bar>:
mov    $0x1,%edi
mov    $0x3,%esi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = tail call i32 @foo(i32 1, i32 3)
ret void
}
int stopping_criterion(int c1, int c2, int c3, int c4, double temp) {
  if (1.0 < temp) {
    return (0);
  } else if ((c1 == c2) && (c1 == c3) && (c1 == c4)) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<stopping_criterion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1138 <stopping_criterion+0x38>
movl   $0x0,-0x4(%rbp)
jmp    116f <stopping_criterion+0x6f>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1168 <stopping_criterion+0x68>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1168 <stopping_criterion+0x68>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1168 <stopping_criterion+0x68>
movl   $0x1,-0x4(%rbp)
jmp    116f <stopping_criterion+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopping_criterion>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
ja     111b <stopping_criterion+0x1b>
xor    %edi,%esi
xor    %edi,%edx
or     %esi,%edx
xor    %edi,%ecx
xor    %eax,%eax
or     %edx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @stopping_criterion(i32 %0, i32 %1, i32 %2, i32 %3, double %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store double %4, double* %11
%12 = load double, double* %11
%13 = fcmp olt double 1.000000e+00, %12
br i1 %13, label %14, label %15
14: ; preds = %5
store i32 0, i32* %6
br label %29
15: ; preds = %5
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i32, i32* %7
%21 = load i32, i32* %9
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i32, i32* %7
%25 = load i32, i32* %10
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 1, i32* %6
br label %29
28: ; preds = %23, %19, %15
store i32 0, i32* %6
br label %29
29: ; preds = %28, %27, %14
%30 = load i32, i32* %6
ret i32 %30
}

LLVM IR (-O2):
define i32 @stopping_criterion(i32 %0, i32 %1, i32 %2, i32 %3, double %4) {
%6 = fcmp ogt double %4, 1.000000e+00
br i1 %6, label %14, label %7
7: ; preds = %5
%8 = icmp eq i32 %0, %1
%9 = icmp eq i32 %0, %2
%10 = and i1 %8, %9
%11 = icmp eq i32 %0, %3
%12 = and i1 %10, %11
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %7, %5
%15 = phi i32 [ 0, %5 ], [ %13, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void post_label(char *label) { printf("%s:\n", label); }


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

x86 assembly (clang, -O2):
<post_label>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s:\0A\00"
define void @post_label(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float *get_element(int i, int j, int n, float *fortran_array) {
  return fortran_array + ((n * j) + i);
}


x86 assembly (clang, -O0):
<get_element>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x4(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_element>:
imul   %edx,%esi
add    %edi,%esi
movslq %esi,%rax
lea    (%rcx,%rax,4),%rax
ret

LLVM IR (-O0):
define float* @get_element(i32 %0, i32 %1, i32 %2, float* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca float*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store float* %3, float** %8
%9 = load float*, float** %8
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %5
%14 = add nsw i32 %12, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %9, i64 %15
ret float* %16
}

LLVM IR (-O2):
define float* @get_element(i32 %0, i32 %1, i32 %2, float* readnone %3) {
%5 = mul nsw i32 %2, %1
%6 = add nsw i32 %5, %0
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds float, float* %3, i64 %7
ret float* %8
}
int bsp_smp_processor_id(void) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void fmt_convert_s16_to_s16(void *dest_v, void *src_v, int n) {
  memcpy(dest_v, src_v, n * sizeof(int16_t));
}


x86 assembly (clang, -O0):
<fmt_convert_s16_to_s16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_convert_s16_to_s16>:
shl    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @fmt_convert_s16_to_s16(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(i8* %7, i8* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @fmt_convert_s16_to_s16(i8* %0, i8* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
ret void
}
int tab_state(char line[], int i) {
  while (line[i] == '\t') {
    ++i;
  }
  return i;
}


x86 assembly (clang, -O0):
<tab_state>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
jne    112e <tab_state+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <tab_state+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tab_state>:
movslq %esi,%rcx
lea    -0x1(%rcx),%eax
add    %rcx,%rdi
nopl   0x0(%rax)
add    $0x1,%eax
cmpb   $0x9,(%rdi)
lea    0x1(%rdi),%rdi
je     1110 <tab_state+0x10>
ret

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

LLVM IR (-O2):
define i32 @tab_state(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %9, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 9
%9 = add i64 %5, 1
br i1 %8, label %4, label %10
10: ; preds = %4
%11 = trunc i64 %5 to i32
ret i32 %11
}
/* Variables and functions */
scalar_t__ CallBack1(int, void *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int XOPCommand(const char *cmdPtr) {
  if (!CheckRunningInMainThread("XOPCommand"))
    return 978;
  return (int)CallBack1(9, (void *)cmdPtr);
}


x86 assembly (clang, -O0):
<XOPCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    114d <XOPCommand+0x2d>
movl   $0x3d2,-0x4(%rbp)
jmp    115e <XOPCommand+0x3e>
mov    -0x10(%rbp),%rsi
mov    $0x9,%edi
call   1030 <CallBack1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XOPCommand>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1143 <XOPCommand+0x23>
mov    $0x9,%edi
mov    %rbx,%rsi
call   1030 <CallBack1@plt>
pop    %rbx
ret
mov    $0x3d2,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"XOPCommand\00"
define i32 @XOPCommand(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 978, i32* %2
br label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @CallBack1(i32 9, i8* %8)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"XOPCommand\00"
define i32 @XOPCommand(i8* %0) {
%2 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @CallBack1(i32 9, i8* %0)
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 978, %1 ]
ret i32 %8
}
int ar724x_pcibios_init(int irq) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ar724x_pcibios_init(i32 %0) {
ret i32 0
}
int set_hash(int key, int size) { return (31 * key) % size; }


x86 assembly (clang, -O0):
<set_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x1f,-0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_hash>:
mov    %edi,%eax
shl    $0x5,%eax
sub    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @set_hash(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 = mul nsw i32 31, %5
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @set_hash(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 31
%4 = srem i32 %3, %1
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xzalloc(size_t size) {
  void *ptr = malloc(size);
  memset(ptr, 0, size);
  return ptr;
}


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

x86 assembly (clang, -O2):
<xzalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @xzalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int x = 10;
  int *c = &x;
  int **p = &c;
  **p = 74;
  printf("%d\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movl   $0x4a,(%rax)
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x4a,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 74)
ret void
}
/* Variables and functions */
int cube(int);
int square(int);
int main(void) {
  int counter;
  int x = 3;
  for (counter = square(x); counter < 5; counter = cube(counter)) {
    int a = 0;
  }
  for (x = 2; x < 5; x = cube(x)) {
    int a = 0;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <square@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1162 <main+0x42>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <cube@plt>
mov    %eax,-0x8(%rbp)
jmp    1141 <main+0x21>
movl   $0x2,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    118a <main+0x6a>
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <cube@plt>
mov    %eax,-0xc(%rbp)
jmp    1169 <main+0x49>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <square@plt>
cmp    $0x4,%eax
jg     113c <main+0x1c>
mov    %eax,%edi
call   1040 <cube@plt>
cmp    $0x5,%eax
jl     1130 <main+0x10>
mov    $0x2,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1040 <cube@plt>
cmp    $0x5,%eax
jl     1150 <main+0x30>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @square(i32 3)
%2 = icmp slt i32 %1, 5
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = phi i32 [ %5, %3 ], [ %1, %0 ]
%5 = tail call i32 @cube(i32 %4)
%6 = icmp slt i32 %5, 5
br i1 %6, label %3, label %7
7: ; preds = %3, %0
br label %8
8: ; preds = %7, %8
%9 = phi i32 [ %10, %8 ], [ 2, %7 ]
%10 = tail call i32 @cube(i32 %9)
%11 = icmp slt i32 %10, 5
br i1 %11, label %8, label %12
12: ; preds = %8
ret i32 0
}
/* Variables and functions */
int rand();
char rnd() {
  char data[36] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
                   'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
                   'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
  return data[rand() % 36];
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x24,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movsbl -0x30(%rbp,%rax,1),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
cltq
lea    0xec1(%rip),%rcx
mov    (%rax,%rcx,1),%al
pop    %rcx
ret

LLVM IR (-O0):
@__const.rnd.data = [36 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
define signext i8 @rnd() {
%1 = alloca [36 x i8]
%2 = bitcast [36 x i8]* %1 to i8*
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 36
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [36 x i8], [36 x i8]* %1, i64 0, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}

LLVM IR (-O2):
@__const.rnd.data = [36 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
define signext i8 @rnd() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 36
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds [36 x i8], [36 x i8]* @__const.rnd.data, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
f(x, c) {
  for (; 1;) {
    if (x << c)
      break;
    x++;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1119 <f+0x19>
jmp    113d <f+0x3d>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
cmp    $0x0,%eax
je     112f <f+0x2f>
jmp    113d <f+0x3d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110a <f+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %esi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
shl    %cl,%eax
add    $0x1,%edi
test   %eax,%eax
je     1110 <f+0x10>
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %7, %3 ]
%5 = shl i32 %4, %1
%6 = icmp eq i32 %5, 0
%7 = add nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
ret i32 undef
}
int count_highbits(const unsigned char c) {
  int bit = 8;
  while (((1 << (bit - 1)) & c) && (bit > 0)) {
    bit--;
  }
  return 8 - bit;
}


x86 assembly (clang, -O0):
<count_highbits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x8,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x1(%rbp),%eax
and    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     113e <count_highbits+0x3e>
cmpl   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114e <count_highbits+0x4e>
jmp    115c <count_highbits+0x5c>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <count_highbits+0x11>
mov    $0x8,%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_highbits>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x7(%rcx),%eax
movzbl %al,%edx
lea    -0x1(%rcx),%eax
bt     %edx,%edi
jae    1125 <count_highbits+0x25>
cmp    $0xfffffff8,%ecx
mov    %eax,%ecx
jne    1110 <count_highbits+0x10>
not    %eax
ret

LLVM IR (-O0):
define i32 @count_highbits(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 8, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 1
%7 = shl i32 1, %6
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %7, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 0
br label %15
15: ; preds = %12, %4
%16 = phi i1 [ false, %4 ], [ %14, %12 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i32, i32* %3
%19 = add nsw i32 %18, -1
store i32 %19, i32* %3
br label %4
20: ; preds = %15
%21 = load i32, i32* %3
%22 = sub nsw i32 8, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @count_highbits(i8 zeroext %0) {
%2 = zext i8 %0 to i32
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 8, %1 ], [ %5, %3 ]
%5 = add nsw i32 %4, -1
%6 = shl nuw i32 1, %5
%7 = and i32 %6, %2
%8 = icmp ne i32 %7, 0
%9 = icmp ne i32 %4, 0
%10 = select i1 %8, i1 %9, i1 false
br i1 %10, label %3, label %11
11: ; preds = %3
%12 = sub nsw i32 8, %4
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  printf("\n%d\n", num * num);
  printf("%d\n", num * num * num);
  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),%esi
imul   -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A%d\0A\00"
@.str.2 = [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 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %2
%12 = mul nsw i32 %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A%d\0A\00"
@.str.2 = [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 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
double max3(double a1, double a2, double a3) {
  if (a3 >= a2) {
    return (a3 >= a1 ? a3 : a1);
  } else {
    return (a2 >= a1 ? a2 : a1);
  }
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     115b <max3+0x5b>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1142 <max3+0x42>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    114c <max3+0x4c>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118e <max3+0x8e>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     117a <max3+0x7a>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1184 <max3+0x84>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
movapd %xmm0,%xmm4
cmplesd %xmm2,%xmm4
movapd %xmm4,%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm4
orpd   %xmm3,%xmm4
movapd %xmm0,%xmm3
cmplesd %xmm1,%xmm3
movapd %xmm3,%xmm5
andpd  %xmm1,%xmm5
andnpd %xmm0,%xmm3
orpd   %xmm5,%xmm3
cmpnlesd %xmm2,%xmm1
andpd  %xmm1,%xmm3
andnpd %xmm4,%xmm1
orpd   %xmm1,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @max3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %7
%9 = load double, double* %6
%10 = fcmp oge double %8, %9
br i1 %10, label %11, label %21
11: ; preds = %3
%12 = load double, double* %7
%13 = load double, double* %5
%14 = fcmp oge double %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load double, double* %7
br label %19
17: ; preds = %11
%18 = load double, double* %5
br label %19
19: ; preds = %17, %15
%20 = phi double [ %16, %15 ], [ %18, %17 ]
store double %20, double* %4
br label %31
21: ; preds = %3
%22 = load double, double* %6
%23 = load double, double* %5
%24 = fcmp oge double %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load double, double* %6
br label %29
27: ; preds = %21
%28 = load double, double* %5
br label %29
29: ; preds = %27, %25
%30 = phi double [ %26, %25 ], [ %28, %27 ]
store double %30, double* %4
br label %31
31: ; preds = %29, %19
%32 = load double, double* %4
ret double %32
}

LLVM IR (-O2):
define double @max3(double %0, double %1, double %2) {
%4 = fcmp ult double %2, %1
%5 = fcmp oge double %2, %0
%6 = select i1 %5, double %2, double %0
%7 = fcmp oge double %1, %0
%8 = select i1 %7, double %1, double %0
%9 = select i1 %4, double %8, double %6
ret double %9
}
void Dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @Dummy() {
ret void
}
/* Variables and functions */
int read(int, char *, int);
int readLine(int fd, char *str) {
  int n;
  do {
    n = read(fd, str, 1);
  } while (n > 0 && *str++ != '\0');
  return (n > 0);
}


x86 assembly (clang, -O0):
<readLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jle    115d <readLine+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    111f <readLine+0xf>
cmpl   $0x0,-0x14(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readLine>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    113c <readLine+0x2c>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <readLine+0x10>
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readLine(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @read(i32 %7, i8* %8, i32 1)
store i32 %9, i32* %5
br label %10
10: ; preds = %6
%11 = load i32, i32* %5
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
br label %19
19: ; preds = %13, %10
%20 = phi i1 [ false, %10 ], [ %18, %13 ]
br i1 %20, label %6, label %21
21: ; preds = %19
%22 = load i32, i32* %5
%23 = icmp sgt i32 %22, 0
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @readLine(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = tail call i32 @read(i32 %0, i8* %4, i32 1)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = zext i1 %6 to i32
ret i32 %12
}
int suma(int op1, int op2) { return op1 + op2; }


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

x86 assembly (clang, -O2):
<suma>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @suma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void picolcd_exit_framebuffer(struct picolcd_data *data) {}


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

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

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

LLVM IR (-O2):
%struct.picolcd_data = type opaque
define void @picolcd_exit_framebuffer(%struct.picolcd_data* nocapture %0) {
ret void
}
int bit_get_rightmost_zero_val(int n) { return ((~n) & (n + 1)); }


x86 assembly (clang, -O0):
<bit_get_rightmost_zero_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_get_rightmost_zero_val>:
lea    0x1(%rdi),%eax
mov    %edi,%ecx
not    %ecx
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bit_get_rightmost_zero_val(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = and i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bit_get_rightmost_zero_val(i32 %0) {
%2 = xor i32 %0, -1
%3 = add nsw i32 %0, 1
%4 = and i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int default_mem_desc(unsigned char, unsigned char, char *, int *);
int decode_mem_intel(int prod, unsigned char b2, unsigned char b3, char *desc,
                     int *psz) {
  return (default_mem_desc(b2, b3, desc, psz));
}


x86 assembly (clang, -O0):
<decode_mem_intel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%dl
mov    %edi,-0x4(%rbp)
mov    %dl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x5(%rbp),%sil
mov    -0x6(%rbp),%al
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movzbl %sil,%edi
movzbl %al,%esi
call   1030 <default_mem_desc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_mem_intel>:
mov    %esi,%edi
mov    %edx,%esi
mov    %rcx,%rdx
mov    %r8,%rcx
jmp    1030 <default_mem_desc@plt>

LLVM IR (-O0):
define i32 @decode_mem_intel(i32 %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i32*
store i32 %0, i32* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%11 = load i8, i8* %7
%12 = load i8, i8* %8
%13 = load i8*, i8** %9
%14 = load i32*, i32** %10
%15 = call i32 @default_mem_desc(i8 zeroext %11, i8 zeroext %12, i8* %13, i32* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @decode_mem_intel(i32 %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i32* %4) {
%6 = tail call i32 @default_mem_desc(i8 zeroext %1, i8 zeroext %2, i8* %3, i32* %4)
ret i32 %6
}
adrreg0reg1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((p0[10000000]) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2625a00(%rax),%eax
cmp    -0xc(%rbp),%eax
jg     1137 <adrreg0reg1+0x37>
movl   $0x1,-0x4(%rbp)
jmp    113e <adrreg0reg1+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0reg1>:
xor    %eax,%eax
cmp    %esi,0x2625a00(%r8)
setle  %al
ret

LLVM IR (-O0):
define i32 @adrreg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %12
%15 = getelementptr inbounds i32, i32* %14, i64 10000000
%16 = load i32, i32* %15
%17 = load i32, i32* %9
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @adrreg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = getelementptr inbounds i32, i32* %4, i64 10000000
%8 = load i32, i32* %7
%9 = icmp sle i32 %8, %1
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblock_acquire_chunk() {
  printf("NOT IMPLEMENTED:"
         "pa_memblock_acquire_chunk"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_memblock_acquire_chunk\0A\00"
define i32 @pa_memblock_acquire_chunk() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_memblock_acquire_chunk\00"
define i32 @pa_memblock_acquire_chunk() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}