	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aml8726_gpio_attach
_aml8726_gpio_attach:                   ## @aml8726_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	callq	_device_get_softc
	movq	%rax, %r14
	movl	%ebx, 24(%rax)
	movl	%ebx, %edi
	callq	_ofw_bus_get_node
	leaq	L_.str(%rip), %rsi
	leaq	-36(%rbp), %rdx
	movl	%eax, %edi
	movl	$4, %ecx
	callq	_OF_getencprop
	testq	%rax, %rax
	jle	LBB0_1
## %bb.3:
	movl	-36(%rbp), %eax
	movl	%eax, (%r14)
	cmpl	$33, %eax
	jge	LBB0_12
## %bb.4:
	movq	_aml8726_gpio_spec@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	8(%r14), %rdx
	movl	%ebx, %edi
	callq	_bus_alloc_resources
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%ebx, %edi
	callq	_device_printf
LBB0_12:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_13:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	8(%r14), %rax
	movl	4(%rax), %edi
	callq	_rman_get_start
	movq	%rax, %r15
	movq	8(%r14), %rax
	movl	(%rax), %edi
	callq	_rman_get_start
	cmpq	%rax, %r15
	jne	LBB0_9
## %bb.7:
	cmpl	$17, (%r14)
	jl	LBB0_9
## %bb.8:
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edi
	callq	_device_printf
	jmp	LBB0_11
LBB0_9:
	movq	%r14, %rdi
	callq	_AML_GPIO_LOCK_INIT
	movl	%ebx, %edi
	callq	_gpiobus_attach_bus
	movq	%rax, %rcx
	movq	%rax, 16(%r14)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_13
## %bb.10:
	movq	%r14, %rdi
	callq	_AML_GPIO_LOCK_DESTROY
LBB0_11:
	movl	(%r12), %esi
	movq	8(%r14), %rdx
	movl	%ebx, %edi
	callq	_bus_release_resources
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pin-count"

L_.str.1:                               ## @.str.1
	.asciz	"missing pin-count attribute in FDT\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_aml8726_gpio_spec,4,2          ## @aml8726_gpio_spec
L_.str.2:                               ## @.str.2
	.asciz	"can not allocate resources for device\n"

L_.str.3:                               ## @.str.3
	.asciz	"too many pins for overlapping OEN and OUT\n"

	.no_dead_strip	_aml8726_gpio_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aml8726_gpio_attach
_aml8726_gpio_attach:                   ; @aml8726_gpio_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	_device_get_softc
	mov	x20, x0
	str	w19, [x0, #24]
	mov	x0, x19
	bl	_ofw_bus_get_node
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #12
	mov	w3, #4
	bl	_OF_getencprop
	cmp	x0, #0
	b.le	LBB0_4
; %bb.1:
	ldr	w8, [sp, #12]
	str	w8, [x20]
	cmp	w8, #33
	b.ge	LBB0_6
; %bb.2:
Lloh2:
	adrp	x22, _aml8726_gpio_spec@GOTPAGE
Lloh3:
	ldr	x22, [x22, _aml8726_gpio_spec@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	x2, [x20, #8]
	mov	x0, x19
	bl	_bus_alloc_resources
	cbz	x0, LBB0_8
; %bb.3:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_4:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_5:
	mov	x0, x19
	bl	_device_printf
LBB0_6:
Lloh8:
	adrp	x8, _ENXIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_8:
	ldr	x8, [x20, #8]
	ldr	w0, [x8, #4]
	bl	_rman_get_start
	mov	x21, x0
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
	bl	_rman_get_start
	cmp	x21, x0
	b.ne	LBB0_11
; %bb.9:
	ldr	w8, [x20]
	cmp	w8, #17
	b.lt	LBB0_11
; %bb.10:
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_14
LBB0_11:
	mov	x0, x20
	bl	_AML_GPIO_LOCK_INIT
	mov	x0, x19
	bl	_gpiobus_attach_bus
	str	x0, [x20, #16]
	cbz	x0, LBB0_13
; %bb.12:
	mov	w0, #0
	b	LBB0_7
LBB0_13:
	mov	x0, x20
	bl	_AML_GPIO_LOCK_DESTROY
LBB0_14:
	ldr	w1, [x22]
	ldr	x2, [x20, #8]
	mov	x0, x19
	bl	_bus_release_resources
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pin-count"

l_.str.1:                               ; @.str.1
	.asciz	"missing pin-count attribute in FDT\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_aml8726_gpio_spec,4,2          ; @aml8726_gpio_spec
l_.str.2:                               ; @.str.2
	.asciz	"can not allocate resources for device\n"

l_.str.3:                               ; @.str.3
	.asciz	"too many pins for overlapping OEN and OUT\n"

	.no_dead_strip	_aml8726_gpio_attach
.subsections_via_symbols
