xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;
typedef int int8_t;

/* Variables and functions */
void PutPixel24(int8_t *pData, uint32_t pixel) {
  pData[2] = (pixel & 0x00FF0000) >> 16;
  pData[1] = (pixel & 0x0000FF00) >> 8;
  pData[0] = (pixel & 0x000000FF);
}


x86 assembly (clang, -O0):
<PutPixel24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutPixel24>:
mov    %esi,%eax
movzbl %ah,%ecx
movzbl %al,%edx
shr    $0x10,%eax
movzbl %al,%eax
mov    %eax,0x8(%rdi)
mov    %ecx,0x4(%rdi)
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
define void @PutPixel24(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 = and i32 %5, 16711680
%7 = ashr i32 %6, 16
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 2
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = and i32 %15, 255
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 0
store i32 %16, i32* %18
ret void
}

LLVM IR (-O2):
define void @PutPixel24(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %4, i32* %5
%6 = lshr i32 %1, 8
%7 = and i32 %6, 255
%8 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %7, i32* %8
%9 = and i32 %1, 255
store i32 %9, i32* %0
ret void
}
int ft_tolower(int c) { return (('A' <= c && c <= 'Z' ? c + 32 : c)); }


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     112d <ft_tolower+0x2d>
cmpl   $0x5a,-0x4(%rbp)
jg     112d <ft_tolower+0x2d>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <ft_tolower+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 65, %3
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
br label %13
11: ; preds = %5, %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 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printRBGFromRGB365(int);
int main(int argc, char const *argv[]) {
  printRBGFromRGB365(0b1111100000000000);
  printRBGFromRGB365(0x0000);
  printRBGFromRGB365(0x40B0);
  printRBGFromRGB365(0x0078);
  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    $0xf800,%edi
call   1030 <printRBGFromRGB365@plt>
xor    %edi,%edi
call   1030 <printRBGFromRGB365@plt>
mov    $0x40b0,%edi
call   1030 <printRBGFromRGB365@plt>
mov    $0x78,%edi
call   1030 <printRBGFromRGB365@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf800,%edi
call   1030 <printRBGFromRGB365@plt>
xor    %edi,%edi
call   1030 <printRBGFromRGB365@plt>
mov    $0x40b0,%edi
call   1030 <printRBGFromRGB365@plt>
mov    $0x78,%edi
call   1030 <printRBGFromRGB365@plt>
xor    %eax,%eax
pop    %rcx
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 @printRBGFromRGB365(i32 63488)
%7 = call i32 @printRBGFromRGB365(i32 0)
%8 = call i32 @printRBGFromRGB365(i32 16560)
%9 = call i32 @printRBGFromRGB365(i32 120)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printRBGFromRGB365(i32 63488)
%4 = tail call i32 @printRBGFromRGB365(i32 0)
%5 = tail call i32 @printRBGFromRGB365(i32 16560)
%6 = tail call i32 @printRBGFromRGB365(i32 120)
ret i32 0
}
void start() {
  char stack[65536];
  int i;
  for (i = 0; i < 65536; i++)
    stack[i] = 0x55;
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0xff90,%rsp
movl   $0x0,-0x10004(%rbp)
cmpl   $0x10000,-0x10004(%rbp)
jge    1148 <start+0x48>
movslq -0x10004(%rbp),%rax
movb   $0x55,-0x10000(%rbp,%rax,1)
55
mov    -0x10004(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10004(%rbp)
jmp    1115 <start+0x15>
add    $0xff90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @start() {
%1 = alloca [65536 x i8]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 65536
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [65536 x i8], [65536 x i8]* %1, i64 0, i64 %8
store i8 85, i8* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Error(char *, int, char *);
int /*<<< orphan*/ freeconfig();
int /*<<< orphan*/ initconfig(int /*<<< orphan*/ *);
int /*<<< orphan*/ modulerehash();
void rehashconfig() {
  Error("config", 1, "Rehashing config file.");
  freeconfig();
  initconfig(NULL);
  modulerehash();
}


x86 assembly (clang, -O0):
<rehashconfig>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
mov    $0x1,%esi
lea    0xeb0(%rip),%rdx
call   1030 <Error@plt>
mov    $0x0,%al
call   1060 <freeconfig@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <initconfig@plt>
mov    $0x0,%al
call   1040 <modulerehash@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rehashconfig>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0xeb8(%rip),%rdx
mov    $0x1,%esi
call   1030 <Error@plt>
xor    %eax,%eax
call   1060 <freeconfig@plt>
xor    %edi,%edi
call   1050 <initconfig@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <modulerehash@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"config\00"
@.str.1 = [23 x i8] c"Rehashing config file.\00"
define void @rehashconfig() {
%1 = call i32 @Error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @freeconfig()
%3 = call i32 @initconfig(i32* null)
%4 = call i32 (...) @modulerehash()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"config\00"
@.str.1 = [23 x i8] c"Rehashing config file.\00"
define void @rehashconfig() {
%1 = tail call i32 @Error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @freeconfig()
%3 = tail call i32 @initconfig(i32* null)
%4 = tail call i32 (...) @modulerehash()
ret void
}
/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
int jw_strncasecmp(const char *a, const char *b, size_t n) {
  if (a == b) {
    return 0;
  }
  if (a == NULL) {
    return -1;
  }
  if (b == NULL) {
    return 1;
  }
  return strncasecmp(a, b, n);
}


x86 assembly (clang, -O0):
<jw_strncasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113e <jw_strncasecmp+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1180 <jw_strncasecmp+0x70>
cmpq   $0x0,-0x10(%rbp)
jne    1155 <jw_strncasecmp+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <jw_strncasecmp+0x70>
cmpq   $0x0,-0x18(%rbp)
jne    116c <jw_strncasecmp+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1180 <jw_strncasecmp+0x70>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncasecmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jw_strncasecmp>:
cmp    %rsi,%rdi
je     1124 <jw_strncasecmp+0x14>
test   %rdi,%rdi
je     1127 <jw_strncasecmp+0x17>
test   %rsi,%rsi
je     112d <jw_strncasecmp+0x1d>
jmp    1030 <strncasecmp@plt>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @jw_strncasecmp(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %0, %1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp eq i8* %0, null
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = icmp eq i8* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 %2)
br label %11
11: ; preds = %7, %5, %3, %9
%12 = phi i32 [ %10, %9 ], [ 0, %3 ], [ -1, %5 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *thr_func2(void *arg) {
  printf("Thread 2 uscita\n");
  return ((void *)2);
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Thread 2 uscita\0A\00"
define i8* @thr_func2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i8* inttoptr (i64 2 to i8*)
}

LLVM IR (-O2):
@str = [16 x i8] c"Thread 2 uscita\00"
define i8* @thr_func2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i8* inttoptr (i64 2 to i8*)
}
/* Type definitions */
struct ListNode {
  int dummy;
};

/* Variables and functions */
struct ListNode *removeNthFromEnd(struct ListNode *, int);
struct ListNode *rm(struct ListNode *head, int n) {
  return removeNthFromEnd(head, n);
}


x86 assembly (clang, -O0):
<rm>:
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 <removeNthFromEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm>:
jmp    1030 <removeNthFromEnd@plt>

LLVM IR (-O0):
%struct.ListNode = type { i32 }
define %struct.ListNode* @rm(%struct.ListNode* %0, i32 %1) {
%3 = alloca %struct.ListNode*
%4 = alloca i32
store %struct.ListNode* %0, %struct.ListNode** %3
store i32 %1, i32* %4
%5 = load %struct.ListNode*, %struct.ListNode** %3
%6 = load i32, i32* %4
%7 = call %struct.ListNode* @removeNthFromEnd(%struct.ListNode* %5, i32 %6)
ret %struct.ListNode* %7
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define %struct.ListNode* @rm(%struct.ListNode* %0, i32 %1) {
%3 = tail call %struct.ListNode* @removeNthFromEnd(%struct.ListNode* %0, i32 %1)
ret %struct.ListNode* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ merge_64b(int, int /*<<< orphan*/ *, int);
void sort_64b(int n, uint64_t x[n]) {
  if (n <= 1)
    return;
  sort_64b(n / 2, x);
  sort_64b(n / 2, x + n / 2);
  merge_64b(n / 2, x, 1);
}


x86 assembly (clang, -O0):
<sort_64b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     113e <sort_64b+0x1e>
jmp    1199 <sort_64b+0x79>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <sort_64b@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
shl    $0x2,%rax
add    %rax,%rsi
call   1040 <sort_64b@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <merge_64b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_64b>:
cmp    $0x1,%edi
jg     1126 <sort_64b+0x6>
ret
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
shr    %ebx
mov    %ebx,%edi
call   1040 <sort_64b@plt>
lea    (%r14,%rbx,4),%rsi
mov    %ebx,%edi
call   1040 <sort_64b@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <merge_64b@plt>

LLVM IR (-O0):
define void @sort_64b(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
br label %25
10: ; preds = %2
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 2
%13 = load i32*, i32** %4
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 2
%16 = load i32*, i32** %4
%17 = load i32, i32* %3
%18 = sdiv i32 %17, 2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %16, i64 %19
%21 = load i32, i32* %3
%22 = sdiv i32 %21, 2
%23 = load i32*, i32** %4
%24 = call i32 @merge_64b(i32 %22, i32* %23, i32 1)
br label %25
25: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @sort_64b(i32 %0, i32* %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %5
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = lshr i32 %0, 1
tail call void @sort_64b(i32 %6, i32* %1)
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %1, i64 %7
tail call void @sort_64b(i32 %6, i32* %8)
%9 = tail call i32 @merge_64b(i32 %6, i32* %1, i32 1)
br label %4
}
/* Variables and functions */
scalar_t__ __builtin_lfloor(double);
int /*<<< orphan*/ link_failure_builtin_lfloor();
void test_builtin_lfloor(double d) {
  if (__builtin_lfloor(d) != __builtin_lfloor(d))
    link_failure_builtin_lfloor();
}


x86 assembly (clang, -O0):
<test_builtin_lfloor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <__builtin_lfloor@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <__builtin_lfloor@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_lfloor+0x3c>
mov    $0x0,%al
call   1030 <link_failure_builtin_lfloor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_lfloor>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <__builtin_lfloor@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <__builtin_lfloor@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_lfloor+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_lfloor@plt>

LLVM IR (-O0):
define void @test_builtin_lfloor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @__builtin_lfloor(double %3)
%5 = load double, double* %2
%6 = call i64 @__builtin_lfloor(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_lfloor()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_lfloor(double %0) {
%2 = tail call i64 @__builtin_lfloor(double %0)
%3 = tail call i64 @__builtin_lfloor(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_lfloor()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert((2 & 3) == 1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int count_pointers(char **xs) {
  int i;
  for (i = 0; xs[i] != NULL; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<count_pointers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1135 <count_pointers+0x35>
jmp    1127 <count_pointers+0x27>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <count_pointers+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_pointers>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <count_pointers+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_pointers(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int EncUnitFloat(d)
double d;
{
  int i;
  if (d < -1.0)
    d = -1.0;
  if (d > 1.0)
    d = 1.0;
  i = (int)((d + 1.0) * 127.5);
  return i;
}


x86 assembly (clang, -O0):
<EncUnitFloat>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <EncUnitFloat+0x29>
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <EncUnitFloat+0x4d>
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeb3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EncUnitFloat>:
movsd  0xef8(%rip),%xmm1
maxsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
movapd %xmm0,%xmm2
minsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
mulsd  0xee8(%rip),%xmm2
cvttsd2si %xmm2,%eax
ret

LLVM IR (-O0):
define i32 @EncUnitFloat(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, -1.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double -1.000000e+00, double* %2
br label %7
7: ; preds = %6, %1
%8 = load double, double* %2
%9 = fcmp ogt double %8, 1.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double 1.000000e+00, double* %2
br label %11
11: ; preds = %10, %7
%12 = load double, double* %2
%13 = fadd double %12, 1.000000e+00
%14 = fmul double %13, 1.275000e+02
%15 = fptosi double %14 to i32
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @EncUnitFloat(double %0) {
%2 = fcmp olt double %0, -1.000000e+00
%3 = select i1 %2, double -1.000000e+00, double %0
%4 = fcmp ogt double %3, 1.000000e+00
%5 = select i1 %4, double 1.000000e+00, double %3
%6 = fadd double %5, 1.000000e+00
%7 = fmul double %6, 1.275000e+02
%8 = fptosi double %7 to i32
ret i32 %8
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int add_int_data(struct buffer *, int, unsigned int);
int add_maxbps_avp(struct buffer *buf, unsigned int speed) {
  return add_int_data(buf, 17, speed);
}


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

x86 assembly (clang, -O2):
<add_maxbps_avp>:
mov    %esi,%edx
mov    $0x11,%esi
jmp    1030 <add_int_data@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @add_maxbps_avp(%struct.buffer* %0, i32 %1) {
%3 = alloca %struct.buffer*
%4 = alloca i32
store %struct.buffer* %0, %struct.buffer** %3
store i32 %1, i32* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = load i32, i32* %4
%7 = call i32 @add_int_data(%struct.buffer* %5, i32 17, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @add_maxbps_avp(%struct.buffer* %0, i32 %1) {
%3 = tail call i32 @add_int_data(%struct.buffer* %0, i32 17, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo() {
  static int counter = 0;
  printf("counter = %d\n", counter);
  ++counter;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2f00(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef7(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    0x2f15(%rip),%esi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
addl   $0x1,0x2f02(%rip)
pop    %rax
ret

LLVM IR (-O0):
@foo.counter = internal global i32 0
@.str = [14 x i8] c"counter = %d\0A\00"
define void @foo() {
%1 = load i32, i32* @foo.counter
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @foo.counter
%4 = add nsw i32 %3, 1
store i32 %4, i32* @foo.counter
ret void
}

LLVM IR (-O2):
@foo.counter = internal unnamed_addr global i32 0
@.str = [14 x i8] c"counter = %d\0A\00"
define void @foo() {
%1 = load i32, i32* @foo.counter
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @foo.counter
%4 = add nsw i32 %3, 1
store i32 %4, i32* @foo.counter
ret void
}
int rem(int x, int y) {
  if (y == 0)
    y = 1;
  return (x - (x / y) * y);
}


x86 assembly (clang, -O0):
<rem>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111b <rem+0x1b>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rem>:
mov    %edi,%eax
test   %esi,%esi
mov    $0x1,%ecx
cmovne %esi,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @rem(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 1, i32* %4
br label %8
8: ; preds = %7, %2
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sdiv i32 %10, %11
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = sub nsw i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @rem(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 1, i32 %1
%5 = srem i32 %0, %4
ret i32 %5
}
/* Type definitions */
struct lframe {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lframe *machine_peek_frame(struct lemon *);
struct lframe *lemon_machine_peek_frame(struct lemon *lemon) {
  return machine_peek_frame(lemon);
}


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

x86 assembly (clang, -O2):
<lemon_machine_peek_frame>:
jmp    1030 <machine_peek_frame@plt>

LLVM IR (-O0):
%struct.lframe = type { i32 }
%struct.lemon = type { i32 }
define %struct.lframe* @lemon_machine_peek_frame(%struct.lemon* %0) {
%2 = alloca %struct.lemon*
store %struct.lemon* %0, %struct.lemon** %2
%3 = load %struct.lemon*, %struct.lemon** %2
%4 = call %struct.lframe* @machine_peek_frame(%struct.lemon* %3)
ret %struct.lframe* %4
}

LLVM IR (-O2):
%struct.lframe = type { i32 }
%struct.lemon = type { i32 }
define %struct.lframe* @lemon_machine_peek_frame(%struct.lemon* %0) {
%2 = tail call %struct.lframe* @machine_peek_frame(%struct.lemon* %0)
ret %struct.lframe* %2
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ _library_ident(char *);
int /*<<< orphan*/ _library_task(char *);
extern void _start(void) {
  _library_ident("MPT Plotting Library");
  _library_task("layout element definitions");
  _library_task("graph data generation");
  _exit(0);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <_library_ident@plt>
lea    0xece(%rip),%rdi
call   1040 <_library_task@plt>
lea    0xedd(%rip),%rdi
call   1040 <_library_task@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <_library_ident@plt>
lea    0xed1(%rip),%rdi
call   1040 <_library_task@plt>
lea    0xee0(%rip),%rdi
call   1040 <_library_task@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"MPT Plotting Library\00"
@.str.1 = [27 x i8] c"layout element definitions\00"
@.str.2 = [22 x i8] c"graph data generation\00"
define void @_start() {
%1 = call i32 @_library_ident(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @_library_task(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @_library_task(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"MPT Plotting Library\00"
@.str.1 = [27 x i8] c"layout element definitions\00"
@.str.2 = [22 x i8] c"graph data generation\00"
define void @_start() {
%1 = tail call i32 @_library_ident(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_library_task(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @_library_task(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
printstar() { printf("* * * * * * * * * * * * * * * \n"); }


x86 assembly (clang, -O0):
<printstar>:
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):
<printstar>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [31 x i8] c"* * * * * * * * * * * * * * * \00"
define i32 @printstar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct node_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ node_cmdline_parser_required2(struct node_args_info *, char const *,
                                         int /*<<< orphan*/);
int node_cmdline_parser_required(struct node_args_info *args_info,
                                 const char *prog_name) {
  int result = EXIT_SUCCESS;
  if (node_cmdline_parser_required2(args_info, prog_name, 0) > 0)
    result = EXIT_FAILURE;
  return result;
}


x86 assembly (clang, -O0):
<node_cmdline_parser_required>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <node_cmdline_parser_required2@plt>
cmp    $0x0,%rax
jle    1151 <node_cmdline_parser_required+0x41>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_cmdline_parser_required>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ebx
xor    %edx,%edx
call   1030 <node_cmdline_parser_required2@plt>
test   %rax,%rax
jle    112f <node_cmdline_parser_required+0x1f>
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @node_cmdline_parser_required(%struct.node_args_info* %0, i8* %1) {
%3 = alloca %struct.node_args_info*
%4 = alloca i8*
%5 = alloca i32
store %struct.node_args_info* %0, %struct.node_args_info** %3
store i8* %1, i8** %4
%6 = load i32, i32* @EXIT_SUCCESS
store i32 %6, i32* %5
%7 = load %struct.node_args_info*, %struct.node_args_info** %3
%8 = load i8*, i8** %4
%9 = call i64 @node_cmdline_parser_required2(%struct.node_args_info* %7, i8* %8, i32 0)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %5
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.node_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @node_cmdline_parser_required(%struct.node_args_info* %0, i8* %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i64 @node_cmdline_parser_required2(%struct.node_args_info* %0, i8* %1, i32 0)
%5 = icmp sgt i64 %4, 0
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %5, i32 %6, i32 %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
void rnd_init(void) { srand(0); }


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

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

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

LLVM IR (-O2):
define void @rnd_init() {
%1 = tail call i32 @srand(i32 0)
ret void
}
/* Variables and functions */
unsigned long long __udivmoddi4(unsigned long long, unsigned long long,
                                int /*<<< orphan*/);
unsigned long long __udivdi3(unsigned long long num, unsigned long long den) {
  return __udivmoddi4(num, den, 0);
}


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

x86 assembly (clang, -O2):
<__udivdi3>:
xor    %edx,%edx
jmp    1030 <__udivmoddi4@plt>

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

LLVM IR (-O2):
define i64 @__udivdi3(i64 %0, i64 %1) {
%3 = tail call i64 @__udivmoddi4(i64 %0, i64 %1, i32 0)
ret i64 %3
}
/* Variables and functions */
scalar_t__ bit_count(unsigned char);
unsigned int ones_count(unsigned char *buf, unsigned int buf_len) {
  unsigned int sum = 0;
  for (unsigned int i = 0; i < buf_len; i++)
    sum += bit_count(buf[i]);
  return sum;
}


x86 assembly (clang, -O0):
<ones_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1163 <ones_count+0x53>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movzbl (%rax,%rcx,1),%edi
call   1030 <bit_count@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <ones_count+0x1d>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ones_count>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1147 <ones_count+0x37>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%r14,%rbx,1),%edi
call   1030 <bit_count@plt>
add    %eax,%ebp
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <ones_count+0x20>
jmp    1149 <ones_count+0x39>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ones_count(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = phi i32 [ 0, %2 ], [ %15, %8 ]
ret i32 %7
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %16, %8 ]
%10 = phi i32 [ 0, %4 ], [ %15, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = tail call i64 @bit_count(i8 zeroext %12)
%14 = trunc i64 %13 to i32
%15 = add i32 %10, %14
%16 = add nuw nsw i64 %9, 1
%17 = icmp eq i64 %16, %5
br i1 %17, label %6, label %8
}
int main(int argc, char **argv) { static char mbuf[10240000]; }


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

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

LLVM IR (-O0):
@main.mbuf = internal global [10240000 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int getnpar(int, char *, char *, int *);
int getnparint(int n, char *name, int *ptr) {
  return getnpar(n, name, "i", ptr);
}


x86 assembly (clang, -O0):
<getnparint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdx
call   1030 <getnpar@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"i\00"
define i32 @getnparint(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
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i32 @getnpar(i32 %7, i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"i\00"
define i32 @getnparint(i32 %0, i8* %1, i32* %2) {
%4 = tail call i32 @getnpar(i32 %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %2)
ret i32 %4
}
/* Variables and functions */
unsigned int crc32(char *, int);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
int verifyChecksum(char *data, int data_length, unsigned int checksum) {
  unsigned int expected;
  expected = crc32(data, data_length);
  if (expected == checksum)
    return 1;
  printf("[ERROR ]: Checksum ERROR, checksum=%x, expected=%x\n", checksum,
         expected);
  return 0;
}


x86 assembly (clang, -O0):
<verifyChecksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <crc32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1159 <verifyChecksum+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1172 <verifyChecksum+0x52>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifyChecksum>:
push   %rbx
mov    %edx,%ebx
call   1030 <crc32@plt>
mov    $0x1,%ecx
cmp    %ebx,%eax
je     1143 <verifyChecksum+0x23>
lea    0xec8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"[ERROR ]: Checksum ERROR, checksum=%x, expected=%x\0A\00"
define i32 @verifyChecksum(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @crc32(i8* %9, i32 %10)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = load i32, i32* %7
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 1, i32* %4
br label %20
16: ; preds = %3
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
store i32 0, i32* %4
br label %20
20: ; preds = %16, %15
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@.str = [52 x i8] c"[ERROR ]: Checksum ERROR, checksum=%x, expected=%x\0A\00"
define i32 @verifyChecksum(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @crc32(i8* %0, i32 %1)
%5 = icmp eq i32 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %9
}
int dummy(int fd) { return fd; }


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

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

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

LLVM IR (-O2):
define i32 @dummy(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int pid_cmp(const void *a, const void *b) {
  const pid_t *pid1 = (const pid_t *)a;
  const pid_t *pid2 = (const pid_t *)b;
  if (*pid1 > *pid2) {
    return (1);
  }
  if (*pid1 < *pid2) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<pid_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jle    113c <pid_cmp+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <pid_cmp+0x63>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jge    115c <pid_cmp+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <pid_cmp+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pid_cmp>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setl   %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @pid_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
%8 = icmp slt i64 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int check_table1(char *);
int check_table3(char *str) { return check_table1(str); }


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

x86 assembly (clang, -O2):
<check_table3>:
jmp    1030 <check_table1@plt>

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

LLVM IR (-O2):
define i32 @check_table3(i8* %0) {
%2 = tail call i32 @check_table1(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(void const *);
int _p11_hash_intptr_equal(const void *int_one, const void *int_two) {
  assert(int_one);
  assert(int_two);
  return *((int *)int_one) == *((int *)int_two);
}


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

x86 assembly (clang, -O2):
<_p11_hash_intptr_equal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    (%rbx),%ecx
xor    %eax,%eax
cmp    (%r14),%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_p11_hash_intptr_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = icmp eq i32 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @_p11_hash_intptr_equal(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = bitcast i8* %1 to i32*
%8 = load i32, i32* %7
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int BGBDT_MapObj_CheckStrMatch(char *str, char *ref) {
  if (!ref)
    return (1);
  if (!str)
    return (0);
  return (!strcmp(str, ref));
}


x86 assembly (clang, -O0):
<BGBDT_MapObj_CheckStrMatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1137 <BGBDT_MapObj_CheckStrMatch+0x27>
movl   $0x1,-0x4(%rbp)
jmp    116b <BGBDT_MapObj_CheckStrMatch+0x5b>
cmpq   $0x0,-0x10(%rbp)
jne    114e <BGBDT_MapObj_CheckStrMatch+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116b <BGBDT_MapObj_CheckStrMatch+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BGBDT_MapObj_CheckStrMatch>:
test   %rsi,%rsi
je     112e <BGBDT_MapObj_CheckStrMatch+0x1e>
test   %rdi,%rdi
je     1134 <BGBDT_MapObj_CheckStrMatch+0x24>
push   %rax
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @BGBDT_MapObj_CheckStrMatch(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
store i32 1, i32* %3
br label %20
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %9
store i32 0, i32* %3
br label %20
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = call i32 @strcmp(i8* %14, i8* %15)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @BGBDT_MapObj_CheckStrMatch(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp eq i8* %0, null
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = tail call i32 @strcmp(i8* %0, i8* %1)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %2, %6
%11 = phi i32 [ %9, %6 ], [ 1, %2 ], [ 0, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void reply_to_user() {
  printf("Your query is solved. We have a great solution for your "
         "problem.Contact us and we'll let you know\n");
}


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

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

LLVM IR (-O0):
@.str = [99 x i8] c"Your query is solved. We have a great solution for your problem.Contact us and we'll let you know\0A\00"
define void @reply_to_user() {
%1 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [98 x i8] c"Your query is solved. We have a great solution for your problem.Contact us and we'll let you know\00"
define void @reply_to_user() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str, i64 0, i64 0))
ret void
}