	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib9000_mbx_send_attr
_dib9000_mbx_send_attr:                 ## @dib9000_mbx_send_attr
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	cmpl	$0, 4(%rdi)
	je	LBB0_1
## %bb.2:
	movl	%r8d, %r13d
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	%rcx, %r15
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	js	LBB0_3
## %bb.4:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	_MAX_MAILBOX_TRY@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	$1043, %esi                     ## imm = 0x413
	movl	%r13d, %edx
	callq	_dib9000_read_word_attr
	movzbl	%al, %eax
	addq	%r15, %rax
	movq	_MBX_MAX_WORDS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_5
## %bb.10:
	movq	%r15, %rbx
	testl	%r14d, %r14d
	jne	LBB0_7
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	decl	%r14d
	je	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
	movl	$100, %edi
	callq	_msleep
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	$1043, %esi                     ## imm = 0x413
	movl	%r13d, %edx
	callq	_dib9000_read_word_attr
	movq	%r15, %rbx
	movzbl	%al, %eax
	addq	%r15, %rax
	movq	_MBX_MAX_WORDS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_5
LBB0_7:
	testq	%rbx, %rbx
	movl	%r13d, %r14d
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	jle	LBB0_17
## %bb.8:
	cmpq	$1, %rbx
	jne	LBB0_12
## %bb.9:
	xorl	%ecx, %ecx
	movq	%r12, %rax
	testb	$1, %bl
	jne	LBB0_16
	jmp	LBB0_17
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_22
LBB0_3:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dprintk
	movq	_EINTR@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_22
LBB0_12:
	movq	%rbx, %rdx
	andq	$-2, %rdx
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r12,%rcx,4), %esi
	movzbl	%sil, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	sarl	$8, %esi
	movslq	%esi, %rsi
	movq	%rsi, (%r12,%rax)
	movq	%rdi, 8(%r12,%rax)
	movl	4(%r12,%rcx,4), %esi
	movzbl	%sil, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	sarl	$8, %esi
	movslq	%esi, %rsi
	movq	%rsi, 16(%r12,%rax)
	movq	%rdi, 24(%r12,%rax)
	addq	$2, %rcx
	addq	$32, %rax
	cmpq	%rcx, %rdx
	jne	LBB0_13
## %bb.14:
	addq	%r12, %rax
	testb	$1, %bl
	je	LBB0_17
LBB0_16:
	movl	(%r12,%rcx,4), %ecx
	movzbl	%cl, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	sarl	$8, %ecx
	movslq	%ecx, %rcx
	movq	%rcx, (%rax)
	movq	%rdx, 8(%rax)
LBB0_17:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, -64(%rbp)
	leaq	1(%rbx), %rax
	movq	%rax, -56(%rbp)
	leaq	-64(%rbp), %rdx
	movl	$2, %ecx
	movq	%r13, %rdi
	movl	$1045, %esi                     ## imm = 0x415
	movq	%rbx, %r15
	movl	%r14d, %r8d
	callq	_dib9000_write16_noinc_attr
	testq	%rax, %rax
	jne	LBB0_19
## %bb.18:
	addq	%r15, %r15
	movq	%r13, %rdi
	movl	$1045, %esi                     ## imm = 0x415
	movq	%r12, %rdx
	movq	%r15, %rcx
	movl	%r14d, %r8d
	callq	_dib9000_write16_noinc_attr
	testq	%rax, %rax
	je	LBB0_20
LBB0_19:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_21:
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_22:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_24
## %bb.23:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	%r13, %rdi
	movl	$1043, %esi                     ## imm = 0x413
	movl	$16384, %edx                    ## imm = 0x4000
	movl	%r14d, %ecx
	callq	_dib9000_write_word_attr
	movq	%rax, %rbx
	jmp	LBB0_21
LBB0_24:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not get the lock\n"

	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_MAX_MAILBOX_TRY,4,2            ## @MAX_MAILBOX_TRY
	.comm	_MBX_MAX_WORDS,8,3              ## @MBX_MAX_WORDS
L_.str.1:                               ## @.str.1
	.asciz	"MBX: RISC mbx full, retrying\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_dib9000_mbx_send_attr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib9000_mbx_send_attr
_dib9000_mbx_send_attr:                 ; @dib9000_mbx_send_attr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x20, x4
	mov	x22, x3
	mov	x21, x2
	mov	x23, x1
	mov	x19, x0
	bl	_mutex_lock_interruptible
	tbnz	x0, #63, LBB0_6
; %bb.2:
Lloh3:
	adrp	x8, _MAX_MAILBOX_TRY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_MAILBOX_TRY@GOTPAGEOFF]
