	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at24_write
_at24_write:                            ## @at24_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, %r12
	movl	%esi, %r13d
	movq	%rdi, %r15
	callq	_at24_base_client_dev
	movq	%rax, %r14
	xorl	%edi, %edi
	testq	%rbx, %rbx
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movl	%r13d, %eax
	addq	%rbx, %rax
	movl	(%r15), %ecx
	cmpq	%rcx, %rax
	jbe	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_10:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_pm_runtime_get_sync
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	leaq	4(%r14), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movl	8(%r14), %edi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_gpiod_set_value_cansleep
	testq	%rbx, %rbx
	je	LBB0_9
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%r13d, %edx
	movq	%rbx, %rcx
	callq	_at24_regmap_write
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%r14d, %eax
	addq	%rax, %r12
	addl	%r14d, %r13d
	subq	%rax, %rbx
	jne	LBB0_6
LBB0_9:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	movl	$1, %esi
	callq	_gpiod_set_value_cansleep
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_pm_runtime_put
	jmp	LBB0_10
LBB0_4:
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_pm_runtime_put_noidle
	jmp	LBB0_10
LBB0_7:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	movl	$1, %esi
	callq	_gpiod_set_value_cansleep
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_pm_runtime_put
	movl	%r14d, %r15d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_at24_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at24_write
_at24_write:                            ; @at24_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
	bl	_at24_base_client_dev
	mov	x19, x0
	cmp	x21, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_2
; %bb.1:
	add	x8, x21, w23, uxtw
	ldr	w9, [x20]
	cmp	x8, x9
	b.ls	LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_3:
	mov	x0, x25
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x0, x19
	bl	_pm_runtime_get_sync
	tbnz	w0, #31, LBB0_9
; %bb.5:
	add	x24, x20, #4
	mov	x0, x24
	bl	_mutex_lock
	ldr	w0, [x20, #8]
	mov	w1, #0
	bl	_gpiod_set_value_cansleep
	cbz	x21, LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	mov	x3, x21
	bl	_at24_regmap_write
	mov	x25, x0
	tbnz	w0, #31, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w8, w25
	add	x22, x22, x8
	add	w23, w25, w23
	subs	x21, x21, x8
	b.ne	LBB0_6
LBB0_8:
	ldr	w0, [x20, #8]
	mov	w1, #1
	bl	_gpiod_set_value_cansleep
	mov	x0, x24
	bl	_mutex_unlock
	mov	x0, x19
	bl	_pm_runtime_put
	mov	w25, #0
	b	LBB0_3
LBB0_9:
	mov	x25, x0
	mov	x0, x19
	bl	_pm_runtime_put_noidle
	b	LBB0_3
LBB0_10:
	ldr	w0, [x20, #8]
	mov	w1, #1
	bl	_gpiod_set_value_cansleep
	mov	x0, x24
	bl	_mutex_unlock
	mov	x0, x19
	bl	_pm_runtime_put
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_at24_write
.subsections_via_symbols
