#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 rbTree {
  int dummy;
};
struct genomeRangeTree {
  int dummy;
};

/* Variables and functions */
struct rbTree *genomeRangeTreeFindRangeTree(struct genomeRangeTree *, char *);
int rangeTreeOverlapSize(struct rbTree *, int, int);
int genomeRangeTreeOverlapSize(struct genomeRangeTree *tree, char *chrom,
                               int start, int end) {
  struct rbTree *t;
  return (t = genomeRangeTreeFindRangeTree(tree, chrom))
             ? rangeTreeOverlapSize(t, start, end)
             : 0;
}


x86 assembly (clang, -O0):
<genomeRangeTreeOverlapSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <genomeRangeTreeFindRangeTree@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1168 <genomeRangeTreeOverlapSize+0x48>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <rangeTreeOverlapSize@plt>
mov    %eax,-0x24(%rbp)
jmp    1172 <genomeRangeTreeOverlapSize+0x52>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1172 <genomeRangeTreeOverlapSize+0x52>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genomeRangeTreeOverlapSize>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
call   1040 <genomeRangeTreeFindRangeTree@plt>
test   %rax,%rax
je     1143 <genomeRangeTreeOverlapSize+0x23>
mov    %rax,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <rangeTreeOverlapSize@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.genomeRangeTree = type { i32 }
%struct.rbTree = type { i32 }
define i32 @genomeRangeTreeOverlapSize(%struct.genomeRangeTree* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.genomeRangeTree*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.rbTree*
store %struct.genomeRangeTree* %0, %struct.genomeRangeTree** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load %struct.genomeRangeTree*, %struct.genomeRangeTree** %5
%11 = load i8*, i8** %6
%12 = call %struct.rbTree* @genomeRangeTreeFindRangeTree(%struct.genomeRangeTree* %10, i8* %11)
store %struct.rbTree* %12, %struct.rbTree** %9
%13 = icmp ne %struct.rbTree* %12, null
br i1 %13, label %14, label %19
14: ; preds = %4
%15 = load %struct.rbTree*, %struct.rbTree** %9
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @rangeTreeOverlapSize(%struct.rbTree* %15, i32 %16, i32 %17)
br label %20
19: ; preds = %4
br label %20
20: ; preds = %19, %14
%21 = phi i32 [ %18, %14 ], [ 0, %19 ]
ret i32 %21
}

LLVM IR (-O2):
%struct.genomeRangeTree = type { i32 }
%struct.rbTree = type { i32 }
define i32 @genomeRangeTreeOverlapSize(%struct.genomeRangeTree* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call %struct.rbTree* @genomeRangeTreeFindRangeTree(%struct.genomeRangeTree* %0, i8* %1)
%6 = icmp eq %struct.rbTree* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @rangeTreeOverlapSize(%struct.rbTree* %5, i32 %2, i32 %3)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ 0, %4 ]
ret i32 %10
}