	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spi_nor_get_map_in_use
_spi_nor_get_map_in_use:                ## @spi_nor_get_map_in_use
	.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
	movl	%edx, %r12d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_16
## %bb.1:
	movq	%rax, %rbx
	movl	(%r14), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	4(%r14), %eax
	movl	%eax, -80(%rbp)                 ## 4-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	8(%r14), %eax
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	xorl	%edi, %edi
	movl	$0, %r15d
	movl	$0, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testl	%r12d, %r12d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jle	LBB0_8
## %bb.2:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	%r12d, -84(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%r15,4), %edi
	movq	_SMPT_DESC_TYPE_MAP@GOTPCREL(%rip), %rax
	testl	%edi, (%rax)
	jne	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	callq	_SMPT_CMD_READ_DATA
	movl	%eax, %r13d
	movl	(%r14,%r15,4), %esi
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_spi_nor_smpt_addr_width
	movl	%eax, (%r12)
	movl	(%r14,%r15,4), %esi
	movq	%r12, %rdi
	callq	_spi_nor_smpt_read_dummy
	movl	%eax, 4(%r12)
	movl	(%r14,%r15,4), %edi
	callq	_SMPT_CMD_OPCODE
	movl	%eax, 8(%r12)
	movl	4(%r14,%r15,4), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	_spi_nor_read_raw
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	testl	%r13d, (%rbx)
	setne	%al
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leal	(%rax,%rcx,2), %ecx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	addq	$2, %r15
	movl	-84(%rbp), %r12d                ## 4-byte Reload
	cmpl	%r12d, %r15d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jl	LBB0_3
LBB0_7:
	xorl	%edi, %edi
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %edi
	callq	_ERR_PTR
	movq	%rax, %r13
	cmpl	%r12d, %r15d
	jge	LBB0_9
## %bb.10:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movslq	%r15d, %rax
	leaq	(%r14,%rax,4), %r13
	movl	(%r14,%rax,4), %edi
	callq	_SMPT_MAP_ID
	cmpl	-72(%rbp), %eax                 ## 4-byte Folded Reload
	je	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	(%r13), %edi
	movq	_SMPT_DESC_END@GOTPCREL(%rip), %rax
	testl	%edi, (%rax)
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	callq	_SMPT_MAP_REGION_COUNT
	addl	%eax, %r15d
	incl	%r15d
	cmpl	%r12d, %r15d
	jl	LBB0_11
LBB0_14:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_15
LBB0_16:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_5:
	movl	%eax, %edi
	callq	_ERR_PTR
	movq	%rax, %r13
LBB0_9:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	-44(%rbp), %r15d                ## 4-byte Reload
LBB0_15:
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r15d, (%r14)
	movl	-80(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%r14)
	movl	-76(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r14)
	movq	%r13, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SMPT_DESC_TYPE_MAP,4,2         ## @SMPT_DESC_TYPE_MAP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SMPT_DESC_END,4,2              ## @SMPT_DESC_END
	.no_dead_strip	_spi_nor_get_map_in_use
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spi_nor_get_map_in_use
_spi_nor_get_map_in_use:                ; @spi_nor_get_map_in_use
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-112]!            ; 16-byte Folded Spill
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kmalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x20, x0
	ldr	d8, [x19]
	ldr	w24, [x19, #8]
	cmp	w21, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x25, #0
	mov	w28, #0
Lloh3:
	adrp	x27, _SMPT_DESC_TYPE_MAP@GOTPAGE
Lloh4:
	ldr	x27, [x27, _SMPT_DESC_TYPE_MAP@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22, x25, lsl #2]
	ldr	w8, [x27]
	tst	w8, w0
	b.ne	LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_SMPT_CMD_READ_DATA
	mov	x23, x0
	add	x26, x22, x25, lsl #2
	ldr	w1, [x26]
	mov	x0, x19
	bl	_spi_nor_smpt_addr_width
	str	w0, [x19]
	ldr	w1, [x26]
	mov	x0, x19
	bl	_spi_nor_smpt_read_dummy
	str	w0, [x19, #4]
	ldr	w0, [x26]
	bl	_SMPT_CMD_OPCODE
	str	w0, [x19, #8]
	ldr	w1, [x26, #4]
	mov	x0, x19
	mov	w2, #1
	mov	x3, x20
	bl	_spi_nor_read_raw
	cbnz	w0, LBB0_14
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x20]
	tst	w8, w23
	cset	w26, ne
	bfi	w26, w28, #1, #31
	add	x25, x25, #2
	mov	x28, x26
	cmp	w25, w21
	b.lt	LBB0_3
	b	LBB0_9
LBB0_6:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	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
	ldp	d9, d8, [sp], #112              ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_7:
	mov	w25, #0
	mov	w26, #0
	b	LBB0_9
LBB0_8:
	mov	x26, x28
LBB0_9:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	bl	_ERR_PTR
	mov	x23, x0
	cmp	w25, w21
	b.ge	LBB0_16
; %bb.10:
Lloh11:
	adrp	x27, _SMPT_DESC_END@GOTPAGE
Lloh12:
	ldr	x27, [x27, _SMPT_DESC_END@GOTPAGEOFF]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	x28, x22, w25, sxtw #2
	ldr	w0, [x28]
	bl	_SMPT_MAP_ID
	cmp	w0, w26
	b.eq	LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w0, [x28]
	ldr	w8, [x27]
	tst	w8, w0
	b.ne	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	bl	_SMPT_MAP_REGION_COUNT
	add	w8, w25, w0
	add	w25, w8, #1
	cmp	w25, w21
	b.lt	LBB0_11
	b	LBB0_16
LBB0_14:
	bl	_ERR_PTR
	mov	x23, x0
	b	LBB0_16
LBB0_15:
	mov	x23, x28
LBB0_16:
	mov	x0, x20
	bl	_kfree
	str	d8, [x19]
	str	w24, [x19, #8]
	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
	ldp	d9, d8, [sp], #112              ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SMPT_DESC_TYPE_MAP,4,2         ; @SMPT_DESC_TYPE_MAP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SMPT_DESC_END,4,2              ; @SMPT_DESC_END
	.no_dead_strip	_spi_nor_get_map_in_use
.subsections_via_symbols
