#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 _test(int, char **);
int _usage();
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc == 1)
    return 1;
  if (strcmp(argv[0], "[") == 0)
    if (strcmp(argv[--argc], "]") != 0)
      return _usage();
  return _test(argc - 1, argv + 1);
}


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   $0x1,-0x8(%rbp)
jne    115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11cd <main+0x9d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe96(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11b7 <main+0x87>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe6e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11b2 <main+0x82>
mov    $0x0,%al
call   1030 <_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    11cd <main+0x9d>
jmp    11b7 <main+0x87>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1050 <_test@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
cmp    $0x1,%edi
jne    1144 <main+0x14>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
lea    0xead(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1174 <main+0x44>
add    $0xffffffff,%ebp
add    $0x8,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <_test@plt>
movslq %ebp,%rax
mov    -0x8(%rbx,%rax,8),%rdi
lea    0xe7f(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     119a <main+0x6a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_usage@plt>
add    $0xffffffff,%ebp
jmp    115d <main+0x2d>

LLVM IR (-O0):
@.str = [2 x i8] c"[\00"
@.str.1 = [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 eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %33
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %9
%16 = load i8**, i8*** %5
%17 = load i32, i32* %4
%18 = add nsw i32 %17, -1
store i32 %18, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %16, i64 %19
%21 = load i8*, i8** %20
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %15
%25 = call i32 (...) @_usage()
store i32 %25, i32* %3
br label %33
26: ; preds = %15
br label %27
27: ; preds = %26, %9
%28 = load i32, i32* %4
%29 = sub nsw i32 %28, 1
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = call i32 @_test(i32 %29, i8** %31)
store i32 %32, i32* %3
br label %33
33: ; preds = %27, %24, %8
%34 = load i32, i32* %3
ret i32 %34
}

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