	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sr2_bit7_quad_enable
_sr2_bit7_quad_enable:                  ## @sr2_bit7_quad_enable
	.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	%rdi, %r14
	movq	(%rdi), %r15
	movq	%r15, %rsi
	callq	_spi_nor_read_sr2
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	movl	(%r15), %eax
	movq	_SR2_QUAD_EN_BIT7@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	xorl	%ebx, %ebx
	testl	%eax, %ecx
	jne	LBB0_10
## %bb.2:
	orl	%eax, %ecx
	movl	%ecx, (%r15)
	movq	%r14, %rdi
	callq	_write_enable
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_spi_nor_write_sr2
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	%r14, %rdi
	callq	_spi_nor_wait_till_ready
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_spi_nor_read_sr2
	testl	%eax, %eax
	jle	LBB0_8
## %bb.7:
	movl	(%r13), %eax
	testl	%eax, (%r15)
	jne	LBB0_10
LBB0_8:
	movl	8(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_9
LBB0_3:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
LBB0_9:
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_5:
	movl	%eax, %r12d
	movl	8(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	%r12d, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SR2_QUAD_EN_BIT7,4,2           ## @SR2_QUAD_EN_BIT7
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error while writing status register 2\n"

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

L_.str.2:                               ## @.str.2
	.asciz	"SR2 Quad bit not set\n"

	.no_dead_strip	_sr2_bit7_quad_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sr2_bit7_quad_enable
_sr2_bit7_quad_enable:                  ; @sr2_bit7_quad_enable
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x20, [x0]
	mov	x1, x20
	bl	_spi_nor_read_sr2
	mov	x21, x0
	cbnz	w0, LBB0_11
; %bb.1:
	ldr	w8, [x20]
Lloh0:
	adrp	x22, _SR2_QUAD_EN_BIT7@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SR2_QUAD_EN_BIT7@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_3
LBB0_2:
	mov	w21, #0
	b	LBB0_11
LBB0_3:
	orr	w8, w9, w8
	str	w8, [x20]
	mov	x0, x19
	bl	_write_enable
	mov	x0, x19
	mov	x1, x20
	bl	_spi_nor_write_sr2
	tbnz	w0, #31, LBB0_8
; %bb.4:
	mov	x0, x19
	bl	_spi_nor_wait_till_ready
	tbnz	w0, #31, LBB0_10
; %bb.5:
	mov	x0, x19
	mov	x1, x20
	bl	_spi_nor_read_sr2
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.6:
	ldr	w8, [x20]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_2
LBB0_7:
	ldr	w0, [x19, #8]
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_8:
	ldr	w0, [x19, #8]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
LBB0_9:
	bl	_dev_err
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_10:
	mov	x21, x0
	ldr	w0, [x19, #8]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_SR2_QUAD_EN_BIT7,4,2           ; @SR2_QUAD_EN_BIT7
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error while writing status register 2\n"

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

l_.str.2:                               ; @.str.2
	.asciz	"SR2 Quad bit not set\n"

	.no_dead_strip	_sr2_bit7_quad_enable
.subsections_via_symbols
