LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ArchLuke[P]YouSuck/Knight.c
// Function: EvalWhiteKnight
int EvalWhiteKnight(const S_BOARD *pos)
{

	int pceNum, index, sq, sq64, score=0;
	//loop through all the knights
	for(pceNum = 0; pceNum < pos->pceNum[wN]; ++pceNum) {
		sq = pos->pList[wN][pceNum];
		sq64=SQ64(sq);
//knight mobility
		//knight center control check
		score += KnightTable[sq64];
		//knight mobility check
		
		int squares=KnightMobility[sq64]-
			CountBits(WhiteKnightMobilityMask[sq64] & pos->pawns[BLACK]);
		score += (knightMobility*squares);
//knight outpost using bitmasks
		 //the knight needs to be in the enemy half of the board
		if(RanksBrd[sq]>RANK_4)
		{
			//no opposing black pawns to push the knight away, and the knight is supported by a white pawn
			if((pos->pawns[BLACK] & WhiteOutpostMask[sq64])==0 && 
			((WhitePawnSupportMask[sq64] & pos->pawns[WHITE]) != 0))
			{
				//add bonus to this knight for having an outpost
				score += outpost;
			}
		}

				
		
	}
	return score;
}

// Assembly:
cmpl $0x0, 0x230(%rdi)
jle 0x5f59
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %eax, %eax
movslq 0xc2c0(%rbx,%r14,4), %r13
leaq 0x5a11(%rip), %rcx      # 0xb8d0
movslq (%rcx,%r13,4), %r12
movl %eax, %ebp
leaq 0x2194(%rip), %rax      # 0x8060
addl (%rax,%r12,4), %ebp
leaq 0x1c0e9(%rip), %rax     # 0x21fc0
movl (%rax,%r12,4), %r15d
movq 0x1e8(%rbx), %rdi
leaq 0x1d257(%rip), %rax     # 0x23140
andq (%rax,%r12,8), %rdi
callq 0x125c
subl %eax, %r15d
leal (%r15,%r15,2), %eax
addl %ebp, %eax
leaq 0x1df3e(%rip), %rcx     # 0x23e40
cmpl $0x4, (%rcx,%r13,4)
jl 0x5f37
leaq 0x1d430(%rip), %rcx     # 0x23340
movq (%rcx,%r12,8), %rcx
testq %rcx, 0x1e8(%rbx)
jne 0x5f37
movq 0x1e0(%rbx), %rcx
leaq 0x1d815(%rip), %rdx     # 0x23740
testq %rcx, (%rdx,%r12,8)
leal 0xf(%rax), %ecx
cmovel %eax, %ecx
movl %ecx, %eax
incq %r14
movslq 0x230(%rbx), %rcx
cmpq %rcx, %r14
jl 0x5eb0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ArchLuke[P]YouSuck/Knight.c
// Function: EvalBlackKnight
int EvalBlackKnight(const S_BOARD *pos)
{
	int pceNum, index, sq, sq64, score=0;
//loop through all the knights
	for(pceNum = 0; pceNum < pos->pceNum[bN]; ++pceNum) {
		sq = pos->pList[bN][pceNum];
		sq64=SQ64(sq);
//knight mobility
		//knight center control check
		score += KnightTable[sq64];
		//knight mobility check
		
		int squares=KnightMobility[sq64]-
			CountBits(BlackKnightMobilityMask[sq64] & pos->pawns[WHITE]);
		score += (knightMobility*squares);	
//knight outpost using bitmasks
		 //the knight needs to be in the enemy half of the board
		if(RanksBrd[sq]<RANK_5)
		{
			//no opposing black pawns to push the knight away, and the knight is supported by a white pawn
			if((pos->pawns[WHITE] & BlackOutpostMask[sq64])==0 && 
			((BlackPawnSupportMask[sq64] & pos->pawns[BLACK]) != 0))
			{
				//add bonus to this knight for having an outpost
				score += outpost;
			}
		}

				
		
	}
	return -score;
}

// Assembly:
cmpl $0x0, 0x248(%rdi)
jle 0x6026
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %eax, %eax
movslq 0xc3b0(%rbx,%r14,4), %r13
leaq 0x5945(%rip), %rcx      # 0xb8d0
movslq (%rcx,%r13,4), %r12
movl %eax, %ebp
leaq 0x20c8(%rip), %rax      # 0x8060
addl (%rax,%r12,4), %ebp
leaq 0x1c01d(%rip), %rax     # 0x21fc0
movl (%rax,%r12,4), %r15d
movq 0x1e0(%rbx), %rdi
leaq 0x1c30b(%rip), %rax     # 0x222c0
andq (%rax,%r12,8), %rdi
callq 0x125c
subl %eax, %r15d
leal (%r15,%r15,2), %eax
addl %ebp, %eax
leaq 0x1de72(%rip), %rcx     # 0x23e40
cmpl $0x3, (%rcx,%r13,4)
jg 0x6003
leaq 0x1c4e4(%rip), %rcx     # 0x224c0
movq (%rcx,%r12,8), %rcx
testq %rcx, 0x1e0(%rbx)
jne 0x6003
movq 0x1e8(%rbx), %rcx
leaq 0x1c8c9(%rip), %rdx     # 0x228c0
testq %rcx, (%rdx,%r12,8)
leal 0xf(%rax), %ecx
cmovel %eax, %ecx
movl %ecx, %eax
incq %r14
movslq 0x248(%rbx), %rcx
cmpq %rcx, %r14
jl 0x5f7c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6028
xorl %eax, %eax
negl %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ArchLuke[P]YouSuck/Bishop.c
// Function: EvalWhiteBishop
int EvalWhiteBishop(const S_BOARD *pos)
{
	int pceNum;
	int sq;
	int index;
	int score=0;
//loop through all the white bishops
	for(pceNum = 0; pceNum < pos->pceNum[wB]; ++pceNum) {
		int mobility=7;
		sq = pos->pList[wB][pceNum];
		int sq64=SQ64(sq);
//the bishop should be on diagonals that control the center
		score += BishopTable[sq64];
		
		//check the diagonal influences
		U64 mask=WhiteBishopForwardMask[sq64][0] & pos->pawns[BOTH];	
		if(mask)
		{
			//int square=(63-__builtin_ctzll(mask));
			int square=FindBit(mask);
			mobility -= (WhiteMaxDiagonalDistance[sq64][0]-DiagonalDistance[sq][square]);
				
		}
 
		U64 mask2=WhiteBishopForwardMask[sq64][1] & pos->pawns[BOTH];		
		if(mask2)
		{
			//int square=(63-__builtin_ctzll(mask));
			int square=FindBit(mask2);
			mobility -= (WhiteMaxDiagonalDistance[sq64][1]-DiagonalDistance[sq64][square]);
		}
		score += mobility * bishopMobility;
		
				
	}
	//bishop pair
	if(pos->pceNum[wB]>1)
		score += BishopPair;

	return score;	
}

