	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib9000_read16_attr
_dib9000_read16_attr:                   ## @dib9000_read16_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movl	%esi, %r14d
	movq	%rdi, %r12
	cmpl	$1023, %esi                     ## imm = 0x3FF
	jg	LBB0_3
## %bb.1:
	cmpq	$0, 24(%r12)
	je	LBB0_3
## %bb.2:
	movq	%rbx, (%rsp)
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movq	%r13, %r9
	callq	_dib9000_risc_apb_access_read
	jmp	LBB0_10
LBB0_3:
	movq	8(%r12), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	16(%r12), %ecx
	sarl	%ecx
	movq	8(%r12), %rsi
	movl	%ecx, (%rsi)
	movq	$0, 24(%rsi)
	movq	(%r12), %rax
	movq	%rax, 8(%rsi)
	movl	$2, 16(%rsi)
	movl	%ecx, 32(%rsi)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 56(%rsi)
	movq	%r13, 40(%rsi)
	movl	%ebx, 48(%rsi)
	movl	%r14d, %ecx
	sarl	$8, %ecx
	movl	%ecx, (%rax)
	movzbl	%r14b, %edx
	movl	%edx, 4(%rax)
	movq	_DATA_BUS_ACCESS_MODE_8BIT@GOTPCREL(%rip), %rdx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	testl	%edi, (%rdx)
	je	LBB0_5
## %bb.4:
	orl	$32, %ecx
	movl	%ecx, (%rax)
LBB0_5:
	movq	_DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT@GOTPCREL(%rip), %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	testl	%edx, (%rdi)
	je	LBB0_7
## %bb.6:
	orl	$16, %ecx
	movl	%ecx, (%rax)
LBB0_7:
	cmpq	$126, %rbx
	movl	$126, %r15d
	cmovlq	%rbx, %r15
	movl	%r15d, 48(%rsi)
	movq	%r13, 40(%rsi)
	movl	20(%r12), %edi
	movl	$2, %edx
	callq	_i2c_transfer
	movq	_EREMOTEIO@GOTPCREL(%rip), %rcx
	cmpl	$2, %eax
	je	LBB0_11
## %bb.8:
	cmpl	$0, (%rcx)
	je	LBB0_11
LBB0_9:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_dprintk
	xorl	%eax, %eax
	movq	_EREMOTEIO@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=1
	leaq	(%r13,%r15,4), %r13
	cmpq	$126, %rbx
	movl	$126, %r15d
	cmovlq	%rbx, %r15
	movq	8(%r12), %rsi
	movl	%r15d, 48(%rsi)
	movq	%r13, 40(%rsi)
	movl	20(%r12), %edi
	movl	$2, %edx
	callq	_i2c_transfer
	cmpl	$2, %eax
	je	LBB0_11
## %bb.16:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_9
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	subq	%r15, %rbx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	_DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r15, %rax
	shrq	$63, %rax
	addq	%r15, %rax
	shrq	%rax
	addl	%eax, %r14d
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	testq	%rbx, %rbx
	jne	LBB0_15
## %bb.14:
	xorl	%eax, %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,8,3                   ## @I2C_M_RD
	.comm	_DATA_BUS_ACCESS_MODE_8BIT,4,2  ## @DATA_BUS_ACCESS_MODE_8BIT
	.comm	_DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT,4,2 ## @DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c read error on %d\n"

	.no_dead_strip	_dib9000_read16_attr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib9000_read16_attr
_dib9000_read16_attr:                   ; @dib9000_read16_attr
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x4
	mov	x19, x3
	mov	x21, x2
	mov	x20, x1
	mov	x23, x0
	cmp	w1, #1023
	b.gt	LBB0_3
; %bb.1:
	ldr	x8, [x23, #24]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x23
	mov	x1, x20
	mov	x2, x22
	mov	x3, #0
	mov	w4, #0
	mov	x5, x21
	mov	x6, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_dib9000_risc_apb_access_read
LBB0_3:
	ldr	x0, [x23, #8]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w8, [x23, #16]
	asr	w9, w8, #1
	ldp	x8, x1, [x23]
	str	w9, [x1]
	str	xzr, [x1, #24]
	str	x8, [x1, #8]
	mov	w10, #2
	str	w10, [x1, #16]
	str	w9, [x1, #32]
Lloh0:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	str	x9, [x1, #56]
	str	x21, [x1, #40]
	str	w19, [x1, #48]
	asr	w9, w20, #8
	and	w10, w20, #0xff
	stp	w9, w10, [x8]
Lloh3:
	adrp	x10, _DATA_BUS_ACCESS_MODE_8BIT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _DATA_BUS_ACCESS_MODE_8BIT@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	tst	w10, w22
	b.eq	LBB0_5
; %bb.4:
	orr	w9, w9, #0x20
	str	w9, [x8]
LBB0_5:
Lloh6:
	adrp	x24, _DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT@GOTPAGE
Lloh7:
	ldr	x24, [x24, _DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT@GOTPAGEOFF]
	ldr	w10, [x24]
	tst	w10, w22
	b.eq	LBB0_7
; %bb.6:
	orr	w9, w9, #0x10
	str	w9, [x8]
LBB0_7:
	mov	w8, #126
	cmp	x19, #126
	csel	x25, x19, x8, lt
	str	w25, [x1, #48]
	str	x21, [x1, #40]
	ldr	w0, [x23, #20]
	mov	w2, #2
	bl	_i2c_transfer
Lloh8:
	adrp	x26, _EREMOTEIO@GOTPAGE
Lloh9:
	ldr	x26, [x26, _EREMOTEIO@GOTPAGEOFF]
	cmp	w0, #2
	b.eq	LBB0_11
; %bb.8:
	ldr	w8, [x26]
	cbz	w8, LBB0_11
LBB0_9:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_dprintk
	ldr	w8, [x26]
	neg	w0, w8
	b	LBB0_13
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x21, x21, x25, lsl #2
	ldr	x1, [x23, #8]
	mov	w8, #126
	cmp	x19, #126
	csel	x25, x19, x8, lt
	str	w25, [x1, #48]
	str	x21, [x1, #40]
	ldr	w0, [x23, #20]
	mov	w2, #2
	bl	_i2c_transfer
	ldr	w8, [x26]
	cmp	w0, #2
	ccmp	w8, #0, #4, ne
	b.ne	LBB0_9
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	cmp	x25, #0
	cinc	x9, x25, lt
	lsr	x9, x9, #1
	add	w9, w20, w9
	tst	w8, w22
	csel	w20, w20, w9, ne
	sub	x19, x19, x25
	cbnz	x19, LBB0_10
; %bb.12:
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RD,8,3                   ; @I2C_M_RD
	.comm	_DATA_BUS_ACCESS_MODE_8BIT,4,2  ; @DATA_BUS_ACCESS_MODE_8BIT
	.comm	_DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT,4,2 ; @DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c read error on %d\n"

	.no_dead_strip	_dib9000_read16_attr
.subsections_via_symbols
