#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__ exist(char **, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  if (argc < 3) {
    fprintf(stderr, "Usage: ./test word row1 row2...\n");
    exit(-1);
  }
  printf("%s\n", exist(argv + 2, argc - 2, strlen(argv[2]), argv[1]) ? "true"
                                                                     : "false");
  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)
cmpl   $0x3,-0x8(%rbp)
jge    118f <main+0x3f>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
call   1030 <exist@plt>
mov    %rax,%rcx
lea    0xe59(%rip),%rsi
lea    0xe4d(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe3a(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jle    11a8 <main+0x58>
mov    %rsi,%r14
mov    %edi,%ebx
lea    0x10(%rsi),%r15
add    $0xfffffffe,%ebx
mov    0x10(%rsi),%rdi
call   1040 <strlen@plt>
mov    0x8(%r14),%rcx
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <exist@plt>
test   %rax,%rax
lea    0xea1(%rip),%rax
lea    0xe95(%rip),%rsi
cmove  %rax,%rsi
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
lea    0xe48(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: ./test word row1 row2...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [6 x i8] c"false\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @strlen(i8* %19)
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i64 @exist(i8** %14, i32 %16, i32 %20, i8* %23)
%25 = icmp ne i64 %24, 0
%26 = zext i1 %25 to i64
%27 = select i1 %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %27)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: ./test word row1 row2...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [6 x i8] c"false\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = add nsw i32 %0, -2
%11 = load i8*, i8** %9
%12 = tail call i32 @strlen(i8* %11)
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i64 @exist(i8** %9, i32 %10, i32 %12, i8* %14)
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %17)
ret i32 0
}