#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ test_play_one(int, char *, char *, int, int);
void test_play_all(char *prog1, char *prog2) {
  int BlackWin = 2;
  int WhiteWin = 1;
  fprintf(stderr, "\n");
  test_play_one(WhiteWin, prog1, prog2, 1, 1);
  test_play_one(WhiteWin, prog1, prog2, 1, 2);
  test_play_one(BlackWin, prog1, prog2, 1, 3);
  test_play_one(BlackWin, prog1, prog2, 1, 4);
  test_play_one(BlackWin, prog1, prog2, 1, 5);
  test_play_one(BlackWin, prog1, prog2, 1, 6);
  test_play_one(BlackWin, prog1, prog2, 1, 7);
  test_play_one(WhiteWin, prog1, prog2, 2, 2);
  test_play_one(WhiteWin, prog1, prog2, 2, 3);
  return;
}


x86 assembly (clang, -O0):
<test_play_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1040 <test_play_one@plt>
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1040 <test_play_one@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x3,%r8d
call   1040 <test_play_one@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x4,%r8d
call   1040 <test_play_one@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x5,%r8d
call   1040 <test_play_one@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x6,%r8d
call   1040 <test_play_one@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x7,%r8d
call   1040 <test_play_one@plt>
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x2,%r8d
mov    %r8d,%ecx
call   1040 <test_play_one@plt>
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x2,%ecx
mov    $0x3,%r8d
call   1040 <test_play_one@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_play_all>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1040 <test_play_one@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1040 <test_play_one@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
mov    $0x3,%r8d
call   1040 <test_play_one@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
mov    $0x4,%r8d
call   1040 <test_play_one@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
mov    $0x5,%r8d
call   1040 <test_play_one@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
mov    $0x6,%r8d
call   1040 <test_play_one@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
mov    $0x7,%r8d
call   1040 <test_play_one@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x2,%ecx
mov    $0x2,%r8d
call   1040 <test_play_one@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x2,%ecx
mov    $0x3,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <test_play_one@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @test_play_all(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 2, i32* %5
store i32 1, i32* %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %6
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @test_play_one(i32 %9, i8* %10, i8* %11, i32 1, i32 1)
%13 = load i32, i32* %6
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @test_play_one(i32 %13, i8* %14, i8* %15, i32 1, i32 2)
%17 = load i32, i32* %5
%18 = load i8*, i8** %3
%19 = load i8*, i8** %4
%20 = call i32 @test_play_one(i32 %17, i8* %18, i8* %19, i32 1, i32 3)
%21 = load i32, i32* %5
%22 = load i8*, i8** %3
%23 = load i8*, i8** %4
%24 = call i32 @test_play_one(i32 %21, i8* %22, i8* %23, i32 1, i32 4)
%25 = load i32, i32* %5
%26 = load i8*, i8** %3
%27 = load i8*, i8** %4
%28 = call i32 @test_play_one(i32 %25, i8* %26, i8* %27, i32 1, i32 5)
%29 = load i32, i32* %5
%30 = load i8*, i8** %3
%31 = load i8*, i8** %4
%32 = call i32 @test_play_one(i32 %29, i8* %30, i8* %31, i32 1, i32 6)
%33 = load i32, i32* %5
%34 = load i8*, i8** %3
%35 = load i8*, i8** %4
%36 = call i32 @test_play_one(i32 %33, i8* %34, i8* %35, i32 1, i32 7)
%37 = load i32, i32* %6
%38 = load i8*, i8** %3
%39 = load i8*, i8** %4
%40 = call i32 @test_play_one(i32 %37, i8* %38, i8* %39, i32 2, i32 2)
%41 = load i32, i32* %6
%42 = load i8*, i8** %3
%43 = load i8*, i8** %4
%44 = call i32 @test_play_one(i32 %41, i8* %42, i8* %43, i32 2, i32 3)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @test_play_all(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @test_play_one(i32 1, i8* %0, i8* %1, i32 1, i32 1)
%6 = tail call i32 @test_play_one(i32 1, i8* %0, i8* %1, i32 1, i32 2)
%7 = tail call i32 @test_play_one(i32 2, i8* %0, i8* %1, i32 1, i32 3)
%8 = tail call i32 @test_play_one(i32 2, i8* %0, i8* %1, i32 1, i32 4)
%9 = tail call i32 @test_play_one(i32 2, i8* %0, i8* %1, i32 1, i32 5)
%10 = tail call i32 @test_play_one(i32 2, i8* %0, i8* %1, i32 1, i32 6)
%11 = tail call i32 @test_play_one(i32 2, i8* %0, i8* %1, i32 1, i32 7)
%12 = tail call i32 @test_play_one(i32 1, i8* %0, i8* %1, i32 2, i32 2)
%13 = tail call i32 @test_play_one(i32 1, i8* %0, i8* %1, i32 2, i32 3)
ret void
}