	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbfl_substr                    ## -- Begin function mbfl_substr
	.p2align	4, 0x90
_mbfl_substr:                           ## @mbfl_substr
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	16(%rdi), %rbx
	movq	%rsi, %rdi
	callq	_mbfl_string_init
	movl	24(%r14), %eax
	movl	%eax, 24(%r13)
	movq	16(%r14), %rax
	movq	%rax, 16(%r13)
	movl	(%rbx), %r9d
	movq	_MBFL_ENCTYPE_SBCS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	movq	_MBFL_ENCTYPE_WCS2BE@GOTPCREL(%rip), %rdi
	movq	_MBFL_ENCTYPE_WCS2LE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_MBFL_ENCTYPE_WCS4BE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_MBFL_ENCTYPE_WCS4LE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdi), %esi
	movl	%eax, %edi
	orl	%edx, %edi
	orl	%esi, %edi
	orl	%ecx, %edi
	testl	%r9d, %edi
	jne	LBB0_2
## %bb.1:
	cmpq	$0, 8(%rbx)
	je	LBB0_11
LBB0_2:
	movq	(%r14), %r15
	testl	%r9d, %eax
	je	LBB0_6
## %bb.3:
	movq	_MBFL_SUBSTR_UNTIL_END@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%r12), %rdx
	cmpq	%r12, (%rax)
	cmoveq	%r15, %rdx
	movq	%rcx, %r12
LBB0_4:
	cmpq	%r15, %rdx
	cmovbq	%rdx, %r15
	cmpq	%r12, %r15
	cmovbq	%r15, %r12
	subq	%r12, %r15
	movq	$0, (%r13)
	leaq	1(%r15), %rdi
	callq	_mbfl_malloc
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	movq	%rax, %rbx
	movq	%r15, (%r13)
	addq	8(%r14), %r12
	movq	%rax, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_memcpy
	movb	$0, (%rbx,%r15)
	jmp	LBB0_10
LBB0_6:
	movq	%rbx, %r11
	testl	%r9d, %esi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_21
## %bb.7:
	movq	%r12, %rcx
	leaq	(%rbx,%rbx), %r12
	movq	_MBFL_SUBSTR_UNTIL_END@GOTPCREL(%rip), %rax
	cmpq	%rcx, (%rax)
	jne	LBB0_23
## %bb.8:
	movq	%r15, %rdx
	jmp	LBB0_4
LBB0_11:
	movq	_MBFL_SUBSTR_UNTIL_END@GOTPCREL(%rip), %rax
	cmpq	%r12, (%rax)
	jne	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	callq	_mbfl_strlen
	movq	%rax, %r12
	subq	-48(%rbp), %r12                 ## 8-byte Folded Reload
LBB0_13:
	leaq	1(%r12), %rsi
	leaq	-120(%rbp), %r15
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_mbfl_memory_device_init
	movq	%r13, %rdi
	callq	_mbfl_string_init
	movl	24(%r14), %eax
	movl	%eax, 24(%r13)
	movq	16(%r14), %rax
	movq	%rax, 16(%r13)
	movq	16(%r14), %rsi
	movq	_mbfl_memory_device_output@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_mbfl_encoding_wchar@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	movq	%r15, %r8
	callq	_mbfl_convert_filter_new
	movq	%rax, %r15
	movq	16(%r14), %rdi
	movq	_collector_substr@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-88(%rbp), %r8
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_mbfl_convert_filter_new
	movq	%rax, %rbx
	testq	%r15, %r15
	je	LBB0_24
## %bb.14:
	testq	%rbx, %rbx
	je	LBB0_24
## %bb.15:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, -88(%rbp)
	addq	%rax, %r12
	movq	%r12, -80(%rbp)
	movq	$0, -72(%rbp)
	movq	8(%r14), %r15
	testq	%r15, %r15
	je	LBB0_20
## %bb.16:
	movq	(%r14), %r14
	testq	%r14, %r14
	je	LBB0_20
## %bb.17:
	decq	%r14
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%r15,%r12), %edi
	movq	%rbx, %rsi
	callq	*(%rbx)
	testq	%rax, %rax
	js	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	leaq	1(%r12), %rax
	cmpq	%r12, %r14
	movq	%rax, %r12
	jne	LBB0_18
