	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_mbox_attach
_bcm_mbox_attach:                       ## @bcm_mbox_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, %ebx
	callq	_device_get_softc
	movq	%rax, %r14
	movl	$0, -36(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	leaq	-36(%rbp), %rdx
	movl	%ebx, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 48(%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rdi
	callq	_rman_get_bustag
	movl	%eax, 60(%r14)
	movq	48(%r14), %rdi
	callq	_rman_get_bushandle
	movl	%eax, 56(%r14)
	movl	$0, -36(%rbp)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	(%r12), %ecx
	leaq	-36(%rbp), %rdx
	movl	%ebx, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 32(%r14)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rcx
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_bcm_mbox_intr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	leaq	40(%r14), %rcx
	movq	%rcx, (%rsp)
	movl	%ebx, %edi
	movq	%rax, %rsi
	xorl	%ecx, %ecx
	movq	%r14, %r9
	callq	_bus_setup_intr
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	(%r15), %esi
	movl	-36(%rbp), %edx
	movq	32(%r14), %rcx
	movl	%ebx, %edi
	callq	_bus_release_resource
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%ebx, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_26:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r14, %rdi
	addq	$24, %rdi
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.3(%rip), %rsi
	xorl	%edx, %edx
	callq	_mtx_init
	movq	_BCM2835_MBOX_CHANS@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jle	LBB0_22
## %bb.8:
	movq	8(%r14), %rcx
	movq	16(%r14), %rdx
	xorl	%esi, %esi
	cmpl	$4, %r8d
	jb	LBB0_18
## %bb.9:
	movq	%rcx, %rax
	subq	%rdx, %rax
	cmpq	$32, %rax
	jb	LBB0_18
## %bb.10:
	movl	%r8d, %esi
	andl	$-4, %esi
	leaq	-4(%rsi), %rax
	movq	%rax, %rdi
	shrq	$2, %rdi
	incq	%rdi
	movl	%edi, %r9d
	andl	$3, %r9d
	cmpq	$12, %rax
	jae	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_12:
	andq	$-4, %rdi
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movups	%xmm0, (%rdx,%rax,8)
	movups	%xmm0, 16(%rdx,%rax,8)
	movups	%xmm0, (%rcx,%rax,8)
	movups	%xmm0, 16(%rcx,%rax,8)
	movups	%xmm0, 32(%rdx,%rax,8)
	movups	%xmm0, 48(%rdx,%rax,8)
	movups	%xmm0, 32(%rcx,%rax,8)
	movups	%xmm0, 48(%rcx,%rax,8)
	movups	%xmm0, 64(%rdx,%rax,8)
	movups	%xmm0, 80(%rdx,%rax,8)
	movups	%xmm0, 64(%rcx,%rax,8)
	movups	%xmm0, 80(%rcx,%rax,8)
	movups	%xmm0, 96(%rdx,%rax,8)
	movups	%xmm0, 112(%rdx,%rax,8)
	movups	%xmm0, 96(%rcx,%rax,8)
	movups	%xmm0, 112(%rcx,%rax,8)
	addq	$16, %rax
	addq	$-4, %rdi
	jne	LBB0_13
LBB0_14:
	testq	%r9, %r9
	je	LBB0_17
## %bb.15:
	leaq	(%rcx,%rax,8), %rdi
	addq	$16, %rdi
	leaq	(%rdx,%rax,8), %rax
	addq	$16, %rax
	shlq	$5, %r9
	xorl	%ebx, %ebx
	xorps	%xmm0, %xmm0
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movups	%xmm0, -16(%rax,%rbx)
	movups	%xmm0, (%rax,%rbx)
	movups	%xmm0, -16(%rdi,%rbx)
	movups	%xmm0, (%rdi,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %r9
	jne	LBB0_16
LBB0_17:
	cmpq	%r8, %rsi
	je	LBB0_22
LBB0_18:
	movq	%rsi, %rax
	notq	%rax
	addq	%r8, %rax
	movq	%r8, %rdi
	andq	$3, %rdi
	je	LBB0_20
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	$0, (%rdx,%rsi,8)
	movq	$0, (%rcx,%rsi,8)
	incq	%rsi
	decq	%rdi
	jne	LBB0_19
LBB0_20:
	cmpq	$3, %rax
	jb	LBB0_22
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	$0, (%rdx,%rsi,8)
	movq	$0, (%rcx,%rsi,8)
	movq	$0, 8(%rdx,%rsi,8)
	movq	$0, 8(%rcx,%rsi,8)
	movq	$0, 16(%rdx,%rsi,8)
	movq	$0, 16(%rcx,%rsi,8)
	movq	$0, 24(%rdx,%rsi,8)
	movq	$0, 24(%rcx,%rsi,8)
	addq	$4, %rsi
	cmpq	%rsi, %r8
	jne	LBB0_21
LBB0_22:
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	callq	_sx_init
	movq	_REG_STATUS@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_mbox_read_4
	movq	_STATUS_EMPTY@GOTPCREL(%rip), %rbx
	testl	%eax, (%rbx)
	jne	LBB0_25
## %bb.23:
	movq	_REG_READ@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_mbox_read_4
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_mbox_read_4
	testl	%eax, (%rbx)
	je	LBB0_24
LBB0_25:
	movq	_REG_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CONFIG_DATA_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_mbox_write_4
	xorl	%eax, %eax
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.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	_ENXIO,4,2                      ## @ENXIO
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
L_.str.1:                               ## @.str.1
	.asciz	"could not allocate interrupt resource\n"

	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
	.comm	_bcm_mbox_intr,4,2              ## @bcm_mbox_intr
L_.str.2:                               ## @.str.2
	.asciz	"Unable to setup the clock irq handler.\n"

L_.str.3:                               ## @.str.3
	.asciz	"vcio mbox"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
	.comm	_BCM2835_MBOX_CHANS,4,2         ## @BCM2835_MBOX_CHANS
L_.str.4:                               ## @.str.4
	.asciz	"mboxprop"

	.comm	_REG_STATUS,4,2                 ## @REG_STATUS
	.comm	_STATUS_EMPTY,4,2               ## @STATUS_EMPTY
	.comm	_REG_READ,4,2                   ## @REG_READ
	.comm	_REG_CONFIG,4,2                 ## @REG_CONFIG
	.comm	_CONFIG_DATA_IRQ,4,2            ## @CONFIG_DATA_IRQ
	.no_dead_strip	_bcm_mbox_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_mbox_attach
_bcm_mbox_attach:                       ; @bcm_mbox_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	x20, x0
	bl	_device_get_softc
	mov	x19, x0
	str	wzr, [sp, #12]
Lloh0:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x22, _RF_ACTIVE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x22]
	add	x2, sp, #12
	mov	x0, x20
	bl	_bus_alloc_resource_any
	str	x0, [x19, #48]
	cbz	x0, LBB0_4
; %bb.1:
	bl	_rman_get_bustag
	str	w0, [x19, #60]
	ldr	x0, [x19, #48]
	bl	_rman_get_bushandle
	str	w0, [x19, #56]
	str	wzr, [sp, #12]
Lloh5:
	adrp	x21, _SYS_RES_IRQ@GOTPAGE
Lloh6:
	ldr	x21, [x21, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w1, [x21]
	ldr	w3, [x22]
	add	x2, sp, #12
	mov	x0, x20
	bl	_bus_alloc_resource_any
	str	x0, [x19, #32]
	cbz	x0, LBB0_5
; %bb.2:
	mov	x1, x0
Lloh7:
	adrp	x8, _INTR_MPSAFE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _INTR_MPSAFE@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _INTR_TYPE_MISC@GOTPAGE
Lloh11:
	ldr	x9, [x9, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh13:
	adrp	x8, _bcm_mbox_intr@GOTPAGE
Lloh14:
	ldr	x8, [x8, _bcm_mbox_intr@GOTPAGEOFF]
Lloh15:
	ldr	w4, [x8]
	add	x6, x19, #40
	mov	x0, x20
	mov	x3, #0
	mov	x5, x19
	bl	_bus_setup_intr
	cbz	x0, LBB0_8
; %bb.3:
	ldr	w1, [x21]
	ldr	w2, [sp, #12]
	ldr	x3, [x19, #32]
	mov	x0, x20
	bl	_bus_release_resource
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x20
	bl	_device_printf
Lloh22:
	adrp	x8, _ENXIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh24:
	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:
	add	x0, x19, #24
Lloh25:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh27:
	ldr	w3, [x8]
Lloh28:
	adrp	x1, l_.str.3@PAGE
Lloh29:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, #0
	bl	_mtx_init
Lloh30:
	adrp	x8, _BCM2835_MBOX_CHANS@GOTPAGE
Lloh31:
	ldr	x8, [x8, _BCM2835_MBOX_CHANS@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.9:
	mov	x9, #0
	ldp	x11, x10, [x19, #8]
	cmp	w8, #8
	b.lo	LBB0_14
; %bb.10:
	sub	x12, x11, x10
	cmp	x12, #64
	b.lo	LBB0_14
; %bb.11:
	and	x9, x8, #0xfffffff8
	add	x12, x11, #32
	add	x13, x10, #32
	movi.2d	v0, #0000000000000000
	mov	x14, x9
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x13, #-32]
	stp	q0, q0, [x13], #64
	stp	q0, q0, [x12, #-32]
	stp	q0, q0, [x12], #64
	subs	x14, x14, #8
	b.ne	LBB0_12
; %bb.13:
	cmp	x9, x8
	b.eq	LBB0_16
LBB0_14:
	lsl	x12, x9, #3
	add	x11, x11, x12
	add	x10, x10, x12
	sub	x8, x8, x9
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	str	xzr, [x10], #8
	str	xzr, [x11], #8
	subs	x8, x8, #1
	b.ne	LBB0_15
LBB0_16:
Lloh33:
	adrp	x1, l_.str.4@PAGE
Lloh34:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_sx_init
Lloh35:
	adrp	x20, _REG_STATUS@GOTPAGE
Lloh36:
	ldr	x20, [x20, _REG_STATUS@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_mbox_read_4
Lloh37:
	adrp	x21, _STATUS_EMPTY@GOTPAGE
Lloh38:
	ldr	x21, [x21, _STATUS_EMPTY@GOTPAGEOFF]
	ldr	w8, [x21]
	tst	w8, w0
	b.ne	LBB0_19
; %bb.17:
Lloh39:
	adrp	x22, _REG_READ@GOTPAGE
Lloh40:
	ldr	x22, [x22, _REG_READ@GOTPAGEOFF]
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_mbox_read_4
	ldr	w1, [x20]
	mov	x0, x19
	bl	_mbox_read_4
	ldr	w8, [x21]
	tst	w8, w0
	b.eq	LBB0_18
LBB0_19:
Lloh41:
	adrp	x8, _REG_CONFIG@GOTPAGE
Lloh42:
	ldr	x8, [x8, _REG_CONFIG@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
Lloh44:
	adrp	x8, _CONFIG_DATA_IRQ@GOTPAGE
Lloh45:
	ldr	x8, [x8, _CONFIG_DATA_IRQ@GOTPAGEOFF]
Lloh46:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mbox_write_4
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.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	_ENXIO,4,2                      ; @ENXIO
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
l_.str.1:                               ; @.str.1
	.asciz	"could not allocate interrupt resource\n"

	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
	.comm	_bcm_mbox_intr,4,2              ; @bcm_mbox_intr
l_.str.2:                               ; @.str.2
	.asciz	"Unable to setup the clock irq handler.\n"

l_.str.3:                               ; @.str.3
	.asciz	"vcio mbox"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
	.comm	_BCM2835_MBOX_CHANS,4,2         ; @BCM2835_MBOX_CHANS
l_.str.4:                               ; @.str.4
	.asciz	"mboxprop"

	.comm	_REG_STATUS,4,2                 ; @REG_STATUS
	.comm	_STATUS_EMPTY,4,2               ; @STATUS_EMPTY
	.comm	_REG_READ,4,2                   ; @REG_READ
	.comm	_REG_CONFIG,4,2                 ; @REG_CONFIG
	.comm	_CONFIG_DATA_IRQ,4,2            ; @CONFIG_DATA_IRQ
	.no_dead_strip	_bcm_mbox_attach
.subsections_via_symbols
