	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_pmecc_prepare_user_req
_atmel_pmecc_prepare_user_req:          ## @atmel_pmecc_prepare_user_req
	.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
	movl	(%rsi), %eax
	testl	%eax, %eax
	jle	LBB0_24
## %bb.1:
	movq	%rsi, %rbx
	movq	8(%rsi), %rcx
	testq	%rcx, %rcx
	jle	LBB0_24
## %bb.2:
	movl	16(%rbx), %r15d
	testl	%r15d, %r15d
	jle	LBB0_24
## %bb.3:
	movq	%rdi, %r14
	movq	24(%rbx), %rdx
	testq	%rdx, %rdx
	js	LBB0_5
## %bb.4:
	addq	%r15, %rdx
	cmpq	%rcx, %rdx
	jg	LBB0_24
LBB0_5:
	movl	32(%rbx), %esi
	movq	_ATMEL_PMECC_SECTOR_SIZE_AUTO@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %esi
	jne	LBB0_8
## %bb.6:
	movl	36(%rbx), %ecx
	movq	_ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_24
## %bb.7:
	xorl	%esi, %esi
	cmpl	$513, %eax                      ## imm = 0x201
	setae	%sil
	shll	$9, %esi
	addl	$512, %esi                      ## imm = 0x200
	movl	%esi, 32(%rbx)
	jmp	LBB0_10
LBB0_8:
	cmpl	$512, %esi                      ## imm = 0x200
	je	LBB0_10
## %bb.9:
	cmpl	$1024, %esi                     ## imm = 0x400
	jne	LBB0_24
LBB0_10:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	divl	%esi
	testl	%edx, %edx
	je	LBB0_12
## %bb.11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_12:
	movl	%eax, 40(%rbx)
	movq	(%r14), %rcx
	cmpl	$0, (%rcx)
	jle	LBB0_24
## %bb.13:
	movl	36(%rbx), %esi
	movq	_ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r12d, %r12d
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_16
LBB0_14:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	(%r14), %rcx
	movl	%edx, %esi
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_15:                                ##   in Loop: Header=BB0_16 Depth=1
	incq	%r12
	movslq	(%rcx), %rax
	cmpq	%rax, %r12
	jge	LBB0_21
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rcx), %rax
	movl	(%rax,%r12,4), %r13d
	cmpl	%edx, %esi
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	cmpl	%esi, %r13d
	jl	LBB0_15
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	32(%rbx), %edi
	shll	$3, %edi
	callq	_fls
	imull	%r13d, %eax
	movl	%eax, %edi
	movl	$8, %esi
	callq	_DIV_ROUND_UP
	imull	40(%rbx), %eax
	cmpl	%r15d, %eax
	jg	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	36(%rbx), %edx
	movq	_ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
	je	LBB0_14
## %bb.20:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
LBB0_21:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	je	LBB0_24
## %bb.22:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, 16(%rbx)
	movl	%eax, 36(%rbx)
	xorl	%ecx, %ecx
	cmpq	$0, 24(%rbx)
	jns	LBB0_26
## %bb.23:
	movq	8(%rbx), %rax
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movq	%rax, 24(%rbx)
	jmp	LBB0_26
LBB0_24:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
LBB0_25:
	subl	(%rax), %ecx
LBB0_26:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ATMEL_PMECC_SECTOR_SIZE_AUTO,4,2 ## @ATMEL_PMECC_SECTOR_SIZE_AUTO
	.comm	_ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH,4,2 ## @ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH
	.no_dead_strip	_atmel_pmecc_prepare_user_req
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_pmecc_prepare_user_req
_atmel_pmecc_prepare_user_req:          ; @atmel_pmecc_prepare_user_req
	.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
	ldr	w8, [x1]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x19, x1
	ldr	x9, [x1, #8]
	cmp	x9, #1
	b.lt	LBB0_11
; %bb.2:
	ldr	w21, [x19, #16]
	cmp	w21, #0
	b.le	LBB0_11
; %bb.3:
	mov	x20, x0
	ldr	x10, [x19, #24]
	tbnz	x10, #63, LBB0_5
; %bb.4:
	add	x10, x10, x21
	cmp	x10, x9
	b.gt	LBB0_11
LBB0_5:
	ldr	w9, [x19, #32]
Lloh0:
	adrp	x10, _ATMEL_PMECC_SECTOR_SIZE_AUTO@GOTPAGE
Lloh1:
	ldr	x10, [x10, _ATMEL_PMECC_SECTOR_SIZE_AUTO@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_8
; %bb.6:
	ldr	w9, [x19, #36]
Lloh3:
	adrp	x10, _ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH@GOTPAGE
Lloh4:
	ldr	x10, [x10, _ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_11
; %bb.7:
	mov	w9, #512
	mov	w10, #1024
	cmp	w8, #512
	csel	w9, w10, w9, hi
	str	w9, [x19, #32]
	b	LBB0_10
LBB0_8:
	cmp	w9, #512
	b.eq	LBB0_10
; %bb.9:
	cmp	w9, #1024
	b.ne	LBB0_11
LBB0_10:
	udiv	w10, w8, w9
	msub	w8, w10, w9, w8
	cbz	w8, LBB0_13
LBB0_11:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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_13:
	str	w10, [x19, #40]
	ldr	x8, [x20]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_11
; %bb.14:
	mov	x23, #0
	mov	w25, #0
	mov	w22, #0
	ldr	w10, [x19, #36]
Lloh9:
	adrp	x24, _ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH@GOTPAGE
Lloh10:
	ldr	x24, [x24, _ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH@GOTPAGEOFF]
	ldr	w9, [x24]
	b	LBB0_17
LBB0_15:                                ;   in Loop: Header=BB0_17 Depth=1
	ldr	x8, [x20]
	mov	x10, x9
	mov	x25, x26
	mov	x22, x11
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	x23, x23, #1
	ldrsw	x11, [x8]
	cmp	x23, x11
	b.ge	LBB0_22
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x8, #8]
	ldr	w26, [x11, x23, lsl #2]
	cmp	w10, w9
	b.eq	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	cmp	w26, w10
	b.lt	LBB0_16
LBB0_19:                                ;   in Loop: Header=BB0_17 Depth=1
	ldr	w8, [x19, #32]
	lsl	w0, w8, #3
	bl	_fls
	mul	w0, w0, w26
	mov	w1, #8
	bl	_DIV_ROUND_UP
	ldr	w8, [x19, #40]
	mul	w11, w8, w0
	cmp	w11, w21
	b.gt	LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	w9, [x19, #36]
	ldr	w8, [x24]
	cmp	w9, w8
	b.eq	LBB0_15
; %bb.21:
	mov	x22, x11
	mov	x25, x26
LBB0_22:
	cbz	w25, LBB0_11
; %bb.23:
	str	w22, [x19, #16]
	str	w25, [x19, #36]
	ldr	x8, [x19, #24]
	tbnz	x8, #63, LBB0_25
; %bb.24:
	mov	w0, #0
	b	LBB0_12
LBB0_25:
	mov	w0, #0
	ldr	x8, [x19, #8]
	sub	x8, x8, w22, sxtw
	str	x8, [x19, #24]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ATMEL_PMECC_SECTOR_SIZE_AUTO,4,2 ; @ATMEL_PMECC_SECTOR_SIZE_AUTO
	.comm	_ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH,4,2 ; @ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH
	.no_dead_strip	_atmel_pmecc_prepare_user_req
.subsections_via_symbols
