// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/miniwfa.c
// Function: wf_pad_str
static void wf_pad_str(void *km, int32_t tl, const char *ts, int32_t ql, const char *qs, char **pts, char **pqs)
{
	uint8_t t[256];
	int32_t i, c1 = -1, c2 = -1;
	char *s1, *s2;
	*pts = *pqs = 0;
	// collect all used characters
	memset(t, 0, 256);
	for (i = 0; i < tl; ++i)
		if (t[(uint8_t)ts[i]] == 0)
			t[(uint8_t)ts[i]] = 1;
	for (i = 0; i < ql; ++i)
		if (t[(uint8_t)qs[i]] == 0)
			t[(uint8_t)qs[i]] = 1;
	for (i = 0; i < 256; ++i)
		if (t[i] == 0) {
			if (c1 < 0) c1 = i;
			else if (c2 < 0) c2 = i;
		}
	if (c1 < 0 || c2 < 0) return; // The two strings use >=255 characters. Unlikely for bio strings.
	s1 = Kmalloc(km, char, tl + ql + 16); // the two strings are allocated together
	s2 = s1 + tl + 8;
	memcpy(s1, ts, tl);
	for (i = tl; i < tl + 8; ++i) s1[i] = c1; // pad with c1
	memcpy(s2, qs, ql);
	for (i = ql; i < ql + 8; ++i) s2[i] = c2; // pad with c2
	*pts = s1, *pqs = s2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl $0xffffffff, -0x138(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x13c(%rbp) # imm = 0xFFFFFFFF
movq 0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
leaq -0x130(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x2190
movl $0x0, -0x134(%rbp)
movl -0x134(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x1d40d
movq -0x18(%rbp), %rax
movslq -0x134(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movzbl -0x130(%rbp,%rax), %eax
cmpl $0x0, %eax
jne 0x1d3fa
movq -0x18(%rbp), %rax
movslq -0x134(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movb $0x1, -0x130(%rbp,%rax)
jmp 0x1d3fc
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x1d3bc
movl $0x0, -0x134(%rbp)
movl -0x134(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1d468
movq -0x28(%rbp), %rax
movslq -0x134(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movzbl -0x130(%rbp,%rax), %eax
cmpl $0x0, %eax
jne 0x1d455
movq -0x28(%rbp), %rax
movslq -0x134(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movb $0x1, -0x130(%rbp,%rax)
jmp 0x1d457
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x1d417
movl $0x0, -0x134(%rbp)
cmpl $0x100, -0x134(%rbp)    # imm = 0x100
jge 0x1d4d5
movslq -0x134(%rbp), %rax
movzbl -0x130(%rbp,%rax), %eax
cmpl $0x0, %eax
jne 0x1d4c2
cmpl $0x0, -0x138(%rbp)
jge 0x1d4a9
movl -0x134(%rbp), %eax
movl %eax, -0x138(%rbp)
jmp 0x1d4c0
cmpl $0x0, -0x13c(%rbp)
jge 0x1d4be
movl -0x134(%rbp), %eax
movl %eax, -0x13c(%rbp)
jmp 0x1d4c0
jmp 0x1d4c2
jmp 0x1d4c4
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x1d472
cmpl $0x0, -0x138(%rbp)
jl 0x1d4e7
cmpl $0x0, -0x13c(%rbp)
jge 0x1d4ec
jmp 0x1d5ef
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
addl -0x1c(%rbp), %eax
addl $0x10, %eax
movslq %eax, %rsi
shlq $0x0, %rsi
callq 0x2890
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rax
movslq -0xc(%rbp), %rcx
addq %rcx, %rax
addq $0x8, %rax
movq %rax, -0x150(%rbp)
movq -0x148(%rbp), %rdi
movq -0x18(%rbp), %rsi
movslq -0xc(%rbp), %rdx
callq 0x2230
movl -0xc(%rbp), %eax
movl %eax, -0x134(%rbp)
movl -0x134(%rbp), %eax
movl -0xc(%rbp), %ecx
addl $0x8, %ecx
cmpl %ecx, %eax
jge 0x1d57c
movl -0x138(%rbp), %eax
movb %al, %dl
movq -0x148(%rbp), %rax
movslq -0x134(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x1d542
movq -0x150(%rbp), %rdi
movq -0x28(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x2230
movl -0x1c(%rbp), %eax
movl %eax, -0x134(%rbp)
movl -0x134(%rbp), %eax
movl -0x1c(%rbp), %ecx
addl $0x8, %ecx
cmpl %ecx, %eax
jge 0x1d5d3
movl -0x13c(%rbp), %eax
movb %al, %dl
movq -0x150(%rbp), %rax
movslq -0x134(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x1d599
movq -0x148(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x150(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, (%rax)
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax,%rax)