	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_sr_cr
_write_sr_cr:                           ## @write_sr_cr
	.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	%rsi, %r14
	movq	%rdi, %r15
	callq	_write_enable
	cmpq	$0, 16(%r15)
	je	LBB0_2
## %bb.1:
	movq	_SPINOR_OP_WRSR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_SPI_MEM_OP_CMD
	movl	%eax, %r12d
	movq	_SPI_MEM_OP_NO_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_SPI_MEM_OP_NO_DUMMY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	$2, %edi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_SPI_MEM_OP_DATA_OUT
	movl	%r12d, %edi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_SPI_MEM_OP
	movl	%eax, -48(%rbp)
	movq	16(%r15), %rdi
	leaq	-48(%rbp), %rsi
	callq	_spi_mem_exec_op
	testl	%eax, %eax
	js	LBB0_4
LBB0_5:
	movq	%r15, %rdi
	callq	_spi_nor_wait_till_ready
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movl	%eax, %ebx
	movl	8(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_8
LBB0_2:
	movq	_SPINOR_OP_WRSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	*(%r15)
	testl	%eax, %eax
	jns	LBB0_5
LBB0_4:
	movl	8(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_6:
	xorl	%ebx, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPINOR_OP_WRSR,4,2             ## @SPINOR_OP_WRSR
	.comm	_SPI_MEM_OP_NO_ADDR,4,2         ## @SPI_MEM_OP_NO_ADDR
	.comm	_SPI_MEM_OP_NO_DUMMY,4,2        ## @SPI_MEM_OP_NO_DUMMY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error while writing configuration register\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"timeout while writing configuration register\n"

	.no_dead_strip	_write_sr_cr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_sr_cr
_write_sr_cr:                           ; @write_sr_cr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_write_enable
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _SPINOR_OP_WRSR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SPINOR_OP_WRSR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_SPI_MEM_OP_CMD
	mov	x21, x0
Lloh3:
	adrp	x8, _SPI_MEM_OP_NO_ADDR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SPI_MEM_OP_NO_ADDR@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
Lloh6:
	adrp	x8, _SPI_MEM_OP_NO_DUMMY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SPI_MEM_OP_NO_DUMMY@GOTPAGEOFF]
Lloh8:
	ldr	w23, [x8]
	mov	w0, #2
	mov	x1, x20
	mov	w2, #1
	bl	_SPI_MEM_OP_DATA_OUT
	mov	x3, x0
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_SPI_MEM_OP
	str	w0, [sp, #8]
	ldr	x0, [x19, #16]
	add	x1, sp, #8
	bl	_spi_mem_exec_op
	tbnz	w0, #31, LBB0_5
LBB0_2:
	mov	x0, x19
	bl	_spi_nor_wait_till_ready
	mov	x20, x0
	cbz	w0, LBB0_6
; %bb.3:
	ldr	w0, [x19, #8]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_6
LBB0_4:
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _SPINOR_OP_WRSR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SPINOR_OP_WRSR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x9]
	mov	x0, x19
	mov	x2, x20
	mov	w3, #2
	blr	x8
	tbz	w0, #31, LBB0_2
LBB0_5:
	ldr	w0, [x19, #8]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_SPINOR_OP_WRSR,4,2             ; @SPINOR_OP_WRSR
	.comm	_SPI_MEM_OP_NO_ADDR,4,2         ; @SPI_MEM_OP_NO_ADDR
	.comm	_SPI_MEM_OP_NO_DUMMY,4,2        ; @SPI_MEM_OP_NO_DUMMY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error while writing configuration register\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"timeout while writing configuration register\n"

	.no_dead_strip	_write_sr_cr
.subsections_via_symbols
