	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib9000_mbx_read
_dib9000_mbx_read:                      ## @dib9000_mbx_read
	.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
	cmpl	$0, 4(%rdi)
	je	LBB0_1
## %bb.2:
	movl	%ecx, %r15d
	movl	%edx, %ebx
	movq	%rsi, %r12
	movq	%rdi, %r13
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	js	LBB0_3
## %bb.4:
	xorl	%eax, %eax
	cmpl	$1, %ebx
	sete	%al
	shll	$4, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leal	1029(%rax), %r14d
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_dib9000_read_word_attr
	movl	%eax, (%r12)
	movzbl	%al, %ebx
	movq	_MBX_MAX_WORDS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jle	LBB0_5
## %bb.18:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_dprintk
	decl	%ebx
	je	LBB0_21
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	%r14d, %esi
	movq	%r12, %rdx
	movl	$2, %ecx
	movl	%r15d, %r8d
	callq	_dib9000_read16_noinc_attr
	decl	%ebx
	jne	LBB0_19
LBB0_21:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	$-1, %ebx
	jmp	LBB0_22
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_23
LBB0_3:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dprintk
	jmp	LBB0_23
LBB0_5:
	movl	%r15d, %r8d
	leaq	4(%r12), %r15
	leal	-1(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leal	(%rbx,%rbx), %ecx
	addl	$-2, %ecx
	movq	%r13, %rdi
	movl	%r14d, %esi
	movq	%r15, %rdx
	movl	%r8d, %r14d
	callq	_dib9000_read16_noinc_attr
	cmpl	$2, %ebx
	jb	LBB0_6
## %bb.7:
	leal	-2(%rbx), %ecx
	xorl	%eax, %eax
	cmpl	$7, %ecx
	jb	LBB0_16
## %bb.8:
	incq	%rcx
	movq	%rcx, %rax
	andq	$-8, %rax
	leaq	-8(%rax), %rdx
	movq	%rdx, %rsi
	shrq	$3, %rsi
	incq	%rsi
	testq	%rdx, %rdx
	je	LBB0_9
## %bb.10:
	movq	%rsi, %rdi
	andq	$-2, %rdi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movdqu	4(%r12,%rdx,4), %xmm0
	movdqu	20(%r12,%rdx,4), %xmm1
	movdqu	36(%r12,%rdx,4), %xmm2
	movdqu	52(%r12,%rdx,4), %xmm3
	movdqa	%xmm0, %xmm4
	psrad	$8, %xmm4
	movdqa	%xmm1, %xmm5
	psrad	$8, %xmm5
	pslld	$8, %xmm0
	por	%xmm4, %xmm0
	pslld	$8, %xmm1
	por	%xmm5, %xmm1
	movdqu	%xmm0, 4(%r12,%rdx,4)
	movdqu	%xmm1, 20(%r12,%rdx,4)
	movdqa	%xmm2, %xmm0
	psrad	$8, %xmm0
	movdqa	%xmm3, %xmm1
	psrad	$8, %xmm1
	pslld	$8, %xmm2
	por	%xmm0, %xmm2
	pslld	$8, %xmm3
	por	%xmm1, %xmm3
	movdqu	%xmm2, 36(%r12,%rdx,4)
	movdqu	%xmm3, 52(%r12,%rdx,4)
	addq	$16, %rdx
	addq	$-2, %rdi
	jne	LBB0_11
## %bb.12:
	testb	$1, %sil
	je	LBB0_14
LBB0_13:
	movdqu	(%r15,%rdx,4), %xmm0
	movdqu	16(%r15,%rdx,4), %xmm1
	movdqa	%xmm0, %xmm2
	psrad	$8, %xmm2
	movdqa	%xmm1, %xmm3
	psrad	$8, %xmm3
	pslld	$8, %xmm0
	por	%xmm2, %xmm0
	pslld	$8, %xmm1
	por	%xmm3, %xmm1
	movdqu	%xmm0, (%r15,%rdx,4)
	movdqu	%xmm1, 16(%r15,%rdx,4)
LBB0_14:
	cmpq	%rax, %rcx
	je	LBB0_6
## %bb.15:
	leaq	(%r15,%rax,4), %r15
LBB0_16:
	notl	%eax
	addl	%ebx, %eax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rcx,4), %edx
	movl	%edx, %esi
	sarl	$8, %esi
	shll	$8, %edx
	orl	%esi, %edx
	movl	%edx, (%r15,%rcx,4)
	incq	%rcx
	cmpl	%ecx, %eax
	jne	LBB0_17
