	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function acpi_user_find_mapping
_acpi_user_find_mapping:                ## @acpi_user_find_mapping
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_maplist@GOTPCREL(%rip), %rdi
	callq	_LIST_FIRST
	addq	%r14, %r15
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %rbx
	movq	_link@GOTPCREL(%rip), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_LIST_NEXT
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rax
	cmpq	%r14, %rax
	jg	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rcx
	subq	%rax, %rcx
	cmpq	%rcx, 8(%rbx)
	jb	LBB0_4
	jmp	LBB0_10
LBB0_5:
	movq	%r15, %rdi
	callq	_round_page
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_trunc_page
	subq	%rax, %r15
	movq	%r14, %rdi
	callq	_trunc_page
	movq	%rax, %r14
	movl	$24, %edi
	callq	_malloc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_7:
	movq	%r14, (%rbx)
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_acpi_mem_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%edi, %edi
	movq	%r15, %rsi
	movq	%r14, %r9
	callq	_mmap
	movq	%rax, 16(%rbx)
	movq	%r15, 8(%rbx)
	cmpq	$-1, %rax
	jne	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_9:
	movq	_link@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_maplist@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_LIST_INSERT_HEAD
LBB0_10:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_maplist,4,2                    ## @maplist
	.comm	_link,4,2                       ## @link
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of memory"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_acpi_mem_fd,4,2                ## @acpi_mem_fd
L_.str.1:                               ## @.str.1
	.asciz	"can't map address"

	.no_dead_strip	_acpi_user_find_mapping
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function acpi_user_find_mapping
_acpi_user_find_mapping:                ; @acpi_user_find_mapping
	.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	x20, x0
Lloh0:
	adrp	x0, _maplist@GOTPAGE
Lloh1:
	ldr	x0, [x0, _maplist@GOTPAGEOFF]
	bl	_LIST_FIRST
	add	x21, x21, x20
Lloh2:
	adrp	x22, _link@GOTPAGE
Lloh3:
	ldr	x22, [x22, _link@GOTPAGEOFF]
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_LIST_NEXT
	mov	x19, x0
	cbz	x0, LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	cmp	x8, x20
	b.gt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x19, #8]
	sub	x8, x21, x8
	cmp	x9, x8
	b.lo	LBB0_2
	b	LBB0_10
LBB0_5:
	mov	x0, x21
	bl	_round_page
	mov	x19, x0
	mov	x0, x20
	bl	_trunc_page
	sub	x21, x19, x0
	mov	x0, x20
	bl	_trunc_page
	mov	x20, x0
	mov	w0, #24
	bl	_malloc
	mov	x19, x0
	cbnz	x0, LBB0_7
; %bb.6:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_7:
	str	x20, [x19]
Lloh6:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
Lloh12:
	adrp	x8, _acpi_mem_fd@GOTPAGE
Lloh13:
	ldr	x8, [x8, _acpi_mem_fd@GOTPAGEOFF]
Lloh14:
	ldr	w4, [x8]
	mov	w0, #0
	mov	x1, x21
	mov	x5, x20
	bl	_mmap
	stp	x21, x0, [x19, #8]
	cmn	x0, #1
	b.ne	LBB0_9
; %bb.8:
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_9:
	ldr	w2, [x22]
Lloh17:
	adrp	x0, _maplist@GOTPAGE
Lloh18:
	ldr	x0, [x0, _maplist@GOTPAGEOFF]
	mov	x1, x19
	bl	_LIST_INSERT_HEAD
LBB0_10:
	mov	x0, x19
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_maplist,4,2                    ; @maplist
	.comm	_link,4,2                       ; @link
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of memory"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_acpi_mem_fd,4,2                ; @acpi_mem_fd
l_.str.1:                               ; @.str.1
	.asciz	"can't map address"

	.no_dead_strip	_acpi_user_find_mapping
.subsections_via_symbols
