	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib9000_risc_apb_access_write
_dib9000_risc_apb_access_write:         ## @dib9000_risc_apb_access_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	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r8d killed $r8d def $r8
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	cmpl	$1023, %esi                     ## imm = 0x3FF
	jg	LBB0_2
## %bb.1:
	movq	%rdi, %r12
	cmpl	$0, (%rdi)
	je	LBB0_2
## %bb.3:
	cmpl	$19, %r8d
	jl	LBB0_4
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-40(%rbp), %rcx
	jne	LBB0_17
## %bb.16:
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	%edx, %r14d
	movl	%esi, -80(%rbp)
	cmpl	$2, %r8d
	jl	LBB0_12
## %bb.5:
	movl	%r8d, %r11d
	leaq	-2(%r11), %r10
	cmpq	$14, %r10
	jae	LBB0_7
## %bb.6:
	movl	$1, %r9d
	xorl	%r15d, %r15d
	jmp	LBB0_10
LBB0_7:
	shrq	%r10
	incq	%r10
	movq	%r10, %rdi
	andq	$-8, %rdi
	leaq	(%rdi,%rdi), %r15
	leaq	(%rdi,%rdi), %r9
	incq	%r9
	xorl	%esi, %esi
	movabsq	$4611686018427387896, %rbx      ## imm = 0x3FFFFFFFFFFFFFF8
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movups	(%rcx,%rsi,8), %xmm0
	movups	16(%rcx,%rsi,8), %xmm1
	movups	32(%rcx,%rsi,8), %xmm2
	movups	48(%rcx,%rsi,8), %xmm3
	movaps	%xmm0, %xmm4
	shufps	$136, %xmm1, %xmm4              ## xmm4 = xmm4[0,2],xmm1[0,2]
	movaps	%xmm2, %xmm5
	shufps	$136, %xmm3, %xmm5              ## xmm5 = xmm5[0,2],xmm3[0,2]
	shufps	$221, %xmm1, %xmm0              ## xmm0 = xmm0[1,3],xmm1[1,3]
	shufps	$221, %xmm3, %xmm2              ## xmm2 = xmm2[1,3],xmm3[1,3]
	pslld	$8, %xmm4
	por	%xmm0, %xmm4
	pslld	$8, %xmm5
	por	%xmm2, %xmm5
	movq	%rsi, %rax
	andq	%rbx, %rax
	movdqu	%xmm4, -76(%rbp,%rax,4)
	movdqu	%xmm5, -60(%rbp,%rax,4)
	addq	$8, %rsi
	cmpq	%rsi, %rdi
	jne	LBB0_8
## %bb.9:
	cmpq	%rdi, %r10
	je	LBB0_12
LBB0_10:
	leaq	(%rcx,%r15,4), %rsi
	movq	%r15, %rax
	andq	$-2, %rax
	leaq	-76(,%rax,2), %rdi
	addq	%rbp, %rdi
	incq	%r15
	leaq	(%rcx,%r9,4), %rbx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rsi,%rax,4), %edx
	shll	$8, %edx
	orl	(%rbx,%rax,4), %edx
	movl	%edx, (%rdi,%rax,2)
	leaq	(%r15,%rax), %rdx
	addq	$2, %rdx
	addq	$2, %rax
	cmpq	%r11, %rdx
	jb	LBB0_11
LBB0_12:
	testb	$1, %r8b
	je	LBB0_14
## %bb.13:
	movslq	%r8d, %rax
	movl	-4(%rcx,%rax,4), %eax
	shll	$8, %eax
	movl	%r8d, %ecx
	shrl	$31, %ecx
	addl	%r8d, %ecx
	sarl	%ecx
	movslq	%ecx, %rcx
	movl	%eax, -76(%rbp,%rcx,4)
LBB0_14:
	movq	_OUT_MSG_BRIDGE_APB_W@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r8d, %eax
	addl	$3, %eax
	shrl	$31, %eax
	leal	(%r8,%rax), %ecx
	addl	$3, %ecx
	sarl	%ecx
	leaq	-80(%rbp), %r15
	movq	%r12, %rdi
	movq	%r15, %rdx
	movl	%r14d, %r8d
	callq	_dib9000_mbx_send_attr
	movq	_IN_MSG_END_BRIDGE_APB_RW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-84(%rbp), %rcx
	movq	%r12, %rdi
	movq	%r15, %rdx
	movl	%r14d, %r8d
	callq	_dib9000_mbx_get_message_attr
	movl	%eax, %ecx
	movq	_EINVAL@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	subl	(%rdx), %eax
	xorl	%edx, %edx
	cmpl	$1, %ecx
	cmovel	%edx, %eax
	jmp	LBB0_15
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_OUT_MSG_BRIDGE_APB_W,4,2       ## @OUT_MSG_BRIDGE_APB_W
	.comm	_IN_MSG_END_BRIDGE_APB_RW,4,2   ## @IN_MSG_END_BRIDGE_APB_RW
	.no_dead_strip	_dib9000_risc_apb_access_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib9000_risc_apb_access_write
