#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*/ CG_CenterPrint(char *, int, int);
char *va(char *, int, ...);
void CG_DrawResults(int prize, int balance_change) {
  if (balance_change > 0) {
    if (prize > 0) {
      CG_CenterPrint(
          va("^6Congrats! You won ^3%d OAC^6!\n^2Score prize is ^3%d OAC^6.",
             balance_change, prize),
          480 * 0.50, 16);
    } else {
      CG_CenterPrint(va("^6Congrats! You won ^3%d OAC^6!", balance_change),
                     480 * 0.50, 16);
    }
  } else {
    if (prize > 0) {
      CG_CenterPrint(
          va("^6Maybe next time...\n^2Score prize is ^3%d OAC^6.", prize),
          480 * 0.50, 16);
    } else {
      CG_CenterPrint("^6Maybe next time...", 480 * 0.50, 16);
    }
  }
}


x86 assembly (clang, -O0):
<CG_DrawResults>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1195 <CG_DrawResults+0x75>
cmpl   $0x0,-0x4(%rbp)
jle    116d <CG_DrawResults+0x4d>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <va@plt>
mov    %rax,%rdi
mov    $0xf0,%esi
mov    $0x10,%edx
call   1030 <CG_CenterPrint@plt>
jmp    1190 <CG_DrawResults+0x70>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <va@plt>
mov    %rax,%rdi
mov    $0xf0,%esi
mov    $0x10,%edx
call   1030 <CG_CenterPrint@plt>
jmp    11e2 <CG_DrawResults+0xc2>
cmpl   $0x0,-0x4(%rbp)
jle    11c7 <CG_DrawResults+0xa7>
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <va@plt>
mov    %rax,%rdi
mov    $0xf0,%esi
mov    $0x10,%edx
call   1030 <CG_CenterPrint@plt>
jmp    11dd <CG_DrawResults+0xbd>
lea    0xec1(%rip),%rdi
mov    $0xf0,%esi
mov    $0x10,%edx
call   1030 <CG_CenterPrint@plt>
jmp    11e2 <CG_DrawResults+0xc2>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_DrawResults>:
push   %rax
mov    %edi,%edx
test   %esi,%esi
jle    113b <CG_DrawResults+0x1b>
test   %edx,%edx
jle    114a <CG_DrawResults+0x2a>
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1040 <va@plt>
jmp    1158 <CG_DrawResults+0x38>
test   %edx,%edx
jle    116b <CG_DrawResults+0x4b>
lea    0xf17(%rip),%rdi
mov    %edx,%esi
jmp    1151 <CG_DrawResults+0x31>
lea    0xeec(%rip),%rdi
xor    %eax,%eax
call   1040 <va@plt>
mov    %rax,%rdi
mov    $0xf0,%esi
mov    $0x10,%edx
pop    %rax
jmp    1030 <CG_CenterPrint@plt>
lea    0xf1d(%rip),%rdi
jmp    115b <CG_DrawResults+0x3b>

LLVM IR (-O0):
@.str = [61 x i8] c"^6Congrats! You won ^3%d OAC^6!\0A^2Score prize is ^3%d OAC^6.\00"
@.str.1 = [32 x i8] c"^6Congrats! You won ^3%d OAC^6!\00"
@.str.2 = [50 x i8] c"^6Maybe next time...\0A^2Score prize is ^3%d OAC^6.\00"
@.str.3 = [21 x i8] c"^6Maybe next time...\00"
define void @CG_DrawResults(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = call i8* (i8*, i32, ...) @va(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = call i32 @CG_CenterPrint(i8* %13, i32 240, i32 16)
br label %19
15: ; preds = %7
%16 = load i32, i32* %4
%17 = call i8* (i8*, i32, ...) @va(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = call i32 @CG_CenterPrint(i8* %17, i32 240, i32 16)
br label %19
19: ; preds = %15, %10
br label %30
20: ; preds = %2
%21 = load i32, i32* %3
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load i32, i32* %3
%25 = call i8* (i8*, i32, ...) @va(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = call i32 @CG_CenterPrint(i8* %25, i32 240, i32 16)
br label %29
27: ; preds = %20
%28 = call i32 @CG_CenterPrint(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 240, i32 16)
br label %29
29: ; preds = %27, %23
br label %30
30: ; preds = %29, %19
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"^6Congrats! You won ^3%d OAC^6!\0A^2Score prize is ^3%d OAC^6.\00"
@.str.1 = [32 x i8] c"^6Congrats! You won ^3%d OAC^6!\00"
@.str.2 = [50 x i8] c"^6Maybe next time...\0A^2Score prize is ^3%d OAC^6.\00"
@.str.3 = [21 x i8] c"^6Maybe next time...\00"
define void @CG_DrawResults(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = icmp sgt i32 %0, 0
br i1 %3, label %5, label %10
5: ; preds = %2
br i1 %4, label %6, label %8
6: ; preds = %5
%7 = tail call i8* (i8*, i32, ...) @va(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
br label %13
8: ; preds = %5
%9 = tail call i8* (i8*, i32, ...) @va(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %13
10: ; preds = %2
br i1 %4, label %11, label %13
11: ; preds = %10
%12 = tail call i8* (i8*, i32, ...) @va(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %13
13: ; preds = %10, %11, %6, %8
%14 = phi i8* [ %12, %11 ], [ %7, %6 ], [ %9, %8 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), %10 ]
%15 = tail call i32 @CG_CenterPrint(i8* %14, i32 240, i32 16)
ret void
}