	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function macgpio_attach
_macgpio_attach:                        ## @macgpio_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_ofw_bus_get_node
	movq	%rax, %r15
	movq	%rax, (%rbx)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	8(%rbx), %rdx
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_bus_alloc_resource_any
	movl	%eax, 12(%rbx)
	movq	%r15, %rdi
	callq	_OF_child
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movq	%rax, %rbx
	movq	_M_MACGPIO@GOTPCREL(%rip), %r13
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r15), %edx
	movq	%r14, %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_device_printf
	movq	%r12, %rdi
	callq	_ofw_bus_gen_destroy_devinfo
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_free
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_OF_peer
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_14
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	_M_ZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	$12, %edi
	callq	_malloc
	movq	%rax, %r15
	leaq	4(%rax), %r12
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_ofw_bus_gen_setup_devinfo
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	movl	$4, %ecx
	callq	_OF_getencprop
	cmpl	$4, %eax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$-1, (%r15)
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %r13
	addq	$8, %r13
	movq	%r13, %rdi
	callq	_resource_list_init
	movq	%rbx, %rdi
	leaq	L_.str.1(%rip), %rsi
	leaq	-56(%rbp), %rdx
	movl	$8, %ecx
	callq	_OF_getencprop
	cmpl	$8, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.2(%rip), %rsi
	leaq	-72(%rbp), %rdx
	movl	$8, %ecx
	callq	_OF_searchencprop
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	-72(%rbp), %rdi
	movl	-56(%rbp), %esi
	callq	_MAP_IRQ
	movl	%eax, %r14d
	movq	-72(%rbp), %rdi
	movl	-56(%rbp), %esi
	callq	_MAP_IRQ
	movq	%r13, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	movl	%r14d, %ecx
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, %r8d
	movl	$1, %r9d
	callq	_resource_list_add
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %eax
	cmpl	$81, %eax
	movq	_M_MACGPIO@GOTPCREL(%rip), %r13
	jl	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	$-80, %eax
	movl	%eax, (%r15)
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$-1, %edx
	callq	_device_add_child
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_device_set_ivars
	jmp	LBB0_13
LBB0_14:
	movq	%r14, %rdi
	callq	_bus_generic_attach
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_16
## %bb.15:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.comm	_M_MACGPIO,4,2                  ## @M_MACGPIO
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg"

L_.str.1:                               ## @.str.1
	.asciz	"interrupts"

L_.str.2:                               ## @.str.2
	.asciz	"interrupt-parent"

	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
L_.str.3:                               ## @.str.3
	.asciz	"<%s>: device_add_child failed\n"

	.no_dead_strip	_macgpio_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function macgpio_attach
_macgpio_attach:                        ; @macgpio_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_device_get_softc
	mov	x20, x0
	mov	x0, x19
	bl	_ofw_bus_get_node
	mov	x21, x0
Lloh3:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
	str	x0, [x20]
Lloh5:
	ldr	w1, [x8]
	add	x2, x20, #8
Lloh6:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	w0, [x20, #12]
	mov	x0, x21
	bl	_OF_child
	cbz	x0, LBB0_14
; %bb.1:
	mov	x20, x0
Lloh9:
	adrp	x23, _M_MACGPIO@GOTPAGE
Lloh10:
	ldr	x23, [x23, _M_MACGPIO@GOTPAGEOFF]
Lloh11:
	adrp	x21, _M_WAITOK@GOTPAGE
Lloh12:
	ldr	x21, [x21, _M_WAITOK@GOTPAGEOFF]
Lloh13:
	adrp	x24, l_.str@PAGE
Lloh14:
	add	x24, x24, l_.str@PAGEOFF
Lloh15:
	adrp	x22, _M_ZERO@GOTPAGE
Lloh16:
	ldr	x22, [x22, _M_ZERO@GOTPAGEOFF]
Lloh17:
	adrp	x28, l_.str.1@PAGE
Lloh18:
	add	x28, x28, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w2, [x25, #4]
	mov	x0, x19
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_device_printf
	mov	x0, x26
	bl	_ofw_bus_gen_destroy_devinfo
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x23]
	mov	x0, x25
	bl	_free
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_OF_peer
	mov	x20, x0
	cbz	x0, LBB0_14
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w2, w9, w8
	mov	w0, #12
	bl	_malloc
	mov	x25, x0
	add	x26, x0, #4
	mov	x0, x26
	mov	x1, x20
	bl	_ofw_bus_gen_setup_devinfo
	cbnz	x0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	mov	x1, x24
	mov	x2, x25
	mov	w3, #4
	bl	_OF_getencprop
	cmp	w0, #4
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #-1
	str	w8, [x25]
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x27, x25, #8
	mov	x0, x27
	bl	_resource_list_init
	add	x2, sp, #16
	mov	x0, x20
	mov	x1, x28
	mov	w3, #8
	bl	_OF_getencprop
	cmp	w0, #8
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x2, sp, #8
	mov	x0, x20
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w3, #8
	bl	_OF_searchencprop
Lloh23:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	str	w8, [sp, #4]                    ; 4-byte Folded Spill
	ldr	x0, [sp, #8]
	ldr	w1, [sp, #16]
	bl	_MAP_IRQ
	mov	x28, x23
	mov	x23, x19
	mov	x19, x22
	mov	x22, x21
	mov	x21, x24
	mov	x24, x0
	ldr	x0, [sp, #8]
	ldr	w1, [sp, #16]
	bl	_MAP_IRQ
	mov	x4, x0
	mov	x0, x27
	ldr	w1, [sp, #4]                    ; 4-byte Folded Reload
	mov	w2, #0
	mov	x3, x24
	mov	x24, x21
	mov	x21, x22
	mov	x22, x19
	mov	x19, x23
	mov	x23, x28
Lloh26:
	adrp	x28, l_.str.1@PAGE
Lloh27:
	add	x28, x28, l_.str.1@PAGEOFF
	mov	w5, #1
	bl	_resource_list_add
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x25]
	cmp	w8, #81
	b.lt	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	sub	w8, w8, #80
	str	w8, [x25]
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	mov	x1, #0
	mov	w2, #-1
	bl	_device_add_child
	cbz	x0, LBB0_2
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x25
	bl	_device_set_ivars
	b	LBB0_4
LBB0_14:
	mov	x0, x19
	bl	_bus_generic_attach
	ldr	x8, [sp, #24]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.comm	_M_MACGPIO,4,2                  ; @M_MACGPIO
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg"

l_.str.1:                               ; @.str.1
	.asciz	"interrupts"

l_.str.2:                               ; @.str.2
	.asciz	"interrupt-parent"

	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
l_.str.3:                               ; @.str.3
	.asciz	"<%s>: device_add_child failed\n"

	.no_dead_strip	_macgpio_attach
.subsections_via_symbols
