	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt1310_gpio_pin_getflags
_rt1310_gpio_pin_getflags:              ## @rt1310_gpio_pin_getflags
	.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, %r14
	movq	%rsi, %rbx
	callq	_device_get_softc
	movq	%rax, %r12
	movq	_RT_GPIO_NPINS@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jge	LBB0_2
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_13
LBB0_2:
	movq	%rbx, %rdi
	callq	_rt1310_gpio_get_pinmap
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	_GPIO_PIN_INPUT@GOTPCREL(%rip), %rdx
	movq	_GPIO_PIN_OUTPUT@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	orq	(%rdx), %rcx
	movq	%rax, %rdx
	notq	%rdx
	testq	%rdx, %rcx
	jne	LBB0_12
## %bb.3:
	movl	8(%r15), %eax
	cmpl	$128, %eax
	je	LBB0_7
## %bb.4:
	cmpl	$129, %eax
	jne	LBB0_8
## %bb.5:
	movq	_RT_GPIO_OFF_PADIR@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_7:
	movq	_RT_GPIO_OFF_PBDIR@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt1310_gpio_read_4
	movq	%rax, %r12
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_RT_GPIO_PIN_BIT
	movl	$1, %edx
	movl	%eax, %ecx
	shll	%cl, %edx
	andl	%edx, %r12d
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str(%rip), %rdi
	callq	_panic
                                        ## implicit-def: $r12d
LBB0_9:
	testl	%r12d, %r12d
	movq	_GPIO_PIN_INPUT@GOTPCREL(%rip), %rax
	jne	LBB0_11
## %bb.10:
	movq	%rax, %r13
LBB0_11:
	movq	(%r13), %rax
LBB0_12:
	movq	%rax, (%r14)
	xorl	%eax, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RT_GPIO_NPINS,8,3              ## @RT_GPIO_NPINS
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GPIO_PIN_INPUT,8,3             ## @GPIO_PIN_INPUT
	.comm	_GPIO_PIN_OUTPUT,8,3            ## @GPIO_PIN_OUTPUT
	.comm	_RT_GPIO_OFF_PADIR,4,2          ## @RT_GPIO_OFF_PADIR
	.comm	_RT_GPIO_OFF_PBDIR,4,2          ## @RT_GPIO_OFF_PBDIR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown GPIO port"

	.no_dead_strip	_rt1310_gpio_pin_getflags
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt1310_gpio_pin_getflags
_rt1310_gpio_pin_getflags:              ; @rt1310_gpio_pin_getflags
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x2
	mov	x20, x1
	bl	_device_get_softc
Lloh0:
	adrp	x8, _RT_GPIO_NPINS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RT_GPIO_NPINS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ge	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_12
LBB0_2:
	mov	x22, x0
	mov	x0, x20
	bl	_rt1310_gpio_get_pinmap
	ldr	x8, [x0]
Lloh6:
	adrp	x23, _GPIO_PIN_INPUT@GOTPAGE
Lloh7:
	ldr	x23, [x23, _GPIO_PIN_INPUT@GOTPAGEOFF]
	ldr	x9, [x23]
Lloh8:
	adrp	x24, _GPIO_PIN_OUTPUT@GOTPAGE
Lloh9:
	ldr	x24, [x24, _GPIO_PIN_OUTPUT@GOTPAGEOFF]
	ldr	x10, [x24]
	orr	x9, x10, x9
	bics	xzr, x9, x8
	b.ne	LBB0_6
; %bb.3:
	mov	x21, x0
	ldr	w8, [x0, #8]
	cmp	w8, #128
	b.eq	LBB0_7
; %bb.4:
	cmp	w8, #129
	b.ne	LBB0_9
; %bb.5:
Lloh10:
	adrp	x8, _RT_GPIO_OFF_PADIR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RT_GPIO_OFF_PADIR@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	mov	w0, #0
	b	LBB0_11
LBB0_7:
Lloh12:
	adrp	x8, _RT_GPIO_OFF_PBDIR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RT_GPIO_OFF_PBDIR@GOTPAGEOFF]
LBB0_8:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_rt1310_gpio_read_4
	mov	x22, x0
	mov	x0, x21
	mov	x1, x20
	bl	_RT_GPIO_PIN_BIT
	mov	w8, #1
	lsl	w8, w8, w0
	and	w8, w8, w22
	b	LBB0_10
LBB0_9:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_panic
                                        ; implicit-def: $w8
LBB0_10:
	mov	w0, #0
	cmp	w8, #0
	csel	x8, x23, x24, eq
	ldr	x8, [x8]
LBB0_11:
	str	x8, [x19]
LBB0_12:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_RT_GPIO_NPINS,8,3              ; @RT_GPIO_NPINS
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GPIO_PIN_INPUT,8,3             ; @GPIO_PIN_INPUT
	.comm	_GPIO_PIN_OUTPUT,8,3            ; @GPIO_PIN_OUTPUT
	.comm	_RT_GPIO_OFF_PADIR,4,2          ; @RT_GPIO_OFF_PADIR
	.comm	_RT_GPIO_OFF_PBDIR,4,2          ; @RT_GPIO_OFF_PBDIR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown GPIO port"

	.no_dead_strip	_rt1310_gpio_pin_getflags
.subsections_via_symbols
