	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_as3722_gpio_pin_setflags       ## -- Begin function as3722_gpio_pin_setflags
	.p2align	4, 0x90
_as3722_gpio_pin_setflags:              ## @as3722_gpio_pin_setflags
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	callq	_device_get_softc
	cmpq	%r14, (%rax)
	jbe	LBB0_5
## %bb.1:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_GPIO_LOCK
	movq	8(%r12), %rax
	movq	(%rax,%r14,8), %rax
	movl	(%rax), %ebx
	movq	_AS3722_GPIO_IOSF_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%ebx, %eax
	sarl	%cl, %eax
	movq	_AS3722_GPIO_IOSF_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_AS3722_IOSF_GPIO@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.2:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_as3722_gpio_get_mode
	movq	_AS3722_GPIO_MODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_AS3722_GPIO_MODE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movq	_AS3722_MODE_PUSH_PULL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r15d
	shll	%cl, %r15d
	notl	%eax
	andl	%eax, %ebx
	orl	%ebx, %r15d
	movq	8(%r12), %rax
	movq	(%rax,%r14,8), %rax
	xorl	%ebx, %ebx
	cmpl	(%rax), %r15d
	je	LBB0_4
## %bb.3:
	movq	_AS3722_GPIO0_CONTROL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r14, %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_WR1
	movl	%eax, %ebx
	movq	8(%r12), %rax
	movq	(%rax,%r14,8), %rax
	movl	%r15d, (%rax)
LBB0_4:
	movq	%r12, %rdi
	callq	_GPIO_UNLOCK
	jmp	LBB0_8
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	movq	%r12, %rdi
	callq	_GPIO_UNLOCK
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AS3722_GPIO_IOSF_SHIFT,4,2     ## @AS3722_GPIO_IOSF_SHIFT
	.comm	_AS3722_GPIO_IOSF_MASK,4,2      ## @AS3722_GPIO_IOSF_MASK
	.comm	_AS3722_IOSF_GPIO,4,2           ## @AS3722_IOSF_GPIO
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_AS3722_GPIO_MODE_MASK,4,2      ## @AS3722_GPIO_MODE_MASK
	.comm	_AS3722_GPIO_MODE_SHIFT,4,2     ## @AS3722_GPIO_MODE_SHIFT
	.comm	_AS3722_MODE_PUSH_PULL,4,2      ## @AS3722_MODE_PUSH_PULL
	.comm	_AS3722_GPIO0_CONTROL,8,3       ## @AS3722_GPIO0_CONTROL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_as3722_gpio_pin_setflags       ; -- Begin function as3722_gpio_pin_setflags
	.p2align	2
_as3722_gpio_pin_setflags:              ; @as3722_gpio_pin_setflags
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x2
	mov	x20, x1
	bl	_device_get_softc
	ldr	x8, [x0]
	cmp	x8, x20
	b.ls	LBB0_4
; %bb.1:
	mov	x19, x0
	bl	_GPIO_LOCK
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x20, lsl #3]
	ldr	w22, [x8]
Lloh0:
	adrp	x8, _AS3722_GPIO_IOSF_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AS3722_GPIO_IOSF_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	asr	w8, w22, w8
Lloh3:
	adrp	x9, _AS3722_GPIO_IOSF_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AS3722_GPIO_IOSF_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w8, w8, w9
Lloh6:
	adrp	x9, _AS3722_IOSF_GPIO@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AS3722_IOSF_GPIO@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_as3722_gpio_get_mode
Lloh9:
	adrp	x8, _AS3722_GPIO_MODE_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AS3722_GPIO_MODE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _AS3722_GPIO_MODE_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _AS3722_GPIO_MODE_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	bic	w8, w22, w8
Lloh15:
	adrp	x10, _AS3722_MODE_PUSH_PULL@GOTPAGE
Lloh16:
	ldr	x10, [x10, _AS3722_MODE_PUSH_PULL@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	lsl	w9, w10, w9
	orr	w22, w8, w9
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x20, lsl #3]
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_6
; %bb.3:
	mov	w21, #0
	b	LBB0_7
LBB0_4:
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w21, [x8]
	b	LBB0_8
LBB0_5:
	mov	x0, x19
	bl	_GPIO_UNLOCK
Lloh21:
	adrp	x8, _ENXIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh23:
	ldr	w21, [x8]
	b	LBB0_8
LBB0_6:
Lloh24:
	adrp	x8, _AS3722_GPIO0_CONTROL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AS3722_GPIO0_CONTROL@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	add	x1, x8, x20
	mov	x0, x19
	mov	x2, x22
	bl	_WR1
	mov	x21, x0
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x20, lsl #3]
	str	w22, [x8]
LBB0_7:
	mov	x0, x19
	bl	_GPIO_UNLOCK
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AS3722_GPIO_IOSF_SHIFT,4,2     ; @AS3722_GPIO_IOSF_SHIFT
	.comm	_AS3722_GPIO_IOSF_MASK,4,2      ; @AS3722_GPIO_IOSF_MASK
	.comm	_AS3722_IOSF_GPIO,4,2           ; @AS3722_IOSF_GPIO
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_AS3722_GPIO_MODE_MASK,4,2      ; @AS3722_GPIO_MODE_MASK
	.comm	_AS3722_GPIO_MODE_SHIFT,4,2     ; @AS3722_GPIO_MODE_SHIFT
	.comm	_AS3722_MODE_PUSH_PULL,4,2      ; @AS3722_MODE_PUSH_PULL
	.comm	_AS3722_GPIO0_CONTROL,8,3       ; @AS3722_GPIO0_CONTROL
.subsections_via_symbols
