	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_as3722_gpio_attach             ## -- Begin function as3722_gpio_attach
	.p2align	4, 0x90
_as3722_gpio_attach:                    ## @as3722_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	addq	$32, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_sx_init
	movq	_NGPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, (%r14)
	shll	$3, %edi
	movq	_M_AS3722_GPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	callq	_malloc
	movq	%rax, 8(%r14)
	movl	16(%r14), %edi
	callq	_gpiobus_attach_bus
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	cmpl	$0, (%r14)
	jle	LBB0_6
## %bb.2:
	xorl	%r13d, %r13d
	movq	_GPIO_PIN_INVOUT@GOTPCREL(%rip), %r15
	movq	_AS3722_GPIO0_CONTROL@GOTPCREL(%rip), %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r13
	movslq	(%r14), %rax
	cmpq	%rax, %r13
	jge	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_M_AS3722_GPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %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	8(%r14), %rcx
	movq	%rax, (%rcx,%r13,8)
	movq	8(%r14), %rax
	movq	(%rax,%r13,8), %rbx
	movl	4(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	callq	_sprintf
	movq	_GPIO_PIN_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_GPIO_PIN_INPUT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_GPIO_PIN_OPENDRAIN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_GPIO_PIN_PUSHPULL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_GPIO_PIN_TRISTATE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_GPIO_PIN_PULLUP@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_GPIO_PIN_PULLDOWN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_GPIO_PIN_INVIN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	(%r15), %eax
	movl	%eax, (%rbx)
	movq	(%r12), %rsi
	addq	%r13, %rsi
	addq	$8, %rbx
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_RD1
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	16(%r14), %edi
	movq	8(%r14), %rax
	movq	(%rax,%r13,8), %rax
	movl	4(%rax), %edx
	leaq	L_.str.2(%rip), %rsi
	callq	_device_printf
	jmp	LBB0_5
LBB0_6:
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_8:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AS3722 GPIO lock"

	.comm	_NGPIO,4,2                      ## @NGPIO
	.comm	_M_AS3722_GPIO,4,2              ## @M_AS3722_GPIO
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.1:                               ## @.str.1
	.asciz	"gpio%d"

	.comm	_GPIO_PIN_INPUT,4,2             ## @GPIO_PIN_INPUT
	.comm	_GPIO_PIN_OUTPUT,4,2            ## @GPIO_PIN_OUTPUT
	.comm	_GPIO_PIN_OPENDRAIN,4,2         ## @GPIO_PIN_OPENDRAIN
	.comm	_GPIO_PIN_PUSHPULL,4,2          ## @GPIO_PIN_PUSHPULL
	.comm	_GPIO_PIN_TRISTATE,4,2          ## @GPIO_PIN_TRISTATE
	.comm	_GPIO_PIN_PULLUP,4,2            ## @GPIO_PIN_PULLUP
	.comm	_GPIO_PIN_PULLDOWN,4,2          ## @GPIO_PIN_PULLDOWN
	.comm	_GPIO_PIN_INVIN,4,2             ## @GPIO_PIN_INVIN
	.comm	_GPIO_PIN_INVOUT,4,2            ## @GPIO_PIN_INVOUT
	.comm	_AS3722_GPIO0_CONTROL,8,3       ## @AS3722_GPIO0_CONTROL
L_.str.2:                               ## @.str.2
	.asciz	"Cannot read configuration for pin %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_as3722_gpio_attach             ; -- Begin function as3722_gpio_attach
	.p2align	2
_as3722_gpio_attach:                    ; @as3722_gpio_attach
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	add	x0, x0, #32
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_sx_init
Lloh2:
	adrp	x8, _NGPIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NGPIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x19]
	lsl	w0, w8, #3
Lloh5:
	adrp	x8, _M_AS3722_GPIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _M_AS3722_GPIO@GOTPAGEOFF]
Lloh7:
	adrp	x9, _M_WAITOK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _M_WAITOK@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	ldr	w8, [x9]
