	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_iobus_alloc_resource       ## -- Begin function ata_iobus_alloc_resource
	.p2align	4, 0x90
_ata_iobus_alloc_resource:              ## @ata_iobus_alloc_resource
	.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
	movq	%rcx, %r15
	movl	%edx, %ebx
	movl	%esi, %r14d
	movl	%edi, %r12d
	movl	24(%rbp), %r13d
	callq	_iobus_get_regs
	movq	_SYS_RES_IOPORT@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jne	LBB0_6
## %bb.1:
	movl	(%r15), %ecx
	cmpl	$129, %ecx
	je	LBB0_5
## %bb.2:
	cmpl	$128, %ecx
	jne	LBB0_8
## %bb.3:
	movl	$0, -44(%rbp)
	movl	16(%rax), %ebx
	movq	_ATA_IOSIZE@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_6:
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %r14
	cmpl	%ebx, (%r14)
	jne	LBB0_8
## %bb.7:
	movl	(%r15), %eax
	movq	_ATA_IRQ_RID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_8
## %bb.11:
	movl	%r12d, %edi
	callq	_device_get_parent
	movl	(%r14), %edx
	movl	%eax, %edi
	movl	%r12d, %esi
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	movl	$-1, %r9d
	pushq	%r13
	pushq	$1
	callq	_BUS_ALLOC_RESOURCE
	addq	$24, %rsp
	jmp	LBB0_10
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_5:
	movl	$0, -44(%rbp)
	movl	40(%rax), %ebx
	movq	_ATA_CTLIOSIZE@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %r13d
	leal	(%rbx,%r13), %r15d
	decl	%r15d
	movl	%r12d, %edi
	callq	_device_get_parent
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-44(%rbp), %rcx
	movl	%eax, %edi
	movl	%r14d, %esi
	movl	%ebx, %r8d
	movl	%r15d, %r9d
	movl	24(%rbp), %eax
	pushq	%rax
	pushq	%r13
	callq	_BUS_ALLOC_RESOURCE
	addq	$16, %rsp
LBB0_9:
	addq	$8, %rsp
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_IOPORT,4,2             ## @SYS_RES_IOPORT
	.comm	_ATA_IOSIZE,4,2                 ## @ATA_IOSIZE
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_ATA_CTLIOSIZE,4,2              ## @ATA_CTLIOSIZE
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_ATA_IRQ_RID,4,2                ## @ATA_IRQ_RID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_iobus_alloc_resource       ; -- Begin function ata_iobus_alloc_resource
	.p2align	2
_ata_iobus_alloc_resource:              ; @ata_iobus_alloc_resource
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x7
	mov	x22, x3
	mov	x23, x2
	mov	x20, x1
	mov	x21, x0
	bl	_iobus_get_regs
Lloh0:
	adrp	x8, _SYS_RES_IOPORT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYS_RES_IOPORT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w23
	b.ne	LBB0_4
; %bb.1:
	ldr	w8, [x22]
	cmp	w8, #129
	b.eq	LBB0_8
; %bb.2:
	cmp	w8, #128
	b.ne	LBB0_7
; %bb.3:
	str	wzr, [sp, #12]
	ldr	w22, [x0, #16]
Lloh3:
	adrp	x8, _ATA_IOSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATA_IOSIZE@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
Lloh5:
	adrp	x20, _SYS_RES_IRQ@GOTPAGE
Lloh6:
	ldr	x20, [x20, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, w23
	b.ne	LBB0_7
; %bb.5:
	ldr	w8, [x22]
Lloh7:
	adrp	x9, _ATA_IRQ_RID@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ATA_IRQ_RID@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x21
	bl	_device_get_parent
	ldr	w2, [x20]
	mov	x1, x21
	mov	x3, x22
	mov	w4, #0
	mov	w5, #-1
	mov	w6, #1
	mov	x7, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_BUS_ALLOC_RESOURCE
LBB0_7:
	mov	x0, #0
	b	LBB0_10
LBB0_8:
	str	wzr, [sp, #12]
	ldr	w22, [x0, #40]
Lloh10:
	adrp	x8, _ATA_CTLIOSIZE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ATA_CTLIOSIZE@GOTPAGEOFF]
LBB0_9:
	ldr	w23, [x8]
	add	w8, w22, w23
	sub	w24, w8, #1
	mov	x0, x21
	bl	_device_get_parent
Lloh12:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	x1, x20
	mov	x4, x22
	mov	x5, x24
	mov	x6, x23
	mov	x7, x19
	bl	_BUS_ALLOC_RESOURCE
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_IOPORT,4,2             ; @SYS_RES_IOPORT
	.comm	_ATA_IOSIZE,4,2                 ; @ATA_IOSIZE
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_ATA_CTLIOSIZE,4,2              ; @ATA_CTLIOSIZE
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_ATA_IRQ_RID,4,2                ; @ATA_IRQ_RID
.subsections_via_symbols
