	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wbuflen
_wbuflen:                               ## @wbuflen
	.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
	movl	(%rdi), %eax
	movl	%eax, -44(%rbp)
	testl	%edx, %edx
	jle	LBB0_1
## %bb.2:
	movl	%edx, %ebx
	movq	%rsi, %r15
	xorl	%r14d, %r14d
	leaq	-44(%rbp), %r12
	movl	$1, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r12, %rdx
	callq	_mbrlen
	cmpq	$-2, %rax
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$-1, %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	testq	%rax, %rax
	cmoveq	%r13, %rax
	subl	%eax, %ebx
	addq	%rax, %r15
	incq	%r14
	testl	%ebx, %ebx
	jg	LBB0_3
	jmp	LBB0_7
LBB0_1:
	xorl	%r14d, %r14d
	jmp	LBB0_7
LBB0_5:
	movq	%rax, %r14
LBB0_7:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_wbuflen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wbuflen
_wbuflen:                               ; @wbuflen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w8, [x0]
	str	w8, [sp, #12]
	cmp	w2, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x19
	bl	_mbrlen
	cmn	x0, #2
	b.eq	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cmn	x0, #1
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	x0, #0
	csinc	x8, x0, xzr, ne
	sub	w19, w19, w8
	add	x20, x20, x8
	add	x21, x21, #1
	cmp	w19, #0
	b.gt	LBB0_2
	b	LBB0_7
LBB0_5:
	mov	x21, #0
	b	LBB0_7
LBB0_6:
	mov	x21, x0
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_wbuflen
.subsections_via_symbols
