#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__ cmpTwoBits32(int, int, int, int);
int cirTreeOverlaps(int qChrom, int qStart, int qEnd, int rStartChrom,
                    int rStartBase, int rEndChrom, int rEndBase) {
  return cmpTwoBits32(qChrom, qStart, rEndChrom, rEndBase) > 0 &&
         cmpTwoBits32(qChrom, qEnd, rStartChrom, rStartBase) < 0;
}


x86 assembly (clang, -O0):
<cirTreeOverlaps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    0x10(%rbp),%ecx
call   1030 <cmpTwoBits32@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jle    116d <cirTreeOverlaps+0x5d>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <cmpTwoBits32@plt>
cmp    $0x0,%rax
setl   %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):
<cirTreeOverlaps>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %edi,%ebp
mov    0x30(%rsp),%ecx
mov    %r9d,%edx
call   1030 <cmpTwoBits32@plt>
test   %rax,%rax
jle    1147 <cirTreeOverlaps+0x37>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1030 <cmpTwoBits32@plt>
shr    $0x3f,%rax
jmp    1149 <cirTreeOverlaps+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cirTreeOverlaps(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %13
%18 = load i32, i32* %14
%19 = call i64 @cmpTwoBits32(i32 %15, i32 %16, i32 %17, i32 %18)
%20 = icmp sgt i64 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %7
%22 = load i32, i32* %8
%23 = load i32, i32* %10
%24 = load i32, i32* %11
%25 = load i32, i32* %12
%26 = call i64 @cmpTwoBits32(i32 %22, i32 %23, i32 %24, i32 %25)
%27 = icmp slt i64 %26, 0
br label %28
28: ; preds = %21, %7
%29 = phi i1 [ false, %7 ], [ %27, %21 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @cirTreeOverlaps(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i64 @cmpTwoBits32(i32 %0, i32 %1, i32 %5, i32 %6)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = tail call i64 @cmpTwoBits32(i32 %0, i32 %2, i32 %3, i32 %4)
%12 = lshr i64 %11, 63
%13 = trunc i64 %12 to i32
br label %14
14: ; preds = %10, %7
%15 = phi i32 [ 0, %7 ], [ %13, %10 ]
ret i32 %15
}