	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chainlength
_chainlength:                           ## @chainlength
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	xorl	%eax, %eax
	cmpq	%rsi, %rbx
	jb	LBB0_16
## %bb.1:
	movq	%rdx, %r8
	movq	%rdi, %r14
	movq	_N_INUSEBITS@GOTPCREL(%rip), %rax
	movq	(%rax), %r10
	movq	%rbx, %rax
	orq	%r10, %rax
	shrq	$32, %rax
	je	LBB0_2
## %bb.3:
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%r10
	movq	%rax, %r9
	jmp	LBB0_4
LBB0_2:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%r10d
	movl	%eax, %r9d
LBB0_4:
	movq	%rsi, %rax
	orq	%r10, %rax
	shrq	$32, %rax
	je	LBB0_5
## %bb.6:
	movq	%rsi, %rax
	xorl	%edx, %edx
	divq	%r10
	movq	%rdx, %r15
	jmp	LBB0_7
LBB0_5:
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%r10d
	movl	%edx, %r15d
                                        ## kill: def $eax killed $eax def $rax
LBB0_7:
	movq	8(%r14), %rdx
	movl	(%rdx,%rax,4), %esi
	movl	%r15d, %ecx
	shrl	%cl, %esi
	shll	%cl, %esi
	testl	%esi, %esi
	je	LBB0_9
## %bb.8:
	bsfl	%esi, %edi
	subq	%r15, %rdi
LBB0_15:
	movq	%r8, %rsi
	callq	_MIN
	leaq	(%rax,%r15), %rcx
	movq	(%r14), %rdx
	movl	%edx, %esi
	subl	%r15d, %esi
	incl	%esi
	cmpq	%rdx, %rcx
	cmoval	%esi, %eax
LBB0_16:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r10, %rdi
	subq	%r15, %rdi
	cmpq	%r8, %rdi
	jae	LBB0_17
## %bb.10:
	incq	%rax
	cmpq	%r9, %rax
	ja	LBB0_15
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdx,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	addq	%r10, %rdi
	incq	%rax
	cmpq	%r9, %rax
	ja	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	%r8, %rdi
	jb	LBB0_11
	jmp	LBB0_15
LBB0_17:
	leaq	(%r15,%r8), %rax
	movl	%ebx, %ecx
	subl	%r15d, %ecx
	incl	%ecx
	cmpq	%rbx, %rax
	cmoval	%ecx, %r8d
	movl	%r8d, %eax
	jmp	LBB0_16
LBB0_12:
	bsfl	%ecx, %eax
	addq	%rax, %rdi
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_N_INUSEBITS,8,3                ## @N_INUSEBITS
	.no_dead_strip	_chainlength
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chainlength
_chainlength:                           ; @chainlength
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x10, [x0]
	cmp	x10, x1
	b.hs	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_5
LBB0_2:
	mov	x19, x0
Lloh0:
	adrp	x8, _N_INUSEBITS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _N_INUSEBITS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	udiv	x11, x1, x8
	msub	x20, x11, x8, x1
	ldr	x9, [x0, #8]
	ldr	w12, [x9, x11, lsl #2]
	mov	w13, #-1
	lsl	w13, w13, w20
	ands	w12, w12, w13
	b.eq	LBB0_6
; %bb.3:
	rbit	w8, w12
	clz	w8, w8
	sub	x0, x8, x20
LBB0_4:
	mov	x1, x2
	bl	_MIN
	ldr	x8, [x19]
	sub	w9, w8, w20
	add	x10, x0, x20
	cmp	x10, x8
	csinc	w0, w0, w9, ls
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
	sub	x0, x8, x20
	cmp	x0, x2
	b.hs	LBB0_11
; %bb.7:
	udiv	x10, x10, x8
	add	x11, x11, #1
	cmp	x11, x10
	b.hi	LBB0_4
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x9, x11, lsl #2]
	cbnz	w12, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x0, x0, x8
	add	x11, x11, #1
	cmp	x11, x10
	b.hi	LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	x0, x2
	b.lo	LBB0_8
	b	LBB0_4
LBB0_11:
	sub	w8, w10, w20
	add	x9, x20, x2
	cmp	x9, x10
	csinc	w0, w2, w8, ls
	b	LBB0_5
LBB0_12:
	rbit	w8, w12
	clz	w8, w8
	add	x0, x0, x8
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_N_INUSEBITS,8,3                ; @N_INUSEBITS
	.no_dead_strip	_chainlength
.subsections_via_symbols
