#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 */
struct obj {
  int dummy;
};

/* Variables and functions */
scalar_t__ colon();
scalar_t__ dot();
scalar_t__ lbracket();
int length(struct obj *);
scalar_t__ name(struct obj *);
scalar_t__ qmark(struct obj *);
scalar_t__ type(struct obj *);
int decl(struct obj *obj) {
  return name(obj) && colon() && type(obj) && (lbracket() ? length(obj) : 1) &&
         (dot() || qmark(obj));
}


x86 assembly (clang, -O0):
<decl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <name@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1241 <decl+0xd1>
mov    $0x0,%al
call   1070 <colon@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1241 <decl+0xd1>
mov    -0x8(%rbp),%rdi
call   1050 <type@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1241 <decl+0xd1>
mov    $0x0,%al
call   1090 <lbracket@plt>
cmp    $0x0,%rax
je     11fa <decl+0x8a>
mov    -0x8(%rbp),%rdi
call   1040 <length@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    120f <decl+0x9f>
jmp    1241 <decl+0xd1>
xor    %eax,%eax
mov    $0x1,%cl
test   $0x1,%cl
mov    %al,-0x9(%rbp)
jne    120f <decl+0x9f>
jmp    1241 <decl+0xd1>
mov    $0x0,%al
call   1030 <dot@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
jne    123b <decl+0xcb>
mov    -0x8(%rbp),%rdi
call   1080 <qmark@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decl>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <name@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     11d7 <decl+0x67>
xor    %eax,%eax
call   1070 <colon@plt>
test   %rax,%rax
je     11d7 <decl+0x67>
mov    %rbx,%rdi
call   1050 <type@plt>
test   %rax,%rax
je     11d7 <decl+0x67>
xor    %ebp,%ebp
xor    %eax,%eax
call   1090 <lbracket@plt>
test   %rax,%rax
je     11b5 <decl+0x45>
mov    %rbx,%rdi
call   1040 <length@plt>
test   %eax,%eax
je     11d7 <decl+0x67>
xor    %eax,%eax
call   1030 <dot@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    11d7 <decl+0x67>
mov    %rbx,%rdi
call   1080 <qmark@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.obj = type { i32 }
define i32 @decl(%struct.obj* %0) {
%2 = alloca %struct.obj*
store %struct.obj* %0, %struct.obj** %2
%3 = load %struct.obj*, %struct.obj** %2
%4 = call i64 @name(%struct.obj* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %30
6: ; preds = %1
%7 = call i64 (...) @colon()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load %struct.obj*, %struct.obj** %2
%11 = call i64 @type(%struct.obj* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %30
13: ; preds = %9
%14 = call i64 (...) @lbracket()
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load %struct.obj*, %struct.obj** %2
%18 = call i32 @length(%struct.obj* %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %30
20: ; preds = %13
br i1 true, label %21, label %30
21: ; preds = %20, %16
%22 = call i64 (...) @dot()
%23 = icmp ne i64 %22, 0
br i1 %23, label %28, label %24
24: ; preds = %21
%25 = load %struct.obj*, %struct.obj** %2
%26 = call i64 @qmark(%struct.obj* %25)
%27 = icmp ne i64 %26, 0
br label %28
28: ; preds = %24, %21
%29 = phi i1 [ true, %21 ], [ %27, %24 ]
br label %30
30: ; preds = %28, %20, %16, %9, %6, %1
%31 = phi i1 [ false, %20 ], [ false, %16 ], [ false, %9 ], [ false, %6 ], [ false, %1 ], [ %29, %28 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
%struct.obj = type { i32 }
define i32 @decl(%struct.obj* %0) {
%2 = tail call i64 @name(%struct.obj* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %23, label %4
4: ; preds = %1
%5 = tail call i64 (...) @colon()
%6 = icmp eq i64 %5, 0
br i1 %6, label %23, label %7
7: ; preds = %4
%8 = tail call i64 @type(%struct.obj* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %23, label %10
10: ; preds = %7
%11 = tail call i64 (...) @lbracket()
%12 = icmp eq i64 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = tail call i32 @length(%struct.obj* %0)
%15 = icmp eq i32 %14, 0
br i1 %15, label %23, label %16
16: ; preds = %10, %13
%17 = tail call i64 (...) @dot()
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = tail call i64 @qmark(%struct.obj* %0)
%21 = icmp ne i64 %20, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %16, %19, %13, %7, %4, %1
%24 = phi i32 [ 0, %13 ], [ 0, %7 ], [ 0, %4 ], [ 0, %1 ], [ 1, %16 ], [ %22, %19 ]
ret i32 %24
}