	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function imx_ocotp_read
_imx_ocotp_read:                        ## @imx_ocotp_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rdi, %r13
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r12d
	shrl	$2, %r12d
	shrq	$2, %rcx
	movq	24(%rdi), %rax
	movl	(%rax), %ebx
	subl	%r12d, %ebx
	cmpl	%ecx, %ebx
	cmovael	%ecx, %ebx
	movq	_ocotp_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movl	(%r13), %edi
	callq	_clk_prepare_enable
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	8(%r13), %rdi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_imx_ocotp_wait_for_busy
	testl	%eax, %eax
	js	LBB0_11
## %bb.3:
	leal	(%rbx,%r12), %eax
	cmpl	%eax, %r12d
	jae	LBB0_9
## %bb.4:
	movl	%ebx, %r15d
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	shrq	$2, %r12
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	cmpl	%ebx, %r15d
	je	LBB0_8
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%r12,%rbx), %eax
	movq	_IMX_OCOTP_OFFSET_B0W0@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	8(%r13), %rcx
	movq	_IMX_OCOTP_OFFSET_PER_WORD@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	movslq	%eax, %rdi
	imulq	%rdx, %rdi
	addq	%rcx, %rdi
	callq	_readl
	movl	%eax, (%r14,%rbx,4)
	movq	_IMX_OCOTP_READ_LOCKED_VAL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r13), %rdi
	callq	_imx_ocotp_clr_err_if_set
	jmp	LBB0_7
LBB0_1:
	movl	%eax, %r15d
	movq	_ocotp_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	16(%r13), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_10
LBB0_11:
	movl	16(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %r15d
	callq	_dev_err
	jmp	LBB0_9
LBB0_8:
	xorl	%r15d, %r15d
LBB0_9:
	movl	(%r13), %edi
	callq	_clk_disable_unprepare
	movq	_ocotp_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_10:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ocotp_mutex,4,2                ## @ocotp_mutex
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to prepare/enable ocotp clk\n"

L_.str.1:                               ## @.str.1
	.asciz	"timeout during read setup\n"

	.comm	_IMX_OCOTP_OFFSET_B0W0,8,3      ## @IMX_OCOTP_OFFSET_B0W0
	.comm	_IMX_OCOTP_OFFSET_PER_WORD,4,2  ## @IMX_OCOTP_OFFSET_PER_WORD
	.comm	_IMX_OCOTP_READ_LOCKED_VAL,4,2  ## @IMX_OCOTP_READ_LOCKED_VAL
	.no_dead_strip	_imx_ocotp_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function imx_ocotp_read
_imx_ocotp_read:                        ; @imx_ocotp_read
	.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
	mov	x20, x2
	mov	x19, x0
	lsr	w22, w1, #2
	lsr	x8, x3, #2
	ldr	x9, [x0, #24]
	ldr	w9, [x9]
	sub	w9, w9, w22
	cmp	w9, w8
	csel	w23, w9, w8, lo
Lloh0:
	adrp	x0, _ocotp_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _ocotp_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	w0, [x19]
	bl	_clk_prepare_enable
	tbnz	w0, #31, LBB0_8
; %bb.1:
	ldr	x0, [x19, #8]
	mov	w1, #0
	bl	_imx_ocotp_wait_for_busy
	tbnz	w0, #31, LBB0_9
; %bb.2:
	add	w8, w23, w22
	cmp	w22, w8
	b.hs	LBB0_7
; %bb.3:
Lloh2:
	adrp	x21, _IMX_OCOTP_OFFSET_B0W0@GOTPAGE
Lloh3:
	ldr	x21, [x21, _IMX_OCOTP_OFFSET_B0W0@GOTPAGEOFF]
Lloh4:
	adrp	x24, _IMX_OCOTP_OFFSET_PER_WORD@GOTPAGE
Lloh5:
	ldr	x24, [x24, _IMX_OCOTP_OFFSET_PER_WORD@GOTPAGEOFF]
Lloh6:
	adrp	x25, _IMX_OCOTP_READ_LOCKED_VAL@GOTPAGE
Lloh7:
	ldr	x25, [x25, _IMX_OCOTP_READ_LOCKED_VAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w22, w22, #1
	subs	w23, w23, #1
	b.eq	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x8, x9, x8
	ldrsw	x9, [x24]
	sxtw	x10, w22
	madd	x0, x9, x10, x8
	bl	_readl
	str	w0, [x20], #4
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x19, #8]
	bl	_imx_ocotp_clr_err_if_set
	b	LBB0_4
LBB0_7:
	mov	w21, #0
	b	LBB0_10
LBB0_8:
	mov	x21, x0
Lloh8:
	adrp	x0, _ocotp_mutex@GOTPAGE
Lloh9:
	ldr	x0, [x0, _ocotp_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	ldr	w0, [x19, #16]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_11
LBB0_9:
	mov	x21, x0
	ldr	w0, [x19, #16]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_10:
	ldr	w0, [x19]
	bl	_clk_disable_unprepare
Lloh14:
	adrp	x0, _ocotp_mutex@GOTPAGE
Lloh15:
	ldr	x0, [x0, _ocotp_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_11:
	mov	x0, x21
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ocotp_mutex,4,2                ; @ocotp_mutex
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to prepare/enable ocotp clk\n"

l_.str.1:                               ; @.str.1
	.asciz	"timeout during read setup\n"

	.comm	_IMX_OCOTP_OFFSET_B0W0,8,3      ; @IMX_OCOTP_OFFSET_B0W0
	.comm	_IMX_OCOTP_OFFSET_PER_WORD,4,2  ; @IMX_OCOTP_OFFSET_PER_WORD
	.comm	_IMX_OCOTP_READ_LOCKED_VAL,4,2  ; @IMX_OCOTP_READ_LOCKED_VAL
	.no_dead_strip	_imx_ocotp_read
.subsections_via_symbols
