#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int token_exists(char **, int, int, int, int, char *, int, int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  char **matrix = (char **)malloc(sizeof(char *) * 5);
  matrix[0] = "URLPM";
  matrix[1] = "XPRET";
  matrix[2] = "GIAET";
  matrix[3] = "XTNZY";
  matrix[4] = "XOQRS";
  printf("%d\n", token_exists(matrix, 5, 5, 2, 2, "GIRL", 4, 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x28,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
lea    0xea1(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
lea    0xe99(%rip),%rcx
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rax
lea    0xe90(%rip),%rcx
mov    %rcx,0x10(%rax)
mov    -0x18(%rbp),%rax
lea    0xe87(%rip),%rcx
mov    %rcx,0x18(%rax)
mov    -0x18(%rbp),%rax
lea    0xe7e(%rip),%rcx
mov    %rcx,0x20(%rax)
mov    -0x18(%rbp),%rdi
mov    $0x5,%edx
mov    $0x2,%r8d
lea    0xe6e(%rip),%r9
xor    %eax,%eax
mov    %edx,%esi
mov    %r8d,%ecx
movl   $0x4,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <token_exists@plt>
mov    %eax,%esi
lea    0xe46(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1050 <malloc@plt>
lea    0xebe(%rip),%rcx
mov    %rcx,(%rax)
lea    0xeba(%rip),%rcx
mov    %rcx,0x8(%rax)
lea    0xeb5(%rip),%rcx
mov    %rcx,0x10(%rax)
lea    0xeb0(%rip),%rcx
mov    %rcx,0x18(%rax)
lea    0xeab(%rip),%rcx
mov    %rcx,0x20(%rax)
lea    0xeaa(%rip),%r9
mov    %rax,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
push   $0x0
push   $0x4
call   1030 <token_exists@plt>
add    $0x10,%rsp
lea    0xe7a(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"URLPM\00"
@.str.1 = [6 x i8] c"XPRET\00"
@.str.2 = [6 x i8] c"GIAET\00"
@.str.3 = [6 x i8] c"XTNZY\00"
@.str.4 = [6 x i8] c"XOQRS\00"
@.str.5 = [4 x i8] c"%d\0A\00"
@.str.6 = [5 x i8] c"GIRL\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 @malloc(i32 40)
%8 = inttoptr i64 %7 to i8**
store i8** %8, i8*** %6
%9 = load i8**, i8*** %6
%10 = getelementptr inbounds i8*, i8** %9, i64 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %10
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %12
%13 = load i8**, i8*** %6
%14 = getelementptr inbounds i8*, i8** %13, i64 2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %14
%15 = load i8**, i8*** %6
%16 = getelementptr inbounds i8*, i8** %15, i64 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %16
%17 = load i8**, i8*** %6
%18 = getelementptr inbounds i8*, i8** %17, i64 4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %18
%19 = load i8**, i8*** %6
%20 = call i32 @token_exists(i8** %19, i32 5, i32 5, i32 2, i32 2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4, i32 0)
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"URLPM\00"
@.str.1 = [6 x i8] c"XPRET\00"
@.str.2 = [6 x i8] c"GIAET\00"
@.str.3 = [6 x i8] c"XTNZY\00"
@.str.4 = [6 x i8] c"XOQRS\00"
@.str.5 = [4 x i8] c"%d\0A\00"
@.str.6 = [5 x i8] c"GIRL\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 40)
%4 = inttoptr i64 %3 to i8**
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds i8*, i8** %4, i64 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds i8*, i8** %4, i64 2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds i8*, i8** %4, i64 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds i8*, i8** %4, i64 4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %8
%9 = tail call i32 @token_exists(i8** %4, i32 5, i32 5, i32 2, i32 2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4, i32 0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %9)
ret i32 0
}