#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ run(int, int, int, int);
int /*<<< orphan*/ stdout;
int main(void) {
  int i, n;
  run(256, 1000000, 103, 1);
  printf("\n\n");
  run(1000, 1000000, 451, 1);
  printf("\n\n");
  run(10000, 1000000, 4845, 1);
  printf("\n\n");
  n = 20;
  printf("Running %d tests for 256 bits... ", n);
  for (i = 0; i < n; i++) {
    run(256, 1000000, 103, 0);
    printf("!");
    fflush(stdout);
  }
  printf("\n");
  n = 20;
  printf("Running %d tests for 1,000 bits... ", n);
  for (i = 0; i < n; i++) {
    run(1000, 1000000, 451, 0);
    printf("!");
    fflush(stdout);
  }
  printf("\n");
  n = 3;
  printf("Running %d tests for 10,000 bits... ", n);
  for (i = 0; i < n; i++) {
    run(10000, 1000000, 4845, 0);
    printf("!");
    fflush(stdout);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x100,%edi
mov    $0xf4240,%esi
mov    $0x67,%edx
mov    $0x1,%ecx
call   1030 <run@plt>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x3e8,%edi
mov    $0xf4240,%esi
mov    $0x1c3,%edx
mov    $0x1,%ecx
call   1030 <run@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2710,%edi
mov    $0xf4240,%esi
mov    $0x12ed,%edx
mov    $0x1,%ecx
call   1030 <run@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x14,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    121f <main+0xef>
mov    $0x100,%edi
mov    $0xf4240,%esi
mov    $0x67,%edx
xor    %ecx,%ecx
call   1030 <run@plt>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d3 <main+0xa3>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x14,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1298 <main+0x168>
mov    $0x3e8,%edi
mov    $0xf4240,%esi
mov    $0x1c3,%edx
xor    %ecx,%ecx
call   1030 <run@plt>
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    124c <main+0x11c>
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1311 <main+0x1e1>
mov    $0x2710,%edi
mov    $0xf4240,%esi
mov    $0x12ed,%edx
xor    %ecx,%ecx
call   1030 <run@plt>
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2ce4(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12c5 <main+0x195>
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x100,%edi
mov    $0xf4240,%esi
mov    $0x67,%edx
mov    $0x1,%ecx
call   1050 <run@plt>
lea    0xef8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x3e8,%edi
mov    $0xf4240,%esi
mov    $0x1c3,%edx
mov    $0x1,%ecx
call   1050 <run@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x2710,%edi
mov    $0xf4240,%esi
mov    $0x12ed,%edx
mov    $0x1,%ecx
call   1050 <run@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xe3c(%rip),%rdi
mov    $0x14,%ebp
mov    $0x14,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e04(%rip),%rbx
nopl   0x0(%rax)
mov    $0x100,%edi
mov    $0xf4240,%esi
mov    $0x67,%edx
xor    %ecx,%ecx
call   1050 <run@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1070 <fflush@plt>
add    $0xffffffff,%ebp
jne    11e0 <main+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe05(%rip),%rdi
mov    $0x14,%ebp
mov    $0x14,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xchg   %ax,%ax
mov    $0x3e8,%edi
mov    $0xf4240,%esi
mov    $0x1c3,%edx
xor    %ecx,%ecx
call   1050 <run@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1070 <fflush@plt>
add    $0xffffffff,%ebp
jne    1230 <main+0xe0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdd9(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2710,%edi
mov    $0xf4240,%esi
mov    $0x12ed,%edx
xor    %ecx,%ecx
call   1050 <run@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1070 <fflush@plt>
mov    $0x2710,%edi
mov    $0xf4240,%esi
mov    $0x12ed,%edx
xor    %ecx,%ecx
call   1050 <run@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1070 <fflush@plt>
mov    $0x2710,%edi
mov    $0xf4240,%esi
mov    $0x12ed,%edx
xor    %ecx,%ecx
call   1050 <run@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1070 <fflush@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [34 x i8] c"Running %d tests for 256 bits... \00"
@.str.2 = [2 x i8] c"!\00"
@stdout = global i32 0
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [36 x i8] c"Running %d tests for 1,000 bits... \00"
@.str.5 = [37 x i8] c"Running %d tests for 10,000 bits... \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @run(i32 256, i32 1000000, i32 103, i32 1)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @run(i32 1000, i32 1000000, i32 451, i32 1)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @run(i32 10000, i32 1000000, i32 4845, i32 1)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 20, i32* %3
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %10)
store i32 0, i32* %2
br label %12
12: ; preds = %21, %0
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = call i32 @run(i32 256, i32 1000000, i32 103, i32 0)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = load i32, i32* @stdout
%20 = call i32 @fflush(i32 %19)
br label %21
21: ; preds = %16
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %12
24: ; preds = %12
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 20, i32* %3
%26 = load i32, i32* %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %26)
store i32 0, i32* %2
br label %28
28: ; preds = %37, %24
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %40
32: ; preds = %28
%33 = call i32 @run(i32 1000, i32 1000000, i32 451, i32 0)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%35 = load i32, i32* @stdout
%36 = call i32 @fflush(i32 %35)
br label %37
37: ; preds = %32
%38 = load i32, i32* %2
%39 = add nsw i32 %38, 1
store i32 %39, i32* %2
br label %28
40: ; preds = %28
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 3, i32* %3
%42 = load i32, i32* %3
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %42)
store i32 0, i32* %2
br label %44
44: ; preds = %53, %40
%45 = load i32, i32* %2
%46 = load i32, i32* %3
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %56
48: ; preds = %44
%49 = call i32 @run(i32 10000, i32 1000000, i32 4845, i32 0)
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%51 = load i32, i32* @stdout
%52 = call i32 @fflush(i32 %51)
br label %53
53: ; preds = %48
%54 = load i32, i32* %2
%55 = add nsw i32 %54, 1
store i32 %55, i32* %2
br label %44
56: ; preds = %44
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%58 = load i32, i32* %1
ret i32 %58
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"Running %d tests for 256 bits... \00"
@stdout = global i32 0
@.str.4 = [36 x i8] c"Running %d tests for 1,000 bits... \00"
@.str.5 = [37 x i8] c"Running %d tests for 10,000 bits... \00"
@str.7 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @run(i32 256, i32 1000000, i32 103, i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
%3 = tail call i32 @run(i32 1000, i32 1000000, i32 451, i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @run(i32 10000, i32 1000000, i32 4845, i32 1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 20)
br label %8
8: ; preds = %0, %8
%9 = phi i32 [ 0, %0 ], [ %14, %8 ]
%10 = tail call i32 @run(i32 256, i32 1000000, i32 103, i32 0)
%11 = tail call i32 @putchar(i32 33)
%12 = load i32, i32* @stdout
%13 = tail call i32 @fflush(i32 %12)
%14 = add nuw nsw i32 %9, 1
%15 = icmp eq i32 %14, 20
br i1 %15, label %16, label %8
16: ; preds = %8
%17 = tail call i32 @putchar(i32 10)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 20)
br label %19
19: ; preds = %16, %19
%20 = phi i32 [ 0, %16 ], [ %25, %19 ]
%21 = tail call i32 @run(i32 1000, i32 1000000, i32 451, i32 0)
%22 = tail call i32 @putchar(i32 33)
%23 = load i32, i32* @stdout
%24 = tail call i32 @fflush(i32 %23)
%25 = add nuw nsw i32 %20, 1
%26 = icmp eq i32 %25, 20
br i1 %26, label %27, label %19
27: ; preds = %19
%28 = tail call i32 @putchar(i32 10)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 3)
%30 = tail call i32 @run(i32 10000, i32 1000000, i32 4845, i32 0)
%31 = tail call i32 @putchar(i32 33)
%32 = load i32, i32* @stdout
%33 = tail call i32 @fflush(i32 %32)
%34 = tail call i32 @run(i32 10000, i32 1000000, i32 4845, i32 0)
%35 = tail call i32 @putchar(i32 33)
%36 = load i32, i32* @stdout
%37 = tail call i32 @fflush(i32 %36)
%38 = tail call i32 @run(i32 10000, i32 1000000, i32 4845, i32 0)
%39 = tail call i32 @putchar(i32 33)
%40 = load i32, i32* @stdout
%41 = tail call i32 @fflush(i32 %40)
%42 = tail call i32 @putchar(i32 10)
ret i32 0
}