xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ g5_runMC(int /*<<< orphan*/);
void g5_run(void) { g5_runMC(0); }


x86 assembly (clang, -O0):
<g5_run>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <g5_runMC@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g5_run>:
xor    %edi,%edi
jmp    1030 <g5_runMC@plt>

LLVM IR (-O0):
define void @g5_run() {
%1 = call i32 @g5_runMC(i32 0)
ret void
}

LLVM IR (-O2):
define void @g5_run() {
%1 = tail call i32 @g5_runMC(i32 0)
ret void
}
int nhanHaiSo(int soThu1, int soThu2) {
  int ketQua = soThu1 * soThu2;
  return ketQua;
}


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

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

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

LLVM IR (-O2):
define i32 @nhanHaiSo(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ words;

/* Variables and functions */
int /*<<< orphan*/ print_order(char **, int, int);
void main() {
  char *words[] = {"caa", "aaa", "aab"};
  int len = sizeof(words) / sizeof(words[0]);
  print_order(words, len, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2ce1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cde(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cdb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x3,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    $0x3,%edx
call   1030 <print_order@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x2cf5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1030 <print_order@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"caa\00"
@.str.1 = [4 x i8] c"aaa\00"
@.str.2 = [4 x i8] c"aab\00"
@__const.main.words = [3 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0)]
define void @main() {
%1 = alloca [3 x i8*]
%2 = alloca i32
%3 = bitcast [3 x i8*]* %1 to i8*
store i32 3, i32* %2
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @print_order(i8** %4, i32 %5, i32 3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"caa\00"
@.str.1 = [4 x i8] c"aaa\00"
@.str.2 = [4 x i8] c"aab\00"
@__const.main.words = [3 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0)]
define void @main() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%4 = call i32 @print_order(i8** %3, i32 3, i32 3)
ret void
}
int test_imm_9Cint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x9C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Cint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10223616
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void issue8811Init() {}


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

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

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

LLVM IR (-O2):
define void @issue8811Init() {
ret void
}
int f(int x) {
  int unused;
  unsigned int y = 10;
  return x < y ? ++x : x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    112b <f+0x2b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    %eax,-0x10(%rbp)
jmp    1131 <f+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
cmp    $0xa,%edi
adc    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = zext i1 %2 to i32
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void suspend_usb(void) {
  system("sync");
  system("reg s 0xb01c0000");
  system("reg w 54 0x1084");
}


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

x86 assembly (clang, -O2):
<suspend_usb>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"sync\00"
@.str.1 = [17 x i8] c"reg s 0xb01c0000\00"
@.str.2 = [16 x i8] c"reg w 54 0x1084\00"
define void @suspend_usb() {
%1 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"sync\00"
@.str.1 = [17 x i8] c"reg s 0xb01c0000\00"
@.str.2 = [16 x i8] c"reg w 54 0x1084\00"
define void @suspend_usb() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void glutChangeToSubMenu(int item, const char *label, int submenu) {}


x86 assembly (clang, -O0):
<glutChangeToSubMenu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @glutChangeToSubMenu(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
int test_imm_E8int8_mem(signed char *val) {
  return ((*val) & (-0xE8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E8int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff18,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E8int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -232
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void set_tree_height(uint32_t addr[8], uint32_t tree_height) {
  addr[6] = tree_height;
}


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

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

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

LLVM IR (-O2):
define void @set_tree_height(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %1, i32* %3
ret void
}
unsigned long CountLeadingZeroesLong(unsigned long long arg) {
  return __builtin_clzll(arg);
}


x86 assembly (clang, -O0):
<CountLeadingZeroesLong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountLeadingZeroesLong>:
bsr    %rdi,%rax
xor    $0x3f,%rax
ret

LLVM IR (-O0):
define i64 @CountLeadingZeroesLong(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctlz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @CountLeadingZeroesLong(i64 %0) {
%2 = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true)
ret i64 %2
}
int __ev_ri3_changed() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__ev_ri3_changed() {
ret i32 0
}
struct STU *link_delete(struct STU *head, int num) {
  return head;
}


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

x86 assembly (clang, -O2):
<link_delete>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.STU = type opaque
define %struct.STU* @link_delete(%struct.STU* %0, i32 %1) {
%3 = alloca %struct.STU*
%4 = alloca i32
store %struct.STU* %0, %struct.STU** %3
store i32 %1, i32* %4
%5 = load %struct.STU*, %struct.STU** %3
ret %struct.STU* %5
}

LLVM IR (-O2):
%struct.STU = type opaque
define %struct.STU* @link_delete(%struct.STU* readnone returned %0, i32 %1) {
ret %struct.STU* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void aker_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<aker_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @aker_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_random_bytes(void *, int);
void tpm_get_random_bytes(void *buf, int nbytes) {
  get_random_bytes(buf, nbytes);
}


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

x86 assembly (clang, -O2):
<tpm_get_random_bytes>:
jmp    1030 <get_random_bytes@plt>

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

LLVM IR (-O2):
define void @tpm_get_random_bytes(i8* %0, i32 %1) {
%3 = tail call i32 @get_random_bytes(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ez_daemonize();
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ sleep(int);
scalar_t__ time(void *);
int main(int argc, char *argv[]) {
  ez_daemonize();
  while (1) {
    printf("%lld\n", (long long int)time(((void *)0)));
    sleep(1);
  }
  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)
mov    $0x0,%al
call   1040 <ez_daemonize@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    115d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <ez_daemonize@plt>
lea    0xeb1(%rip),%rbx
nop
xor    %edi,%edi
call   1050 <time@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
@.str = [6 x i8] c"%lld\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 (...) @ez_daemonize()
br label %7
7: ; preds = %2, %7
%8 = call i64 @time(i8* null)
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = call i32 @sleep(i32 1)
br label %7
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ez_daemonize()
br label %4
4: ; preds = %2, %4
%5 = tail call i64 @time(i8* null)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = tail call i32 @sleep(i32 1)
br label %4
}
/* Variables and functions */
char const *tcerrmsg(int);
const char *tchdberrmsg(int ecode) { return tcerrmsg(ecode); }


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

x86 assembly (clang, -O2):
<tchdberrmsg>:
jmp    1030 <tcerrmsg@plt>

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

LLVM IR (-O2):
define i8* @tchdberrmsg(i32 %0) {
%2 = tail call i8* @tcerrmsg(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern int shmem_my_pe(void) { printf("\nOpenSHMEM Analyzer\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define i32 @shmem_my_pe() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void algorithm_benchmark(void) {}


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

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

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

LLVM IR (-O2):
define void @algorithm_benchmark() {
ret void
}
/* Variables and functions */
char *capture(char const *, char *);
char *get_full_path(const char *rawString) {
  char *res;
  char *regexString = "(\\./?[^\r\n]*|/[^\r\n]*)[\r\n]?$";
  res = capture(rawString, regexString);
  return res;
}


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

x86 assembly (clang, -O2):
<get_full_path>:
lea    0xee9(%rip),%rsi
jmp    1030 <capture@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"(\\./?[^\0D\0A]*|/[^\0D\0A]*)[\0D\0A]?$\00"
define i8* @get_full_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i8*, i8** %2
%6 = load i8*, i8** %4
%7 = call i8* @capture(i8* %5, i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [27 x i8] c"(\\./?[^\0D\0A]*|/[^\0D\0A]*)[\0D\0A]?$\00"
define i8* @get_full_path(i8* %0) {
%2 = tail call i8* @capture(i8* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
void ARGBBlend() {}


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

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

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

LLVM IR (-O2):
define void @ARGBBlend() {
ret void
}
/* Variables and functions */
scalar_t__ cjson_malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *cjson_strdup(const char *str) {
  size_t len;
  char *copy;
  len = strlen(str) + 1;
  if (!(copy = (char *)cjson_malloc(len)))
    return 0;
  memcpy(copy, str, len);
  return copy;
}


x86 assembly (clang, -O0):
<cjson_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <cjson_malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1172 <cjson_strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    118b <cjson_strdup+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cjson_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <cjson_malloc@plt>
test   %rax,%rax
je     1163 <cjson_strdup+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1165 <cjson_strdup+0x35>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @cjson_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @cjson_malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
br label %10
10: ; preds = %1, %8
%11 = phi i8* [ %6, %8 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
double exp(double);
double norm(double X) { return 0.4 * exp(-X * X / 2); }


x86 assembly (clang, -O0):
<norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xea6(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm>:
push   %rax
mulsd  %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @norm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = fdiv double %6, 2.000000e+00
%8 = call double @exp(double %7)
%9 = fmul double 4.000000e-01, %8
ret double %9
}

LLVM IR (-O2):
define double @norm(double %0) {
%2 = fneg double %0
%3 = fmul double %2, %0
%4 = fmul double %3, 5.000000e-01
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 4.000000e-01
ret double %6
}
unsigned recurse(unsigned x) { return recurse(x) + 1; }


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

x86 assembly (clang, -O2):
<recurse>:
jmp    1100 <recurse>

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

LLVM IR (-O2):
define i32 @recurse(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
char *reg_str_r_i(char *, int);
char *reg_str_i(int r) {
  static char buf[4];
  return reg_str_r_i(buf, r);
}


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

x86 assembly (clang, -O2):
<reg_str_i>:
mov    %edi,%esi
lea    0x2f10(%rip),%rdi
jmp    1030 <reg_str_r_i@plt>

LLVM IR (-O0):
@reg_str_i.buf = internal global [4 x i8] zeroinitializer
define i8* @reg_str_i(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @reg_str_r_i(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @reg_str_i.buf, i64 0, i64 0), i32 %3)
ret i8* %4
}

LLVM IR (-O2):
@reg_str_i.buf = internal global [4 x i8] zeroinitializer
define i8* @reg_str_i(i32 %0) {
%2 = tail call i8* @reg_str_r_i(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @reg_str_i.buf, i64 0, i64 0), i32 %0)
ret i8* %2
}
int test_imm_85int16_mem(short *val) {
  return ((*val) & (0x85 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_85int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 133
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void i2d_OCSP_REQINFO(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_OCSP_REQINFO() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_puts(int, char const *);
void kputs(const char *str) { uart_puts((0x10009000), str); }


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

x86 assembly (clang, -O2):
<kputs>:
mov    %rdi,%rsi
mov    $0x10009000,%edi
jmp    1030 <uart_puts@plt>

LLVM IR (-O0):
define void @kputs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @uart_puts(i32 268472320, i8* %3)
ret void
}

LLVM IR (-O2):
define void @kputs(i8* %0) {
%2 = tail call i32 @uart_puts(i32 268472320, i8* %0)
ret void
}
/* Variables and functions */
double calc_fps(double, double);
double calc_mps(double, double);
double get_input();
int /*<<< orphan*/ printf(char *, double);
void compute_speed_for_racer(void) {
  double seconds, fps, mps;
  seconds = get_input();
  fps = calc_fps(1.0, seconds);
  printf("That is %.3f feet per second\n", fps);
  mps = calc_mps(1.0, seconds);
  printf("That is %.3f meters per second\n", mps);
}


x86 assembly (clang, -O0):
<compute_speed_for_racer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1060 <get_input@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xe9f(%rip),%xmm0
call   1030 <calc_fps@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm1
movsd  0xe77(%rip),%xmm0
call   1050 <calc_mps@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_speed_for_racer>:
push   %rax
xor    %eax,%eax
call   1060 <get_input@plt>
movaps %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0xea8(%rip),%xmm0
call   1030 <calc_fps@plt>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe8f(%rip),%xmm0
movsd  (%rsp),%xmm1
call   1050 <calc_mps@plt>
lea    0xea4(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"That is %.3f feet per second\0A\00"
@.str.1 = [32 x i8] c"That is %.3f meters per second\0A\00"
define void @compute_speed_for_racer() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = call double (...) @get_input()
store double %4, double* %1
%5 = load double, double* %1
%6 = call double @calc_fps(double 1.000000e+00, double %5)
store double %6, double* %2
%7 = load double, double* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %7)
%9 = load double, double* %1
%10 = call double @calc_mps(double 1.000000e+00, double %9)
store double %10, double* %3
%11 = load double, double* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), double %11)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"That is %.3f feet per second\0A\00"
@.str.1 = [32 x i8] c"That is %.3f meters per second\0A\00"
define void @compute_speed_for_racer() {
%1 = tail call double (...) @get_input()
%2 = tail call double @calc_fps(double 1.000000e+00, double %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %2)
%4 = tail call double @calc_mps(double 1.000000e+00, double %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), double %4)
ret void
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inc_nlink(struct inode *);
int /*<<< orphan*/ mark_inode_dirty(struct inode *);
__attribute__((always_)) void inode_inc_link_count(struct inode *inode) {
  inc_nlink(inode);
  mark_inode_dirty(inode);
}


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

x86 assembly (clang, -O2):
<inode_inc_link_count>:
push   %rbx
mov    %rdi,%rbx
call   1030 <inc_nlink@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mark_inode_dirty@plt>

LLVM IR (-O0):
%struct.inode = type { i32 }
define void @inode_inc_link_count(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
%3 = load %struct.inode*, %struct.inode** %2
%4 = call i32 @inc_nlink(%struct.inode* %3)
%5 = load %struct.inode*, %struct.inode** %2
%6 = call i32 @mark_inode_dirty(%struct.inode* %5)
ret void
}

LLVM IR (-O2):
%struct.inode = type { i32 }
define void @inode_inc_link_count(%struct.inode* %0) {
%2 = tail call i32 @inc_nlink(%struct.inode* %0)
%3 = tail call i32 @mark_inode_dirty(%struct.inode* %0)
ret void
}
/* Variables and functions */
int unlink(char *);
int Sys_Unlink(char *file) { return unlink(file); }


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

x86 assembly (clang, -O2):
<Sys_Unlink>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @Sys_Unlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SETHLm(int);
void SET1HLm() { SETHLm(0x02); }


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

x86 assembly (clang, -O2):
<SET1HLm>:
mov    $0x2,%edi
jmp    1030 <SETHLm@plt>

LLVM IR (-O0):
define void @SET1HLm() {
%1 = call i32 @SETHLm(i32 2)
ret void
}

LLVM IR (-O2):
define void @SET1HLm() {
%1 = tail call i32 @SETHLm(i32 2)
ret void
}
void ade7759_remove_trigger(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @ade7759_remove_trigger(%struct.iio_dev* nocapture %0) {
ret void
}
struct rsync_delta *rsync_delta_new(char *signature, int len) {
  signature = signature;
  len = len;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.rsync_delta = type opaque
define %struct.rsync_delta* @rsync_delta_new(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
store i8* %5, i8** %3
%6 = load i32, i32* %4
store i32 %6, i32* %4
ret %struct.rsync_delta* null
}

LLVM IR (-O2):
%struct.rsync_delta = type opaque
define noalias %struct.rsync_delta* @rsync_delta_new(i8* nocapture readnone %0, i32 %1) {
ret %struct.rsync_delta* null
}
int ind2D(int i, int j, int nrow, int ncol) {
  int ind = nrow * j + i;
  return ind;
}


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

x86 assembly (clang, -O2):
<ind2D>:
imul   %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @ind2D(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %2, %1
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ wait4(int /*<<< orphan*/, int *, int, int /*<<< orphan*/);
pid_t waitpid(pid_t pid, int *status, int options) {
  return wait4(pid, status, options, 0);
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
xor    %ecx,%ecx
jmp    1030 <wait4@plt>

LLVM IR (-O0):
define i32 @waitpid(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 @wait4(i32 %7, i32* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @wait4(i32 %0, i32* %1, i32 %2, i32 0)
ret i32 %4
}
void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv) { return; }


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

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

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

LLVM IR (-O2):
%struct.batadv_priv = type opaque
define void @batadv_nc_init_bat_priv(%struct.batadv_priv* nocapture %0) {
ret void
}
/* Variables and functions */
size_t hash_func(char *key) {
  size_t h = 2166136261;
  int i;
  for (i = 0; key[i] != '\0'; ++i)
    h = (h * 16777619) ^ key[i];
  return h;
}


x86 assembly (clang, -O0):
<hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x811c9dc5,%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <hash_func+0x57>
imul   $0x1000193,-0x10(%rbp),%rax
01
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <hash_func+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func>:
mov    $0x811c9dc5,%eax
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <hash_func+0x29>
add    $0x1,%rdi
nop
imul   $0x1000193,%rax,%rdx
movsbq %cl,%rax
xor    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_func+0x10>
ret

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

LLVM IR (-O2):
define i64 @hash_func(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i64 [ %10, %4 ], [ 2166136261, %1 ]
%8 = mul i64 %7, 16777619
%9 = sext i8 %6 to i64
%10 = xor i64 %8, %9
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 2166136261, %1 ], [ %10, %4 ]
ret i64 %16
}
int isnumber(int ch) {
  if (ch >= '0' && ch <= '9')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isnumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <isnumber+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <isnumber+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isnumber+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnumber>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isnumber(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isnumber(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_float2() {
  union {
    float f;
    struct {
      unsigned int sign : 1;
      unsigned int exp : 8;
      unsigned int coef : 23;
    } u;
  } p;
  p.f = -13.0;
  printf("%d\n", p.u.sign);
  printf("%d\n", p.u.exp);
  printf("%x\n", p.u.coef);
}


x86 assembly (clang, -O0):
<print_float2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
and    $0x1,%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
shr    $0x1,%esi
and    $0xff,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
shr    $0x9,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_float2>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x60a800,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%union.anon = type { float }
%struct.anon = type { i32 }
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%x\0A\00"
define void @print_float2() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to float*
store float -1.300000e+01, float* %2
%3 = bitcast %union.anon* %1 to %struct.anon*
%4 = bitcast %struct.anon* %3 to i32*
%5 = load i32, i32* %4
%6 = and i32 %5, 1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = bitcast %union.anon* %1 to %struct.anon*
%9 = bitcast %struct.anon* %8 to i32*
%10 = load i32, i32* %9
%11 = lshr i32 %10, 1
%12 = and i32 %11, 255
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = bitcast %union.anon* %1 to %struct.anon*
%15 = bitcast %struct.anon* %14 to i32*
%16 = load i32, i32* %15
%17 = lshr i32 %16, 9
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%x\0A\00"
define void @print_float2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 6334464)
ret void
}
__attribute__((unused)) __attribute__((const)) float square(float x) {
  return x * x;
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @square(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @square(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ brc(int, char);
void dl(int pn) { brc(pn, 'M'); }


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

x86 assembly (clang, -O2):
<dl>:
mov    $0x4d,%esi
jmp    1030 <brc@plt>

LLVM IR (-O0):
define void @dl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @brc(i32 %3, i8 signext 77)
ret void
}

LLVM IR (-O2):
define void @dl(i32 %0) {
%2 = tail call i32 @brc(i32 %0, i8 signext 77)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void d() { printf("this is d\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"this is d\00"
define void @d() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
void itson_alloc_dump(void *ksf_handle) {}


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

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

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

LLVM IR (-O2):
define void @itson_alloc_dump(i8* nocapture %0) {
ret void
}
long long Integer_0_toInteger_2_Double(double value) {
  return (long long)value;
}


x86 assembly (clang, -O0):
<Integer_0_toInteger_2_Double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Integer_0_toInteger_2_Double>:
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @Integer_0_toInteger_2_Double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @Integer_0_toInteger_2_Double(double %0) {
%2 = fptosi double %0 to i64
ret i64 %2
}
float sub3(float f, float g, float h) { return -((f * g) - h); }


x86 assembly (clang, -O0):
<sub3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub3>:
mulss  %xmm1,%xmm0
subss  %xmm2,%xmm0
xorps  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define float @sub3(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fneg float %9
%11 = call float @llvm.fmuladd.f32(float %7, float %8, float %10)
%12 = fneg float %11
ret float %12
}

LLVM IR (-O2):
define float @sub3(float %0, float %1, float %2) {
%4 = fneg float %2
%5 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %4)
%6 = fneg float %5
ret float %6
}
int security_inode_getxattr(struct dentry *dentry, char *name) { return 0; }


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

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

LLVM IR (-O0):
%struct.dentry = type opaque
define i32 @security_inode_getxattr(%struct.dentry* %0, i8* %1) {
%3 = alloca %struct.dentry*
%4 = alloca i8*
store %struct.dentry* %0, %struct.dentry** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @security_inode_getxattr(%struct.dentry* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int fileExists(char *);
int /*<<< orphan*/ free(char *);
char *mergePath(char const *, char const *);
int checkPath(const char *path, const char *file) {
  char *merged = mergePath(path, file);
  int r = fileExists(merged);
  free(merged);
  return r;
}


x86 assembly (clang, -O0):
<checkPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mergePath@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <fileExists@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkPath>:
push   %rbp
push   %rbx
push   %rax
call   1040 <mergePath@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <fileExists@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @checkPath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i8* @mergePath(i8* %7, i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i32 @fileExists(i8* %10)
store i32 %11, i32* %6
%12 = load i8*, i8** %5
%13 = call i32 @free(i8* %12)
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @checkPath(i8* %0, i8* %1) {
%3 = tail call i8* @mergePath(i8* %0, i8* %1)
%4 = tail call i32 @fileExists(i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 %4
}