#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 /*<<< orphan*/ divide_evenly(long);
int /*<<< orphan*/ printf(char *, float);
float timeit();
int main(int argc, char *argv[]) {
  float start = timeit();
  long count;
  for (count = 20; !(divide_evenly(count)); count += 20)
    ;
  float stop = timeit();
  printf("Answer: %ld\n", count);
  printf("Time: %.8f\n", stop - start);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <timeit@plt>
movss  %xmm0,-0x14(%rbp)
movq   $0x14,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <divide_evenly@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1178 <main+0x48>
jmp    118e <main+0x5e>
jmp    117d <main+0x4d>
mov    -0x20(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x20(%rbp)
jmp    115a <main+0x2a>
mov    $0x0,%al
call   1050 <timeit@plt>
movss  %xmm0,-0x24(%rbp)
cvtsi2ssq -0x20(%rbp),%xmm0
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <timeit@plt>
movss  %xmm0,0xc(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x14,%rbx
mov    %rbx,%rdi
call   1040 <divide_evenly@plt>
test   %eax,%eax
je     1150 <main+0x20>
xor    %eax,%eax
call   1050 <timeit@plt>
movss  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Answer: %ld\0A\00"
@.str.1 = [12 x i8] c"Time: %.8f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca i64
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call float (...) @timeit()
store float %9, float* %6
store i64 20, i64* %7
br label %10
10: ; preds = %16, %2
%11 = load i64, i64* %7
%12 = call i32 @divide_evenly(i64 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br i1 %14, label %15, label %19
15: ; preds = %10
br label %16
16: ; preds = %15
%17 = load i64, i64* %7
%18 = add nsw i64 %17, 20
store i64 %18, i64* %7
br label %10
19: ; preds = %10
%20 = call float (...) @timeit()
store float %20, float* %8
%21 = load i64, i64* %7
%22 = sitofp i64 %21 to float
%23 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float %22)
%24 = load float, float* %8
%25 = load float, float* %6
%26 = fsub float %24, %25
%27 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), float %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Answer: %ld\0A\00"
@.str.1 = [12 x i8] c"Time: %.8f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float (...) @timeit()
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ 20, %2 ], [ %8, %4 ]
%6 = tail call i32 @divide_evenly(i64 %5)
%7 = icmp eq i32 %6, 0
%8 = add nuw nsw i64 %5, 20
br i1 %7, label %4, label %9
9: ; preds = %4
%10 = tail call float (...) @timeit()
%11 = sitofp i64 %5 to float
%12 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float %11)
%13 = fsub float %10, %3
%14 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), float %13)
ret i32 0
}