_dib9000_risc_apb_access_write:         ; @dib9000_risc_apb_access_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	cmp	w1, #1023
	b.gt	LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_3
; %bb.2:
	cmp	w4, #19
	b.lt	LBB0_6
LBB0_3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldur	x8, [x29, #-24]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
	mov	x19, x2
	str	w1, [sp, #16]
	cmp	w4, #2
	b.lt	LBB0_14
; %bb.7:
	mov	w8, w4
	sub	x9, x8, #2
	cmp	x9, #30
	b.hs	LBB0_9
; %bb.8:
	mov	x9, #0
	mov	w10, #1
	b	LBB0_12
LBB0_9:
	mov	x11, #0
	lsr	x9, x9, #1
	add	x12, x9, #1
	and	x13, x12, #0xfffffffffffffff0
	lsr	x14, x13, #4
	lsl	x9, x13, #1
	mov	w10, #1
	bfi	x10, x14, #5, #59
	add	x14, x3, #64
	add	x15, sp, #16
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	sub	x16, x14, #64
	ld2.4s	{ v0, v1 }, [x16]
	sub	x16, x14, #32
	ld2.4s	{ v2, v3 }, [x16]
	mov	x16, x14
	ld2.4s	{ v4, v5 }, [x16], #32
	ld2.4s	{ v6, v7 }, [x16]
	shl.4s	v16, v0, #8
	shl.4s	v17, v2, #8
	shl.4s	v18, v4, #8
	shl.4s	v19, v6, #8
	orr.16b	v0, v16, v1
	orr.16b	v1, v17, v3
	orr.16b	v2, v18, v5
	orr.16b	v3, v19, v7
	and	x16, x11, #0x3ffffffffffffff0
	add	x16, x15, x16, lsl #2
	stur	q0, [x16, #4]
	stur	q1, [x16, #20]
	stur	q2, [x16, #36]
	stur	q3, [x16, #52]
	add	x11, x11, #16
	add	x14, x14, #128
	cmp	x13, x11
	b.ne	LBB0_10
; %bb.11:
	cmp	x12, x13
	b.eq	LBB0_14
LBB0_12:
	lsl	x11, x9, #1
	and	x11, x11, #0xfffffffffffffffc
	add	x12, sp, #16
	add	x11, x11, x12
	add	x11, x11, #4
	lsl	x10, x10, #2
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x3, x9, lsl #2]
	ldr	w13, [x3, x10]
	orr	w12, w13, w12, lsl #8
	str	w12, [x11], #4
	add	x12, x9, #3
	add	x9, x9, #2
	add	x10, x10, #8
	cmp	x12, x8
	b.lo	LBB0_13
LBB0_14:
	tbz	w4, #0, LBB0_16
; %bb.15:
	sub	w8, w4, #1
	ldr	w8, [x3, w8, sxtw #2]
	lsl	w8, w8, #8
	cmp	w4, #0
	cinc	w9, w4, lt
	asr	w9, w9, #1
	add	x10, sp, #16
	add	x9, x10, w9, sxtw #2
	str	w8, [x9, #4]
LBB0_16:
Lloh9:
	adrp	x8, _OUT_MSG_BRIDGE_APB_W@GOTPAGE
Lloh10:
	ldr	x8, [x8, _OUT_MSG_BRIDGE_APB_W@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	w8, w4, #3
	add	w9, w4, #4
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w3, w8, #1
	add	x2, sp, #16
	mov	x0, x20
	mov	x4, x19
	bl	_dib9000_mbx_send_attr
Lloh12:
	adrp	x8, _IN_MSG_END_BRIDGE_APB_RW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IN_MSG_END_BRIDGE_APB_RW@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x2, sp, #16
	add	x3, sp, #12
	mov	x0, x20
	mov	x4, x19
	bl	_dib9000_mbx_get_message_attr
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w0, #1
	csneg	w0, wzr, w8, eq
	b	LBB0_4
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_OUT_MSG_BRIDGE_APB_W,4,2       ; @OUT_MSG_BRIDGE_APB_W
	.comm	_IN_MSG_END_BRIDGE_APB_RW,4,2   ; @IN_MSG_END_BRIDGE_APB_RW
	.no_dead_strip	_dib9000_risc_apb_access_write
.subsections_via_symbols
