	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_io_space
_alloc_io_space:                        ## @alloc_io_space
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movq	%rsi, %r12
	movl	(%rsi), %r14d
	movl	%r14d, -44(%rbp)
	movl	4(%rsi), %r15d
	movq	_IORESOURCE_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%rsi)
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	testl	%r13d, %r13d
	jne	LBB0_2
## %bb.1:
	testl	%r14d, %r14d
	jne	LBB0_7
LBB0_2:
	movl	$1, %ebx
	movl	%r13d, %ecx
	shll	%cl, %ebx
	movl	$1, %eax
	testl	%r13d, %r13d
	cmovel	%r13d, %ebx
	testl	%r14d, %r14d
	cmovel	%eax, %ebx
	cmpl	%r15d, %ebx
	jae	LBB0_7
## %bb.3:
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.16:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_7
LBB0_4:
	movl	$1, %eax
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	leal	(%rbx,%rbx), %eax
	cmpl	%r15d, %ebx
	jb	LBB0_5
LBB0_7:
	movl	%ebx, %eax
	negl	%eax
	testl	%eax, %r14d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_9:
	movq	8(%r14), %rax
	movl	16(%r12), %esi
	leaq	8(%r12), %r9
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movl	%r15d, %ecx
	movl	%ebx, %r8d
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_11:
	movl	-44(%rbp), %eax
	movl	%eax, (%r12)
	addl	%r15d, %eax
	decl	%eax
	movl	%eax, 4(%r12)
	movq	8(%r12), %rdi
	xorl	%ebx, %ebx
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.12:
	movq	%r12, %rsi
	callq	_request_resource
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movq	%r12, %rdx
	movl	%eax, %ecx
	callq	_dev_warn
	movq	$0, 8(%r12)
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_release_io_space
	movl	%r15d, %ebx
LBB0_14:
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IORESOURCE_IO,4,2              ## @IORESOURCE_IO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"alloc_io_space request for %pR, %d lines\n"

L_.str.1:                               ## @.str.1
	.asciz	"odd IO request\n"

L_.str.2:                               ## @.str.2
	.asciz	"alloc_io_space request failed (%d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"request_resource %pR failed: %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"alloc_io_space request result %d: %pR\n"

	.no_dead_strip	_alloc_io_space
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_io_space
_alloc_io_space:                        ; @alloc_io_space
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldp	w23, w21, [x1]
	str	w23, [sp, #28]
Lloh0:
	adrp	x8, _IORESOURCE_IO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IORESOURCE_IO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x1, #16]
	orr	w8, w9, w8
	str	w8, [x1, #16]
	stp	x1, x22, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	cbnz	w22, LBB0_3
; %bb.1:
	cbz	w23, LBB0_3
; %bb.2:
	mov	w4, #0
	b	LBB0_9
LBB0_3:
	mov	w8, #1
	lsl	w8, w8, w22
	cmp	w22, #0
	csel	w8, wzr, w8, eq
	cmp	w23, #0
	csinc	w4, w8, wzr, ne
	cmp	w4, w21
	b.hs	LBB0_9
; %bb.4:
	cbz	w23, LBB0_6
; %bb.5:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	mov	w4, #0
	b	LBB0_9
LBB0_6:
	mov	w8, #1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x4, x8
	cbz	w8, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	lsl	w8, w4, #1
	cmp	w4, w21
	b.lo	LBB0_7
LBB0_9:
	neg	w8, w4
	tst	w23, w8
	b.eq	LBB0_11
; %bb.10:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	mov	w4, #0
LBB0_11:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w1, [x20, #16]
	add	x5, x20, #8
	add	x2, sp, #28
	mov	x0, x19
	mov	x3, x21
	blr	x8
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_13
; %bb.12:
	str	x0, [sp]
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_18
LBB0_13:
	ldr	w8, [sp, #28]
	add	w9, w21, w8
	sub	w9, w9, #1
	stp	w8, w9, [x20]
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_16
; %bb.14:
	mov	x1, x20
	bl	_request_resource
	mov	x21, x0
	cbz	w0, LBB0_17
; %bb.15:
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	mov	x3, x21
	bl	_dev_warn
	str	xzr, [x20, #8]
	mov	x0, x19
	mov	x1, x20
	bl	_release_io_space
	b	LBB0_17
LBB0_16:
	mov	w21, #0
LBB0_17:
	stp	x21, x20, [sp]
Lloh16:
	adrp	x1, l_.str.4@PAGE
Lloh17:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
LBB0_18:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_IORESOURCE_IO,4,2              ; @IORESOURCE_IO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"alloc_io_space request for %pR, %d lines\n"

l_.str.1:                               ; @.str.1
	.asciz	"odd IO request\n"

l_.str.2:                               ; @.str.2
	.asciz	"alloc_io_space request failed (%d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"request_resource %pR failed: %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"alloc_io_space request result %d: %pR\n"

	.no_dead_strip	_alloc_io_space
.subsections_via_symbols
