	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_intc_attach
_bcm_intc_attach:                       ## @bcm_intc_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, %ebx
	callq	_device_get_softc
	movl	$0, -44(%rbp)
	movl	%ebx, 32(%rax)
	movq	_bcm_intc_sc@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	jne	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	movl	%ebx, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movl	%ebx, %edi
	callq	_ofw_bus_get_node
	movl	%eax, %edi
	callq	_OF_xref_from_node
	movq	%rax, %r15
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_bcm_intc_pic_register
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	(%r13), %esi
	movq	(%r14), %rcx
	movl	%ebx, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_7:
	movl	$0, -44(%rbp)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	movl	%ebx, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_8
## %bb.10:
	movq	_INTR_TYPE_CLK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_bcm2835_intc_intr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r14, %rsi
	addq	$16, %rsi
	movq	%rsi, (%rsp)
	movl	%ebx, %edi
	movq	%rax, %rsi
	xorl	%r8d, %r8d
	movq	%r14, %r9
	callq	_bus_setup_intr
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_4
LBB0_8:
	movq	_bcm2835_intc_intr@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	movq	%r15, %rsi
	movq	%r14, %rcx
	xorl	%r8d, %r8d
	callq	_intr_pic_claim_root
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	leaq	L_.str.2(%rip), %rsi
LBB0_4:
	movl	%ebx, %edi
	callq	_device_printf
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	(%r14), %rdi
	callq	_rman_get_bustag
	movl	%eax, 12(%r14)
	movq	(%r14), %rdi
	callq	_rman_get_bushandle
	movl	%eax, 8(%r14)
	movq	%r14, (%r12)
	xorl	%eax, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_bcm_intc_sc,8,3                ## @bcm_intc_sc
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not allocate memory resource\n"

L_.str.1:                               ## @.str.1
	.asciz	"could not register PIC\n"

	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_bcm2835_intc_intr,4,2          ## @bcm2835_intc_intr
L_.str.2:                               ## @.str.2
	.asciz	"could not set PIC as a root\n"

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

	.no_dead_strip	_bcm_intc_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_intc_attach
_bcm_intc_attach:                       ; @bcm_intc_attach
	.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, x0
	bl	_device_get_softc
	str	wzr, [sp, #12]
	str	w19, [x0, #32]
Lloh0:
	adrp	x22, _bcm_intc_sc@GOTPAGE
Lloh1:
	ldr	x22, [x22, _bcm_intc_sc@GOTPAGEOFF]
	ldr	x8, [x22]
	cbnz	x8, LBB0_11
; %bb.1:
	mov	x20, x0
Lloh2:
	adrp	x24, _SYS_RES_MEMORY@GOTPAGE
Lloh3:
	ldr	x24, [x24, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh4:
	adrp	x23, _RF_ACTIVE@GOTPAGE
Lloh5:
	ldr	x23, [x23, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x23]
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20]
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_ofw_bus_get_node
	bl	_OF_xref_from_node
	mov	x21, x0
	mov	x0, x20
	mov	x1, x21
	bl	_bcm_intc_pic_register
	cbz	x0, LBB0_5
; %bb.3:
	ldr	w1, [x24]
	ldr	x3, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_4:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
LBB0_5:
	str	wzr, [sp, #12]
Lloh10:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ldr	w3, [x23]
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #24]
	cbz	x0, LBB0_8
; %bb.6:
	mov	x1, x0
Lloh13:
	adrp	x8, _INTR_TYPE_CLK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _INTR_TYPE_CLK@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
Lloh16:
	adrp	x8, _bcm2835_intc_intr@GOTPAGE
Lloh17:
	ldr	x8, [x8, _bcm2835_intc_intr@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
	add	x6, x20, #16
	mov	x0, x19
	mov	x4, #0
	mov	x5, x20
	bl	_bus_setup_intr
	cbz	x0, LBB0_13
; %bb.7:
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_8:
Lloh21:
	adrp	x8, _bcm2835_intc_intr@GOTPAGE
Lloh22:
	ldr	x8, [x8, _bcm2835_intc_intr@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	x3, x20
	mov	w4, #0
	bl	_intr_pic_claim_root
	cbz	x0, LBB0_13
; %bb.9:
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_10:
	mov	x0, x19
	bl	_device_printf
LBB0_11:
Lloh26:
	adrp	x8, _ENXIO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
LBB0_12:
	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
LBB0_13:
	ldr	x0, [x20]
	bl	_rman_get_bustag
	str	w0, [x20, #12]
	ldr	x0, [x20]
	bl	_rman_get_bushandle
	mov	x8, x0
	mov	w0, #0
	str	w8, [x20, #8]
	str	x20, [x22]
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_bcm_intc_sc,8,3                ; @bcm_intc_sc
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not allocate memory resource\n"

l_.str.1:                               ; @.str.1
	.asciz	"could not register PIC\n"

	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_bcm2835_intc_intr,4,2          ; @bcm2835_intc_intr
l_.str.2:                               ; @.str.2
	.asciz	"could not set PIC as a root\n"

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

	.no_dead_strip	_bcm_intc_attach
.subsections_via_symbols
