	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function highlander_i2c_read
_highlander_i2c_read:                   ## @highlander_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_highlander_i2c_wait_for_bbsy
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	callq	_highlander_i2c_start
	movq	%r15, %rdi
	callq	_highlander_i2c_wait_xfer_done
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	20(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_1:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_14
## %bb.13:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_iic_read_delay@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.5:
	movq	_jiffies@GOTPCREL(%rip), %r12
	movq	(%r12), %r14
	movq	8(%r15), %rbx
	callq	_msecs_to_jiffies
	addq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	8(%r15), %rbx
	movq	(%r13), %rdi
	callq	_msecs_to_jiffies
	addq	%rax, %rbx
	subq	(%r12), %rbx
	movq	%rbx, %rdi
	callq	_jiffies_to_msecs
	movl	%eax, %edi
	callq	_msleep
LBB0_7:
	movl	(%r15), %edx
	testl	%edx, %edx
	jle	LBB0_11
## %bb.8:
	leaq	(%rdx,%rdx), %r12
	addq	$2, %r12
	andq	$-4, %r12
	xorl	%ebx, %ebx
	leaq	L_.str.1(%rip), %r14
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r15), %rdi
	movq	_SMTRDR@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	addq	%rbx, %rdi
	callq	_ioread16
	movl	%eax, -112(%rbp,%rbx)
	movl	20(%r15), %edi
	movq	%r14, %rsi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_dev_dbg
	incl	%r13d
	addq	$4, %rbx
	cmpq	%rbx, %r12
	jne	LBB0_9
## %bb.10:
	movl	(%r15), %edx
LBB0_11:
	movl	16(%r15), %esi
	leaq	-112(%rbp), %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_smbus_read_data
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r15)
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Arbitration loss\n"

	.comm	_iic_read_delay,8,3             ## @iic_read_delay
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_SMTRDR,8,3                     ## @SMTRDR
L_.str.1:                               ## @.str.1
	.asciz	"read data[%x] 0x%04x\n"

	.no_dead_strip	_highlander_i2c_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function highlander_i2c_read
_highlander_i2c_read:                   ; @highlander_i2c_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #72]
	bl	_highlander_i2c_wait_for_bbsy
	cbnz	x0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_highlander_i2c_start
	mov	x0, x19
	bl	_highlander_i2c_wait_xfer_done
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w0, [x19, #20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_3:
Lloh5:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldr	x8, [sp, #72]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.5:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_6:
Lloh11:
	adrp	x21, _iic_read_delay@GOTPAGE
Lloh12:
	ldr	x21, [x21, _iic_read_delay@GOTPAGEOFF]
	ldr	x0, [x21]
Lloh13:
	adrp	x22, _jiffies@GOTPAGE
Lloh14:
	ldr	x22, [x22, _jiffies@GOTPAGEOFF]
	cbz	x0, LBB0_9
; %bb.7:
	ldr	x20, [x22]
	ldr	x23, [x19, #8]
	bl	_msecs_to_jiffies
	add	x1, x0, x23
	mov	x0, x20
	bl	_time_before
	cbz	x0, LBB0_9
; %bb.8:
	ldr	x20, [x19, #8]
	ldr	x0, [x21]
	bl	_msecs_to_jiffies
	ldr	x8, [x22]
	add	x9, x0, x20
	sub	x0, x9, x8
	bl	_jiffies_to_msecs
	bl	_msleep
LBB0_9:
	ldr	w2, [x19]
	cmp	w2, #1
	b.lt	LBB0_13
; %bb.10:
	mov	x23, #0
	mov	w20, #0
	lsl	x8, x2, #1
	add	x8, x8, #2
	and	x24, x8, #0x3fffffffc
Lloh15:
	adrp	x25, _SMTRDR@GOTPAGE
Lloh16:
	ldr	x25, [x25, _SMTRDR@GOTPAGEOFF]
	add	x26, sp, #8
Lloh17:
	adrp	x21, l_.str.1@PAGE
Lloh18:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	ldr	x9, [x25]
	add	x8, x8, x9
	add	x0, x23, x8
	bl	_ioread16
	mov	x3, x0
	str	w0, [x26, x23]
	ldr	w0, [x19, #20]
	mov	x1, x21
	mov	x2, x20
	bl	_dev_dbg
	add	w20, w20, #1
	add	x23, x23, #4
	cmp	x24, x23
	b.ne	LBB0_11
; %bb.12:
	ldr	w2, [x19]
LBB0_13:
	ldr	w1, [x19, #16]
	add	x0, sp, #8
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_smbus_read_data
	mov	w0, #0
	ldr	x8, [x22]
	str	x8, [x19, #8]
	b	LBB0_4
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Arbitration loss\n"

	.comm	_iic_read_delay,8,3             ; @iic_read_delay
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_SMTRDR,8,3                     ; @SMTRDR
l_.str.1:                               ; @.str.1
	.asciz	"read data[%x] 0x%04x\n"

	.no_dead_strip	_highlander_i2c_read
.subsections_via_symbols
