// File: /workspace/github_c_makefile_star2_O0/aokad[P]sequeeze/seqtk.c
// Function: stk_famask
int stk_famask(int argc, char *argv[])
{
	gzFile fp[2];
	kseq_t *seq[2];
	int i, l, c;
	while ((c = getopt(argc, argv, "")) >= 0);
	if (argc - optind < 2) {
		fprintf(stderr, "Usage: seqtk famask <src.fa> <mask.fa>\n");
		return 1;
	}
	for (i = 0; i < 2; ++i) {
		fp[i] = strcmp(argv[optind+i], "-")? gzopen(argv[optind+i], "r") : gzdopen(fileno(stdin), "r");
		seq[i] = kseq_init(fp[i]);
	}
	if (fp[0] == 0 || fp[1] == 0) {
		fprintf(stderr, "[E::%s] failed to open the input file/stream.\n", __func__);
		return 1;
	}
	while (kseq_read(seq[0]) >= 0) {
		int min_l, c[2];
		kseq_read(seq[1]);
		if (strcmp(seq[0]->name.s, seq[1]->name.s))
			fprintf(stderr, "[%s] Different sequence names: %s != %s\n", __func__, seq[0]->name.s, seq[1]->name.s);
		if (seq[0]->seq.l != seq[1]->seq.l)
			fprintf(stderr, "[%s] Unequal sequence length: %ld != %ld\n", __func__, seq[0]->seq.l, seq[1]->seq.l);
		min_l = seq[0]->seq.l < seq[1]->seq.l? seq[0]->seq.l : seq[1]->seq.l;
		printf(">%s", seq[0]->name.s);
		for (l = 0; l < min_l; ++l) {
			c[0] = seq[0]->seq.s[l]; c[1] = seq[1]->seq.s[l];
			if (c[1] == 'x') c[0] = tolower(c[0]);
			else if (c[1] != 'X') c[0] = c[1];
			if (l%60 == 0) putchar('\n');
			putchar(c[0]);
		}
		putchar('\n');
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x7e39(%rip), %rdx      # 0xd7d6
callq 0x2240
movl %eax, -0x3c(%rbp)
cmpl $0x0, %eax
jl 0x59ac
jmp 0x598f
movl -0x8(%rbp), %eax
movq 0xb61a(%rip), %rcx      # 0x10fd0
subl (%rcx), %eax
cmpl $0x2, %eax
jge 0x59e1
movq 0xb634(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x8011(%rip), %rsi      # 0xd9df
movb $0x0, %al
callq 0x2190
movl $0x1, -0x4(%rbp)
jmp 0x5c5b
movl $0x0, -0x34(%rbp)
cmpl $0x2, -0x34(%rbp)
jge 0x5a99
movq -0x10(%rbp), %rax
movq 0xb5d3(%rip), %rcx      # 0x10fd0
movl (%rcx), %ecx
addl -0x34(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x8a86(%rip), %rsi      # 0xe496
callq 0x2170
cmpl $0x0, %eax
je 0x5a43
movq -0x10(%rbp), %rax
movq 0xb5ab(%rip), %rcx      # 0x10fd0
movl (%rcx), %ecx
addl -0x34(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7848(%rip), %rsi      # 0xd280
callq 0x2220
movq %rax, -0x50(%rbp)
jmp 0x5a64
movq 0xb57e(%rip), %rax      # 0x10fc8
movq (%rax), %rdi
callq 0x21b0
movl %eax, %edi
leaq 0x7825(%rip), %rsi      # 0xd280
callq 0x20b0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rcx
movslq -0x34(%rbp), %rax
movq %rcx, -0x20(%rbp,%rax,8)
movslq -0x34(%rbp), %rax
movq -0x20(%rbp,%rax,8), %rdi
callq 0x38f0
movq %rax, %rcx
movslq -0x34(%rbp), %rax
movq %rcx, -0x30(%rbp,%rax,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x59e8
cmpq $0x0, -0x20(%rbp)
je 0x5aa7
cmpq $0x0, -0x18(%rbp)
jne 0x5ad2
movq 0xb54a(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x79c1(%rip), %rsi      # 0xd479
leaq 0x7f48(%rip), %rdx      # 0xda07
movb $0x0, %al
callq 0x2190
movl $0x1, -0x4(%rbp)
jmp 0x5c5b
jmp 0x5ad4
movq -0x30(%rbp), %rdi
callq 0x3930
cmpl $0x0, %eax
jl 0x5c54
movq -0x28(%rbp), %rdi
callq 0x3930
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x2170
cmpl $0x0, %eax
je 0x5b38
movq 0xb4e8(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %r8
leaq 0x7e22(%rip), %rsi      # 0xd94c
leaq 0x7ed6(%rip), %rdx      # 0xda07
movb $0x0, %al
callq 0x2190
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x30(%rcx), %rax
je 0x5b79
movq 0xb4a7(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %r8
leaq 0x7e0a(%rip), %rsi      # 0xd975
leaq 0x7e95(%rip), %rdx      # 0xda07
movb $0x0, %al
callq 0x2190
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jae 0x5b99
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x5ba5
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl %eax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x79c1(%rip), %rdi      # 0xd57c
movb $0x0, %al
callq 0x20f0
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x5c45
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x44(%rbp)
cmpl $0x78, -0x44(%rbp)
jne 0x5c0a
movl -0x48(%rbp), %edi
callq 0x21c0
movl %eax, -0x48(%rbp)
jmp 0x5c18
cmpl $0x58, -0x44(%rbp)
je 0x5c16
movl -0x44(%rbp), %eax
movl %eax, -0x48(%rbp)
jmp 0x5c18
movl -0x38(%rbp), %eax
movl $0x3c, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x5c32
movl $0xa, %edi
callq 0x2050
movl -0x48(%rbp), %edi
callq 0x2050
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x5bc9
movl $0xa, %edi
callq 0x2050
jmp 0x5ad4
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)