	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mv88e6xxx_g2_scratch_gpio_set_smi ## -- Begin function mv88e6xxx_g2_scratch_gpio_set_smi
	.p2align	4, 0x90
_mv88e6xxx_g2_scratch_gpio_set_smi:     ## @mv88e6xxx_g2_scratch_gpio_set_smi
	.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
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	_MV88E6352_G2_SCRATCH_MISC_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_MV88E6352_G2_SCRATCH_CONFIG_DATA1@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_MV88E6352_G2_SCRATCH_CONFIG_DATA2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_mv88e6xxx_g2_scratch_read
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movq	_MV88E6352_G2_SCRATCH_CONFIG_DATA2_P0_MODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-44(%rbp), %eax
	decl	%eax
	cmpl	$1, %eax
	ja	LBB0_3
## %bb.2:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_3:
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_mv88e6xxx_g2_scratch_read
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	movl	-44(%rbp), %r13d
	movq	_MV88E6352_G2_SCRATCH_CONFIG_DATA1_NO_CPU@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_mv88e6xxx_g2_scratch_read
	testl	%eax, %eax
	jne	LBB0_9
## %bb.5:
	xorl	%eax, %eax
	testl	%r15d, %r15d
	sete	%al
	testl	%r13d, %ebx
	cmovnel	%r15d, %eax
	movq	_MV88E6352_G2_SCRATCH_MISC_CFG_NORMALSMI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	orl	-44(%rbp), %edx
	jmp	LBB0_8
LBB0_7:
	notl	%edx
	andl	-44(%rbp), %edx
LBB0_8:
	movl	%edx, -44(%rbp)
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_mv88e6xxx_g2_scratch_write
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MV88E6352_G2_SCRATCH_MISC_CFG,4,2 ## @MV88E6352_G2_SCRATCH_MISC_CFG
	.comm	_MV88E6352_G2_SCRATCH_CONFIG_DATA1,4,2 ## @MV88E6352_G2_SCRATCH_CONFIG_DATA1
	.comm	_MV88E6352_G2_SCRATCH_CONFIG_DATA2,4,2 ## @MV88E6352_G2_SCRATCH_CONFIG_DATA2
	.comm	_MV88E6352_G2_SCRATCH_CONFIG_DATA2_P0_MODE_MASK,4,2 ## @MV88E6352_G2_SCRATCH_CONFIG_DATA2_P0_MODE_MASK
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_MV88E6352_G2_SCRATCH_CONFIG_DATA1_NO_CPU,4,2 ## @MV88E6352_G2_SCRATCH_CONFIG_DATA1_NO_CPU
	.comm	_MV88E6352_G2_SCRATCH_MISC_CFG_NORMALSMI,4,2 ## @MV88E6352_G2_SCRATCH_MISC_CFG_NORMALSMI
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mv88e6xxx_g2_scratch_gpio_set_smi ; -- Begin function mv88e6xxx_g2_scratch_gpio_set_smi
	.p2align	2
_mv88e6xxx_g2_scratch_gpio_set_smi:     ; @mv88e6xxx_g2_scratch_gpio_set_smi
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _MV88E6352_G2_SCRATCH_MISC_CFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MV88E6352_G2_SCRATCH_MISC_CFG@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x8, _MV88E6352_G2_SCRATCH_CONFIG_DATA1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MV88E6352_G2_SCRATCH_CONFIG_DATA1@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
Lloh6:
	adrp	x8, _MV88E6352_G2_SCRATCH_CONFIG_DATA2@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MV88E6352_G2_SCRATCH_CONFIG_DATA2@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_mv88e6xxx_g2_scratch_read
	cbnz	w0, LBB0_9
; %bb.1:
	ldr	w8, [sp, #12]
Lloh9:
	adrp	x9, _MV88E6352_G2_SCRATCH_CONFIG_DATA2_P0_MODE_MASK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MV88E6352_G2_SCRATCH_CONFIG_DATA2_P0_MODE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w8, w9, w8
	sub	w8, w8, #1
	cmp	w8, #1
	b.hi	LBB0_3
; %bb.2:
Lloh12:
	adrp	x8, _EBUSY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_3:
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x22
	bl	_mv88e6xxx_g2_scratch_read
	cbnz	w0, LBB0_9
; %bb.4:
	ldr	w22, [sp, #12]
Lloh15:
	adrp	x8, _MV88E6352_G2_SCRATCH_CONFIG_DATA1_NO_CPU@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MV88E6352_G2_SCRATCH_CONFIG_DATA1_NO_CPU@GOTPAGEOFF]
Lloh17:
	ldr	w23, [x8]
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x20
	bl	_mv88e6xxx_g2_scratch_read
	cbnz	w0, LBB0_9
; %bb.5:
	cmp	w21, #0
	cset	w8, eq
	tst	w23, w22
	csel	w9, w8, w21, eq
Lloh18:
	adrp	x8, _MV88E6352_G2_SCRATCH_MISC_CFG_NORMALSMI@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MV88E6352_G2_SCRATCH_MISC_CFG_NORMALSMI@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cbz	w9, LBB0_7
; %bb.6:
	ldr	w9, [sp, #12]
	orr	w2, w9, w8
	b	LBB0_8
LBB0_7:
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
LBB0_8:
	str	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x20
	bl	_mv88e6xxx_g2_scratch_write
LBB0_9:
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MV88E6352_G2_SCRATCH_MISC_CFG,4,2 ; @MV88E6352_G2_SCRATCH_MISC_CFG
	.comm	_MV88E6352_G2_SCRATCH_CONFIG_DATA1,4,2 ; @MV88E6352_G2_SCRATCH_CONFIG_DATA1
	.comm	_MV88E6352_G2_SCRATCH_CONFIG_DATA2,4,2 ; @MV88E6352_G2_SCRATCH_CONFIG_DATA2
	.comm	_MV88E6352_G2_SCRATCH_CONFIG_DATA2_P0_MODE_MASK,4,2 ; @MV88E6352_G2_SCRATCH_CONFIG_DATA2_P0_MODE_MASK
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_MV88E6352_G2_SCRATCH_CONFIG_DATA1_NO_CPU,4,2 ; @MV88E6352_G2_SCRATCH_CONFIG_DATA1_NO_CPU
	.comm	_MV88E6352_G2_SCRATCH_MISC_CFG_NORMALSMI,4,2 ; @MV88E6352_G2_SCRATCH_MISC_CFG_NORMALSMI
.subsections_via_symbols
