// File: /workspace/github_c_makefile_star2_O0/aokad[P]sequeeze/seqtk.c
// Function: stk_mergepe
int stk_mergepe(int argc, char *argv[])
{
	gzFile fp1, fp2;
	kseq_t *seq[2];

	if (argc < 3) {
		fprintf(stderr, "Usage: seqtk mergepe <in1.fq> <in2.fq>\n");
		return 1;
	}
	fp1 = strcmp(argv[1], "-")? gzopen(argv[1], "r") : gzdopen(fileno(stdin), "r");
	fp2 = strcmp(argv[2], "-")? gzopen(argv[2], "r") : gzdopen(fileno(stdin), "r");
	if (fp1 == 0 || fp2 == 0) {
		fprintf(stderr, "[E::%s] failed to open the input file/stream.\n", __func__);
		return 1;
	}
	seq[0] = kseq_init(fp1);
	seq[1] = kseq_init(fp2);
	while (kseq_read(seq[0]) >= 0) {
		if (kseq_read(seq[1]) < 0) {
			fprintf(stderr, "[W::%s] the 2nd file has fewer records.\n", __func__);
			break;
		}
		stk_printseq(seq[0], 0);
		stk_printseq(seq[1], 0);
	}
	if (kseq_read(seq[1]) >= 0)
		fprintf(stderr, "[W::%s] the 1st file has fewer records.\n", __func__);
	kseq_destroy(seq[0]); gzclose(fp1);
	kseq_destroy(seq[1]); gzclose(fp2);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x3, -0x8(%rbp)
jge 0x8da9
movq 0x826c(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x55ad(%rip), %rsi      # 0xe343
movb $0x0, %al
callq 0x2190
movl $0x1, -0x4(%rbp)
jmp 0x8f61
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x56de(%rip), %rsi      # 0xe496
callq 0x2170
cmpl $0x0, %eax
je 0x8ddc
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x44af(%rip), %rsi      # 0xd280
callq 0x2220
movq %rax, -0x38(%rbp)
jmp 0x8dfd
movq 0x81e5(%rip), %rax      # 0x10fc8
movq (%rax), %rdi
callq 0x21b0
movl %eax, %edi
leaq 0x448c(%rip), %rsi      # 0xd280
callq 0x20b0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x5682(%rip), %rsi      # 0xe496
callq 0x2170
cmpl $0x0, %eax
je 0x8e38
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x4453(%rip), %rsi      # 0xd280
callq 0x2220
movq %rax, -0x40(%rbp)
jmp 0x8e59
movq 0x8189(%rip), %rax      # 0x10fc8
movq (%rax), %rdi
callq 0x21b0
movl %eax, %edi
leaq 0x4430(%rip), %rsi      # 0xd280
callq 0x20b0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x8e6f
cmpq $0x0, -0x20(%rbp)
jne 0x8e9a
movq 0x8182(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x45f9(%rip), %rsi      # 0xd479
leaq 0x54e4(%rip), %rdx      # 0xe36b
movb $0x0, %al
callq 0x2190
movl $0x1, -0x4(%rbp)
jmp 0x8f61
movq -0x18(%rbp), %rdi
callq 0x38f0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x38f0
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rdi
callq 0x3930
cmpl $0x0, %eax
jl 0x8f09
movq -0x28(%rbp), %rdi
callq 0x3930
cmpl $0x0, %eax
jge 0x8ef1
movq 0x8121(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x5496(%rip), %rsi      # 0xe377
leaq 0x5483(%rip), %rdx      # 0xe36b
movb $0x0, %al
callq 0x2190
jmp 0x8f09
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x7440
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x7440
jmp 0x8eb4
movq -0x28(%rbp), %rdi
callq 0x3930
cmpl $0x0, %eax
jl 0x8f36
movq 0x80da(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x5478(%rip), %rsi      # 0xe3a0
leaq 0x543c(%rip), %rdx      # 0xe36b
movb $0x0, %al
callq 0x2190
movq -0x30(%rbp), %rdi
callq 0x3d40
movq -0x18(%rbp), %rdi
callq 0x2030
movq -0x28(%rbp), %rdi
callq 0x3d40
movq -0x20(%rbp), %rdi
callq 0x2030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)