	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i2c_write                      ## -- Begin function i2c_write
	.p2align	4, 0x90
_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	%rsi, %rbx
	movq	_TWDR@GOTPCREL(%rip), %rax
	movl	%edi, (%rax)
	movq	_TWINT@GOTPCREL(%rip), %r15
	movq	_TWEN@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %eax
	shll	%cl, %eax
	movb	(%r15), %cl
	btsl	%ecx, %eax
	movq	_TWCR@GOTPCREL(%rip), %r12
	movl	%eax, (%r12)
	xorl	%eax, %eax
	callq	_timer_read
	movq	%rax, %r14
	movl	(%r12), %eax
	movl	(%r15), %ecx
	btl	%ecx, %eax
	jae	LBB0_1
LBB0_7:
	movq	_TW_STATUS@GOTPCREL(%rip), %rax
	movl	$248, %ecx
	andl	(%rax), %ecx
	movq	_TW_MT_DATA_ACK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_8
## %bb.9:
	movq	_I2C_STATUS_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	_I2C_STATUS_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_1:
	movq	_I2C_TIMEOUT_INFINITE@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	btl	%ecx, %eax
	jb	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rbx, (%r13)
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_timer_read
	subq	%r14, %rax
	cmpq	%rbx, %rax
	jge	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %eax
	movl	(%r15), %ecx
	jmp	LBB0_6
LBB0_4:
	movq	_I2C_STATUS_TIMEOUT@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TWDR,4,2                       ## @TWDR
	.comm	_TWINT,4,2                      ## @TWINT
	.comm	_TWEN,4,2                       ## @TWEN
	.comm	_TWCR,4,2                       ## @TWCR
	.comm	_I2C_TIMEOUT_INFINITE,8,3       ## @I2C_TIMEOUT_INFINITE
	.comm	_I2C_STATUS_TIMEOUT,4,2         ## @I2C_STATUS_TIMEOUT
	.comm	_TW_STATUS,4,2                  ## @TW_STATUS
	.comm	_TW_MT_DATA_ACK,4,2             ## @TW_MT_DATA_ACK
	.comm	_I2C_STATUS_ERROR,4,2           ## @I2C_STATUS_ERROR
	.comm	_I2C_STATUS_SUCCESS,4,2         ## @I2C_STATUS_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i2c_write                      ; -- Begin function i2c_write
	.p2align	2
_i2c_write:                             ; @i2c_write
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
Lloh0:
	adrp	x8, _TWDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TWDR@GOTPAGEOFF]
Lloh2:
	adrp	x21, _TWINT@GOTPAGE
Lloh3:
	ldr	x21, [x21, _TWINT@GOTPAGEOFF]
Lloh4:
	str	w0, [x8]
	ldr	w8, [x21]
	mov	w9, #1
	lsl	w8, w9, w8
Lloh5:
	adrp	x10, _TWEN@GOTPAGE
Lloh6:
	ldr	x10, [x10, _TWEN@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
Lloh8:
	adrp	x22, _TWCR@GOTPAGE
Lloh9:
	ldr	x22, [x22, _TWCR@GOTPAGEOFF]
	str	w8, [x22]
	bl	_timer_read
	ldr	w8, [x22]
	ldr	w9, [x21]
	lsr	w10, w8, w9
	tbz	w10, #0, LBB0_3
LBB0_1:
Lloh10:
	adrp	x8, _TW_STATUS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TW_STATUS@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	and	w8, w8, #0xf8
Lloh13:
	adrp	x9, _TW_MT_DATA_ACK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _TW_MT_DATA_ACK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
Lloh16:
	adrp	x10, _I2C_STATUS_ERROR@GOTPAGE
Lloh17:
	ldr	x10, [x10, _I2C_STATUS_ERROR@GOTPAGEOFF]
Lloh18:
	adrp	x11, _I2C_STATUS_SUCCESS@GOTPAGE
Lloh19:
	ldr	x11, [x11, _I2C_STATUS_SUCCESS@GOTPAGEOFF]
	cmp	w8, w9
	csel	x23, x11, x10, eq
LBB0_2:
	ldr	w0, [x23]
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x20, x0
Lloh20:
	adrp	x24, _I2C_TIMEOUT_INFINITE@GOTPAGE
Lloh21:
	ldr	x24, [x24, _I2C_TIMEOUT_INFINITE@GOTPAGEOFF]
Lloh22:
	adrp	x23, _I2C_STATUS_TIMEOUT@GOTPAGE
Lloh23:
	ldr	x23, [x23, _I2C_STATUS_TIMEOUT@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	lsr	w10, w8, w9
	tbnz	w10, #0, LBB0_1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x24]
	cmp	x10, x19
	b.eq	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_timer_read
	sub	x8, x0, x20
	cmp	x8, x19
	b.ge	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x22]
	ldr	w9, [x21]
	b	LBB0_4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_TWDR,4,2                       ; @TWDR
	.comm	_TWINT,4,2                      ; @TWINT
	.comm	_TWEN,4,2                       ; @TWEN
	.comm	_TWCR,4,2                       ; @TWCR
	.comm	_I2C_TIMEOUT_INFINITE,8,3       ; @I2C_TIMEOUT_INFINITE
	.comm	_I2C_STATUS_TIMEOUT,4,2         ; @I2C_STATUS_TIMEOUT
	.comm	_TW_STATUS,4,2                  ; @TW_STATUS
	.comm	_TW_MT_DATA_ACK,4,2             ; @TW_MT_DATA_ACK
	.comm	_I2C_STATUS_ERROR,4,2           ; @I2C_STATUS_ERROR
	.comm	_I2C_STATUS_SUCCESS,4,2         ; @I2C_STATUS_SUCCESS
.subsections_via_symbols
