xunge/DecIR huggingface dataset:
void *get_physical_address(void *virtual_addr) {
  unsigned long pdindex = (unsigned long)virtual_addr >> 22;
  unsigned long ptindex = (unsigned long)virtual_addr >> 12 & 0x03FF;
  unsigned long *pd = (unsigned long *)0xC0010000;
  unsigned long *pt = ((unsigned long *)0xC0400000) + (0x400 * pdindex);
  return (void *)((pt[ptindex] & ~0xFFF) +
                  ((unsigned long)virtual_addr & 0xFFF));
}


x86 assembly (clang, -O0):
<get_physical_address>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x16,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0xc,%rax
and    $0x3ff,%rax
mov    %rax,-0x18(%rbp)
mov    $0xc0010000,%eax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
shl    $0xa,%rcx
mov    $0xc0400000,%eax
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
and    $0xfffffffffffff000,%rax
mov    -0x8(%rbp),%rcx
and    $0xfff,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_physical_address>:
mov    %rdi,%rcx
shr    $0xc,%rcx
mov    $0xc0400000,%edx
mov    $0xfffffffffffff000,%rax
and    (%rdx,%rcx,8),%rax
and    $0xfff,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i8* @get_physical_address(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64*
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %7 to i64
%9 = lshr i64 %8, 22
store i64 %9, i64* %3
%10 = load i8*, i8** %2
%11 = ptrtoint i8* %10 to i64
%12 = lshr i64 %11, 12
%13 = and i64 %12, 1023
store i64 %13, i64* %4
store i64* inttoptr (i64 3221291008 to i64*), i64** %5
%14 = load i64, i64* %3
%15 = mul i64 1024, %14
%16 = getelementptr inbounds i64, i64* inttoptr (i64 3225419776 to i64*), i64 %15
store i64* %16, i64** %6
%17 = load i64*, i64** %6
%18 = load i64, i64* %4
%19 = getelementptr inbounds i64, i64* %17, i64 %18
%20 = load i64, i64* %19
%21 = and i64 %20, -4096
%22 = load i8*, i8** %2
%23 = ptrtoint i8* %22 to i64
%24 = and i64 %23, 4095
%25 = add i64 %21, %24
%26 = inttoptr i64 %25 to i8*
ret i8* %26
}

