xunge/DecIR huggingface dataset:
unsigned int ss_fnv(char *key, int len) {
  unsigned char *p = (unsigned char *)key;
  unsigned char *end = p + len;
  unsigned h = 2166136261;
  while (p < end) {
    h = (h * 16777619) ^ *p;
    p++;
  }
  return h;
}


x86 assembly (clang, -O0):
<ss_fnv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
movl   $0x811c9dc5,-0x24(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    115b <ss_fnv+0x5b>
imul   $0x1000193,-0x24(%rbp),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1129 <ss_fnv+0x29>
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_fnv>:
test   %esi,%esi
jle    1125 <ss_fnv+0x25>
movslq %esi,%rcx
add    %rdi,%rcx
mov    $0x811c9dc5,%eax
nop
imul   $0x1000193,%eax,%edx
movzbl (%rdi),%eax
xor    %edx,%eax
add    $0x1,%rdi
cmp    %rcx,%rdi
jb     1110 <ss_fnv+0x10>
ret
mov    $0x811c9dc5,%eax
ret

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

LLVM IR (-O2):
define i32 @ss_fnv(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %15
6: ; preds = %2, %6
%7 = phi i32 [ %12, %6 ], [ -2128831035, %2 ]
%8 = phi i8* [ %13, %6 ], [ %0, %2 ]
%9 = mul i32 %7, 16777619
%10 = load i8, i8* %8
%11 = zext i8 %10 to i32
%12 = xor i32 %9, %11
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp ult i8* %13, %4
br i1 %14, label %6, label %15
15: ; preds = %6, %2
%16 = phi i32 [ -2128831035, %2 ], [ %12, %6 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Server started!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Server started!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Server started!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ getwd(char *);
char *sys_getwd(char *s) {
  char *wd;
  wd = (char *)getwd(s);
  return wd;
}


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

x86 assembly (clang, -O2):
<sys_getwd>:
jmp    1030 <getwd@plt>

LLVM IR (-O0):
define i8* @sys_getwd(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @getwd(i8* %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
define i8* @sys_getwd(i8* %0) {
%2 = tail call i64 @getwd(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int ENXIO;
int pm8xxx_mpp_config(unsigned mpp, unsigned type, unsigned level,
                      unsigned control) {
  return -ENXIO;
}


x86 assembly (clang, -O0):
<pm8xxx_mpp_config>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ec7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8xxx_mpp_config>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @pm8xxx_mpp_config(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @ENXIO
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @pm8xxx_mpp_config(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @ENXIO
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ c();
int main(void) {
  c();
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @c()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
void swap(int arr[], int i, int j) {
  int temp = arr[i];
  arr[i] = arr[j];
  arr[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
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):
<swap>:
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 @swap(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 @swap(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 CHAR_BIT;
void __clear_bit(int idx, unsigned long *bmap) {
  unsigned long mask = (1UL << ((idx) % (CHAR_BIT * sizeof(unsigned long))));
  unsigned long *p =
      ((unsigned long *)bmap) + ((idx) / (CHAR_BIT * sizeof(unsigned long)));
  *p &= ~mask;
}


x86 assembly (clang, -O0):
<__clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    0x2eca(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movslq -0x4(%rbp),%rax
mov    0x2e9c(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x20(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__clear_bit>:
movslq %edi,%rax
mov    0x2ed6(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1127 <__clear_bit+0x27>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rcx
jmp    112f <__clear_bit+0x2f>
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
mov    %edx,%ecx
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
and    %rdx,(%rsi,%rax,8)
ret

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

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define void @__clear_bit(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = load i32, i32* @CHAR_BIT
%5 = sext i32 %4 to i64
%6 = shl nsw i64 %5, 3
%7 = urem i64 %3, %6
%8 = shl nuw i64 1, %7
%9 = udiv i64 %3, %6
%10 = getelementptr inbounds i64, i64* %1, i64 %9
%11 = xor i64 %8, -1
%12 = load i64, i64* %10
%13 = and i64 %12, %11
store i64 %13, i64* %10
ret void
}
/* Variables and functions */
int congHaiSo(int, int);
int nhanHaiSo(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int number1 = 10;
  int number2 = 30;
  int resultOfCongHaiSo = congHaiSo(number1, number2);
  printf("Ket qua cua CongHaiSo: %d\n", resultOfCongHaiSo);
  printf("Ket qua cua CongHaiSo: %d\n", nhanHaiSo(number1, number2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x1e,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <congHaiSo@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <nhanHaiSo@plt>
mov    %eax,%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
mov    $0x1e,%esi
call   1050 <congHaiSo@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x1e,%esi
call   1040 <nhanHaiSo@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Ket qua cua CongHaiSo: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 10, i32* %1
store i32 30, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @congHaiSo(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @nhanHaiSo(i32 %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Ket qua cua CongHaiSo: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @congHaiSo(i32 10, i32 30)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @nhanHaiSo(i32 10, i32 30)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int rand();
int Create_Campaign_Start_Point() {
  int start_number;
  start_number = (rand() % 4) + 1;
  return start_number;
}


x86 assembly (clang, -O0):
<Create_Campaign_Start_Point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Create_Campaign_Start_Point>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Create_Campaign_Start_Point() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 4
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @Create_Campaign_Start_Point() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 4
%3 = add nsw i32 %2, 1
ret i32 %3
}
int main() {
  int c, b;
  int d = c && b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1124 <main+0x24>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ asbits(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int rightrot(unsigned int, int);
int main() {
  int offset = 34;
  unsigned x = 0x12345678;
  asbits(x, sizeof(x), 1);
  asbits(rightrot(x, offset), sizeof(x), 1);
  printf("%u\n\n", rightrot(x, offset));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x22,-0x8(%rbp)
movl   $0x12345678,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <asbits@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <rightrot@plt>
mov    %eax,%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <asbits@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <rightrot@plt>
mov    %eax,%esi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x12345678,%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <asbits@plt>
mov    $0x12345678,%edi
mov    $0x22,%esi
call   1040 <rightrot@plt>
mov    %eax,%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <asbits@plt>
mov    $0x12345678,%edi
mov    $0x22,%esi
call   1040 <rightrot@plt>
lea    0xe85(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%u\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 34, i32* %2
store i32 305419896, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @asbits(i32 %4, i32 4, i32 1)
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @rightrot(i32 %6, i32 %7)
%9 = call i32 @asbits(i32 %8, i32 4, i32 1)
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = call i32 @rightrot(i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%u\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @asbits(i32 305419896, i32 4, i32 1)
%2 = tail call i32 @rightrot(i32 305419896, i32 34)
%3 = tail call i32 @asbits(i32 %2, i32 4, i32 1)
%4 = tail call i32 @rightrot(i32 305419896, i32 34)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void wait_cb(int sig __attribute((unused))) { wait(NULL); }


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

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

LLVM IR (-O0):
define void @wait_cb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @wait(i32* null)
ret void
}

LLVM IR (-O2):
define void @wait_cb(i32 %0) {
%2 = tail call i32 @wait(i32* null)
ret void
}
/* Variables and functions */
double acos(double);
int /*<<< orphan*/ pix2ang_ring_z_phi(long, long, double *, double *);
void pix2ang_ring(long nside, long ipix, double *theta, double *phi) {
  double z;
  pix2ang_ring_z_phi(nside, ipix, &z, phi);
  *theta = acos(z);
}


x86 assembly (clang, -O0):
<pix2ang_ring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%rdx
call   1030 <pix2ang_ring_z_phi@plt>
movsd  -0x28(%rbp),%xmm0
call   1040 <acos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pix2ang_ring>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
lea    0x8(%rsp),%rdx
call   1030 <pix2ang_ring_z_phi@plt>
movsd  0x8(%rsp),%xmm0
call   1040 <acos@plt>
movsd  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @pix2ang_ring(i64 %0, i64 %1, double* nocapture writeonly %2, double* %3) {
%5 = alloca double
%6 = bitcast double* %5 to i8*
%7 = call i32 @pix2ang_ring_z_phi(i64 %0, i64 %1, double* %5, double* %3)
%8 = load double, double* %5
%9 = call double @acos(double %8)
store double %9, double* %2
ret void
}
const char *ulz_how_girl_get_pragnent(void) {
  return "They need to do way instain mother> who kill thier babbys.";
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"They need to do way instain mother> who kill thier babbys.\00"
define i8* @ulz_how_girl_get_pragnent() {
ret i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [59 x i8] c"They need to do way instain mother> who kill thier babbys.\00"
define i8* @ulz_how_girl_get_pragnent() {
ret i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int handle_off(int, int, char *);
int handle_on(int, int, char *);
int /*<<< orphan*/ usleep(int);
int handle_bounce(int devfd, int nodeid, char *arg) {
  int ret;
  ret = handle_off(devfd, nodeid, arg);
  if (ret != 0)
    return ret;
  usleep(500000);
  return handle_on(devfd, nodeid, arg);
}


x86 assembly (clang, -O0):
<handle_bounce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <handle_off@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1169 <handle_bounce+0x39>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <handle_bounce+0x55>
mov    $0x7a120,%edi
call   1050 <usleep@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <handle_on@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_bounce>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <handle_off@plt>
test   %eax,%eax
je     1149 <handle_bounce+0x19>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x7a120,%edi
call   1050 <usleep@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <handle_on@plt>

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

LLVM IR (-O2):
define i32 @handle_bounce(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @handle_off(i32 %0, i32 %1, i8* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @usleep(i32 500000)
%8 = tail call i32 @handle_on(i32 %0, i32 %1, i8* %2)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %8, %6 ], [ %4, %3 ]
ret i32 %10
}
/* Variables and functions */
int rand();
int randbetween(int min, int max) {
  int n = rand();
  return min + (n % (max - min + 1));
}


x86 assembly (clang, -O0):
<randbetween>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randbetween>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randbetween(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @rand()
store i32 %6, i32* %5
%7 = load i32, i32* %3
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = add nsw i32 %11, 1
%13 = srem i32 %8, %12
%14 = add nsw i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @randbetween(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  int x;
  x = 0;
  do {
    printf("Hello, world!\n");
  } while (x != 0);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1136 <main+0x16>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %5, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %5
%9 = call i32 (...) @getchar()
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRB8_get(void) { return U_WMRCORENONE_get("U_WMRB8"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRB8\00"
define i32 @U_WMRB8_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRB8\00"
define i32 @U_WMRB8_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char *);
void usage() {
  error("zeller (v%s)\n\nUsage: zeller [-j] \"Month Day, Year\"\n", "1.0.1");
}


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

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
lea    0xf16(%rip),%rsi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"zeller (v%s)\0A\0AUsage: zeller [-j] \22Month Day, Year\22\0A\00"
@.str.1 = [6 x i8] c"1.0.1\00"
define void @usage() {
%1 = call i32 @error(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"zeller (v%s)\0A\0AUsage: zeller [-j] \22Month Day, Year\22\0A\00"
@.str.1 = [6 x i8] c"1.0.1\00"
define void @usage() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *print(void *arg) {
  int *num = (int *)arg;
  printf("%d, ", *num);
  *num *= 2;
  return (void *)(num);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
shll   (%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d, \00"
define i8* @print(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = mul nsw i32 %10, 2
store i32 %11, i32* %9
%12 = load i32*, i32** %3
%13 = bitcast i32* %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define i8* @print(i8* returned %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = shl nsw i32 %5, 1
store i32 %6, i32* %2
ret i8* %0
}
/* Type definitions */
struct Area {
  int dummy;
};

/* Variables and functions */
struct Area *display_X11_select_area();
struct Area *display_select_area(void) {
  return display_X11_select_area();
}


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

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

LLVM IR (-O0):
%struct.Area = type { i32 }
define %struct.Area* @display_select_area() {
%1 = call %struct.Area* (...) @display_X11_select_area()
ret %struct.Area* %1
}

LLVM IR (-O2):
%struct.Area = type { i32 }
define %struct.Area* @display_select_area() {
%1 = tail call %struct.Area* (...) @display_X11_select_area()
ret %struct.Area* %1
}
/* Variables and functions */
int /*<<< orphan*/ create_page_table();
int /*<<< orphan*/ mmu_enable();
void mmu_init(void) {
  create_page_table();
  mmu_enable();
}


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

x86 assembly (clang, -O2):
<mmu_init>:
push   %rax
xor    %eax,%eax
call   1030 <create_page_table@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <mmu_enable@plt>

LLVM IR (-O0):
define void @mmu_init() {
%1 = call i32 (...) @create_page_table()
%2 = call i32 (...) @mmu_enable()
ret void
}

LLVM IR (-O2):
define void @mmu_init() {
%1 = tail call i32 (...) @create_page_table()
%2 = tail call i32 (...) @mmu_enable()
ret void
}
/* Variables and functions */
int rust_always_inlined();
int rust_never_inlined();
int main(int argc, char **argv) {
  return rust_never_inlined() + rust_always_inlined();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rust_never_inlined@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rust_always_inlined@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <rust_never_inlined@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rust_always_inlined@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @rust_never_inlined()
%7 = call i32 (...) @rust_always_inlined()
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rust_never_inlined()
%4 = tail call i32 (...) @rust_always_inlined()
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_RED_LED_INPUT() { clear_io_bit(0x39, 7); }


x86 assembly (clang, -O0):
<TOSH_MAKE_RED_LED_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
mov    $0x7,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_RED_LED_INPUT>:
mov    $0x39,%edi
mov    $0x7,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_RED_LED_INPUT() {
%1 = call i32 @clear_io_bit(i32 57, i32 7)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_RED_LED_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 57, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void merge_sort(int array[], int p, int r) {
  if (p < r) {
    int q = (p + r) / 2;
    merge_sort(array, p, q);
    merge_sort(array, q + 1, r);
    merge(array, p, q, r);
  }
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <merge_sort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
cmp    %edx,%esi
jge    1172 <merge_sort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <merge_sort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <merge_sort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

LLVM IR (-O0):
define void @merge_sort(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* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @merge_sort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @merge_sort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Type definitions */
struct in_addr {
  int s_addr;
};

/* Variables and functions */
char *inet_ntoa(struct in_addr);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char **argv) {
  struct in_addr src, des;
  src.s_addr = 0xE11710AC;
  des.s_addr = 0x640710AC;
  printf("src addr<%s>\tdst addr<%s>\n", inet_ntoa(src), inet_ntoa(des));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xe11710ac,-0x18(%rbp)
movl   $0x640710ac,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xe11710ac,%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    $0x640710ac,%edi
call   1030 <inet_ntoa@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [27 x i8] c"src addr<%s>\09dst addr<%s>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.in_addr
%7 = alloca %struct.in_addr
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
store i32 -518582100, i32* %8
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i32 0, i32 0
store i32 1678184620, i32* %9
%10 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i8* @inet_ntoa(i32 %11)
%13 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i8* @inet_ntoa(i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"src addr<%s>\09dst addr<%s>\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @inet_ntoa(i32 -518582100)
%4 = tail call i8* @inet_ntoa(i32 1678184620)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_start_client_streaming() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_call_start_client_streaming>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_call_start_client_streaming>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_start_client_streaming() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_start_client_streaming() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
double a(double x) { return x + 1; }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @a(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @a(double %0) {
%2 = fadd double %0, 1.000000e+00
ret double %2
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, int);
void logPid(int idx) { printf("%d. this message from %d\n", idx, getpid()); }


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

x86 assembly (clang, -O2):
<logPid>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"%d. this message from %d\0A\00"
define void @logPid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @getpid()
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%d. this message from %d\0A\00"
define void @logPid(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
void crypto_free_tfm(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<crypto_free_tfm>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_free_tfm>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.crypto_free_tfm = [16 x i8] c"crypto_free_tfm\00"
define void @crypto_free_tfm() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.crypto_free_tfm, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.crypto_free_tfm = [16 x i8] c"crypto_free_tfm\00"
define void @crypto_free_tfm() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.crypto_free_tfm, i64 0, i64 0))
ret void
}
/* Variables and functions */
int abs(int);
int nullregion(int null, int val) {
  if (abs(val) > null) {
    return ((val > 0) ? (val - null) : (val + null));
  }
  return 0;
}


x86 assembly (clang, -O0):
<nullregion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
cmp    -0x8(%rbp),%eax
jle    115b <nullregion+0x4b>
cmpl   $0x0,-0xc(%rbp)
jle    1147 <nullregion+0x37>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1150 <nullregion+0x40>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <nullregion+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullregion>:
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
mov    %edi,%edx
neg    %edx
test   %esi,%esi
cmovle %edi,%edx
add    %esi,%edx
xor    %eax,%eax
cmp    %edi,%ecx
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @nullregion(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%4 = icmp sgt i32 %3, %0
%5 = icmp sgt i32 %1, 0
%6 = sub i32 0, %0
%7 = select i1 %5, i32 %6, i32 %0
%8 = add i32 %7, %1
%9 = select i1 %4, i32 %8, i32 0
ret i32 %9
}
/* Variables and functions */
int test_compare(long, long, char *, char const *);
int test_address(const void *result, const void *expected, const char *error) {
  return test_compare((long)result, (long)expected, "0x%06lx", error);
}


x86 assembly (clang, -O0):
<test_address>:
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),%rcx
lea    0xec9(%rip),%rdx
call   1030 <test_compare@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_address>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <test_compare@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"0x%06lx\00"
define i32 @test_address(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i8*, i8** %6
%12 = call i32 @test_compare(i64 %8, i64 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"0x%06lx\00"
define i32 @test_address(i8* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %0 to i64
%5 = ptrtoint i8* %1 to i64
%6 = tail call i32 @test_compare(i64 %4, i64 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test_func(int volatile, int volatile);
int main() {
  volatile int p, q;
  p = 1;
  q = 4;
  while (1) {
    test_func(p, q);
    p++;
    q--;
    if (q < 0)
      q = 4;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <test_func@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
jge    115d <main+0x4d>
movl   $0x4,-0xc(%rbp)
jmp    112d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
nopl   0x0(%rax)
movl   $0x4,(%rsp)
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <test_func@plt>
addl   $0x1,0x4(%rsp)
addl   $0xffffffff,(%rsp)
cmpl   $0x0,(%rsp)
jns    1127 <main+0x17>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store volatile i32 1, i32* %1
store volatile i32 4, i32* %2
br label %5
5: ; preds = %16, %0
%6 = load volatile i32, i32* %1
%7 = load volatile i32, i32* %2
%8 = tail call i32 @test_func(i32 %6, i32 %7)
%9 = load volatile i32, i32* %1
%10 = add nsw i32 %9, 1
store volatile i32 %10, i32* %1
%11 = load volatile i32, i32* %2
%12 = add nsw i32 %11, -1
store volatile i32 %12, i32* %2
%13 = load volatile i32, i32* %2
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %5
store volatile i32 4, i32* %2
br label %16
16: ; preds = %15, %5
br label %5
}