	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _MSKanji_mbrtowc
__MSKanji_mbrtowc:                      ## @_MSKanji_mbrtowc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rcx), %r9d
	cmpl	$256, %r9d                      ## imm = 0x100
	jae	LBB0_1
## %bb.3:
	testq	%rsi, %rsi
	leaq	L_.str(%rip), %r8
	cmovneq	%rsi, %r8
	movl	$1, %eax
	cmoveq	%rax, %rdx
	cmoveq	%rsi, %rdi
	movq	$-2, %rax
	testq	%rdx, %rdx
	je	LBB0_20
## %bb.4:
	testl	%r9d, %r9d
	je	LBB0_10
## %bb.5:
	movzbl	(%r8), %eax
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	shll	$8, %r9d
	orl	%eax, %r9d
	movl	%r9d, (%rdi)
LBB0_9:
	movl	$0, (%rcx)
	movl	$1, %eax
	popq	%rbp
	retq
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	$-1, %rax
	popq	%rbp
	retq
LBB0_10:
	movzbl	(%r8), %r9d
	leal	127(%r9), %esi
	cmpb	$31, %sil
	jb	LBB0_12
## %bb.11:
	leal	32(%r9), %esi
	cmpb	$28, %sil
	jbe	LBB0_12
## %bb.17:
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.18:
	movl	%r9d, (%rdi)
LBB0_19:
	xorl	%eax, %eax
	testl	%r9d, %r9d
	setne	%al
LBB0_20:
	popq	%rbp
	retq
LBB0_12:
	cmpq	$1, %rdx
	ja	LBB0_14
## %bb.13:
	movl	%r9d, (%rcx)
	popq	%rbp
	retq
LBB0_14:
	movzbl	1(%r8), %ecx
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.15:
	movl	$2, %eax
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.16:
	shll	$8, %r9d
	orl	%ecx, %r9d
	movl	%r9d, (%rdi)
	popq	%rbp
	retq
LBB0_6:
	movq	_EILSEQ@GOTPCREL(%rip), %rax
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.no_dead_strip	__MSKanji_mbrtowc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _MSKanji_mbrtowc
__MSKanji_mbrtowc:                      ; @_MSKanji_mbrtowc
	.cfi_startproc
; %bb.0:
	ldr	w9, [x3]
	cmp	w9, #256
	b.hs	LBB0_7
; %bb.1:
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	cmp	x1, #0
	csel	x10, x8, x1, eq
	csinc	x11, x2, xzr, ne
	csel	x8, xzr, x0, eq
	cbz	x11, LBB0_9
; %bb.2:
	cbz	w9, LBB0_10
; %bb.3:
	ldrb	w10, [x10]
	cbz	w10, LBB0_19
; %bb.4:
	cbz	x8, LBB0_6
; %bb.5:
	bfi	w10, w9, #8, #24
	str	w10, [x8]
LBB0_6:
	str	wzr, [x3]
	mov	w0, #1
	ret
LBB0_7:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
Lloh4:
	adrp	x9, _errno@GOTPAGE
Lloh5:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh6:
	str	w8, [x9]
	mov	x0, #-1
	ret
LBB0_9:
	mov	x0, #-2
	ret
LBB0_10:
	ldrb	w9, [x10]
	add	w12, w9, #127
	and	w12, w12, #0xff
	add	w13, w9, #32
	cmp	w12, #31
	and	w12, w13, #0xff
	ccmp	w12, #28, #0, hs
	b.hi	LBB0_13
; %bb.11:
	cmp	x11, #1
	b.hi	LBB0_16
; %bb.12:
	str	w9, [x3]
	mov	x0, #-2
	ret
LBB0_13:
	cbz	x8, LBB0_15
; %bb.14:
	str	w9, [x8]
LBB0_15:
	cmp	w9, #0
	cset	w0, ne
	ret
LBB0_16:
	ldrb	w10, [x10, #1]
	cbz	w10, LBB0_19
; %bb.17:
	cbz	x8, LBB0_20
; %bb.18:
	bfi	w10, w9, #8, #8
	str	w10, [x8]
	mov	w0, #2
	ret
LBB0_19:
Lloh7:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
	b	LBB0_8
LBB0_20:
	mov	w0, #2
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotStr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.no_dead_strip	__MSKanji_mbrtowc
.subsections_via_symbols
