xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cdoFinish();
int /*<<< orphan*/ cdoInitialize(void *);
void *Test(void *argument) {
  cdoInitialize(argument);
  cdoFinish();
  return (0);
}


x86 assembly (clang, -O0):
<Test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cdoInitialize@plt>
mov    $0x0,%al
call   1030 <cdoFinish@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test>:
push   %rax
call   1040 <cdoInitialize@plt>
xor    %eax,%eax
call   1030 <cdoFinish@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @Test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cdoInitialize(i8* %3)
%5 = call i32 (...) @cdoFinish()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @Test(i8* %0) {
%2 = tail call i32 @cdoInitialize(i8* %0)
%3 = tail call i32 (...) @cdoFinish()
ret i8* null
}
unsigned long long f2(signed char n) { return (long double)n; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i64 @f2(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sitofp i8 %3 to x86_fp80
%5 = fptoui x86_fp80 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @f2(i8 signext %0) {
%2 = zext i8 %0 to i64
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ heap_mbuff_size();
int /*<<< orphan*/ heap_msg_size();
void dump_heap(FILE *file) {
  fprintf(file, "HEAP( mbuff: %ld, msg: %ld )\n", heap_mbuff_size(),
          heap_msg_size());
}


x86 assembly (clang, -O0):
<dump_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <heap_mbuff_size@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <heap_msg_size@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe9b(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_heap>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <heap_mbuff_size@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <heap_msg_size@plt>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"HEAP( mbuff: %ld, msg: %ld )\0A\00"
define void @dump_heap(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (...) @heap_mbuff_size()
%5 = call i32 (...) @heap_msg_size()
%6 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"HEAP( mbuff: %ld, msg: %ld )\0A\00"
define void @dump_heap(i32* nocapture %0) {
%2 = tail call i32 (...) @heap_mbuff_size()
%3 = tail call i32 (...) @heap_msg_size()
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret void
}
void __DELETE_java_lang_NoSuchFieldException(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_NoSuchFieldException(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int base128_blksize_raw() { return 7; }


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

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

LLVM IR (-O0):
define i32 @base128_blksize_raw() {
ret i32 7
}

LLVM IR (-O2):
define i32 @base128_blksize_raw() {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ lcd_putStr_at(int, int, char *);
void lcd_format() {
  lcd_putStr_at(1, 0, "T:      ");
  lcd_putStr_at(1, 8, "C        ");
  lcd_putStr_at(2, 0, "H:      ");
  lcd_putStr_at(2, 8, "%        ");
}


x86 assembly (clang, -O0):
<lcd_format>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
lea    0xede(%rip),%rdx
call   1030 <lcd_putStr_at@plt>
mov    $0x1,%edi
mov    $0x8,%esi
lea    0xed1(%rip),%rdx
call   1030 <lcd_putStr_at@plt>
mov    $0x2,%edi
xor    %esi,%esi
lea    0xec8(%rip),%rdx
call   1030 <lcd_putStr_at@plt>
mov    $0x2,%edi
mov    $0x8,%esi
lea    0xebb(%rip),%rdx
call   1030 <lcd_putStr_at@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_format>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <lcd_putStr_at@plt>
lea    0xede(%rip),%rdx
mov    $0x1,%edi
mov    $0x8,%esi
call   1030 <lcd_putStr_at@plt>
lea    0xed2(%rip),%rdx
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <lcd_putStr_at@plt>
lea    0xec8(%rip),%rdx
mov    $0x2,%edi
mov    $0x8,%esi
pop    %rax
jmp    1030 <lcd_putStr_at@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"T: \00"
@.str.1 = [10 x i8] c"C \00"
@.str.2 = [9 x i8] c"H: \00"
@.str.3 = [10 x i8] c"% \00"
define void @lcd_format() {
%1 = call i32 @lcd_putStr_at(i32 1, i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @lcd_putStr_at(i32 1, i32 8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @lcd_putStr_at(i32 2, i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @lcd_putStr_at(i32 2, i32 8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"T: \00"
@.str.1 = [10 x i8] c"C \00"
@.str.2 = [9 x i8] c"H: \00"
@.str.3 = [10 x i8] c"% \00"
define void @lcd_format() {
%1 = tail call i32 @lcd_putStr_at(i32 1, i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @lcd_putStr_at(i32 1, i32 8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @lcd_putStr_at(i32 2, i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @lcd_putStr_at(i32 2, i32 8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EOF;
int recv(int, char *, int, int /*<<< orphan*/);
int skgetc(int *sd) {
  int c = 0;
  int r = recv(*sd, (char *)&c, 1, 0);
  if (r == 0 || r == -1) {
    ;
    c = EOF;
  };
  return c;
}


x86 assembly (clang, -O0):
<skgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1150 <skgetc+0x40>
cmpl   $0xffffffff,-0x10(%rbp)
jne    115c <skgetc+0x4c>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skgetc>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
mov    (%rdi),%edi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x1,%eax
cmp    $0x2,%eax
jae    1142 <skgetc+0x32>
mov    0x2ea6(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @skgetc(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = bitcast i32* %3 to i8*
%8 = call i32 @recv(i32 %6, i8* %7, i32 1, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %11, %1
%15 = load i32, i32* @EOF
store i32 %15, i32* %3
br label %16
16: ; preds = %14, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @skgetc(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* %0
%5 = call i32 @recv(i32 %4, i8* %3, i32 1, i32 0)
%6 = add i32 %5, 1
%7 = icmp ult i32 %6, 2
%8 = load i32, i32* %2
%9 = load i32, i32* @EOF
%10 = select i1 %7, i32 %9, i32 %8
ret i32 %10
}
void lsdn_names_free(struct lsdn_names *tab) { ((void)(tab)); }


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

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

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

LLVM IR (-O2):
%struct.lsdn_names = type opaque
define void @lsdn_names_free(%struct.lsdn_names* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned int hweight32(unsigned int w) {
  unsigned int res = w - ((w >> 1) & 0x55555555);
  res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
  res = (res + (res >> 4)) & 0x0F0F0F0F;
  res = res + (res >> 8);
  return (res + (res >> 16)) & 0x000000FF;
}


x86 assembly (clang, -O0):
<hweight32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x33333333,%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight32>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @hweight32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 1431655765
%8 = sub i32 %4, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = and i32 %9, 858993459
%11 = load i32, i32* %3
%12 = lshr i32 %11, 2
%13 = and i32 %12, 858993459
%14 = add i32 %10, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = lshr i32 %16, 4
%18 = add i32 %15, %17
%19 = and i32 %18, 252645135
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = load i32, i32* %3
%22 = lshr i32 %21, 8
%23 = add i32 %20, %22
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = load i32, i32* %3
%26 = lshr i32 %25, 16
%27 = add i32 %24, %26
%28 = and i32 %27, 255
ret i32 %28
}

LLVM IR (-O2):
define i32 @hweight32(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = lshr i32 %11, 8
%13 = add nuw nsw i32 %12, %11
%14 = lshr i32 %13, 16
%15 = add nuw nsw i32 %14, %13
%16 = and i32 %15, 63
ret i32 %16
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t int32min(int32_t a, int32_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<int32min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <int32min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <int32min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int32min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @int32min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @int32min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_append();
int /*<<< orphan*/ test_create();
int /*<<< orphan*/ test_create_node();
int /*<<< orphan*/ test_delete();
int /*<<< orphan*/ test_pop();
int /*<<< orphan*/ test_push();
int /*<<< orphan*/ test_shift();
int /*<<< orphan*/ test_size();
int main(void) {
  test_create_node();
  test_create();
  test_push();
  test_append();
  test_size();
  test_pop();
  test_shift();
  test_delete();
  printf("All tests passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_create_node@plt>
mov    $0x0,%al
call   10b0 <test_create@plt>
mov    $0x0,%al
call   1090 <test_push@plt>
mov    $0x0,%al
call   10a0 <test_append@plt>
mov    $0x0,%al
call   1040 <test_size@plt>
mov    $0x0,%al
call   1060 <test_pop@plt>
mov    $0x0,%al
call   1030 <test_shift@plt>
mov    $0x0,%al
call   1080 <test_delete@plt>
lea    0xe22(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_create_node@plt>
xor    %eax,%eax
call   10b0 <test_create@plt>
xor    %eax,%eax
call   1090 <test_push@plt>
xor    %eax,%eax
call   10a0 <test_append@plt>
xor    %eax,%eax
call   1050 <test_size@plt>
xor    %eax,%eax
call   1060 <test_pop@plt>
xor    %eax,%eax
call   1030 <test_shift@plt>
xor    %eax,%eax
call   1080 <test_delete@plt>
lea    0xe30(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"All tests passed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_create_node()
%3 = call i32 (...) @test_create()
%4 = call i32 (...) @test_push()
%5 = call i32 (...) @test_append()
%6 = call i32 (...) @test_size()
%7 = call i32 (...) @test_pop()
%8 = call i32 (...) @test_shift()
%9 = call i32 (...) @test_delete()
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"All tests passed\00"
define i32 @main() {
%1 = tail call i32 (...) @test_create_node()
%2 = tail call i32 (...) @test_create()
%3 = tail call i32 (...) @test_push()
%4 = tail call i32 (...) @test_append()
%5 = tail call i32 (...) @test_size()
%6 = tail call i32 (...) @test_pop()
%7 = tail call i32 (...) @test_shift()
%8 = tail call i32 (...) @test_delete()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_outl(unsigned int, int);
unsigned pci_locate_device(unsigned addr) {
  addr &= ~0xff;
  for (; addr <= 0x00ffff00; addr += 0x00000100) {
    __builtin_outl(addr, 0x12);
  }
  return addr;
}


x86 assembly (clang, -O0):
<pci_locate_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff00,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xffff00,-0x4(%rbp)
ja     1150 <pci_locate_device+0x40>
mov    -0x4(%rbp),%edi
mov    $0x12,%esi
call   1030 <__builtin_outl@plt>
mov    -0x4(%rbp),%eax
add    $0x100,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <pci_locate_device+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_locate_device>:
push   %rbx
mov    %edi,%ebx
and    $0xffffff00,%ebx
cmp    $0xffff00,%ebx
ja     114e <pci_locate_device+0x3e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    $0x12,%esi
call   1030 <__builtin_outl@plt>
lea    0x100(%rbx),%eax
cmp    $0xfffe01,%ebx
mov    %eax,%ebx
jb     1130 <pci_locate_device+0x20>
pop    %rbx
ret
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pci_locate_device(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -256
store i32 %4, i32* %2
br label %5
5: ; preds = %11, %1
%6 = load i32, i32* %2
%7 = icmp ule i32 %6, 16776960
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %2
%10 = call i32 @__builtin_outl(i32 %9, i32 18)
br label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = add i32 %12, 256
store i32 %13, i32* %2
br label %5
14: ; preds = %5
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @pci_locate_device(i32 %0) {
%2 = and i32 %0, -256
%3 = icmp ult i32 %2, 16776961
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @__builtin_outl(i32 %5, i32 18)
%7 = add nuw nsw i32 %5, 256
%8 = icmp ult i32 %5, 16776705
br i1 %8, label %4, label %9
9: ; preds = %4, %1
%10 = phi i32 [ %2, %1 ], [ %7, %4 ]
ret i32 %10
}
long long proc5() { return 0xaabbccddLL; }


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

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

LLVM IR (-O0):
define i64 @proc5() {
ret i64 2864434397
}

LLVM IR (-O2):
define i64 @proc5() {
ret i64 2864434397
}
/* Variables and functions */
int /*<<< orphan*/ ABMON_9;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_abmon_9() { return nl_langinfo(ABMON_9); }


x86 assembly (clang, -O0):
<langinfo_abmon_9>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_abmon_9>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ABMON_9 = global i32 0
define i8* @langinfo_abmon_9() {
%1 = load i32, i32* @ABMON_9
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ABMON_9 = global i32 0
define i8* @langinfo_abmon_9() {
%1 = load i32, i32* @ABMON_9
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t extract_variantkey_pos(uint64_t vk) {
  return (uint32_t)((vk & 0x07FFFFFF80000000) >> 31);
}


x86 assembly (clang, -O0):
<extract_variantkey_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x7ffffff80000000,%rcx
ff ff 07
and    %rcx,%rax
sar    $0x1f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_variantkey_pos>:
mov    %edi,%eax
sar    $0x1f,%eax
and    $0xfffffff,%eax
ret

LLVM IR (-O0):
define i32 @extract_variantkey_pos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, 576460750155939840
%6 = ashr i64 %5, 31
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @extract_variantkey_pos(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 268435455, i32 0
ret i32 %3
}
void v_add(double *A, double *B, double *C) {
  register int i;
  for (i = 0; i < 3; i++) {
    C[i] = B[i] + A[i];
  }
}


x86 assembly (clang, -O0):
<v_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1156 <v_add+0x56>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <v_add+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_add>:
movsd  (%rsi),%xmm0
addsd  (%rdi),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rsi),%xmm0
addsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  0x10(%rsi),%xmm0
addsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdx)
ret

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

LLVM IR (-O2):
define void @v_add(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %1
%5 = load double, double* %0
%6 = fadd double %4, %5
store double %6, double* %2
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %0, i64 1
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = getelementptr inbounds double, double* %2, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %0, i64 2
%16 = load double, double* %15
%17 = fadd double %14, %16
%18 = getelementptr inbounds double, double* %2, i64 2
store double %17, double* %18
ret void
}
unsigned short highest_order_bit_s(unsigned short n) {
  n |= (n >> 1);
  n |= (n >> 2);
  n |= (n >> 4);
  n |= (n >> 8);
  return (unsigned short)(n - (n >> 1));
}


x86 assembly (clang, -O0):
<highest_order_bit_s>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
sar    $0x1,%ecx
movzwl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
sar    $0x2,%ecx
movzwl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
sar    $0x4,%ecx
movzwl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
sar    $0x8,%ecx
movzwl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x2(%rbp),%ecx
sar    $0x1,%ecx
sub    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<highest_order_bit_s>:
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x4,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x8,%eax
or     %edx,%eax
mov    %eax,%ecx
shr    %ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @highest_order_bit_s(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 1
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = or i32 %7, %5
%9 = trunc i32 %8 to i16
store i16 %9, i16* %2
%10 = load i16, i16* %2
%11 = zext i16 %10 to i32
%12 = ashr i32 %11, 2
%13 = load i16, i16* %2
%14 = zext i16 %13 to i32
%15 = or i32 %14, %12
%16 = trunc i32 %15 to i16
store i16 %16, i16* %2
%17 = load i16, i16* %2
%18 = zext i16 %17 to i32
%19 = ashr i32 %18, 4
%20 = load i16, i16* %2
%21 = zext i16 %20 to i32
%22 = or i32 %21, %19
%23 = trunc i32 %22 to i16
store i16 %23, i16* %2
%24 = load i16, i16* %2
%25 = zext i16 %24 to i32
%26 = ashr i32 %25, 8
%27 = load i16, i16* %2
%28 = zext i16 %27 to i32
%29 = or i32 %28, %26
%30 = trunc i32 %29 to i16
store i16 %30, i16* %2
%31 = load i16, i16* %2
%32 = zext i16 %31 to i32
%33 = load i16, i16* %2
%34 = zext i16 %33 to i32
%35 = ashr i32 %34, 1
%36 = sub nsw i32 %32, %35
%37 = trunc i32 %36 to i16
ret i16 %37
}

LLVM IR (-O2):
define zeroext i16 @highest_order_bit_s(i16 zeroext %0) {
%2 = lshr i16 %0, 1
%3 = or i16 %2, %0
%4 = lshr i16 %3, 2
%5 = or i16 %4, %3
%6 = lshr i16 %5, 4
%7 = or i16 %6, %5
%8 = lshr i16 %7, 8
%9 = or i16 %8, %7
%10 = lshr i16 %9, 1
%11 = sub i16 %9, %10
ret i16 %11
}
void __gnu_unwind_frame() {}


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

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

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

LLVM IR (-O2):
define void @__gnu_unwind_frame() {
ret void
}
void remove_keyb_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @remove_keyb_handler() {
ret void
}
int event_del(struct event *ev) {
  (void)ev;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.event = type opaque
define i32 @event_del(%struct.event* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *exadd(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
char *rmchr(char *, char);
int main(void) {
  printf("%s\n", exadd("18782.94", "5.54"));
  printf("%s\n", rmchr("fjodaooo", 'o'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <exadd@plt>
mov    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1050 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x6f,%esi
call   1040 <rmchr@plt>
mov    %rax,%rsi
lea    0xe84(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xecc(%rip),%rdi
lea    0xece(%rip),%rsi
call   1030 <exadd@plt>
lea    0xeb5(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x6f,%esi
call   1040 <rmchr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"18782.94\00"
@.str.2 = [5 x i8] c"5.54\00"
@.str.3 = [9 x i8] c"fjodaooo\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* @exadd(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @rmchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8 signext 111)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"18782.94\00"
@.str.2 = [5 x i8] c"5.54\00"
@.str.3 = [9 x i8] c"fjodaooo\00"
define i32 @main() {
%1 = tail call i8* @exadd(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* @rmchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8 signext 111)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteChar(int);
void iRobot_Stop() { SerialWriteChar(173); }


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

x86 assembly (clang, -O2):
<iRobot_Stop>:
mov    $0xad,%edi
jmp    1030 <SerialWriteChar@plt>

LLVM IR (-O0):
define void @iRobot_Stop() {
%1 = call i32 @SerialWriteChar(i32 173)
ret void
}

LLVM IR (-O2):
define void @iRobot_Stop() {
%1 = tail call i32 @SerialWriteChar(i32 173)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *getString(char *inFunc) {
  strcpy(inFunc, "hello world");
  return inFunc;
}


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

x86 assembly (clang, -O2):
<getString>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i8* @getString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i8* @getString(i8* returned %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M150_f(char *s) {
  debug("M150_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M150_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M150_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M150_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M150_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M150_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M150_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
char *give_string() { return "am string"; }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"am string\00"
define i8* @give_string() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"am string\00"
define i8* @give_string() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double pow(int, double);
double Tween_ExponentialInEasing(double k) {
  return k == 0 ? 0 : pow(1024, k - 1);
}


x86 assembly (clang, -O0):
<Tween_ExponentialInEasing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1142 <Tween_ExponentialInEasing+0x32>
jp     1142 <Tween_ExponentialInEasing+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1162 <Tween_ExponentialInEasing+0x52>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x400,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_ExponentialInEasing>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1121 <Tween_ExponentialInEasing+0x11>
jp     1121 <Tween_ExponentialInEasing+0x11>
xorpd  %xmm0,%xmm0
ret
addsd  0xed7(%rip),%xmm0
mov    $0x400,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @Tween_ExponentialInEasing(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %10
6: ; preds = %1
%7 = load double, double* %2
%8 = fsub double %7, 1.000000e+00
%9 = call double @pow(i32 1024, double %8)
br label %10
10: ; preds = %6, %5
%11 = phi double [ 0.000000e+00, %5 ], [ %9, %6 ]
ret double %11
}

LLVM IR (-O2):
define double @Tween_ExponentialInEasing(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fadd double %0, -1.000000e+00
%5 = tail call double @pow(i32 1024, double %4)
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ 0.000000e+00, %1 ]
ret double %7
}
int fn4(int x, int y) { return ~(y & x) & x; }


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

x86 assembly (clang, -O2):
<fn4>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn4(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 = and i32 %5, %6
%8 = xor i32 %7, -1
%9 = load i32, i32* %3
%10 = and i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @fn4(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
size_t strlen(char const *);
int strncmp(char const *, char const *, size_t);
int strcmpend(const char *s1, const char *s2) {
  size_t n1 = strlen(s1);
  size_t n2 = strlen(s2);
  if (n2 <= n1) {
    return strncmp(s1 + n1 - n2, s2, n2);
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<strcmpend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     117e <strcmpend+0x5e>
mov    -0x10(%rbp),%rdi
add    -0x20(%rbp),%rdi
xor    %eax,%eax
sub    -0x28(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <strncmp@plt>
mov    %eax,-0x4(%rbp)
jmp    1185 <strcmpend+0x65>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmpend>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    %r15,%rax
jbe    114b <strcmpend+0x2b>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
add    %r15,%rbx
sub    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @strcmpend(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ugt i64 %4, %3
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 %3
%8 = sub i64 0, %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = tail call i32 @strncmp(i8* %9, i8* %1, i64 %4)
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ 1, %2 ]
ret i32 %12
}
unsigned int cpuid_eax(unsigned value) {
  unsigned int res;
  asm volatile("cpuid" : "=a"(res) : "a"(value) : "ebx", "ecx", "edx");
  return res;
}


x86 assembly (clang, -O0):
<cpuid_eax>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_eax>:
push   %rbx
mov    %edi,%eax
cpuid
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_eax(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "cpuid", "={ax},{ax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @cpuid_eax(i32 %0) {
%2 = tail call i32 asm sideeffect "cpuid", "={ax},{ax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sum_array(int const *, int const *, int *);
void gc_main(const int *g, const int *e, int *o) { sum_array(g, e, o); }


x86 assembly (clang, -O0):
<gc_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sum_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gc_main>:
jmp    1030 <sum_array@plt>

LLVM IR (-O0):
define void @gc_main(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** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @sum_array(i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @gc_main(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @sum_array(i32* %0, i32* %1, i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_castpd_si128(int /*<<< orphan*/);
__m128i test_mm_castpd_si128(__m128d A) { return _mm_castpd_si128(A); }


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

x86 assembly (clang, -O2):
<test_mm_castpd_si128>:
jmp    1030 <_mm_castpd_si128@plt>

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

LLVM IR (-O2):
define i32 @test_mm_castpd_si128(i32 %0) {
%2 = tail call i32 @_mm_castpd_si128(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
double ceil(double);
int /*<<< orphan*/ isfinite(double);
double az_mod2pi_nonpos(double theta) {
  assert(isfinite(theta));
  return theta - 6.2831853071795862 * ceil(theta / 6.2831853071795862);
}


x86 assembly (clang, -O0):
<az_mod2pi_nonpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <isfinite@plt>
mov    %eax,%edi
call   1040 <assert@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xe85(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<az_mod2pi_nonpos>:
push   %rax
movsd  %xmm0,(%rsp)
call   1050 <isfinite@plt>
mov    %eax,%edi
call   1040 <assert@plt>
movsd  (%rsp),%xmm0
divsd  0xeb1(%rip),%xmm0
call   1030 <ceil@plt>
mulsd  0xeac(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @az_mod2pi_nonpos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @isfinite(double %3)
%5 = call i32 @assert(i32 %4)
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fdiv double %7, 0x401921FB54442D18
%9 = call double @llvm.ceil.f64(double %8)
%10 = call double @llvm.fmuladd.f64(double 0xC01921FB54442D18, double %9, double %6)
ret double %10
}

LLVM IR (-O2):
define double @az_mod2pi_nonpos(double %0) {
%2 = tail call i32 @isfinite(double %0)
%3 = tail call i32 @assert(i32 %2)
%4 = fdiv double %0, 0x401921FB54442D18
%5 = tail call double @llvm.ceil.f64(double %4)
%6 = tail call double @llvm.fmuladd.f64(double %5, double 0xC01921FB54442D18, double %0)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void _warning(char *m) { fprintf(stderr, "%s", m); }


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @_warning(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void camc_sa(const int c, const int n, const int a, const int f, const int r) {}


x86 assembly (clang, -O0):
<camc_sa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @camc_sa(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @camc_sa(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Third line\n");
  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),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Third line\0A\00"
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 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Third line\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(size_t);
int wcslen(int /*<<< orphan*/ const *);
int /*<<< orphan*/ *wmemcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                            size_t);
wchar_t *wcsdup(const wchar_t *str) {
  wchar_t *copy;
  size_t len;
  len = wcslen(str) + 1;
  copy = malloc(len * sizeof(wchar_t));
  if (!copy)
    return NULL;
  return wmemcpy(copy, str, len);
}


x86 assembly (clang, -O0):
<wcsdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <wcslen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
shl    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1177 <wcsdup+0x47>
movq   $0x0,-0x8(%rbp)
jmp    118c <wcsdup+0x5c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <wmemcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <wcslen@plt>
movslq %eax,%rbx
lea    0x4(,%rbx,4),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     116a <wcsdup+0x3a>
add    $0x1,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <wmemcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @wcsdup(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i64
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @wcslen(i32* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = mul i64 %10, 4
%12 = call i32* @malloc(i64 %11)
store i32* %12, i32** %4
%13 = load i32*, i32** %4
%14 = icmp ne i32* %13, null
br i1 %14, label %16, label %15
15: ; preds = %1
store i32* null, i32** %2
br label %21
16: ; preds = %1
%17 = load i32*, i32** %4
%18 = load i32*, i32** %3
%19 = load i64, i64* %5
%20 = call i32* @wmemcpy(i32* %17, i32* %18, i64 %19)
store i32* %20, i32** %2
br label %21
21: ; preds = %16, %15
%22 = load i32*, i32** %2
ret i32* %22
}

LLVM IR (-O2):
define i32* @wcsdup(i32* %0) {
%2 = tail call i32 @wcslen(i32* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = shl nsw i64 %4, 2
%6 = tail call i32* @malloc(i64 %5)
%7 = icmp eq i32* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32* @wmemcpy(i32* %6, i32* %0, i64 %4)
br label %10
10: ; preds = %1, %8
%11 = phi i32* [ %9, %8 ], [ null, %1 ]
ret i32* %11
}