Lloh5:
	ldr	w25, [x8]
	mov	x0, x19
	mov	w1, #1043
	mov	x2, x20
	bl	_dib9000_read_word_attr
	and	w8, w0, #0xff
Lloh6:
	adrp	x26, _MBX_MAX_WORDS@GOTPAGE
Lloh7:
	ldr	x26, [x26, _MBX_MAX_WORDS@GOTPAGEOFF]
	ldr	x9, [x26]
	add	x8, x8, x22
	cmp	x8, x9
	b.ge	LBB0_8
; %bb.3:
	cbnz	w25, LBB0_11
LBB0_4:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_22
LBB0_5:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
Lloh14:
	adrp	x8, _EINTR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_24
LBB0_8:
Lloh16:
	adrp	x24, l_.str.1@PAGE
Lloh17:
	add	x24, x24, l_.str.1@PAGEOFF
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	subs	w25, w25, #1
	b.eq	LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x24
	bl	_dprintk
	mov	w0, #100
	bl	_msleep
	mov	x0, x19
	mov	w1, #1043
	mov	x2, x20
	bl	_dib9000_read_word_attr
	and	w8, w0, #0xff
	ldr	x9, [x26]
	add	x8, x8, x22
	cmp	x8, x9
	b.ge	LBB0_9
LBB0_11:
	cmp	x22, #1
	b.lt	LBB0_19
; %bb.12:
	cmp	x22, #8
	b.hs	LBB0_14
; %bb.13:
	mov	x9, #0
	mov	x8, x21
	b	LBB0_17
LBB0_14:
	and	x9, x22, #0xfffffffffffffff8
	add	x8, x21, x9, lsl #4
	add	x10, x21, #16
	add	x12, x21, #64
	movi	d0, #0x0000ff000000ff
	mov	x11, x9
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldp	d1, d2, [x10, #-16]
	sshr.2s	v3, v1, #8
	sshr.2s	v4, v2, #8
	ldp	d5, d6, [x10], #32
	sshr.2s	v7, v5, #8
	sshr.2s	v16, v6, #8
	sshll.2d	v17, v3, #0
	and.8b	v1, v1, v0
	ushll.2d	v18, v1, #0
	sshll.2d	v3, v4, #0
	and.8b	v1, v2, v0
	ushll.2d	v4, v1, #0
	sshll.2d	v1, v7, #0
	and.8b	v5, v5, v0
	ushll.2d	v2, v5, #0
	sub	x13, x12, #64
	st2.2d	{ v17, v18 }, [x13]
	sshll.2d	v16, v16, #0
	sub	x13, x12, #32
	st2.2d	{ v3, v4 }, [x13]
	add	x13, x12, #128
	st2.2d	{ v1, v2 }, [x12], #32
	and.8b	v1, v6, v0
	ushll.2d	v17, v1, #0
	st2.2d	{ v16, v17 }, [x12]
	mov	x12, x13
	subs	x11, x11, #8
	b.ne	LBB0_15
; %bb.16:
	cmp	x9, x22
	b.eq	LBB0_19
LBB0_17:
	sub	x10, x22, x9
	add	x9, x21, x9, lsl #2
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9], #4
	and	x12, x11, #0xff
                                        ; kill: def $w11 killed $w11 killed $x11 def $x11
	sbfx	x11, x11, #8, #24
	stp	x11, x12, [x8], #16
	subs	x10, x10, #1
	b.ne	LBB0_18
LBB0_19:
	add	x8, x22, #1
	stp	x23, x8, [sp, #8]
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #1045
	mov	w3, #2
	mov	x4, x20
	bl	_dib9000_write16_noinc_attr
	cbnz	x0, LBB0_21
; %bb.20:
	lsl	x3, x22, #1
	mov	x0, x19
	mov	w1, #1045
	mov	x2, x21
	mov	x4, x20
	bl	_dib9000_write16_noinc_attr
	cbz	x0, LBB0_26
LBB0_21:
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_22:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_23:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_24:
	ldr	x8, [sp, #24]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.25:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_26:
	mov	x0, x19
	mov	w1, #1043
	mov	w2, #16384
	mov	x3, x20
	bl	_dib9000_write_word_attr
	mov	x20, x0
	b	LBB0_23
LBB0_27:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not get the lock\n"

	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_MAX_MAILBOX_TRY,4,2            ; @MAX_MAILBOX_TRY
	.comm	_MBX_MAX_WORDS,8,3              ; @MBX_MAX_WORDS
l_.str.1:                               ; @.str.1
	.asciz	"MBX: RISC mbx full, retrying\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_dib9000_mbx_send_attr
.subsections_via_symbols
