	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ide_get_dev_handle
_ide_get_dev_handle:                    ## @ide_get_dev_handle
	.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
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	callq	_to_pci_dev
	movq	%rax, %rbx
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	$0, -48(%rbp)
	movq	8(%rbx), %rax
	movl	(%rax), %r12d
	movl	(%rbx), %edi
	callq	_PCI_SLOT
	movl	(%rbx), %edi
	movl	%eax, %ebx
	callq	_PCI_FUNC
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_DEBPRINT
	movq	%r14, %rdi
	callq	_DEVICE_ACPI_HANDLE
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	leaq	-48(%rbp), %rsi
	movq	%rax, %rdi
	callq	_acpi_get_object_info
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	xorl	%eax, %eax
	callq	_DEBPRINT
LBB0_11:
	movq	-48(%rbp), %rdi
	callq	_kfree
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%ebx, %ecx
	shll	$16, %ecx
	orl	%r13d, %ecx
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.8:
	movq	_ACPI_VALID_ADR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	8(%rax), %rsi
	testl	%edx, (%rax)
	je	LBB0_7
## %bb.9:
	cmpq	%rcx, %rsi
	jne	LBB0_7
## %bb.10:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rcx, (%rax)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax)
	leaq	L_.str.4(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%ebx, %esi
	movl	%r13d, %edx
	movq	%r14, %r8
	xorl	%eax, %eax
	callq	_DEBPRINT
	jmp	LBB0_11
LBB0_6:
	movq	$-1, %rsi
LBB0_7:
	leaq	L_.str.3(%rip), %rdi
	movl	%ecx, %edx
	xorl	%eax, %eax
	callq	_DEBPRINT
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ENTER: pci %02x:%02x.%01x\n"

L_.str.1:                               ## @.str.1
	.asciz	"no acpi handle for device\n"

L_.str.2:                               ## @.str.2
	.asciz	"get_object_info for device failed\n"

	.comm	_ACPI_VALID_ADR,4,2             ## @ACPI_VALID_ADR
L_.str.3:                               ## @.str.3
	.asciz	"get_object_info for device has wrong  address: %llu, should be %u\n"

L_.str.4:                               ## @.str.4
	.asciz	"for dev=0x%x.%x, addr=0x%llx, *handle=0x%p\n"

	.no_dead_strip	_ide_get_dev_handle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ide_get_dev_handle
_ide_get_dev_handle:                    ; @ide_get_dev_handle
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x2
	mov	x20, x1
	mov	x24, x0
	bl	_to_pci_dev
	mov	x23, x0
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	str	xzr, [sp, #40]
Lloh2:
	ldr	w8, [x8]
	neg	w19, w8
	ldr	x8, [x0, #8]
	ldr	w0, [x0]
	ldr	w25, [x8]
	bl	_PCI_SLOT
	mov	x22, x0
	ldr	w0, [x23]
	bl	_PCI_FUNC
	mov	x23, x0
	stp	x22, x23, [sp, #8]
	str	x25, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DEBPRINT
	mov	x0, x24
	bl	_DEVICE_ACPI_HANDLE
	cbz	x0, LBB0_3
; %bb.1:
	mov	x24, x0
	add	x1, sp, #40
	bl	_acpi_get_object_info
	bl	_ACPI_FAILURE
	cbz	x0, LBB0_4
; %bb.2:
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_3:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_4:
	orr	w8, w23, w22, lsl #16
	ldr	x9, [sp, #40]
	cbz	x9, LBB0_7
; %bb.5:
Lloh9:
	adrp	x10, _ACPI_VALID_ADR@GOTPAGE
Lloh10:
	ldr	x10, [x10, _ACPI_VALID_ADR@GOTPAGEOFF]
	ldr	w11, [x9]
Lloh11:
	ldr	w10, [x10]
	and	w10, w10, w11
	ldr	x9, [x9, #8]
	cmp	w10, #0
	ccmp	x9, x8, #0, ne
	b.ne	LBB0_8
; %bb.6:
	str	x8, [x21]
	str	x24, [x20]
	stp	x8, x24, [sp, #16]
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	stp	x22, x23, [sp]
Lloh12:
	adrp	x0, l_.str.4@PAGE
Lloh13:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DEBPRINT
	mov	w19, #0
	b	LBB0_10
LBB0_7:
	mov	x9, #-1
LBB0_8:
	stp	x9, x8, [sp]
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_9:
	bl	_DEBPRINT
LBB0_10:
	ldr	x0, [sp, #40]
	bl	_kfree
	mov	x0, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ENTER: pci %02x:%02x.%01x\n"

l_.str.1:                               ; @.str.1
	.asciz	"no acpi handle for device\n"

l_.str.2:                               ; @.str.2
	.asciz	"get_object_info for device failed\n"

	.comm	_ACPI_VALID_ADR,4,2             ; @ACPI_VALID_ADR
l_.str.3:                               ; @.str.3
	.asciz	"get_object_info for device has wrong  address: %llu, should be %u\n"

l_.str.4:                               ; @.str.4
	.asciz	"for dev=0x%x.%x, addr=0x%llx, *handle=0x%p\n"

	.no_dead_strip	_ide_get_dev_handle
.subsections_via_symbols
