	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hw20k2_i2c_read
_hw20k2_i2c_read:                       ## @hw20k2_i2c_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	_I2C_IF_STATUS@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_hw_read_20kx
	movl	%eax, -36(%rbp)
	movq	_I2C_STATUS_BC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %eax
	xorl	%edx, %edx
	cmpl	$4, %eax
	cmovnel	%eax, %edx
	leaq	-36(%rbp), %rdi
	callq	_set_field
	movl	(%r12), %esi
	movl	-36(%rbp), %edx
	movq	%rbx, %rdi
	callq	_hw_write_20kx
	movq	%rbx, %rdi
	callq	_hw20k2_i2c_wait_data_ready
	movl	$-1, %r12d
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movq	_I2C_IF_WDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_hw_write_20kx
	movq	%rbx, %rdi
	callq	_hw20k2_i2c_wait_data_ready
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	movq	_I2C_IF_RDATA@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_hw_write_20kx
	movq	%rbx, %rdi
	callq	_hw20k2_i2c_wait_data_ready
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_hw_read_20kx
	movq	%rax, (%r14)
	xorl	%r12d, %r12d
LBB0_4:
	movl	%r12d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_IF_STATUS,4,2              ## @I2C_IF_STATUS
	.comm	_I2C_STATUS_BC,4,2              ## @I2C_STATUS_BC
	.comm	_I2C_IF_WDATA,4,2               ## @I2C_IF_WDATA
	.comm	_I2C_IF_RDATA,4,2               ## @I2C_IF_RDATA
	.no_dead_strip	_hw20k2_i2c_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hw20k2_i2c_read
_hw20k2_i2c_read:                       ; @hw20k2_i2c_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _I2C_IF_STATUS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _I2C_IF_STATUS@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_hw_read_20kx
	str	w0, [sp, #12]
Lloh2:
	adrp	x8, _I2C_STATUS_BC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _I2C_STATUS_BC@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	w8, [x20]
	cmp	w8, #4
	csel	w2, wzr, w8, eq
	add	x0, sp, #12
	bl	_set_field
	ldr	w1, [x22]
	ldr	w2, [sp, #12]
	mov	x0, x20
	bl	_hw_write_20kx
	mov	x0, x20
	bl	_hw20k2_i2c_wait_data_ready
	cbz	w0, LBB0_4
; %bb.1:
Lloh5:
	adrp	x8, _I2C_IF_WDATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I2C_IF_WDATA@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_hw_write_20kx
	mov	x0, x20
	bl	_hw20k2_i2c_wait_data_ready
	cbz	w0, LBB0_4
; %bb.2:
Lloh8:
	adrp	x21, _I2C_IF_RDATA@GOTPAGE
Lloh9:
	ldr	x21, [x21, _I2C_IF_RDATA@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #0
	bl	_hw_write_20kx
	mov	x0, x20
	bl	_hw20k2_i2c_wait_data_ready
	cbz	w0, LBB0_4
; %bb.3:
	ldr	w1, [x21]
	mov	x0, x20
	bl	_hw_read_20kx
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19]
	b	LBB0_5
LBB0_4:
	mov	w0, #-1
LBB0_5:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_IF_STATUS,4,2              ; @I2C_IF_STATUS
	.comm	_I2C_STATUS_BC,4,2              ; @I2C_STATUS_BC
	.comm	_I2C_IF_WDATA,4,2               ; @I2C_IF_WDATA
	.comm	_I2C_IF_RDATA,4,2               ; @I2C_IF_RDATA
	.no_dead_strip	_hw20k2_i2c_read
.subsections_via_symbols
