	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32_bsec_read
_stm32_bsec_read:                       ## @stm32_bsec_read
	.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	$56, %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, -88(%rbp)                 ## 8-byte Spill
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	16(%rdi), %r15
	movl	%esi, %edi
	movl	$4, %esi
	callq	_rounddown
	movl	%eax, %r14d
	andl	$3, %r13d
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%r13), %rdi
	movl	$4, %esi
	callq	_roundup
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r14), %ecx
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	cmpl	8(%r12), %ecx
	jle	LBB0_1
## %bb.3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_1:
	testl	%eax, %eax
	jle	LBB0_2
## %bb.4:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movslq	%r14d, %r13
	movslq	%ecx, %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movq	_STM32MP15_BSEC_DATA0@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	addq	%r13, %rdi
	callq	_readl_relaxed
	movl	%eax, -44(%rbp)
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	$4, %esi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	subl	%r14d, %esi
	movq	%rbx, %rdi
	callq	_min
	movl	%eax, %r12d
	movslq	%r15d, %rcx
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rdi
	movl	%r14d, %eax
	leaq	-44(,%rax,4), %rsi
	addq	%rbp, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	movslq	%r12d, %r15
	subq	%r15, %rbx
	addl	-96(%rbp), %r15d                ## 4-byte Folded Reload
	addq	$4, %r13
	xorl	%eax, %eax
	cmpq	-80(%rbp), %r13                 ## 8-byte Folded Reload
	jge	LBB0_10
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r13d, %r14d
	sarl	$2, %r14d
	movq	_STM32MP15_BSEC_NUM_LOWER@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jl	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_STM32_SMC_READ_SHADOW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	xorl	%edx, %edx
	leaq	-44(%rbp), %rcx
	callq	_stm32_bsec_smc
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_dev_err
	movl	%r12d, %eax
	jmp	LBB0_10
LBB0_2:
	xorl	%eax, %eax
LBB0_10:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_STM32MP15_BSEC_NUM_LOWER,4,2   ## @STM32MP15_BSEC_NUM_LOWER
	.comm	_STM32MP15_BSEC_DATA0,8,3       ## @STM32MP15_BSEC_DATA0
	.comm	_STM32_SMC_READ_SHADOW,4,2      ## @STM32_SMC_READ_SHADOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't read data%d (%d)\n"

	.no_dead_strip	_stm32_bsec_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stm32_bsec_read
_stm32_bsec_read:                       ; @stm32_bsec_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x3
	mov	x21, x2
	mov	x24, x1
	mov	x22, x0
	ldr	x19, [x0, #16]
	mov	x0, x1
	mov	w1, #4
	bl	_rounddown
	mov	x23, x0
	and	w25, w24, #0x3
	add	x0, x25, x20
	mov	w1, #4
	bl	_roundup
	ldr	w9, [x22, #8]
	add	w8, w0, w23
	cmp	w8, w9
	b.le	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_10
LBB0_2:
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.3:
	str	x19, [sp]                       ; 8-byte Folded Spill
	mov	w26, #0
	sxtw	x27, w23
	sxtw	x28, w8
	add	x19, sp, #12
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x22]
Lloh3:
	adrp	x9, _STM32MP15_BSEC_DATA0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _STM32MP15_BSEC_DATA0@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x8, x8, x9
	add	x0, x27, x8
	bl	_readl_relaxed
	str	w0, [sp, #12]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	w8, #4
	sub	w1, w8, w25
	mov	x0, x20
	bl	_min
	mov	x24, x0
	add	x0, x21, w26, sxtw #2
	add	x1, x19, w25, uxtw #2
	mov	x2, x24
	bl	_memcpy
	mov	w25, #0
	mov	w23, #0
	sub	x20, x20, w24, sxtw
	add	w26, w24, w26
	add	x27, x27, #4
	cmp	x27, x28
	b.ge	LBB0_10
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	asr	w24, w27, #2
Lloh6:
	adrp	x8, _STM32MP15_BSEC_NUM_LOWER@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STM32MP15_BSEC_NUM_LOWER@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w24, w8
	b.lt	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh9:
	adrp	x8, _STM32_SMC_READ_SHADOW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _STM32_SMC_READ_SHADOW@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	add	x3, sp, #12
	mov	x1, x24
	mov	w2, #0
	bl	_stm32_bsec_smc
	cbz	w0, LBB0_5
; %bb.8:
	mov	x23, x0
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	mov	x2, x24
	mov	x3, x23
	bl	_dev_err
	b	LBB0_10
LBB0_9:
	mov	w23, #0
LBB0_10:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_STM32MP15_BSEC_NUM_LOWER,4,2   ; @STM32MP15_BSEC_NUM_LOWER
	.comm	_STM32MP15_BSEC_DATA0,8,3       ; @STM32MP15_BSEC_DATA0
	.comm	_STM32_SMC_READ_SHADOW,4,2      ; @STM32_SMC_READ_SHADOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't read data%d (%d)\n"

	.no_dead_strip	_stm32_bsec_read
.subsections_via_symbols
