// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/main.c
// Function: main_opt_validate
void main_opt_validate(main_opt_t *opt)
{
	assert_or_exit(AlignmentModeStart <= opt->alignment_mode && opt->alignment_mode <= AlignmentModeEnd, "Alignment mode (-M) was not valid ([%d-%d]), found %d.", AlignmentModeStart, AlignmentModeEnd, opt->alignment_mode);
	assert_or_exit(opt->mismatch_score > 0, "Mismatch score (-a) must be greater than zero, found %d.", opt->mismatch_score);
	assert_or_exit(opt->match_score > 0, "Mismatch score (-b) must be greater than zero, found %d.", opt->mismatch_score);
	assert_or_exit(opt->gap_open >= 0, "Gap open penalty (-q) must be greater than or equal to zero, found %d.", opt->gap_open);
	assert_or_exit(opt->gap_extend > 0, "Gap extend penalty (-r) must be greater than zero, found %d.", opt->gap_extend);
	assert_or_exit(0 <= opt->band_width, "Band width (-w) must be greater than or equal zero, found %d.", opt->band_width);
	assert_or_exit(LibraryStart <= opt->library && opt->library <= LibraryEnd, "Library (-l) was not valid ([%d-%d]), found %d.", LibraryStart, LibraryEnd, opt->library);

	// verify library type with alignment_mode
	int found_mismatch = 0;
	switch (opt->library) {
		case Ksw2: 
			if (opt->alignment_mode != Extension && opt->alignment_mode != Global) found_mismatch = 1; 
			break;
		case Parasail: 
			assert_or_exit(opt->right_align_gaps == 0, "Cannot right adjust gaps (-R) with parasail (-l)");
			if (opt->alignment_mode != Local && opt->alignment_mode != Glocal && opt->alignment_mode != Global) found_mismatch = 1; 
			break;
		default: break;
	}
	assert_or_exit(found_mismatch == 0, "Cannot use alignment mode (-M) %d-%s with library (-l) %d-%s.", 
			opt->alignment_mode, library_to_str(opt->alignment_mode),
			opt->library, library_to_str(opt->library));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdx
xorl %eax, %eax
xorl %ecx, %ecx
cmpl 0x20(%rdx), %ecx
movb %al, -0xd(%rbp)
jg 0x1b89ba
movq -0x8(%rbp), %rax
cmpl $0x3, 0x20(%rax)
setle %al
movb %al, -0xd(%rbp)
movb -0xd(%rbp), %al
andb $0x1, %al
movzbl %al, %edi
movq -0x8(%rbp), %rax
movl 0x20(%rax), %r8d
leaq 0xad4c3e(%rip), %rsi    # 0xc8d60f
xorl %edx, %edx
movl $0x3, %ecx
movb $0x0, %al
callq 0x1b88a0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4(%rax)
setg %al
andb $0x1, %al
movzbl %al, %edi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0xad4c49(%rip), %rsi    # 0xc8d646
movb $0x0, %al
callq 0x1b88a0
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
setg %al
andb $0x1, %al
movzbl %al, %edi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0xad4c5e(%rip), %rsi    # 0xc8d67f
movb $0x0, %al
callq 0x1b88a0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x8(%rax)
setge %al
andb $0x1, %al
movzbl %al, %edi
movq -0x8(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0xad4c72(%rip), %rsi    # 0xc8d6b8
movb $0x0, %al
callq 0x1b88a0
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
setg %al
andb $0x1, %al
movzbl %al, %edi
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edx
leaq 0xad4c94(%rip), %rsi    # 0xc8d6ff
movb $0x0, %al
callq 0x1b88a0
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl 0x10(%rcx), %eax
setle %al
andb $0x1, %al
movzbl %al, %edi
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0xad4cab(%rip), %rsi    # 0xc8d73c
movb $0x0, %al
callq 0x1b88a0
movq -0x8(%rbp), %rdx
xorl %eax, %eax
xorl %ecx, %ecx
cmpl 0x38(%rdx), %ecx
movb %al, -0xe(%rbp)
jg 0x1b8ab6
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
setle %al
movb %al, -0xe(%rbp)
movb -0xe(%rbp), %al
movzbl %al, %edi
andl $0x1, %edi
movq -0x8(%rbp), %rax
movl 0x38(%rax), %r8d
leaq 0xad4cac(%rip), %rsi    # 0xc8d77a
xorl %edx, %edx
movb %dl, %al
movl $0x2, %ecx
callq 0x1b88a0
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x14(%rbp)
subl $0x1, %eax
je 0x1b8afe
jmp 0x1b8af4
movl -0x14(%rbp), %eax
subl $0x2, %eax
je 0x1b8b1b
jmp 0x1b8b60
movq -0x8(%rbp), %rax
cmpl $0x2, 0x20(%rax)
je 0x1b8b19
movq -0x8(%rbp), %rax
cmpl $0x3, 0x20(%rax)
je 0x1b8b19
movl $0x1, -0xc(%rbp)
jmp 0x1b8b62
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30(%rax)
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0xad4c78(%rip), %rsi    # 0xc8d7aa
movb $0x0, %al
callq 0x1b88a0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x1b8b5e
movq -0x8(%rbp), %rax
cmpl $0x1, 0x20(%rax)
je 0x1b8b5e
movq -0x8(%rbp), %rax
cmpl $0x3, 0x20(%rax)
je 0x1b8b5e
movl $0x1, -0xc(%rbp)
jmp 0x1b8b62
jmp 0x1b8b62
cmpl $0x0, -0xc(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
callq 0x1b79b0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %edi
callq 0x1b79b0
movl -0x28(%rbp), %edi
movl -0x24(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x18(%rbp), %r8d
movq %rax, %r9
leaq 0xad4c22(%rip), %rsi    # 0xc8d7db
movb $0x0, %al
callq 0x1b88a0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)