// Assembly:
cmpl $0x0, 0x234(%rdi)
jle 0x612b
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r12d, %r12d
movslq 0xc2e8(%rbx,%r14,4), %r13
leaq 0x5874(%rip), %rax      # 0xb8d0
movslq (%rax,%r13,4), %rbp
leaq 0x2109(%rip), %rax      # 0x8170
addl (%rax,%rbp,4), %r12d
movq %rbp, %r15
shlq $0x4, %r15
movq 0x1f0(%rbx), %rdi
leaq 0x5440(%rip), %rax      # 0xb4c0
movq (%rax,%r15), %rax
andq %rdi, %rax
je 0x60bb
movq %rax, %rdi
callq 0x126f
cltq
shlq $0x8, %r13
addq 0x4f32(%rip), %r13      # 0xafd0
movl (%r13,%rax,4), %r13d
leaq 0x1c016(%rip), %rax     # 0x220c0
subl (%rax,%rbp,8), %r13d
addl $0x7, %r13d
movq 0x1f0(%rbx), %rdi
jmp 0x60c1
movl $0x7, %r13d
addq 0x4f10(%rip), %r15      # 0xafd8
andq 0x8(%r15), %rdi
je 0x60f3
callq 0x126f
cltq
movq %rbp, %rcx
shlq $0x8, %rcx
addq 0x4eed(%rip), %rcx      # 0xafd0
leaq 0x1bfd6(%rip), %rdx     # 0x220c0
subl 0x4(%rdx,%rbp,8), %r13d
addl (%rcx,%rax,4), %r13d
leal (%r13,%r13,2), %eax
addl %eax, %r12d
incq %r14
movl 0x234(%rbx), %ecx
movslq %ecx, %rax
cmpq %rax, %r14
jl 0x604d
leal 0xa(%r12), %eax
cmpl $0x2, %ecx
cmovll %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ArchLuke[P]YouSuck/Bishop.c
// Function: EvalBlackBishop
int EvalBlackBishop(const S_BOARD *pos)
{
	int pceNum;
	int sq;
	int index;
	int score=0;

//loop through all the black bishops
	for(pceNum = 0; pceNum < pos->pceNum[bB]; ++pceNum) {
		int mobility=7;
		sq = pos->pList[bB][pceNum];
		int sq64=SQ64(sq);
//the bishop should be on diagonals that control the center
		score += BishopTable[sq64];
		
		//check the diagonal influences
		U64 mask=BlackBishopForwardMask[sq64][0] & pos->pawns[BOTH];
		if(mask)
		{
		//	int square=FindBit(mask2);
			int square=(63-__builtin_clzll(mask));

			mobility -= (BlackMaxDiagonalDistance[sq64][0]-DiagonalDistance[square][sq64]);
				
		}

		U64 mask2=BlackBishopForwardMask[sq64][1] & pos->pawns[BOTH];		

		if(mask2)
		{
		//	int square=FindBit(mask2);
			int square=(63-__builtin_clzll(mask2));
			mobility -= (BlackMaxDiagonalDistance[sq64][1]-DiagonalDistance[square][sq64]);
				
		}

		score += mobility * bishopMobility;				
	}
	//bishop pair
	if(pos->pceNum[bB]>1)
		score += BishopPair;
	
	return -score;	

}

// Assembly:
movslq 0x24c(%rdi), %rcx
testq %rcx, %rcx
jle 0x61ec
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x1f0(%rdi), %rax
xorl %esi, %esi
leaq 0x577a(%rip), %r8       # 0xb8d0
leaq 0x2013(%rip), %r9       # 0x8170
leaq 0x4f5c(%rip), %r10      # 0xb0c0
leaq 0x13b55(%rip), %r11     # 0x19cc0
leaq 0x13e4e(%rip), %rbx     # 0x19fc0
xorl %edx, %edx
movslq 0xc3d8(%rdi,%rsi,4), %r14
movslq (%r8,%r14,4), %r14
movq %r14, %r12
shlq $0x4, %r12
movq (%r10,%r12), %r15
andq %rax, %r15
je 0x61a9
bsrq %r15, %r15
shll $0x8, %r15d
addq %rbx, %r15
movl (%r15,%r14,4), %r15d
subl (%r11,%r14,8), %r15d
addl $0x7, %r15d
jmp 0x61af
movl $0x7, %r15d
addq %r10, %r12
movq 0x8(%r12), %r12
andq %rax, %r12
je 0x61d0
bsrq %r12, %r12
shll $0x8, %r12d
addq %rbx, %r12
subl 0x4(%r11,%r14,8), %r15d
addl (%r12,%r14,4), %r15d
addl (%r9,%r14,4), %edx
leal (%r15,%r15,2), %ebp
addl %ebp, %edx
incq %rsi
cmpq %rsi, %rcx
jne 0x6174
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x61ee
xorl %edx, %edx
leal 0xa(%rdx), %eax
cmpl $0x2, %ecx
cmovll %edx, %eax
negl %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ArchLuke[P]YouSuck/Rook.c
// Function: EvalWhiteRook
int EvalWhiteRook(const S_BOARD *pos)
{
	int pceNum, sq, score=0;
	for(pceNum = 0; pceNum < pos->pceNum[wR]; ++pceNum) {
		sq = pos->pList[wR][pceNum];
		score += RookTable[SQ64(sq)];
		if(!(pos->pawns[BOTH] & FileBBMask[FilesBrd[sq]])) {
			score += RookOpenFile;
		} else if(!(pos->pawns[WHITE] & FileBBMask[FilesBrd[sq]])) {
			score += RookSemiOpenFile;
		}
	}	
	return score;
}

// Assembly:
movslq 0x238(%rdi), %rcx
testq %rcx, %rcx
jle 0x626f
pushq %r14
pushq %rbx
movq 0x1f0(%rdi), %rdx
xorl %esi, %esi
leaq 0x56b5(%rip), %r8       # 0xb8d0
leaq 0x205e(%rip), %r9       # 0x8280
leaq 0x5887(%rip), %r10      # 0xbab0
leaq 0x1ca90(%rip), %r11     # 0x22cc0
xorl %eax, %eax
movslq 0xc310(%rdi,%rsi,4), %rbx
movslq (%r8,%rbx,4), %r14
addl (%r9,%r14,4), %eax
movslq (%r10,%rbx,4), %rbx
movq (%r11,%rbx,8), %rbx
testq %rdx, %rbx
je 0x6260
testq %rbx, 0x1e0(%rdi)
leal 0xa(%rax), %ebx
cmovnel %eax, %ebx
movl %ebx, %eax
jmp 0x6263
addl $0xf, %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x6232
popq %rbx
popq %r14
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ArchLuke[P]YouSuck/Rook.c
// Function: EvalBlackRook
int EvalBlackRook(const S_BOARD *pos)
{
	int pceNum, sq, score=0;
	for(pceNum = 0; pceNum < pos->pceNum[bR]; ++pceNum) {
		sq = pos->pList[bR][pceNum];
		score += RookTable[MIRROR64(SQ64(sq))];
		if(!(pos->pawns[BOTH] & FileBBMask[FilesBrd[sq]])) {
			score += RookOpenFile;
		} else if(!(pos->pawns[BLACK] & FileBBMask[FilesBrd[sq]])) {
			score += RookSemiOpenFile;
		}
	}	
	return -score;
}

