#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 */
char F_FstC(char *, char **);
int F_GetV(char *, char *);
char F_LstC(char *);
scalar_t__ strlen(char *);
scalar_t__ strncmp(char *, char *, scalar_t__);
int F_CkE(char *str, int t, char *nm, char *v) {
  char *n;
  if (strlen(str) == 0)
    return 0;
  if (t & 0x0004) {
    F_FstC(str, &n);
    if (strncmp(nm, n, strlen(nm)))
      return 0;
    if (v != 0)
      return F_GetV(str, v);
    else
      return 0;
  } else if (t & 0x0001) {
    F_FstC(str, &n);
    if (!strncmp(nm, n, strlen(nm)))
      return 1;
  } else if (t & 0x0002 && F_FstC(str, 0) == '(' && F_LstC(str) == ')')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<F_CkE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jne    1186 <F_CkE+0x36>
movl   $0x0,-0x4(%rbp)
jmp    12c7 <F_CkE+0x177>
mov    -0x14(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     120d <F_CkE+0xbd>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <F_FstC@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     11e1 <F_CkE+0x91>
movl   $0x0,-0x4(%rbp)
jmp    12c7 <F_CkE+0x177>
cmpq   $0x0,-0x28(%rbp)
je     1201 <F_CkE+0xb1>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1070 <F_GetV@plt>
mov    %eax,-0x4(%rbp)
jmp    12c7 <F_CkE+0x177>
movl   $0x0,-0x4(%rbp)
jmp    12c7 <F_CkE+0x177>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     126d <F_CkE+0x11d>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <F_FstC@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1268 <F_CkE+0x118>
movl   $0x1,-0x4(%rbp)
jmp    12c7 <F_CkE+0x177>
jmp    12bb <F_CkE+0x16b>
mov    -0x14(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     12b6 <F_CkE+0x166>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <F_FstC@plt>
movsbl %al,%eax
cmp    $0x28,%eax
jne    12b6 <F_CkE+0x166>
mov    -0x10(%rbp),%rdi
call   1050 <F_LstC@plt>
movsbl %al,%eax
cmp    $0x29,%eax
jne    12b6 <F_CkE+0x166>
movl   $0x1,-0x4(%rbp)
jmp    12c7 <F_CkE+0x177>
jmp    12bb <F_CkE+0x16b>
jmp    12c0 <F_CkE+0x170>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_CkE>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
xor    %ebp,%ebp
cmpb   $0x0,(%rdi)
je     121b <F_CkE+0xcb>
mov    %rdx,%r14
mov    %rdi,%rbx
test   $0x4,%sil
jne    11a8 <F_CkE+0x58>
test   $0x1,%sil
jne    11ec <F_CkE+0x9c>
test   $0x2,%sil
je     1219 <F_CkE+0xc9>
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <F_FstC@plt>
cmp    $0x28,%al
jne    1219 <F_CkE+0xc9>
mov    %rbx,%rdi
call   1050 <F_LstC@plt>
mov    $0x1,%ebp
cmp    $0x29,%al
jne    1219 <F_CkE+0xc9>
jmp    121b <F_CkE+0xcb>
mov    %rcx,%r15
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <F_FstC@plt>
mov    0x8(%rsp),%r12
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
test   %r15,%r15
je     121b <F_CkE+0xcb>
test   %rax,%rax
jne    121b <F_CkE+0xcb>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <F_GetV@plt>
mov    %eax,%ebp
jmp    121b <F_CkE+0xcb>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <F_FstC@plt>
mov    0x8(%rsp),%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
test   %rax,%rax
je     122a <F_CkE+0xda>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebp
jmp    121b <F_CkE+0xcb>

LLVM IR (-O0):
define i32 @F_CkE(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%11 = load i8*, i8** %6
%12 = call i64 @strlen(i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %4
store i32 0, i32* %5
br label %70
15: ; preds = %4
%16 = load i32, i32* %7
%17 = and i32 %16, 4
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %37
19: ; preds = %15
%20 = load i8*, i8** %6
%21 = call signext i8 @F_FstC(i8* %20, i8** %10)
%22 = load i8*, i8** %8
%23 = load i8*, i8** %10
%24 = load i8*, i8** %8
%25 = call i64 @strlen(i8* %24)
%26 = call i64 @strncmp(i8* %22, i8* %23, i64 %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %19
store i32 0, i32* %5
br label %70
29: ; preds = %19
%30 = load i8*, i8** %9
%31 = icmp ne i8* %30, null
br i1 %31, label %32, label %36
32: ; preds = %29
%33 = load i8*, i8** %6
%34 = load i8*, i8** %9
%35 = call i32 @F_GetV(i8* %33, i8* %34)
store i32 %35, i32* %5
br label %70
36: ; preds = %29
store i32 0, i32* %5
br label %70
37: ; preds = %15
%38 = load i32, i32* %7
%39 = and i32 %38, 1
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %52
41: ; preds = %37
%42 = load i8*, i8** %6
%43 = call signext i8 @F_FstC(i8* %42, i8** %10)
%44 = load i8*, i8** %8
%45 = load i8*, i8** %10
%46 = load i8*, i8** %8
%47 = call i64 @strlen(i8* %46)
%48 = call i64 @strncmp(i8* %44, i8* %45, i64 %47)
%49 = icmp ne i64 %48, 0
br i1 %49, label %51, label %50
50: ; preds = %41
store i32 1, i32* %5
br label %70
51: ; preds = %41
br label %68
52: ; preds = %37
%53 = load i32, i32* %7
%54 = and i32 %53, 2
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %67
56: ; preds = %52
%57 = load i8*, i8** %6
%58 = call signext i8 @F_FstC(i8* %57, i8** null)
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 40
br i1 %60, label %61, label %67
61: ; preds = %56
%62 = load i8*, i8** %6
%63 = call signext i8 @F_LstC(i8* %62)
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %64, 41
br i1 %65, label %66, label %67
66: ; preds = %61
store i32 1, i32* %5
br label %70
67: ; preds = %61, %56, %52
br label %68
68: ; preds = %67, %51
br label %69
69: ; preds = %68
store i32 0, i32* %5
br label %70
70: ; preds = %69, %66, %50, %36, %32, %28, %14
%71 = load i32, i32* %5
ret i32 %71
}

LLVM IR (-O2):
define i32 @F_CkE(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = bitcast i8** %5 to i8*
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %41, label %9
9: ; preds = %4
%10 = and i32 %1, 4
%11 = icmp eq i32 %10, 0
br i1 %11, label %22, label %12
12: ; preds = %9
%13 = call signext i8 @F_FstC(i8* %0, i8** %5)
%14 = load i8*, i8** %5
%15 = call i64 @strlen(i8* dereferenceable(1) %2)
%16 = call i64 @strncmp(i8* %2, i8* %14, i64 %15)
%17 = icmp ne i64 %16, 0
%18 = icmp eq i8* %3, null
%19 = or i1 %18, %17
br i1 %19, label %41, label %20
20: ; preds = %12
%21 = call i32 @F_GetV(i8* %0, i8* %3)
br label %41
22: ; preds = %9
%23 = and i32 %1, 1
%24 = icmp eq i32 %23, 0
br i1 %24, label %31, label %25
25: ; preds = %22
%26 = call signext i8 @F_FstC(i8* %0, i8** %5)
%27 = load i8*, i8** %5
%28 = call i64 @strlen(i8* dereferenceable(1) %2)
%29 = call i64 @strncmp(i8* %2, i8* %27, i64 %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %41, label %40
31: ; preds = %22
%32 = and i32 %1, 2
%33 = icmp eq i32 %32, 0
br i1 %33, label %40, label %34
34: ; preds = %31
%35 = tail call signext i8 @F_FstC(i8* %0, i8** null)
%36 = icmp eq i8 %35, 40
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = tail call signext i8 @F_LstC(i8* %0)
%39 = icmp eq i8 %38, 41
br i1 %39, label %41, label %40
40: ; preds = %25, %37, %34, %31
br label %41
41: ; preds = %37, %25, %12, %4, %40, %20
%42 = phi i32 [ %21, %20 ], [ 0, %40 ], [ 0, %4 ], [ 0, %12 ], [ 1, %25 ], [ 1, %37 ]
ret i32 %42
}