	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_arm_physmem_hardware_region    ## -- Begin function arm_physmem_hardware_region
	.p2align	4, 0x90
_arm_physmem_hardware_region:           ## @arm_physmem_hardware_region
	.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, %r14d
	testl	%edi, %edi
	je	LBB0_1
## %bb.3:
	movl	%edi, %ebx
	movq	_MAX_PHYS_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%edi, %eax
	jge	LBB0_4
	jmp	LBB0_10
LBB0_1:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	cmpl	%r14d, %ebx
	jge	LBB0_10
## %bb.2:
	subl	%ebx, %r14d
	movq	_MAX_PHYS_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	addl	%ebx, %r14d
	leal	-1048576(%rax), %ecx
	cmpl	%ecx, %r14d
	jle	LBB0_7
## %bb.5:
	movl	%eax, %ecx
	subl	%ebx, %ecx
	cmpl	$1048576, %ecx                  ## imm = 0x100000
	jl	LBB0_10
## %bb.6:
	addl	$-1048575, %eax                 ## imm = 0xFFF00001
	movl	%eax, %r14d
LBB0_7:
	movl	%ebx, %edi
	callq	_round_page
	movl	%eax, %r12d
	movl	%ebx, %edi
	callq	_round_page
	movl	%eax, %r15d
	subl	%r12d, %r14d
	movl	%r14d, %edi
	callq	_trunc_page
	testl	%eax, %eax
	jle	LBB0_10
## %bb.8:
	movl	%eax, %ebx
	movq	_hwcnt@GOTPCREL(%rip), %r14
	movq	(%r14), %r13
	movq	_hwregions@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_nitems
	cmpq	%rax, %r13
	jge	LBB0_10
## %bb.9:
	movl	(%r12), %edi
	movq	(%r14), %rsi
	movl	%r15d, %edx
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	callq	_insert_region
	movq	%rax, (%r14)
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_MAX_PHYS_ADDR,4,2              ## @MAX_PHYS_ADDR
	.comm	_hwcnt,8,3                      ## @hwcnt
	.comm	_hwregions,4,2                  ## @hwregions
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_arm_physmem_hardware_region    ; -- Begin function arm_physmem_hardware_region
	.p2align	2
_arm_physmem_hardware_region:           ; @arm_physmem_hardware_region
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cbz	w0, LBB0_2
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _MAX_PHYS_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_PHYS_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.ge	LBB0_4
	b	LBB0_10
LBB0_2:
Lloh3:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w19, [x8]
	cmp	w19, w1
	b.ge	LBB0_10
; %bb.3:
	sub	w1, w1, w19
Lloh6:
	adrp	x8, _MAX_PHYS_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX_PHYS_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
LBB0_4:
	sub	w9, w8, #256, lsl #12           ; =1048576
	add	w21, w19, w1
	cmp	w21, w9
	b.le	LBB0_7
; %bb.5:
	sub	w9, w8, w19
	cmp	w9, #256, lsl #12               ; =1048576
	b.lt	LBB0_10
; %bb.6:
	mov	w9, #-1048575
	add	w21, w8, w9
LBB0_7:
	mov	x0, x19
	bl	_round_page
	mov	x20, x0
	mov	x0, x19
	bl	_round_page
	mov	x19, x0
	sub	w0, w21, w20
	bl	_trunc_page
	cmp	w0, #1
	b.lt	LBB0_10
; %bb.8:
	mov	x20, x0
Lloh9:
	adrp	x21, _hwcnt@GOTPAGE
Lloh10:
	ldr	x21, [x21, _hwcnt@GOTPAGEOFF]
	ldr	x23, [x21]
Lloh11:
	adrp	x22, _hwregions@GOTPAGE
Lloh12:
	ldr	x22, [x22, _hwregions@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_nitems
	cmp	x23, x0
	b.ge	LBB0_10
; %bb.9:
	ldr	w0, [x22]
	ldr	x1, [x21]
	mov	x2, x19
	mov	x3, x20
	mov	w4, #0
	bl	_insert_region
	str	x0, [x21]
LBB0_10:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_MAX_PHYS_ADDR,4,2              ; @MAX_PHYS_ADDR
	.comm	_hwcnt,8,3                      ; @hwcnt
	.comm	_hwregions,4,2                  ; @hwregions
.subsections_via_symbols
