	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at24_eeprom_write
_at24_eeprom_write:                     ## @at24_eeprom_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	%rcx, %r14
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movl	%edx, -44(%rbp)
	leaq	-44(%rbp), %rsi
	callq	_at24_translate_offset
	movq	(%rbx), %rcx
	cmpq	%r14, %rcx
	cmovbq	%rcx, %r14
	movq	%rax, %r15
	movl	-44(%rbp), %edi
	incl	%edi
	movl	28(%rbx), %esi
	callq	_roundup
	movl	%eax, %r12d
	movl	-44(%rbp), %eax
	movq	%rax, %rcx
	addq	%r14, %rcx
	movl	%r12d, %edx
	subl	%eax, %r12d
	cmpq	%rdx, %rcx
	cmovbeq	%r14, %r12
	cmpq	$0, 16(%rbx)
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_5
## %bb.1:
	movl	8(%r15), %ecx
	movl	%ecx, -80(%rbp)
	movq	$0, -88(%rbp)
	movq	8(%rbx), %rcx
	movq	%rcx, -104(%rbp)
	movq	_AT24_FLAG_ADDR16@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, 24(%rbx)
	je	LBB0_2
## %bb.3:
	shrl	$8, %eax
	movl	%eax, (%rcx)
	movl	$1, %r14d
	movl	-44(%rbp), %eax
	jmp	LBB0_4
LBB0_2:
	xorl	%r14d, %r14d
LBB0_4:
	movl	%r14d, %edx
	movl	%eax, (%rcx,%rdx,4)
	leaq	(%rcx,%rdx,4), %rdi
	addq	$4, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	callq	_memcpy
	leal	(%r14,%r12), %eax
	incl	%eax
	movl	%eax, -96(%rbp)
LBB0_5:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	_write_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, %r13
	addq	%r14, %r13
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	cmpq	$0, 16(%rbx)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	-44(%rbp), %esi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r12, %rdx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_i2c_smbus_write_i2c_block_data
	movl	%eax, %r15d
	testl	%eax, %eax
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	4(%rbx), %edi
	leaq	-104(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	movl	%eax, %r15d
	cmpl	$1, %eax
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	cmovel	%r12d, %r15d
	movl	-44(%rbp), %ecx
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %r9
	movq	%rbx, %rdi
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdx
	movl	%r15d, %r8d
	callq	_dev_dbg
	movslq	%r15d, %rax
	cmpq	%rax, %r12
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	$1, %edi
	callq	_msleep
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_time_before
	testq	%rax, %rax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_6
## %bb.11:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_12:
	movl	%r12d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AT24_FLAG_ADDR16,4,2           ## @AT24_FLAG_ADDR16
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_write_timeout,4,2              ## @write_timeout
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write %zu@%d --> %zd (%ld)\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_at24_eeprom_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at24_eeprom_write
_at24_eeprom_write:                     ; @at24_eeprom_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x22, x3
	mov	x19, x1
	mov	x20, x0
	str	w2, [sp, #44]
	add	x1, sp, #44
	bl	_at24_translate_offset
	mov	x21, x0
	ldr	x8, [x20]
	cmp	x8, x22
	csel	x22, x8, x22, lo
	ldr	w8, [sp, #44]
	add	w0, w8, #1
	ldr	w1, [x20, #28]
	bl	_roundup
	ldr	w8, [sp, #44]
	add	x9, x22, x8
	sub	w10, w0, w8
	cmp	x9, w0, uxtw
	csel	x22, x10, x22, hi
	ldr	x9, [x20, #16]
	cbnz	x9, LBB0_5
; %bb.1:
	ldr	w9, [x21, #8]
	str	w9, [sp, #32]
	ldr	x9, [x20, #8]
	str	xzr, [sp, #24]
	str	x9, [sp, #8]
	ldr	w10, [x20, #24]
Lloh0:
	adrp	x11, _AT24_FLAG_ADDR16@GOTPAGE
Lloh1:
	ldr	x11, [x11, _AT24_FLAG_ADDR16@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x11]
	tst	w11, w10
	b.eq	LBB0_3
; %bb.2:
	lsr	w8, w8, #8
	str	w8, [x9]
	mov	w10, #1
	ldr	w8, [sp, #44]
	b	LBB0_4
LBB0_3:
	mov	w10, #0
LBB0_4:
	add	w23, w10, #1
	str	w8, [x9, w10, uxtw #2]
	add	x0, x9, w23, uxtw #2
	mov	x1, x19
	mov	x2, x22
	bl	_memcpy
	add	w8, w23, w22
	str	w8, [sp, #16]
LBB0_5:
Lloh3:
	adrp	x27, _jiffies@GOTPAGE
Lloh4:
	ldr	x27, [x27, _jiffies@GOTPAGEOFF]
	ldr	x23, [x27]
Lloh5:
	adrp	x8, _write_timeout@GOTPAGE
Lloh6:
	ldr	x8, [x8, _write_timeout@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	add	x23, x0, x23
Lloh8:
	adrp	x24, l_.str@PAGE
Lloh9:
	add	x24, x24, l_.str@PAGEOFF
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x25, [x27]
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [sp, #44]
	mov	x0, x21
	mov	x2, x22
	mov	x3, x19
	bl	_i2c_smbus_write_i2c_block_data
	cmp	w0, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x21, #4]
	add	x1, sp, #8
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	csel	w26, w22, w0, eq
	ldr	w3, [sp, #44]
	ldr	x5, [x27]
	mov	x0, x21
	mov	x1, x24
	mov	x2, x22
	mov	x4, x26
	bl	_dev_dbg
	cmp	x22, w26, sxtw
	b.eq	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w0, #1
	bl	_msleep
	mov	x0, x25
	mov	x1, x23
	bl	_time_before
	cbnz	x0, LBB0_6
; %bb.11:
Lloh10:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_12:
	mov	x0, x22
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_AT24_FLAG_ADDR16,4,2           ; @AT24_FLAG_ADDR16
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_write_timeout,4,2              ; @write_timeout
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write %zu@%d --> %zd (%ld)\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_at24_eeprom_write
.subsections_via_symbols
