	.file	"extr_at24.c_at24_write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	at24_write, @function
at24_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, esi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rcx
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	at24_base_client_dev@PLT
	xor	edi, edi
	test	rbx, rbx
	sete	dil
	mov	r13, rax
	call	unlikely@PLT
	test	rax, rax
	jne	.L4
	mov	eax, r15d
	mov	edx, DWORD PTR 0[rbp]
	add	rax, rbx
	cmp	rax, rdx
	jbe	.L15
.L4:
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	rdi, r13
	call	pm_runtime_get_sync@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L16
	lea	rax, 4[rbp]
	mov	rdi, rax
	mov	QWORD PTR 8[rsp], rax
	call	mutex_lock@PLT
	mov	edi, DWORD PTR 8[rbp]
	xor	esi, esi
	call	gpiod_set_value_cansleep@PLT
	test	rbx, rbx
	jne	.L8
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	cdqe
	add	r15d, r12d
	add	r14, rax
	sub	rbx, rax
	je	.L6
.L8:
	mov	rcx, rbx
	mov	edx, r15d
	mov	rsi, r14
	mov	rdi, rbp
	call	at24_regmap_write@PLT
	mov	r12d, eax
	test	eax, eax
	jns	.L7
	mov	edi, DWORD PTR 8[rbp]
	mov	esi, 1
	call	gpiod_set_value_cansleep@PLT
	mov	rdi, QWORD PTR 8[rsp]
	call	mutex_unlock@PLT
	mov	rdi, r13
	call	pm_runtime_put@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edi, DWORD PTR 8[rbp]
	mov	esi, 1
	xor	r12d, r12d
	call	gpiod_set_value_cansleep@PLT
	mov	rdi, QWORD PTR 8[rsp]
	call	mutex_unlock@PLT
	mov	rdi, r13
	call	pm_runtime_put@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rdi, r13
	call	pm_runtime_put_noidle@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	at24_write, .-at24_write
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_at24.c_at24_write.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	at24_write, %function
at24_write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r3
	mov	fp, r1
	mov	r6, r2
	mov	r8, r0
	bl	at24_base_client_dev
	mov	r9, r0
	clz	r0, r5
	lsr	r0, r0, #5
	bl	unlikely
	subs	r7, r0, #0
	bne	.L4
	ldr	r3, [r8]
	add	r2, r5, fp
	cmp	r2, r3
	bls	.L15
.L4:
	ldr	r3, .L17
	ldr	r7, [r3]
	rsb	r7, r7, #0
.L1:
	mov	r0, r7
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	mov	r0, r9
	bl	pm_runtime_get_sync
	subs	r4, r0, #0
	blt	.L16
	add	r10, r8, #4
	mov	r0, r10
	bl	mutex_lock
	mov	r1, r7
	ldr	r0, [r8, #8]
	bl	gpiod_set_value_cansleep
	cmp	r5, #0
	bne	.L8
	b	.L6
.L7:
	subs	r5, r5, r4
	add	r6, r6, r4
	add	fp, fp, r4
	beq	.L6
.L8:
	mov	r3, r5
	mov	r2, fp
	mov	r1, r6
	mov	r0, r8
	bl	at24_regmap_write
	subs	r4, r0, #0
	bge	.L7
	mov	r7, r4
	mov	r1, #1
	ldr	r0, [r8, #8]
	bl	gpiod_set_value_cansleep
	mov	r0, r10
	bl	mutex_unlock
	mov	r0, r9
	bl	pm_runtime_put
	mov	r0, r7
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L6:
	mov	r1, #1
	ldr	r0, [r8, #8]
	bl	gpiod_set_value_cansleep
	mov	r0, r10
	bl	mutex_unlock
	mov	r0, r9
	bl	pm_runtime_put
	mov	r0, r7
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	mov	r0, r9
	bl	pm_runtime_put_noidle
	mov	r7, r4
	b	.L1
.L18:
	.align	2
.L17:
	.word	EINVAL
	.size	at24_write, .-at24_write
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
