	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function axp2xx_gpio_pin_setflags
_axp2xx_gpio_pin_setflags:              ## @axp2xx_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	%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	%rdx, %r12
	movq	%rsi, %r15
	movl	%edi, %r14d
	callq	_device_get_softc
	cmpq	%r15, (%rax)
	jbe	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_AXP_LOCK
	movq	8(%r13), %rax
	movl	(%rax,%r15,4), %esi
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	movl	$1, %ecx
	callq	_axp2xx_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:
	movq	_AXP2XX_GPIO_FUNC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-44(%rbp), %edx
	movl	%edx, -44(%rbp)
	movq	_GPIO_PIN_INPUT@GOTPCREL(%rip), %rcx
	movq	_GPIO_PIN_OUTPUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rcx), %rcx
	orq	%rax, %rcx
	testq	%r12, %rcx
	je	LBB0_6
## %bb.4:
	andq	%r12, %rax
	jne	LBB0_6
## %bb.5:
	movq	_AXP2XX_GPIO_FUNC_INPUT@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%edx, -44(%rbp)
LBB0_6:
	movq	8(%r13), %rax
	movl	(%rax,%r15,4), %esi
	movl	%r14d, %edi
	callq	_axp2xx_write
	movl	%eax, %ebx
LBB0_7:
	movq	%r13, %rdi
	callq	_AXP_UNLOCK
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AXP2XX_GPIO_FUNC_MASK,4,2      ## @AXP2XX_GPIO_FUNC_MASK
	.comm	_GPIO_PIN_INPUT,8,3             ## @GPIO_PIN_INPUT
	.comm	_GPIO_PIN_OUTPUT,8,3            ## @GPIO_PIN_OUTPUT
	.comm	_AXP2XX_GPIO_FUNC_INPUT,4,2     ## @AXP2XX_GPIO_FUNC_INPUT
	.no_dead_strip	_axp2xx_gpio_pin_setflags
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function axp2xx_gpio_pin_setflags
_axp2xx_gpio_pin_setflags:              ; @axp2xx_gpio_pin_setflags
	.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	x22, x2
	mov	x21, x1
	mov	x20, x0
	bl	_device_get_softc
	ldr	x8, [x0]
	cmp	x8, x21
	b.ls	LBB0_6
; %bb.1:
	mov	x19, x0
	bl	_AXP_LOCK
	ldr	x8, [x19, #8]
	ldr	w1, [x8, x21, lsl #2]
	add	x2, sp, #12
	mov	x0, x20
	mov	w3, #1
	bl	_axp2xx_read
	mov	x23, x0
	cbnz	w0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _AXP2XX_GPIO_FUNC_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AXP2XX_GPIO_FUNC_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	str	w2, [sp, #12]
Lloh3:
	adrp	x8, _GPIO_PIN_INPUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GPIO_PIN_INPUT@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x9, _GPIO_PIN_OUTPUT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _GPIO_PIN_OUTPUT@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	orr	x8, x9, x8
	and	x8, x8, x22
	and	x9, x9, x22
	cmp	x8, #0
	ccmp	x9, #0, #0, ne
	b.ne	LBB0_4
; %bb.3:
Lloh9:
	adrp	x8, _AXP2XX_GPIO_FUNC_INPUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AXP2XX_GPIO_FUNC_INPUT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	orr	w2, w8, w2
	str	w2, [sp, #12]
LBB0_4:
	ldr	x8, [x19, #8]
	ldr	w1, [x8, x21, lsl #2]
	mov	x0, x20
	bl	_axp2xx_write
	mov	x23, x0
LBB0_5:
	mov	x0, x19
	bl	_AXP_UNLOCK
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w23, [x8]
LBB0_7:
	mov	x0, x23
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AXP2XX_GPIO_FUNC_MASK,4,2      ; @AXP2XX_GPIO_FUNC_MASK
	.comm	_GPIO_PIN_INPUT,8,3             ; @GPIO_PIN_INPUT
	.comm	_GPIO_PIN_OUTPUT,8,3            ; @GPIO_PIN_OUTPUT
	.comm	_AXP2XX_GPIO_FUNC_INPUT,4,2     ; @AXP2XX_GPIO_FUNC_INPUT
	.no_dead_strip	_axp2xx_gpio_pin_setflags
.subsections_via_symbols
