xunge/DecIR huggingface dataset:
void ARGB4444ToARGBRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGB4444ToARGBRow_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, double);
int main() {
  printf("%*.*f", 6, 2, 12.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x6,%esi
mov    $0x2,%edx
movsd  0xec8(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x6,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%*.*f\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 6, i32 2, double 1.200000e+01)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%*.*f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 6, i32 2, double 1.200000e+01)
ret i32 0
}
int QueryIRQ(int intpri) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @QueryIRQ(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t stu_atomic_read(const uint32_t *v) {
  return (*(volatile uint32_t *)v);
}


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

x86 assembly (clang, -O2):
<stu_atomic_read>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @stu_atomic_read(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void compat_le16enc(void *pp, uint16_t x) {
  uint8_t *p = (uint8_t *)pp;
  p[0] = x & 0xff;
  p[1] = (x >> 8) & 0xff;
}


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

x86 assembly (clang, -O2):
<compat_le16enc>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @compat_le16enc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
ret void
}

LLVM IR (-O2):
define void @compat_le16enc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = and i32 %1, 255
store i32 %4, i32* %3
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __get_FPEXC(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @__get_FPEXC() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_table();
int /*<<< orphan*/ yyparse();
main() {
  init_table();
  yyparse();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init_table@plt>
mov    $0x0,%al
call   1030 <yyparse@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @init_table()
%2 = call i32 (...) @yyparse()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_table()
%2 = tail call i32 (...) @yyparse()
ret i32 0
}
int helper(int c) { return c / 2; }


x86 assembly (clang, -O0):
<helper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @helper(i32 %0) {
%2 = sdiv i32 %0, 2
ret i32 %2
}
void UnixSetupFunc() {}


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

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

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

LLVM IR (-O2):
define void @UnixSetupFunc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ testForEmtpyQueue();
int /*<<< orphan*/ testQueueCommutativeEnDeQueue();
int /*<<< orphan*/ testQueueEmptyOnEnqueueDequeue();
int /*<<< orphan*/ testQueueEnqueueFrontOnEmpty();
int /*<<< orphan*/ testQueueEnqueueFrontOnNonEmpty();
int /*<<< orphan*/ testQueueNotEmptyOnEnque();
int main(void) {
  testForEmtpyQueue();
  testQueueNotEmptyOnEnque();
  testQueueEmptyOnEnqueueDequeue();
  testQueueCommutativeEnDeQueue();
  testQueueEnqueueFrontOnEmpty();
  testQueueEnqueueFrontOnNonEmpty();
  printf("All tests passed!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <testForEmtpyQueue@plt>
mov    $0x0,%al
call   1040 <testQueueNotEmptyOnEnque@plt>
mov    $0x0,%al
call   1030 <testQueueEmptyOnEnqueueDequeue@plt>
mov    $0x0,%al
call   1080 <testQueueCommutativeEnDeQueue@plt>
mov    $0x0,%al
call   1070 <testQueueEnqueueFrontOnEmpty@plt>
mov    $0x0,%al
call   1090 <testQueueEnqueueFrontOnNonEmpty@plt>
lea    0xe50(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <testForEmtpyQueue@plt>
xor    %eax,%eax
call   1050 <testQueueNotEmptyOnEnque@plt>
xor    %eax,%eax
call   1030 <testQueueEmptyOnEnqueueDequeue@plt>
xor    %eax,%eax
call   1080 <testQueueCommutativeEnDeQueue@plt>
xor    %eax,%eax
call   1070 <testQueueEnqueueFrontOnEmpty@plt>
xor    %eax,%eax
call   1090 <testQueueEnqueueFrontOnNonEmpty@plt>
lea    0xe5e(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"All tests passed!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testForEmtpyQueue()
%3 = call i32 (...) @testQueueNotEmptyOnEnque()
%4 = call i32 (...) @testQueueEmptyOnEnqueueDequeue()
%5 = call i32 (...) @testQueueCommutativeEnDeQueue()
%6 = call i32 (...) @testQueueEnqueueFrontOnEmpty()
%7 = call i32 (...) @testQueueEnqueueFrontOnNonEmpty()
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"All tests passed!\00"
define i32 @main() {
%1 = tail call i32 (...) @testForEmtpyQueue()
%2 = tail call i32 (...) @testQueueNotEmptyOnEnque()
%3 = tail call i32 (...) @testQueueEmptyOnEnqueueDequeue()
%4 = tail call i32 (...) @testQueueCommutativeEnDeQueue()
%5 = tail call i32 (...) @testQueueEnqueueFrontOnEmpty()
%6 = tail call i32 (...) @testQueueEnqueueFrontOnNonEmpty()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct pollfd {
  int fd;
  int events;
};

/* Variables and functions */
int poll(struct pollfd *, int, int);
int poll_one(int fd, int events, int timeout_ms) {
  struct pollfd pfd = {.fd = fd, .events = events};
  return poll(&pfd, 1, timeout_ms);
}


x86 assembly (clang, -O0):
<poll_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edx
lea    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1030 <poll@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poll_one>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <poll@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32 }
define i32 @poll_one(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.pollfd
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %7, i32 0, i32 0
%9 = load i32, i32* %4
store i32 %9, i32* %8
%10 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %7, i32 0, i32 1
%11 = load i32, i32* %5
store i32 %11, i32* %10
%12 = load i32, i32* %6
%13 = call i32 @poll(%struct.pollfd* %7, i32 1, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32 }
define i32 @poll_one(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.pollfd
%5 = bitcast %struct.pollfd* %4 to i8*
%6 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %4, i64 0, i32 0
store i32 %0, i32* %6
%7 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %4, i64 0, i32 1
store i32 %1, i32* %7
%8 = call i32 @poll(%struct.pollfd* %4, i32 1, i32 %2)
ret i32 %8
}
int main() {
  int x = 1;
  x = x + 1;
  x = x + 1;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
int test12(int x) { return x / -10 >= 0; }


x86 assembly (clang, -O0):
<test12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test12>:
xor    %eax,%eax
cmp    $0xa,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @test12(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, -10
%5 = icmp sge i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test12(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int treeSum(struct TreeNode *, int /*<<< orphan*/);
int sumNumbers(struct TreeNode *root) {
  if (!root)
    return 0;
  return treeSum(root, 0);
}


x86 assembly (clang, -O0):
<sumNumbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <sumNumbers+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1141 <sumNumbers+0x31>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <treeSum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumNumbers>:
test   %rdi,%rdi
je     111c <sumNumbers+0xc>
xor    %esi,%esi
jmp    1030 <treeSum@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @sumNumbers(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = alloca %struct.TreeNode*
store %struct.TreeNode* %0, %struct.TreeNode** %3
%4 = load %struct.TreeNode*, %struct.TreeNode** %3
%5 = icmp ne %struct.TreeNode* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
%8 = load %struct.TreeNode*, %struct.TreeNode** %3
%9 = call i32 @treeSum(%struct.TreeNode* %8, i32 0)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @sumNumbers(%struct.TreeNode* %0) {
%2 = icmp eq %struct.TreeNode* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @treeSum(%struct.TreeNode* %0, i32 0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
int isidentchar(int c) {
  return ((unsigned)((c) - ('a')) <= (unsigned)(('z') - ('a'))) ||
         ((unsigned)((c) - ('A')) <= (unsigned)(('Z') - ('A'))) ||
         ((unsigned)((c) - ('0')) <= (unsigned)(('9') - ('0'))) || c == '.' ||
         c == '_';
}


x86 assembly (clang, -O0):
<isidentchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x1,%al
cmp    $0x19,%ecx
mov    %al,-0x5(%rbp)
jbe    115c <isidentchar+0x5c>
mov    -0x4(%rbp),%ecx
sub    $0x41,%ecx
mov    $0x1,%al
cmp    $0x19,%ecx
mov    %al,-0x5(%rbp)
jbe    115c <isidentchar+0x5c>
mov    -0x4(%rbp),%ecx
sub    $0x30,%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x5(%rbp)
jbe    115c <isidentchar+0x5c>
mov    $0x1,%al
cmpl   $0x2e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isidentchar+0x5c>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isidentchar>:
lea    -0x61(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x1a,%ecx
jb     112a <isidentchar+0x2a>
lea    -0x41(%rdi),%ecx
cmp    $0x1a,%ecx
jb     112a <isidentchar+0x2a>
cmp    $0x2e,%edi
je     112a <isidentchar+0x2a>
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
jb     112a <isidentchar+0x2a>
xor    %eax,%eax
cmp    $0x5f,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isidentchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 97
%5 = icmp ule i32 %4, 25
br i1 %5, label %20, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 65
%9 = icmp ule i32 %8, 25
br i1 %9, label %20, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 48
%13 = icmp ule i32 %12, 9
br i1 %13, label %20, label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 46
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 95
br label %20
20: ; preds = %17, %14, %10, %6, %1
%21 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isidentchar(i32 %0) {
%2 = add nsw i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -65
%5 = icmp ult i32 %4, 26
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = add nsw i32 %0, -48
%9 = icmp ult i32 %8, 10
%10 = icmp eq i32 %0, 46
%11 = or i1 %10, %9
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = icmp eq i32 %0, 95
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %12, %7, %1
%16 = phi i32 [ 1, %7 ], [ 1, %1 ], [ %14, %12 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void version(void) { puts("Nokia FBUS line discipline\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Nokia FBUS line discipline\0A\00"
define void @version() {
%1 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Nokia FBUS line discipline\0A\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
void XtAppNextEvent() {}


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

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

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

LLVM IR (-O2):
define void @XtAppNextEvent() {
ret void
}
void __set_bit(int nr, volatile void *addr) {
  asm volatile("btsl %1,%0"
               : "=m"((*(volatile long *)addr))
               : "Ir"(nr), "m"((*(volatile long *)addr))
               : "memory");
}


x86 assembly (clang, -O0):
<__set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rdx
bts    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_bit>:
bts    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @__set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i64*
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
ret void
}

LLVM IR (-O2):
define void @__set_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
tail call void asm sideeffect "btsl $1,$0", "=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i32 %0, i64* elementtype(i64) %3)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank4(int);
void m80setParams7EF2(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank4(val << 10);
}


x86 assembly (clang, -O0):
<m80setParams7EF2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xa,%edi
call   1030 <chr1setBank4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m80setParams7EF2>:
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank4@plt>

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

LLVM IR (-O2):
define void @m80setParams7EF2(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank4(i32 %3)
ret void
}
/* Variables and functions */
int cycle_length(int);
int max_cycle_length(int start, int end) {
  int cur_max = 1;
  int ret;
  int i;
  for (i = start; i < end + 1; ++i) {
    ret = cycle_length(i);
    if (ret > cur_max)
      cur_max = ret;
  }
  return cur_max;
}


x86 assembly (clang, -O0):
<max_cycle_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    116c <max_cycle_length+0x5c>
mov    -0x14(%rbp),%edi
call   1030 <cycle_length@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1159 <max_cycle_length+0x49>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    115e <max_cycle_length+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <max_cycle_length+0x1b>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_cycle_length>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebx
cmp    %esi,%edi
jg     1144 <max_cycle_length+0x34>
mov    %esi,%r14d
mov    %edi,%ebp
add    $0x1,%r14d
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <cycle_length@plt>
cmp    %ebx,%eax
cmovg  %eax,%ebx
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1130 <max_cycle_length+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @max_cycle_length(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %0, %2 ]
%6 = phi i32 [ %9, %4 ], [ 1, %2 ]
%7 = tail call i32 @cycle_length(i32 %5)
%8 = icmp sgt i32 %7, %6
%9 = select i1 %8, i32 %7, i32 %6
%10 = add i32 %5, 1
%11 = icmp eq i32 %5, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 1, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ sqlite3_free(void *);
void xFree(void *p) { sqlite3_free(p); }


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

x86 assembly (clang, -O2):
<xFree>:
jmp    1030 <sqlite3_free@plt>

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

LLVM IR (-O2):
define void @xFree(i8* %0) {
%2 = tail call i32 @sqlite3_free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hash_add(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ hash_finish(int /*<<< orphan*/, int);
uint32_t hash_2words(uint32_t x, uint32_t y) {
  return hash_finish(hash_add(hash_add(x, 0), y), 8);
}


x86 assembly (clang, -O0):
<hash_2words>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <hash_add@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1030 <hash_add@plt>
mov    %eax,%edi
mov    $0x8,%esi
call   1040 <hash_finish@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_2words>:
push   %rbx
mov    %esi,%ebx
xor    %esi,%esi
call   1030 <hash_add@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <hash_add@plt>
mov    %eax,%edi
mov    $0x8,%esi
pop    %rbx
jmp    1040 <hash_finish@plt>

LLVM IR (-O0):
define i32 @hash_2words(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 = call i32 @hash_add(i32 %5, i32 0)
%7 = load i32, i32* %4
%8 = call i32 @hash_add(i32 %6, i32 %7)
%9 = call i32 @hash_finish(i32 %8, i32 8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @hash_2words(i32 %0, i32 %1) {
%3 = tail call i32 @hash_add(i32 %0, i32 0)
%4 = tail call i32 @hash_add(i32 %3, i32 %1)
%5 = tail call i32 @hash_finish(i32 %4, i32 8)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _putchar(int);
int putchar(int c) {
  _putchar(c);
  return c;
}


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

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
call   1030 <_putchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
%2 = tail call i32 @_putchar(i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int foo();
main() {
  if (foo() != 0xfcc)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0xfcc,%eax
je     1158 <main+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0xfcc,%eax
jne    1146 <main+0x16>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 %2, 4044
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 4044
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int sync_wait(int, int);
int sync_wait_child(int fd[2], int seq) { return sync_wait(fd[1], seq); }


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

x86 assembly (clang, -O2):
<sync_wait_child>:
mov    0x4(%rdi),%edi
jmp    1030 <sync_wait@plt>

LLVM IR (-O0):
define i32 @sync_wait_child(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 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = call i32 @sync_wait(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @sync_wait_child(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @sync_wait(i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
void stdio_puts(const char *s) { printf(s); }


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

x86 assembly (clang, -O2):
<stdio_puts>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @stdio_puts(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
void blk_mq_debugfs_register(struct request_queue *q) {}


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

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

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

LLVM IR (-O2):
%struct.request_queue = type opaque
define void @blk_mq_debugfs_register(%struct.request_queue* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_names_clbk(void *name, void *data) { printf("%s\n", (char *)name); }


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

x86 assembly (clang, -O2):
<print_names_clbk>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @print_names_clbk(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 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_names_clbk(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void clearGrid(char grid[9][9]) {
  for (int y = 0; y < 9; y++)
    for (int x = 0; x < 9; x++)
      grid[x][y] = '-';
}


x86 assembly (clang, -O0):
<clearGrid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1162 <clearGrid+0x62>
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    114f <clearGrid+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x9,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movb   $0x2d,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <clearGrid+0x20>
jmp    1154 <clearGrid+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clearGrid+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearGrid>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movb   $0x2d,0x50(%rdi)
ret

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

LLVM IR (-O2):
define void @clearGrid([9 x i8]* nocapture writeonly %0) {
%2 = getelementptr [9 x i8], [9 x i8]* %0, i64 0, i64 0
ret void
}
/* Variables and functions */
int first();
int main(void) { return first() - 1001; }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <first@plt>
add    $0xfffffc17,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @first()
%3 = sub nsw i32 %2, 1001
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @first()
%2 = add nsw i32 %1, -1001
ret i32 %2
}
double calculate_time_to_stop(double init_velocity, double final_velocity,
                              double acceleration,
                              double initial_time_interval) {
  double time = 0.0;
  time = (((final_velocity - init_velocity) / acceleration) * 3600.0) +
         (initial_time_interval * 60.0);
  return time;
}


x86 assembly (clang, -O0):
<calculate_time_to_stop>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  0xebc(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_time_to_stop>:
subsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm3
divsd  %xmm2,%xmm1
mulsd  0xef0(%rip),%xmm1
addsd  %xmm3,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calculate_time_to_stop(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
store double 0.000000e+00, double* %9
%10 = load double, double* %6
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = load double, double* %7
%14 = fdiv double %12, %13
%15 = load double, double* %8
%16 = fmul double %15, 6.000000e+01
%17 = call double @llvm.fmuladd.f64(double %14, double 3.600000e+03, double %16)
store double %17, double* %9
%18 = load double, double* %9
ret double %18
}

LLVM IR (-O2):
define double @calculate_time_to_stop(double %0, double %1, double %2, double %3) {
%5 = fsub double %1, %0
%6 = fdiv double %5, %2
%7 = fmul double %3, 6.000000e+01
%8 = tail call double @llvm.fmuladd.f64(double %6, double 3.600000e+03, double %7)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ assert_dbl_equal_(char *, int, double, double, double);
void test_dbl_equal_pass() {
  assert_dbl_equal_("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/"
                    "heads/master/test/pass_test.c",
                    38, (1.0), (1.05), (0.1));
}


x86 assembly (clang, -O0):
<test_dbl_equal_pass>:
push   %rbp
mov    %rsp,%rbp
lea    0xefd(%rip),%rdi
mov    $0x26,%esi
movsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
movsd  0xed8(%rip),%xmm2
call   1030 <assert_dbl_equal_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dbl_equal_pass>:
lea    0xf01(%rip),%rdi
movsd  0xee1(%rip),%xmm0
movsd  0xee1(%rip),%xmm1
movsd  0xee1(%rip),%xmm2
mov    $0x26,%esi
jmp    1030 <assert_dbl_equal_@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/pass_test.c\00"
define void @test_dbl_equal_pass() {
%1 = call i32 @assert_dbl_equal_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 38, double 1.000000e+00, double 1.050000e+00, double 1.000000e-01)
ret void
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/pass_test.c\00"
define void @test_dbl_equal_pass() {
%1 = tail call i32 @assert_dbl_equal_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 38, double 1.000000e+00, double 1.050000e+00, double 1.000000e-01)
ret void
}
/* Variables and functions */
float ldexp(float, int);
float scalbnf(float x, int n) { return ldexp(x, n); }


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

x86 assembly (clang, -O2):
<scalbnf>:
jmp    1030 <ldexp@plt>

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

LLVM IR (-O2):
define float @scalbnf(float %0, i32 %1) {
%3 = tail call float @ldexp(float %0, i32 %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void swaphead(int osvers, int osrel, int ossub) {
  printf("pagescan/s  swapin/s swapout/s oomkill"
         "  commitspc  commitlim   _swap_");
}


x86 assembly (clang, -O0):
<swaphead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [70 x i8] c"pagescan/s swapin/s swapout/s oomkill commitspc commitlim _swap_\00"
define void @swaphead(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"pagescan/s swapin/s swapout/s oomkill commitspc commitlim _swap_\00"
define void @swaphead(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_help(const char *argv0) {
  printf("Usage: %s [-h] [-c /path/to/config.yaml]", argv0);
}


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

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Usage: %s [-h] [-c /path/to/config.yaml]\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Usage: %s [-h] [-c /path/to/config.yaml]\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void ASN1_STRING_set(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_STRING_set() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lua_check_string(int, char *);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(int /*<<< orphan*/);
void str_len(void) { lua_pushnumber(strlen(lua_check_string(1, "strlen"))); }


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xec0(%rip),%rsi
call   1030 <lua_check_string@plt>
mov    %eax,%edi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1050 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1030 <lua_check_string@plt>
mov    %eax,%edi
call   1040 <strlen@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushnumber@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"strlen\00"
define void @str_len() {
%1 = call i32 @lua_check_string(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @strlen(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"strlen\00"
define void @str_len() {
%1 = tail call i32 @lua_check_string(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @strlen(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int *set42(int *);
void nodpd1() {
  int *y = malloc(sizeof(int));
  int *z;
  z = set42(y);
  free(y);
}


x86 assembly (clang, -O0):
<nodpd1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <set42@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nodpd1>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <set42@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @nodpd1() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32* @set42(i32* %4)
store i32* %5, i32** %2
%6 = load i32*, i32** %1
%7 = call i32 @free(i32* %6)
ret void
}

LLVM IR (-O2):
define void @nodpd1() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32* @set42(i32* %1)
%3 = tail call i32 @free(i32* %1)
ret void
}
void txt_arbitrary(leng, mess) char *mess;
{
  prtime();
  printf("Arbitrary bytes, leng=%d\n", leng);
}


x86 assembly (clang, -O0):
<txt_arbitrary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x4(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"Arbitrary bytes, leng=%d\0A\00"
define void @txt_arbitrary(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 (...) @prtime()
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Arbitrary bytes, leng=%d\0A\00"
define void @txt_arbitrary(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @prtime()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sum_n(int n) {
  int i = 0;
  int sum = 0;
  for (i = 0; i < n; i++)
    sum += i;
  printf("%d\n", sum);
}


x86 assembly (clang, -O0):
<sum_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1153 <sum_n+0x43>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <sum_n+0x20>
mov    -0xc(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_n>:
test   %edi,%edi
jle    1133 <sum_n+0x23>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,1),%esi
add    $0xffffffff,%esi
lea    0xed2(%rip),%rdi
jmp    1030 <printf@plt>
xor    %esi,%esi
lea    0xec4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @sum_n(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %10, %0
%12 = add i32 %11, -1
br label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %12, %3 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}
int numDigits(unsigned i) {
  int ndigits = 1;
  while (i /= 10)
    ndigits++;
  return ndigits;
}


x86 assembly (clang, -O0):
<numDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1134 <numDigits+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <numDigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numDigits>:
mov    $0x1,%eax
cmp    $0xa,%edi
jb     1134 <numDigits+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x63,%edi
mov    %edx,%edi
ja     1120 <numDigits+0x20>
ret

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

LLVM IR (-O2):
define i32 @numDigits(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 100
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ DAC_Init();
void Sound_Init(uint32_t period) {
  DAC_Init();
  (*((volatile uint32_t *)0xE000E010)) = 0;
  (*((volatile uint32_t *)0xE000E014)) = 2389;
  (*((volatile uint32_t *)0xE000E018)) = 0;
  (*((volatile uint32_t *)0xE000ED20)) =
      ((*((volatile uint32_t *)0xE000ED20)) & 0x00FFFFFF) | 0x20000000;
  (*((volatile uint32_t *)0xE000E010)) = 0x0007;
}


x86 assembly (clang, -O0):
<Sound_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <DAC_Init@plt>
mov    $0xe000e010,%eax
movl   $0x0,(%rax)
mov    $0xe000e014,%eax
movl   $0x955,(%rax)
mov    $0xe000e018,%eax
movl   $0x0,(%rax)
mov    $0xe000ed20,%eax
mov    (%rax),%ecx
and    $0xffffff,%ecx
or     $0x20000000,%ecx
mov    $0xe000ed20,%eax
mov    %ecx,(%rax)
mov    $0xe000e010,%eax
movl   $0x7,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sound_Init>:
push   %rax
xor    %eax,%eax
call   1030 <DAC_Init@plt>
mov    $0xe000e010,%eax
movl   $0x0,(%rax)
movl   $0x955,0x4(%rax)
movl   $0x0,0x8(%rax)
mov    $0xffffff,%ecx
and    0xd10(%rax),%ecx
or     $0x20000000,%ecx
mov    %ecx,0xd10(%rax)
movl   $0x7,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @Sound_Init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @DAC_Init()
store volatile i32 0, i32* inttoptr (i64 3758153744 to i32*)
store volatile i32 2389, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 0, i32* inttoptr (i64 3758153752 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 3758157088 to i32*)
%5 = and i32 %4, 16777215
%6 = or i32 %5, 536870912
store volatile i32 %6, i32* inttoptr (i64 3758157088 to i32*)
store volatile i32 7, i32* inttoptr (i64 3758153744 to i32*)
ret void
}

LLVM IR (-O2):
define void @Sound_Init(i32 %0) {
%2 = tail call i32 (...) @DAC_Init()
store volatile i32 0, i32* inttoptr (i64 3758153744 to i32*)
store volatile i32 2389, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 0, i32* inttoptr (i64 3758153752 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 3758157088 to i32*)
%4 = and i32 %3, 16777215
%5 = or i32 %4, 536870912
store volatile i32 %5, i32* inttoptr (i64 3758157088 to i32*)
store volatile i32 7, i32* inttoptr (i64 3758153744 to i32*)
ret void
}