xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ min_heap_fixup(int *, int, int);
void build_min_heap(int arr[], int len) {
  for (int i = (len - 2) / 2; i >= 0; i--) {
    min_heap_fixup(arr, len, i);
  }
}


x86 assembly (clang, -O0):
<build_min_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <build_min_heap+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <min_heap_fixup@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <build_min_heap+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_min_heap>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1141 <build_min_heap+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x2(%rbx),%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%ebp
add    $0xfffffffe,%ebp
sar    %ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <min_heap_fixup@plt>
add    $0xffffffff,%ebp
jb     1130 <build_min_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_min_heap(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 2
%8 = sdiv i32 %7, 2
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @min_heap_fixup(i32* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @build_min_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = add nsw i32 %1, -2
%6 = sdiv i32 %5, 2
br label %8
7: ; preds = %8, %2
ret void
8: ; preds = %4, %8
%9 = phi i32 [ %11, %8 ], [ %6, %4 ]
%10 = tail call i32 @min_heap_fixup(i32* %0, i32 %1, i32 %9)
%11 = add nsw i32 %9, -1
%12 = icmp eq i32 %9, 0
br i1 %12, label %7, label %8
}
/* Variables and functions */
int foo(int *, int *);
int bar(int *restrict a, int *restrict b) {
  (void)a;
  (void)b;
  return foo(a, b);
}


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @bar(i32* noalias %0, i32* noalias %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 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = call i32 @foo(i32* %7, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @bar(i32* noalias %0, i32* noalias %1) {
%3 = tail call i32 @foo(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char const *, int /*<<< orphan*/);
int is_param(const char *text, const char *param) {
  return !strncmp(param, text, strlen(text));
}


x86 assembly (clang, -O0):
<is_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_param>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @is_param(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_param(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strncmp(i8* %1, i8* %0, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
const char *pte_update_should_not_run(const char *virtdir,
                                      struct benchmark *b) {
  return "glibc version is too old";
}


x86 assembly (clang, -O0):
<pte_update_should_not_run>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeed(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.benchmark = type opaque
@.str = [25 x i8] c"glibc version is too old\00"
define i8* @pte_update_should_not_run(i8* %0, %struct.benchmark* %1) {
%3 = alloca i8*
%4 = alloca %struct.benchmark*
store i8* %0, i8** %3
store %struct.benchmark* %1, %struct.benchmark** %4
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.benchmark = type opaque
@.str = [25 x i8] c"glibc version is too old\00"
define i8* @pte_update_should_not_run(i8* nocapture readnone %0, %struct.benchmark* nocapture readnone %1) {
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int RSA_FLAG_EXT_PKEY;
int RSA_METHOD_FLAG_NO_CHECK;
int RSA_flags(int /*<<< orphan*/ *);
int /*<<< orphan*/ RSA_set_flags(int /*<<< orphan*/ *, int);
int keymgr_rsa_init(RSA *rsa) {
  if (rsa != NULL) {
    RSA_set_flags(rsa, RSA_flags(rsa) | RSA_FLAG_EXT_PKEY |
                           RSA_METHOD_FLAG_NO_CHECK);
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<keymgr_rsa_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1171 <keymgr_rsa_init+0x51>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <RSA_flags@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    0x2e8b(%rip),%rax
or     (%rax),%esi
mov    0x2e72(%rip),%rax
or     (%rax),%esi
call   1030 <RSA_set_flags@plt>
movl   $0x1,-0x4(%rbp)
jmp    1178 <keymgr_rsa_init+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keymgr_rsa_init>:
test   %rdi,%rdi
je     1151 <keymgr_rsa_init+0x31>
push   %rbx
mov    %rdi,%rbx
call   1040 <RSA_flags@plt>
mov    0x2eab(%rip),%rcx
or     (%rcx),%eax
mov    0x2e92(%rip),%rcx
or     (%rcx),%eax
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <RSA_set_flags@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@RSA_FLAG_EXT_PKEY = global i32 0
@RSA_METHOD_FLAG_NO_CHECK = global i32 0
define i32 @keymgr_rsa_init(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32*, i32** %3
%8 = load i32*, i32** %3
%9 = call i32 @RSA_flags(i32* %8)
%10 = load i32, i32* @RSA_FLAG_EXT_PKEY
%11 = or i32 %9, %10
%12 = load i32, i32* @RSA_METHOD_FLAG_NO_CHECK
%13 = or i32 %11, %12
%14 = call i32 @RSA_set_flags(i32* %7, i32 %13)
store i32 1, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@RSA_FLAG_EXT_PKEY = global i32 0
@RSA_METHOD_FLAG_NO_CHECK = global i32 0
define i32 @keymgr_rsa_init(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @RSA_flags(i32* %0)
%5 = load i32, i32* @RSA_FLAG_EXT_PKEY
%6 = or i32 %5, %4
%7 = load i32, i32* @RSA_METHOD_FLAG_NO_CHECK
%8 = or i32 %6, %7
%9 = tail call i32 @RSA_set_flags(i32* %0, i32 %8)
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ 1, %3 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ LoggingStatsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void LoggingStatsRequestUpdate() { UAVObjRequestUpdate(LoggingStatsHandle()); }


x86 assembly (clang, -O0):
<LoggingStatsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LoggingStatsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoggingStatsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <LoggingStatsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @LoggingStatsRequestUpdate() {
%1 = call i32 (...) @LoggingStatsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @LoggingStatsRequestUpdate() {
%1 = tail call i32 (...) @LoggingStatsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ disable_irq_nosync(unsigned int);
__attribute__((always_)) void
disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags) {
  disable_irq_nosync(irq);
}


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

x86 assembly (clang, -O2):
<disable_irq_nosync_lockdep_irqsave>:
jmp    1030 <disable_irq_nosync@plt>

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

LLVM IR (-O2):
define void @disable_irq_nosync_lockdep_irqsave(i32 %0, i64* nocapture readnone %1) {
%3 = tail call i32 @disable_irq_nosync(i32 %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct xp_ops {
  int dummy;
};
struct TYPE_3__ {
  scalar_t__ xp_ops;
  struct xp_ops *xp_p2;
  struct xp_ops *xp_p1;
};
typedef TYPE_1__ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ free(struct xp_ops *);
void byz_destroy(SVCXPRT *xpt) {
  free(xpt->xp_p1);
  free(xpt->xp_p2);
  free((struct xp_ops *)(xpt->xp_ops));
}


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

x86 assembly (clang, -O2):
<byz_destroy>:
push   %rbx
mov    %rdi,%rbx
mov    0x10(%rdi),%rdi
call   1030 <free@plt>
mov    0x8(%rbx),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, %struct.xp_ops*, %struct.xp_ops* }
%struct.xp_ops = type { i32 }
define void @byz_destroy(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 2
%5 = load %struct.xp_ops*, %struct.xp_ops** %4
%6 = call i32 @free(%struct.xp_ops* %5)
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
%9 = load %struct.xp_ops*, %struct.xp_ops** %8
%10 = call i32 @free(%struct.xp_ops* %9)
%11 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = inttoptr i64 %13 to %struct.xp_ops*
%15 = call i32 @free(%struct.xp_ops* %14)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, %struct.xp_ops*, %struct.xp_ops* }
%struct.xp_ops = type { i32 }
define void @byz_destroy(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 2
%3 = load %struct.xp_ops*, %struct.xp_ops** %2
%4 = tail call i32 @free(%struct.xp_ops* %3)
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%6 = load %struct.xp_ops*, %struct.xp_ops** %5
%7 = tail call i32 @free(%struct.xp_ops* %6)
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to %struct.xp_ops*
%11 = tail call i32 @free(%struct.xp_ops* %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main(void) {
  test(0);
  test(1);
  test(10);
  test(25);
  test(1808548329);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <test@plt>
mov    $0x1,%edi
call   1030 <test@plt>
mov    $0xa,%edi
call   1030 <test@plt>
mov    $0x19,%edi
call   1030 <test@plt>
mov    $0x6bcc41e9,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <test@plt>
mov    $0x1,%edi
call   1030 <test@plt>
mov    $0xa,%edi
call   1030 <test@plt>
mov    $0x19,%edi
call   1030 <test@plt>
mov    $0x6bcc41e9,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @test(i32 0)
%2 = call i32 @test(i32 1)
%3 = call i32 @test(i32 10)
%4 = call i32 @test(i32 25)
%5 = call i32 @test(i32 1808548329)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 0)
%2 = tail call i32 @test(i32 1)
%3 = tail call i32 @test(i32 10)
%4 = tail call i32 @test(i32 25)
%5 = tail call i32 @test(i32 1808548329)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void info() {
  puts("Maximum fill size is (size - 1) elements in this implementation.");
  puts("Hence, minimum usable table size is 2.");
}


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

x86 assembly (clang, -O2):
<info>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"Maximum fill size is (size - 1) elements in this implementation.\00"
@.str.1 = [39 x i8] c"Hence, minimum usable table size is 2.\00"
define void @info() {
%1 = call i32 @puts(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [65 x i8] c"Maximum fill size is (size - 1) elements in this implementation.\00"
@.str.1 = [39 x i8] c"Hence, minimum usable table size is 2.\00"
define void @info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ close(int /*<<< orphan*/);
int /*<<< orphan*/ execvp(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
void detach(char *path) {
  int pid = fork();
  if (pid != 0)
    return;
  close(STDIN_FILENO);
  close(STDOUT_FILENO);
  close(STDERR_FILENO);
  execvp(path, NULL);
  exit(0);
}


x86 assembly (clang, -O0):
<detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1166 <detach+0x26>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <execvp@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<detach>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <fork@plt>
test   %eax,%eax
je     1151 <detach+0x11>
pop    %rbx
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <execvp@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
define void @detach(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @fork()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
ret void
8: ; preds = %1
%9 = load i32, i32* @STDIN_FILENO
%10 = call i32 @close(i32 %9)
%11 = load i32, i32* @STDOUT_FILENO
%12 = call i32 @close(i32 %11)
%13 = load i32, i32* @STDERR_FILENO
%14 = call i32 @close(i32 %13)
%15 = load i8*, i8** %2
%16 = call i32 @execvp(i8* %15, i32* null)
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
define void @detach(i8* %0) {
%2 = tail call i32 (...) @fork()
%3 = icmp eq i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
ret void
5: ; preds = %1
%6 = load i32, i32* @STDIN_FILENO
%7 = tail call i32 @close(i32 %6)
%8 = load i32, i32* @STDOUT_FILENO
%9 = tail call i32 @close(i32 %8)
%10 = load i32, i32* @STDERR_FILENO
%11 = tail call i32 @close(i32 %10)
%12 = tail call i32 @execvp(i8* %0, i32* null)
%13 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct rlimit {
  scalar_t__ rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_NOFILE;
scalar_t__ getrlimit(int /*<<< orphan*/, struct rlimit *);
int getmaxfds(void) {
  struct rlimit rlp;
  if (getrlimit(RLIMIT_NOFILE, &rlp) < 0)
    return -1;
  return (int)rlp.rlim_cur;
}


x86 assembly (clang, -O0):
<getmaxfds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <getrlimit@plt>
cmp    $0x0,%rax
jge    1140 <getmaxfds+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <getmaxfds+0x37>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmaxfds>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrlimit@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1132 <getmaxfds+0x22>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i64 }
@RLIMIT_NOFILE = global i32 0
define i32 @getmaxfds() {
%1 = alloca i32
%2 = alloca %struct.rlimit
%3 = load i32, i32* @RLIMIT_NOFILE
%4 = call i64 @getrlimit(i32 %3, %struct.rlimit* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %11
7: ; preds = %0
%8 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %1
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%struct.rlimit = type { i64 }
@RLIMIT_NOFILE = global i32 0
define i32 @getmaxfds() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_NOFILE
%4 = call i64 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = select i1 %5, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, float, float, float, double, double,
                          double, float);
void testParseConsts() {
  printf("Constants: %g %g %g %g %g %g %g %g %g\n", 0e1, 0E1, 0.f, .01f, .01e0f,
         1.0e-1, 1.0e1, 1.0e+1, .1f);
}


x86 assembly (clang, -O0):
<testParseConsts>:
push   %rbp
mov    %rsp,%rbp
lea    0xefd(%rip),%rdi
xor    %edx,%edx
xorps  %xmm0,%xmm0
movss  0xed8(%rip),%xmm2
movsd  0xed8(%rip),%xmm3
movsd  0xed8(%rip),%xmm5
movss  0xec4(%rip),%xmm6
mov    %edx,%esi
movaps %xmm2,%xmm1
movaps %xmm5,%xmm4
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testParseConsts>:
lea    0xf01(%rip),%rdi
movss  0xee1(%rip),%xmm1
movsd  0xee1(%rip),%xmm3
movsd  0xee1(%rip),%xmm4
movss  0xecd(%rip),%xmm6
xorps  %xmm0,%xmm0
xor    %esi,%esi
xor    %edx,%edx
movaps %xmm1,%xmm2
movaps %xmm4,%xmm5
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Constants: %g %g %g %g %g %g %g %g %g\0A\00"
define void @testParseConsts() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, float 0.000000e+00, float 0x3F847AE140000000, float 0x3F847AE140000000, double 1.000000e-01, double 1.000000e+01, double 1.000000e+01, float 0x3FB99999A0000000)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Constants: %g %g %g %g %g %g %g %g %g\0A\00"
define void @testParseConsts() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, float 0.000000e+00, float 0x3F847AE140000000, float 0x3F847AE140000000, double 1.000000e-01, double 1.000000e+01, double 1.000000e+01, float 0x3FB99999A0000000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
testAssignment() {
  int a, b;
  a = 3;
  b = a;
  printf("b == %d\n", b);
}


x86 assembly (clang, -O0):
<testAssignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAssignment>:
lea    0xee9(%rip),%rdi
mov    $0x3,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"b == %d\0A\00"
define i32 @testAssignment() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *numa_bitmask_free;
int main(int argc, char *argv[]) {
  void *p;
  (void)argc;
  (void)argv;
  p = numa_bitmask_free;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@numa_bitmask_free = global i8* null
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** @numa_bitmask_free
store i8* %9, i8** %6
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@numa_bitmask_free = global i8* null
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int log10(int);
double calc_dBm(double power) { return 10 * log10(2 * power * 1000 / 600.0); }


x86 assembly (clang, -O0):
<calc_dBm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log10@plt>
imul   $0xa,%eax,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_dBm>:
push   %rax
addsd  %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
divsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log10@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @calc_dBm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 2.000000e+00, %3
%5 = fmul double %4, 1.000000e+03
%6 = fdiv double %5, 6.000000e+02
%7 = fptosi double %6 to i32
%8 = call i32 @log10(i32 %7)
%9 = mul nsw i32 10, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @calc_dBm(double %0) {
%2 = fmul double %0, 2.000000e+00
%3 = fmul double %2, 1.000000e+03
%4 = fdiv double %3, 6.000000e+02
%5 = fptosi double %4 to i32
%6 = tail call i32 @log10(i32 %5)
%7 = mul nsw i32 %6, 10
%8 = sitofp i32 %7 to double
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int /*<<< orphan*/ name_to_dev_t_real(char const *);
dev_t name_to_dev_t(const char *name) {
  dev_t dev = name_to_dev_t_real(name);
  ((void)0);
  return dev;
}


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

x86 assembly (clang, -O2):
<name_to_dev_t>:
jmp    1030 <name_to_dev_t_real@plt>

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

LLVM IR (-O2):
define i32 @name_to_dev_t(i8* %0) {
%2 = tail call i32 @name_to_dev_t_real(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *s) {
  fprintf(stderr, "FAILED due to %s!\n", s);
  fflush(stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"FAILED due to %s!\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"FAILED due to %s!\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SSYNC();
void flush_icache_range(unsigned start, unsigned end) { SSYNC(); }


x86 assembly (clang, -O0):
<flush_icache_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <SSYNC@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @flush_icache_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @SSYNC()
ret void
}

LLVM IR (-O2):
define void @flush_icache_range(i32 %0, i32 %1) {
%3 = tail call i32 (...) @SSYNC()
ret void
}
int PyDTrace_INSTANCE_DELETE_START_ENABLED(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PyDTrace_INSTANCE_DELETE_START_ENABLED() {
ret i32 0
}
/* Variables and functions */
char *trim_left(char *);
char *trim_right(char *);
char *trim(char *str) {
  char *s1 = trim_left(str);
  return trim_right(s1);
}


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

x86 assembly (clang, -O2):
<trim>:
push   %rax
call   1040 <trim_left@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <trim_right@plt>

LLVM IR (-O0):
define i8* @trim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @trim_left(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @trim_right(i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @trim(i8* %0) {
%2 = tail call i8* @trim_left(i8* %0)
%3 = tail call i8* @trim_right(i8* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ mu_init(char *);
int /*<<< orphan*/ sp_alloc_summary();
int /*<<< orphan*/ test_parse(int);
int main(void) {
  mu_init("line");
  test_parse(-1);
  test_parse(1);
  test_parse(2);
  test_parse(11);
  sp_alloc_summary();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <mu_init@plt>
mov    $0xffffffff,%edi
call   1040 <test_parse@plt>
mov    $0x1,%edi
call   1040 <test_parse@plt>
mov    $0x2,%edi
call   1040 <test_parse@plt>
mov    $0xb,%edi
call   1040 <test_parse@plt>
mov    $0x0,%al
call   1050 <sp_alloc_summary@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <mu_init@plt>
mov    $0xffffffff,%edi
call   1040 <test_parse@plt>
mov    $0x1,%edi
call   1040 <test_parse@plt>
mov    $0x2,%edi
call   1040 <test_parse@plt>
mov    $0xb,%edi
call   1040 <test_parse@plt>
xor    %eax,%eax
call   1050 <sp_alloc_summary@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"line\00"
define i32 @main() {
%1 = call i32 @mu_init(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test_parse(i32 -1)
%3 = call i32 @test_parse(i32 1)
%4 = call i32 @test_parse(i32 2)
%5 = call i32 @test_parse(i32 11)
%6 = call i32 (...) @sp_alloc_summary()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"line\00"
define i32 @main() {
%1 = tail call i32 @mu_init(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test_parse(i32 -1)
%3 = tail call i32 @test_parse(i32 1)
%4 = tail call i32 @test_parse(i32 2)
%5 = tail call i32 @test_parse(i32 11)
%6 = tail call i32 (...) @sp_alloc_summary()
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int dev_redir_string_ends_with(char *string, char c) {
  int len;
  len = strlen(string);
  return (string[len - 1] == c) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dev_redir_string_ends_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
movsbl -0x9(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_redir_string_ends_with>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmp    %bpl,-0x1(%rcx,%rbx,1)
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dev_redir_string_ends_with(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %14, %16
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
ret i32 %19
}

LLVM IR (-O2):
define i32 @dev_redir_string_ends_with(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, %1
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
float brrand();
float triangle() {
  float randnum, randnum2, output;
  randnum = brrand();
  randnum2 = brrand();
  output = 0.5 * (randnum + randnum2);
  return (output);
}


x86 assembly (clang, -O0):
<triangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <brrand@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <brrand@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangle>:
push   %rax
xor    %eax,%eax
call   1030 <brrand@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <brrand@plt>
addss  0x4(%rsp),%xmm0
mulss  0xecd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @triangle() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = call float (...) @brrand()
store float %4, float* %1
%5 = call float (...) @brrand()
store float %5, float* %2
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fadd float %6, %7
%9 = fpext float %8 to double
%10 = fmul double 5.000000e-01, %9
%11 = fptrunc double %10 to float
store float %11, float* %3
%12 = load float, float* %3
ret float %12
}

LLVM IR (-O2):
define float @triangle() {
%1 = tail call float (...) @brrand()
%2 = tail call float (...) @brrand()
%3 = fadd float %1, %2
%4 = fmul float %3, 5.000000e-01
ret float %4
}
int subber(int x, int y) { return x - y; }


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

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

LLVM IR (-O0):
define i32 @subber(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @subber(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void FPUNaNModeSet(uint32_t ui32Mode) {
  (*((volatile uint32_t *)(0xE000EF3C))) =
      ((*((volatile uint32_t *)(0xE000EF3C))) & ~(0x02000000)) | ui32Mode;
}


x86 assembly (clang, -O0):
<FPUNaNModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xe000ef3c,%eax
mov    (%rax),%ecx
and    $0xfdffffff,%ecx
or     -0x4(%rbp),%ecx
mov    $0xe000ef3c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPUNaNModeSet>:
mov    $0xe000ef3c,%eax
mov    $0xfdffffff,%ecx
and    (%rax),%ecx
or     %edi,%ecx
mov    %ecx,(%rax)
ret

LLVM IR (-O0):
define void @FPUNaNModeSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load volatile i32, i32* inttoptr (i64 3758157628 to i32*)
%4 = and i32 %3, -33554433
%5 = load i32, i32* %2
%6 = or i32 %4, %5
store volatile i32 %6, i32* inttoptr (i64 3758157628 to i32*)
ret void
}

LLVM IR (-O2):
define void @FPUNaNModeSet(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 3758157628 to i32*)
%3 = and i32 %2, -33554433
%4 = or i32 %3, %0
store volatile i32 %4, i32* inttoptr (i64 3758157628 to i32*)
ret void
}
int board_flash_get_datafs_size() { return (1024 * 16); }


x86 assembly (clang, -O0):
<board_flash_get_datafs_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @board_flash_get_datafs_size() {
ret i32 16384
}

LLVM IR (-O2):
define i32 @board_flash_get_datafs_size() {
ret i32 16384
}
int muspcm_waitend(int slot) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @muspcm_waitend(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
main() {
  int *ia, *ib;
  char *ca, *cb;
  int i;
  char c;
  ia = &i;
  ib = &i + 5;
  assert(ib - ia == 5);
  assert((void *)ib - (void *)ia == 5 * sizeof(int));
  ca = &c;
  cb = &c + 3;
  assert(cb - ca == 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x24(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    -0x24(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x5,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x14,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x25(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x25(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x3,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i32* %5, i32** %1
%7 = getelementptr inbounds i32, i32* %5, i64 5
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = load i32*, i32** %1
%10 = ptrtoint i32* %8 to i64
%11 = ptrtoint i32* %9 to i64
%12 = sub i64 %10, %11
%13 = sdiv exact i64 %12, 4
%14 = icmp eq i64 %13, 5
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32*, i32** %2
%18 = bitcast i32* %17 to i8*
%19 = load i32*, i32** %1
%20 = bitcast i32* %19 to i8*
%21 = ptrtoint i8* %18 to i64
%22 = ptrtoint i8* %20 to i64
%23 = sub i64 %21, %22
%24 = icmp eq i64 %23, 20
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
store i8* %6, i8** %3
%27 = getelementptr inbounds i8, i8* %6, i64 3
store i8* %27, i8** %4
%28 = load i8*, i8** %4
%29 = load i8*, i8** %3
%30 = ptrtoint i8* %28 to i64
%31 = ptrtoint i8* %29 to i64
%32 = sub i64 %30, %31
%33 = icmp eq i64 %32, 3
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ buffio_reset();
void buffio_init(void) { buffio_reset(); }


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

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

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

LLVM IR (-O2):
define void @buffio_init() {
%1 = tail call i32 (...) @buffio_reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int func_two() {
  printf("This is function two\n");
  return 2;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"This is function two\0A\00"
define i32 @func_two() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@str = [21 x i8] c"This is function two\00"
define i32 @func_two() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 2
}
unsigned int _hash(char *input) {
  unsigned int hashVal = 0;
  int i = 0;
  while (input[i++])
    hashVal += (input[i - 1] * i);
  return hashVal;
}


x86 assembly (clang, -O0):
<_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1152 <_hash+0x52>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <_hash+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash>:
mov    (%rdi),%dl
xor    %eax,%eax
test   %dl,%dl
je     1124 <_hash+0x24>
mov    $0x1,%ecx
nopl   (%rax)
movsbl %dl,%edx
imul   %ecx,%edx
add    %edx,%eax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <_hash+0x10>
ret

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

LLVM IR (-O2):
define i32 @_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 1, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = trunc i64 %5 to i32
%10 = mul nsw i32 %9, %8
%11 = add i32 %10, %7
%12 = add nuw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %5
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
void *__my_memrchr(const void *m, int c, size_t n) {
  const unsigned char *s = m;
  c = (unsigned char)c;
  while (n--)
    if (s[n] == c)
      return (void *)(s + n);
  return 0;
}


x86 assembly (clang, -O0):
<__my_memrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1164 <__my_memrchr+0x64>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    -0x14(%rbp),%eax
jne    115f <__my_memrchr+0x5f>
mov    -0x28(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <__my_memrchr+0x6c>
jmp    1120 <__my_memrchr+0x20>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__my_memrchr>:
xor    %eax,%eax
mov    %rdx,%rcx
cs nopw 0x0(%rax,%rax,1)
nop
sub    $0x1,%rcx
jb     1126 <__my_memrchr+0x26>
cmp    %sil,-0x1(%rdi,%rdx,1)
mov    %rcx,%rdx
jne    1110 <__my_memrchr+0x10>
add    %rcx,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @__my_memrchr(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
%9 = load i8*, i8** %5
store i8* %9, i8** %8
%10 = load i32, i32* %6
%11 = trunc i32 %10 to i8
%12 = zext i8 %11 to i32
store i32 %12, i32* %6
br label %13
13: ; preds = %29, %3
%14 = load i64, i64* %7
%15 = add i64 %14, -1
store i64 %15, i64* %7
%16 = icmp ne i64 %14, 0
br i1 %16, label %17, label %30
17: ; preds = %13
%18 = load i8*, i8** %8
%19 = load i64, i64* %7
%20 = getelementptr inbounds i8, i8* %18, i64 %19
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i32, i32* %6
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %29
25: ; preds = %17
%26 = load i8*, i8** %8
%27 = load i64, i64* %7
%28 = getelementptr inbounds i8, i8* %26, i64 %27
store i8* %28, i8** %4
br label %31
29: ; preds = %17
br label %13
30: ; preds = %13
store i8* null, i8** %4
br label %31
31: ; preds = %30, %25
%32 = load i8*, i8** %4
ret i8* %32
}

LLVM IR (-O2):
define i8* @__my_memrchr(i8* %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
br label %5
5: ; preds = %9, %3
%6 = phi i64 [ %2, %3 ], [ %7, %9 ]
%7 = add i64 %6, -1
%8 = icmp eq i64 %6, 0
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 %7
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %4
br i1 %12, label %13, label %5
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %0, i64 %7
br label %15
15: ; preds = %5, %13
%16 = phi i8* [ %14, %13 ], [ null, %5 ]
ret i8* %16
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ readUInt8(int /*<<< orphan*/ *);
void silentSkipBytes(FILE *f, int length) {
  for (; length > 0; --length)
    readUInt8(f);
}


x86 assembly (clang, -O0):
<silentSkipBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1140 <silentSkipBytes+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <readUInt8@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <silentSkipBytes+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<silentSkipBytes>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1130 <silentSkipBytes+0x20>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
mov    %r14,%rdi
call   1030 <readUInt8@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <silentSkipBytes+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @silentSkipBytes(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 @readUInt8(i32* %0)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}