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

/* Variables and functions */
scalar_t__ EQ(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ NEXT(struct bb *);
scalar_t__ NumIN(struct bb *, int);
int isIfElse(struct bb *t, struct bb *e, int nt, int ne) {
  return EQ(NEXT(t), NEXT(e)) && NumIN(t, nt) && NumIN(e, ne);
}


x86 assembly (clang, -O0):
<isIfElse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <NEXT@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <NEXT@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1050 <EQ@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     11ab <isIfElse+0x7b>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <NumIN@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     11ab <isIfElse+0x7b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <NumIN@plt>
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):
<isIfElse>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%r12
mov    %rdi,%rbx
call   1040 <NEXT@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1040 <NEXT@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <EQ@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1187 <isIfElse+0x57>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1030 <NumIN@plt>
test   %rax,%rax
je     1187 <isIfElse+0x57>
mov    %r12,%rdi
mov    %r14d,%esi
call   1030 <NumIN@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.bb = type { i32 }
define i32 @isIfElse(%struct.bb* %0, %struct.bb* %1, i32 %2, i32 %3) {
%5 = alloca %struct.bb*
%6 = alloca %struct.bb*
%7 = alloca i32
%8 = alloca i32
store %struct.bb* %0, %struct.bb** %5
store %struct.bb* %1, %struct.bb** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.bb*, %struct.bb** %5
%10 = call i32 @NEXT(%struct.bb* %9)
%11 = load %struct.bb*, %struct.bb** %6
%12 = call i32 @NEXT(%struct.bb* %11)
%13 = call i64 @EQ(i32 %10, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %4
%16 = load %struct.bb*, %struct.bb** %5
%17 = load i32, i32* %7
%18 = call i64 @NumIN(%struct.bb* %16, i32 %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = load %struct.bb*, %struct.bb** %6
%22 = load i32, i32* %8
%23 = call i64 @NumIN(%struct.bb* %21, i32 %22)
%24 = icmp ne i64 %23, 0
br label %25
25: ; preds = %20, %15, %4
%26 = phi i1 [ false, %15 ], [ false, %4 ], [ %24, %20 ]
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
%struct.bb = type { i32 }
define i32 @isIfElse(%struct.bb* %0, %struct.bb* %1, i32 %2, i32 %3) {
%5 = tail call i32 @NEXT(%struct.bb* %0)
%6 = tail call i32 @NEXT(%struct.bb* %1)
%7 = tail call i64 @EQ(i32 %5, i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %4
%10 = tail call i64 @NumIN(%struct.bb* %0, i32 %2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = tail call i64 @NumIN(%struct.bb* %1, i32 %3)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %12, %9, %4
%17 = phi i32 [ 0, %9 ], [ 0, %4 ], [ %15, %12 ]
ret i32 %17
}