// Assembly:
movslq 0x250(%rdi), %rcx
testq %rcx, %rcx
jle 0x62f7
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x1f0(%rdi), %rdx
xorl %esi, %esi
leaq 0x563c(%rip), %r8       # 0xb8d0
leaq 0xfd5(%rip), %r9        # 0x7270
leaq 0x1fde(%rip), %r10      # 0x8280
leaq 0x5807(%rip), %r11      # 0xbab0
leaq 0x1ca10(%rip), %rbx     # 0x22cc0
xorl %eax, %eax
movslq 0xc400(%rdi,%rsi,4), %r14
movslq (%r8,%r14,4), %r15
movslq (%r9,%r15,4), %r15
addl (%r10,%r15,4), %eax
movslq (%r11,%r14,4), %r14
movq (%rbx,%r14,8), %r14
testq %rdx, %r14
je 0x62e4
testq %r14, 0x1e8(%rdi)
leal 0xa(%rax), %ebp
cmovnel %eax, %ebp
movl %ebp, %eax
jmp 0x62e7
addl $0xf, %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x62b2
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x62f9
xorl %eax, %eax
negl %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ArchLuke[P]YouSuck/Pawn.c
// Function: EvalWhitePawns
int EvalWhitePawns(const S_BOARD *pos)
{
	int pceNum, sq, score=0;
	for(pceNum = 0; pceNum < pos->pceNum[wP]; ++pceNum) {
		sq = pos->pList[wP][pceNum];
		score += PawnTable[SQ64(sq)];	
		
		if( (IsolatedMask[SQ64(sq)] & pos->pawns[WHITE]) == 0) {
			score += PawnIsolated;
		}
		
		if( (WhitePassedMask[SQ64(sq)] & pos->pawns[BLACK]) == 0) {
			score += PawnPassed[RanksBrd[sq]];
		}
		if( (DoubledPawnsMask[SQ64(sq)] & pos->pawns[WHITE]) !=0) {
			score += PawnDoubled;
		}
			
	}
	return score;
}

// Assembly:
movslq 0x22c(%rdi), %rcx
testq %rcx, %rcx
jle 0x63a5
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x1e0(%rdi), %rdx
movq 0x1e8(%rdi), %rsi
xorl %r8d, %r8d
leaq 0x55a2(%rip), %r9       # 0xb8d0
leaq 0x207b(%rip), %r10      # 0x83b0
leaq 0x1c9c4(%rip), %r11     # 0x22d00
leaq 0x1d1fd(%rip), %rbx     # 0x23540
leaq 0x1c776(%rip), %r12     # 0x22ac0
xorl %eax, %eax
movslq 0xc298(%rdi,%r8,4), %r14
movslq (%r9,%r14,4), %r13
movl (%r10,%r13,4), %ebp
leal (%rax,%rbp), %r15d
testq %rdx, (%r11,%r13,8)
leal -0xf(%rbp,%rax), %ebp
cmovnel %r15d, %ebp
testq %rsi, (%rbx,%r13,8)
jne 0x6388
leaq 0x1dac7(%rip), %rax     # 0x23e40
movslq (%rax,%r14,4), %rax
leaq 0x200c(%rip), %r14      # 0x8390
addl (%r14,%rax,4), %ebp
leal -0xa(%rbp), %eax
testq %rdx, (%r12,%r13,8)
cmovel %ebp, %eax
incq %r8
cmpq %r8, %rcx
jne 0x634c
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ArchLuke[P]YouSuck/Pawn.c
// Function: EvalBlackPawns
int EvalBlackPawns(const S_BOARD *pos)
{
	int pceNum, sq, score=0;
	for(pceNum = 0; pceNum < pos->pceNum[bP]; ++pceNum) {
		sq = pos->pList[bP][pceNum];
	
		score += PawnTable[MIRROR64(SQ64(sq))];	
		
		if( (IsolatedMask[SQ64(sq)] & pos->pawns[BLACK]) == 0) {
			score += PawnIsolated;
		}
		
		if( (BlackPassedMask[SQ64(sq)] & pos->pawns[WHITE]) == 0) {
			score += PawnPassed[7 - RanksBrd[sq]];
		}

		if( (DoubledPawnsMask[SQ64(sq)] & pos->pawns[BLACK]) !=0) {
			score += PawnDoubled;
		}
	}
	return -score;
}

