xunge/DecIR huggingface dataset:
void intGenBufferOut(struct LSD_SceneNodeOutput const *output) {}


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

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

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

LLVM IR (-O2):
%struct.LSD_SceneNodeOutput = type opaque
define void @intGenBufferOut(%struct.LSD_SceneNodeOutput* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ character;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void libc_printf_putchar(FILE *stream, char character) {
  fwrite(&character, 1, sizeof(character), stream);
}


x86 assembly (clang, -O0):
<libc_printf_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libc_printf_putchar>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @libc_printf_putchar(i32* nocapture %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = tail call i32 @fputc(i32 %3, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outs(char *, int);
void endl() { outs("\n", 1); }


x86 assembly (clang, -O0):
<endl>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <outs@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @endl() {
%1 = tail call i32 @outs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
void error_print(void) {}


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

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

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

LLVM IR (-O2):
define void @error_print() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outportb(int, int);
void irq_ack(unsigned int irq_no) {
  if (irq_no >= 12) {
    outportb(0xA0, 0x20);
  }
  outportb(0x20, 0x20);
}


x86 assembly (clang, -O0):
<irq_ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xc,-0x4(%rbp)
jb     1134 <irq_ack+0x24>
mov    $0xa0,%edi
mov    $0x20,%esi
call   1030 <outportb@plt>
mov    $0x20,%esi
mov    %esi,%edi
call   1030 <outportb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_ack>:
cmp    $0xc,%edi
jb     1129 <irq_ack+0x19>
push   %rax
mov    $0xa0,%edi
mov    $0x20,%esi
call   1030 <outportb@plt>
add    $0x8,%rsp
mov    $0x20,%edi
mov    $0x20,%esi
jmp    1030 <outportb@plt>

LLVM IR (-O0):
define void @irq_ack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 12
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @outportb(i32 160, i32 32)
br label %7
7: ; preds = %5, %1
%8 = call i32 @outportb(i32 32, i32 32)
ret void
}

LLVM IR (-O2):
define void @irq_ack(i32 %0) {
%2 = icmp ugt i32 %0, 11
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @outportb(i32 160, i32 32)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @outportb(i32 32, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vdp_puts(int, char const *);
void print(int x, int y, const char *str) {
  vdp_puts(0x0000 + x + y * 40, str);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0x0,%edi
imul   $0x28,-0x8(%rbp),%eax
add    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <vdp_puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
lea    (%rsi,%rsi,4),%eax
lea    (%rdi,%rax,8),%edi
mov    %rdx,%rsi
jmp    1030 <vdp_puts@plt>

LLVM IR (-O0):
define void @print(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = add nsw i32 0, %7
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 40
%11 = add nsw i32 %8, %10
%12 = load i8*, i8** %6
%13 = call i32 @vdp_puts(i32 %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @print(i32 %0, i32 %1, i8* %2) {
%4 = mul nsw i32 %1, 40
%5 = add nsw i32 %4, %0
%6 = tail call i32 @vdp_puts(i32 %5, i8* %2)
ret void
}
/* Variables and functions */
int myfunction();
int main(void) {
  int a;
  a = myfunction();
here:
  return a;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @myfunction()
store i32 %3, i32* %2
br label %4
4: ; preds = %0
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @myfunction()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ findIfAnagrams(char *, char *);
int main(int argc, const char *argv[]) {
  findIfAnagrams("", "");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @findIfAnagrams(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_LAZY;
int /*<<< orphan*/ dlopen(char *, int /*<<< orphan*/);
void *work(void *arg) {
  dlopen((char *)arg, RTLD_LAZY);
  return NULL;
}


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

x86 assembly (clang, -O2):
<work>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
call   1030 <dlopen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RTLD_LAZY = global i32 0
define i8* @work(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @RTLD_LAZY
%5 = call i32 @dlopen(i8* %3, i32 %4)
ret i8* null
}

LLVM IR (-O2):
@RTLD_LAZY = global i32 0
define noalias i8* @work(i8* %0) {
%2 = load i32, i32* @RTLD_LAZY
%3 = tail call i32 @dlopen(i8* %0, i32 %2)
ret i8* null
}
int main(int argc, char **argv) { return argc; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 returned %0, i8** nocapture readnone %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ FRqDone(int);
void FRqOK() { FRqDone(1); }


x86 assembly (clang, -O0):
<FRqOK>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <FRqDone@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FRqOK>:
mov    $0x1,%edi
jmp    1030 <FRqDone@plt>

LLVM IR (-O0):
define void @FRqOK() {
%1 = call i32 @FRqDone(i32 1)
ret void
}

LLVM IR (-O2):
define void @FRqOK() {
%1 = tail call i32 @FRqDone(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help(char *prog) {
  printf("Usage: %s [-CvhV] file\n"
         "\t-C, --card <cardno>	Card to use, default is 0\n"
         "\t-V, --version		Print Version number for this tool\n"
         "\t-h, --help		This help message\n"
         "\t-q, --quiet		No output at all\n"
         "\t-v, --verbose	verbose mode, up to -vvv\n",
         prog);
  return;
}


x86 assembly (clang, -O0):
<help>:
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):
<help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [224 x i8] c"Usage: %s [-CvhV] file\0A\09-C, --card <cardno>\09Card to use, default is 0\0A\09-V, --version\09\09Print Version number for this tool\0A\09-h, --help\09\09This help message\0A\09-q, --quiet\09\09No output at all\0A\09-v, --verbose\09verbose mode, up to -vvv\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [224 x i8] c"Usage: %s [-CvhV] file\0A\09-C, --card <cardno>\09Card to use, default is 0\0A\09-V, --version\09\09Print Version number for this tool\0A\09-h, --help\09\09This help message\0A\09-q, --quiet\09\09No output at all\0A\09-v, --verbose\09verbose mode, up to -vvv\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void SmartMac_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @SmartMac_Init() {
ret void
}
int fibonnaci_recursive(int n) {
  if (n <= 1) {
    return n;
  } else {
    return fibonnaci_recursive(n - 1) + fibonnaci_recursive(n - 2);
  }
}


x86 assembly (clang, -O0):
<fibonnaci_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1130 <fibonnaci_recursive+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fibonnaci_recursive+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonnaci_recursive@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonnaci_recursive@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonnaci_recursive>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fibonnaci_recursive+0x10>
mov    %ebx,%ecx
jmp    1144 <fibonnaci_recursive+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonnaci_recursive@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fibonnaci_recursive+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonnaci_recursive(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibonnaci_recursive(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
void loglike_finalize() {}


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

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

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

LLVM IR (-O2):
define void @loglike_finalize() {
ret void
}
int free_list_length(void *p) {
  int l = 0;
  while (p) {
    ++l;
    p = ((void **)p)[0];
  }
  return l;
}


x86 assembly (clang, -O0):
<free_list_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <free_list_length+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    110f <free_list_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_list_length>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <free_list_length+0x1b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
mov    (%rdi),%rdi
test   %rdi,%rdi
jne    1110 <free_list_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @free_list_length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i8* [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = bitcast i8* %5 to i8**
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ dump_stack();
void sys_my_stack_trace() { dump_stack(); }


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

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

LLVM IR (-O0):
define void @sys_my_stack_trace() {
%1 = call i32 (...) @dump_stack()
ret void
}

LLVM IR (-O2):
define void @sys_my_stack_trace() {
%1 = tail call i32 (...) @dump_stack()
ret void
}
double dist(double x1, double y1, double x2, double y2) {
  double dx, dy;
  dx = x1 - x2;
  dy = y1 - y2;
  return sqrt(((dx) * (dx)) + ((dy) * (dy)));
}


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
subsd  %xmm2,%xmm0
subsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <dist+0x23>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @dist(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = fsub double %1, %3
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
%9 = tail call double @sqrt(double %8)
ret double %9
}
void g_queue_peek_head() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_peek_head() {
ret void
}
int tokenCounter(char *stringIn, char delim) {
  int i = 0, numTokens = 1;
  while (stringIn[i] != '\0') {
    if (stringIn[i] == delim) {
      numTokens++;
    }
    i++;
  }
  return numTokens;
}


x86 assembly (clang, -O0):
<tokenCounter>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <tokenCounter+0x60>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1152 <tokenCounter+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <tokenCounter+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenCounter>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <tokenCounter+0x26>
add    $0x1,%rdi
mov    $0x1,%eax
nop
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <tokenCounter+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @tokenCounter(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ 1, %2 ]
%9 = icmp eq i8 %7, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 1, %2 ], [ %11, %5 ]
ret i32 %17
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ flash();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_flash(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(flash());
}


x86 assembly (clang, -O0):
<cmd_flash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_flash+0x27>
jmp    117f <cmd_flash+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1060 <flash@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_flash>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_flash+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1060 <flash@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_flash(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 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @flash()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_flash(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @flash()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
int test_imm_C7uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xC7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C7uint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xc7,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C7uint64_lowword_mem>:
testb  $0xc7,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C7uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 199
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float foo(float);
void main(int argc, char *argv[]) {
  float arg1 = -2.1;
  float ret = foo(arg1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <foo@plt>
movss  %xmm0,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movss  0xee8(%rip),%xmm0
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float @foo(float 0xC000CCCCC0000000)
ret void
}
int dvfs_debugfs_init(struct dentry *clk_debugfs_root) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @dvfs_debugfs_init(%struct.dentry* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skipSpace(char *p) {
  while (isspace(*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<skipSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipSpace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipSpace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipSpace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipSpace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skipSpace(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 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @skipSpace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct stat {
  int dummy;
};
typedef int int32_t;

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int32_t IsDreambox() {
  struct stat buffer;
  return (stat("/proc/stb/tpm/0/serial", &buffer) == 0);
}


x86 assembly (clang, -O0):
<IsDreambox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDreambox>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [23 x i8] c"/proc/stb/tpm/0/serial\00"
define i32 @IsDreambox() {
%1 = alloca %struct.stat
%2 = call i64 @stat(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [23 x i8] c"/proc/stb/tpm/0/serial\00"
define i32 @IsDreambox() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i64 @stat(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
bool string(char c) { return c == '"'; }


x86 assembly (clang, -O0):
<string>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x22,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string>:
xor    %eax,%eax
cmp    $0x22,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @string(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 34
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @string(i8 signext %0) {
%2 = icmp eq i8 %0, 34
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned int foo(unsigned short x) { return x ? __builtin_clz(x) : 16U; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     112a <foo+0x2a>
movzwl -0x2(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <foo+0x37>
mov    $0x10,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <foo+0x37>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
je     110e <foo+0xe>
movzwl %di,%eax
bsr    %eax,%eax
xor    $0x1f,%eax
ret
mov    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @foo(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = call i32 @llvm.ctlz.i32(i32 %8, i1 true)
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ 16, %10 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @foo(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = zext i16 %0 to i32
%5 = tail call i32 @llvm.ctlz.i32(i32 %4, i1 true)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 16, %1 ]
ret i32 %7
}
long sequence_l(unsigned char **signal) {
  long v = (*signal)[0] | ((*signal)[1] << 8) | ((*signal)[2] << 16) |
           ((*signal)[3] << 24);
  *signal += 4;
  return v;
}


x86 assembly (clang, -O0):
<sequence_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequence_l>:
mov    (%rdi),%rcx
movslq (%rcx),%rax
add    $0x4,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i64 @sequence_l(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %2, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %2, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl nuw i32 %17, 24
%19 = or i32 %14, %18
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %2, i64 4
store i8* %21, i8** %0
ret i64 %20
}
/* Variables and functions */
int core6_swap(char *, int);
int U_EMRPOLYLINE16_swap(char *record, int torev) {
  return (core6_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYLINE16_swap>:
jmp    1030 <core6_swap@plt>

LLVM IR (-O0):
define i32 @U_EMRPOLYLINE16_swap(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 = load i32, i32* %4
%7 = call i32 @core6_swap(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_EMRPOLYLINE16_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core6_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int foo(int);
main() {
  if (foo(9) != 10)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x9,%edi
call   1040 <foo@plt>
cmp    $0xa,%eax
je     1159 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1040 <foo@plt>
cmp    $0xa,%eax
jne    1147 <main+0x17>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 9)
%3 = icmp ne i32 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 9)
%2 = icmp eq i32 %1, 10
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
extern int TakeUint8(unsigned char x) {
  if (x == 0xFE)
    return 10;
  return 0;
}


x86 assembly (clang, -O0):
<TakeUint8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0xfe,%eax
jne    1125 <TakeUint8+0x25>
movl   $0xa,-0x4(%rbp)
jmp    112c <TakeUint8+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TakeUint8>:
xor    %ecx,%ecx
cmp    $0xfe,%dil
mov    $0xa,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @TakeUint8(i8 zeroext %0) {
%2 = icmp eq i8 %0, -2
%3 = select i1 %2, i32 10, i32 0
ret i32 %3
}
unsigned long hash(const char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
void smpboot_clear_io_apic(void) {}


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

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

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

LLVM IR (-O2):
define void @smpboot_clear_io_apic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_ll_has_cycle();
int main(void) {
  test_ll_has_cycle();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_ll_has_cycle@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_ll_has_cycle()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_ll_has_cycle()
ret i32 0
}
/* Type definitions */
struct response {
  int dummy;
};

/* Variables and functions */
char *xml_read_chars(char *, struct response *);
char *parse_start_session_res(struct response *res) {
  return xml_read_chars("/SessionInfo/SID", res);
}


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

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

LLVM IR (-O0):
%struct.response = type { i32 }
@.str = [17 x i8] c"/SessionInfo/SID\00"
define i8* @parse_start_session_res(%struct.response* %0) {
%2 = alloca %struct.response*
store %struct.response* %0, %struct.response** %2
%3 = load %struct.response*, %struct.response** %2
%4 = call i8* @xml_read_chars(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), %struct.response* %3)
ret i8* %4
}

LLVM IR (-O2):
%struct.response = type { i32 }
@.str = [17 x i8] c"/SessionInfo/SID\00"
define i8* @parse_start_session_res(%struct.response* %0) {
%2 = tail call i8* @xml_read_chars(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), %struct.response* %0)
ret i8* %2
}
void ext() {}


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

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

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

LLVM IR (-O2):
define void @ext() {
ret void
}
int my_mul(int nb1, int nb2) {
  int result;
  result = nb1 * nb2;
  return (result);
}


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

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

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

LLVM IR (-O2):
define i32 @my_mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
unsigned cache_size(void) {
  unsigned cs = 0;
  if (cs == 0) {
    static int warned;
    if (!warned) {
      printf("Cannot determine CPU cache size\n");
      warned = 1;
    }
    cs = 64 * 1024 * 1024;
  }
  cs *= 2;
  return cs;
}


x86 assembly (clang, -O0):
<cache_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1153 <cache_size+0x43>
cmpl   $0x0,0x2efc(%rip)
jne    114c <cache_size+0x3c>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,0x2ee0(%rip)
movl   $0x4000000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_size>:
push   %rax
cmpb   $0x0,0x2f14(%rip)
jne    112d <cache_size+0x1d>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
movb   $0x1,0x2eff(%rip)
mov    $0x8000000,%eax
pop    %rcx
ret

LLVM IR (-O0):
@cache_size.warned = internal global i32 0
@.str = [33 x i8] c"Cannot determine CPU cache size\0A\00"
define i32 @cache_size() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = load i32, i32* @cache_size.warned
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* @cache_size.warned
br label %9
9: ; preds = %7, %4
store i32 67108864, i32* %1
br label %10
10: ; preds = %9, %0
%11 = load i32, i32* %1
%12 = mul i32 %11, 2
store i32 %12, i32* %1
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@cache_size.warned = internal unnamed_addr global i1 false
@str = [32 x i8] c"Cannot determine CPU cache size\00"
define i32 @cache_size() {
%1 = load i1, i1* @cache_size.warned
br i1 %1, label %4, label %2
2: ; preds = %0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
store i1 true, i1* @cache_size.warned
br label %4
4: ; preds = %0, %2
ret i32 134217728
}
void pkf_storage_init(struct pkf_storage *storage) {}


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

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

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

LLVM IR (-O2):
%struct.pkf_storage = type opaque
define void @pkf_storage_init(%struct.pkf_storage* nocapture %0) {
ret void
}
int lower_bound(const int *array, int start, int end, const int value) {
  int i;
  while (start < end) {
    i = start + ((end - start) >> 1);
    if (array[i] < value)
      start = i + 1;
    else
      end = i;
  }
  return start;
}


x86 assembly (clang, -O0):
<lower_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115b <lower_bound+0x5b>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jge    1150 <lower_bound+0x50>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <lower_bound+0x56>
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1111 <lower_bound+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_bound>:
mov    %esi,%eax
cmp    %esi,%edx
jg     1117 <lower_bound+0x17>
jmp    1136 <lower_bound+0x36>
nopl   0x0(%rax,%rax,1)
mov    %r8d,%edx
cmp    %eax,%edx
jle    1136 <lower_bound+0x36>
mov    %edx,%r9d
sub    %eax,%r9d
sar    %r9d
lea    (%r9,%rax,1),%r8d
movslq %r8d,%rsi
cmp    %ecx,(%rdi,%rsi,4)
jge    1110 <lower_bound+0x10>
add    %r9d,%eax
add    $0x1,%eax
cmp    %eax,%edx
jg     1117 <lower_bound+0x17>
ret

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

LLVM IR (-O2):
define i32 @lower_bound(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, %1
br i1 %5, label %6, label %20
6: ; preds = %4, %6
%7 = phi i32 [ %18, %6 ], [ %1, %4 ]
%8 = phi i32 [ %17, %6 ], [ %2, %4 ]
%9 = sub nsw i32 %8, %7
%10 = ashr i32 %9, 1
%11 = add nsw i32 %10, %7
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp slt i32 %14, %3
%16 = add nsw i32 %11, 1
%17 = select i1 %15, i32 %8, i32 %11
%18 = select i1 %15, i32 %16, i32 %7
%19 = icmp sgt i32 %17, %18
br i1 %19, label %6, label %20
20: ; preds = %6, %4
%21 = phi i32 [ %1, %4 ], [ %18, %6 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int objAtk(void *self, int dmg) {
  printf("You can't attack that");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"You can't attack that\00"
define i32 @objAtk(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"You can't attack that\00"
define i32 @objAtk(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}