#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 isprefix(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  if (argc < 3) {
    usage();
  }
  if (strcmp(argv[1], "!")) {
    return !isprefix(argv[1], argv[2]);
  } else {
    if (argc < 4) {
      usage();
    }
    return isprefix(argv[2], argv[3]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1157 <main+0x27>
mov    $0x0,%al
call   1050 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     119f <main+0x6f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <isprefix@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11c8 <main+0x98>
cmpl   $0x4,-0x8(%rbp)
jge    11b0 <main+0x80>
mov    $0x0,%al
call   1050 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1030 <isprefix@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x2,%edi
jg     1144 <main+0x14>
xor    %eax,%eax
call   1050 <usage@plt>
mov    0x8(%rbx),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1176 <main+0x46>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1030 <isprefix@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
cmp    $0x3,%ebp
jg     1182 <main+0x52>
xor    %eax,%eax
call   1050 <usage@plt>
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <isprefix@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"!\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 %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %27
16: ; preds = %10
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = call i32 @isprefix(i8* %19, i8* %22)
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
store i32 %26, i32* %3
br label %40
27: ; preds = %10
%28 = load i32, i32* %4
%29 = icmp slt i32 %28, 4
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (...) @usage()
br label %32
32: ; preds = %30, %27
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 3
%38 = load i8*, i8** %37
%39 = call i32 @isprefix(i8* %35, i8* %38)
store i32 %39, i32* %3
br label %40
40: ; preds = %32, %16
%41 = load i32, i32* %3
ret i32 %41
}

LLVM IR (-O2):
@.str = [2 x i8] c"!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %6
%12 = load i8*, i8** %7
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i32 @isprefix(i8* %12, i8* %14)
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
br label %28
18: ; preds = %6
%19 = icmp slt i32 %0, 4
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = tail call i32 (...) @usage()
br label %22
22: ; preds = %20, %18
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = getelementptr inbounds i8*, i8** %1, i64 3
%26 = load i8*, i8** %25
%27 = tail call i32 @isprefix(i8* %24, i8* %26)
br label %28
28: ; preds = %22, %11
%29 = phi i32 [ %17, %11 ], [ %27, %22 ]
ret i32 %29
}