// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r12
testq %rdi, %rdi
je 0x50dd
movq %rdi, %r15
movb (%rdi), %bpl
cmpb $0x6c, %bpl
jne 0x4ef3
cmpb $0x72, 0x1(%r15)
jne 0x4ef3
cmpb $0x0, 0x2(%r15)
je 0x510b
leaq 0x22d2c(%rip), %rsi     # 0x27c26
movq %r15, %rdi
callq 0x2240
xorl %ebx, %ebx
testl %eax, %eax
je 0x515f
leaq 0x22d1b(%rip), %rsi     # 0x27c2e
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x511e
leaq 0x22d0c(%rip), %rsi     # 0x27c36
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x510f
leaq 0x22cfc(%rip), %rsi     # 0x27c3d
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x510f
leaq 0x22cec(%rip), %rsi     # 0x27c44
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x51df
leaq 0x22cdc(%rip), %rsi     # 0x27c4b
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x516a
leaq 0x22ccb(%rip), %rsi     # 0x27c51
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x516a
leaq 0x22cbd(%rip), %rsi     # 0x27c5a
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x516a
leaq 0x22cae(%rip), %rsi     # 0x27c62
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x5216
leaq 0x22c9f(%rip), %rsi     # 0x27c6a
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x5263
leaq 0x22c9b(%rip), %rsi     # 0x27c7d
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x530f
cmpb $0x61, %bpl
jne 0x528c
cmpb $0x73, 0x1(%r15)
jne 0x528c
cmpb $0x6d, 0x2(%r15)
jne 0x528c
andw $0x0, 0x4(%r12)
movl $0x130013, (%r12)       # imm = 0x130013
movabsq $0x186a0000003e8, %rax  # imm = 0x186A0000003E8
movq %rax, 0x14(%r14)
movl $0x2710, 0x1c(%r14)     # imm = 0x2710
orb $-0x80, 0x3(%r14)
movabsq $0x1f400000032, %rax    # imm = 0x1F400000032
movq %rax, 0xcc(%r14)
movl $0xc8, 0x9c(%r14)
movl $0x32, 0x5c(%r14)
leaq 0x22c1f(%rip), %rsi     # 0x27c86
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x5506
leaq 0x22c0d(%rip), %rsi     # 0x27c8b
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x551d
leaq 0x22bfc(%rip), %rsi     # 0x27c91
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
jne 0x5307
movabsq $0x10000001a, %rax      # imm = 0x10000001A
movq %rax, 0x74(%r14)
movaps 0x22b06(%rip), %xmm0    # 0x27bc0
movups %xmm0, 0x64(%r14)
movabsq $0xc8000000c8, %rax     # imm = 0xC8000000C8
movq %rax, 0x90(%r14)
movw $0xa, 0x2(%r12)
jmp 0x515f
movabsq $0xe0000000a000f, %rax  # imm = 0xE0000000A000F
movq %rax, (%r12)
movq $0x2faf080, 0x8(%r12)   # imm = 0x2FAF080
movabsq $0x1dcd65000, %rax      # imm = 0x1DCD65000
movq %rax, 0x10(%r12)
movq %r14, %rdi
callq 0x4cac
xorl %ebx, %ebx
jmp 0x515f
orb $0x1, 0x4(%r12)
movw $0x13, (%r12)
jmp 0x515f
andw $0x0, 0x4(%r12)
movl $0x5000f, (%r12)        # imm = 0x5000F
orl $0x800403, (%r14)       # imm = 0x800403
movl $0x64, 0x34(%r14)
andl $0x0, 0x58(%r14)
movl $0x19, 0x28(%r14)
movabsq $0x7d0000007d0, %rax    # imm = 0x7D0000007D0
movq %rax, 0x14(%r14)
andl $0x0, 0xe0(%r14)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
andw $0x0, 0x4(%r12)
movl $0x130013, (%r12)       # imm = 0x130013
movl $0x2710, 0x1c(%r14)     # imm = 0x2710
movabsq $0x1f400000032, %rax    # imm = 0x1F400000032
movq %rax, 0xcc(%r14)
leaq 0x22ab8(%rip), %rsi     # 0x27c51
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x51b8
leaq 0x22aae(%rip), %rsi     # 0x27c5a
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
jne 0x515f
movabsq $0x10000001a, %rax      # imm = 0x10000001A
movq %rax, 0x74(%r14)
movaps 0x229f3(%rip), %xmm0    # 0x27bc0
movups %xmm0, 0x64(%r14)
movl $0xc8, 0x9c(%r14)
jmp 0x515f
orb $0x1, 0x4(%r12)
movl $0x50013, (%r12)        # imm = 0x50013
orl $0x800403, (%r14)       # imm = 0x800403
movl $0x64, 0x34(%r14)
andl $0x0, 0x58(%r14)
movl $0x19, 0x28(%r14)
movl 0x14(%r14), %eax
movl %eax, 0x18(%r14)
jmp 0x5157
andw $0x0, 0x4(%r12)
movl $0x330019, (%r12)       # imm = 0x330019
orb $-0x80, 0x3(%r14)
movabsq $0x1f400000032, %rax    # imm = 0x1F400000032
movq %rax, 0xcc(%r14)
movl $0x1388, 0x44(%r14)     # imm = 0x1388
movl $0xc8, 0xe0(%r14)
movl $0x64, 0x5c(%r14)
movl $0x40a00000, 0x38(%r14) # imm = 0x40A00000
jmp 0x515f
andw $0x0, 0x4(%r12)
movw $0xf, (%r12)
movabsq $0xa00000006, %rax      # imm = 0xA00000006
movq %rax, 0x68(%r14)
movl $0x1, 0x7c(%r14)
jmp 0x5333
leaq 0x211fa(%rip), %rsi     # 0x2648d
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x543b
cmpb $0x73, %bpl
jne 0x52bb
cmpb $0x72, 0x1(%r15)
jne 0x52bb
cmpb $0x0, 0x2(%r15)
je 0x543b
leaq 0x22498(%rip), %rsi     # 0x2775a
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x5340
leaq 0x229c2(%rip), %rsi     # 0x27c97
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x5340
leaq 0x229b9(%rip), %rsi     # 0x27ca1
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x5340
leaq 0x229b0(%rip), %rsi     # 0x27cab
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x5340
pushq $-0x1
popq %rbx
jmp 0x515f
andw $0x0, 0x4(%r12)
movw $0x13, (%r12)
movabsq $0xa00000006, %rax      # imm = 0xA00000006
movq %rax, 0x68(%r14)
movl $0x4, 0x7c(%r14)
movl $0x32, 0x74(%r14)
jmp 0x515f
andw $0x0, 0x4(%r12)
movl $0x5000f, (%r12)        # imm = 0x5000F
movq (%r14), %r12
movq %r12, %rax
orq $0x40380, %rax          # imm = 0x40380
movq %rax, (%r14)
andq $0x0, 0xf0(%r14)
movaps 0x22803(%rip), %xmm0    # 0x27b70
movups %xmm0, 0x14(%r14)
movaps 0x22807(%rip), %xmm0    # 0x27b80
movups %xmm0, 0x64(%r14)
movq $0x20, 0x74(%r14)
movaps 0x22803(%rip), %xmm0    # 0x27b90
movups %xmm0, 0x84(%r14)
movl $0x64, 0x94(%r14)
leaq 0x228f0(%rip), %rsi     # 0x27c97
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
je 0x54e0
leaq 0x228e3(%rip), %rsi     # 0x27ca1
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
jne 0x515f
movabsq $0xc00044e380, %rax     # imm = 0xC00044E380
orq %rax, %r12
movq %r12, (%r14)
movl $0x5, 0x84(%r14)
movabsq $0x600000004, %rax      # imm = 0x600000004
movq %rax, 0x68(%r14)
movl $0x18, 0x74(%r14)
movl $0x19, 0x34(%r14)
movabsq $0x1400000028, %rax     # imm = 0x1400000028
movq %rax, 0x9c(%r14)
movl $0x1, 0xb8(%r14)
movl $0xa, 0x5c(%r14)
movq $0x5f5e100, 0xe8(%r14) # imm = 0x5F5E100
jmp 0x515f
andw $0x0, 0x4(%r12)
movl $0xb0015, (%r12)        # imm = 0xB0015
orq $0x40f000, (%r14)       # imm = 0x40F000
movl $0x1, 0xb8(%r14)
movaps 0x2273d(%rip), %xmm0    # 0x27ba0
movups %xmm0, 0x64(%r14)
movabsq $0x100000018, %rax      # imm = 0x100000018
movq %rax, 0x74(%r14)
movl $0x320, 0x24(%r14)      # imm = 0x320
movl $0x64, 0x1c(%r14)
movabsq $0x6400000064, %rax     # imm = 0x6400000064
movq %rax, 0x14(%r14)
movabsq $0x143f000000, %rax     # imm = 0x143F000000
movq %rax, 0x58(%r14)
movabsq $0x1900000002, %rax     # imm = 0x1900000002
movq %rax, 0x30(%r14)
movaps 0x226f9(%rip), %xmm0    # 0x27bb0
movups %xmm0, 0x90(%r14)
movabsq $0x1388000003e8, %rax   # imm = 0x1388000003E8
movq %rax, 0xd4(%r14)
movq $0x2faf080, 0xe8(%r14) # imm = 0x2FAF080
jmp 0x515f
movl $0x5, 0x84(%r14)
movabsq $0x600000004, %rax      # imm = 0x600000004
movq %rax, 0x68(%r14)
movl $0x18, 0x74(%r14)
jmp 0x515f
movabsq $0x100000051, %rax      # imm = 0x100000051
movq %rax, 0x74(%r14)
movaps 0x226c5(%rip), %xmm0    # 0x27be0
jmp 0x5532
movabsq $0x100000029, %rax      # imm = 0x100000029
movq %rax, 0x74(%r14)
movaps 0x2269e(%rip), %xmm0    # 0x27bd0
movups %xmm0, 0x64(%r14)
movabsq $0xc8000000c8, %rax     # imm = 0xC8000000C8
movq %rax, 0x90(%r14)
jmp 0x515f