LBB0_20:
	movq	%rbx, %rdi
	callq	_mbfl_convert_filter_flush
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_mbfl_convert_filter_flush
	leaq	-120(%rbp), %rdi
	movq	%r13, %rsi
	callq	_mbfl_memory_device_result
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_mbfl_convert_filter_delete
	movq	%r14, %rdi
	callq	_mbfl_convert_filter_delete
	jmp	LBB0_10
LBB0_21:
	movq	%r12, %r10
	orl	%edx, %ecx
	testl	%r9d, %ecx
	je	LBB0_25
## %bb.22:
	shlq	$2, %rbx
	movq	_MBFL_SUBSTR_UNTIL_END@GOTPCREL(%rip), %rax
	movq	%rbx, %r12
	jmp	LBB0_29
LBB0_23:
	addq	%rcx, %rbx
	addq	%rbx, %rbx
	movq	%rbx, %rdx
	jmp	LBB0_4
LBB0_24:
	movq	%rbx, %rdi
	callq	_mbfl_convert_filter_delete
	movq	%r15, %rdi
	callq	_mbfl_convert_filter_delete
LBB0_9:
	xorl	%r13d, %r13d
LBB0_10:
	movq	%r13, %rax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	movq	8(%r11), %r8
	movq	8(%r14), %rsi
	xorl	%edx, %edx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_26:                                ## =>This Inner Loop Header: Depth=1
	movq	%rdx, %r12
	cmpq	%r15, %rdx
	jae	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_26 Depth=1
	movzbl	(%rsi), %eax
	movzbl	(%r8,%rax), %eax
	leaq	(%r12,%rax), %rdx
	addq	%rax, %rsi
	incq	%rdi
	cmpq	%rbx, %rdi
	jbe	LBB0_26
LBB0_28:
	movq	_MBFL_SUBSTR_UNTIL_END@GOTPCREL(%rip), %rax
LBB0_29:
	movq	%r15, %rdx
	cmpq	%r10, (%rax)
	je	LBB0_4
## %bb.30:
	testl	%r9d, %ecx
	je	LBB0_32
## %bb.31:
	leaq	(%r12,%r10,4), %rdx
	jmp	LBB0_4
LBB0_32:
	movq	8(%r11), %rax
	movq	8(%r14), %rcx
	addq	%r12, %rcx
	xorl	%esi, %esi
	movq	%r12, %rdi
	.p2align	4, 0x90
LBB0_33:                                ## =>This Inner Loop Header: Depth=1
	movq	%rdi, %rdx
	cmpq	%r15, %rdi
	jae	LBB0_4
## %bb.34:                              ##   in Loop: Header=BB0_33 Depth=1
	movzbl	(%rcx), %edi
	movzbl	(%rax,%rdi), %ebx
	leaq	(%rdx,%rbx), %rdi
	addq	%rbx, %rcx
	incq	%rsi
	cmpq	%r10, %rsi
	jbe	LBB0_33
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_MBFL_ENCTYPE_SBCS,4,2          ## @MBFL_ENCTYPE_SBCS
	.comm	_MBFL_ENCTYPE_WCS2BE,4,2        ## @MBFL_ENCTYPE_WCS2BE
	.comm	_MBFL_ENCTYPE_WCS2LE,4,2        ## @MBFL_ENCTYPE_WCS2LE
	.comm	_MBFL_ENCTYPE_WCS4BE,4,2        ## @MBFL_ENCTYPE_WCS4BE
	.comm	_MBFL_ENCTYPE_WCS4LE,4,2        ## @MBFL_ENCTYPE_WCS4LE
	.comm	_MBFL_SUBSTR_UNTIL_END,8,3      ## @MBFL_SUBSTR_UNTIL_END
	.comm	_mbfl_encoding_wchar,16,3       ## @mbfl_encoding_wchar
	.comm	_mbfl_memory_device_output,4,2  ## @mbfl_memory_device_output
	.comm	_collector_substr,4,2           ## @collector_substr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbfl_substr                    ; -- Begin function mbfl_substr
	.p2align	2