Lloh11:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh12:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w2, w9, w8
	bl	_malloc
	str	x0, [x19, #8]
	ldr	w0, [x19, #16]
	bl	_gpiobus_attach_bus
	str	x0, [x19, #24]
	cbz	x0, LBB0_7
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.2:
	mov	x20, #0
Lloh14:
	adrp	x22, _GPIO_PIN_PUSHPULL@GOTPAGE
Lloh15:
	ldr	x22, [x22, _GPIO_PIN_PUSHPULL@GOTPAGEOFF]
Lloh16:
	adrp	x23, _GPIO_PIN_TRISTATE@GOTPAGE
Lloh17:
	ldr	x23, [x23, _GPIO_PIN_TRISTATE@GOTPAGEOFF]
Lloh18:
	adrp	x24, _GPIO_PIN_PULLUP@GOTPAGE
Lloh19:
	ldr	x24, [x24, _GPIO_PIN_PULLUP@GOTPAGEOFF]
Lloh20:
	adrp	x25, _GPIO_PIN_PULLDOWN@GOTPAGE
Lloh21:
	ldr	x25, [x25, _GPIO_PIN_PULLDOWN@GOTPAGEOFF]
Lloh22:
	adrp	x26, _GPIO_PIN_INVIN@GOTPAGE
Lloh23:
	ldr	x26, [x26, _GPIO_PIN_INVIN@GOTPAGEOFF]
Lloh24:
	adrp	x27, _GPIO_PIN_INVOUT@GOTPAGE
Lloh25:
	ldr	x27, [x27, _GPIO_PIN_INVOUT@GOTPAGEOFF]
Lloh26:
	adrp	x28, _AS3722_GPIO0_CONTROL@GOTPAGE
Lloh27:
	ldr	x28, [x28, _AS3722_GPIO0_CONTROL@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x19]
	cmp	x20, x8
	b.ge	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
Lloh28:
	adrp	x8, _M_AS3722_GPIO@GOTPAGE
Lloh29:
	ldr	x8, [x8, _M_AS3722_GPIO@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
Lloh31:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh32:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
Lloh34:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh35:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #12
	bl	_malloc
	ldr	x8, [x19, #8]
	lsl	x9, x20, #3
	str	x0, [x8, x9]
	ldr	x8, [x19, #8]
	ldr	x21, [x8, x9]
	ldr	w0, [x21, #4]
Lloh37:
	adrp	x1, l_.str.1@PAGE
Lloh38:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_sprintf
Lloh39:
	adrp	x8, _GPIO_PIN_INPUT@GOTPAGE
Lloh40:
	ldr	x8, [x8, _GPIO_PIN_INPUT@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
Lloh42:
	adrp	x9, _GPIO_PIN_OUTPUT@GOTPAGE
Lloh43:
	ldr	x9, [x9, _GPIO_PIN_OUTPUT@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh45:
	adrp	x9, _GPIO_PIN_OPENDRAIN@GOTPAGE
Lloh46:
	ldr	x9, [x9, _GPIO_PIN_OPENDRAIN@GOTPAGEOFF]
Lloh47:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x22]
	orr	w8, w8, w9
	ldr	w9, [x23]
	orr	w8, w8, w9
	ldr	w9, [x24]
	orr	w8, w8, w9
	ldr	w9, [x25]
	orr	w8, w8, w9
	ldr	w9, [x26]
	orr	w8, w8, w9
	ldr	w9, [x27]
	orr	w8, w8, w9
	str	w8, [x21]
	ldr	x8, [x28]
	add	x1, x20, x8
	add	x2, x21, #8
	mov	x0, x19
	bl	_RD1
	cbz	w0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x20, lsl #3]
	ldr	w2, [x8, #4]
Lloh48:
	adrp	x1, l_.str.2@PAGE
Lloh49:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_device_printf
	b	LBB0_3
LBB0_6:
	mov	w0, #0
	b	LBB0_8
LBB0_7:
Lloh50:
	adrp	x8, _ENXIO@GOTPAGE
Lloh51:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh52:
	ldr	w0, [x8]
LBB0_8:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AS3722 GPIO lock"

	.comm	_NGPIO,4,2                      ; @NGPIO
	.comm	_M_AS3722_GPIO,4,2              ; @M_AS3722_GPIO
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.1:                               ; @.str.1
	.asciz	"gpio%d"

	.comm	_GPIO_PIN_INPUT,4,2             ; @GPIO_PIN_INPUT
	.comm	_GPIO_PIN_OUTPUT,4,2            ; @GPIO_PIN_OUTPUT
	.comm	_GPIO_PIN_OPENDRAIN,4,2         ; @GPIO_PIN_OPENDRAIN
	.comm	_GPIO_PIN_PUSHPULL,4,2          ; @GPIO_PIN_PUSHPULL
	.comm	_GPIO_PIN_TRISTATE,4,2          ; @GPIO_PIN_TRISTATE
	.comm	_GPIO_PIN_PULLUP,4,2            ; @GPIO_PIN_PULLUP
	.comm	_GPIO_PIN_PULLDOWN,4,2          ; @GPIO_PIN_PULLDOWN
	.comm	_GPIO_PIN_INVIN,4,2             ; @GPIO_PIN_INVIN
	.comm	_GPIO_PIN_INVOUT,4,2            ; @GPIO_PIN_INVOUT
	.comm	_AS3722_GPIO0_CONTROL,8,3       ; @AS3722_GPIO0_CONTROL
l_.str.2:                               ; @.str.2
	.asciz	"Cannot read configuration for pin %s\n"

.subsections_via_symbols
