#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 check_params(char **, int *, int *);
int game(int, int);
int main(int ac, char **av) {
  int size;
  int mode;
  size = 4;
  mode = 1;
  if (ac > 1 && check_params(av, &size, &mode) == 1)
    return (1);
  if (game(size, mode) == 1)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1174 <main+0x54>
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <check_params@plt>
cmp    $0x1,%eax
jne    1174 <main+0x54>
movl   $0x1,-0x4(%rbp)
jmp    119b <main+0x7b>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <game@plt>
cmp    $0x1,%eax
jne    1194 <main+0x74>
movl   $0x1,-0x4(%rbp)
jmp    119b <main+0x7b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x4,0x4(%rsp)
movl   $0x1,(%rsp)
cmp    $0x2,%edi
jl     115d <main+0x3d>
lea    0x4(%rsp),%rax
mov    %rsp,%rdx
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <check_params@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     1176 <main+0x56>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
jmp    1167 <main+0x47>
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <game@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 4, i32* %6
store i32 1, i32* %7
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = call i32 @check_params(i8** %11, i32* %6, i32* %7)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %3
br label %22
15: ; preds = %10, %2
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 @game(i32 %16, i32 %17)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %15
store i32 1, i32* %3
br label %22
21: ; preds = %15
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %14
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
store i32 4, i32* %3
store i32 1, i32* %4
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = call i32 @check_params(i8** %1, i32* %3, i32* %4)
%10 = icmp eq i32 %9, 1
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = load i32, i32* %4
br label %14
14: ; preds = %11, %2
%15 = phi i32 [ %13, %11 ], [ 1, %2 ]
%16 = phi i32 [ %12, %11 ], [ 4, %2 ]
%17 = call i32 @game(i32 %16, i32 %15)
%18 = icmp eq i32 %17, 1
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %14, %8
%21 = phi i32 [ 1, %8 ], [ %19, %14 ]
ret i32 %21
}