#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__ match_char(char **, char *);
scalar_t__ match_signed_integer(char **, void *);
bool match_sudirript(char **p, void *i64) {
  char *q = *p;
  return match_char(&q, "[") && match_signed_integer(&q, i64) &&
         match_char(&q, "]") && (*p = q);
}


x86 assembly (clang, -O0):
<match_sudirript>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1040 <match_char@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     11b3 <match_sudirript+0x93>
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdi
call   1030 <match_signed_integer@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     11b3 <match_sudirript+0x93>
lea    -0x18(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1040 <match_char@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     11b3 <match_sudirript+0x93>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_sudirript>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r15
mov    %rdi,%r14
mov    (%rdi),%rax
mov    %rax,0x8(%rsp)
lea    0xec2(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1040 <match_char@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1187 <match_sudirript+0x67>
lea    0x8(%rsp),%rdi
mov    %r15,%rsi
call   1030 <match_signed_integer@plt>
test   %rax,%rax
je     1187 <match_sudirript+0x67>
lea    0xe9a(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1040 <match_char@plt>
test   %rax,%rax
je     1187 <match_sudirript+0x67>
mov    0x8(%rsp),%rax
mov    %rax,(%r14)
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"[\00"
@.str.1 = [2 x i8] c"]\00"
define i32 @match_sudirript(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = call i64 @match_char(i8** %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i64 @match_signed_integer(i8** %5, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %10
%15 = call i64 @match_char(i8** %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i8*, i8** %5
%19 = load i8**, i8*** %3
store i8* %18, i8** %19
%20 = icmp ne i8* %18, null
br label %21
21: ; preds = %17, %14, %10, %2
%22 = phi i1 [ false, %14 ], [ false, %10 ], [ false, %2 ], [ %20, %17 ]
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
@.str = [2 x i8] c"[\00"
@.str.1 = [2 x i8] c"]\00"
define i32 @match_sudirript(i8** nocapture %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = load i8*, i8** %0
store i8* %5, i8** %3
%6 = call i64 @match_char(i8** %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %2
%9 = call i64 @match_signed_integer(i8** %3, i8* %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8
%12 = call i64 @match_char(i8** %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = load i8*, i8** %3
store i8* %15, i8** %0
%16 = icmp ne i8* %15, null
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %14, %11, %8, %2
%19 = phi i32 [ 0, %11 ], [ 0, %8 ], [ 0, %2 ], [ %17, %14 ]
ret i32 %19
}