	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iwl_find_otp_image
_iwl_find_otp_image:                    ## @iwl_find_otp_image
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	$0, -48(%rbp)
	callq	_iwl_set_otp_access_absolute
	movq	%r15, %rdi
	callq	_iwl_is_otp_empty
	testq	%rax, %rax
	je	LBB0_1
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_8:
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	$-1, %ebx
	leaq	-48(%rbp), %r13
	xorl	%edi, %edi
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	callq	_le16_to_cpu
	movl	%eax, %r14d
	shll	$2, %r14d
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_IWL_DEBUG_EEPROM
	movq	%r15, %rdi
	movl	%r14d, %esi
	movq	%r13, %rdx
	callq	_iwl_read_otp_word
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r15), %rax
	movq	(%rax), %rax
	movl	%r14d, %r12d
	cmpl	(%rax), %ebx
	jl	LBB0_2
## %bb.7:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_IWL_DEBUG_EEPROM
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_5:
	orl	$2, %r12d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%r12d, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OTP blocks %d addr 0x%x\n"

L_.str.1:                               ## @.str.1
	.asciz	"OTP has no valid blocks\n"

	.no_dead_strip	_iwl_find_otp_image
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iwl_find_otp_image
_iwl_find_otp_image:                    ; @iwl_find_otp_image
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x1
	mov	x20, x0
	str	xzr, [sp, #24]
	bl	_iwl_set_otp_access_absolute
	mov	x0, x20
	bl	_iwl_is_otp_empty
	cbz	x0, LBB0_3
LBB0_1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_2:
	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
	add	sp, sp, #112
	ret
LBB0_3:
	mov	w24, #0
	mov	w23, #-1
Lloh3:
	adrp	x21, l_.str@PAGE
Lloh4:
	add	x21, x21, l_.str@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	w25, w23, #1
	bl	_le16_to_cpu
	lsl	w22, w0, #2
	ldr	w0, [x20]
	stp	x25, x22, [sp]
	mov	x1, x21
	bl	_IWL_DEBUG_EEPROM
	add	x2, sp, #24
	mov	x0, x20
	mov	x1, x22
	bl	_iwl_read_otp_word
	cbnz	x0, LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [sp, #24]
	cbz	x0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldr	w8, [x8]
	add	w23, w23, #1
	mov	x24, x22
	cmp	w23, w8
	b.lt	LBB0_4
; %bb.7:
	ldr	w0, [x20]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_IWL_DEBUG_EEPROM
	b	LBB0_1
LBB0_8:
	orr	w8, w24, #0x2
	str	w8, [x19]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OTP blocks %d addr 0x%x\n"

l_.str.1:                               ; @.str.1
	.asciz	"OTP has no valid blocks\n"

	.no_dead_strip	_iwl_find_otp_image
.subsections_via_symbols
