	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_prepare_str_cp1251             ## -- Begin function prepare_str_cp1251
	.p2align	4, 0x90
_prepare_str_cp1251:                    ## @prepare_str_cp1251
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_MAX_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	decl	%ecx
	cmpl	%esi, %ecx
	jle	LBB0_25
## %bb.1:
	movl	%esi, %ebx
	movq	%rdi, %r14
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_sp_init
	movq	%r14, %rdi
	callq	_sp_to_lower
	testl	%ebx, %ebx
	jle	LBB0_27
## %bb.2:
	movl	%ebx, %r10d
	movl	$-1, %r9d
	movq	_name_buff@GOTPCREL(%rip), %r8
	xorl	%edi, %edi
	xorl	%r11d, %r11d
	xorl	%r14d, %r14d
	xorl	%ecx, %ecx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	%r14d, %edx
	movl	%r9d, %r11d
LBB0_4:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r8), %rbx
	movslq	%r9d, %rsi
	movb	%dl, (%rbx,%rsi)
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=1
	incl	%r11d
	testb	%r13b, %r13b
	cmovnel	%r12d, %ecx
	incq	%rdi
	cmpq	%rdi, %r10
	je	LBB0_26
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$2, %ecx
	je	LBB0_13
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$1, %ecx
	je	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	testl	%ecx, %ecx
	jne	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpb	$38, (%rax,%rdi)
	jne	LBB0_18
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	xorl	%r13d, %r13d
	movl	$1, %ecx
	movl	%r11d, %r9d
	xorl	%r14d, %r14d
	testb	%r13b, %r13b
	jne	LBB0_19
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	cmpb	$35, (%rax,%rdi)
	jne	LBB0_18
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	$2, %ecx
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	movsbl	(%rax,%rdi), %ebx
	leal	-48(%rbx), %ecx
	cmpb	$9, %cl
	ja	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	$2, %ecx
	cmpl	$131071, %r14d                  ## imm = 0x1FFFF
	jg	LBB0_24
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=1
	leal	(%r14,%r14,4), %edx
	leal	(%rbx,%rdx,2), %r14d
	addl	$-48, %r14d
LBB0_24:                                ##   in Loop: Header=BB0_6 Depth=1
	xorl	%r13d, %r13d
	testb	%r13b, %r13b
	jne	LBB0_19
	jmp	LBB0_23
LBB0_16:                                ##   in Loop: Header=BB0_6 Depth=1
	cmpb	$59, %bl
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	$3, %ecx
	movb	$1, %r13b
	testb	%r13b, %r13b
	jne	LBB0_19
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_6 Depth=1
	xorl	%r13d, %r13d
	xorl	%ecx, %ecx
	testb	%r13b, %r13b
	je	LBB0_23
LBB0_19:                                ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$32, %r14d
	jl	LBB0_23
## %bb.20:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$8232, %r14d                    ## imm = 0x2028
	je	LBB0_23
## %bb.21:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$8233, %r14d                    ## imm = 0x2029
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$131071, %r14d                  ## imm = 0x1FFFF
	jle	LBB0_3
LBB0_23:                                ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$65536, %r14d                   ## imm = 0x10000
	setge	%bl
	andb	%r13b, %bl
	movq	_win_to_utf8_convert@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movzbl	(%rax,%rdi), %r15d
	movzbl	(%rdx,%r15), %r15d
	movq	(%r8), %rdx
	movq	%r8, %rsi
	movslq	%r11d, %r8
	movb	%r15b, (%rdx,%r8)
	movq	%rsi, %r8
	movb	$36, %dl
	cmpb	$1, %bl
	je	LBB0_4
	jmp	LBB0_5
LBB0_25:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	movslq	%r11d, %r12
LBB0_27:
	movq	_name_buff@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movb	$0, (%rcx,%r12)
	movq	(%rax), %rdi
	callq	_prepare_str_UTF8
	movq	_prepare_res@GOTPCREL(%rip), %r12
	movq	(%r12), %r14
	movl	(%rax), %edi
	testl	%edi, %edi
	je	LBB0_30
## %bb.28:
	movq	%rax, %rbx
	addq	$4, %rbx
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rsi
	callq	_put_char_utf8
	cltq
	addq	%rax, %r14
	movl	(%rbx), %edi
	addq	$4, %rbx
	testl	%edi, %edi
	jne	LBB0_29
LBB0_30:
	movb	$0, (%r14)
	subq	(%r12), %r14
	incq	%r14
	movq	_MAX_NAME_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	xorl	%edi, %edi
	cmpq	%rax, %r14
	setl	%dil
	callq	_assert
	movq	(%r12), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_clean_str                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_NAME_SIZE,4,2              ## @MAX_NAME_SIZE
	.comm	_name_buff,8,3                  ## @name_buff
	.comm	_win_to_utf8_convert,8,3        ## @win_to_utf8_convert
	.comm	_prepare_res,8,3                ## @prepare_res
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_prepare_str_cp1251             ; -- Begin function prepare_str_cp1251
	.p2align	2