_mbfl_substr:                           ; @mbfl_substr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x23, [x0, #16]
	mov	x0, x1
	bl	_mbfl_string_init
	ldr	w8, [x20, #24]
	str	w8, [x19, #24]
	ldr	x8, [x20, #16]
	str	x8, [x19, #16]
	ldr	w10, [x23]
Lloh0:
	adrp	x8, _MBFL_ENCTYPE_SBCS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MBFL_ENCTYPE_SBCS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
Lloh3:
	adrp	x8, _MBFL_ENCTYPE_WCS2BE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MBFL_ENCTYPE_WCS2BE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x11, _MBFL_ENCTYPE_WCS2LE@GOTPAGE
Lloh7:
	ldr	x11, [x11, _MBFL_ENCTYPE_WCS2LE@GOTPAGEOFF]
Lloh8:
	ldr	w13, [x11]
Lloh9:
	adrp	x11, _MBFL_ENCTYPE_WCS4BE@GOTPAGE
Lloh10:
	ldr	x11, [x11, _MBFL_ENCTYPE_WCS4BE@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
Lloh12:
	adrp	x12, _MBFL_ENCTYPE_WCS4LE@GOTPAGE
Lloh13:
	ldr	x12, [x12, _MBFL_ENCTYPE_WCS4LE@GOTPAGEOFF]
Lloh14:
	ldr	w12, [x12]
	orr	w13, w13, w8
	orr	w8, w13, w9
	orr	w8, w8, w11
	orr	w8, w8, w12
	tst	w8, w10
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_9
LBB0_2:
	ldr	x8, [x20]
	tst	w9, w10
	b.eq	LBB0_6
; %bb.3:
Lloh15:
	adrp	x9, _MBFL_SUBSTR_UNTIL_END@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MBFL_SUBSTR_UNTIL_END@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x10, x22, x21
	cmp	x9, x21
	csel	x9, x8, x10, eq
	mov	x10, x22
LBB0_4:
	cmp	x9, x8
	csel	x8, x9, x8, lo
	cmp	x8, x10
	csel	x23, x8, x10, lo
	sub	x21, x8, x23
	str	xzr, [x19]
	add	x0, x21, #1
	bl	_mbfl_malloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_22
; %bb.5:
	mov	x22, x0
	str	x21, [x19]
	ldr	x8, [x20, #8]
	add	x1, x8, x23
	mov	x2, x21
	bl	_memcpy
	strb	wzr, [x22, x21]
	b	LBB0_23
LBB0_6:
	mov	x9, x8
	tst	w13, w10
	b.eq	LBB0_19
; %bb.7:
	lsl	x10, x22, #1
Lloh18:
	adrp	x11, _MBFL_SUBSTR_UNTIL_END@GOTPAGE
Lloh19:
	ldr	x11, [x11, _MBFL_SUBSTR_UNTIL_END@GOTPAGEOFF]
Lloh20:
	ldr	x11, [x11]
	cmp	x11, x21
	b.eq	LBB0_4
; %bb.8:
	add	x9, x22, x21
	lsl	x9, x9, #1
	b	LBB0_4
LBB0_9:
Lloh21:
	adrp	x8, _MBFL_SUBSTR_UNTIL_END@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MBFL_SUBSTR_UNTIL_END@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cmp	x8, x21
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x20
	bl	_mbfl_strlen
	sub	x21, x0, x22
LBB0_11:
	add	x1, x21, #1
	add	x0, sp, #32
	mov	w2, #0
	bl	_mbfl_memory_device_init
	mov	x0, x19
	bl	_mbfl_string_init
	ldr	w8, [x20, #24]
	str	w8, [x19, #24]
	ldr	x8, [x20, #16]
	str	x8, [x19, #16]
	ldr	x1, [x20, #16]
Lloh24:
	adrp	x8, _mbfl_memory_device_output@GOTPAGE
Lloh25:
	ldr	x8, [x8, _mbfl_memory_device_output@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
Lloh27:
	adrp	x24, _mbfl_encoding_wchar@GOTPAGE
Lloh28:
	ldr	x24, [x24, _mbfl_encoding_wchar@GOTPAGEOFF]
	add	x4, sp, #32
	mov	x0, x24
	mov	w3, #0
	bl	_mbfl_convert_filter_new
	mov	x23, x0
	ldr	x0, [x20, #16]
Lloh29:
	adrp	x8, _collector_substr@GOTPAGE
Lloh30:
	ldr	x8, [x8, _collector_substr@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x4, sp
	mov	x1, x24
	mov	w3, #0
	bl	_mbfl_convert_filter_new
	mov	x24, x0
	cbz	x23, LBB0_21
; %bb.12:
	cbz	x24, LBB0_21
; %bb.13:
	add	x8, x21, x22
	stp	x22, x8, [sp]
	stp	xzr, x23, [sp, #16]
	ldr	x21, [x20, #8]
	cbz	x21, LBB0_18
; %bb.14:
	ldr	x8, [x20]
	cbz	x8, LBB0_18
; %bb.15:
	sub	x8, x8, #1
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x20, x8
	ldr	x8, [x24]
	ldrb	w0, [x21], #1
	mov	x1, x24
	blr	x8
	tbnz	x0, #63, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	sub	x8, x20, #1
	cbnz	x20, LBB0_16
LBB0_18:
	mov	x0, x24
	bl	_mbfl_convert_filter_flush
	mov	x0, x23
	bl	_mbfl_convert_filter_flush
	add	x0, sp, #32
	mov	x1, x19
	bl	_mbfl_memory_device_result
	mov	x19, x0
	mov	x0, x24
	bl	_mbfl_convert_filter_delete
	mov	x0, x23
	bl	_mbfl_convert_filter_delete
	b	LBB0_23
LBB0_19:
	orr	w11, w12, w11
	ands	w11, w11, w10
	b.eq	LBB0_24
; %bb.20:
	lsl	x10, x22, #2
	b	LBB0_27
LBB0_21:
	mov	x0, x24
	bl	_mbfl_convert_filter_delete
	mov	x0, x23
	bl	_mbfl_convert_filter_delete
LBB0_22:
	mov	x19, #0
LBB0_23:
	mov	x0, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_24:
	mov	x15, #0
	mov	x12, #0
	ldr	x13, [x23, #8]
	ldr	x14, [x20, #8]
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	mov	x10, x15
	cmp	x15, x8
	b.hs	LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_25 Depth=1
	ldrb	w15, [x14]
	ldrb	w16, [x13, x15]
	add	x15, x10, x16
	add	x14, x14, x16
	add	x12, x12, #1
	cmp	x12, x22
	b.ls	LBB0_25
LBB0_27:
Lloh32:
	adrp	x12, _MBFL_SUBSTR_UNTIL_END@GOTPAGE
Lloh33:
	ldr	x12, [x12, _MBFL_SUBSTR_UNTIL_END@GOTPAGEOFF]
Lloh34:
	ldr	x12, [x12]
	cmp	x12, x21
	b.eq	LBB0_4
; %bb.28:
	cbz	w11, LBB0_30
; %bb.29:
	add	x9, x10, x21, lsl #2
	b	LBB0_4
LBB0_30:
	mov	x11, #0
	ldr	x12, [x23, #8]
	ldr	x9, [x20, #8]
	add	x13, x9, x10
	mov	x14, x10
LBB0_31:                                ; =>This Inner Loop Header: Depth=1
	mov	x9, x14
	cmp	x14, x8
	b.hs	LBB0_4
; %bb.32:                               ;   in Loop: Header=BB0_31 Depth=1
	ldrb	w14, [x13]
	ldrb	w15, [x12, x14]
	add	x14, x9, x15
	add	x13, x13, x15
	add	x11, x11, #1
	cmp	x11, x21
	b.ls	LBB0_31
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_MBFL_ENCTYPE_SBCS,4,2          ; @MBFL_ENCTYPE_SBCS
	.comm	_MBFL_ENCTYPE_WCS2BE,4,2        ; @MBFL_ENCTYPE_WCS2BE
	.comm	_MBFL_ENCTYPE_WCS2LE,4,2        ; @MBFL_ENCTYPE_WCS2LE
	.comm	_MBFL_ENCTYPE_WCS4BE,4,2        ; @MBFL_ENCTYPE_WCS4BE
	.comm	_MBFL_ENCTYPE_WCS4LE,4,2        ; @MBFL_ENCTYPE_WCS4LE
	.comm	_MBFL_SUBSTR_UNTIL_END,8,3      ; @MBFL_SUBSTR_UNTIL_END
	.comm	_mbfl_encoding_wchar,16,3       ; @mbfl_encoding_wchar
	.comm	_mbfl_memory_device_output,4,2  ; @mbfl_memory_device_output
	.comm	_collector_substr,4,2           ; @collector_substr
.subsections_via_symbols
