#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*/ my_putnbr(int);
int /*<<< orphan*/ my_putnchar(char, int);
int /*<<< orphan*/ my_putstr(char *);
void print_player(int mode, int player) {
  static int turn = 0;
  my_putnchar('-', 24);
  my_putstr("\nTurn ");
  my_putnbr(++turn);
  my_putstr((player == 1) ? "\033[34m" : "\033[31m");
  my_putstr(": Player ");
  my_putnbr(player);
  my_putstr(" (");
  if ((player == 1 && mode == 0) || (player == 2 && mode < 2))
    my_putstr("IA");
  else
    my_putstr("human");
  my_putstr(")\033[0m\n");
}


x86 assembly (clang, -O0):
<print_player>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x2d,%edi
mov    $0x18,%esi
call   1030 <my_putnchar@plt>
lea    0xeac(%rip),%rdi
call   1040 <my_putstr@plt>
mov    0x2edd(%rip),%edi
add    $0x1,%edi
mov    %edi,0x2ed4(%rip)
call   1050 <my_putnbr@plt>
mov    -0x8(%rbp),%ecx
lea    0xe96(%rip),%rdi
lea    0xe89(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdi
call   1040 <my_putstr@plt>
lea    0xe82(%rip),%rdi
call   1040 <my_putstr@plt>
mov    -0x8(%rbp),%edi
call   1050 <my_putnbr@plt>
lea    0xe78(%rip),%rdi
call   1040 <my_putstr@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11be <print_player+0x8e>
cmpl   $0x0,-0x4(%rbp)
je     11d2 <print_player+0xa2>
cmpl   $0x2,-0x8(%rbp)
jne    11e3 <print_player+0xb3>
cmpl   $0x2,-0x4(%rbp)
jge    11e3 <print_player+0xb3>
lea    0xe47(%rip),%rdi
call   1040 <my_putstr@plt>
jmp    11ef <print_player+0xbf>
lea    0xe39(%rip),%rdi
call   1040 <my_putstr@plt>
lea    0xe33(%rip),%rdi
call   1040 <my_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_player>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r13d
mov    %edi,%r14d
mov    $0x2d,%edi
mov    $0x18,%esi
call   1030 <my_putnchar@plt>
lea    0xea9(%rip),%rdi
call   1040 <my_putstr@plt>
mov    0x2eda(%rip),%edi
add    $0x1,%edi
mov    %edi,0x2ed1(%rip)
call   1050 <my_putnbr@plt>
cmp    $0x2,%r13d
lea    0xea5(%rip),%rbx
lea    0xea1(%rip),%rax
mov    %rax,%rbp
cmove  %rbx,%rbp
cmp    $0x2,%r14d
cmovge %rax,%rbp
cmp    $0x1,%r13d
lea    0xe6b(%rip),%rax
lea    0xe6a(%rip),%rdi
cmove  %rax,%rdi
lea    0xe65(%rip),%r15
lea    0xe68(%rip),%r12
cmovne %rbp,%rbx
call   1040 <my_putstr@plt>
mov    %r15,%rdi
call   1040 <my_putstr@plt>
mov    %r13d,%edi
call   1050 <my_putnbr@plt>
mov    %r12,%rdi
call   1040 <my_putstr@plt>
test   %r14d,%r14d
cmovne %rbp,%rbx
mov    %rbx,%rdi
call   1040 <my_putstr@plt>
lea    0xe3d(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <my_putstr@plt>

LLVM IR (-O0):
@print_player.turn = internal global i32 0
@.str = [7 x i8] c"\0ATurn \00"
@.str.1 = [6 x i8] c"\1B[34m\00"
@.str.2 = [6 x i8] c"\1B[31m\00"
@.str.3 = [10 x i8] c": Player \00"
@.str.4 = [3 x i8] c" (\00"
@.str.5 = [3 x i8] c"IA\00"
@.str.6 = [6 x i8] c"human\00"
@.str.7 = [7 x i8] c")\1B[0m\0A\00"
define void @print_player(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @my_putnchar(i8 signext 45, i32 24)
%6 = call i32 @my_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @print_player.turn
%8 = add nsw i32 %7, 1
store i32 %8, i32* @print_player.turn
%9 = call i32 @my_putnbr(i32 %8)
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 @my_putstr(i8* %13)
%15 = call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* %4
%17 = call i32 @my_putnbr(i32 %16)
%18 = call i32 @my_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %24
21: ; preds = %2
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 0
br i1 %23, label %30, label %24
24: ; preds = %21, %2
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %32
27: ; preds = %24
%28 = load i32, i32* %3
%29 = icmp slt i32 %28, 2
br i1 %29, label %30, label %32
30: ; preds = %27, %21
%31 = call i32 @my_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %34
32: ; preds = %27, %24
%33 = call i32 @my_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %34
34: ; preds = %32, %30
%35 = call i32 @my_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@print_player.turn = internal unnamed_addr global i32 0
@.str = [7 x i8] c"\0ATurn \00"
@.str.1 = [6 x i8] c"\1B[34m\00"
@.str.2 = [6 x i8] c"\1B[31m\00"
@.str.3 = [10 x i8] c": Player \00"
@.str.4 = [3 x i8] c" (\00"
@.str.5 = [3 x i8] c"IA\00"
@.str.6 = [6 x i8] c"human\00"
@.str.7 = [7 x i8] c")\1B[0m\0A\00"
define void @print_player(i32 %0, i32 %1) {
%3 = tail call i32 @my_putnchar(i8 signext 45, i32 24)
%4 = tail call i32 @my_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @print_player.turn
%6 = add nsw i32 %5, 1
store i32 %6, i32* @print_player.turn
%7 = tail call i32 @my_putnbr(i32 %6)
%8 = icmp eq i32 %1, 1
%9 = select i1 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%10 = tail call i32 @my_putstr(i8* %9)
%11 = tail call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 @my_putnbr(i32 %1)
%13 = tail call i32 @my_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i32 %0, 0
%15 = and i1 %14, %8
%16 = icmp eq i32 %1, 2
%17 = icmp slt i32 %0, 2
%18 = and i1 %17, %16
%19 = or i1 %15, %18
%20 = select i1 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0)
%21 = tail call i32 @my_putstr(i8* %20)
%22 = tail call i32 @my_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
ret void
}