	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vf_gpio_attach
_vf_gpio_attach:                        ## @vf_gpio_attach
	.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	%edi, %ebx
	callq	_device_get_softc
	movq	%rax, %r13
	leaq	4(%rax), %r14
	movl	%ebx, %edi
	callq	_device_get_nameunit
	movq	_MTX_DEF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_mtx_init
	movq	_vf_gpio_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r13), %rdx
	movl	%ebx, %edi
	callq	_bus_alloc_resources
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	callq	_device_printf
LBB0_9:
	movq	%r14, %rdi
	callq	_mtx_destroy
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_10
LBB0_2:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %rax
	movl	(%rax), %edi
	callq	_rman_get_bustag
	movl	%eax, 36(%r13)
	movq	8(%r13), %rax
	movl	(%rax), %edi
	callq	_rman_get_bushandle
	movl	%eax, 32(%r13)
	movq	_gpio_sc@GOTPCREL(%rip), %rax
	movq	%r13, (%rax)
	movq	_NGPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
	testl	%eax, %eax
	jle	LBB0_7
## %bb.3:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rax), %eax
	movq	24(%r13), %rcx
	movl	%eax, 8(%rcx,%r15)
	movl	4(%rcx,%r15), %r14d
	movq	_GPIOMAXNAME@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_device_get_unit
	movl	%r14d, %edi
	movl	%r12d, %esi
	leaq	L_.str.1(%rip), %rdx
	movl	%eax, %ecx
	movl	%ebx, %r8d
	callq	_snprintf
	incq	%rbx
	movslq	(%r13), %rax
	addq	$16, %r15
	cmpq	%rax, %rbx
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %rax
	movl	%ebx, (%rax,%r15)
	movq	_DEFAULT_CAPS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%rax,%r15)
	movl	%ebx, %edi
	callq	_GPIO_PDOR
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_READ4
	btl	%ebx, %eax
	movq	_GPIO_PIN_OUTPUT@GOTPCREL(%rip), %rax
	jb	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_GPIO_PIN_INPUT@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_7:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_gpiobus_attach_bus
	movq	%rax, %rcx
	movq	%rax, 16(%r13)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	je	LBB0_8
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_vf_gpio_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r13), %rdx
	movl	%ebx, %edi
	callq	_bus_release_resources
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
	.comm	_vf_gpio_spec,4,2               ## @vf_gpio_spec
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not allocate resources\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_gpio_sc,8,3                    ## @gpio_sc
	.comm	_NGPIO,4,2                      ## @NGPIO
	.comm	_DEFAULT_CAPS,4,2               ## @DEFAULT_CAPS
	.comm	_GPIO_PIN_OUTPUT,4,2            ## @GPIO_PIN_OUTPUT
	.comm	_GPIO_PIN_INPUT,4,2             ## @GPIO_PIN_INPUT
	.comm	_GPIOMAXNAME,4,2                ## @GPIOMAXNAME
L_.str.1:                               ## @.str.1
	.asciz	"vf_gpio%d.%d"

	.no_dead_strip	_vf_gpio_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vf_gpio_attach
_vf_gpio_attach:                        ; @vf_gpio_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x0
	bl	_device_get_softc
	mov	x21, x0
	add	x19, x0, #4
	mov	x0, x20
	bl	_device_get_nameunit
	mov	x1, x0
Lloh0:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_mtx_init
Lloh3:
	adrp	x8, _vf_gpio_spec@GOTPAGE
Lloh4:
	ldr	x8, [x8, _vf_gpio_spec@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	x2, [x21, #8]
	mov	x0, x20
	bl	_bus_alloc_resources
	cbz	x0, LBB0_3
; %bb.1:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_device_printf
LBB0_2:
	mov	x0, x19
	bl	_mtx_destroy
Lloh8:
	adrp	x8, _ENXIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	b	LBB0_8
LBB0_3:
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	ldr	x8, [x21, #8]
	ldr	w0, [x8]
	bl	_rman_get_bustag
	str	w0, [x21, #36]
	ldr	x8, [x21, #8]
	ldr	w0, [x8]
	bl	_rman_get_bushandle
	str	w0, [x21, #32]
Lloh11:
	adrp	x8, _gpio_sc@GOTPAGE
Lloh12:
	ldr	x8, [x8, _gpio_sc@GOTPAGEOFF]
Lloh13:
	str	x21, [x8]
Lloh14:
	adrp	x8, _NGPIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NGPIO@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x27, #0
	mov	x22, #0
Lloh17:
	adrp	x26, _GPIO_PIN_OUTPUT@GOTPAGE
Lloh18:
	ldr	x26, [x26, _GPIO_PIN_OUTPUT@GOTPAGEOFF]
Lloh19:
	adrp	x19, _GPIO_PIN_INPUT@GOTPAGE
Lloh20:
	ldr	x19, [x19, _GPIO_PIN_INPUT@GOTPAGEOFF]
Lloh21:
	adrp	x28, _GPIOMAXNAME@GOTPAGE
Lloh22:
	ldr	x28, [x28, _GPIOMAXNAME@GOTPAGEOFF]
Lloh23:
	adrp	x23, l_.str.1@PAGE
Lloh24:
	add	x23, x23, l_.str.1@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #24]
	add	x8, x8, x27
	str	w22, [x8]
Lloh25:
	adrp	x9, _DEFAULT_CAPS@GOTPAGE
Lloh26:
	ldr	x9, [x9, _DEFAULT_CAPS@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	str	w9, [x8, #12]
	mov	x0, x22
	bl	_GPIO_PDOR
	mov	x1, x0
	mov	x0, x21
	bl	_READ4
	lsr	w8, w0, w22
	tst	w8, #0x1
	csel	x8, x19, x26, eq
	ldr	w8, [x8]
	ldr	x9, [x21, #24]
	add	x9, x9, x27
	str	w8, [x9, #8]
	ldr	w24, [x9, #4]
	ldr	w25, [x28]
	mov	x0, x20
	bl	_device_get_unit
	mov	x3, x0
	mov	x0, x24
	mov	x1, x25
	mov	x2, x23
	mov	x4, x22
	bl	_snprintf
	add	x22, x22, #1
	ldrsw	x8, [x21]
	add	x27, x27, #16
	cmp	x22, x8
	b.lt	LBB0_5
LBB0_6:
	mov	x0, x20
	bl	_gpiobus_attach_bus
	str	x0, [x21, #16]
	cbz	x0, LBB0_9
; %bb.7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_9:
Lloh28:
	adrp	x8, _vf_gpio_spec@GOTPAGE
Lloh29:
	ldr	x8, [x8, _vf_gpio_spec@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	ldr	x2, [x21, #8]
	mov	x0, x20
	bl	_bus_release_resources
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
	.comm	_vf_gpio_spec,4,2               ; @vf_gpio_spec
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not allocate resources\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_gpio_sc,8,3                    ; @gpio_sc
	.comm	_NGPIO,4,2                      ; @NGPIO
	.comm	_DEFAULT_CAPS,4,2               ; @DEFAULT_CAPS
	.comm	_GPIO_PIN_OUTPUT,4,2            ; @GPIO_PIN_OUTPUT
	.comm	_GPIO_PIN_INPUT,4,2             ; @GPIO_PIN_INPUT
	.comm	_GPIOMAXNAME,4,2                ; @GPIOMAXNAME
l_.str.1:                               ; @.str.1
	.asciz	"vf_gpio%d.%d"

	.no_dead_strip	_vf_gpio_attach
.subsections_via_symbols
