	.file	"extr_tpm_i2c_infineon.c_iic_tpm_write_generic.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	iic_tpm_write_generic, @function
iic_tpm_write_generic:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	mov	r12d, ecx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	ecx, DWORD PTR EIO[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	lea	rax, 1[rdx]
	cmp	QWORD PTR TPM_I2C_INFINEON_BUFSIZE[rip], r14
	mov	QWORD PTR 16[rsp], rax
	mov	rax, QWORD PTR tpm_dev[rip]
	mov	QWORD PTR 24[rsp], rax
	mov	rax, QWORD PTR tpm_dev[rip+8]
	mov	edx, DWORD PTR 8[rax]
	mov	DWORD PTR 32[rsp], edx
	jb	.L18
	mov	ebx, edi
	mov	rdi, QWORD PTR [rax]
	mov	rax, QWORD PTR [rdi]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L4
	mov	eax, DWORD PTR EOPNOTSUPP[rip]
	neg	eax
.L1:
	mov	rcx, QWORD PTR 40[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L19
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L4:
	.cfi_restore_state
	mov	r15, rsi
	mov	esi, DWORD PTR I2C_LOCK_SEGMENT[rip]
	mov	DWORD PTR 12[rsp], ecx
	mov	ebp, r9d
	mov	r13d, r8d
	call	i2c_lock_bus@PLT
	mov	rdi, QWORD PTR tpm_dev[rip]
	mov	rdx, r14
	mov	rsi, r15
	mov	DWORD PTR [rdi], ebx
	add	rdi, 4
	call	memcpy@PLT
	test	ebp, ebp
	mov	ecx, DWORD PTR 12[rsp]
	jle	.L5
	xor	ebx, ebx
	lea	r14, 16[rsp]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L21:
	mov	esi, r13d
	mov	edi, r12d
	add	ebx, 1
	call	usleep_range@PLT
	cmp	ebp, ebx
	je	.L20
.L7:
	mov	rax, QWORD PTR tpm_dev[rip+8]
	mov	edx, 1
	mov	rsi, r14
	mov	rdi, QWORD PTR [rax]
	call	__i2c_transfer@PLT
	test	eax, eax
	jle	.L21
	mov	rax, QWORD PTR tpm_dev[rip+8]
	mov	esi, DWORD PTR I2C_LOCK_SEGMENT[rip]
	mov	rdi, QWORD PTR [rax]
	call	i2c_unlock_bus@PLT
	mov	esi, DWORD PTR SLEEP_DURATION_HI[rip]
	mov	edi, DWORD PTR SLEEP_DURATION_LOW[rip]
	call	usleep_range@PLT
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rax, QWORD PTR tpm_dev[rip+8]
	mov	esi, DWORD PTR I2C_LOCK_SEGMENT[rip]
	mov	rdi, QWORD PTR [rax]
	call	i2c_unlock_bus@PLT
	mov	esi, DWORD PTR SLEEP_DURATION_HI[rip]
	mov	edi, DWORD PTR SLEEP_DURATION_LOW[rip]
	call	usleep_range@PLT
.L9:
	mov	eax, DWORD PTR EIO[rip]
	neg	eax
	jmp	.L1
.L5:
	mov	rax, QWORD PTR tpm_dev[rip+8]
	mov	esi, DWORD PTR I2C_LOCK_SEGMENT[rip]
	mov	DWORD PTR 12[rsp], ecx
	mov	rdi, QWORD PTR [rax]
	call	i2c_unlock_bus@PLT
	mov	esi, DWORD PTR SLEEP_DURATION_HI[rip]
	mov	edi, DWORD PTR SLEEP_DURATION_LOW[rip]
	call	usleep_range@PLT
	mov	ecx, DWORD PTR 12[rsp]
	test	ecx, ecx
	jns	.L9
	xor	eax, eax
	jmp	.L1
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	iic_tpm_write_generic, .-iic_tpm_write_generic
	.comm	tpm_dev,16,16
	.comm	TPM_I2C_INFINEON_BUFSIZE,8,8
	.comm	SLEEP_DURATION_LOW,4,4
	.comm	SLEEP_DURATION_HI,4,4
	.comm	I2C_LOCK_SEGMENT,4,4
	.comm	EOPNOTSUPP,4,4
	.comm	EIO,4,4
	.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_tpm_i2c_infineon.c_iic_tpm_write_generic.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	iic_tpm_write_generic, %function
iic_tpm_write_generic:
	@ args = 8, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r5, .L21
	ldr	lr, .L21+4
	ldr	ip, [r5, #4]
	ldr	r4, [lr]
	ldr	r7, [ip, #4]
	mov	r6, r3
	ldr	lr, [r5]
	ldr	r3, .L21+8
	ldr	r9, .L21+12
	sub	sp, sp, #28
	add	r8, r2, #1
	cmp	r4, r2
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	str	r8, [sp, #8]
	str	r7, [sp, #16]
	ldr	r3, [r9]
	ldr	r8, [sp, #64]
	ldr	r7, [sp, #68]
	str	lr, [sp, #12]
	bcc	.L17
	mov	fp, r0
	ldr	r0, [ip]
	mov	r4, r1
	ldr	r1, [r0]
	ldr	r1, [r1]
	cmp	r1, #0
	bne	.L4
	ldr	r3, .L21+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	ldr	r3, .L21+8
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r10, .L21+20
	str	r3, [sp]
	ldr	r1, [r10]
	str	r2, [sp, #4]
	bl	i2c_lock_bus
	ldr	r0, [r5]
	mov	r1, r4
	ldr	r2, [sp, #4]
	str	fp, [r0], #4
	bl	memcpy
	cmp	r7, #0
	ldr	r3, [sp]
	ble	.L5
	mov	r4, #0
	b	.L7
.L20:
	mov	r1, r8
	mov	r0, r6
	add	r4, r4, #1
	bl	usleep_range
	cmp	r7, r4
	beq	.L19
.L7:
	ldr	r3, [r5, #4]
	mov	r2, #1
	ldr	r0, [r3]
	add	r1, sp, #8
	bl	__i2c_transfer
	cmp	r0, #0
	ble	.L20
	ldr	r3, [r5, #4]
	ldr	r1, [r10]
	ldr	r0, [r3]
	bl	i2c_unlock_bus
	ldr	r2, .L21+24
	ldr	r3, .L21+28
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	usleep_range
.L15:
	mov	r0, #0
	b	.L1
.L17:
	ldr	r3, .L21+32
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L19:
	ldr	r3, [r5, #4]
	ldr	r1, [r10]
	ldr	r0, [r3]
	bl	i2c_unlock_bus
	ldr	r2, .L21+24
	ldr	r3, .L21+28
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	usleep_range
.L9:
	ldr	r0, [r9]
	rsb	r0, r0, #0
	b	.L1
.L5:
	ldr	r2, [r5, #4]
	ldr	r1, [r10]
	ldr	r0, [r2]
	str	r3, [sp]
	bl	i2c_unlock_bus
	ldr	r2, .L21+28
	ldr	r1, .L21+24
	ldr	r0, [r2]
	ldr	r1, [r1]
	bl	usleep_range
	ldr	r3, [sp]
	cmp	r3, #0
	blt	.L15
	b	.L9
.L18:
	bl	__stack_chk_fail
.L22:
	.align	2
.L21:
	.word	tpm_dev
	.word	TPM_I2C_INFINEON_BUFSIZE
	.word	.LC0
	.word	EIO
	.word	EOPNOTSUPP
	.word	I2C_LOCK_SEGMENT
	.word	SLEEP_DURATION_HI
	.word	SLEEP_DURATION_LOW
	.word	EINVAL
	.size	iic_tpm_write_generic, .-iic_tpm_write_generic
	.comm	tpm_dev,8,4
	.comm	TPM_I2C_INFINEON_BUFSIZE,4,4
	.comm	SLEEP_DURATION_LOW,4,4
	.comm	SLEEP_DURATION_HI,4,4
	.comm	I2C_LOCK_SEGMENT,4,4
	.comm	EOPNOTSUPP,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
