#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 Plex {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ connectCubes(struct Plex *);
int /*<<< orphan*/ inoroutCubes(struct Plex *);
int /*<<< orphan*/ markSurfaceCubes(struct Plex *);
int /*<<< orphan*/ numberCubes(struct Plex *);
int /*<<< orphan*/ numberRoots(struct Plex *);
int classifyCubes(struct Plex *plex) {
  if (!markSurfaceCubes(plex))
    return (0);
  if (!connectCubes(plex))
    return (0);
  if (!numberRoots(plex))
    return (0);
  if (!numberCubes(plex))
    return (0);
  if (!inoroutCubes(plex))
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<classifyCubes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <markSurfaceCubes@plt>
cmp    $0x0,%eax
jne    117a <classifyCubes+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    11f9 <classifyCubes+0xa9>
mov    -0x10(%rbp),%rdi
call   1050 <connectCubes@plt>
cmp    $0x0,%eax
jne    1198 <classifyCubes+0x48>
movl   $0x0,-0x4(%rbp)
jmp    11f9 <classifyCubes+0xa9>
mov    -0x10(%rbp),%rdi
call   1040 <numberRoots@plt>
cmp    $0x0,%eax
jne    11b6 <classifyCubes+0x66>
movl   $0x0,-0x4(%rbp)
jmp    11f9 <classifyCubes+0xa9>
mov    -0x10(%rbp),%rdi
call   1030 <numberCubes@plt>
cmp    $0x0,%eax
jne    11d4 <classifyCubes+0x84>
movl   $0x0,-0x4(%rbp)
jmp    11f9 <classifyCubes+0xa9>
mov    -0x10(%rbp),%rdi
call   1060 <inoroutCubes@plt>
cmp    $0x0,%eax
jne    11f2 <classifyCubes+0xa2>
movl   $0x0,-0x4(%rbp)
jmp    11f9 <classifyCubes+0xa9>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<classifyCubes>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1070 <markSurfaceCubes@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     1195 <classifyCubes+0x45>
mov    %rbx,%rdi
call   1050 <connectCubes@plt>
test   %eax,%eax
je     1195 <classifyCubes+0x45>
mov    %rbx,%rdi
call   1040 <numberRoots@plt>
test   %eax,%eax
je     1195 <classifyCubes+0x45>
mov    %rbx,%rdi
call   1030 <numberCubes@plt>
test   %eax,%eax
je     1195 <classifyCubes+0x45>
mov    %rbx,%rdi
call   1060 <inoroutCubes@plt>
xor    %ebp,%ebp
test   %eax,%eax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.Plex = type { i32 }
define i32 @classifyCubes(%struct.Plex* %0) {
%2 = alloca i32
%3 = alloca %struct.Plex*
store %struct.Plex* %0, %struct.Plex** %3
%4 = load %struct.Plex*, %struct.Plex** %3
%5 = call i32 @markSurfaceCubes(%struct.Plex* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %29
8: ; preds = %1
%9 = load %struct.Plex*, %struct.Plex** %3
%10 = call i32 @connectCubes(%struct.Plex* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
store i32 0, i32* %2
br label %29
13: ; preds = %8
%14 = load %struct.Plex*, %struct.Plex** %3
%15 = call i32 @numberRoots(%struct.Plex* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
store i32 0, i32* %2
br label %29
18: ; preds = %13
%19 = load %struct.Plex*, %struct.Plex** %3
%20 = call i32 @numberCubes(%struct.Plex* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %18
store i32 0, i32* %2
br label %29
23: ; preds = %18
%24 = load %struct.Plex*, %struct.Plex** %3
%25 = call i32 @inoroutCubes(%struct.Plex* %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %23
store i32 0, i32* %2
br label %29
28: ; preds = %23
store i32 1, i32* %2
br label %29
29: ; preds = %28, %27, %22, %17, %12, %7
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
%struct.Plex = type { i32 }
define i32 @classifyCubes(%struct.Plex* %0) {
%2 = tail call i32 @markSurfaceCubes(%struct.Plex* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1
%5 = tail call i32 @connectCubes(%struct.Plex* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %4
%8 = tail call i32 @numberRoots(%struct.Plex* %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %7
%11 = tail call i32 @numberCubes(%struct.Plex* %0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %10
%14 = tail call i32 @inoroutCubes(%struct.Plex* %0)
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %13, %10, %7, %4, %1
%18 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 0, %7 ], [ 0, %10 ], [ %16, %13 ]
ret i32 %18
}