xunge/DecIR huggingface dataset:
void en(jm) {}


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

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

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

LLVM IR (-O2):
define void @en(i32 %0) {
ret void
}
void SLLIB_cleanUp(void) {}


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

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

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

LLVM IR (-O2):
define void @SLLIB_cleanUp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
void rotate(char *digits, int len) {
  char first = digits[0];
  memmove(&digits[0], &digits[1], len - 1);
  digits[len - 1] = first;
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <memmove@plt>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%r14b
lea    0x1(%rdi),%rax
movslq %esi,%rbp
lea    -0x1(%rbp),%rdx
mov    %rax,%rsi
call   1030 <memmove@plt>
mov    %r14b,-0x1(%rbx,%rbp,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @rotate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %5
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = call i32 @memmove(i8* %10, i8* %12, i32 %14)
%16 = load i8, i8* %5
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %17, i64 %20
store i8 %16, i8* %21
ret void
}

LLVM IR (-O2):
define void @rotate(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = add nsw i32 %1, -1
%6 = tail call i32 @memmove(i8* %0, i8* %4, i32 %5)
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %3, i8* %8
ret void
}
/* Variables and functions */
unsigned long long _blsi_u64(unsigned long long);
unsigned long long func_blsi64_2(unsigned long long X) { return _blsi_u64(X); }


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

x86 assembly (clang, -O2):
<func_blsi64_2>:
jmp    1030 <_blsi_u64@plt>

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

LLVM IR (-O2):
define i64 @func_blsi64_2(i64 %0) {
%2 = tail call i64 @_blsi_u64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ z80_ed_45_retn();
void z80_ed_6d_retn(void) { z80_ed_45_retn(); }


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

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

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

LLVM IR (-O2):
define void @z80_ed_6d_retn() {
%1 = tail call i32 (...) @z80_ed_45_retn()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eFree(char *);
char *popString();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ rmdir(char *);
void basRmDir() {
  char *name;
  name = popString();
  pushNumber(rmdir(name));
  eFree(name);
}


x86 assembly (clang, -O0):
<basRmDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rmdir@plt>
mov    %eax,%edi
call   1060 <pushNumber@plt>
mov    -0x8(%rbp),%rdi
call   1030 <eFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basRmDir>:
push   %rbx
xor    %eax,%eax
call   1050 <popString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <rmdir@plt>
mov    %eax,%edi
call   1060 <pushNumber@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <eFree@plt>

LLVM IR (-O0):
define void @basRmDir() {
%1 = alloca i8*
%2 = call i8* (...) @popString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @rmdir(i8* %3)
%5 = call i32 @pushNumber(i32 %4)
%6 = load i8*, i8** %1
%7 = call i32 @eFree(i8* %6)
ret void
}

LLVM IR (-O2):
define void @basRmDir() {
%1 = tail call i8* (...) @popString()
%2 = tail call i32 @rmdir(i8* %1)
%3 = tail call i32 @pushNumber(i32 %2)
%4 = tail call i32 @eFree(i8* %1)
ret void
}
int foo(long long a) {
  if (a & (long long)0x400)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x400,%rax
cmp    $0x0,%rax
je     1128 <foo+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <foo+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
shr    $0xa,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @foo(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, 1024
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, 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 @foo(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i32 %2, 10
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void md_bold_beg(FILE *fw, int term) {
  switch (term) {
  case 0:
    break;
  case 1:
    fprintf(fw, "<b>");
    break;
  case 2:
    fprintf(fw, "{\\bf ");
    break;
  }
}


x86 assembly (clang, -O0):
<md_bold_beg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1154 <md_bold_beg+0x44>
jmp    1132 <md_bold_beg+0x22>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1159 <md_bold_beg+0x49>
jmp    1143 <md_bold_beg+0x33>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     116e <md_bold_beg+0x5e>
jmp    117e <md_bold_beg+0x6e>
jmp    117e <md_bold_beg+0x6e>
mov    -0x8(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
jmp    117e <md_bold_beg+0x6e>
mov    -0x8(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md_bold_beg>:
mov    %rdi,%rcx
cmp    $0x2,%esi
je     1133 <md_bold_beg+0x23>
cmp    $0x1,%esi
jne    1149 <md_bold_beg+0x39>
lea    0xedc(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>
lea    0xeca(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>
ret

LLVM IR (-O0):
@.str = [4 x i8] c"<b>\00"
@.str.1 = [6 x i8] c"{\\bf \00"
define void @md_bold_beg(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
switch i32 %5, label %13 [
i32 0, label %6
i32 1, label %7
i32 2, label %10
]
6: ; preds = %2
br label %13
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %13
10: ; preds = %2
%11 = load i32*, i32** %3
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %2, %10, %7, %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"<b>\00"
@.str.1 = [6 x i8] c"{\\bf \00"
define void @md_bold_beg(i32* nocapture %0, i32 %1) {
switch i32 %1, label %7 [
i32 2, label %5
i32 1, label %3
]
3: ; preds = %2
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
br label %7
5: ; preds = %2
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 5, i64 1, i32* %0)
br label %7
7: ; preds = %2, %5, %3
ret void
}
/* Variables and functions */
int ds1621_read_value(int, int);
int /*<<< orphan*/ ds1621_write_value(int, int, int);
int reset_TLF(int dev_fd) {
  int reg;
  reg = ds1621_read_value(dev_fd, 0xAC);
  reg = reg & ~0x20;
  ds1621_write_value(dev_fd, 0xAC, reg & 0xfe);
}


x86 assembly (clang, -O0):
<reset_TLF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xac,%esi
call   1030 <ds1621_read_value@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
and    $0xfe,%edx
mov    $0xac,%esi
call   1040 <ds1621_write_value@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_TLF>:
push   %rbx
mov    %edi,%ebx
mov    $0xac,%esi
call   1030 <ds1621_read_value@plt>
and    $0xde,%eax
mov    %ebx,%edi
mov    $0xac,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <ds1621_write_value@plt>

LLVM IR (-O0):
define i32 @reset_TLF(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @ds1621_read_value(i32 %5, i32 172)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, -33
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = and i32 %10, 254
%12 = call i32 @ds1621_write_value(i32 %9, i32 172, i32 %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @reset_TLF(i32 %0) {
%2 = tail call i32 @ds1621_read_value(i32 %0, i32 172)
%3 = and i32 %2, 222
%4 = tail call i32 @ds1621_write_value(i32 %0, i32 172, i32 %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void __attribute__((regparm(3))) memcpy_3(void *dest, void *src) {
  memcpy(dest, src, 3);
}


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

x86 assembly (clang, -O2):
<memcpy_3>:
mov    $0x3,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @memcpy_3(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 3)
ret void
}
/* Variables and functions */
char *memchr(char const *, char, size_t);
char *next_line(const char *ptr, size_t len) {
  char *newline;
  newline = memchr(ptr, '\n', len);
  if (newline == NULL)
    return NULL;
  return newline + 1;
}


x86 assembly (clang, -O0):
<next_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xa,%esi
call   1030 <memchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114e <next_line+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    115a <next_line+0x4a>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_line>:
push   %rax
mov    %rsi,%rdx
mov    $0xa,%esi
call   1030 <memchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @next_line(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i8 signext 10, i64 %1)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* null, i8* %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *);
int /*<<< orphan*/ Label_Printf(char *);
void Dico_Long_Start(int nb_longs) {
  Label_Printf(".data");
  Inst_Printf(".align", "4");
}


x86 assembly (clang, -O0):
<Dico_Long_Start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <Label_Printf@plt>
lea    0xec8(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dico_Long_Start>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Label_Printf@plt>
lea    0xed2(%rip),%rdi
lea    0xed2(%rip),%rsi
pop    %rax
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c".data\00"
@.str.1 = [7 x i8] c".align\00"
@.str.2 = [2 x i8] c"4\00"
define void @Dico_Long_Start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @Label_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @Inst_Printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c".data\00"
@.str.1 = [7 x i8] c".align\00"
@.str.2 = [2 x i8] c"4\00"
define void @Dico_Long_Start(i32 %0) {
%2 = tail call i32 @Label_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t fread(void *, int, size_t, void *);
size_t def_read(void *buf, size_t bytes, void *uptr) {
  return uptr ? fread(buf, 1, bytes, uptr) : 0;
}


x86 assembly (clang, -O0):
<def_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114e <def_read+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    %rax,-0x20(%rbp)
jmp    1159 <def_read+0x49>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1159 <def_read+0x49>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<def_read>:
mov    %rdx,%rcx
test   %rdx,%rdx
je     1125 <def_read+0x15>
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <fread@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @def_read(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i64, i64* %5
%12 = load i8*, i8** %6
%13 = call i64 @fread(i8* %10, i32 1, i64 %11, i8* %12)
br label %15
14: ; preds = %3
br label %15
15: ; preds = %14, %9
%16 = phi i64 [ %13, %9 ], [ 0, %14 ]
ret i64 %16
}

LLVM IR (-O2):
define i64 @def_read(i8* nocapture %0, i64 %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i64 @fread(i8* %0, i32 1, i64 %1, i8* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i64 [ %6, %5 ], [ 0, %3 ]
ret i64 %8
}
double power(double a, int n) {
  double ret = 1;
  while (n) {
    if (n % 2 == 1)
      ret *= a;
    a *= a;
    n /= 2;
  }
  return ret;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1168 <power+0x68>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1146 <power+0x46>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1119 <power+0x19>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %edi,%edi
je     1156 <power+0x56>
movsd  0xef4(%rip),%xmm2
movapd %xmm2,%xmm1
mov    %edi,%eax
jmp    1134 <power+0x34>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mulsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm0
sar    %eax
add    $0x1,%edi
cmp    $0x2,%edi
mov    %eax,%edi
jbe    1151 <power+0x51>
shr    $0x1f,%eax
add    %edi,%eax
mov    %eax,%ecx
and    $0xfffffffe,%ecx
mov    %edi,%edx
sub    %ecx,%edx
movapd %xmm0,%xmm3
cmp    $0x1,%edx
je     1120 <power+0x20>
movapd %xmm2,%xmm3
jmp    1120 <power+0x20>
movapd %xmm1,%xmm0
ret
movsd  0xea2(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @power(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi double [ %11, %4 ], [ 1.000000e+00, %2 ]
%6 = phi i32 [ %13, %4 ], [ %1, %2 ]
%7 = phi double [ %12, %4 ], [ %0, %2 ]
%8 = srem i32 %6, 2
%9 = icmp eq i32 %8, 1
%10 = select i1 %9, double %7, double 1.000000e+00
%11 = fmul double %5, %10
%12 = fmul double %7, %7
%13 = sdiv i32 %6, 2
%14 = add i32 %6, 1
%15 = icmp ult i32 %14, 3
br i1 %15, label %16, label %4
16: ; preds = %4, %2
%17 = phi double [ 1.000000e+00, %2 ], [ %11, %4 ]
ret double %17
}
void swapArrayInts(int *arr, int i, int j) {
  int buffer = arr[i];
  arr[i] = arr[j];
  arr[j] = buffer;
}


x86 assembly (clang, -O0):
<swapArrayInts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapArrayInts>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swapArrayInts(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ system(char *);
int rp_app_init() {
  fprintf(stderr, "Starting HPSDR transceiver server.\n");
  system("/opt/redpitaya/www/apps/sdr_transceiver_hpsdr/start.sh");
  return 0;
}


x86 assembly (clang, -O0):
<rp_app_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xee4(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rp_app_init>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xee7(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Starting HPSDR transceiver server.\0A\00"
@.str.1 = [55 x i8] c"/opt/redpitaya/www/apps/sdr_transceiver_hpsdr/start.sh\00"
define i32 @rp_app_init() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Starting HPSDR transceiver server.\0A\00"
@.str.1 = [55 x i8] c"/opt/redpitaya/www/apps/sdr_transceiver_hpsdr/start.sh\00"
define i32 @rp_app_init() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long evalfieldcond();
scalar_t__ test(char *);
long evalwhere() {
  long val;
  for (val = evalfieldcond(); test("&&");) {
    if (!evalfieldcond() != 0)
      val = 0;
  }
  return (val);
}


x86 assembly (clang, -O0):
<evalwhere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <evalfieldcond@plt>
mov    %rax,-0x8(%rbp)
lea    0xec6(%rip),%rdi
call   1040 <test@plt>
cmp    $0x0,%rax
je     1174 <evalwhere+0x54>
mov    $0x0,%al
call   1030 <evalfieldcond@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     116f <evalwhere+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    1133 <evalwhere+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evalwhere>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <evalfieldcond@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
call   1040 <test@plt>
test   %rax,%rax
je     116b <evalwhere+0x4b>
lea    0xeba(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <evalfieldcond@plt>
test   %rax,%rax
cmove  %rax,%rbx
mov    %r14,%rdi
call   1040 <test@plt>
test   %rax,%rax
jne    1150 <evalwhere+0x30>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"&&\00"
define i64 @evalwhere() {
%1 = alloca i64
%2 = call i64 (...) @evalfieldcond()
store i64 %2, i64* %1
br label %3
3: ; preds = %13, %0
%4 = call i64 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = call i64 (...) @evalfieldcond()
%8 = icmp ne i64 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %6
store i64 0, i64* %1
br label %13
13: ; preds = %12, %6
br label %3
14: ; preds = %3
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"&&\00"
define i64 @evalwhere() {
%1 = tail call i64 (...) @evalfieldcond()
%2 = tail call i64 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i64 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i64 (...) @evalfieldcond()
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i64 0, i64 %5
%9 = tail call i64 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %0
%12 = phi i64 [ %1, %0 ], [ %8, %4 ]
ret i64 %12
}
void hc05_test(void) {}


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

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

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

LLVM IR (-O2):
define void @hc05_test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PPCMMU(int, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void MmuDumpMap() { PPCMMU(0x10e, 0, 0, 0); }


x86 assembly (clang, -O0):
<MmuDumpMap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10e,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <PPCMMU@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MmuDumpMap>:
mov    $0x10e,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <PPCMMU@plt>

LLVM IR (-O0):
define void @MmuDumpMap() {
%1 = call i32 @PPCMMU(i32 270, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @MmuDumpMap() {
%1 = tail call i32 @PPCMMU(i32 270, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int a;
  int b;
  a = 3;
  b = 2;
  __print_int(a << b);
  __print_int(4 << b);
  __print_int(4 << 1);
  a = 28;
  b = 1;
  __print_int(a >> b);
  __print_int(a >> 2);
  __print_int(8 >> 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%ecx
shl    %cl,%edi
call   1030 <__print_int@plt>
mov    -0xc(%rbp),%ecx
mov    $0x4,%edi
shl    %cl,%edi
call   1030 <__print_int@plt>
mov    $0x8,%edi
call   1030 <__print_int@plt>
movl   $0x1c,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%ecx
sar    %cl,%edi
call   1030 <__print_int@plt>
mov    -0x8(%rbp),%edi
sar    $0x2,%edi
call   1030 <__print_int@plt>
mov    $0x1,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1030 <__print_int@plt>
mov    $0x10,%edi
call   1030 <__print_int@plt>
mov    $0x8,%edi
call   1030 <__print_int@plt>
mov    $0xe,%edi
call   1030 <__print_int@plt>
mov    $0x7,%edi
call   1030 <__print_int@plt>
mov    $0x1,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = shl i32 %4, %5
%7 = call i32 @__print_int(i32 %6)
%8 = load i32, i32* %3
%9 = shl i32 4, %8
%10 = call i32 @__print_int(i32 %9)
%11 = call i32 @__print_int(i32 8)
store i32 28, i32* %2
store i32 1, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = ashr i32 %12, %13
%15 = call i32 @__print_int(i32 %14)
%16 = load i32, i32* %2
%17 = ashr i32 %16, 2
%18 = call i32 @__print_int(i32 %17)
%19 = call i32 @__print_int(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 12)
%2 = tail call i32 @__print_int(i32 16)
%3 = tail call i32 @__print_int(i32 8)
%4 = tail call i32 @__print_int(i32 14)
%5 = tail call i32 @__print_int(i32 7)
%6 = tail call i32 @__print_int(i32 1)
ret i32 0
}
void exynos_hdcp_attach_ddc_client(struct i2c_client *ddc) {}


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

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

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

LLVM IR (-O2):
%struct.i2c_client = type opaque
define void @exynos_hdcp_attach_ddc_client(%struct.i2c_client* nocapture %0) {
ret void
}
void libmsx264_init() {}


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

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

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

LLVM IR (-O2):
define void @libmsx264_init() {
ret void
}
/* Variables and functions */
double pow(double, double);
double _debug_pow(double x, double y) { return pow(x, y); }


x86 assembly (clang, -O0):
<_debug_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_debug_pow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @_debug_pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @_debug_pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t setBit_fun_uint16_t(uint16_t x, uint32_t i) { return x | 1 << i; }


x86 assembly (clang, -O0):
<setBit_fun_uint16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @setBit_fun_uint16_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
int test_imm_88uint16_reg(unsigned short val) {
  return ((val) & (-0x88 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_88uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff78,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_88uint16_reg>:
test   $0xff78,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_88uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -136
%6 = icmp ne i32 %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_88uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -136
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t qikpart(int *, size_t, size_t);
void qikcore(int *a, size_t left, size_t right) {
  size_t last;
  last = qikpart(a, left, right);
  if (!last)
    return;
  qikcore(a, left, last - 1);
  qikcore(a, last + 1, right);
}


x86 assembly (clang, -O0):
<qikcore>:
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 <qikpart@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <qikcore+0x39>
jmp    1183 <qikcore+0x63>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
sub    $0x1,%rdx
call   1040 <qikcore@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rdx
call   1040 <qikcore@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qikcore>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
call   1030 <qikpart@plt>
test   %rax,%rax
je     116d <qikcore+0x4d>
mov    %rax,%r12
xchg   %ax,%ax
lea    -0x1(%r12),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <qikcore@plt>
mov    %r12,%rbx
add    $0x1,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <qikpart@plt>
mov    %rax,%r12
test   %rax,%rax
jne    1140 <qikcore+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @qikcore(i32* %0, i64 %1, i64 %2) {
%4 = tail call i64 @qikpart(i32* %0, i64 %1, i64 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ %4, %3 ]
%8 = phi i64 [ %10, %6 ], [ %1, %3 ]
%9 = add i64 %7, -1
tail call void @qikcore(i32* %0, i64 %8, i64 %9)
%10 = add i64 %7, 1
%11 = tail call i64 @qikpart(i32* %0, i64 %10, i64 %2)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3
ret void
}
double max(double x, double y) {
  if (x > y)
    return x;
  return y;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <max+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int getsockopt(int, int, int, char *, unsigned int *);
int Xgetsockopt(int s, int e, int n, void *v, int *l) {
  unsigned int rl;
  int code;
  rl = *l;
  code = getsockopt(s, e, n, (char *)v, &rl);
  *l = rl;
  return code;
}


x86 assembly (clang, -O0):
<Xgetsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    -0x24(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xgetsockopt>:
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rbx
mov    (%r8),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%r8
call   1030 <getsockopt@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Xgetsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%13 = load i32*, i32** %10
%14 = load i32, i32* %13
store i32 %14, i32* %11
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = load i8*, i8** %9
%19 = call i32 @getsockopt(i32 %15, i32 %16, i32 %17, i8* %18, i32* %11)
store i32 %19, i32* %12
%20 = load i32, i32* %11
%21 = load i32*, i32** %10
store i32 %20, i32* %21
%22 = load i32, i32* %12
ret i32 %22
}

LLVM IR (-O2):
define i32 @Xgetsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* nocapture %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to i8*
%8 = load i32, i32* %4
store i32 %8, i32* %6
%9 = call i32 @getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %6)
%10 = load i32, i32* %6
store i32 %10, i32* %4
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Fail(char *, int, int);
int printf(char const *, int);
int strlen(char const *);
void DoNumTest(const char *formatstr, int param, const char *checkstr) {
  int ret;
  ret = printf(formatstr, param);
  if (ret != strlen(checkstr)) {
    Fail("Expected printf to return %d, got %d.\n", strlen(checkstr), ret);
  }
}


x86 assembly (clang, -O0):
<DoNumTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <printf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
je     1188 <DoNumTest+0x58>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
mov    -0x1c(%rbp),%edx
lea    0xe7d(%rip),%rdi
call   1050 <Fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoNumTest>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1040 <printf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
jne    1150 <DoNumTest+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Fail@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Expected printf to return %d, got %d.\0A\00"
define void @DoNumTest(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @printf(i8* %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = icmp ne i32 %11, %13
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i8*, i8** %6
%17 = call i32 @strlen(i8* %16)
%18 = load i32, i32* %7
%19 = call i32 @Fail(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
br label %20
20: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Expected printf to return %d, got %d.\0A\00"
define void @DoNumTest(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* %0, i32 %1)
%5 = tail call i32 @strlen(i8* %2)
%6 = icmp eq i32 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i32 @strlen(i8* %2)
%9 = tail call i32 @Fail(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %4)
br label %10
10: ; preds = %7, %3
ret void
}
double pow(x, y)
double x, y;
{
  if (y == 0.0)
    return 1.0;
  if (x < 0.0)
    return 0.0;
  if (x == 0.0)
    return 0.0;
  x = exp(log(x) * y);
  return x;
}


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115c <pow+0x3c>
jp     115c <pow+0x3c>
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11bf <pow+0x9f>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1177 <pow+0x57>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11bf <pow+0x9f>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    119c <pow+0x7c>
jp     119c <pow+0x7c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11bf <pow+0x9f>
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
mulsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
push   %rax
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    113b <pow+0x1b>
jp     113b <pow+0x1b>
movsd  0xec7(%rip),%xmm0
pop    %rax
ret
ucomisd %xmm2,%xmm0
jae    115a <pow+0x3a>
movapd %xmm2,%xmm0
movsd  %xmm1,(%rsp)
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <exp@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store double 1.000000e+00, double* %3
br label %24
9: ; preds = %2
%10 = load double, double* %4
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %9
store double 0.000000e+00, double* %3
br label %24
13: ; preds = %9
%14 = load double, double* %4
%15 = fcmp oeq double %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %13
store double 0.000000e+00, double* %3
br label %24
17: ; preds = %13
%18 = load double, double* %4
%19 = call double @log(double %18)
%20 = load double, double* %5
%21 = fmul double %19, %20
%22 = call double @exp(double %21)
store double %22, double* %4
%23 = load double, double* %4
store double %23, double* %3
br label %24
24: ; preds = %17, %16, %12, %8
%25 = load double, double* %3
ret double %25
}

LLVM IR (-O2):
define double @pow(double %0, double %1) {
%3 = fcmp oeq double %1, 0.000000e+00
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = fcmp ugt double %0, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call double @log(double %0)
%8 = fmul double %7, %1
%9 = tail call double @exp(double %8)
br label %10
10: ; preds = %4, %2, %6
%11 = phi double [ %9, %6 ], [ 1.000000e+00, %2 ], [ 0.000000e+00, %4 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ hal_write(int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void console_print(const char *str) { hal_write(1, str, strlen(str)); }


x86 assembly (clang, -O0):
<console_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1040 <hal_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_print>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <hal_write@plt>

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

LLVM IR (-O2):
define void @console_print(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @hal_write(i32 1, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int iccmp(unsigned char *, unsigned char *);
int /*<<< orphan*/ ip2bin(char *, unsigned char *);
int /*<<< orphan*/ printf(char *, int);
main() {
  char str[20] = "192.168.0.20";
  unsigned char dadd[4] = {192, 168, 0, 20};
  unsigned char op[4];
  int status;
  ip2bin(str, op);
  status = iccmp(op, dadd);
  printf("status:%d", status);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xeb7(%rip),%eax
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <ip2bin@plt>
lea    -0x28(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1030 <iccmp@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x1400a8c0,0x8(%rsp)
14
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <ip2bin@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <iccmp@plt>
lea    0xe9d(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [20 x i8] c"192.168.0.20\00\00\00\00\00\00\00\00"
@__const.main.dadd = [4 x i8] c"\C0\A8\00\14"
@.str = [10 x i8] c"status:%d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [4 x i8]
%3 = alloca [4 x i8]
%4 = alloca i32
%5 = bitcast [20 x i8]* %1 to i8*
%6 = bitcast [4 x i8]* %2 to i8*
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%9 = call i32 @ip2bin(i8* %7, i8* %8)
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%12 = call i32 @iccmp(i8* %10, i8* %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [20 x i8] c"192.168.0.20\00\00\00\00\00\00\00\00"
@.str = [10 x i8] c"status:%d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca i32
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
store i32 335587520, i32* %2
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%7 = call i32 @ip2bin(i8* %4, i8* %6)
%8 = call i32 @iccmp(i8* %6, i8* %5)
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Roomy_log(char *);
int /*<<< orphan*/ exit(int);
void RoomyHashTable_defaultUpdateFunc(void *key, void *oldVal, void *passedVal,
                                      void *newValOut) {
  Roomy_log("ERROR: RoomyHashTable_defaultUpdateFunc called\n");
  exit(1);
}


x86 assembly (clang, -O0):
<RoomyHashTable_defaultUpdateFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xec1(%rip),%rdi
call   1030 <Roomy_log@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<RoomyHashTable_defaultUpdateFunc>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <Roomy_log@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"ERROR: RoomyHashTable_defaultUpdateFunc called\0A\00"
define void @RoomyHashTable_defaultUpdateFunc(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = call i32 @Roomy_log(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [48 x i8] c"ERROR: RoomyHashTable_defaultUpdateFunc called\0A\00"
define void @RoomyHashTable_defaultUpdateFunc(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 @Roomy_log(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}