	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function as3722_attach
_as3722_attach:                         ## @as3722_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, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	%r14d, 16(%rax)
	movl	%r14d, %edi
	callq	_iicbus_get_addr
	movl	%eax, 20(%rbx)
	movl	16(%rbx), %edi
	callq	_ofw_bus_get_node
	movl	%eax, %r15d
	movl	%r14d, %edi
	callq	_device_get_name
	movl	%r14d, %edi
	callq	_device_get_unit
	movq	%rbx, %rdi
	callq	_LOCK_INIT
	movl	$0, -44(%rbp)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_as3722_parse_fdt
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.3:
	movq	%rbx, %rdi
	callq	_as3722_get_version
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.4:
	movq	%rbx, %rdi
	callq	_as3722_init
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.5:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_as3722_regulator_attach
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.6:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_as3722_gpio_attach
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_as3722_rtc_attach
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_fdt_pinctrl_register
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	callq	_fdt_pinctrl_configure_by_name
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rax
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	(%rbx), %rsi
	movq	_as3722_intr@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rax
	addq	$8, %rax
	movq	%rax, (%rsp)
	movl	%r14d, %edi
	xorl	%ecx, %ecx
	movq	%rbx, %r9
	callq	_bus_setup_intr
	testl	%eax, %eax
	je	LBB0_16
## %bb.9:
	movl	%eax, %r12d
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_10:
	movq	8(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.11:
	movq	(%rbx), %rsi
	movl	%r14d, %edi
	callq	_bus_teardown_intr
LBB0_12:
	movq	(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_14
## %bb.13:
	movl	(%r13), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_14:
	movq	%rbx, %rdi
	callq	_LOCK_DESTROY
LBB0_15:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	%r14d, %edi
	callq	_bus_generic_attach
	movl	%eax, %r12d
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot allocate interrupt.\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.1:                               ## @.str.1
	.asciz	"default"

	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_as3722_intr,4,2                ## @as3722_intr
L_.str.2:                               ## @.str.2
	.asciz	"Cannot setup interrupt.\n"

	.no_dead_strip	_as3722_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function as3722_attach
_as3722_attach:                         ; @as3722_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	bl	_device_get_softc
	mov	x19, x0
	str	w20, [x0, #16]
	mov	x0, x20
	bl	_iicbus_get_addr
	str	w0, [x19, #20]
	ldr	w0, [x19, #16]
	bl	_ofw_bus_get_node
	mov	x21, x0
	mov	x0, x20
	bl	_device_get_name
	mov	x0, x20
	bl	_device_get_unit
	mov	x0, x19
	bl	_LOCK_INIT
	str	wzr, [sp, #12]
Lloh0:
	adrp	x23, _SYS_RES_IRQ@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_bus_alloc_resource_any
	str	x0, [x19]
	cbz	x0, LBB0_9
; %bb.1:
	mov	x0, x19
	mov	x1, x21
	bl	_as3722_parse_fdt
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.2:
	mov	x0, x19
	bl	_as3722_get_version
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.3:
	mov	x0, x19
	bl	_as3722_init
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.4:
	mov	x0, x19
	mov	x1, x21
	bl	_as3722_regulator_attach
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.5:
	mov	x0, x19
	mov	x1, x21
	bl	_as3722_gpio_attach
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.6:
	mov	x0, x19
	mov	x1, x21
	bl	_as3722_rtc_attach
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.7:
	mov	x0, x20
	mov	x1, #0
	bl	_fdt_pinctrl_register
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_fdt_pinctrl_configure_by_name
	mov	x6, x19
	ldr	x1, [x6], #8
Lloh7:
	adrp	x8, _INTR_TYPE_MISC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh9:
	adrp	x9, _INTR_MPSAFE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _INTR_MPSAFE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh13:
	adrp	x8, _as3722_intr@GOTPAGE
Lloh14:
	ldr	x8, [x8, _as3722_intr@GOTPAGEOFF]
Lloh15:
	ldr	w4, [x8]
	mov	x0, x20
	mov	x3, #0
	mov	x5, x19
	bl	_bus_setup_intr
	cbz	w0, LBB0_16
; %bb.8:
	mov	x22, x0
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_device_printf
	b	LBB0_10
LBB0_9:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_device_printf
Lloh20:
	adrp	x8, _ENXIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh22:
	ldr	w22, [x8]
LBB0_10:
	ldr	x2, [x19, #8]
	cbz	x2, LBB0_12
; %bb.11:
	ldr	x1, [x19]
	mov	x0, x20
	bl	_bus_teardown_intr
LBB0_12:
	ldr	x3, [x19]
	cbz	x3, LBB0_14
; %bb.13:
	ldr	w1, [x23]
	mov	x0, x20
	mov	w2, #0
	bl	_bus_release_resource
LBB0_14:
	mov	x0, x19
	bl	_LOCK_DESTROY
LBB0_15:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_16:
	mov	x0, x20
	bl	_bus_generic_attach
	mov	x22, x0
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot allocate interrupt.\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.1:                               ; @.str.1
	.asciz	"default"

	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_as3722_intr,4,2                ; @as3722_intr
l_.str.2:                               ; @.str.2
	.asciz	"Cannot setup interrupt.\n"

	.no_dead_strip	_as3722_attach
.subsections_via_symbols
