#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*/ fairshare(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ turnCount(int, int);
int main() {
  fairshare(2, 25);
  fairshare(3, 25);
  fairshare(5, 25);
  fairshare(11, 25);
  printf("How many times does each get a turn in 50000 iterations?\n");
  turnCount(191, 50000);
  turnCount(1377, 50000);
  turnCount(49999, 50000);
  turnCount(50000, 50000);
  turnCount(50001, 50000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x19,%esi
call   1050 <fairshare@plt>
mov    $0x3,%edi
mov    $0x19,%esi
call   1050 <fairshare@plt>
mov    $0x5,%edi
mov    $0x19,%esi
call   1050 <fairshare@plt>
mov    $0xb,%edi
mov    $0x19,%esi
call   1050 <fairshare@plt>
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
mov    $0xbf,%edi
mov    $0xc350,%esi
call   1030 <turnCount@plt>
mov    $0x561,%edi
mov    $0xc350,%esi
call   1030 <turnCount@plt>
mov    $0xc34f,%edi
mov    $0xc350,%esi
call   1030 <turnCount@plt>
mov    $0xc350,%esi
mov    %esi,%edi
call   1030 <turnCount@plt>
mov    $0xc351,%edi
mov    $0xc350,%esi
call   1030 <turnCount@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x19,%esi
call   1050 <fairshare@plt>
mov    $0x3,%edi
mov    $0x19,%esi
call   1050 <fairshare@plt>
mov    $0x5,%edi
mov    $0x19,%esi
call   1050 <fairshare@plt>
mov    $0xb,%edi
mov    $0x19,%esi
call   1050 <fairshare@plt>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
mov    $0xbf,%edi
mov    $0xc350,%esi
call   1040 <turnCount@plt>
mov    $0x561,%edi
mov    $0xc350,%esi
call   1040 <turnCount@plt>
mov    $0xc34f,%edi
mov    $0xc350,%esi
call   1040 <turnCount@plt>
mov    $0xc350,%edi
mov    $0xc350,%esi
call   1040 <turnCount@plt>
mov    $0xc351,%edi
mov    $0xc350,%esi
call   1040 <turnCount@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"How many times does each get a turn in 50000 iterations?\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fairshare(i32 2, i32 25)
%3 = call i32 @fairshare(i32 3, i32 25)
%4 = call i32 @fairshare(i32 5, i32 25)
%5 = call i32 @fairshare(i32 11, i32 25)
%6 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @turnCount(i32 191, i32 50000)
%8 = call i32 @turnCount(i32 1377, i32 50000)
%9 = call i32 @turnCount(i32 49999, i32 50000)
%10 = call i32 @turnCount(i32 50000, i32 50000)
%11 = call i32 @turnCount(i32 50001, i32 50000)
ret i32 0
}

LLVM IR (-O2):
@str = [57 x i8] c"How many times does each get a turn in 50000 iterations?\00"
define i32 @main() {
%1 = tail call i32 @fairshare(i32 2, i32 25)
%2 = tail call i32 @fairshare(i32 3, i32 25)
%3 = tail call i32 @fairshare(i32 5, i32 25)
%4 = tail call i32 @fairshare(i32 11, i32 25)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @turnCount(i32 191, i32 50000)
%7 = tail call i32 @turnCount(i32 1377, i32 50000)
%8 = tail call i32 @turnCount(i32 49999, i32 50000)
%9 = tail call i32 @turnCount(i32 50000, i32 50000)
%10 = tail call i32 @turnCount(i32 50001, i32 50000)
ret i32 0
}