	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a37x0_gpio_attach
_a37x0_gpio_attach:                     ## @a37x0_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %ebx
	callq	_device_get_softc
	movq	%rax, %r14
	leaq	24(%rax), %rsi
	movl	%ebx, %edi
	callq	_syscon_get_handle_default
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	callq	_device_printf
LBB0_10:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_11:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_2:
	movl	%ebx, %edi
	callq	_ofw_bus_get_node
	leaq	L_.str.1(%rip), %rsi
	leaq	-24(%rbp), %rdx
	movl	%eax, %edi
	callq	_OF_getencprop_alloc
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.3:
	cmpl	$32, %eax
	jne	LBB0_4
## %bb.5:
	movq	-24(%rbp), %rdi
	cmpq	$0, 8(%rdi)
	jne	LBB0_7
## %bb.6:
	cmpq	$0, 16(%rdi)
	je	LBB0_8
LBB0_7:
	callq	_OF_prop_free
	jmp	LBB0_10
LBB0_4:
	movq	-24(%rbp), %rdi
	callq	_OF_prop_free
	jmp	LBB0_10
LBB0_8:
	movq	24(%rdi), %rax
	movq	%rax, (%r14)
	callq	_OF_prop_free
	movq	(%r14), %rax
	cmpq	8(%r14), %rax
	jg	LBB0_10
## %bb.9:
	movl	%ebx, %edi
	callq	_gpiobus_attach_bus
	movq	%rax, %rcx
	movq	%rax, 16(%r14)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	je	LBB0_10
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot get syscon handle from parent\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.1:                               ## @.str.1
	.asciz	"gpio-ranges"

	.no_dead_strip	_a37x0_gpio_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a37x0_gpio_attach
_a37x0_gpio_attach:                     ; @a37x0_gpio_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	add	x1, x0, #24
	mov	x0, x19
	bl	_syscon_get_handle_default
	cbz	w0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_2:
Lloh2:
	adrp	x8, _ENXIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_4:
	mov	x0, x19
	bl	_ofw_bus_get_node
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #8
	bl	_OF_getencprop_alloc
	cmn	w0, #1
	b.eq	LBB0_2
; %bb.5:
	cmp	w0, #32
	b.ne	LBB0_9
; %bb.6:
	ldr	x0, [sp, #8]
	ldr	x8, [x0, #8]
	cbnz	x8, LBB0_8
; %bb.7:
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_10
LBB0_8:
	bl	_OF_prop_free
	b	LBB0_2
LBB0_9:
	ldr	x0, [sp, #8]
	bl	_OF_prop_free
	b	LBB0_2
LBB0_10:
	ldr	x8, [x0, #24]
	str	x8, [x20]
	bl	_OF_prop_free
	ldp	x8, x9, [x20]
	cmp	x8, x9
	b.gt	LBB0_2
; %bb.11:
	mov	x0, x19
	bl	_gpiobus_attach_bus
	str	x0, [x20, #16]
Lloh7:
	adrp	x8, _ENXIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w0, w8, wzr, eq
	b	LBB0_3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot get syscon handle from parent\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.1:                               ; @.str.1
	.asciz	"gpio-ranges"

	.no_dead_strip	_a37x0_gpio_attach
.subsections_via_symbols
