#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 void *uint8_t;
typedef void *uint32_t;

/* Variables and functions */
void *atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void parseArgs(int argc, char *argv[], uint32_t *p_locationsPerPlayer,
               uint8_t *p_initialTokensPerLocation) {
  if (3 != argc) {
    fprintf(stderr, "usage: <executable> <locations per player (excluding "
                    "stores)> <initial # of tokens per location>\n");
    exit(1);
  }
  *p_locationsPerPlayer = atoi(argv[1]);
  *p_initialTokensPerLocation = atoi(argv[2]);
  return;
}


x86 assembly (clang, -O0):
<parseArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x3,%eax
cmp    -0x4(%rbp),%eax
je     1174 <parseArgs+0x44>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseArgs>:
push   %r15
push   %r14
push   %rbx
cmp    $0x3,%edi
jne    1161 <parseArgs+0x31>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %rax,(%r15)
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
mov    %rax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [98 x i8] c"usage: <executable> <locations per player (excluding stores)> <initial # of tokens per location>\0A\00"
define void @parseArgs(i32 %0, i8** %1, i8** %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8**
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%9 = load i32, i32* %5
%10 = icmp ne i32 3, %9
br i1 %10, label %11, label %15
11: ; preds = %4
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %4
%16 = load i8**, i8*** %6
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i8* @atoi(i8* %18)
%20 = load i8**, i8*** %7
store i8* %19, i8** %20
%21 = load i8**, i8*** %6
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i8* @atoi(i8* %23)
%25 = load i8**, i8*** %8
store i8* %24, i8** %25
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [98 x i8] c"usage: <executable> <locations per player (excluding stores)> <initial # of tokens per location>\0A\00"
define void @parseArgs(i32 %0, i8** nocapture %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3) {
%5 = icmp eq i32 %0, 3
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i8* @atoi(i8* %12)
store i8* %13, i8** %2
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i8* @atoi(i8* %15)
store i8* %16, i8** %3
ret void
}