	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mv_gpio_configure              ## -- Begin function mv_gpio_configure
	.p2align	4, 0x90
_mv_gpio_configure:                     ## @mv_gpio_configure
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%edx, %ebx
	movl	%esi, %r12d
	movl	%edi, %r15d
	callq	_device_get_softc
	cmpl	%r12d, (%rax)
	jle	LBB0_1
## %bb.2:
	movq	%rax, %rdx
	movl	%r14d, %esi
	andl	%ebx, %esi
	movq	_GPIO_PIN_INPUT@GOTPCREL(%rip), %rcx
	movq	_GPIO_PIN_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movl	%esi, %ecx
	notl	%ecx
	testl	%ecx, %eax
	je	LBB0_1
## %bb.3:
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	_MV_GPIO_IN_DEBOUNCE@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_6
## %bb.4:
	cmpq	$0, 8(%rdx)
	je	LBB0_1
## %bb.5:
	movl	%r15d, %edi
	movl	%r12d, %esi
	movq	%rdx, %r13
	callq	_mv_gpio_debounce_prepare
	movq	%r13, %rdx
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_19
LBB0_6:
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_MV_GPIO_LOCK
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movq	_GPIO_PIN_INPUT@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_8
## %bb.7:
	movl	%r15d, %edi
	movl	%r12d, %esi
	xorl	%edx, %edx
	callq	_mv_gpio_out_en
LBB0_8:
	movq	_GPIO_PIN_OUTPUT@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_10
## %bb.9:
	movq	_GPIO_PIN_OPENDRAIN@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	movl	(%rax), %eax
	andl	%r13d, %eax
	sete	%dl
	movl	%r15d, %edi
	movl	%r12d, %esi
	callq	_mv_gpio_value_set
	movl	%r15d, %edi
	movl	%r12d, %esi
	movl	$1, %edx
	callq	_mv_gpio_out_en
LBB0_10:
	movq	_MV_GPIO_OUT_BLINK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%r14d, %edx
	je	LBB0_12
## %bb.11:
	andl	%ebx, %edx
	movl	%r15d, %edi
	movl	%r12d, %esi
	callq	_mv_gpio_blink
LBB0_12:
	movq	_MV_GPIO_IN_POL_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%r14d, %edx
	je	LBB0_14
## %bb.13:
	andl	%ebx, %edx
	movl	%r15d, %edi
	movl	%r12d, %esi
	xorl	%ecx, %ecx
	callq	_mv_gpio_polarity
LBB0_14:
	movq	_MV_GPIO_IN_DEBOUNCE@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_17
## %bb.15:
	movl	%r15d, %edi
	movl	%r12d, %esi
	callq	_mv_gpio_debounce_setup
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movl	%eax, %r13d
	jmp	LBB0_18
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_19:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	notl	%r14d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rax
	movslq	%r12d, %rcx
	andl	(%rax,%rcx,4), %r14d
	orl	-44(%rbp), %r14d                ## 4-byte Folded Reload
	movl	%r14d, (%rax,%rcx,4)
	xorl	%r13d, %r13d
LBB0_18:
	xorl	%eax, %eax
	callq	_MV_GPIO_UNLOCK
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GPIO_PIN_INPUT,4,2             ## @GPIO_PIN_INPUT
	.comm	_GPIO_PIN_OUTPUT,4,2            ## @GPIO_PIN_OUTPUT
	.comm	_MV_GPIO_IN_DEBOUNCE,4,2        ## @MV_GPIO_IN_DEBOUNCE
	.comm	_GPIO_PIN_OPENDRAIN,4,2         ## @GPIO_PIN_OPENDRAIN
	.comm	_MV_GPIO_OUT_BLINK,4,2          ## @MV_GPIO_OUT_BLINK
	.comm	_MV_GPIO_IN_POL_LOW,4,2         ## @MV_GPIO_IN_POL_LOW
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mv_gpio_configure              ; -- Begin function mv_gpio_configure
	.p2align	2
_mv_gpio_configure:                     ; @mv_gpio_configure
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
	mov	x23, x2
	mov	x20, x1
	mov	x22, x0
	bl	_device_get_softc
	ldr	w8, [x0]
	cmp	w8, w20
	b.le	LBB0_16
