#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*/ analysis_big_small_ratio(int *, int, int, char *, int const);
int /*<<< orphan*/ analysis_continue_count(int *, int, char *, int const);
int /*<<< orphan*/ analysis_odd_even_ratio(int *, int, char *, int const);
int /*<<< orphan*/ analysis_sum(int *, int, char *, int const);
int arc4random_uniform(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ quick_sort(int *, int);
void start_main_loop(int draw_count) {
  if (draw_count > 0) {
    printf("I\tII\tIII\tIV\tV\tVI\tO:E\tB:S\tSUM\tCOT\n");
    printf("-------------------------------------------------------------------"
           "----------\n");
    for (int i = 0; i < draw_count; i++) {
      int draw[6];
      for (int j = 0; j < 6; j++) {
        int num = 1 + arc4random_uniform(34 - 1);
        draw[j] = num;
      }
      quick_sort(draw, 6);
      for (int j = 0; j < 6; j++) {
        printf("%d\t", draw[j]);
      }
      const int BUFFER_SIZE = 12;
      char result[BUFFER_SIZE];
      analysis_odd_even_ratio(draw, 6, result, BUFFER_SIZE);
      printf("%s\t", result);
      analysis_big_small_ratio(draw, 6, (34 - 1) / 2.0, result, BUFFER_SIZE);
      printf("%s\t", result);
      analysis_sum(draw, 6, result, BUFFER_SIZE);
      printf("%s\t", result);
      analysis_continue_count(draw, 6, result, BUFFER_SIZE);
      printf("%s\t", result);
      printf("\n");
    }
  }
}


x86 assembly (clang, -O0):
<start_main_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    131b <start_main_loop+0x1ab>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1316 <start_main_loop+0x1a6>
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    11ee <start_main_loop+0x7e>
mov    $0x21,%edi
call   1030 <arc4random_uniform@plt>
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%ecx
movslq -0x24(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11bb <start_main_loop+0x4b>
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1090 <quick_sort@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x6,-0x2c(%rbp)
jge    1231 <start_main_loop+0xc1>
movslq -0x2c(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1203 <start_main_loop+0x93>
movl   $0xc,-0x30(%rbp)
mov    %rsp,%rax
mov    %rax,-0x38(%rbp)
mov    %rsp,%rdx
add    $0xfffffffffffffff0,%rdx
mov    %rdx,-0x40(%rbp)
mov    %rdx,%rsp
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0xc,%ecx
call   1070 <analysis_odd_even_ratio@plt>
mov    -0x40(%rbp),%rsi
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x40(%rbp),%rcx
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0x10,%edx
mov    $0xc,%r8d
call   1080 <analysis_big_small_ratio@plt>
mov    -0x40(%rbp),%rsi
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x40(%rbp),%rdx
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0xc,%ecx
call   1060 <analysis_sum@plt>
mov    -0x40(%rbp),%rsi
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x40(%rbp),%rdx
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0xc,%ecx
call   1040 <analysis_continue_count@plt>
mov    -0x40(%rbp),%rsi
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a8 <start_main_loop+0x38>
jmp    131b <start_main_loop+0x1ab>
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_main_loop>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %edi,%edi
jle    134d <start_main_loop+0x1bd>
mov    %edi,%r13d
lea    0xe55(%rip),%rdi
call   1040 <puts@plt>
lea    0xe6a(%rip),%rdi
call   1040 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x21,%edi
call   1050 <arc4random_uniform@plt>
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    $0x21,%edi
call   1050 <arc4random_uniform@plt>
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    $0x21,%edi
call   1050 <arc4random_uniform@plt>
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    $0x21,%edi
call   1050 <arc4random_uniform@plt>
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    $0x21,%edi
call   1050 <arc4random_uniform@plt>
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    $0x21,%edi
call   1050 <arc4random_uniform@plt>
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
lea    -0x40(%rbp),%r15
mov    %r15,%rdi
mov    $0x6,%esi
call   10b0 <quick_sort@plt>
mov    -0x40(%rbp),%esi
lea    0xdb5(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    -0x3c(%rbp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    -0x38(%rbp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    -0x34(%rbp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    -0x30(%rbp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    -0x2c(%rbp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rsp,%r12
lea    -0x10(%rsp),%rbx
mov    %rbx,%rsp
mov    %r15,%rdi
mov    $0x6,%esi
mov    %rbx,%rdx
mov    $0xc,%ecx
call   1090 <analysis_odd_even_ratio@plt>
lea    0xd47(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
mov    $0x6,%esi
mov    $0x10,%edx
mov    %rbx,%rcx
mov    $0xc,%r8d
call   10a0 <analysis_big_small_ratio@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
mov    $0x6,%esi
mov    %rbx,%rdx
mov    $0xc,%ecx
call   1080 <analysis_sum@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
mov    $0x6,%esi
mov    %rbx,%rdx
mov    $0xc,%ecx
call   1060 <analysis_continue_count@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rsp
add    $0xffffffff,%r13d
jne    11d0 <start_main_loop+0x40>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"I\09II\09III\09IV\09V\09VI\09O:E\09B:S\09SUM\09COT\0A\00"
@.str.1 = [79 x i8] c"-----------------------------------------------------------------------------\0A\00"
@.str.2 = [4 x i8] c"%d\09\00"
@.str.3 = [4 x i8] c"%s\09\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @start_main_loop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [6 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i32 %0, i32* %2
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %69
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %15
15: ; preds = %65, %12
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %68
19: ; preds = %15
store i32 0, i32* %5
br label %20
20: ; preds = %30, %19
%21 = load i32, i32* %5
%22 = icmp slt i32 %21, 6
br i1 %22, label %23, label %33
23: ; preds = %20
%24 = call i32 @arc4random_uniform(i32 33)
%25 = add nsw i32 1, %24
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 %28
store i32 %26, i32* %29
br label %30
30: ; preds = %23
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %20
33: ; preds = %20
%34 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
%35 = call i32 @quick_sort(i32* %34, i32 6)
store i32 0, i32* %7
br label %36
36: ; preds = %45, %33
%37 = load i32, i32* %7
%38 = icmp slt i32 %37, 6
br i1 %38, label %39, label %48
39: ; preds = %36
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %39
%46 = load i32, i32* %7
%47 = add nsw i32 %46, 1
store i32 %47, i32* %7
br label %36
48: ; preds = %36
store i32 12, i32* %8
%49 = call i8* @llvm.stacksave()
store i8* %49, i8** %9
%50 = alloca i8, i64 12
%51 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
%52 = call i32 @analysis_odd_even_ratio(i32* %51, i32 6, i8* %50, i32 12)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %50)
%54 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
%55 = call i32 @analysis_big_small_ratio(i32* %54, i32 6, i32 16, i8* %50, i32 12)
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %50)
%57 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
%58 = call i32 @analysis_sum(i32* %57, i32 6, i8* %50, i32 12)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %50)
%60 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
%61 = call i32 @analysis_continue_count(i32* %60, i32 6, i8* %50, i32 12)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %50)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%64 = load i8*, i8** %9
br label %65
65: ; preds = %48
%66 = load i32, i32* %3
%67 = add nsw i32 %66, 1
store i32 %67, i32* %3
br label %15
68: ; preds = %15
br label %69
69: ; preds = %68, %1
ret void
}

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%d\09\00"
@.str.3 = [4 x i8] c"%s\09\00"
@str = [33 x i8] c"I\09II\09III\09IV\09V\09VI\09O:E\09B:S\09SUM\09COT\00"
@str.5 = [78 x i8] c"-----------------------------------------------------------------------------\00"
define void @start_main_loop(i32 %0) {
%2 = alloca [6 x i32]
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %55
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.5, i64 0, i64 0))
%7 = bitcast [6 x i32]* %2 to i8*
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 1
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 2
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 3
%12 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 4
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 5
br label %14
14: ; preds = %4, %14
%15 = phi i32 [ 0, %4 ], [ %53, %14 ]
%16 = call i32 @arc4random_uniform(i32 33)
%17 = add nsw i32 %16, 1
store i32 %17, i32* %8
%18 = call i32 @arc4random_uniform(i32 33)
%19 = add nsw i32 %18, 1
store i32 %19, i32* %9
%20 = call i32 @arc4random_uniform(i32 33)
%21 = add nsw i32 %20, 1
store i32 %21, i32* %10
%22 = call i32 @arc4random_uniform(i32 33)
%23 = add nsw i32 %22, 1
store i32 %23, i32* %11
%24 = call i32 @arc4random_uniform(i32 33)
%25 = add nsw i32 %24, 1
store i32 %25, i32* %12
%26 = call i32 @arc4random_uniform(i32 33)
%27 = add nsw i32 %26, 1
store i32 %27, i32* %13
%28 = call i32 @quick_sort(i32* %8, i32 6)
%29 = load i32, i32* %8
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %9
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %10
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %11
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %12
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %13
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %39)
%41 = call i8* @llvm.stacksave()
%42 = alloca [12 x i8]
%43 = getelementptr inbounds [12 x i8], [12 x i8]* %42, i64 0, i64 0
%44 = call i32 @analysis_odd_even_ratio(i32* %8, i32 6, i8* %43, i32 12)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %43)
%46 = call i32 @analysis_big_small_ratio(i32* %8, i32 6, i32 16, i8* %43, i32 12)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %43)
%48 = call i32 @analysis_sum(i32* %8, i32 6, i8* %43, i32 12)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %43)
%50 = call i32 @analysis_continue_count(i32* %8, i32 6, i8* %43, i32 12)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %43)
%52 = call i32 @putchar(i32 10)
%53 = add nuw nsw i32 %15, 1
%54 = icmp eq i32 %53, %0
br i1 %54, label %55, label %14
55: ; preds = %14, %1
ret void
}