#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int compare(int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ report(int, double);
void printResults(double cycleNS, int count, int *actual, int *expected) {
  report(((2000 * 2000) * count), cycleNS);
  printf("Count: %d\n", count);
  int equal = compare(actual, expected);
  if (equal)
    printf("Success!\n");
  else
    printf("Try again :)\n");
}


x86 assembly (clang, -O0):
<printResults>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
imul   $0x3d0900,-0xc(%rbp),%edi
movsd  -0x8(%rbp),%xmm0
call   1050 <report@plt>
mov    -0xc(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <compare@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1197 <printResults+0x67>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a5 <printResults+0x75>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResults>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
imul   $0x3d0900,%edi,%edi
call   1060 <report@plt>
lea    0xea2(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <compare@plt>
test   %eax,%eax
lea    0xe90(%rip),%rax
lea    0xe96(%rip),%rdi
cmove  %rax,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Count: %d\0A\00"
@.str.1 = [10 x i8] c"Success!\0A\00"
@.str.2 = [14 x i8] c"Try again :)\0A\00"
define void @printResults(double %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store double %0, double* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32, i32* %6
%11 = mul nsw i32 4000000, %10
%12 = load double, double* %5
%13 = call i32 @report(i32 %11, double %12)
%14 = load i32, i32* %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32*, i32** %7
%17 = load i32*, i32** %8
%18 = call i32 @compare(i32* %16, i32* %17)
store i32 %18, i32* %9
%19 = load i32, i32* %9
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %25
23: ; preds = %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Count: %d\0A\00"
@str = [13 x i8] c"Try again :)\00"
@str.3 = [9 x i8] c"Success!\00"
define void @printResults(double %0, i32 %1, i32* %2, i32* %3) {
%5 = mul nsw i32 %1, 4000000
%6 = tail call i32 @report(i32 %5, double %0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%8 = tail call i32 @compare(i32* %2, i32* %3)
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0)
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
ret void
}