LBB0_6:
	movl	%r14d, %r15d
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_22:
	orl	$1028, %esi                     ## imm = 0x404
	movq	%r13, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$16384, %edx                    ## imm = 0x4000
	movl	%r15d, %ecx
	callq	_dib9000_write_word_attr
	movq	%r13, %rdi
	callq	_mutex_unlock
	incl	%ebx
LBB0_23:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	xorl	%edx, %edx
	testb	$1, %sil
	jne	LBB0_13
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not get the lock\n"

	.comm	_MBX_MAX_WORDS,4,2              ## @MBX_MAX_WORDS
L_.str.1:                               ## @.str.1
	.asciz	"MBX: message is too big for message cache (%d), flushing message\n"

	.no_dead_strip	_dib9000_mbx_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib9000_mbx_read
_dib9000_mbx_read:                      ; @dib9000_mbx_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_mutex_lock_interruptible
	tbnz	x0, #63, LBB0_7
; %bb.2:
	cmp	w21, #1
	cset	w8, eq
	lsl	w24, w8, #4
	mov	w23, #1029
	bfi	w23, w8, #4, #1
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	bl	_dib9000_read_word_attr
	str	w0, [x22]
	and	w26, w0, #0xff
Lloh0:
	adrp	x8, _MBX_MAX_WORDS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MBX_MAX_WORDS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w26, w8
	b.le	LBB0_8
; %bb.3:
	str	x26, [sp]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dprintk
	subs	w21, w26, #1
	b.eq	LBB0_5
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	mov	w3, #2
	mov	x4, x20
	bl	_dib9000_read16_noinc_attr
	subs	w21, w21, #1
	b.ne	LBB0_4
LBB0_5:
	mov	w25, #-1
	b	LBB0_16
LBB0_6:
	mov	w0, #0
	b	LBB0_17
LBB0_7:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
	mov	w0, #0
	b	LBB0_17
LBB0_8:
	add	x21, x22, #4
	sub	w25, w26, #1
	lsl	w3, w25, #1
	mov	x0, x19
	mov	x1, x23
	mov	x2, x21
	mov	x4, x20
	bl	_dib9000_read16_noinc_attr
	subs	w8, w26, #2
	b.lo	LBB0_16
; %bb.9:
	cmp	w8, #15
	b.hs	LBB0_11
; %bb.10:
	mov	w8, #0
	b	LBB0_14
LBB0_11:
	add	x9, x8, #1
	and	x8, x9, #0x1fffffff0
	add	x21, x21, x8, lsl #2
	add	x10, x22, #36
	mov	x11, x8
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x10, #-32]
	ldp	q2, q3, [x10]
	sshr.4s	v4, v0, #8
	sshr.4s	v5, v1, #8
	sshr.4s	v6, v2, #8
	sshr.4s	v7, v3, #8
	shl.4s	v0, v0, #8
	shl.4s	v1, v1, #8
	shl.4s	v2, v2, #8
	shl.4s	v3, v3, #8
	orr.16b	v0, v4, v0
	orr.16b	v1, v5, v1
	orr.16b	v2, v6, v2
	stp	q0, q1, [x10, #-32]
	orr.16b	v0, v7, v3
	stp	q2, q0, [x10], #64
	subs	x11, x11, #16
	b.ne	LBB0_12
; %bb.13:
	cmp	x9, x8
	b.eq	LBB0_16
LBB0_14:
	mvn	w8, w8
	add	w8, w8, w26
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x21]
	asr	w10, w9, #8
	orr	w9, w10, w9, lsl #8
	str	w9, [x21], #4
	subs	w8, w8, #1
	b.ne	LBB0_15
LBB0_16:
	mov	w8, #1028
	orr	w1, w24, w8
	mov	x0, x19
	mov	w2, #16384
	mov	x3, x20
	bl	_dib9000_write_word_attr
	mov	x0, x19
	bl	_mutex_unlock
	add	w0, w25, #1
LBB0_17:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not get the lock\n"

	.comm	_MBX_MAX_WORDS,4,2              ; @MBX_MAX_WORDS
l_.str.1:                               ; @.str.1
	.asciz	"MBX: message is too big for message cache (%d), flushing message\n"

	.no_dead_strip	_dib9000_mbx_read
.subsections_via_symbols
