	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gic_acpi_attach
_gic_acpi_attach:                       ## @gic_acpi_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	callq	_device_get_softc
	movq	%rax, %r15
	movq	_GIC_BUS_ACPI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movl	%ebx, %edi
	callq	_arm_gic_attach
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	_ACPI_INTR_XREF@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_intr_pic_register
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	_arm_gic_intr@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_GIC_LAST_SGI@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	_GIC_FIRST_SGI@GOTPCREL(%rip), %rax
	subq	(%rax), %r8
	incq	%r8
	movl	%ebx, %edi
	movq	%r14, %rsi
	movq	%r15, %rcx
	callq	_intr_pic_claim_root
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	callq	_device_printf
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_intr_pic_deregister
	jmp	LBB0_5
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	callq	_device_printf
LBB0_5:
	movl	%ebx, %edi
	callq	_arm_gic_detach
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%ebx, %edi
	callq	_arm_gic_add_children
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movl	%ebx, %edi
	callq	_bus_generic_probe
	movl	%ebx, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bus_generic_attach             ## TAILCALL
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_GIC_BUS_ACPI,4,2               ## @GIC_BUS_ACPI
	.comm	_ACPI_INTR_XREF,8,3             ## @ACPI_INTR_XREF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not register PIC\n"

	.comm	_arm_gic_intr,4,2               ## @arm_gic_intr
	.comm	_GIC_LAST_SGI,8,3               ## @GIC_LAST_SGI
	.comm	_GIC_FIRST_SGI,8,3              ## @GIC_FIRST_SGI
L_.str.1:                               ## @.str.1
	.asciz	"could not set PIC as a root\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_gic_acpi_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gic_acpi_attach
_gic_acpi_attach:                       ; @gic_acpi_attach
	.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	x19, x0
	bl	_device_get_softc
	mov	x21, x0
Lloh0:
	adrp	x8, _GIC_BUS_ACPI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GIC_BUS_ACPI@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0]
	mov	x0, x19
	bl	_arm_gic_attach
	cbnz	w0, LBB0_6
; %bb.1:
Lloh3:
	adrp	x8, _ACPI_INTR_XREF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ACPI_INTR_XREF@GOTPAGEOFF]
Lloh5:
	ldr	x20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_intr_pic_register
	cbz	x0, LBB0_4
; %bb.2:
Lloh6:
	adrp	x8, _arm_gic_intr@GOTPAGE
Lloh7:
	ldr	x8, [x8, _arm_gic_intr@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _GIC_LAST_SGI@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GIC_LAST_SGI@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
Lloh12:
	adrp	x9, _GIC_FIRST_SGI@GOTPAGE
Lloh13:
	ldr	x9, [x9, _GIC_FIRST_SGI@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	sub	x8, x8, x9
	add	x4, x8, #1
	mov	x0, x19
	mov	x1, x20
	mov	x3, x21
	bl	_intr_pic_claim_root
	cbz	x0, LBB0_7
; %bb.3:
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	mov	x0, x19
	mov	x1, x20
	bl	_intr_pic_deregister
	b	LBB0_5
LBB0_4:
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_5:
	mov	x0, x19
	bl	_arm_gic_detach
Lloh19:
	adrp	x8, _ENXIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
LBB0_6:
	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
LBB0_7:
	mov	x0, x19
	bl	_arm_gic_add_children
	cbz	x0, LBB0_6
; %bb.8:
	mov	x0, x19
	bl	_bus_generic_probe
	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
	b	_bus_generic_attach
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_GIC_BUS_ACPI,4,2               ; @GIC_BUS_ACPI
	.comm	_ACPI_INTR_XREF,8,3             ; @ACPI_INTR_XREF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not register PIC\n"

	.comm	_arm_gic_intr,4,2               ; @arm_gic_intr
	.comm	_GIC_LAST_SGI,8,3               ; @GIC_LAST_SGI
	.comm	_GIC_FIRST_SGI,8,3              ; @GIC_FIRST_SGI
l_.str.1:                               ; @.str.1
	.asciz	"could not set PIC as a root\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_gic_acpi_attach
.subsections_via_symbols
