	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_region_table
_alloc_region_table:                    ## @alloc_region_table
	.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	%esi, %ebx
	movq	16(%rdi), %r12
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %r15d
	movl	(%r12), %edi
	leal	-1(%rdi), %ecx
	movl	$-1, %eax
	testl	%ecx, %edi
	jne	LBB0_2
## %bb.1:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	___ffs
LBB0_2:
	movl	%eax, 4(%r12)
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ecx
	movl	$1, %eax
	shll	%cl, %eax
	cmpl	$31, %ecx
	ja	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%ebx, %eax
	jb	LBB0_3
LBB0_5:
	movl	%ecx, 8(%r12)
	movb	$32, %al
	movzbl	%al, %eax
	divb	%cl
	movzbl	%al, %edi
	movl	%edi, 12(%r12)
	leal	-1(%rdi), %ecx
	movl	$-1, %eax
	testl	%edi, %ecx
	jne	LBB0_7
## %bb.6:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	___ffs
LBB0_7:
	movl	%eax, 16(%r12)
	movl	(%r12), %esi
	movl	%r15d, %edi
	callq	_sector_div
	cmpq	$1, %rax
	sbbl	$-1, %r15d
	movq	_ULONG_MAX@GOTPCREL(%rip), %r14
	movq	_EINVAL@GOTPCREL(%rip), %r13
	leaq	L_.str(%rip), %rbx
	cmpl	(%r14), %r15d
	jge	LBB0_11
## %bb.8:
	movl	%r15d, 20(%r12)
	movl	12(%r12), %esi
	movl	%r15d, %edi
	callq	_sector_div
	cmpq	$1, %rax
	sbbl	$-1, %r15d
	movslq	%r15d, %rax
	movslq	(%r14), %rcx
	shrq	$2, %rcx
	cmpq	%rax, %rcx
	jb	LBB0_11
## %bb.9:
	movl	%r15d, %edi
	movl	$4, %esi
	callq	_array_size
	movl	%eax, %edi
	callq	_vmalloc
	movl	%eax, %ecx
	movl	%eax, 24(%r12)
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_12
## %bb.10:
	movq	_ENOMEM@GOTPCREL(%rip), %r13
	leaq	L_.str.1(%rip), %rbx
LBB0_11:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, 8(%rax)
	xorl	%eax, %eax
	subl	(%r13), %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ULONG_MAX,4,2                  ## @ULONG_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Region table too large"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Cannot allocate region table"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_alloc_region_table
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_region_table
_alloc_region_table:                    ; @alloc_region_table
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0, #16]
	ldr	w20, [x0]
	ldr	w0, [x22]
	sub	w8, w0, #1
	tst	w0, w8
	b.ne	LBB0_2
; %bb.1:
	bl	___ffs
	b	LBB0_3
LBB0_2:
	mov	w0, #-1
LBB0_3:
	mov	w8, #0
	str	w0, [x22, #4]
	mov	w9, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	w8, w8, #1
	cmp	w8, #31
	b.hi	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	lsl	w10, w9, w8
	cmp	w10, w21
	b.lo	LBB0_4
LBB0_6:
	and	w9, w8, #0xff
	mov	w10, #32
	udiv	w0, w10, w9
	stp	w8, w0, [x22, #8]
	sub	w8, w0, #1
	tst	w8, w0
	b.eq	LBB0_8
; %bb.7:
	mov	w0, #-1
	b	LBB0_9
LBB0_8:
	bl	___ffs
LBB0_9:
	str	w0, [x22, #16]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_sector_div
	cmp	x0, #0
	cinc	w20, w20, ne
Lloh0:
	adrp	x21, _ULONG_MAX@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ULONG_MAX@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w20, w8
	b.ge	LBB0_11
; %bb.10:
	str	w20, [x22, #20]
	ldr	w1, [x22, #12]
	mov	x0, x20
	bl	_sector_div
	cmp	x0, #0
	cinc	w0, w20, ne
	sxtw	x8, w0
	ldrsw	x9, [x21]
	cmp	x8, x9, lsr #2
	b.ls	LBB0_14
LBB0_11:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	adrp	x9, l_.str@PAGE
Lloh5:
	add	x9, x9, l_.str@PAGEOFF
LBB0_12:
	str	x9, [x19, #8]
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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_14:
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w1, #4
	bl	_array_size
	bl	_vmalloc
	str	w0, [x22, #24]
	cbz	w0, LBB0_16
; %bb.15:
	mov	w0, #0
	b	LBB0_13
LBB0_16:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	adrp	x9, l_.str.1@PAGE
Lloh9:
	add	x9, x9, l_.str.1@PAGEOFF
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ULONG_MAX,4,2                  ; @ULONG_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Region table too large"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Cannot allocate region table"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_alloc_region_table
.subsections_via_symbols
