#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 */
scalar_t__ is_prime(int);
int /*<<< orphan*/ printf(char *, float);
float timeit();
int main(int argc, char *argv[]) {
  float start = timeit();
  int high = 0;
  signed coefficient = 0;
  for (signed a = -999; a < 1000; a++) {
    for (signed b = -999; b < 1000; b++) {
      int n = 0;
      for (; is_prime(n * n + a * n + b); n++)
        ;
      if (n > high) {
        high = n;
        coefficient = a * b;
      }
    }
  }
  float stop = timeit();
  printf("Answer: %d\n", coefficient);
  printf("Time: %f\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)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0xfffffc19,-0x20(%rbp)
cmpl   $0x3e8,-0x20(%rbp)
jge    1206 <main+0xd6>
movl   $0xfffffc19,-0x24(%rbp)
cmpl   $0x3e8,-0x24(%rbp)
jge    11f3 <main+0xc3>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%edi
imul   -0x28(%rbp),%edi
mov    -0x20(%rbp),%eax
imul   -0x28(%rbp),%eax
add    %eax,%edi
add    -0x24(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     11c4 <main+0x94>
jmp    11b6 <main+0x86>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    118f <main+0x5f>
mov    -0x28(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    11e0 <main+0xb0>
mov    -0x28(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
imul   -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11e5 <main+0xb5>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117b <main+0x4b>
jmp    11f8 <main+0xc8>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1167 <main+0x37>
mov    $0x0,%al
call   1050 <timeit@plt>
movss  %xmm0,-0x2c(%rbp)
cvtsi2ssl -0x1c(%rbp),%xmm0
lea    0xde2(%rip),%rdi
call   1030 <printf@plt>
movss  -0x2c(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <timeit@plt>
movss  %xmm0,0xc(%rsp)
mov    $0xfffffc19,%r12d
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xfffffc19,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r12,%rbx,1),%edi
imul   %ebx,%edi
add    %ebp,%edi
call   1040 <is_prime@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1180 <main+0x50>
add    $0xffffffff,%ebx
mov    %ebp,%eax
imul   %r12d,%eax
cmp    %r15d,%ebx
cmova  %ebx,%r15d
cmova  %eax,%r14d
add    $0x1,%ebp
cmp    $0x3e8,%ebp
jne    1170 <main+0x40>
add    $0x1,%r12d
cmp    $0x3e8,%r12d
jne    1160 <main+0x30>
xor    %eax,%eax
call   1050 <timeit@plt>
movss  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Answer: %d\0A\00"
@.str.1 = [10 x i8] c"Time: %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = call float (...) @timeit()
store float %13, float* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 -999, i32* %9
br label %14
14: ; preds = %52, %2
%15 = load i32, i32* %9
%16 = icmp slt i32 %15, 1000
br i1 %16, label %17, label %55
17: ; preds = %14
store i32 -999, i32* %10
br label %18
18: ; preds = %48, %17
%19 = load i32, i32* %10
%20 = icmp slt i32 %19, 1000
br i1 %20, label %21, label %51
21: ; preds = %18
store i32 0, i32* %11
br label %22
22: ; preds = %35, %21
%23 = load i32, i32* %11
%24 = load i32, i32* %11
%25 = mul nsw i32 %23, %24
%26 = load i32, i32* %9
%27 = load i32, i32* %11
%28 = mul nsw i32 %26, %27
%29 = add nsw i32 %25, %28
%30 = load i32, i32* %10
%31 = add nsw i32 %29, %30
%32 = call i64 @is_prime(i32 %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %22
br label %35
35: ; preds = %34
%36 = load i32, i32* %11
%37 = add nsw i32 %36, 1
store i32 %37, i32* %11
br label %22
38: ; preds = %22
%39 = load i32, i32* %11
%40 = load i32, i32* %7
%41 = icmp sgt i32 %39, %40
br i1 %41, label %42, label %47
42: ; preds = %38
%43 = load i32, i32* %11
store i32 %43, i32* %7
%44 = load i32, i32* %9
%45 = load i32, i32* %10
%46 = mul nsw i32 %44, %45
store i32 %46, i32* %8
br label %47
47: ; preds = %42, %38
br label %48
48: ; preds = %47
%49 = load i32, i32* %10
%50 = add nsw i32 %49, 1
store i32 %50, i32* %10
br label %18
51: ; preds = %18
br label %52
52: ; preds = %51
%53 = load i32, i32* %9
%54 = add nsw i32 %53, 1
store i32 %54, i32* %9
br label %14
55: ; preds = %14
%56 = call float (...) @timeit()
store float %56, float* %12
%57 = load i32, i32* %8
%58 = sitofp i32 %57 to float
%59 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %58)
%60 = load float, float* %12
%61 = load float, float* %6
%62 = fsub float %60, %61
%63 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), float %62)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Answer: %d\0A\00"
@.str.1 = [10 x i8] c"Time: %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float (...) @timeit()
br label %4
4: ; preds = %2, %18
%5 = phi i32 [ -999, %2 ], [ %19, %18 ]
%6 = phi i32 [ 0, %2 ], [ %33, %18 ]
%7 = phi i32 [ 0, %2 ], [ %32, %18 ]
br label %14
8: ; preds = %18
%9 = tail call float (...) @timeit()
%10 = sitofp i32 %33 to float
%11 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %10)
%12 = fsub float %9, %3
%13 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), float %12)
ret i32 0
14: ; preds = %4, %29
%15 = phi i32 [ -999, %4 ], [ %34, %29 ]
%16 = phi i32 [ %6, %4 ], [ %33, %29 ]
%17 = phi i32 [ %7, %4 ], [ %32, %29 ]
br label %21
18: ; preds = %29
%19 = add nsw i32 %5, 1
%20 = icmp eq i32 %19, 1000
br i1 %20, label %8, label %4
21: ; preds = %21, %14
%22 = phi i32 [ %28, %21 ], [ 0, %14 ]
%23 = add i32 %22, %5
%24 = mul i32 %23, %22
%25 = add nsw i32 %24, %15
%26 = tail call i64 @is_prime(i32 %25)
%27 = icmp eq i64 %26, 0
%28 = add nuw nsw i32 %22, 1
br i1 %27, label %29, label %21
29: ; preds = %21
%30 = icmp ugt i32 %22, %17
%31 = mul nsw i32 %15, %5
%32 = select i1 %30, i32 %22, i32 %17
%33 = select i1 %30, i32 %31, i32 %16
%34 = add nsw i32 %15, 1
%35 = icmp eq i32 %34, 1000
br i1 %35, label %18, label %14
}