	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib9000_write16_attr
_dib9000_write16_attr:                  ## @dib9000_write16_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r12d
	movq	%rcx, %r13
	movq	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r15
	cmpl	$1023, %esi                     ## imm = 0x3FF
	jg	LBB0_4
## %bb.1:
	cmpq	$0, 24(%r15)
	je	LBB0_4
## %bb.2:
	movq	_DATA_BUS_ACCESS_MODE_16BIT@GOTPCREL(%rip), %rax
	movq	_DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT@GOTPCREL(%rip), %rcx
	orl	(%rax), %r12d
	orl	(%rcx), %r12d
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	movq	%r14, %rcx
	movq	%r13, %r8
	callq	_dib9000_risc_apb_access_write
	testq	%rax, %rax
	je	LBB0_3
## %bb.12:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_13
LBB0_4:
	movq	8(%r15), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movl	16(%r15), %ecx
	sarl	%ecx
	movq	8(%r15), %rax
	movl	%ecx, (%rax)
	movq	$0, 24(%rax)
	movq	(%r15), %rdi
	movq	%rdi, 8(%rax)
	leaq	2(%r13), %rcx
	movq	%rcx, 16(%rax)
	movzbl	%bh, %ecx
	movl	%ecx, (%rdi)
	movzbl	%bl, %edx
	movl	%edx, 4(%rdi)
	movq	_DATA_BUS_ACCESS_MODE_8BIT@GOTPCREL(%rip), %rdx
	testl	%r12d, (%rdx)
	je	LBB0_6
## %bb.5:
	orl	$32, %ecx
	movl	%ecx, (%rdi)
LBB0_6:
	movq	_DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT@GOTPCREL(%rip), %rdx
	testl	%r12d, (%rdx)
	je	LBB0_8
## %bb.7:
	orl	$16, %ecx
	movl	%ecx, (%rdi)
LBB0_8:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$126, %r13
	movl	$126, %ebx
	cmovlq	%r13, %rbx
	leaq	2(%rbx), %rcx
	movq	%rcx, 16(%rax)
	addq	$8, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_memcpy
	movl	20(%r15), %edi
	movq	8(%r15), %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	movl	%eax, %ecx
	xorl	%eax, %eax
	movq	_EREMOTEIO@GOTPCREL(%rip), %rdx
	subl	(%rdx), %eax
	cmpl	$1, %ecx
	cmovel	%r12d, %eax
	testl	%eax, %eax
	jne	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	subq	%rbx, %r13
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	leaq	(%r14,%rbx,4), %r14
	movq	(%r15), %rdi
	movq	8(%r15), %rax
	jmp	LBB0_9
LBB0_3:
	xorl	%eax, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DATA_BUS_ACCESS_MODE_16BIT,4,2 ## @DATA_BUS_ACCESS_MODE_16BIT
	.comm	_DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT,4,2 ## @DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DATA_BUS_ACCESS_MODE_8BIT,4,2  ## @DATA_BUS_ACCESS_MODE_8BIT
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.no_dead_strip	_dib9000_write16_attr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib9000_write16_attr
_dib9000_write16_attr:                  ; @dib9000_write16_attr
	.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	x22, x4
	mov	x19, x3
	mov	x20, x2
	mov	x23, x1
	mov	x21, x0
	cmp	w1, #1023
	b.gt	LBB0_5
; %bb.1:
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _DATA_BUS_ACCESS_MODE_16BIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DATA_BUS_ACCESS_MODE_16BIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w8, w22
	orr	w2, w8, w9
	mov	x0, x21
	mov	x1, x23
	mov	x3, x20
	mov	x4, x19
	bl	_dib9000_risc_apb_access_write
	cbz	x0, LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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
LBB0_5:
	ldr	x0, [x21, #8]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w8, [x21, #16]
	asr	w10, w8, #1
	ldp	x9, x8, [x21]
	str	w10, [x8]
	add	x10, x19, #2
	str	x9, [x8, #8]
	stp	x10, xzr, [x8, #16]
	ubfx	w10, w23, #8, #8
	and	w11, w23, #0xff
	stp	w10, w11, [x9]
Lloh9:
	adrp	x11, _DATA_BUS_ACCESS_MODE_8BIT@GOTPAGE
Lloh10:
	ldr	x11, [x11, _DATA_BUS_ACCESS_MODE_8BIT@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	tst	w11, w22
	b.eq	LBB0_7
; %bb.6:
	orr	w10, w10, #0x20
	str	w10, [x9]
LBB0_7:
Lloh12:
	adrp	x11, _DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT@GOTPAGE
Lloh13:
	ldr	x11, [x11, _DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	tst	w11, w22
	b.eq	LBB0_9
; %bb.8:
	orr	w10, w10, #0x10
	str	w10, [x9]
LBB0_9:
	mov	w23, #126
Lloh15:
	adrp	x24, _EREMOTEIO@GOTPAGE
Lloh16:
	ldr	x24, [x24, _EREMOTEIO@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	cmp	x19, #126
	csel	x22, x19, x23, lt
	add	x10, x22, #2
	str	x10, [x8, #16]
	add	x0, x9, #8
	mov	x1, x20
	mov	x2, x22
	bl	_memcpy
	ldr	w0, [x21, #20]
	ldr	x1, [x21, #8]
	mov	w2, #1
	bl	_i2c_transfer
	ldr	w8, [x24]
	cmp	w0, #1
	csneg	w0, wzr, w8, eq
	sub	x19, x19, x22
	cmp	w0, #0
	ccmp	x19, #0, #4, eq
	b.eq	LBB0_4
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x20, x20, x22, lsl #2
	ldp	x9, x8, [x21]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_DATA_BUS_ACCESS_MODE_16BIT,4,2 ; @DATA_BUS_ACCESS_MODE_16BIT
	.comm	_DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT,4,2 ; @DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DATA_BUS_ACCESS_MODE_8BIT,4,2  ; @DATA_BUS_ACCESS_MODE_8BIT
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.no_dead_strip	_dib9000_write16_attr
.subsections_via_symbols
