	.file	"extr_pmecc.c_atmel_pmecc_create_user.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	atmel_pmecc_create_user
	.type	atmel_pmecc_create_user, @function
atmel_pmecc_create_user:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rsi
	call	atmel_pmecc_prepare_user_req@PLT
	mov	ebp, eax
	mov	edi, eax
	test	eax, eax
	jne	.L10
	mov	esi, 4
	mov	edi, 112
	call	ALIGN@PLT
	mov	edx, DWORD PTR [rbx]
	mov	esi, 4
	mov	r8d, eax
	lea	ecx, 4[rdx]
	lea	eax, 1[rdx+rdx]
	imul	eax, ecx
	lea	eax, 1[rdx+rax]
	lea	edi, [r8+rax*4]
	call	ALIGN@PLT
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	r8d, eax
	mov	eax, DWORD PTR [rbx]
	lea	eax, 3[rax+rax*2]
	lea	edi, [r8+rax*4]
	call	kzalloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L12
	mov	QWORD PTR 104[rax], r13
	lea	rdi, 112[rax]
	mov	esi, 4
	call	PTR_ALIGN@PLT
	mov	esi, DWORD PTR [rbx]
	mov	QWORD PTR 96[r12], rax
	lea	edx, [rsi+rsi]
	movsx	rdi, edx
	add	edx, 1
	add	rdi, 1
	lea	rcx, 0[0+rdi*8]
	sub	rcx, rdi
	sal	rcx, 4
	lea	rdi, [rax+rcx]
	lea	rax, [rdi+rcx]
	movsx	rcx, esi
	mov	QWORD PTR 88[r12], rdi
	add	rcx, 1
	mov	QWORD PTR 80[r12], rax
	lea	rdi, 0[0+rcx*8]
	sub	rdi, rcx
	sal	rdi, 4
	add	rdi, rax
	lea	eax, 2[rsi]
	mov	esi, 4
	imul	edx, eax
	mov	QWORD PTR 72[r12], rdi
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	sub	rdx, rax
	mov	rax, rdx
	sal	rax, 4
	add	rdi, rax
	call	PTR_ALIGN@PLT
	movsx	rdx, DWORD PTR [rbx]
	mov	rdi, rbx
	mov	QWORD PTR 64[r12], rax
	lea	rdx, 4[0+rdx*4]
	add	rax, rdx
	mov	QWORD PTR 48[r12], rax
	add	rax, rdx
	mov	QWORD PTR 56[r12], rax
	call	atmel_pmecc_get_gf_tables@PLT
	mov	rdi, rax
	mov	r14, rax
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L13
	mov	eax, DWORD PTR 4[rbx]
	mov	QWORD PTR 40[r12], r14
	cdq
	idiv	DWORD PTR 8[rbx]
	mov	rdx, QWORD PTR 0[r13]
	mov	DWORD PTR [r12], eax
	mov	eax, DWORD PTR [rdx]
	test	eax, eax
	jle	.L5
	lea	edi, -1[rax]
	mov	rsi, QWORD PTR 8[rdx]
	mov	ecx, DWORD PTR [rbx]
	xor	eax, eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L14:
	lea	ebp, 1[rax]
	lea	rdx, 1[rax]
	cmp	rax, rdi
	je	.L5
	mov	rax, rdx
.L6:
	mov	ebp, eax
	cmp	DWORD PTR [rsi+rax*4], ecx
	jne	.L14
.L5:
	mov	edi, ebp
	call	PMECC_CFG_BCH_STRENGTH@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	ebp, eax
	call	PMECC_CFG_NSECTORS@PLT
	or	eax, ebp
	cmp	DWORD PTR 12[rbx], 1024
	mov	DWORD PTR 8[r12], eax
	jne	.L7
	or	eax, DWORD PTR PMECC_CFG_SECTOR1024[rip]
	mov	DWORD PTR 8[r12], eax
.L7:
	mov	rax, QWORD PTR 24[rbx]
	movsx	rdx, DWORD PTR 4[rbx]
	sub	rax, 1
	mov	QWORD PTR 32[r12], rax
	mov	rax, QWORD PTR 16[rbx]
	mov	QWORD PTR 24[r12], rax
	lea	rax, -1[rax+rdx]
	mov	QWORD PTR 16[r12], rax
	mov	rax, r12
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	edi, DWORD PTR ENOMEM[rip]
	neg	edi
.L10:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	ERR_PTR@PLT
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	rdi, r12
	call	kfree@PLT
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	rdi, r14
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	ERR_CAST@PLT
	.cfi_endproc
