	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_write
_i2c_write:                             ## @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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %r15d
	movq	%rsi, %rbx
	callq	_device_get_softc
	movq	%rax, %r12
	movl	$0, (%r14)
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rdx
	movq	%rax, %rdi
	movl	$1, %esi
	movl	%r15d, %r8d
	callq	_DEVICE_DEBUGF
	xorl	%r13d, %r13d
	cmpl	%r15d, (%r14)
	jge	LBB0_3
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movsbl	(%rbx), %ecx
	movq	%r12, %rdi
	movl	$1, %esi
	leaq	L_.str.1(%rip), %rdx
	xorl	%eax, %eax
	callq	_DEBUGF
	movq	_I2C_STATUS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_i2c_write_reg
	movq	_I2C_DATA_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movsbl	(%rbx), %edx
	movq	%r12, %rdi
	callq	_i2c_write_reg
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_wait_for_xfer
	movl	%eax, %r13d
	movq	_IIC_NOERR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	incq	%rbx
	movl	(%r14), %eax
	incl	%eax
	movl	%eax, (%r14)
	cmpl	%r15d, %eax
	jl	LBB0_1
LBB0_3:
	leaq	L_.str.2(%rip), %rdx
	movq	%r12, %rdi
	movl	$1, %esi
	xorl	%eax, %eax
	callq	_DEBUGF
	movq	%r12, %rdi
	movl	%r13d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_i2c_error_handler              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write  0x%02x len %d: "

L_.str.1:                               ## @.str.1
	.asciz	"0x%02x "

	.comm	_I2C_STATUS_REG,4,2             ## @I2C_STATUS_REG
	.comm	_I2C_DATA_REG,4,2               ## @I2C_DATA_REG
	.comm	_IIC_NOERR,4,2                  ## @IIC_NOERR
L_.str.2:                               ## @.str.2
	.asciz	"\n"

	.no_dead_strip	_i2c_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_write
_i2c_write:                             ; @i2c_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	bl	_device_get_softc
	mov	x19, x0
	str	wzr, [x20]
	ldr	w3, [x0]
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #1
	mov	x4, x21
	bl	_DEVICE_DEBUGF
	mov	w24, #0
	ldr	w8, [x20]
	cmp	w8, w21
	b.ge	LBB0_4
; %bb.1:
Lloh2:
	adrp	x23, l_.str.1@PAGE
Lloh3:
	add	x23, x23, l_.str.1@PAGEOFF
Lloh4:
	adrp	x25, _I2C_STATUS_REG@GOTPAGE
Lloh5:
	ldr	x25, [x25, _I2C_STATUS_REG@GOTPAGEOFF]
Lloh6:
	adrp	x26, _I2C_DATA_REG@GOTPAGE
Lloh7:
	ldr	x26, [x26, _I2C_DATA_REG@GOTPAGEOFF]
Lloh8:
	adrp	x27, _IIC_NOERR@GOTPAGE
Lloh9:
	ldr	x27, [x27, _IIC_NOERR@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldrsb	x8, [x22]
	str	x8, [sp]
	mov	x0, x19
	mov	w1, #1
	mov	x2, x23
	bl	_DEBUGF
	ldr	w1, [x25]
	mov	x0, x19
	mov	w2, #0
	bl	_i2c_write_reg
	ldr	w1, [x26]
	ldrsb	w2, [x22]
	mov	x0, x19
	bl	_i2c_write_reg
	mov	x0, x19
	mov	w1, #1
	bl	_wait_for_xfer
	mov	x24, x0
	ldr	w8, [x27]
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x22, x22, #1
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
	cmp	w8, w21
	b.lt	LBB0_2
LBB0_4:
Lloh10:
	adrp	x2, l_.str.2@PAGE
Lloh11:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	w1, #1
	bl	_DEBUGF
	mov	x0, x19
	mov	x1, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_i2c_error_handler
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write  0x%02x len %d: "

l_.str.1:                               ; @.str.1
	.asciz	"0x%02x "

	.comm	_I2C_STATUS_REG,4,2             ; @I2C_STATUS_REG
	.comm	_I2C_DATA_REG,4,2               ; @I2C_DATA_REG
	.comm	_IIC_NOERR,4,2                  ; @IIC_NOERR
l_.str.2:                               ; @.str.2
	.asciz	"\n"

	.no_dead_strip	_i2c_write
.subsections_via_symbols