; %bb.1:
	and	w25, w19, w23
Lloh0:
	adrp	x28, _GPIO_PIN_INPUT@GOTPAGE
Lloh1:
	ldr	x28, [x28, _GPIO_PIN_INPUT@GOTPAGEOFF]
	ldr	w8, [x28]
Lloh2:
	adrp	x27, _GPIO_PIN_OUTPUT@GOTPAGE
Lloh3:
	ldr	x27, [x27, _GPIO_PIN_OUTPUT@GOTPAGEOFF]
	ldr	w9, [x27]
	orr	w8, w9, w8
	bics	wzr, w8, w25
	b.eq	LBB0_16
; %bb.2:
	mov	x21, x0
Lloh4:
	adrp	x26, _MV_GPIO_IN_DEBOUNCE@GOTPAGE
Lloh5:
	ldr	x26, [x26, _MV_GPIO_IN_DEBOUNCE@GOTPAGEOFF]
	ldr	w8, [x26]
	tst	w8, w19
	b.eq	LBB0_5
; %bb.3:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_16
; %bb.4:
	mov	x0, x22
	mov	x1, x20
	bl	_mv_gpio_debounce_prepare
	mov	x24, x0
	cbnz	w0, LBB0_17
LBB0_5:
	bl	_MV_GPIO_LOCK
	ldr	w8, [x28]
	tst	w8, w25
	b.eq	LBB0_7
; %bb.6:
	mov	x0, x22
	mov	x1, x20
	mov	w2, #0
	bl	_mv_gpio_out_en
LBB0_7:
	ldr	w8, [x27]
	tst	w8, w25
	b.eq	LBB0_9
; %bb.8:
Lloh6:
	adrp	x8, _GPIO_PIN_OPENDRAIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GPIO_PIN_OPENDRAIN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w25
	cset	w2, eq
	mov	x0, x22
	mov	x1, x20
	bl	_mv_gpio_value_set
	mov	x0, x22
	mov	x1, x20
	mov	w2, #1
	bl	_mv_gpio_out_en
LBB0_9:
Lloh9:
	adrp	x8, _MV_GPIO_OUT_BLINK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MV_GPIO_OUT_BLINK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_11
; %bb.10:
	and	w2, w8, w23
	mov	x0, x22
	mov	x1, x20
	bl	_mv_gpio_blink
LBB0_11:
Lloh12:
	adrp	x8, _MV_GPIO_IN_POL_LOW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MV_GPIO_IN_POL_LOW@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_13
; %bb.12:
	and	w2, w8, w23
	mov	x0, x22
	mov	x1, x20
	mov	w3, #0
	bl	_mv_gpio_polarity
LBB0_13:
	ldr	w8, [x26]
	tst	w8, w19
	b.eq	LBB0_18
; %bb.14:
	mov	x0, x22
	mov	x1, x20
	bl	_mv_gpio_debounce_setup
	cbz	w0, LBB0_18
; %bb.15:
	mov	x24, x0
	bl	_MV_GPIO_UNLOCK
	b	LBB0_17
LBB0_16:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w24, [x8]
LBB0_17:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_18:
	ldr	x8, [x21, #16]
	sbfiz	x9, x20, #2, #32
	ldr	w10, [x8, x9]
	bic	w10, w10, w19
	orr	w10, w10, w25
	str	w10, [x8, x9]
	bl	_MV_GPIO_UNLOCK
	mov	w24, #0
	b	LBB0_17
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GPIO_PIN_INPUT,4,2             ; @GPIO_PIN_INPUT
	.comm	_GPIO_PIN_OUTPUT,4,2            ; @GPIO_PIN_OUTPUT
	.comm	_MV_GPIO_IN_DEBOUNCE,4,2        ; @MV_GPIO_IN_DEBOUNCE
	.comm	_GPIO_PIN_OPENDRAIN,4,2         ; @GPIO_PIN_OPENDRAIN
	.comm	_MV_GPIO_OUT_BLINK,4,2          ; @MV_GPIO_OUT_BLINK
	.comm	_MV_GPIO_IN_POL_LOW,4,2         ; @MV_GPIO_IN_POL_LOW
.subsections_via_symbols
