	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spi_nor_parse_sfdp
_spi_nor_parse_sfdp:                    ## @spi_nor_parse_sfdp
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	(%rdi), %r14
	leaq	-104(%rbp), %rcx
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_spi_nor_read_sfdp_dma_unsafe
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	-64(%rbp), %edi
	callq	_le32_to_cpu
	movq	_SFDP_SIGNATURE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	-104(%rbp), %rax
	movq	_SFDP_JESD216_MAJOR@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_4
## %bb.6:
	leaq	-88(%rbp), %r12
	movq	%r12, %rdi
	callq	_SFDP_PARAM_HEADER_ID
	movq	_SFDP_BFPT_ID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_4
## %bb.7:
	movq	-88(%rbp), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_4
## %bb.8:
	movslq	-96(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	shlq	$3, %rax
	leaq	(%rax,%rax,2), %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movq	%rax, %r12
	movq	%r13, %rdi
	movl	$48, %esi
	movq	%rbx, %rdx
	movq	%rax, %rcx
	callq	_spi_nor_read_sfdp
	testl	%eax, %eax
	js	LBB0_13
## %bb.14:
	cmpl	$0, -96(%rbp)
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_15
## %bb.16:
	movq	%r12, %rbx
	xorl	%r12d, %r12d
	jmp	LBB0_17
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_40
LBB0_1:
	movl	%eax, %ebx
LBB0_40:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
LBB0_23:                                ##   in Loop: Header=BB0_17 Depth=1
	incq	%r12
	movslq	-96(%rbp), %rax
	addq	$24, %rbx
	cmpq	%rax, %r12
	jge	LBB0_24
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_SFDP_PARAM_HEADER_ID
	movq	_SFDP_BFPT_ID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_23
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	(%rbx), %rax
	movq	_SFDP_JESD216_MAJOR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	cmpq	%rax, 8(%rbx)
	jg	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_17 Depth=1
	jne	LBB0_23
## %bb.21:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	16(%rbx), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpq	16(%rcx), %rax
	jg	LBB0_22
	jmp	LBB0_23
LBB0_9:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_25
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_24:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_25
LBB0_13:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_39
LBB0_15:
	leaq	-88(%rbp), %r12
LBB0_25:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_spi_nor_parse_bfpt
	testl	%eax, %eax
	je	LBB0_27
## %bb.26:
	movl	%eax, %ebx
	jmp	LBB0_38
LBB0_27:
	cmpl	$0, -96(%rbp)
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jle	LBB0_28
## %bb.29:
	xorl	%ebx, %ebx
	jmp	LBB0_30
LBB0_36:                                ##   in Loop: Header=BB0_30 Depth=1
	incq	%rbx
	movslq	-96(%rbp), %rax
	addq	$24, %r12
	cmpq	%rax, %rbx
	jge	LBB0_37
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_SFDP_PARAM_HEADER_ID
	cmpl	$129, %eax
	je	LBB0_33
## %bb.31:                              ##   in Loop: Header=BB0_30 Depth=1
	cmpl	$128, %eax
	jne	LBB0_36
## %bb.32:                              ##   in Loop: Header=BB0_30 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_spi_nor_parse_smpt
	testl	%eax, %eax
	jne	LBB0_35
	jmp	LBB0_36
LBB0_33:                                ##   in Loop: Header=BB0_30 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_spi_nor_parse_4bait
	testl	%eax, %eax
	je	LBB0_36
LBB0_35:                                ##   in Loop: Header=BB0_30 Depth=1
	movq	%r12, %rdi
	callq	_SFDP_PARAM_HEADER_ID
	movq	%r14, %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
	jmp	LBB0_36
LBB0_37:
	xorl	%ebx, %ebx
LBB0_38:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_39:
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_40
LBB0_28:
	xorl	%ebx, %ebx
	jmp	LBB0_39
	.cfi_endproc
                                        ## -- End function
	.comm	_SFDP_SIGNATURE,8,3             ## @SFDP_SIGNATURE
	.comm	_SFDP_JESD216_MAJOR,8,3         ## @SFDP_JESD216_MAJOR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SFDP_BFPT_ID,4,2               ## @SFDP_BFPT_ID
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read SFDP parameter headers\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to parse optional parameter table: %04x\n"

	.no_dead_strip	_spi_nor_parse_sfdp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spi_nor_parse_sfdp
_spi_nor_parse_sfdp:                    ; @spi_nor_parse_sfdp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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, x1
	mov	x21, x0
	ldr	x19, [x0]
	mov	x3, sp
	mov	w1, #0
	mov	w2, #48
	bl	_spi_nor_read_sfdp_dma_unsafe
	tbnz	w0, #31, LBB0_12
; %bb.1:
	ldr	w0, [sp, #40]
	bl	_le32_to_cpu
Lloh0:
	adrp	x8, _SFDP_SIGNATURE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SFDP_SIGNATURE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.2:
	ldr	x8, [sp]
Lloh3:
	adrp	x25, _SFDP_JESD216_MAJOR@GOTPAGE
Lloh4:
	ldr	x25, [x25, _SFDP_JESD216_MAJOR@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.3:
	mov	x8, sp
	add	x23, x8, #16
	mov	x0, x23
	bl	_SFDP_PARAM_HEADER_ID
Lloh5:
	adrp	x26, _SFDP_BFPT_ID@GOTPAGE
Lloh6:
	ldr	x26, [x26, _SFDP_BFPT_ID@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.4:
	ldr	x8, [sp, #16]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.5:
	ldrsw	x8, [sp, #8]
	cbz	w8, LBB0_21
; %bb.6:
	add	x8, x8, x8, lsl #1
	lsl	x24, x8, #3
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_kmalloc
	cbz	x0, LBB0_24
; %bb.7:
	mov	x22, x0
	mov	x0, x21
	mov	w1, #48
	mov	x2, x24
	mov	x3, x22
	bl	_spi_nor_read_sfdp
	tbnz	w0, #31, LBB0_34
; %bb.8:
	ldr	w8, [sp, #8]
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.9:
	mov	x27, #0
	mov	x24, x22
	b	LBB0_16
LBB0_10:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_13
LBB0_12:
	mov	x24, x0
LBB0_13:
	mov	x0, x24
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_14:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x23, x24
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	add	x27, x27, #1
	ldrsw	x8, [sp, #8]
	add	x24, x24, #24
	cmp	x27, x8
	b.ge	LBB0_22
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_SFDP_PARAM_HEADER_ID
	ldr	w8, [x26]
	cmp	w0, w8
	b.ne	LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x24]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x24, #8]
	ldr	x9, [x23, #8]
	cmp	x8, x9
	b.gt	LBB0_14
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	b.ne	LBB0_15
; %bb.20:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x24, #16]
	ldr	x9, [x23, #16]
	cmp	x8, x9
	b.gt	LBB0_14
	b	LBB0_15
LBB0_21:
	mov	x22, #0
LBB0_22:
	mov	x0, x21
	mov	x1, x23
	mov	x2, x20
	bl	_spi_nor_parse_bfpt
	cbz	w0, LBB0_25
; %bb.23:
	mov	x24, x0
	b	LBB0_35
LBB0_24:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
LBB0_25:
	ldr	w8, [sp, #8]
	cmp	w8, #1
	b.lt	LBB0_33
; %bb.26:
	mov	x25, #0
Lloh14:
	adrp	x23, l_.str.1@PAGE
Lloh15:
	add	x23, x23, l_.str.1@PAGEOFF
	mov	x24, x22
	b	LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_28 Depth=1
	add	x25, x25, #1
	ldrsw	x8, [sp, #8]
	add	x24, x24, #24
	cmp	x25, x8
	b.ge	LBB0_33
LBB0_28:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_SFDP_PARAM_HEADER_ID
	cmp	w0, #129
	b.eq	LBB0_31
; %bb.29:                               ;   in Loop: Header=BB0_28 Depth=1
	cmp	w0, #128
	b.ne	LBB0_27
; %bb.30:                               ;   in Loop: Header=BB0_28 Depth=1
	mov	x0, x21
	mov	x1, x24
	mov	x2, x20
	bl	_spi_nor_parse_smpt
	cbnz	w0, LBB0_32
	b	LBB0_27
LBB0_31:                                ;   in Loop: Header=BB0_28 Depth=1
	mov	x0, x21
	mov	x1, x24
	mov	x2, x20
	bl	_spi_nor_parse_4bait
	cbz	w0, LBB0_27
LBB0_32:                                ;   in Loop: Header=BB0_28 Depth=1
	mov	x0, x24
	bl	_SFDP_PARAM_HEADER_ID
	mov	x2, x0
	mov	x0, x19
	mov	x1, x23
	bl	_dev_warn
	b	LBB0_27
LBB0_33:
	mov	w24, #0
	b	LBB0_35
LBB0_34:
	mov	x24, x0
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_35:
	mov	x0, x22
	bl	_kfree
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SFDP_SIGNATURE,8,3             ; @SFDP_SIGNATURE
	.comm	_SFDP_JESD216_MAJOR,8,3         ; @SFDP_JESD216_MAJOR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SFDP_BFPT_ID,4,2               ; @SFDP_BFPT_ID
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read SFDP parameter headers\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to parse optional parameter table: %04x\n"

	.no_dead_strip	_spi_nor_parse_sfdp
.subsections_via_symbols
