	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ds1682_eeprom_write
_ds1682_eeprom_write:                   ## @ds1682_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r12
	movq	%rcx, %r15
	movq	%rdx, %r14
	callq	_kobj_to_i2c_client
	movq	%rax, %r13
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	movq	%r14, %rdx
	movq	%r15, %rcx
	movq	%r12, %r8
	callq	_dev_dbg
	movq	_DS1682_EEPROM_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, %rbx
	subq	%r15, %rbx
	jle	LBB0_1
## %bb.2:
	leaq	(%r12,%r15), %rcx
	cmpq	%rax, %rcx
	cmovbeq	%r12, %rbx
	movq	_DS1682_REG_EEPROM@GOTPCREL(%rip), %rax
	addq	(%rax), %r15
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	callq	_i2c_smbus_write_i2c_block_data
	testq	%rax, %rax
	jns	LBB0_5
## %bb.3:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_1:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
LBB0_5:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ds1682_eeprom_write(p=%p, off=%lli, c=%zi)\n"

	.comm	_DS1682_EEPROM_SIZE,8,3         ## @DS1682_EEPROM_SIZE
	.comm	_ENOSPC,8,3                     ## @ENOSPC
	.comm	_DS1682_REG_EEPROM,8,3          ## @DS1682_REG_EEPROM
	.comm	_EIO,8,3                        ## @EIO
	.no_dead_strip	_ds1682_eeprom_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ds1682_eeprom_write
_ds1682_eeprom_write:                   ; @ds1682_eeprom_write
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x4
	mov	x20, x3
	mov	x19, x2
	bl	_kobj_to_i2c_client
	mov	x22, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	mov	x3, x20
	mov	x4, x21
	bl	_dev_dbg
Lloh2:
	adrp	x8, _DS1682_EEPROM_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DS1682_EEPROM_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	subs	x9, x8, x20
	b.le	LBB0_3
; %bb.1:
	add	x10, x21, x20
	cmp	x10, x8
	csel	x21, x9, x21, hi
Lloh5:
	adrp	x8, _DS1682_REG_EEPROM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DS1682_REG_EEPROM@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	add	x1, x8, x20
	mov	x0, x22
	mov	x2, x21
	mov	x3, x19
	bl	_i2c_smbus_write_i2c_block_data
	tbz	x0, #63, LBB0_5
; %bb.2:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh10:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
LBB0_4:
	ldr	x8, [x8]
	neg	x21, x8
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ds1682_eeprom_write(p=%p, off=%lli, c=%zi)\n"

	.comm	_DS1682_EEPROM_SIZE,8,3         ; @DS1682_EEPROM_SIZE
	.comm	_ENOSPC,8,3                     ; @ENOSPC
	.comm	_DS1682_REG_EEPROM,8,3          ; @DS1682_REG_EEPROM
	.comm	_EIO,8,3                        ; @EIO
	.no_dead_strip	_ds1682_eeprom_write
.subsections_via_symbols
