	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_towide                         ## -- Begin function towide
	.p2align	4, 0x90
_towide:                                ## @towide
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	testq	%rsi, %rsi
	leaq	-36(%rbp), %rbx
	cmovneq	%rsi, %rbx
	movq	_CP_ACP@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	movq	%r14, %rdx
	movl	$-1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_MultiByteToWideChar
	shll	$2, %eax
	movl	%eax, (%rbx)
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	_towide.n(%rip), %ecx
	incl	%ecx
	cmpl	$8, %ecx
	cmovael	%r15d, %ecx
	movl	%ecx, _towide.n(%rip)
	leaq	_towide.outs(%rip), %r15
	movq	(%r15,%rcx,8), %rdi
	movl	%eax, %esi
	callq	_xrealloc
	movslq	_towide.n(%rip), %rcx
	movq	%rax, (%r15,%rcx,8)
	movl	(%rbx), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movl	(%r12), %edi
	movslq	_towide.n(%rip), %rax
	movq	(%r15,%rax,8), %r8
	movl	(%rbx), %r9d
	xorl	%esi, %esi
	movq	%r14, %rdx
	movl	$-1, %ecx
	callq	_MultiByteToWideChar
	movslq	_towide.n(%rip), %rax
	movq	(%r15,%rax,8), %r15
LBB0_2:
	movq	%r15, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	2                               ## @towide.n
_towide.n:
	.long	4294967295                      ## 0xffffffff

.zerofill __DATA,__bss,_towide.outs,64,4 ## @towide.outs
	.comm	_CP_ACP,4,2                     ## @CP_ACP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_towide                         ; -- Begin function towide
	.p2align	2
_towide:                                ; @towide
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
	add	x8, sp, #12
	cmp	x1, #0
	csel	x20, x8, x1, eq
Lloh0:
	adrp	x21, _CP_ACP@GOTPAGE
Lloh1:
	ldr	x21, [x21, _CP_ACP@GOTPAGEOFF]
	ldr	w0, [x21]
	mov	w1, #0
	mov	x2, x19
	mov	w3, #-1
	mov	x4, #0
	mov	w5, #0
	bl	_MultiByteToWideChar
	lsl	w1, w0, #2
	str	w1, [x20]
	cbz	w1, LBB0_2
; %bb.1:
	adrp	x22, _towide.n@PAGE
	ldr	w8, [x22, _towide.n@PAGEOFF]
	add	w9, w8, #1
	cmp	w9, #7
	csinc	w8, wzr, w8, hi
	str	w8, [x22, _towide.n@PAGEOFF]
Lloh2:
	adrp	x23, _towide.outs@PAGE
Lloh3:
	add	x23, x23, _towide.outs@PAGEOFF
	ldr	x0, [x23, w8, uxtw #3]
	bl	_xrealloc
	ldrsw	x8, [x22, _towide.n@PAGEOFF]
	str	x0, [x23, x8, lsl #3]
	ldr	w2, [x20]
	mov	w1, #0
	bl	_memset
	ldr	w0, [x21]
	ldrsw	x8, [x22, _towide.n@PAGEOFF]
	ldr	x4, [x23, x8, lsl #3]
	ldr	w5, [x20]
	mov	w1, #0
	mov	x2, x19
	mov	w3, #-1
	bl	_MultiByteToWideChar
	ldrsw	x8, [x22, _towide.n@PAGEOFF]
	ldr	x0, [x23, x8, lsl #3]
	b	LBB0_3
LBB0_2:
	mov	x0, #0
LBB0_3:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.p2align	2                               ; @towide.n
_towide.n:
	.long	4294967295                      ; 0xffffffff

.zerofill __DATA,__bss,_towide.outs,64,3 ; @towide.outs
	.comm	_CP_ACP,4,2                     ; @CP_ACP
.subsections_via_symbols
