	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spi_nor_spansion_clear_sr_bp
_spi_nor_spansion_clear_sr_bp:          ## @spi_nor_spansion_clear_sr_bp
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_SR_BP2@GOTPCREL(%rip), %rax
	movq	_SR_BP1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movq	_SR_BP0@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	(%rdi), %r15
	callq	_read_cr
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	_CR_QUAD_EN_SPAN@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_7
## %bb.3:
	movl	%r12d, 4(%r15)
	movq	%r14, %rdi
	callq	_read_sr
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	notl	%ebx
	andl	%ebx, %r12d
	movl	%r12d, (%r15)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_write_sr_cr
	testl	%eax, %eax
	je	LBB0_6
## %bb.8:
	movl	%eax, %r12d
	movl	8(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_9
LBB0_1:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_9
LBB0_7:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spi_nor_clear_sr_bp            ## TAILCALL
LBB0_4:
	movl	8(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_9:
	callq	_dev_err
LBB0_10:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%r12d, %r12d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_SR_BP2,4,2                     ## @SR_BP2
	.comm	_SR_BP1,4,2                     ## @SR_BP1
	.comm	_SR_BP0,4,2                     ## @SR_BP0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error while reading configuration register\n"

	.comm	_CR_QUAD_EN_SPAN,4,2            ## @CR_QUAD_EN_SPAN
L_.str.1:                               ## @.str.1
	.asciz	"error while reading status register\n"

L_.str.2:                               ## @.str.2
	.asciz	"16-bit write register failed\n"

	.no_dead_strip	_spi_nor_spansion_clear_sr_bp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spi_nor_spansion_clear_sr_bp
_spi_nor_spansion_clear_sr_bp:          ; @spi_nor_spansion_clear_sr_bp
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _SR_BP2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SR_BP2@GOTPAGEOFF]
Lloh2:
	adrp	x9, _SR_BP1@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SR_BP1@GOTPAGEOFF]
Lloh4:
	ldr	w22, [x8]
Lloh5:
	ldr	w23, [x9]
Lloh6:
	adrp	x8, _SR_BP0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SR_BP0@GOTPAGEOFF]
Lloh8:
	ldr	w24, [x8]
	ldr	x21, [x0]
	bl	_read_cr
	mov	x19, x0
	tbnz	w0, #31, LBB0_5
; %bb.1:
Lloh9:
	adrp	x8, _CR_QUAD_EN_SPAN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CR_QUAD_EN_SPAN@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_6
; %bb.2:
	str	w19, [x21, #4]
	mov	x0, x20
	bl	_read_sr
	mov	x19, x0
	tbnz	w0, #31, LBB0_7
; %bb.3:
	orr	w8, w23, w22
	orr	w8, w8, w24
	bic	w8, w19, w8
	str	w8, [x21]
	mov	x0, x20
	mov	x1, x21
	bl	_write_sr_cr
	mov	x19, x0
	cbz	w0, LBB0_9
; %bb.4:
	ldr	w0, [x20, #8]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_5:
	ldr	w0, [x20, #8]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_8
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_spi_nor_clear_sr_bp
LBB0_7:
	ldr	w0, [x20, #8]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_8:
	bl	_dev_err
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SR_BP2,4,2                     ; @SR_BP2
	.comm	_SR_BP1,4,2                     ; @SR_BP1
	.comm	_SR_BP0,4,2                     ; @SR_BP0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error while reading configuration register\n"

	.comm	_CR_QUAD_EN_SPAN,4,2            ; @CR_QUAD_EN_SPAN
l_.str.1:                               ; @.str.1
	.asciz	"error while reading status register\n"

l_.str.2:                               ; @.str.2
	.asciz	"16-bit write register failed\n"

	.no_dead_strip	_spi_nor_spansion_clear_sr_bp
.subsections_via_symbols