.LFE0:
	.size	atmel_pmecc_create_user, .-atmel_pmecc_create_user
	.comm	PMECC_CFG_SECTOR1024,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,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_pmecc.c_atmel_pmecc_create_user.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.global	atmel_pmecc_create_user
	.syntax unified
	.arm
	.fpu softvfp
	.type	atmel_pmecc_create_user, %function
atmel_pmecc_create_user:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r7, r0
	mov	r6, r1
	bl	atmel_pmecc_prepare_user_req
	cmp	r0, #0
	bne	.L10
	mov	r1, #4
	mov	r0, #56
	bl	ALIGN
	mov	r1, #4
	ldr	r2, [r6]
	lsl	r3, r2, #1
	add	ip, r2, r1
	add	r3, r3, #1
	add	r2, r2, #1
	mla	r3, ip, r3, r2
	add	r0, r0, r3, lsl #2
	bl	ALIGN
	ldr	r3, [r6]
	ldr	r2, .L15
	add	r3, r3, #1
	add	r3, r3, r3, lsl #1
	ldr	r1, [r2]
	add	r0, r0, r3, lsl #2
	bl	kzalloc
	subs	r5, r0, #0
	beq	.L12
	mov	r1, #4
	str	r7, [r5, #52]
	add	r0, r5, #56
	bl	PTR_ALIGN
	ldr	r3, [r6]
	str	r0, [r5, #48]
	lsl	r1, r3, #1
	add	ip, r3, #2
	rsb	r2, r3, r3, lsl #3
	add	r1, r1, #1
	mul	r1, ip, r1
	lsl	r2, r2, #4
	add	r2, r2, #56
	add	r0, r0, r2
	add	r3, r3, #1
	add	r2, r0, r2
	rsb	r3, r3, r3, lsl #3
	add	r3, r2, r3, lsl #3
	rsb	r1, r1, r1, lsl #3
	str	r2, [r5, #40]
	str	r0, [r5, #44]
	str	r3, [r5, #36]
	add	r0, r3, r1, lsl #3
	mov	r1, #4
	bl	PTR_ALIGN
	ldr	r3, [r6]
	str	r0, [r5, #32]
	add	r3, r3, #1
	add	r0, r0, r3, lsl #2
	add	r3, r0, r3, lsl #2
	str	r3, [r5, #28]
	str	r0, [r5, #24]
	mov	r0, r6
	bl	atmel_pmecc_get_gf_tables
	mov	r8, r0
	bl	IS_ERR
	subs	r4, r0, #0
	bne	.L13
	ldmib	r6, {r0, r1}
	str	r8, [r5, #20]
	bl	__aeabi_idiv
	ldr	r3, [r7]
	str	r0, [r5]
	ldr	r1, [r3]
	cmp	r1, #0
	ble	.L5
	ldr	r3, [r3, #4]
	ldr	r0, [r6]
	sub	r3, r3, #4
	b	.L6
.L14:
	add	r4, r4, #1
	cmp	r4, r1
	beq	.L5
.L6:
	ldr	r2, [r3, #4]!
	cmp	r2, r0
	bne	.L14
.L5:
	mov	r0, r4
	bl	PMECC_CFG_BCH_STRENGTH
	mov	r4, r0
	ldr	r0, [r6, #8]
	bl	PMECC_CFG_NSECTORS
	ldr	r3, [r6, #12]
	orr	r0, r4, r0
	cmp	r3, #1024
	ldreq	r3, .L15+4
	ldr	r1, [r6, #16]
	ldreq	r3, [r3]
	str	r0, [r5, #4]
	orreq	r0, r3, r0
	ldr	r3, [r6, #4]
	ldr	r2, [r6, #20]
	add	r3, r1, r3
	sub	r3, r3, #1
	sub	r2, r2, #1
	streq	r0, [r5, #4]
	str	r3, [r5, #8]
	mov	r0, r5
	str	r2, [r5, #16]
	str	r1, [r5, #12]
	pop	{r4, r5, r6, r7, r8, pc}
.L12:
	ldr	r3, .L15+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L10:
	pop	{r4, r5, r6, r7, r8, lr}
	b	ERR_PTR
.L13:
	mov	r0, r5
	bl	kfree
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, lr}
	b	ERR_CAST
.L16:
	.align	2
.L15:
	.word	GFP_KERNEL
	.word	PMECC_CFG_SECTOR1024
	.word	ENOMEM
	.size	atmel_pmecc_create_user, .-atmel_pmecc_create_user
	.comm	PMECC_CFG_SECTOR1024,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
