#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 twoBitFile {
  int dummy;
};
struct dnaSeq {
  int dummy;
};
typedef int /*<<< orphan*/ path;

/* Variables and functions */
struct dnaSeq *nibLoadAllMasked(int, char *);
int /*<<< orphan*/ safef(char *, int, char *, char *, char *);
int /*<<< orphan*/ twoBitClose(struct twoBitFile **);
scalar_t__ twoBitIsFile(char *);
struct twoBitFile *twoBitOpen(char *);
struct dnaSeq *twoBitReadSeqFrag(struct twoBitFile *, char *,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
struct dnaSeq *nibTwoLoadOne(char *pathName, char *seqName) {
  struct dnaSeq *seq;
  if (twoBitIsFile(pathName)) {
    struct twoBitFile *tbf = twoBitOpen(pathName);
    seq = twoBitReadSeqFrag(tbf, seqName, 0, 0);
    twoBitClose(&tbf);
  } else {
    char path[512];
    safef(path, sizeof(path), "%s/%s.nib", pathName, seqName);
    seq = nibLoadAllMasked(0x01, path);
  }
  return seq;
}


x86 assembly (clang, -O0):
<nibTwoLoadOne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <twoBitIsFile@plt>
cmp    $0x0,%rax
je     11b6 <nibTwoLoadOne+0x56>
mov    -0x8(%rbp),%rdi
call   1030 <twoBitOpen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1060 <twoBitReadSeqFrag@plt>
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1070 <twoBitClose@plt>
jmp    11eb <nibTwoLoadOne+0x8b>
lea    -0x220(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x200,%esi
lea    0xe2f(%rip),%rdx
call   1050 <safef@plt>
lea    -0x220(%rbp),%rsi
mov    $0x1,%edi
call   1080 <nibLoadAllMasked@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibTwoLoadOne>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <twoBitIsFile@plt>
test   %rax,%rax
je     11a7 <nibTwoLoadOne+0x47>
mov    %rbx,%rdi
call   1030 <twoBitOpen@plt>
mov    %rax,(%rsp)
mov    %rax,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <twoBitReadSeqFrag@plt>
mov    %rax,%rbx
mov    %rsp,%rdi
call   1070 <twoBitClose@plt>
mov    %rbx,%rax
jmp    11d1 <nibTwoLoadOne+0x71>
lea    0xe52(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x200,%esi
mov    %rbx,%rcx
mov    %r14,%r8
call   1050 <safef@plt>
mov    $0x1,%edi
mov    %r15,%rsi
call   1080 <nibLoadAllMasked@plt>
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.dnaSeq = type { i32 }
%struct.twoBitFile = type { i32 }
@.str = [10 x i8] c"%s/%s.nib\00"
define %struct.dnaSeq* @nibTwoLoadOne(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.dnaSeq*
%6 = alloca %struct.twoBitFile*
%7 = alloca [512 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i64 @twoBitIsFile(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call %struct.twoBitFile* @twoBitOpen(i8* %12)
store %struct.twoBitFile* %13, %struct.twoBitFile** %6
%14 = load %struct.twoBitFile*, %struct.twoBitFile** %6
%15 = load i8*, i8** %4
%16 = call %struct.dnaSeq* @twoBitReadSeqFrag(%struct.twoBitFile* %14, i8* %15, i32 0, i32 0)
store %struct.dnaSeq* %16, %struct.dnaSeq** %5
%17 = call i32 @twoBitClose(%struct.twoBitFile** %6)
br label %25
18: ; preds = %2
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%20 = load i8*, i8** %3
%21 = load i8*, i8** %4
%22 = call i32 @safef(i8* %19, i32 512, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %20, i8* %21)
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%24 = call %struct.dnaSeq* @nibLoadAllMasked(i32 1, i8* %23)
store %struct.dnaSeq* %24, %struct.dnaSeq** %5
br label %25
25: ; preds = %18, %11
%26 = load %struct.dnaSeq*, %struct.dnaSeq** %5
ret %struct.dnaSeq* %26
}

LLVM IR (-O2):
%struct.dnaSeq = type { i32 }
%struct.twoBitFile = type { i32 }
@.str = [10 x i8] c"%s/%s.nib\00"
define %struct.dnaSeq* @nibTwoLoadOne(i8* %0, i8* %1) {
%3 = alloca %struct.twoBitFile*
%4 = alloca [512 x i8]
%5 = tail call i64 @twoBitIsFile(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = bitcast %struct.twoBitFile** %3 to i8*
%9 = tail call %struct.twoBitFile* @twoBitOpen(i8* %0)
store %struct.twoBitFile* %9, %struct.twoBitFile** %3
%10 = tail call %struct.dnaSeq* @twoBitReadSeqFrag(%struct.twoBitFile* %9, i8* %1, i32 0, i32 0)
%11 = call i32 @twoBitClose(%struct.twoBitFile** %3)
br label %16
12: ; preds = %2
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%14 = call i32 @safef(i8* %13, i32 512, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%15 = call %struct.dnaSeq* @nibLoadAllMasked(i32 1, i8* %13)
br label %16
16: ; preds = %12, %7
%17 = phi %struct.dnaSeq* [ %10, %7 ], [ %15, %12 ]
ret %struct.dnaSeq* %17
}