// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/string.c
// Function: rstr_trim_ex
void rstr_trim_ex(
	ResizableString *dst,
	ResizableString *src,
	RstrCharComparer comparer
) {
	assert(dst);
	assert(src);
	assert(dst != src);
	assert(comparer);

	int start = 0;
	for (; start < RSTR_LEN(src) && comparer(RSTR_CHAR(src, start)); start++);

	int len = RSTR_LEN(src);
	for (; len > 0 && comparer(RSTR_CHAR(src, len - 1)); len--);

	rstr_sub_string(dst, src, start, len - start);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1174d
jmp 0x1176c
leaq 0x34915(%rip), %rdi     # 0x46069
leaq 0x363c9(%rip), %rsi     # 0x47b24
movl $0x1f9, %edx            # imm = 0x1F9
leaq 0x36912(%rip), %rcx     # 0x48079
callq 0xa0b0
cmpq $0x0, -0x10(%rbp)
je 0x11775
jmp 0x11794
leaq 0x36840(%rip), %rdi     # 0x47fbc
leaq 0x363a1(%rip), %rsi     # 0x47b24
movl $0x1fa, %edx            # imm = 0x1FA
leaq 0x368ea(%rip), %rcx     # 0x48079
callq 0xa0b0
movq -0x8(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x117a0
jmp 0x117bf
leaq 0x3680e(%rip), %rdi     # 0x47fb5
leaq 0x36376(%rip), %rsi     # 0x47b24
movl $0x1fb, %edx            # imm = 0x1FB
leaq 0x368bf(%rip), %rcx     # 0x48079
callq 0xa0b0
cmpq $0x0, -0x18(%rbp)
je 0x117c8
jmp 0x117e7
leaq 0x355a0(%rip), %rdi     # 0x46d6f
leaq 0x3634e(%rip), %rsi     # 0x47b24
movl $0x1fc, %edx            # imm = 0x1FC
leaq 0x36897(%rip), %rcx     # 0x48079
callq 0xa0b0
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpl 0x4(%rdx), %ecx
movb %al, -0x21(%rbp)
jge 0x1185f
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jl 0x1181d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x34(%rbp)
jmp 0x11850
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x11835
leaq 0x36058(%rip), %rax     # 0x47887
movq %rax, -0x40(%rbp)
jmp 0x11841
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
movl -0x34(%rbp), %ecx
movsbl %cl, %edi
callq *%rax
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x11868
jmp 0x11878
jmp 0x1186a
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x117ee
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x20(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x20(%rbp)
movb %al, -0x41(%rbp)
jle 0x118f5
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x20(%rbp), %eax
subl $0x1, %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jl 0x118ae
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x54(%rbp)
jmp 0x118e6
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x118c6
leaq 0x35fc7(%rip), %rax     # 0x47887
movq %rax, -0x60(%rbp)
jmp 0x118d2
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x54(%rbp)
movq -0x50(%rbp), %rax
movl -0x54(%rbp), %ecx
movsbl %cl, %edi
callq *%rax
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x118fe
jmp 0x1190e
jmp 0x11900
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x11882
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
movl -0x20(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rcx
callq 0x11230
addq $0x60, %rsp
popq %rbp
retq
nop