_prepare_str_cp1251:                    ; @prepare_str_cp1251
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x21, _MAX_NAME_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MAX_NAME_SIZE@GOTPAGEOFF]
	ldr	w8, [x21]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #2
	sub	w8, w8, #1
	cmp	w8, w1
	b.le	LBB0_25
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	bl	_sp_init
	mov	x0, x20
	bl	_sp_to_lower
Lloh2:
	adrp	x8, _name_buff@GOTPAGE
Lloh3:
	ldr	x8, [x8, _name_buff@GOTPAGEOFF]
	cmp	w19, #1
	b.lt	LBB0_27
; %bb.2:
	mov	w9, #0
	mov	w10, #0
	mov	w1, #0
	mov	w15, #-1
	mov	w11, #2
	mov	w12, #10
	mov	w13, #8232
	mov	w14, #8233
Lloh4:
	adrp	x16, _win_to_utf8_convert@GOTPAGE
Lloh5:
	ldr	x16, [x16, _win_to_utf8_convert@GOTPAGEOFF]
	mov	w17, w19
	b	LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x3, x10
	mov	x9, x15
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x4, [x8]
	strb	w3, [x4, w15, sxtw]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	w9, w9, #1
	cmp	w1, #0
	csel	w1, wzr, w2, ne
	add	x0, x0, #1
	subs	x17, x17, #1
	b.eq	LBB0_26
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w1, #2
	b.eq	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w1, #1
	b.eq	LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	cbnz	w1, LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldrb	w1, [x0]
	cmp	w1, #38
	b.ne	LBB0_17
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w1, #0
	mov	w10, #0
	mov	w2, #1
	mov	x15, x9
	b	LBB0_18
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldrsb	w1, [x0]
	sub	w2, w1, #48
	cmp	w2, #9
	b.hi	LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	madd	w1, w10, w12, w1
	sub	w3, w1, #48
	cmp	w10, #32, lsl #12               ; =131072
	csel	w1, wzr, wzr, ge
	csel	w2, w11, w11, ge
	csel	w10, w10, w3, ge
	b	LBB0_18
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=1
	ldrb	w1, [x0]
	cmp	w1, #35
	b.ne	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w1, #0
	mov	w2, #2
	b	LBB0_18
LBB0_15:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w1, #59
	b.ne	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w2, #3
	mov	w1, #1
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w1, #0
	mov	w2, #0
LBB0_18:                                ;   in Loop: Header=BB0_6 Depth=1
	cbz	w1, LBB0_23
; %bb.19:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	w10, #32
	b.lt	LBB0_23
; %bb.20:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	w10, w13
	b.eq	LBB0_23
; %bb.21:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	w10, w14
	b.eq	LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	w10, #32, lsl #12               ; =131072
	b.lt	LBB0_3
LBB0_23:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w10, #16, lsl #12               ; =65536
	cset	w3, ge
	and	w3, w1, w3
	ldr	x4, [x16]
	ldrb	w5, [x0]
	ldrb	w4, [x4, x5]
	ldr	x5, [x8]
	strb	w4, [x5, w9, sxtw]
	cmp	w3, #1
	b.ne	LBB0_5
; %bb.24:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w3, #36
	b	LBB0_4
LBB0_25:
	mov	x0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_26:
	sxtw	x9, w9
	b	LBB0_28
LBB0_27:
	mov	x9, #0
LBB0_28:
	ldr	x10, [x8]
	strb	wzr, [x10, x9]
	ldr	x0, [x8]
	bl	_prepare_str_UTF8
	mov	x8, x0
Lloh6:
	adrp	x20, _prepare_res@GOTPAGE
Lloh7:
	ldr	x20, [x20, _prepare_res@GOTPAGEOFF]
	ldr	x19, [x20]
	ldr	w0, [x0]
	cbz	w0, LBB0_31
; %bb.29:
	add	x22, x8, #4
LBB0_30:                                ; =>This Inner Loop Header: Depth=1
	mov	x1, x19
	bl	_put_char_utf8
	add	x19, x19, w0, sxtw
	ldr	w0, [x22], #4
	cbnz	w0, LBB0_30
LBB0_31:
	strb	wzr, [x19]
	ldr	x8, [x20]
	sub	x8, x19, x8
	add	x8, x8, #1
	ldrsw	x9, [x21]
	cmp	x8, x9
	cset	w0, lt
	bl	_assert
	ldr	x0, [x20]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_clean_str
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_NAME_SIZE,4,2              ; @MAX_NAME_SIZE
	.comm	_name_buff,8,3                  ; @name_buff
	.comm	_win_to_utf8_convert,8,3        ; @win_to_utf8_convert
	.comm	_prepare_res,8,3                ; @prepare_res
.subsections_via_symbols