// Assembly:
movslq 0x244(%rdi), %rcx
testq %rcx, %rcx
jle 0x646a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x1e0(%rdi), %rdx
movq 0x1e8(%rdi), %rsi
xorl %r8d, %r8d
leaq 0xe96(%rip), %r10       # 0x7270
leaq 0x1fcf(%rip), %r11      # 0x83b0
leaq 0x1c918(%rip), %rbx     # 0x22d00
leaq 0x1c2d1(%rip), %r14     # 0x226c0
leaq 0x1c6ca(%rip), %r13     # 0x22ac0
xorl %eax, %eax
movslq 0xc388(%rdi,%r8,4), %r12
leaq 0x54c9(%rip), %r9       # 0xb8d0
movslq (%r9,%r12,4), %rbp
movslq (%r10,%rbp,4), %r15
movl (%r11,%r15,4), %r15d
leal (%r15,%rax), %r9d
testq %rsi, (%rbx,%rbp,8)
leal -0xf(%r15,%rax), %r15d
cmovnel %r9d, %r15d
testq %rdx, (%r14,%rbp,8)
jne 0x6449
leaq 0x1da0f(%rip), %rax     # 0x23e40
movslq (%rax,%r12,4), %rax
movl $0x7, %r9d
subq %rax, %r9
leaq 0x1f4b(%rip), %rax      # 0x8390
addl (%rax,%r9,4), %r15d
leal -0xa(%r15), %eax
testq %rsi, (%r13,%rbp,8)
cmovel %r15d, %eax
incq %r8
cmpq %r8, %rcx
jne 0x63f8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x646c
xorl %eax, %eax
negl %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: write_fasta_file_from_agp
void write_fasta_file_from_agp(const char *fa, const char *agp, FILE *fo, int line_wd, int allow_unknown_oris)
{
    sdict_t *sdict = make_sdict_from_fa(fa, 0);
    asm_dict_t *dict = make_asm_dict_from_agp(sdict, agp, allow_unknown_oris);
    uint64_t len = write_asm_dict_to_fasta(dict, line_wd, fo);
    fprintf(stderr, "[I::%s] Number sequences: %u\n", __func__, dict->n);
    fprintf(stderr, "[I::%s] Number bases: %lu\n", __func__, len);
    asm_destroy(dict);
    sd_destroy(sdict);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r15d
movq %rdx, %r12
movq %rsi, %r14
xorl %esi, %esi
callq 0x494f
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x57f8
movq %rax, %r14
movq %rax, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x85ea
movq %rax, %r15
movq 0xbac6(%rip), %r13      # 0xdff0
movq (%r13), %rdi
movl (%r14), %ecx
leaq 0x83e0(%rip), %rsi      # 0xa918
leaq 0x83f7(%rip), %r12      # 0xa936
movq %r12, %rdx
xorl %eax, %eax
callq 0x2200
movq (%r13), %rdi
leaq 0x83fc(%rip), %rsi      # 0xa950
movq %r12, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2200
movq %r14, %rdi
callq 0x438d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x42ef
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/asset.c
// Function: file_copy
int file_copy(char *fin, char *fout)
{
    FILE *fptr1, *fptr2;
    int c;
    fptr1 = fopen(fin, "r");
    fptr2 = fopen(fout, "w");
    c = fgetc(fptr1);
    while (c != EOF) {
        fputc(c, fptr2);
        c = fgetc(fptr1);
    }
    fclose(fptr1);
    fclose(fptr2);
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
leaq 0x7fae(%rip), %rsi      # 0xab6c
callq 0x22c0
movq %rax, %rbx
leaq 0x7443(%rip), %rsi      # 0xa010
movq %r14, %rdi
callq 0x22c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2170
cmpl $-0x1, %eax
je 0x2bf1
movl %eax, %edi
movq %r14, %rsi
callq 0x21a0
jmp 0x2bd8
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2100
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/asset.c
// Function: is_read_pair
int8_t is_read_pair(const char *rname0, const char *rname1)
{
    int n = strlen(rname0);
    if (n == 0 || n != strlen(rname1))
          return 0;
    if (!strcmp(rname0, rname1) || 
            (n > 2 &&
             !strncmp(rname0, rname1, n - 1) &&
             rname0[n - 2] == '/' &&
             rname1[n - 2] == '/' &&
             rname0[n - 1] != rname1[n - 1]))
        return 1;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2110
movq %rax, %r15
testl %r15d, %r15d
je 0x2c84
movslq %r15d, %r12
movq %rbx, %rdi
callq 0x2110
cmpq %rax, %r12
jne 0x2c84
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21e0
movb $0x1, %bpl
testl %eax, %eax
je 0x2c86
cmpl $0x3, %r15d
jl 0x2c84
leal -0x1(%r15), %r12d
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2090
testl %eax, %eax
jne 0x2c84
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addl %eax, %r15d
cmpb $0x2f, (%r14,%r15)
jne 0x2c84
cmpb $0x2f, (%rbx,%r15)
jne 0x2c84
movb (%r14,%r12), %al
cmpb (%rbx,%r12), %al
jne 0x2c86
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/asset.c
// Function: linear_scale
uint64_t linear_scale(uint64_t g, int *scale, uint64_t max_g)
{
    int s;
    s = 0;
    while (g > max_g) {
        ++s;
        g >>= 1;
    }
    
    *scale = s;
    return g;
}

// Assembly:
movq %rdi, %rax
xorl %ecx, %ecx
cmpq %rdx, %rdi
jbe 0x2ce6
xorl %ecx, %ecx
incl %ecx
shrq %rax
cmpq %rdx, %rax
ja 0x2cdc
movl %ecx, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/asset.c
// Function: is_empty_line
int is_empty_line(char *line)
{
    while (isspace(*line))
        line++;
    if(*line == '\0')
        return 1;
    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x23e0
movq (%rax), %rax
movsbq (%rbx), %rcx
incq %rbx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x2da0
xorl %eax, %eax
testb %cl, %cl
sete %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/asset.c
// Function: iostream_open
iostream_t *iostream_open(const char *spath)
{
    iostream_t *iostream;
    iostream = (iostream_t *) calloc(1, sizeof(iostream_t));
    if (iostream == NULL)
        return NULL;
    iostream->koaux = kopen(spath, &iostream->fd);
    if (iostream->koaux == 0) {
        free(iostream);
        return NULL;
    }
    iostream->fp = gzdopen(iostream->fd, "r");
    if (iostream->fp == Z_NULL) {
        kclose(iostream->koaux);
        free(iostream);
        return NULL;
    }
    iostream->stream = ks_init(iostream->fp);
    iostream->buffer = kstring_init(BUFF_SIZE);

    return iostream;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x30, %esi
callq 0x21d0
testq %rax, %rax
je 0x2e7a
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x3498
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x2e72
movl (%rbx), %edi
leaq 0x7d71(%rip), %rsi      # 0xab6c
callq 0x20f0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x2e69
movq %rax, %r14
movl $0x1, %edi
movl $0x20, %esi
callq 0x21d0
movq %rax, %r15
movq %r14, 0x10(%rax)
movl $0x4000, 0x8(%rax)      # imm = 0x4000
movl $0x1000, %edi           # imm = 0x1000
callq 0x2250
movq %rax, 0x18(%r15)
movq %r15, 0x10(%rbx)
movl $0x1, %edi
movl $0x18, %esi
callq 0x21d0
movq %rax, %r14
movq $0x1000, 0x8(%rax)      # imm = 0x1000
movl $0x1000, %edi           # imm = 0x1000
callq 0x2250
movq %rax, 0x10(%r14)
movq %r14, 0x18(%rbx)
jmp 0x2e7c
movq 0x20(%rbx), %rdi
callq 0x3e8a
movq %rbx, %rdi
callq 0x2050
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/asset.c
// Function: iostream_close
void iostream_close(iostream_t *iostream)
{
    if (!iostream) return;
    ks_destroy(iostream->stream);
    kstring_destroy(iostream->buffer);
    gzclose(iostream->fp);
    kclose(iostream->koaux);
    free(iostream);
}

// Assembly:
testq %rdi, %rdi
je 0x2ee6
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r14
testq %r14, %r14
je 0x2eab
movq 0x18(%r14), %rdi
callq 0x2050
movq %r14, %rdi
callq 0x2050
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0x2ec5
movq 0x10(%r14), %rdi
callq 0x2050
movq %r14, %rdi
callq 0x2050
movq 0x8(%rbx), %rdi
callq 0x2040
movq 0x20(%rbx), %rdi
callq 0x3e8a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/asset.c
// Function: iostream_getline
char *iostream_getline(iostream_t *iostream)
{
    int len;
    kstring_t *buffer;
    buffer = (kstring_t *) (iostream->buffer);
    len = ks_getuntil(iostream->stream, KS_SEP_LINE, buffer, 0);
    if (len >= 0) {
        iostream->nline += 1;
        return buffer->s;
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r15
movq 0x18(%rdi), %r14
movq $0x0, (%r14)
movl (%r15), %ecx
movl 0x4(%r15), %eax
cmpl %eax, %ecx
jl 0x2f17
testb $0x3, 0x8(%r15)
jne 0x308c
cmpl %eax, %ecx
jl 0x2f64
movl 0x8(%r15), %edx
testb $0x3, %dl
jne 0x3038
movl $0x0, (%r15)
movq 0x10(%r15), %rdi
movq 0x18(%r15), %rsi
sarl $0x2, %edx
callq 0x21f0
movl %eax, 0x4(%r15)
movl 0x8(%r15), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x2f59
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%r15)
testl %eax, %eax
je 0x3038
movl (%r15), %ecx
movl %ecx, %r12d
cmpl %eax, %ecx
jge 0x2f88
movslq %ecx, %rdx
addq 0x18(%r15), %rdx
movl %ecx, %r12d
cmpb $0xa, (%rdx)
je 0x2f88
incl %r12d
incq %rdx
cmpl %r12d, %eax
jne 0x2f75
movl %eax, %r12d
movq (%r14), %rdi
movq 0x8(%r14), %rsi
subq %rdi, %rsi
movl %r12d, %edx
subl %ecx, %edx
leal 0x1(%rdx), %eax
movslq %eax, %r8
movq 0x10(%r14), %rax
cmpq %r8, %rsi
jae 0x3005
movslq %edx, %rcx
addq %rcx, %rdi
movq %rdi, %rcx
shrq %rcx
orq %rdi, %rcx
movq %rcx, %rdx
shrq $0x2, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x4, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x8, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x10, %rcx
orq %rdx, %rcx
movq %rcx, %rsi
shrq $0x20, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%r14)
movq %rax, %rdi
callq 0x2290
movq %rax, 0x10(%r14)
movq (%r14), %rdi
movl (%r15), %ecx
movl %r12d, %edx
subl %ecx, %edx
addq %rax, %rdi
movslq %ecx, %rsi
addq 0x18(%r15), %rsi
movslq %edx, %rdx
callq 0x2220
movslq (%r15), %rax
movslq %r12d, %rcx
subq %rax, %rcx
addq %rcx, (%r14)
leal 0x1(%r12), %ecx
movl %ecx, (%r15)
movl 0x4(%r15), %eax
cmpl %eax, %r12d
jge 0x2f17
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x3059
movq (%r14), %rcx
cmpq $0x2, %rcx
jb 0x3077
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x3077
decq %rcx
movq %rcx, (%r14)
jmp 0x3077
movq $0x1, 0x8(%r14)
movl $0x1, %edi
movl $0x1, %esi
callq 0x21d0
movq %rax, 0x10(%r14)
movq (%r14), %rcx
movb $0x0, (%rax,%rcx)
testb $-0x80, 0x3(%r14)
jne 0x308c
incq 0x28(%rbx)
movq 0x10(%r14), %rax
jmp 0x308e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/kalloc.c
// Function: km_init2
void *km_init2(void *km_par, size_t min_core_size)
{
	kmem_t *km;
	km = (kmem_t*)kcalloc(km_par, 1, sizeof(kmem_t));
	km->par = km_par;
	km->min_core_size = min_core_size > 0? min_core_size : 0x80000;
	return (void*)km;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %esi
movl $0x30, %edx
callq 0x30d0
movq %r14, (%rax)
testq %rbx, %rbx
movl $0x80000, %ecx          # imm = 0x80000
cmovneq %rbx, %rcx
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: sd_init
sdict_t *sd_init(void)
{
    sdict_t *d;
    d = (sdict_t *) calloc(1, sizeof(sdict_t));
    d->n = 0;
    d->m = 16;
    d->s = (sd_seq_t *) malloc(d->m * sizeof(sd_seq_t));
    d->h = kh_init(sdict);
    return d;
}

// Assembly:
pushq %rbx
movl $0x1, %edi
movl $0x18, %esi
callq 0x21d0
movq %rax, %rbx
movl $0x10, 0x4(%rax)
movl $0x180, %edi            # imm = 0x180
callq 0x2250
movq %rax, 0x8(%rbx)
movl $0x1, %esi
movl $0x28, %edx
xorl %edi, %edi
callq 0x30d0
movq %rax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: asm_init
asm_dict_t *asm_init(sdict_t *sdict)
{
    asm_dict_t *d;
    d = (asm_dict_t *) calloc(1, sizeof(asm_dict_t));
    d->n = 0;
    d->m = 16;
    d->s = (sd_aseq_t *) malloc(d->m * sizeof(sd_aseq_t));
    d->h = kh_init(sdict);
    d->u = 0;
    d->v = 16;
    d->seg = (sd_seg_t *) malloc(d->v * sizeof(sd_seg_t));
    d->a = (uint64_t *) malloc(sdict->n * sizeof(uint64_t));
    d->index = 0;
    d->sdict = sdict;
    return d;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %edi
movl $0x40, %esi
callq 0x21d0
movq %rax, %r14
movl $0x10, %ebp
movl %ebp, 0x4(%rax)
movl $0x580, %edi            # imm = 0x580
callq 0x2250
movq %rax, 0x8(%r14)
movl $0x1, %esi
movl $0x28, %edx
xorl %edi, %edi
callq 0x30d0
movq %rax, 0x10(%r14)
movl %ebp, 0x1c(%r14)
movl $0x300, %edi            # imm = 0x300
callq 0x2250
movq %rax, 0x20(%r14)
movl (%rbx), %edi
shlq $0x3, %rdi
callq 0x2250
movq %rax, 0x28(%r14)
movq %rbx, 0x38(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: sd_destroy
void sd_destroy(sdict_t *d)
{
    if (!d) return;
    uint32_t i;
    if (d == 0)
        return;
    if (d->h)
        kh_destroy(sdict, d->h);
    if(d->s) {
        for (i = 0; i < d->n; ++i) {
            free(d->s[i].name);
            if (d->s[i].seq)
                free(d->s[i].seq);
        }
        free(d->s);
    }
    free(d);
}

// Assembly:
testq %rdi, %rdi
je 0x438c
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %r14
testq %r14, %r14
je 0x4334
movq 0x18(%r14), %rsi
xorl %edi, %edi
callq 0x316b
movq 0x10(%r14), %rsi
xorl %edi, %edi
callq 0x316b
movq 0x20(%r14), %rsi
xorl %edi, %edi
callq 0x316b
xorl %edi, %edi
movq %r14, %rsi
callq 0x316b
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x437f
cmpl $0x0, (%rbx)
je 0x437a
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x8(%rax,%r14), %rdi
testq %rdi, %rdi
je 0x4368
callq 0x2050
incq %r15
movl (%rbx), %eax
addq $0x18, %r14
cmpq %rax, %r15
jb 0x4348
movq 0x8(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: asm_destroy
void asm_destroy(asm_dict_t *d)
{
    if (!d) return;
    uint32_t i;
    if (d == 0)
        return;
    if (d->s) {
        for (i = 0; i < d->n; ++i) {
            free(d->s[i].name);
            free(d->s[i].gs);
            free(d->s[i].gsize);
            free(d->s[i].gcomp);
            free(d->s[i].gtype);
            free(d->s[i].glink);
            free(d->s[i].gevid);
        }
        free(d->s);
    }
    if (d->seg)
        free(d->seg);
    if (d->a)
        free(d->a);
    if (d->index)
        free(d->index);
    if (d->h)
        kh_destroy(sdict, d->h);
    free(d);
}

// Assembly:
testq %rdi, %rdi
je 0x4499
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x442e
cmpl $0x0, (%rbx)
je 0x4429
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x28(%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x30(%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x38(%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x40(%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x48(%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x50(%rax,%r14), %rdi
callq 0x2050
incq %r15
movl (%rbx), %eax
addq $0x58, %r14
cmpq %rax, %r15
jb 0x43b6
movq 0x8(%rbx), %rdi
callq 0x2050
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x443c
callq 0x2050
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x444a
callq 0x2050
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x4458
callq 0x2050
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0x448c
movq 0x18(%r14), %rsi
xorl %edi, %edi
callq 0x316b
movq 0x10(%r14), %rsi
xorl %edi, %edi
callq 0x316b
movq 0x20(%r14), %rsi
xorl %edi, %edi
callq 0x316b
xorl %edi, %edi
movq %r14, %rsi
callq 0x316b
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: sd_put
uint32_t sd_put(sdict_t *d, const char *name, uint32_t len)
{
    if (!name)
        return UINT32_MAX;
    sdhash_t *h = d->h;
    khint_t k;
    int absent;
    k = kh_put(sdict, h, name, &absent);
    if (absent) {
        sd_seq_t *s;
        if (d->n == d->m) {
            d->m = d->m? d->m<<1 : 16;
            d->s = (sd_seq_t *) realloc(d->s, d->m * sizeof(sd_seq_t));
        }
        s = &d->s[d->n];
        s->len = len;
        s->seq = 0;
        kh_key(h, k) = s->name = strdup(name);
        kh_val(h, k) = d->n++;
    }
    return kh_val(h, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rsi, %rsi
je 0x4514
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rdi), %r14
leaq 0x14(%rsp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x457d
cmpl $0x0, (%r12)
je 0x451c
movl %eax, 0xc(%rsp)
movl (%rbx), %r13d
cmpl 0x4(%rbx), %r13d
movl %ebp, 0x10(%rsp)
jne 0x4528
leal (,%r13,2), %eax
testl %r13d, %r13d
movl $0x10, %ecx
cmovnel %eax, %ecx
movl %ecx, 0x4(%rbx)
movq 0x8(%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2290
movq %rax, %r12
movq %rax, 0x8(%rbx)
movl (%rbx), %r13d
jmp 0x452c
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x456b
movq 0x20(%r14), %rdx
movl %eax, %ecx
movl (%rdx,%rcx,4), %r13d
jmp 0x456b
movq 0x8(%rbx), %r12
movl %r13d, %eax
leaq (%rax,%rax,2), %rbp
movl 0x10(%rsp), %eax
movl %eax, 0x10(%r12,%rbp,8)
movq $0x0, 0x8(%r12,%rbp,8)
movq %r15, %rdi
callq 0x23b0
movq %rax, (%r12,%rbp,8)
movq 0x18(%r14), %rcx
movl 0xc(%rsp), %edx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%r13), %eax
movl %eax, (%rbx)
movq 0x20(%r14), %rax
movl %r13d, (%rax,%rdx,4)
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: sd_get
uint32_t sd_get(sdict_t *d, const char *name)
{
    sdhash_t *h = d->h;
    khint_t k;
    k = kh_get(sdict, h, name);
    return k == kh_end(h)? UINT32_MAX : kh_val(h, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x10(%rdi), %rax
movq %rax, 0x8(%rsp)
movl (%rax), %ecx
testl %ecx, %ecx
je 0x481b
movq %rsi, %r14
leal -0x1(%rcx), %edi
movsbl (%rsi), %r13d
testl %r13d, %r13d
movq %rcx, 0x18(%rsp)
je 0x4823
movb 0x1(%r14), %al
testb %al, %al
je 0x4826
leaq 0x2(%r14), %rcx
movl %r13d, %edx
shll $0x5, %edx
subl %r13d, %edx
movsbl %al, %r13d
addl %edx, %r13d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x4800
jmp 0x4826
xorl %r15d, %r15d
jmp 0x48ae
xorl %r13d, %r13d
andl %edi, %r13d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdx
movl $0x1, %ebx
movl %r13d, %r15d
movl %edi, 0x14(%rsp)
movq %rdx, 0x20(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %r12d
leal (%r15,%r15), %ebp
andl $0x1e, %ebp
movl %r12d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x489c
testb $0x1, %al
jne 0x4888
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x21e0
movq 0x20(%rsp), %rdx
movl 0x14(%rsp), %edi
testl %eax, %eax
je 0x489c
addl %ebx, %r15d
andl %edi, %r15d
incl %ebx
cmpl %r13d, %r15d
jne 0x4843
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x48c7
movl %ebp, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x18(%rsp), %rcx
cmovnel %ecx, %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %r15d
je 0x48c7
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movl %r15d, %ecx
movl (%rax,%rcx,4), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: sd_hash
void sd_hash(sdict_t *d)
{
    uint32_t i;
    sdhash_t *h;
    if (d->h)
        return;
    d->h = h = kh_init(sdict);
    for (i = 0; i < d->n; ++i) {
        int absent;
        khint_t k;
        k = kh_put(sdict, h, d->s[i].name, &absent);
        kh_val(h, k) = i;
    }
}

// Assembly:
cmpq $0x0, 0x10(%rdi)
je 0x48de
retq
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x1, %esi
movl $0x28, %edx
xorl %edi, %edi
callq 0x30d0
movq %rax, 0x10(%rbx)
cmpl $0x0, (%rbx)
je 0x4941
movq %rax, %r14
xorl %r12d, %r12d
leaq 0xc(%rsp), %r15
xorl %r13d, %r13d
movq 0x8(%rbx), %rax
movq (%rax,%r12), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x457d
movq 0x20(%r14), %rcx
movl %eax, %eax
movl %r13d, (%rcx,%rax,4)
incq %r13
movl (%rbx), %eax
addq $0x18, %r12
cmpq %rax, %r13
jb 0x4916
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: make_sdict_from_index
sdict_t *make_sdict_from_index(const char *f, uint32_t min_len)
{
    iostream_t *fp;
    char *line;
    char name[4096];
    int64_t len;

    fp = iostream_open(f);
    if (fp == NULL) {
        fprintf(stderr, "[E::%s] cannot open file %s for reading\n", __func__, f);
        exit(EXIT_FAILURE);
    }
    
    sdict_t *d;
    d = sd_init();
    while ((line = iostream_getline(fp)) != NULL) {
        if (is_empty_line(line))
            continue;
        sscanf(line, "%s %ld", name, &len);
        if (len > UINT32_MAX) {
            fprintf(stderr, "[E::%s] >4G sequence chunks are not supported: %s [%ld]\n", __func__, name, len);
            exit(EXIT_FAILURE);
        }
        if (len >= min_len)
            sd_put(d, name, len);
    }

    iostream_close(fp);
    return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movl %esi, %r15d
movq %rdi, %r14
callq 0x2db7
testq %rax, %rax
je 0x4eb2
movq %rax, %rbx
callq 0x423c
movq %rax, %r14
movq %rbx, %rdi
callq 0x2ee7
testq %rax, %rax
je 0x4e88
movq %rax, %rbp
movl %r15d, %r15d
leaq 0x10(%rsp), %r12
movabsq $0x100000000, %r13      # imm = 0x100000000
movq %rbp, %rdi
callq 0x2d94
testl %eax, %eax
jne 0x4e78
movq %rbp, %rdi
leaq 0x5664(%rip), %rsi      # 0xa4b3
movq %r12, %rdx
leaq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x2260
movq 0x8(%rsp), %rdx
cmpq %r13, %rdx
jge 0x4ea5
cmpq %r15, %rdx
jl 0x4e78
movq %r14, %rdi
movq %r12, %rsi
callq 0x449a
movq %rbx, %rdi
callq 0x2ee7
movq %rax, %rbp
testq %rax, %rax
jne 0x4e39
movq %rbx, %rdi
callq 0x2e85
movq %r14, %rax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rdi
movq %rdx, %rsi
callq 0x25db
movq %r14, %rdi
callq 0x2609
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: make_sdict_from_gfa
sdict_t *make_sdict_from_gfa(const char *f, uint32_t min_len)
{
    iostream_t *fp;
    char *line;
    char name[4096], lens[4096];
    uint64_t len;

    fp = iostream_open(f);
    if (fp == NULL) {
        fprintf(stderr, "[E::%s] cannot open file %s for reading\n", __func__, f);
        exit(EXIT_FAILURE);
    }

    sdict_t *d;
    d = sd_init();
    while ((line = iostream_getline(fp)) != NULL) {
        if (is_empty_line(line))
            continue;
        if (line[0] == 'S') {
            sscanf(line, "%*s %s %*s %s", name, lens);
            len = strtoul(lens + 5, NULL, 10);
            if (len > UINT32_MAX) {
                fprintf(stderr, "[E::%s] >4G sequence chunks are not supported: %s [%ld]\n", __func__, name, len);
                exit(EXIT_FAILURE);
            }
            if (len >= min_len)
                sd_put(d, name, len);
        }
    }
    iostream_close(fp);

    return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movl %esi, %ebp
movq %rdi, %r14
callq 0x2db7
testq %rax, %rax
je 0x4f99
movq %rax, %rbx
callq 0x423c
movq %rax, %r14
movq %rbx, %rdi
callq 0x2ee7
testq %rax, %rax
je 0x4f6c
movq %rax, %r15
movl %ebp, %r12d
leaq 0x1000(%rsp), %r13
movq %rsp, %rbp
movq %r15, %rdi
callq 0x2d94
testl %eax, %eax
jne 0x4f5c
cmpb $0x53, (%r15)
jne 0x4f5c
movq %r15, %rdi
leaq 0x55ab(%rip), %rsi      # 0xa4ce
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2260
leaq 0x5(%rsp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2320
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x4f89
cmpq %r12, %rax
jb 0x4f5c
movq %r14, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x449a
movq %rbx, %rdi
callq 0x2ee7
movq %rax, %r15
testq %rax, %rax
jne 0x4f07
movq %rbx, %rdi
callq 0x2e85
movq %r14, %rax
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1000(%rsp), %rdi
movq %rax, %rsi
callq 0x2634
movq %r14, %rdi
callq 0x2662
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: seg_put
void seg_put(asm_dict_t *d, uint32_t s, uint32_t k, uint64_t a, uint64_t b,
        uint32_t c, uint32_t x, uint32_t y, uint32_t t, uint32_t r)
{
    if (d->u == d->v) {
        d->v = d->v? d->v<<1 : 16;
        d->seg = (sd_seg_t *) realloc(d->seg, d->v * sizeof(sd_seg_t));
    }
    sd_seg_t seg = {s, k, a, b, c, x, y, t, r};
    d->seg[d->u++] = seg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movq %r8, %r14
movq %rcx, %r15
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r13
movl 0x58(%rsp), %esi
movl 0x50(%rsp), %edi
movl 0x48(%rsp), %r8d
movl 0x40(%rsp), %r9d
movl 0x18(%r13), %ecx
cmpl 0x1c(%r13), %ecx
jne 0x531f
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
movl $0x10, %ecx
cmovnel %eax, %ecx
movl %ecx, 0x1c(%r13)
movq 0x20(%r13), %rdi
shlq $0x4, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2290
movl 0x40(%rsp), %r9d
movl 0x48(%rsp), %r8d
movl 0x50(%rsp), %edi
movl 0x58(%rsp), %esi
movq %rax, 0x20(%r13)
movl 0x18(%r13), %ecx
jmp 0x5323
movq 0x20(%r13), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x18(%r13)
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movl %r12d, (%rax,%rcx)
movl %ebp, 0x4(%rax,%rcx)
movq %r15, 0x8(%rax,%rcx)
movq %r14, 0x10(%rax,%rcx)
movl %ebx, 0x18(%rax,%rcx)
movl %r9d, 0x1c(%rax,%rcx)
movl %r8d, 0x20(%rax,%rcx)
movl %edi, 0x24(%rax,%rcx)
movl %esi, 0x28(%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: make_asm_dict_from_sdict
asm_dict_t *make_asm_dict_from_sdict(sdict_t *sdict)
{
    uint32_t i;
    asm_dict_t *d;
    d = asm_init(sdict);
    d->index = (uint64_t *) calloc(sdict->n, sizeof(uint64_t));
    uint64_t *a = d->a;
    for (i = 0; i < sdict->n; ++i) {
        asm_put(d, sdict->s[i].name, sdict->s[i].len, 0, 1, i, 0, 0, 0, 0, 0, 0, 0);
        seg_put(d, i, 0, 0, 0, i<<1, 0, sdict->s[i].len, DEFAULT_AGP_SEQ_COMPONENT_TYPE, AGP_OT_PLUS);
        a[i] = (uint64_t) i << 32 | 1;
        d->index[i] = (uint64_t) sdict->s[i].len << 32 | i;
    }
    return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x427e
movq %rax, %r14
movq %rbx, 0x8(%rsp)
movl (%rbx), %r15d
movl $0x8, %esi
movq %r15, %rdi
callq 0x21d0
movq %r14, (%rsp)
movq %rax, 0x30(%r14)
testq %r15, %r15
je 0x548b
movq (%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movl $0x4, %r12d
movl $0x1, %r13d
xorl %ebp, %ebp
xorl %r15d, %r15d
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
movq -0x10(%rax,%r12,4), %rsi
movl (%rax,%r12,4), %edx
subq $0x40, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
xorl %eax, %eax
movl %eax, (%rsp)
movq %rbx, %rdi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %r15d, %r9d
callq 0x4fa1
addq $0x40, %rsp
movq 0x8(%r14), %rax
movl (%rax,%r12,4), %eax
movl 0x8dfc(%rip), %r10d     # 0xe220
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq $0x2b5d0                # imm = 0x2B5D0
pushq %r10
pushq %rax
xorl %eax, %eax
pushq %rax
callq 0x52a9
addq $0x20, %rsp
movq 0x10(%rsp), %rax
movq %r13, (%rax,%r15,8)
movq 0x8(%r14), %rax
movl (%rax,%r12,4), %ecx
shlq $0x20, %rcx
addq %r15, %rcx
movq 0x30(%rbx), %rdx
movq %rcx, (%rdx,%r15,8)
incq %r15
movl (%r14), %ecx
addl $0x2, %ebp
addq $0x6, %r12
movabsq $0x100000000, %rdx      # imm = 0x100000000
addq %rdx, %r13
cmpq %rcx, %r15
jb 0x53da
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: asm_index
void asm_index(asm_dict_t *d)
{
    int32_t i, s, c;
    uint64_t *a, last;
    sd_seg_t seg;

    s = d->u;
    if (s == 0) return;

    c_pair_t *c_pairs;
    c_pairs = (c_pair_t *) malloc(s * sizeof(c_pair_t));
    for(i = 0; i < s; ++i) {
        seg = d->seg[i];
        c_pairs[i].x = (uint64_t) seg.c >> 1 << 32 | (seg.x + seg.y);
        c_pairs[i].y = (uint64_t) (seg.x + seg.y) << 32 | i;
    }

    radix_sort_pair(c_pairs, c_pairs + s);
    
    if (d->index)
        free(d->index);
    d->index = (uint64_t *) malloc(s * sizeof(uint64_t));
    a = d->a;
    memset(a, 0, sizeof(uint64_t) * d->sdict->n);
    d->index[0] = c_pairs[0].y;
    c = c_pairs[0].x >> 32;
    for (i = 1, last = 0; i < s; ++i) {
        d->index[i] = c_pairs[i].y;
        if (c != c_pairs[i].x >> 32) {
            a[c] = last << 32 | (i - last);
            last = i;
            c = c_pairs[i].x >> 32;
        }
    }
    a[c] = last << 32 | (i - last);

    free(c_pairs);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x18(%rdi), %r12
testq %r12, %r12
je 0x57c7
movq %rdi, %r14
movq %r12, %r15
shlq $0x4, %r15
movq %r15, %rdi
callq 0x2250
movq %rax, %rbx
testl %r12d, %r12d
jle 0x5723
movq 0x20(%r14), %rax
leaq 0x8(%rbx), %rcx
addq $0x20, %rax
xorl %edx, %edx
movl -0x8(%rax), %esi
movl (%rax), %edi
shrl %esi
shlq $0x20, %rsi
addl -0x4(%rax), %edi
orq %rdi, %rsi
movq %rsi, -0x8(%rcx)
shlq $0x20, %rdi
addq %rdx, %rdi
movq %rdi, (%rcx)
incq %rdx
addq $0x10, %rcx
addq $0x30, %rax
cmpq %rdx, %r12
jne 0x56f4
addq %rbx, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5694
movq 0x30(%r14), %rdi
testq %rdi, %rdi
je 0x573f
callq 0x2050
leaq (,%r12,8), %rdi
callq 0x2250
movq %rax, 0x30(%r14)
movq 0x28(%r14), %r15
movq 0x38(%r14), %rax
movl (%rax), %edx
shlq $0x3, %rdx
xorl %r13d, %r13d
movq %r15, %rdi
xorl %esi, %esi
callq 0x2160
movq 0x8(%rbx), %rax
movq 0x30(%r14), %rcx
movq %rax, (%rcx)
movl 0x4(%rbx), %eax
cmpl $0x2, %r12d
jl 0x57d1
movq %rbx, %rdx
addq $0x10, %rdx
movl $0x1, %esi
xorl %r13d, %r13d
movq 0x8(%rdx), %rdi
movq %rdi, (%rcx,%rsi,8)
movslq %eax, %rdi
movl 0x4(%rdx), %r8d
cmpq %rdi, %r8
je 0x57b9
movq %rsi, %rax
subq %r13, %rax
shlq $0x20, %r13
orq %rax, %r13
movq %r13, (%r15,%rdi,8)
movl 0x4(%rdx), %eax
movq %rsi, %r13
incq %rsi
addq $0x10, %rdx
cmpq %rsi, %r12
jne 0x578e
jmp 0x57d7
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x1, %r12d
subq %r13, %r12
shlq $0x20, %r13
orq %r12, %r13
cltq
movq %r13, (%r15,%rax,8)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: add_unplaced_short_seqs
void add_unplaced_short_seqs(asm_dict_t *d, uint32_t min_len)
{
    uint32_t i;
    sdict_t *sdict;
    
    sdict = d->sdict;
    for (i = 0; i < sdict->n; ++i) {
        if (sdict->s[i].len >= min_len)
            continue;
        seg_put(d, d->n, 0, 0, 0, i<<1, 0, sdict->s[i].len, DEFAULT_AGP_SEQ_COMPONENT_TYPE, AGP_OT_PLUS);
        asm_put(d, sdict->s[i].name, sdict->s[i].len, 0, 1, d->u - 1, 0, 0, 0, 0, 0, 0, 0);
    }
    asm_index(d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %r15
movl (%r15), %eax
testl %eax, %eax
je 0x6c33
movl $0x8, %r13d
xorl %r14d, %r14d
xorl %r12d, %r12d
movl %esi, 0x4(%rsp)
movq 0x8(%r15), %rcx
movl (%rcx,%r13,2), %r10d
cmpl %esi, %r10d
jae 0x6c1d
movl (%rbx), %esi
movl 0x766c(%rip), %eax      # 0xe220
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %r14d, %r9d
pushq $0x2b5d0                # imm = 0x2B5D0
pushq %rax
pushq %r10
xorl %ebp, %ebp
pushq %rbp
callq 0x52a9
addq $0x20, %rsp
movq 0x8(%r15), %rax
movq -0x10(%rax,%r13,2), %rsi
movl (%rax,%r13,2), %edx
movl 0x18(%rbx), %r9d
decl %r9d
subq $0x40, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
movl %ebp, (%rsp)
movq %rbx, %rdi
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x4fa1
movl 0x44(%rsp), %esi
addq $0x40, %rsp
movl (%r15), %eax
incq %r12
movl %eax, %ecx
addl $0x2, %r14d
addq $0xc, %r13
cmpq %rcx, %r12
jb 0x6b9f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x56b6
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: sd_coordinate_conversion
int sd_coordinate_conversion(asm_dict_t *d, uint32_t id, uint32_t pos, uint32_t *s, uint64_t *p, int count_gap)
{
    *s = UINT32_MAX;
    *p = UINT64_MAX;

    if (id >= d->sdict->n)
        return SEQ_NOT_FOUND;

    uint32_t i, n;
    uint64_t *index = d->index;
    i = (uint32_t) (d->a[id] >> 32);
    n = (uint32_t) (d->a[id]) + i;

    while (i < n && index[i]>>32 <= pos)
        ++i;
    if (i == n)
        return POS_NOT_IN_RANGE;

    sd_seg_t *seg = &d->seg[(uint32_t) index[i]];
    if (pos < seg->x || pos >= seg->x + seg->y)
        return POS_NOT_IN_RANGE;

    uint64_t offset = count_gap? seg->b : seg->a;
    *s = seg->s;
    *p = seg->c & 1? offset + seg->x + seg->y - 1 - pos : offset + pos - seg->x;

    return CC_SUCCESS;
}

// Assembly:
pushq %rbx
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
movq $-0x1, (%r8)
movq 0x38(%rdi), %r10
movl $0x1, %eax
cmpl %esi, (%r10)
jbe 0x6d10
movq 0x28(%rdi), %rax
movq 0x30(%rdi), %r10
movl %esi, %esi
movq (%rax,%rsi,8), %rsi
movq %rsi, %r11
shrq $0x20, %r11
addl %r11d, %esi
cmpl %r11d, %esi
jbe 0x6ca0
movl %edx, %eax
movl %esi, %ebx
cmpl %eax, 0x4(%r10,%r11,8)
ja 0x6ca0
incq %r11
cmpq %r11, %rbx
jne 0x6c8a
movl $0x2, %eax
jmp 0x6d10
movl $0x2, %eax
cmpl %esi, %r11d
je 0x6d10
movq 0x20(%rdi), %rsi
movl %r11d, %edi
movl (%r10,%rdi,8), %edi
leaq (%rdi,%rdi,2), %rdi
shlq $0x4, %rdi
movl 0x1c(%rsi,%rdi), %r10d
cmpl %edx, %r10d
ja 0x6d10
addq %rdi, %rsi
addl 0x20(%rsi), %r10d
cmpl %edx, %r10d
jbe 0x6d10
xorl %eax, %eax
testl %r9d, %r9d
setne %al
movq 0x8(%rsi,%rax,8), %rax
movl (%rsi), %edi
movl %edi, (%rcx)
testb $0x1, 0x18(%rsi)
jne 0x6cf7
movl %edx, %ecx
addq %rcx, %rax
movl 0x1c(%rsi), %ecx
subq %rcx, %rax
jmp 0x6d0b
movl 0x1c(%rsi), %ecx
movl 0x20(%rsi), %esi
addq %rcx, %rsi
movl %edx, %ecx
notq %rcx
addq %rcx, %rax
addq %rsi, %rax
movq %rax, (%r8)
xorl %eax, %eax
popq %rbx
retq