	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function macronix_quad_enable
_macronix_quad_enable:                  ## @macronix_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_read_sr
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_7
## %bb.1:
	movq	_SR_QUAD_EN_MX@GOTPCREL(%rip), %r15
	testl	%ebx, (%r15)
	je	LBB0_3
## %bb.2:
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_3:
	movq	%r14, %rdi
	callq	_write_enable
	movl	(%r15), %esi
	orl	%ebx, %esi
	movq	%r14, %rdi
	callq	_write_sr
	movq	%r14, %rdi
	callq	_spi_nor_wait_till_ready
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	movq	%r14, %rdi
	callq	_read_sr
	testl	%eax, %eax
	jle	LBB0_6
## %bb.5:
	movl	$0, %ebx
	testl	%eax, (%r15)
	jne	LBB0_7
LBB0_6:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SR_QUAD_EN_MX,4,2              ## @SR_QUAD_EN_MX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Macronix Quad bit not set\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_macronix_quad_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function macronix_quad_enable
_macronix_quad_enable:                  ; @macronix_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
	bl	_read_sr
	mov	x20, x0
	tbnz	w0, #31, LBB0_7
; %bb.1:
Lloh0:
	adrp	x21, _SR_QUAD_EN_MX@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SR_QUAD_EN_MX@GOTPAGEOFF]
	ldr	w8, [x21]
	tst	w8, w20
	b.eq	LBB0_3
LBB0_2:
	mov	w20, #0
	b	LBB0_7
LBB0_3:
	mov	x0, x19
	bl	_write_enable
	ldr	w8, [x21]
	orr	w1, w8, w20
	mov	x0, x19
	bl	_write_sr
	mov	x0, x19
	bl	_spi_nor_wait_till_ready
	mov	x20, x0
	cbnz	w0, LBB0_7
; %bb.4:
	mov	x0, x19
	bl	_read_sr
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.5:
	ldr	w8, [x21]
	tst	w8, w0
	b.ne	LBB0_2
LBB0_6:
	ldr	w0, [x19]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_7:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_SR_QUAD_EN_MX,4,2              ; @SR_QUAD_EN_MX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Macronix Quad bit not set\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_macronix_quad_enable
.subsections_via_symbols
