#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 */
typedef int /*<<< orphan*/ mpz_t;
typedef int /*<<< orphan*/ mpf_t;

/* Variables and functions */
int /*<<< orphan*/ gmp_printf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpf_add(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpf_div(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpf_set_z(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpf_ui_sub(int /*<<< orphan*/, int, int /*<<< orphan*/);
int mpz_cmp_ui(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mod(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_sub(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void PrintIfNeeded(int fastmode, mpz_t WinsWithBonus, mpz_t LossesWithBonus,
                   mpz_t LoopCounter, mpz_t LoopModuloFastmode,
                   mpz_t DrawCounter, mpz_t NumberOfResults, mpz_t FastmodeSkip,
                   mpf_t RelativeBonusWins, mpf_t RelativeBonusDraws,
                   mpf_t RelativeBonusLosses, mpf_t RelativeBonusResults,
                   mpf_t RelativeBonusWinResults,
                   mpf_t RelativeBonusLossResults, mpf_t WinsWithBonusFloat,
                   mpf_t LossesWithBonusFloat, mpf_t LoopCounterFloat,
                   mpf_t NumberOfResultsFloat) {
  int LoopModuloFastmodeInt;
  mpz_mod(LoopModuloFastmode, LoopCounter, FastmodeSkip);
  LoopModuloFastmodeInt = mpz_cmp_ui(LoopModuloFastmode, 0);
  if ((fastmode == 0) || (LoopModuloFastmodeInt == 0)) {
    mpz_sub(NumberOfResults, LoopCounter, DrawCounter);
    mpf_set_z(WinsWithBonusFloat, WinsWithBonus);
    mpf_set_z(LossesWithBonusFloat, LossesWithBonus);
    mpf_set_z(LoopCounterFloat, LoopCounter);
    mpf_set_z(NumberOfResultsFloat, NumberOfResults);
    mpf_div(RelativeBonusWins, WinsWithBonusFloat, LoopCounterFloat);
    mpf_div(RelativeBonusLosses, LossesWithBonusFloat, LoopCounterFloat);
    mpf_add(RelativeBonusResults, RelativeBonusWins, RelativeBonusLosses);
    mpf_ui_sub(RelativeBonusDraws, 1, RelativeBonusResults);
    mpf_div(RelativeBonusWinResults, WinsWithBonusFloat, NumberOfResultsFloat);
    mpf_div(RelativeBonusLossResults, LossesWithBonusFloat,
            NumberOfResultsFloat);
    gmp_printf("Loop %Zd, "
               "WinsWithBonus %Zd, "
               "LossesWithBonus %Zd, "
               "RelativeBonusWins %Ff, "
               "RelativeBonusLosses %Ff, "
               "RelativeBonusDraws %Ff, "
               "RelativeBonusWinResults %Ff, "
               "RelativeBonusLossResults %Ff\n",
               LoopCounter, WinsWithBonus, LossesWithBonus, RelativeBonusWins,
               RelativeBonusLosses, RelativeBonusDraws, RelativeBonusWinResults,
               RelativeBonusLossResults);
  }
}


x86 assembly (clang, -O0):
<PrintIfNeeded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x68(%rbp),%eax
mov    0x60(%rbp),%eax
mov    0x58(%rbp),%eax
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    0x18(%rbp),%edx
call   1080 <mpz_mod@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <mpz_cmp_ui@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11ef <PrintIfNeeded+0x6f>
cmpl   $0x0,-0x1c(%rbp)
jne    12b4 <PrintIfNeeded+0x134>
mov    0x10(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <mpz_sub@plt>
mov    0x50(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <mpf_set_z@plt>
mov    0x58(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <mpf_set_z@plt>
mov    0x60(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <mpf_set_z@plt>
mov    0x68(%rbp),%edi
mov    0x10(%rbp),%esi
call   1050 <mpf_set_z@plt>
mov    0x20(%rbp),%edi
mov    0x50(%rbp),%esi
mov    0x60(%rbp),%edx
call   1090 <mpf_div@plt>
mov    0x30(%rbp),%edi
mov    0x58(%rbp),%esi
mov    0x60(%rbp),%edx
call   1090 <mpf_div@plt>
mov    0x38(%rbp),%edi
mov    0x20(%rbp),%esi
mov    0x30(%rbp),%edx
call   1040 <mpf_add@plt>
mov    0x28(%rbp),%edi
mov    0x38(%rbp),%edx
mov    $0x1,%esi
call   1070 <mpf_ui_sub@plt>
mov    0x40(%rbp),%edi
mov    0x50(%rbp),%esi
mov    0x68(%rbp),%edx
call   1090 <mpf_div@plt>
mov    0x48(%rbp),%edi
mov    0x58(%rbp),%esi
mov    0x68(%rbp),%edx
call   1090 <mpf_div@plt>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    0x20(%rbp),%r8d
mov    0x30(%rbp),%r9d
mov    0x28(%rbp),%r11d
mov    0x40(%rbp),%r10d
mov    0x48(%rbp),%eax
lea    0xd5e(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   10a0 <gmp_printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintIfNeeded>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r15d
mov    %r8d,%ebx
mov    %ecx,%r13d
mov    %edx,%r14d
mov    %esi,%r12d
mov    %edi,%ebp
mov    0x48(%rsp),%edx
mov    %r8d,%edi
mov    %ecx,%esi
call   1080 <mpz_mod@plt>
mov    %ebx,%edi
xor    %esi,%esi
call   1060 <mpz_cmp_ui@plt>
test   %ebp,%ebp
je     11c4 <PrintIfNeeded+0x44>
test   %eax,%eax
je     11c4 <PrintIfNeeded+0x44>
add    $0x8,%rsp
jmp    12c6 <PrintIfNeeded+0x146>
mov    0x88(%rsp),%ebp
mov    0x80(%rsp),%ebx
mov    %r14d,0x4(%rsp)
mov    0x40(%rsp),%edi
mov    %r13d,%esi
mov    %r15d,%edx
call   1030 <mpz_sub@plt>
mov    %ebx,%edi
mov    %r12d,%esi
call   1050 <mpf_set_z@plt>
mov    %ebp,%edi
mov    %r12d,(%rsp)
mov    %ebp,%r12d
mov    %r14d,%esi
call   1050 <mpf_set_z@plt>
mov    0x90(%rsp),%r14d
mov    %r14d,%edi
mov    %r13d,%esi
call   1050 <mpf_set_z@plt>
mov    0x98(%rsp),%r15d
mov    %r15d,%edi
mov    0x40(%rsp),%esi
call   1050 <mpf_set_z@plt>
mov    0x50(%rsp),%ebp
mov    %ebp,%edi
mov    0x80(%rsp),%esi
mov    %r14d,%edx
call   1090 <mpf_div@plt>
mov    0x60(%rsp),%ebx
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r14d,%edx
call   1090 <mpf_div@plt>
mov    0x68(%rsp),%r14d
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <mpf_add@plt>
mov    0x58(%rsp),%edi
mov    $0x1,%esi
mov    %r14d,%edx
call   1070 <mpf_ui_sub@plt>
mov    0x70(%rsp),%ebx
mov    %ebx,%edi
mov    0x80(%rsp),%esi
mov    %r15d,%edx
call   1090 <mpf_div@plt>
mov    0x78(%rsp),%ebp
mov    %ebp,%edi
mov    %r12d,%esi
mov    %r15d,%edx
call   1090 <mpf_div@plt>
sub    $0x8,%rsp
lea    0xd5f(%rip),%rdi
mov    %r13d,%esi
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x58(%rsp),%r8d
mov    0x68(%rsp),%r9d
push   %rbp
push   %rbx
mov    0x70(%rsp),%eax
push   %rax
call   10a0 <gmp_printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [181 x i8] c"Loop %Zd, WinsWithBonus %Zd, LossesWithBonus %Zd, RelativeBonusWins %Ff, RelativeBonusLosses %Ff, RelativeBonusDraws %Ff, RelativeBonusWinResults %Ff, RelativeBonusLossResults %Ff\0A\00"
define void @PrintIfNeeded(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32 %16, i32 %17) {
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i32
store i32 %0, i32* %19
store i32 %1, i32* %20
store i32 %2, i32* %21
store i32 %3, i32* %22
store i32 %4, i32* %23
store i32 %5, i32* %24
store i32 %6, i32* %25
store i32 %7, i32* %26
store i32 %8, i32* %27
store i32 %9, i32* %28
store i32 %10, i32* %29
store i32 %11, i32* %30
store i32 %12, i32* %31
store i32 %13, i32* %32
store i32 %14, i32* %33
store i32 %15, i32* %34
store i32 %16, i32* %35
store i32 %17, i32* %36
%38 = load i32, i32* %23
%39 = load i32, i32* %22
%40 = load i32, i32* %26
%41 = call i32 @mpz_mod(i32 %38, i32 %39, i32 %40)
%42 = load i32, i32* %23
%43 = call i32 @mpz_cmp_ui(i32 %42, i32 0)
store i32 %43, i32* %37
%44 = load i32, i32* %19
%45 = icmp eq i32 %44, 0
br i1 %45, label %49, label %46
46: ; preds = %18
%47 = load i32, i32* %37
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %98
49: ; preds = %46, %18
%50 = load i32, i32* %25
%51 = load i32, i32* %22
%52 = load i32, i32* %24
%53 = call i32 @mpz_sub(i32 %50, i32 %51, i32 %52)
%54 = load i32, i32* %33
%55 = load i32, i32* %20
%56 = call i32 @mpf_set_z(i32 %54, i32 %55)
%57 = load i32, i32* %34
%58 = load i32, i32* %21
%59 = call i32 @mpf_set_z(i32 %57, i32 %58)
%60 = load i32, i32* %35
%61 = load i32, i32* %22
%62 = call i32 @mpf_set_z(i32 %60, i32 %61)
%63 = load i32, i32* %36
%64 = load i32, i32* %25
%65 = call i32 @mpf_set_z(i32 %63, i32 %64)
%66 = load i32, i32* %27
%67 = load i32, i32* %33
%68 = load i32, i32* %35
%69 = call i32 @mpf_div(i32 %66, i32 %67, i32 %68)
%70 = load i32, i32* %29
%71 = load i32, i32* %34
%72 = load i32, i32* %35
%73 = call i32 @mpf_div(i32 %70, i32 %71, i32 %72)
%74 = load i32, i32* %30
%75 = load i32, i32* %27
%76 = load i32, i32* %29
%77 = call i32 @mpf_add(i32 %74, i32 %75, i32 %76)
%78 = load i32, i32* %28
%79 = load i32, i32* %30
%80 = call i32 @mpf_ui_sub(i32 %78, i32 1, i32 %79)
%81 = load i32, i32* %31
%82 = load i32, i32* %33
%83 = load i32, i32* %36
%84 = call i32 @mpf_div(i32 %81, i32 %82, i32 %83)
%85 = load i32, i32* %32
%86 = load i32, i32* %34
%87 = load i32, i32* %36
%88 = call i32 @mpf_div(i32 %85, i32 %86, i32 %87)
%89 = load i32, i32* %22
%90 = load i32, i32* %20
%91 = load i32, i32* %21
%92 = load i32, i32* %27
%93 = load i32, i32* %29
%94 = load i32, i32* %28
%95 = load i32, i32* %31
%96 = load i32, i32* %32
%97 = call i32 @gmp_printf(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str, i64 0, i64 0), i32 %89, i32 %90, i32 %91, i32 %92, i32 %93, i32 %94, i32 %95, i32 %96)
br label %98
98: ; preds = %49, %46
ret void
}

LLVM IR (-O2):
@.str = [181 x i8] c"Loop %Zd, WinsWithBonus %Zd, LossesWithBonus %Zd, RelativeBonusWins %Ff, RelativeBonusLosses %Ff, RelativeBonusDraws %Ff, RelativeBonusWinResults %Ff, RelativeBonusLossResults %Ff\0A\00"
define void @PrintIfNeeded(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32 %16, i32 %17) {
%19 = tail call i32 @mpz_mod(i32 %4, i32 %3, i32 %7)
%20 = tail call i32 @mpz_cmp_ui(i32 %4, i32 0)
%21 = icmp eq i32 %0, 0
%22 = icmp eq i32 %20, 0
%23 = select i1 %21, i1 true, i1 %22
br i1 %23, label %24, label %37
24: ; preds = %18
%25 = tail call i32 @mpz_sub(i32 %6, i32 %3, i32 %5)
%26 = tail call i32 @mpf_set_z(i32 %14, i32 %1)
%27 = tail call i32 @mpf_set_z(i32 %15, i32 %2)
%28 = tail call i32 @mpf_set_z(i32 %16, i32 %3)
%29 = tail call i32 @mpf_set_z(i32 %17, i32 %6)
%30 = tail call i32 @mpf_div(i32 %8, i32 %14, i32 %16)
%31 = tail call i32 @mpf_div(i32 %10, i32 %15, i32 %16)
%32 = tail call i32 @mpf_add(i32 %11, i32 %8, i32 %10)
%33 = tail call i32 @mpf_ui_sub(i32 %9, i32 1, i32 %11)
%34 = tail call i32 @mpf_div(i32 %12, i32 %14, i32 %17)
%35 = tail call i32 @mpf_div(i32 %13, i32 %15, i32 %17)
%36 = tail call i32 @gmp_printf(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %1, i32 %2, i32 %8, i32 %10, i32 %9, i32 %12, i32 %13)
br label %37
37: ; preds = %18, %24
ret void
}