#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*/ strcmp(char *, char *);
void getargs(int argc, char **argv, int *pc, int *ch) {
  int i;
  *pc = *ch = 0;
  for (i = 0; i < argc; i++) {
    if (!strcmp(argv[i], "--play-with-computer") || !strcmp(argv[i], "-c")) {
      *pc = 1;
      *ch = 1;
    }
  }
}


x86 assembly (clang, -O0):
<getargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11b7 <getargs+0xa7>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     1190 <getargs+0x80>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe93(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11a4 <getargs+0x94>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
jmp    11a9 <getargs+0x99>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1142 <getargs+0x32>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getargs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,(%rcx)
movl   $0x0,(%rdx)
test   %edi,%edi
jle    1183 <getargs+0x73>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%r13d
xor    %r12d,%r12d
jmp    1157 <getargs+0x47>
nopl   0x0(%rax)
movl   $0x1,(%r15)
movl   $0x1,(%r14)
add    $0x1,%r12
cmp    %r12,%r13
je     1183 <getargs+0x73>
mov    (%rbx,%r12,8),%rbp
mov    %rbp,%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1140 <getargs+0x30>
mov    %rbp,%rdi
lea    0xe9d(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
jne    114e <getargs+0x3e>
jmp    1140 <getargs+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"--play-with-computer\00"
@.str.1 = [3 x i8] c"-c\00"
define void @getargs(i32 %0, i8** %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32*, i32** %8
store i32 0, i32* %10
%11 = load i32*, i32** %7
store i32 0, i32* %11
store i32 0, i32* %9
br label %12
12: ; preds = %36, %4
%13 = load i32, i32* %9
%14 = load i32, i32* %5
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %39
16: ; preds = %12
%17 = load i8**, i8*** %6
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @strcmp(i8* %21, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %16
%25 = load i8**, i8*** %6
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %25, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp ne i32 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %24, %16
%33 = load i32*, i32** %7
store i32 1, i32* %33
%34 = load i32*, i32** %8
store i32 1, i32* %34
br label %35
35: ; preds = %32, %24
br label %36
36: ; preds = %35
%37 = load i32, i32* %9
%38 = add nsw i32 %37, 1
store i32 %38, i32* %9
br label %12
39: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"--play-with-computer\00"
@.str.1 = [3 x i8] c"-c\00"
define void @getargs(i32 %0, i8** nocapture %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
store i32 0, i32* %3
store i32 0, i32* %2
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %21
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %18
%9 = phi i64 [ 0, %6 ], [ %19, %18 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(21) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14, %8
store i32 1, i32* %2
store i32 1, i32* %3
br label %18
18: ; preds = %14, %17
%19 = add nuw nsw i64 %9, 1
%20 = icmp eq i64 %19, %7
br i1 %20, label %21, label %8
21: ; preds = %18, %4
ret void
}