	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_s5c73m3_read                   ## -- Begin function s5c73m3_read
	.p2align	4, 0x90
_s5c73m3_read:                          ## @s5c73m3_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	8(%rdi), %r15
	movl	(%rdi), %eax
	xorl	%esi, %eax
	cmpl	$65536, %eax                    ## imm = 0x10000
	jb	LBB0_3
## %bb.1:
	movq	_REG_CMDRD_ADDRH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	sarl	$16, %edx
	movq	%r15, %rdi
	callq	_s5c73m3_i2c_write
	testl	%eax, %eax
	js	LBB0_8
## %bb.2:
	movl	(%r12), %eax
	xorl	%ebx, %eax
LBB0_3:
	testw	%ax, %ax
	je	LBB0_5
## %bb.4:
	movq	_REG_CMDRD_ADDRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzwl	%bx, %edx
	movq	%r15, %rdi
	callq	_s5c73m3_i2c_write
	testl	%eax, %eax
	js	LBB0_8
LBB0_5:
	movl	%ebx, (%r12)
	movq	_REG_CMDBUF_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_s5c73m3_i2c_read
	testl	%eax, %eax
	js	LBB0_10
## %bb.6:
	movl	(%r12), %ecx
	addl	$2, %ecx
	jmp	LBB0_9
LBB0_8:
	xorl	%ecx, %ecx
LBB0_9:
	movl	%ecx, (%r12)
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_CMDRD_ADDRH,4,2            ## @REG_CMDRD_ADDRH
	.comm	_REG_CMDRD_ADDRL,4,2            ## @REG_CMDRD_ADDRL
	.comm	_REG_CMDBUF_ADDR,4,2            ## @REG_CMDBUF_ADDR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_s5c73m3_read                   ; -- Begin function s5c73m3_read
	.p2align	2
_s5c73m3_read:                          ; @s5c73m3_read
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x21, [x0, #8]
	ldr	w8, [x0]
	eor	w8, w8, w1
	cmp	w8, #16, lsl #12                ; =65536
	b.lo	LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _REG_CMDRD_ADDRH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_CMDRD_ADDRH@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	asr	w2, w22, #16
	mov	x0, x21
	bl	_s5c73m3_i2c_write
	tbnz	w0, #31, LBB0_7
; %bb.2:
	ldr	w8, [x19]
	eor	w8, w8, w22
LBB0_3:
	tst	w8, #0xffff
	b.eq	LBB0_5
; %bb.4:
Lloh3:
	adrp	x8, _REG_CMDRD_ADDRL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_CMDRD_ADDRL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	and	w2, w22, #0xffff
	mov	x0, x21
	bl	_s5c73m3_i2c_write
	tbnz	w0, #31, LBB0_7
LBB0_5:
	str	w22, [x19]
Lloh6:
	adrp	x8, _REG_CMDBUF_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_CMDBUF_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x20
	bl	_s5c73m3_i2c_read
	tbnz	w0, #31, LBB0_9
; %bb.6:
	ldr	w8, [x19]
	add	w8, w8, #2
	b	LBB0_8
LBB0_7:
	mov	w8, #0
LBB0_8:
	str	w8, [x19]
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_CMDRD_ADDRH,4,2            ; @REG_CMDRD_ADDRH
	.comm	_REG_CMDRD_ADDRL,4,2            ; @REG_CMDRD_ADDRL
	.comm	_REG_CMDBUF_ADDR,4,2            ; @REG_CMDBUF_ADDR
.subsections_via_symbols
