#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 */
char *cloneString(char *);
int /*<<< orphan*/ freeMem(char *);
int twoBitIsFile(char *);
int twoBitParseRange(char *, char **, char **, int *, int *);
int twoBitIsRange(char *rangeSpec) {
  char *dupe = cloneString(rangeSpec);
  char *file, *seq;
  int start, end;
  int isRange = twoBitParseRange(dupe, &file, &seq, &start, &end);
  if (isRange)
    isRange = twoBitIsFile(file);
  freeMem(dupe);
  return isRange;
}


x86 assembly (clang, -O0):
<twoBitIsRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <cloneString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1060 <twoBitParseRange@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     118b <twoBitIsRange+0x4b>
mov    -0x18(%rbp),%rdi
call   1030 <twoBitIsFile@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <freeMem@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twoBitIsRange>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
call   1050 <cloneString@plt>
mov    %rax,%rbx
mov    %rsp,%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %rax,%rdi
call   1060 <twoBitParseRange@plt>
test   %eax,%eax
je     1179 <twoBitIsRange+0x39>
mov    (%rsp),%rdi
call   1030 <twoBitIsFile@plt>
mov    %eax,%ebp
jmp    117b <twoBitIsRange+0x3b>
xor    %ebp,%ebp
mov    %rbx,%rdi
call   1040 <freeMem@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @twoBitIsRange(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %2
%9 = load i8*, i8** %2
%10 = call i8* @cloneString(i8* %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @twoBitParseRange(i8* %11, i8** %4, i8** %5, i32* %6, i32* %7)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i8*, i8** %4
%17 = call i32 @twoBitIsFile(i8* %16)
store i32 %17, i32* %8
br label %18
18: ; preds = %15, %1
%19 = load i8*, i8** %3
%20 = call i32 @freeMem(i8* %19)
%21 = load i32, i32* %8
ret i32 %21
}

LLVM IR (-O2):
define i32 @twoBitIsRange(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = tail call i8* @cloneString(i8* %0)
%7 = bitcast i8** %2 to i8*
%8 = bitcast i8** %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = call i32 @twoBitParseRange(i8* %6, i8** %2, i8** %3, i32* %4, i32* %5)
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = call i32 @twoBitIsFile(i8* %14)
br label %16
16: ; preds = %13, %1
%17 = phi i32 [ %15, %13 ], [ 0, %1 ]
%18 = call i32 @freeMem(i8* %6)
ret i32 %17
}