LLVM IR (-O2):
define i8* @get_physical_address(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 12
%4 = and i64 %3, 1023
%5 = and i64 %3, 4503599627369472
%6 = getelementptr inbounds i64, i64* inttoptr (i64 3225419776 to i64*), i64 %5
%7 = getelementptr inbounds i64, i64* %6, i64 %4
%8 = load i64, i64* %7
%9 = and i64 %8, -4096
%10 = and i64 %2, 4095
%11 = or i64 %9, %10
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void so_init1(void) {
  printf("so_init1"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"so_init1\00"
define void @so_init1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
void inSituEbcdicToAscii(char *s) {
  static char etoa[] = "                                "
                       "                                "
                       "           .<(+|&         !$*); "
                       "-/         ,%_>?         `:#@'=\""
                       " abcdefghi       jklmnopqr      "
                       "  stuvwxyz                      "
                       " ABCDEFGHI       JKLMNOPQR      "
                       "  STUVWXYZ      0123456789      ";
  while (*s != '\0') {
    *s = etoa[(unsigned char)*s];
    s++;
  }
}


x86 assembly (clang, -O0):
<inSituEbcdicToAscii>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1142 <inSituEbcdicToAscii+0x42>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,%ecx
lea    0x2f08(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <inSituEbcdicToAscii+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inSituEbcdicToAscii>:
mov    (%rdi),%al
test   %al,%al
je     1135 <inSituEbcdicToAscii+0x35>
add    $0x1,%rdi
lea    0xeef(%rip),%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %al,%eax
movzbl (%rax,%rcx,1),%eax
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1120 <inSituEbcdicToAscii+0x20>
ret

LLVM IR (-O0):
@inSituEbcdicToAscii.etoa = internal global [257 x i8] c" .<(+|& !$*); -/ ,%_>? `:#@'=\22 abcdefghi jklmnopqr stuvwxyz ABCDEFGHI JKLMNOPQR STUVWXYZ 0123456789 \00"
define void @inSituEbcdicToAscii(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = getelementptr inbounds [257 x i8], [257 x i8]* @inSituEbcdicToAscii.etoa, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = load i8*, i8** %2
store i8 %13, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %2
br label %3
17: ; preds = %3
ret void
}

LLVM IR (-O2):
@inSituEbcdicToAscii.etoa = internal unnamed_addr constant [257 x i8] c" .<(+|& !$*); -/ ,%_>? `:#@'=\22 abcdefghi jklmnopqr stuvwxyz ABCDEFGHI JKLMNOPQR STUVWXYZ 0123456789 \00"
define void @inSituEbcdicToAscii(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = zext i8 %5 to i64
%8 = getelementptr inbounds [257 x i8], [257 x i8]* @inSituEbcdicToAscii.etoa, i64 0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
double absF(double vstup) {
  if (vstup < 0)
    return vstup * (-1);
  else
    return vstup;
}


x86 assembly (clang, -O0):
<absF>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112e <absF+0x2e>
movsd  0xee1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1138 <absF+0x38>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @absF(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int xmalloc(size)
int size;
{
  register int result = malloc(size);
  if (!result)
    fatal(15);
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1030 <malloc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114d <xmalloc+0x2d>
mov    $0xf,%edi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
movslq %edi,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %ebx,%ebx
jne    113c <xmalloc+0x1c>
mov    $0xf,%edi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
%7 = ptrtoint i8* %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = call i32 (i32, ...) bitcast (i32 (...)* @fatal to i32 (i32, ...)*)(i32 15)
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @xmalloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @fatal to i32 (i32, ...)*)(i32 15)
br label %9
9: ; preds = %7, %1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int read(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
uint8_t ReadUint8(void) {
  uint8_t temp;
  int data_read = read(0, &temp, 1);
  if (data_read != 1) {
    exit(-1);
  }
  return temp;
}


x86 assembly (clang, -O0):
<ReadUint8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     114f <ReadUint8+0x2f>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadUint8>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
jne    113d <ReadUint8+0x1d>
mov    0x4(%rsp),%eax
pop    %rcx
ret
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @ReadUint8() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @read(i32 0, i32* %1, i32 1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @exit(i32 -1)
unreachable
8: ; preds = %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @ReadUint8() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read(i32 0, i32* %1, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
%8 = load i32, i32* %1
ret i32 %8
}
/* Variables and functions */
int test_lib_bar_global();
__attribute__((visibility("default"))) int test_lib_foo_global(void) {
  return test_lib_bar_global();
}


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

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

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

LLVM IR (-O2):
define i32 @test_lib_foo_global() {
%1 = tail call i32 (...) @test_lib_bar_global()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ lib();
int main(void) {
  lib();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @lib()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void genksyms_usage(void) {
  fputs(
      "Usage:\n"
      "genksyms [-adDTwqhV] > /path/to/.tmp_obj.ver\n"
      "\n"
      "  -s                    Select symbol prefix\n"
      "  -d                    Increment the debug level (repeatable)\n"
      "  -D                    Dump expanded symbol defs (for debugging only)\n"
      "  -r file               Read reference symbols from a file\n"
      "  -T file               Dump expanded types into file\n"
      "  -p                    Preserve reference modversions or fail\n"
      "  -w                    Enable warnings\n"
      "  -q                    Disable warnings (default)\n"
      "  -h                    Print this message\n"
      "  -V                    Print the release version\n",
      stderr);
}


x86 assembly (clang, -O0):
<genksyms_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genksyms_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [593 x i8] c"Usage:\0Agenksyms [-adDTwqhV] > /path/to/.tmp_obj.ver\0A\0A -s Select symbol prefix\0A -d Increment the debug level (repeatable)\0A -D Dump expanded symbol defs (for debugging only)\0A -r file Read reference symbols from a file\0A -T file Dump expanded types into file\0A -p Preserve reference modversions or fail\0A -w Enable warnings\0A -q Disable warnings (default)\0A -h Print this message\0A -V Print the release version\0A\00"
@stderr = global i32 0
define void @genksyms_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([593 x i8], [593 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [593 x i8] c"Usage:\0Agenksyms [-adDTwqhV] > /path/to/.tmp_obj.ver\0A\0A -s Select symbol prefix\0A -d Increment the debug level (repeatable)\0A -D Dump expanded symbol defs (for debugging only)\0A -r file Read reference symbols from a file\0A -T file Dump expanded types into file\0A -p Preserve reference modversions or fail\0A -w Enable warnings\0A -q Disable warnings (default)\0A -h Print this message\0A -V Print the release version\0A\00"
@stderr = global i32 0
define void @genksyms_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([593 x i8], [593 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int f2(int a) { return a + 2; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
void GLUE_STORE_P1_TO_STACK_AT_OFFS(void *b, int offs) {
  ((unsigned char *)b)[0] = 0x48;
  ((unsigned char *)b)[1] = 0x89;
  ((unsigned char *)b)[2] = 0x84;
  ((unsigned char *)b)[3] = 0x24;
  *(int *)((unsigned char *)b + 4) = offs;
}


x86 assembly (clang, -O0):
<GLUE_STORE_P1_TO_STACK_AT_OFFS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x48,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x89,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x84,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x24,0x3(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_STORE_P1_TO_STACK_AT_OFFS>:
movl   $0x24848948,(%rdi)
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @GLUE_STORE_P1_TO_STACK_AT_OFFS(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 72, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 -119, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8 -124, i8* %10
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 3
store i8 36, i8* %12
%13 = load i32, i32* %4
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 4
%16 = bitcast i8* %15 to i32*
store i32 %13, i32* %16
ret void
}

LLVM IR (-O2):
define void @GLUE_STORE_P1_TO_STACK_AT_OFFS(i8* nocapture writeonly %0, i32 %1) {
store i8 72, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 -119, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 2
store i8 -124, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 3
store i8 36, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = bitcast i8* %6 to i32*
store i32 %1, i32* %7
ret void
}
/* Variables and functions */
int vlist_def_att(int, int, int, int, char const *, size_t, size_t,
                  char const *);
int vlistDefAttTxt(int vlistID, int varID, const char *name, int len,
                   const char *tp) {
  return vlist_def_att(253, 253, vlistID, varID, name, (size_t)len, (size_t)len,
                       tp);
}


x86 assembly (clang, -O0):
<vlistDefAttTxt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
movslq -0x14(%rbp),%r9
movslq -0x14(%rbp),%r10
mov    -0x20(%rbp),%rax
mov    $0xfd,%esi
mov    %esi,%edi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <vlist_def_att@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlistDefAttTxt>:
push   %rax
mov    %r8,%r10
mov    %rdx,%r8
mov    %esi,%eax
mov    %edi,%edx
movslq %ecx,%r9
mov    $0xfd,%edi
mov    $0xfd,%esi
mov    %eax,%ecx
push   %r10
push   %r9
call   1030 <vlist_def_att@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vlistDefAttTxt(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = sext i32 %14 to i64
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = load i8*, i8** %10
%19 = call i32 @vlist_def_att(i32 253, i32 253, i32 %11, i32 %12, i8* %13, i64 %15, i64 %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @vlistDefAttTxt(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = sext i32 %3 to i64
%7 = tail call i32 @vlist_def_att(i32 253, i32 253, i32 %0, i32 %1, i8* %2, i64 %6, i64 %6, i8* %4)
ret i32 %7
}
char is_check(struct chessboard *c) { return 0; }


x86 assembly (clang, -O0):
<is_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.chessboard = type opaque
define signext i8 @is_check(%struct.chessboard* %0) {
%2 = alloca %struct.chessboard*
store %struct.chessboard* %0, %struct.chessboard** %2
ret i8 0
}

LLVM IR (-O2):
%struct.chessboard = type opaque
define signext i8 @is_check(%struct.chessboard* nocapture readnone %0) {
ret i8 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_avg2_16(int, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ const *, int, int,
                              int /*<<< orphan*/);
void MC_avg_y_16_mmxext(uint8_t *dest, const uint8_t *ref, int stride,
                        int height) {
  MC_avg2_16(height, dest, ref, stride, stride, 0);
}


x86 assembly (clang, -O0):
<MC_avg_y_16_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x14(%rbp),%r8d
xor    %r9d,%r9d
call   1030 <MC_avg2_16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_avg_y_16_mmxext>:
mov    %edx,%r8d
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %r8d,%ecx
xor    %r9d,%r9d
jmp    1030 <MC_avg2_16@plt>

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

LLVM IR (-O2):
define void @MC_avg_y_16_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_avg2_16(i32 %3, i32* %0, i32* %1, i32 %2, i32 %2, i32 0)
ret void
}
int test_imm_CEuint32_reg(unsigned int val) {
  return ((val) & (0xCE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CEuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xce,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CEuint32_reg>:
test   $0xce,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CEuint32_reg(i32 %0) {
%2 = and i32 %0, 206
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
SHL(statlink, n, a) int *statlink;
unsigned a;
{ return (n < 0 ? (-n >= 32 ? 0 : a >> -n) : n >= 32 ? 0 : a << n); }


x86 assembly (clang, -O0):
<SHL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1148 <SHL+0x48>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cmp    $0x20,%eax
jl     1130 <SHL+0x30>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <SHL+0x3d>
mov    -0x10(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    116d <SHL+0x6d>
cmpl   $0x20,-0xc(%rbp)
jl     115c <SHL+0x5c>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1167 <SHL+0x67>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHL>:
mov    %esi,%ecx
test   %esi,%esi
js     1111 <SHL+0x11>
shl    %cl,%edx
xor    %eax,%eax
cmp    $0x20,%esi
cmovb  %edx,%eax
ret
neg    %cl
shr    %cl,%edx
xor    %eax,%eax
cmp    $0xffffffe1,%esi
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @SHL(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = sub nsw i32 0, %1
%7 = icmp ult i32 %1, -31
%8 = lshr i32 %2, %6
%9 = select i1 %7, i32 0, i32 %8
br label %14
10: ; preds = %3
%11 = icmp ugt i32 %1, 31
%12 = shl i32 %2, %1
%13 = select i1 %11, i32 0, i32 %12
br label %14
14: ; preds = %10, %5
%15 = phi i32 [ %9, %5 ], [ %13, %10 ]
ret i32 %15
}
void setactivepage(int i) {}


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

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

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

LLVM IR (-O2):
define void @setactivepage(i32 %0) {
ret void
}
unsigned rcb_fast_get_one_bits(unsigned count) {
  return ~((unsigned)-1 << count);
}


x86 assembly (clang, -O0):
<rcb_fast_get_one_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcb_fast_get_one_bits>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @rcb_fast_get_one_bits(i32 %0) {
%2 = shl nsw i32 -1, %0
%3 = xor i32 %2, -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_gre_mpls_tcp_ipv4_packet_to_string();
int /*<<< orphan*/ test_tcp_ipv4_packet_to_string();
int /*<<< orphan*/ test_tcp_ipv6_packet_to_string();
int main(void) {
  test_tcp_ipv4_packet_to_string();
  test_tcp_ipv6_packet_to_string();
  test_gre_mpls_tcp_ipv4_packet_to_string();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_tcp_ipv4_packet_to_string()
%2 = tail call i32 (...) @test_tcp_ipv6_packet_to_string()
%3 = tail call i32 (...) @test_gre_mpls_tcp_ipv4_packet_to_string()
ret i32 0
}
void sesmexit() {}


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

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

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

LLVM IR (-O2):
define void @sesmexit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
char **handle_version(char *arg, char **next) {
  printf("%s\n", "0.5.0");
  exit(0);
}


x86 assembly (clang, -O0):
<handle_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [6 x i8] c"0.5.0\00"
define i8** @handle_version(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [6 x i8] c"0.5.0\00"
define noalias i8** @handle_version(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
void init(int argc, char **argv) {
  {
    extern void main_init(int, char **);
    main_init(argc, argv);
  }
}


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

x86 assembly (clang, -O2):
<init>:
jmp    1030 <main_init@plt>

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

LLVM IR (-O2):
define void @init(i32 %0, i8** %1) {
tail call void @main_init(i32 %0, i8** %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ svc_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ *svcfd_create(int, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argn, char *argc[]) {
  int run_mode = 0;
  int test_status = 1;
  int fd;
  SVCXPRT *svcr = NULL;
  svcr = svcfd_create(fd, 0, 0);
  svc_destroy(svcr);
  test_status = 0;
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <svcfd_create@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <svc_destroy@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1050 <svcfd_create@plt>
mov    %rax,%rdi
call   1040 <svc_destroy@plt>
lea    0xeb7(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @svcfd_create(i32 undef, i32 0, i32 0)
%4 = tail call i32 @svc_destroy(i32* %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
int avpriv_atomic_int_get(volatile int *ptr) { return *ptr; }


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

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

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

LLVM IR (-O2):
define i32 @avpriv_atomic_int_get(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __delay_blink();
int /*<<< orphan*/ pwr_off();
int /*<<< orphan*/ pwr_on();
void gpio_blink_green(void) {
  for (;;) {
    pwr_on();
    __delay_blink();
    pwr_off();
    __delay_blink();
  }
}


x86 assembly (clang, -O0):
<gpio_blink_green>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <gpio_blink_green+0x9>
mov    $0x0,%al
call   1030 <pwr_on@plt>
mov    $0x0,%al
call   1050 <__delay_blink@plt>
mov    $0x0,%al
call   1040 <pwr_off@plt>
mov    $0x0,%al
call   1050 <__delay_blink@plt>
jmp    1139 <gpio_blink_green+0x9>

x86 assembly (clang, -O2):
<gpio_blink_green>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <pwr_on@plt>
xor    %eax,%eax
call   1050 <__delay_blink@plt>
xor    %eax,%eax
call   1040 <pwr_off@plt>
xor    %eax,%eax
call   1050 <__delay_blink@plt>
jmp    1140 <gpio_blink_green+0x10>

LLVM IR (-O0):
define void @gpio_blink_green() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @pwr_on()
%3 = call i32 (...) @__delay_blink()
%4 = call i32 (...) @pwr_off()
%5 = call i32 (...) @__delay_blink()
br label %1
}

LLVM IR (-O2):
define void @gpio_blink_green() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @pwr_on()
%3 = tail call i32 (...) @__delay_blink()
%4 = tail call i32 (...) @pwr_off()
%5 = tail call i32 (...) @__delay_blink()
br label %1
}
float *quat_assign(float *result, float *a) {
  result[0] = a[0];
  result[1] = a[1];
  result[2] = a[2];
  result[3] = a[3];
  return result;
}


x86 assembly (clang, -O0):
<quat_assign>:
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)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_assign>:
mov    %rdi,%rax
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 float* @quat_assign(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
%25 = load float*, float** %3
ret float* %25
}

LLVM IR (-O2):
define float* @quat_assign(float* returned 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 float* %0
}
void swap(int *p1, int *p2) {
  int a, *temp = &a;
  *temp = *p1;
  *p1 = *p2;
  *p2 = *temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ warn(char *, int);
int /*<<< orphan*/ warnx(char *, int);
int main(void) {
  warnx("%d. warnx", 1);
  warn("%d. warn", 2);
  err(0, "%d. err", 3);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x1,%esi
call   1040 <warnx@plt>
lea    0xeb3(%rip),%rdi
mov    $0x2,%esi
call   1030 <warn@plt>
xor    %edi,%edi
lea    0xea9(%rip),%rsi
mov    $0x3,%edx
call   1050 <err@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x1,%esi
call   1040 <warnx@plt>
lea    0xec1(%rip),%rdi
mov    $0x2,%esi
call   1030 <warn@plt>
lea    0xeb9(%rip),%rsi
xor    %edi,%edi
mov    $0x3,%edx
call   1050 <err@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d. warnx\00"
@.str.1 = [9 x i8] c"%d. warn\00"
@.str.2 = [8 x i8] c"%d. err\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @warnx(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = call i32 @warn(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 2)
%4 = call i32 @err(i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 3)
ret i32 1
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d. warnx\00"
@.str.1 = [9 x i8] c"%d. warn\00"
@.str.2 = [8 x i8] c"%d. err\00"
define i32 @main() {
%1 = tail call i32 @warnx(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @warn(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = tail call i32 @err(i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 3)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void set_ots_addr(uint32_t addr[8], uint32_t ots) { addr[4] = ots; }


x86 assembly (clang, -O0):
<set_ots_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ots_addr>:
mov    %esi,0x10(%rdi)
ret

LLVM IR (-O0):
define void @set_ots_addr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 4
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @set_ots_addr(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %1, i32* %3
ret void
}
extern const char *lua_version(void) { return "Lua 5.0"; }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"Lua 5.0\00"
define i8* @lua_version() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
int _is_first_name(char c) {
  unsigned x = (unsigned char)c;
  x -= 'A';
  return (x & ~32u) <= 'Z' - 'A' || c == '_';
}


x86 assembly (clang, -O0):
<_is_first_name>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0xffffffdf,%ecx
mov    $0x1,%al
cmp    $0x19,%ecx
mov    %al,-0x9(%rbp)
jbe    113b <_is_first_name+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_first_name>:
movzbl %dil,%eax
lea    -0x41(%rax),%ecx
and    $0xffffffde,%ecx
cmp    $0x1a,%ecx
setb   %cl
cmp    $0x5f,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @_is_first_name(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sub i32 %6, 65
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = and i32 %8, -33
%10 = icmp ule i32 %9, 25
br i1 %10, label %15, label %11
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 95
br label %15
15: ; preds = %11, %1
%16 = phi i1 [ true, %1 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @_is_first_name(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = add nsw i32 %2, -65
%4 = and i32 %3, -34
%5 = icmp ult i32 %4, 26
%6 = icmp eq i8 %0, 95
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned int);
void fb_move_cursor(unsigned int pos) {
  outb(0x3D4, 14);
  outb(0x3D5, (pos >> 8) & 0x00FF);
  outb(0x3D4, 15);
  outb(0x3D5, pos & 0x00FF);
}


x86 assembly (clang, -O0):
<fb_move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%esi
shr    $0x8,%esi
and    $0xff,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%esi
and    $0xff,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_move_cursor>:
push   %rbx
mov    %edi,%ebx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @fb_move_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @outb(i32 980, i32 14)
%4 = load i32, i32* %2
%5 = lshr i32 %4, 8
%6 = and i32 %5, 255
%7 = call i32 @outb(i32 981, i32 %6)
%8 = call i32 @outb(i32 980, i32 15)
%9 = load i32, i32* %2
%10 = and i32 %9, 255
%11 = call i32 @outb(i32 981, i32 %10)
ret void
}

LLVM IR (-O2):
define void @fb_move_cursor(i32 %0) {
%2 = tail call i32 @outb(i32 980, i32 14)
%3 = lshr i32 %0, 8
%4 = and i32 %3, 255
%5 = tail call i32 @outb(i32 981, i32 %4)
%6 = tail call i32 @outb(i32 980, i32 15)
%7 = and i32 %0, 255
%8 = tail call i32 @outb(i32 981, i32 %7)
ret void
}
int is_octet(int mode) {
  if (mode == 9)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_octet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jne    111d <is_octet+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <is_octet+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_octet>:
xor    %eax,%eax
cmp    $0x9,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_octet(i32 %0) {
%2 = icmp eq i32 %0, 9
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int sprintf(char *, char *, int, int);
int ssds_item_name(int fd, int class_num, int item_num, char *sp) {
  int ret;
  ret = sprintf(sp, "INAM%d.%d", class_num, item_num);
  return ret;
}


x86 assembly (clang, -O0):
<ssds_item_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeca(%rip),%rsi
call   1030 <sprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_item_name>:
mov    %edx,%eax
mov    %esi,%edx
lea    0xee5(%rip),%rsi
mov    %rcx,%rdi
mov    %eax,%ecx
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"INAM%d.%d\00"
define i32 @ssds_item_name(i32 %0, i32 %1, i32 %2, i8* nocapture writeonly %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 %5
}
int fun986() { return 986; }


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

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

LLVM IR (-O0):
define i32 @fun986() {
ret i32 986
}

LLVM IR (-O2):
define i32 @fun986() {
ret i32 986
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
add(int m) { printf("C plugin adding %d\n", m); }


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"C plugin adding %d\0A\00"
define i32 @add(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}