	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gic_fdt_attach
_gic_fdt_attach:                        ## @gic_fdt_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_FDT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movl	%ebx, %edi
	callq	_arm_gic_attach
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movl	%ebx, %edi
	callq	_ofw_bus_get_node
	movl	%eax, %edi
	callq	_OF_xref_from_node
	movq	%rax, %r14
	movl	%ebx, %edi
	movq	%rax, %rsi
	callq	_intr_pic_register
	testq	%rax, %rax
	je	LBB0_2
## %bb.5:
	movl	%ebx, %edi
	callq	_ofw_bus_get_node
	movl	%eax, %edi
	callq	_ofw_bus_find_iparent
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	cmpq	%rax, %r14
	je	LBB0_7
## %bb.10:
	movq	8(%r15), %rax
	movq	16(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_11
## %bb.12:
	movq	_INTR_TYPE_CLK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_arm_gic_intr@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, (%rsp)
	movl	%ebx, %edi
	xorl	%r8d, %r8d
	movq	%r15, %r9
	callq	_bus_setup_intr
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_9
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	callq	_device_printf
	jmp	LBB0_3
LBB0_7:
	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_14
## %bb.8:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_9
LBB0_14:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_OF_device_register_xref
	movl	%ebx, %edi
	callq	_arm_gic_add_children
	testq	%rax, %rax
	je	LBB0_15
## %bb.16:
	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_11:
	leaq	L_.str.2(%rip), %rsi
LBB0_9:
	movl	%ebx, %edi
	callq	_device_printf
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_intr_pic_deregister
LBB0_3:
	movl	%ebx, %edi
	callq	_arm_gic_detach
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	xorl	%eax, %eax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_GIC_BUS_FDT,4,2                ## @GIC_BUS_FDT
	.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"

L_.str.2:                               ## @.str.2
	.asciz	"not root PIC must have defined interrupt\n"

	.comm	_INTR_TYPE_CLK,4,2              ## @INTR_TYPE_CLK
L_.str.3:                               ## @.str.3
	.asciz	"could not setup irq handler\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gic_fdt_attach
_gic_fdt_attach:                        ; @gic_fdt_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_FDT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GIC_BUS_FDT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	mov	x0, x19
	bl	_arm_gic_attach
	cbnz	w0, LBB0_15
; %bb.1:
	mov	x0, x19
	bl	_ofw_bus_get_node
	bl	_OF_xref_from_node
	mov	x20, x0
	mov	x0, x19
	mov	x1, x20
	bl	_intr_pic_register
	cbz	x0, LBB0_7
; %bb.2:
	mov	x0, x19
	bl	_ofw_bus_get_node
	bl	_ofw_bus_find_iparent
	cbz	x0, LBB0_8
; %bb.3:
	cmp	x20, x0
	b.eq	LBB0_8
; %bb.4:
	ldr	x8, [x21, #8]
	ldr	x1, [x8, #16]
	cbz	x1, LBB0_12
; %bb.5:
Lloh3:
	adrp	x8, _INTR_TYPE_CLK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INTR_TYPE_CLK@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _arm_gic_intr@GOTPAGE
Lloh7:
	ldr	x8, [x8, _arm_gic_intr@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x4, #0
	mov	x5, x21
	mov	x6, x21
	bl	_bus_setup_intr
	cbz	x0, LBB0_10
; %bb.6:
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_13
LBB0_7:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_14
LBB0_8:
Lloh13:
	adrp	x8, _arm_gic_intr@GOTPAGE
Lloh14:
	ldr	x8, [x8, _arm_gic_intr@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
Lloh16:
	adrp	x8, _GIC_LAST_SGI@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GIC_LAST_SGI@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
Lloh19:
	adrp	x9, _GIC_FIRST_SGI@GOTPAGE
Lloh20:
	ldr	x9, [x9, _GIC_FIRST_SGI@GOTPAGEOFF]
Lloh21:
	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_10
; %bb.9:
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_10:
	mov	x0, x20
	mov	x1, x19
	bl	_OF_device_register_xref
	mov	x0, x19
	bl	_arm_gic_add_children
	cbz	x0, LBB0_15
; %bb.11:
	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
LBB0_12:
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_13:
	mov	x0, x19
	bl	_device_printf
	mov	x0, x19
	mov	x1, x20
	bl	_intr_pic_deregister
LBB0_14:
	mov	x0, x19
	bl	_arm_gic_detach
Lloh26:
	adrp	x8, _ENXIO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
LBB0_15:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_GIC_BUS_FDT,4,2                ; @GIC_BUS_FDT
	.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"

l_.str.2:                               ; @.str.2
	.asciz	"not root PIC must have defined interrupt\n"

	.comm	_INTR_TYPE_CLK,4,2              ; @INTR_TYPE_CLK
l_.str.3:                               ; @.str.3
	.asciz	"could not setup irq handler\n"

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