// File: /workspace/github_c_makefile_star2_O3/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, %rbx
movq %rsi, %r15
testq %rdi, %rdi
je 0x63bb
movq %rdi, %r14
movb (%rdi), %r12b
cmpb $0x6c, %r12b
jne 0x61da
cmpb $0x72, 0x1(%r14)
jne 0x61da
cmpb $0x0, 0x2(%r14)
je 0x63f3
leaq 0x26a45(%rip), %rsi     # 0x2cc26
movq %r14, %rdi
callq 0x2240
xorl %ebp, %ebp
testl %eax, %eax
je 0x63f3
leaq 0x26a34(%rip), %rsi     # 0x2cc2e
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x6400
leaq 0x26a25(%rip), %rsi     # 0x2cc36
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x63e8
leaq 0x26a15(%rip), %rsi     # 0x2cc3d
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x63e8
leaq 0x26a05(%rip), %rsi     # 0x2cc44
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x64b5
leaq 0x269f5(%rip), %rsi     # 0x2cc4b
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x643d
leaq 0x269e4(%rip), %rsi     # 0x2cc51
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x643d
leaq 0x269d6(%rip), %rsi     # 0x2cc5a
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x643d
leaq 0x269c7(%rip), %rsi     # 0x2cc62
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x64e5
leaq 0x269b8(%rip), %rsi     # 0x2cc6a
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x652c
leaq 0x269b4(%rip), %rsi     # 0x2cc7d
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x6550
cmpb $0x61, %r12b
jne 0x657e
cmpb $0x73, 0x1(%r14)
jne 0x6650
cmpb $0x6d, 0x2(%r14)
jne 0x6650
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 0x2693d(%rip), %rsi     # 0x2cc86
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x67d0
leaq 0x2692b(%rip), %rsi     # 0x2cc8b
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x67e7
leaq 0x2691a(%rip), %rsi     # 0x2cc91
movq %r14, %rdi
callq 0x2240
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x63f5
movabsq $0x10000001a, %rax      # imm = 0x10000001A
movq %rax, 0x74(%rbx)
movaps 0x26823(%rip), %xmm0    # 0x2cbc0
movups %xmm0, 0x64(%rbx)
movabsq $0xc8000000c8, %rax     # imm = 0xC8000000C8
movq %rax, 0x90(%rbx)
movw $0xa, 0x2(%r15)
jmp 0x63f3
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 0x5ffc
jmp 0x63f3
orb $0x1, 0x4(%r15)
movw $0x13, (%r15)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
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 0x63f5
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 0x267e7(%rip), %rsi     # 0x2cc51
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x648d
leaq 0x267dd(%rip), %rsi     # 0x2cc5a
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
jne 0x63f5
movabsq $0x10000001a, %rax      # imm = 0x10000001A
movq %rax, 0x74(%rbx)
movaps 0x2671e(%rip), %xmm0    # 0x2cbc0
movups %xmm0, 0x64(%rbx)
movl $0xc8, 0x9c(%rbx)
jmp 0x63f3
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 0x6435
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 0x63f3
movw $0x0, 0x4(%r15)
movw $0xf, (%r15)
movabsq $0xa00000006, %rax      # imm = 0xA00000006
movq %rax, 0x68(%rbx)
movl $0x1, 0x7c(%rbx)
jmp 0x6572
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 0x63f3
leaq 0x24f08(%rip), %rsi     # 0x2b48d
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x65b1
cmpb $0x73, %r12b
jne 0x6667
cmpb $0x72, 0x1(%r14)
jne 0x6667
cmpb $0x0, 0x2(%r14)
jne 0x6667
movw $0x0, 0x4(%r15)
movl $0xb0015, (%r15)        # imm = 0xB0015
orq $0x40f000, (%rbx)       # imm = 0x40F000
movl $0x1, 0xb8(%rbx)
movaps 0x265c9(%rip), %xmm0    # 0x2cba0
movups %xmm0, 0x64(%rbx)
movabsq $0x100000018, %rax      # imm = 0x100000018
movq %rax, 0x74(%rbx)
movl $0x320, 0x24(%rbx)      # imm = 0x320
movl $0x64, 0x1c(%rbx)
movabsq $0x6400000064, %rax     # imm = 0x6400000064
movq %rax, 0x14(%rbx)
movabsq $0x143f000000, %rax     # imm = 0x143F000000
movq %rax, 0x58(%rbx)
movabsq $0x1900000002, %rax     # imm = 0x1900000002
movq %rax, 0x30(%rbx)
movaps 0x26588(%rip), %xmm0    # 0x2cbb0
movups %xmm0, 0x90(%rbx)
movabsq $0x1388000003e8, %rax   # imm = 0x1388000003E8
movq %rax, 0xd4(%rbx)
movq $0x2faf080, 0xe8(%rbx) # imm = 0x2FAF080
jmp 0x63f3
leaq 0x24e36(%rip), %rsi     # 0x2b48d
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x65b1
leaq 0x260ec(%rip), %rsi     # 0x2c75a
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x66bc
leaq 0x26616(%rip), %rsi     # 0x2cc97
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x66bc
leaq 0x2660d(%rip), %rsi     # 0x2cca1
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x66bc
leaq 0x26604(%rip), %rsi     # 0x2ccab
movq %r14, %rdi
callq 0x2240
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x63f5
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)
movaps 0x26485(%rip), %xmm0    # 0x2cb70
movups %xmm0, 0x14(%rbx)
movaps 0x2648a(%rip), %xmm0    # 0x2cb80
movups %xmm0, 0x64(%rbx)
movq $0x20, 0x74(%rbx)
movaps 0x26487(%rip), %xmm0    # 0x2cb90
movups %xmm0, 0x84(%rbx)
movl $0x64, 0x94(%rbx)
leaq 0x26576(%rip), %rsi     # 0x2cc97
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x67ac
leaq 0x2656d(%rip), %rsi     # 0x2cca1
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
jne 0x63f3
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 0x63f3
movl $0x5, 0x84(%rbx)
movabsq $0x600000004, %rax      # imm = 0x600000004
movq %rax, 0x68(%rbx)
movl $0x18, 0x74(%rbx)
jmp 0x63f3
movabsq $0x100000051, %rax      # imm = 0x100000051
movq %rax, 0x74(%rbx)
movaps 0x263fb(%rip), %xmm0    # 0x2cbe0
jmp 0x67fc
movabsq $0x100000029, %rax      # imm = 0x100000029
movq %rax, 0x74(%rbx)
movaps 0x263d4(%rip), %xmm0    # 0x2cbd0
movups %xmm0, 0x64(%rbx)
movabsq $0xc8000000c8, %rax     # imm = 0xC8000000C8
movq %rax, 0x90(%rbx)
jmp 0x63f3