	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_mbox_write
_bcm_mbox_write:                        ## @bcm_mbox_write
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %r15d
	callq	_device_get_softc
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, %edx
	callq	_dprintf
	movq	%rbx, %rdi
	callq	_MBOX_LOCK
	movq	(%rbx), %rax
	movslq	%r15d, %rcx
	movq	$0, (%rax,%rcx,8)
	movq	_REG_STATUS@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_mbox_read_4
	movq	_STATUS_FULL@GOTPCREL(%rip), %r13
	testl	%eax, (%r13)
	je	LBB0_4
## %bb.1:
	movl	$-1000, %r14d                   ## imm = 0xFC18
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	incl	%r14d
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$5, %edi
	callq	_DELAY
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_mbox_read_4
	testl	%eax, (%r13)
	jne	LBB0_2
LBB0_4:
	movq	_REG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%r15d, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_MBOX_MSG
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_mbox_write_4
	movq	%rbx, %rdi
	callq	_MBOX_UNLOCK
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	callq	_printf
	movq	%rbx, %rdi
	callq	_MBOX_UNLOCK
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bcm_mbox_write: chan %d, data %08x\n"

	.comm	_REG_STATUS,4,2                 ## @REG_STATUS
	.comm	_STATUS_FULL,4,2                ## @STATUS_FULL
L_.str.1:                               ## @.str.1
	.asciz	"bcm_mbox_write: STATUS_FULL stuck"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_REG_WRITE,4,2                  ## @REG_WRITE
	.no_dead_strip	_bcm_mbox_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_mbox_write
_bcm_mbox_write:                        ; @bcm_mbox_write
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x21, x1
	bl	_device_get_softc
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x20
	bl	_dprintf
	mov	x0, x19
	bl	_MBOX_LOCK
	ldr	x8, [x19]
	str	xzr, [x8, w21, sxtw #3]
Lloh2:
	adrp	x22, _REG_STATUS@GOTPAGE
Lloh3:
	ldr	x22, [x22, _REG_STATUS@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_mbox_read_4
Lloh4:
	adrp	x23, _STATUS_FULL@GOTPAGE
Lloh5:
	ldr	x23, [x23, _STATUS_FULL@GOTPAGEOFF]
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.1:
	mov	w24, #-1000
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	adds	w24, w24, #1
	b.hs	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #5
	bl	_DELAY
	ldr	w1, [x22]
	mov	x0, x19
	bl	_mbox_read_4
	ldr	w8, [x23]
	tst	w8, w0
	b.ne	LBB0_2
LBB0_4:
Lloh6:
	adrp	x8, _REG_WRITE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_WRITE@GOTPAGEOFF]
Lloh8:
	ldr	w22, [x8]
	mov	x0, x21
	mov	x1, x20
	bl	_MBOX_MSG
	mov	x2, x0
	mov	x0, x19
	mov	x1, x22
	bl	_mbox_write_4
	mov	x0, x19
	bl	_MBOX_UNLOCK
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	mov	x0, x19
	bl	_MBOX_UNLOCK
Lloh11:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
LBB0_6:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bcm_mbox_write: chan %d, data %08x\n"

	.comm	_REG_STATUS,4,2                 ; @REG_STATUS
	.comm	_STATUS_FULL,4,2                ; @STATUS_FULL
l_.str.1:                               ; @.str.1
	.asciz	"bcm_mbox_write: STATUS_FULL stuck"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_REG_WRITE,4,2                  ; @REG_WRITE
	.no_dead_strip	_bcm_mbox_write
.subsections_via_symbols
