	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atpic_isa_attach
_atpic_isa_attach:                      ## @atpic_isa_attach
	.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	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	%r14d, 36(%rax)
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	(%rbx), %rax
	movq	_ATPIC_MASTER@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	leaq	(%rax,%rcx,4), %rdx
	movl	$0, (%rax,%rcx,4)
	movq	_SYS_RES_IOPORT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	16(%rbx), %rcx
	movq	(%r15), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	16(%rbx), %rax
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_1
## %bb.9:
	movq	(%rbx), %rax
	movq	_ATPIC_SLAVE@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	leaq	(%rax,%rcx,4), %rdx
	movl	$1, (%rax,%rcx,4)
	movl	(%r13), %esi
	movl	(%r12), %ecx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	16(%rbx), %rcx
	movq	(%r15), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	16(%rbx), %rax
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_1
## %bb.10:
	leaq	8(%rbx), %rdx
	movl	$0, 8(%rbx)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %ecx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	je	LBB0_2
## %bb.11:
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rcx
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_atpic_intr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movq	%rbx, %rcx
	addq	$32, %rcx
	movq	%rcx, (%rsp)
	xorl	%r12d, %r12d
	movl	%r14d, %edi
	movq	%rax, %rsi
	xorl	%ecx, %ecx
	movl	%r14d, %r9d
	callq	_bus_setup_intr
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_2
## %bb.12:
	movq	_ATPIC_SLAVE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_atpic_init
	movq	_ATPIC_MASTER@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_atpic_init
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r14d, %edi
	xorl	%esi, %esi
	movl	$16, %edx
	xorl	%ecx, %ecx
	callq	_powerpc_register_pic
	jmp	LBB0_13
LBB0_1:
	movl	-44(%rbp), %r13d                ## 4-byte Reload
LBB0_2:
	movq	24(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.3:
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%rbx), %edx
	movl	%r14d, %edi
	callq	_bus_release_resource
LBB0_4:
	movq	16(%rbx), %rax
	movq	_ATPIC_SLAVE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	(%rax,%rdx,8), %rcx
	testq	%rcx, %rcx
	movq	_SYS_RES_IOPORT@GOTPCREL(%rip), %r15
	je	LBB0_6
## %bb.5:
	movl	(%r15), %esi
	movq	(%rbx), %rax
	movl	(%rax,%rdx,4), %edx
	movl	%r14d, %edi
	callq	_bus_release_resource
	movq	16(%rbx), %rax
LBB0_6:
	movq	_ATPIC_MASTER@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	(%rax,%rdx,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_8
## %bb.7:
	movl	(%r15), %esi
	movq	(%rbx), %rax
	movl	(%rax,%rdx,4), %edx
	movl	%r14d, %edi
	callq	_bus_release_resource
LBB0_8:
	movl	%r13d, %r12d
LBB0_13:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_ATPIC_MASTER,8,3               ## @ATPIC_MASTER
	.comm	_SYS_RES_IOPORT,4,2             ## @SYS_RES_IOPORT
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.comm	_ATPIC_SLAVE,8,3                ## @ATPIC_SLAVE
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_atpic_intr,4,2                 ## @atpic_intr
	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_atpic_isa_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atpic_isa_attach
_atpic_isa_attach:                      ; @atpic_isa_attach
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	str	w19, [x0, #36]
Lloh0:
	adrp	x8, _ENXIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	ldr	x8, [x0]
Lloh3:
	adrp	x23, _ATPIC_MASTER@GOTPAGE
Lloh4:
	ldr	x23, [x23, _ATPIC_MASTER@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x2, x8, x9, lsl #2
	str	wzr, [x2]
Lloh5:
	adrp	x24, _SYS_RES_IOPORT@GOTPAGE
Lloh6:
	ldr	x24, [x24, _SYS_RES_IOPORT@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh7:
	adrp	x26, _RF_ACTIVE@GOTPAGE
Lloh8:
	ldr	x26, [x26, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x26]
	mov	x0, x19
	bl	_bus_alloc_resource_any
	ldr	x8, [x20, #16]
	ldr	x9, [x23]
	lsl	x9, x9, #3
	str	x0, [x8, x9]
	ldr	x8, [x20, #16]
	ldr	x8, [x8, x9]
Lloh9:
	adrp	x25, _ATPIC_SLAVE@GOTPAGE
Lloh10:
	ldr	x25, [x25, _ATPIC_SLAVE@GOTPAGEOFF]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x8, [x20]
	ldr	x9, [x25]
	add	x2, x8, x9, lsl #2
	mov	w8, #1
	str	w8, [x2]
	ldr	w1, [x24]
	ldr	w3, [x26]
	mov	x0, x19
	bl	_bus_alloc_resource_any
	ldr	x8, [x20, #16]
	ldr	x9, [x25]
	lsl	x9, x9, #3
	str	x0, [x8, x9]
	ldr	x8, [x20, #16]
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_4
; %bb.2:
	mov	x22, x20
	str	wzr, [x22, #8]!
Lloh11:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	w3, [x26]
	mov	x0, x19
	mov	x2, x22
	bl	_bus_alloc_resource_any
	str	x0, [x22, #16]
	cbz	x0, LBB0_4
; %bb.3:
	mov	x1, x0
Lloh14:
	adrp	x8, _INTR_TYPE_MISC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _INTR_MPSAFE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _INTR_MPSAFE@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh20:
	adrp	x8, _atpic_intr@GOTPAGE
Lloh21:
	ldr	x8, [x8, _atpic_intr@GOTPAGEOFF]
Lloh22:
	ldr	w4, [x8]
	add	x6, x20, #32
	mov	x0, x19
	mov	x3, #0
	mov	x5, x19
	bl	_bus_setup_intr
	mov	x21, x0
	cbz	w0, LBB0_11
LBB0_4:
	ldr	x3, [x20, #24]
	cbz	x3, LBB0_6
; %bb.5:
Lloh23:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldr	w2, [x20, #8]
	mov	x0, x19
	bl	_bus_release_resource
LBB0_6:
	ldr	x8, [x20, #16]
	ldr	x9, [x25]
	ldr	x3, [x8, x9, lsl #3]
	cbz	x3, LBB0_8
; %bb.7:
	ldr	w1, [x24]
	ldr	x8, [x20]
	ldr	w2, [x8, x9, lsl #2]
	mov	x0, x19
	bl	_bus_release_resource
	ldr	x8, [x20, #16]
LBB0_8:
	ldr	x9, [x23]
	ldr	x3, [x8, x9, lsl #3]
	cbz	x3, LBB0_10
; %bb.9:
	ldr	w1, [x24]
	ldr	x8, [x20]
	ldr	w2, [x8, x9, lsl #2]
	mov	x0, x19
	bl	_bus_release_resource
LBB0_10:
	mov	x0, x21
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_11:
	ldr	x1, [x25]
	mov	x0, x20
	bl	_atpic_init
	ldr	x1, [x23]
	mov	x0, x20
	bl	_atpic_init
Lloh26:
	adrp	x8, _TRUE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh28:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	w2, #16
	mov	w3, #0
	bl	_powerpc_register_pic
	b	LBB0_10
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_ATPIC_MASTER,8,3               ; @ATPIC_MASTER
	.comm	_SYS_RES_IOPORT,4,2             ; @SYS_RES_IOPORT
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.comm	_ATPIC_SLAVE,8,3                ; @ATPIC_SLAVE
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_atpic_intr,4,2                 ; @atpic_intr
	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_atpic_isa_attach
.subsections_via_symbols
