// File: /workspace/github_c_makefile_star2_O1/lh3[P]minimap2/options.c
// Function: mm_set_opt
int mm_set_opt(const char *preset, mm_idxopt_t *io, mm_mapopt_t *mo)
{
	if (preset == 0) {
		mm_idxopt_init(io);
		mm_mapopt_init(mo);
	} else if (strcmp(preset, "lr") == 0 || strcmp(preset, "map-ont") == 0) { // this is the same as the default
	} else if (strcmp(preset, "ava-ont") == 0) {
		io->flag = 0, io->k = 15, io->w = 5;
		mo->flag |= MM_F_ALL_CHAINS | MM_F_NO_DIAG | MM_F_NO_DUAL | MM_F_NO_LJOIN;
		mo->min_chain_score = 100, mo->pri_ratio = 0.0f, mo->max_chain_skip = 25;
		mo->bw = mo->bw_long = 2000;
		mo->occ_dist = 0;
	} else if (strcmp(preset, "map10k") == 0 || strcmp(preset, "map-pb") == 0) {
		io->flag |= MM_I_HPC, io->k = 19;
	} else if (strcmp(preset, "ava-pb") == 0) {
		io->flag |= MM_I_HPC, io->k = 19, io->w = 5;
		mo->flag |= MM_F_ALL_CHAINS | MM_F_NO_DIAG | MM_F_NO_DUAL | MM_F_NO_LJOIN;
		mo->min_chain_score = 100, mo->pri_ratio = 0.0f, mo->max_chain_skip = 25;
		mo->bw_long = mo->bw;
		mo->occ_dist = 0;
	} else if (strcmp(preset, "lr:hq") == 0 || strcmp(preset, "map-hifi") == 0 || strcmp(preset, "map-ccs") == 0) {
		io->flag = 0, io->k = 19, io->w = 19;
		mo->max_gap = 10000;
		mo->min_mid_occ = 50, mo->max_mid_occ = 500;
		if (strcmp(preset, "map-hifi") == 0 || strcmp(preset, "map-ccs") == 0) {
			mo->a = 1, mo->b = 4, mo->q = 6, mo->q2 = 26, mo->e = 2, mo->e2 = 1;
			mo->min_dp_max = 200;
		}
	} else if (strcmp(preset, "lr:hqae") == 0) { // high-quality assembly evaluation
		io->flag = 0, io->k = 25, io->w = 51;
		mo->flag |= MM_F_RMQ;
		mo->min_mid_occ = 50, mo->max_mid_occ = 500;
		mo->rmq_inner_dist = 5000;
		mo->occ_dist = 200;
		mo->best_n = 100;
		mo->chain_gap_scale = 5.0f;
	} else if (strcmp(preset, "map-iclr-prerender") == 0) {
		io->flag = 0, io->k = 15;
		mo->b = 6, mo->transition = 1;
		mo->q = 10, mo->q2 = 50;
	} else if (strcmp(preset, "map-iclr") == 0) {
		io->flag = 0, io->k = 19;
		mo->b = 6, mo->transition = 4;
		mo->q = 10, mo->q2 = 50;
	} else if (strncmp(preset, "asm", 3) == 0) {
		io->flag = 0, io->k = 19, io->w = 19;
		mo->bw = 1000, mo->bw_long = 100000;
		mo->max_gap = 10000;
		mo->flag |= MM_F_RMQ;
		mo->min_mid_occ = 50, mo->max_mid_occ = 500;
		mo->min_dp_max = 200;
		mo->best_n = 50;
		if (strcmp(preset, "asm5") == 0) {
			mo->a = 1, mo->b = 19, mo->q = 39, mo->q2 = 81, mo->e = 3, mo->e2 = 1, mo->zdrop = mo->zdrop_inv = 200;
		} else if (strcmp(preset, "asm10") == 0) {
			mo->a = 1, mo->b = 9, mo->q = 16, mo->q2 = 41, mo->e = 2, mo->e2 = 1, mo->zdrop = mo->zdrop_inv = 200;
		} else if (strcmp(preset, "asm20") == 0) {
			mo->a = 1, mo->b = 4, mo->q = 6, mo->q2 = 26, mo->e = 2, mo->e2 = 1, mo->zdrop = mo->zdrop_inv = 200;
			io->w = 10;
		} else return -1;
	} else if (strcmp(preset, "short") == 0 || strcmp(preset, "sr") == 0) {
		io->flag = 0, io->k = 21, io->w = 11;
		mo->flag |= MM_F_SR | MM_F_FRAG_MODE | MM_F_NO_PRINT_2ND | MM_F_2_IO_THREADS | MM_F_HEAP_SORT;
		mo->pe_ori = 0<<1|1; // FR
		mo->a = 2, mo->b = 8, mo->q = 12, mo->e = 2, mo->q2 = 24, mo->e2 = 1;
		mo->zdrop = mo->zdrop_inv = 100;
		mo->end_bonus = 10;
		mo->max_frag_len = 800;
		mo->max_gap = 100;
		mo->bw = mo->bw_long = 100;
		mo->pri_ratio = 0.5f;
		mo->min_cnt = 2;
		mo->min_chain_score = 25;
		mo->min_dp_max = 40;
		mo->best_n = 20;
		mo->mid_occ = 1000;
		mo->max_occ = 5000;
		mo->mini_batch_size = 50000000;
	} else if (strcmp(preset, "splice") == 0 || strcmp(preset, "splice:hq") == 0 || strcmp(preset, "splice:sr") == 0 || strcmp(preset, "cdna") == 0) {
		io->flag = 0, io->k = 15, io->w = 5;
		mo->flag |= MM_F_SPLICE | MM_F_SPLICE_FOR | MM_F_SPLICE_REV | MM_F_SPLICE_FLANK;
		mo->max_sw_mat = 0;
		mo->max_gap = 2000, mo->max_gap_ref = mo->bw = mo->bw_long = 200000;
		mo->a = 1, mo->b = 2, mo->q = 2, mo->e = 1, mo->q2 = 32, mo->e2 = 0;
		mo->noncan = 9;
		mo->junc_bonus = 9;
		mo->junc_pen = 5;
		mo->zdrop = 200, mo->zdrop_inv = 100; // because mo->a is halved
		if (strcmp(preset, "splice:hq") == 0) {
			mo->noncan = 5, mo->b = 4, mo->q = 6, mo->q2 = 24;
		} else if (strcmp(preset, "splice:sr") == 0) {
			mo->flag |= MM_F_NO_PRINT_2ND | MM_F_2_IO_THREADS | MM_F_HEAP_SORT | MM_F_FRAG_MODE | MM_F_WEAK_PAIRING | MM_F_SR_RNA;
			mo->noncan = 5, mo->b = 4, mo->q = 6, mo->q2 = 24;
			mo->min_chain_score = 25;
			mo->min_dp_max = 40;
			mo->min_ksw_len = 20;
			mo->pe_ori = 0<<1|1; // FR
			mo->best_n = 10;
			mo->mini_batch_size = 100000000;
		}
	} else return -1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
testq %rdi, %rdi
je 0x64f9
movq %rdi, %r14
leaq 0x25a17(%rip), %rsi     # 0x2bc63
callq 0x2240
xorl %ebp, %ebp
testl %eax, %eax
je 0x652b
leaq 0x259a4(%rip), %rsi     # 0x2bc06
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x652b
leaq 0x25995(%rip), %rsi     # 0x2bc0e
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x6547
leaq 0x25986(%rip), %rsi     # 0x2bc16
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x653a
leaq 0x25976(%rip), %rsi     # 0x2bc1d
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x653a
leaq 0x25966(%rip), %rsi     # 0x2bc24
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x65fc
leaq 0x25956(%rip), %rsi     # 0x2bc2b
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x6584
leaq 0x25945(%rip), %rsi     # 0x2bc31
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x6584
leaq 0x25937(%rip), %rsi     # 0x2bc3a
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x6584
leaq 0x25928(%rip), %rsi     # 0x2bc42
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x662c
leaq 0x25919(%rip), %rsi     # 0x2bc4a
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x6673
leaq 0x25915(%rip), %rsi     # 0x2bc5d
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x6697
leaq 0x25907(%rip), %rsi     # 0x2bc66
movl $0x3, %edx
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
je 0x676e
leaq 0x24115(%rip), %rsi     # 0x2a490
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x66c5
leaq 0x258fa(%rip), %rsi     # 0x2bc8c
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x66c5
leaq 0x253b4(%rip), %rsi     # 0x2b75d
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x63f7
leaq 0x258bf(%rip), %rsi     # 0x2bc7b
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x63f7
leaq 0x258b6(%rip), %rsi     # 0x2bc85
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x63f7
leaq 0x258ad(%rip), %rsi     # 0x2bc8f
movq %r14, %rdi
callq 0x2240
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x652d
movw $0x0, 0x4(%r15)
movl $0x5000f, (%r15)        # imm = 0x5000F
movq (%rbx), %r15
movq %r15, %rax
orq $0x40380, %rax          # imm = 0x40380
movq %rax, (%rbx)
movq $0x0, 0xf0(%rbx)
movabsq $0x30d40000007d0, %rax  # imm = 0x30D40000007D0
movq %rax, 0x1c(%rbx)
movabsq $0x30d4000030d40, %rax  # imm = 0x30D4000030D40
movq %rax, 0x14(%rbx)
movaps 0x2572e(%rip), %xmm0    # 0x2bb70
movups %xmm0, 0x64(%rbx)
movq $0x20, 0x74(%rbx)
movaps 0x2572b(%rip), %xmm0    # 0x2bb80
movups %xmm0, 0x84(%rbx)
movl $0x64, 0x94(%rbx)
leaq 0x2580e(%rip), %rsi     # 0x2bc7b
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x6875
leaq 0x25801(%rip), %rsi     # 0x2bc85
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
jne 0x652b
movabsq $0xc00044e380, %rax     # imm = 0xC00044E380
orq %rax, %r15
movq %r15, (%rbx)
movl $0x5, 0x84(%rbx)
movabsq $0x600000004, %rax      # imm = 0x600000004
movq %rax, 0x68(%rbx)
movl $0x18, 0x74(%rbx)
movl $0x19, 0x34(%rbx)
movabsq $0x1400000028, %rax     # imm = 0x1400000028
movq %rax, 0x9c(%rbx)
movl $0x1, 0xb8(%rbx)
movl $0xa, 0x5c(%rbx)
movq $0x5f5e100, 0xe8(%rbx) # imm = 0x5F5E100
jmp 0x652b
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movabsq $0xe0000000a000f, %rax  # imm = 0xE0000000A000F
movq %rax, (%r15)
movq $0x2faf080, 0x8(%r15)   # imm = 0x2FAF080
movabsq $0x1dcd65000, %rax      # imm = 0x1DCD65000
movq %rax, 0x10(%r15)
movq %rbx, %rdi
callq 0x6096
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
orb $0x1, 0x4(%r15)
movw $0x13, (%r15)
jmp 0x652b
movw $0x0, 0x4(%r15)
movl $0x5000f, (%r15)        # imm = 0x5000F
orl $0x800403, (%rbx)       # imm = 0x800403
movl $0x64, 0x34(%rbx)
xorl %ebp, %ebp
movl %ebp, 0x58(%rbx)
movl $0x19, 0x28(%rbx)
movabsq $0x7d0000007d0, %rax    # imm = 0x7D0000007D0
movq %rax, 0x14(%rbx)
movl %ebp, 0xe0(%rbx)
jmp 0x652d
movw $0x0, 0x4(%r15)
movl $0x130013, (%r15)       # imm = 0x130013
movl $0x2710, 0x1c(%rbx)     # imm = 0x2710
movabsq $0x1f400000032, %rax    # imm = 0x1F400000032
movq %rax, 0xcc(%rbx)
leaq 0x25680(%rip), %rsi     # 0x2bc31
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x65d4
leaq 0x25676(%rip), %rsi     # 0x2bc3a
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
jne 0x652d
movaps 0x255c5(%rip), %xmm0    # 0x2bba0
movups %xmm0, 0x64(%rbx)
movabsq $0x10000001a, %rax      # imm = 0x10000001A
movq %rax, 0x74(%rbx)
movl $0xc8, 0x9c(%rbx)
jmp 0x652b
orb $0x1, 0x4(%r15)
movl $0x50013, (%r15)        # imm = 0x50013
orl $0x800403, (%rbx)       # imm = 0x800403
movl $0x64, 0x34(%rbx)
xorl %ebp, %ebp
movl %ebp, 0x58(%rbx)
movl $0x19, 0x28(%rbx)
movl 0x14(%rbx), %eax
movl %eax, 0x18(%rbx)
jmp 0x657c
movw $0x0, 0x4(%r15)
movl $0x330019, (%r15)       # imm = 0x330019
orb $-0x80, 0x3(%rbx)
movabsq $0x1f400000032, %rax    # imm = 0x1F400000032
movq %rax, 0xcc(%rbx)
movl $0x1388, 0x44(%rbx)     # imm = 0x1388
movl $0xc8, 0xe0(%rbx)
movl $0x64, 0x5c(%rbx)
movl $0x40a00000, 0x38(%rbx) # imm = 0x40A00000
jmp 0x652b
movw $0x0, 0x4(%r15)
movw $0xf, (%r15)
movabsq $0xa00000006, %rax      # imm = 0xA00000006
movq %rax, 0x68(%rbx)
movl $0x1, 0x7c(%rbx)
jmp 0x66b9
movw $0x0, 0x4(%r15)
movw $0x13, (%r15)
movabsq $0xa00000006, %rax      # imm = 0xA00000006
movq %rax, 0x68(%rbx)
movl $0x4, 0x7c(%rbx)
movl $0x32, 0x74(%rbx)
jmp 0x652b
movw $0x0, 0x4(%r15)
movl $0xb0015, (%r15)        # imm = 0xB0015
orq $0x40f000, (%rbx)       # imm = 0x40F000
movl $0x1, 0xb8(%rbx)
movaps 0x254a5(%rip), %xmm0    # 0x2bb90
movups %xmm0, 0x64(%rbx)
movabsq $0x100000018, %rax      # imm = 0x100000018
movq %rax, 0x74(%rbx)
movabsq $0x6400000064, %rax     # imm = 0x6400000064
movq %rax, 0x90(%rbx)
movabsq $0x280000000a, %rcx     # imm = 0x280000000A
movq %rcx, 0x98(%rbx)
movl $0x320, 0x24(%rbx)      # imm = 0x320
movl $0x64, 0x1c(%rbx)
movq %rax, 0x14(%rbx)
movabsq $0x143f000000, %rax     # imm = 0x143F000000
movq %rax, 0x58(%rbx)
movabsq $0x1900000002, %rax     # imm = 0x1900000002
movq %rax, 0x30(%rbx)
movabsq $0x1388000003e8, %rax   # imm = 0x1388000003E8
movq %rax, 0xd4(%rbx)
movq $0x2faf080, 0xe8(%rbx) # imm = 0x2FAF080
jmp 0x652b
movw $0x0, 0x4(%r15)
movl $0x130013, (%r15)       # imm = 0x130013
movabsq $0x186a0000003e8, %rax  # imm = 0x186A0000003E8
movq %rax, 0x14(%rbx)
movl $0x2710, 0x1c(%rbx)     # imm = 0x2710
orb $-0x80, 0x3(%rbx)
movabsq $0x1f400000032, %rax    # imm = 0x1F400000032
movq %rax, 0xcc(%rbx)
movl $0xc8, 0x9c(%rbx)
movl $0x32, 0x5c(%rbx)
leaq 0x254ac(%rip), %rsi     # 0x2bc6a
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x682f
leaq 0x2549e(%rip), %rsi     # 0x2bc6f
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x6846
leaq 0x25491(%rip), %rsi     # 0x2bc75
movq %r14, %rdi
callq 0x2240
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x652d
movaps 0x253a0(%rip), %xmm0    # 0x2bba0
movups %xmm0, 0x64(%rbx)
movabsq $0x10000001a, %rax      # imm = 0x10000001A
movq %rax, 0x74(%rbx)
movabsq $0xc8000000c8, %rax     # imm = 0xC8000000C8
movq %rax, 0x90(%rbx)
movw $0xa, 0x2(%r15)
jmp 0x652b
movaps 0x2538a(%rip), %xmm0    # 0x2bbc0
movups %xmm0, 0x64(%rbx)
movabsq $0x100000051, %rax      # imm = 0x100000051
jmp 0x685b
movaps 0x25363(%rip), %xmm0    # 0x2bbb0
movups %xmm0, 0x64(%rbx)
movabsq $0x100000029, %rax      # imm = 0x100000029
movq %rax, 0x74(%rbx)
movabsq $0xc8000000c8, %rax     # imm = 0xC8000000C8
movq %rax, 0x90(%rbx)
jmp 0x652b
movl $0x5, 0x84(%rbx)
movabsq $0x600000004, %rax      # imm = 0x600000004
movq %rax, 0x68(%rbx)
movl $0x18, 0x74(%rbx)
jmp 0x652b