	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_lintc_attach
_bcm_lintc_attach:                      ## @bcm_lintc_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movl	%r14d, 16(%rax)
	movq	_bcm_lintc_sc@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	jne	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movl	$0, -36(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-36(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %rdi
	callq	_rman_get_bustag
	movl	%eax, 12(%rbx)
	movq	(%rbx), %rdi
	callq	_rman_get_bushandle
	movl	%eax, 8(%rbx)
	movq	_BCM_LINTC_CONTROL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_bcm_lintc_write_4
	movq	_BCM_LINTC_PRESCALER_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BCM_LINTC_PSR_19_2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_bcm_lintc_write_4
	xorl	%edi, %edi
	callq	_BCM_LINTC_TIMER_CFG_REG
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_bcm_lintc_write_4
	movl	$1, %edi
	callq	_BCM_LINTC_TIMER_CFG_REG
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_bcm_lintc_write_4
	movl	$2, %edi
	callq	_BCM_LINTC_TIMER_CFG_REG
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_bcm_lintc_write_4
	movl	$3, %edi
	callq	_BCM_LINTC_TIMER_CFG_REG
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_bcm_lintc_write_4
	movq	%rbx, %rdi
	callq	_bcm_lintc_pic_attach
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str(%rip), %rsi
LBB0_4:
	movl	%r14d, %edi
	callq	_device_printf
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%rbx, %rdi
	callq	_BCM_LINTC_LOCK_INIT
	movq	%rbx, (%r12)
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_bcm_lintc_sc,8,3               ## @bcm_lintc_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"

	.comm	_BCM_LINTC_CONTROL_REG,4,2      ## @BCM_LINTC_CONTROL_REG
	.comm	_BCM_LINTC_PRESCALER_REG,4,2    ## @BCM_LINTC_PRESCALER_REG
	.comm	_BCM_LINTC_PSR_19_2,4,2         ## @BCM_LINTC_PSR_19_2
L_.str.1:                               ## @.str.1
	.asciz	"could not attach PIC\n"

	.no_dead_strip	_bcm_lintc_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_lintc_attach
_bcm_lintc_attach:                      ; @bcm_lintc_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	str	w19, [x0, #16]
Lloh0:
	adrp	x21, _bcm_lintc_sc@GOTPAGE
Lloh1:
	ldr	x21, [x21, _bcm_lintc_sc@GOTPAGEOFF]
	ldr	x8, [x21]
	cbnz	x8, LBB0_6
; %bb.1:
	mov	x20, x0
	str	wzr, [sp, #12]
Lloh2:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20]
	cbz	x0, LBB0_4
; %bb.2:
	bl	_rman_get_bustag
	str	w0, [x20, #12]
	ldr	x0, [x20]
	bl	_rman_get_bushandle
	str	w0, [x20, #8]
Lloh8:
	adrp	x8, _BCM_LINTC_CONTROL_REG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BCM_LINTC_CONTROL_REG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_bcm_lintc_write_4
Lloh11:
	adrp	x8, _BCM_LINTC_PRESCALER_REG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BCM_LINTC_PRESCALER_REG@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _BCM_LINTC_PSR_19_2@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BCM_LINTC_PSR_19_2@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_bcm_lintc_write_4
	mov	w0, #0
	bl	_BCM_LINTC_TIMER_CFG_REG
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_bcm_lintc_write_4
	mov	w0, #1
	bl	_BCM_LINTC_TIMER_CFG_REG
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_bcm_lintc_write_4
	mov	w0, #2
	bl	_BCM_LINTC_TIMER_CFG_REG
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_bcm_lintc_write_4
	mov	w0, #3
	bl	_BCM_LINTC_TIMER_CFG_REG
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_bcm_lintc_write_4
	mov	x0, x20
	bl	_bcm_lintc_pic_attach
	cbz	x0, LBB0_8
; %bb.3:
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_4:
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
LBB0_5:
	mov	x0, x19
	bl	_device_printf
LBB0_6:
Lloh21:
	adrp	x8, _ENXIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_8:
	mov	x0, x20
	bl	_BCM_LINTC_LOCK_INIT
	mov	w0, #0
	str	x20, [x21]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_bcm_lintc_sc,8,3               ; @bcm_lintc_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"

	.comm	_BCM_LINTC_CONTROL_REG,4,2      ; @BCM_LINTC_CONTROL_REG
	.comm	_BCM_LINTC_PRESCALER_REG,4,2    ; @BCM_LINTC_PRESCALER_REG
	.comm	_BCM_LINTC_PSR_19_2,4,2         ; @BCM_LINTC_PSR_19_2
l_.str.1:                               ; @.str.1
	.asciz	"could not attach PIC\n"

	.no_dead_strip	_bcm_lintc_attach
.subsections_via_symbols
