	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function highlander_i2c_write
_highlander_i2c_write:                  ## @highlander_i2c_write
	.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)
	movl	(%rdi), %edx
	movl	16(%rdi), %edi
	leaq	-112(%rbp), %rsi
	callq	_smbus_write_data
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_3
## %bb.1:
	leaq	(%rax,%rax), %r12
	addq	$2, %r12
	andq	$-4, %r12
	xorl	%ebx, %ebx
	leaq	L_.str(%rip), %r14
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	-112(%rbp,%rbx), %edi
	movq	8(%r15), %rsi
	movq	_SMTRDR@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	addq	%rbx, %rsi
	callq	_iowrite16
	movl	4(%r15), %edi
	movl	-112(%rbp,%rbx), %ecx
	movq	%r14, %rsi
	movl	%r13d, %edx
	callq	_dev_dbg
	incl	%r13d
	addq	$4, %rbx
	cmpq	%rbx, %r12
	jne	LBB0_2
LBB0_3:
	movq	%r15, %rdi
	callq	_highlander_i2c_wait_for_bbsy
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_5:
	movq	%r15, %rdi
	callq	_highlander_i2c_start
	movq	%r15, %rdi
	callq	_highlander_i2c_wait_xfer_done
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_8
## %bb.7:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SMTRDR,8,3                     ## @SMTRDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write data[%x] 0x%04x\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_highlander_i2c_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function highlander_i2c_write
_highlander_i2c_write:                  ; @highlander_i2c_write
	.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]
	ldr	w0, [x0, #16]
	ldr	w2, [x19]
	add	x22, sp, #8
	add	x1, sp, #8
	bl	_smbus_write_data
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x23, #0
	mov	w20, #0
	lsl	x8, x8, #1
	add	x8, x8, #2
	and	x24, x8, #0x3fffffffc
Lloh3:
	adrp	x25, _SMTRDR@GOTPAGE
Lloh4:
	ldr	x25, [x25, _SMTRDR@GOTPAGEOFF]
Lloh5:
	adrp	x21, l_.str@PAGE
Lloh6:
	add	x21, x21, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22, x23]
	ldr	x8, [x19, #8]
	ldr	x9, [x25]
	add	x8, x8, x9
	add	x1, x23, x8
	bl	_iowrite16
	ldr	w0, [x19, #4]
	ldr	w3, [x22, x23]
	mov	x1, x21
	mov	x2, x20
	bl	_dev_dbg
	add	w20, w20, #1
	add	x23, x23, #4
	cmp	x24, x23
	b.ne	LBB0_2
LBB0_3:
	mov	x0, x19
	bl	_highlander_i2c_wait_for_bbsy
	cbz	x0, LBB0_5
; %bb.4:
Lloh7:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_highlander_i2c_start
	mov	x0, x19
	bl	_highlander_i2c_wait_xfer_done
LBB0_6:
	ldr	x8, [sp, #72]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	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_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SMTRDR,8,3                     ; @SMTRDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write data[%x] 0x%04x\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_highlander_i2c_write
.subsections_via_symbols
