	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx23885_gpio_get               ## -- Begin function cx23885_gpio_get
	.p2align	4, 0x90
_cx23885_gpio_get:                      ## @cx23885_gpio_get
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	andl	$7, %ebx
	je	LBB0_2
## %bb.1:
	movq	_GP0_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cx_read
	shrl	$8, %eax
	andl	%eax, %ebx
	jmp	LBB0_9
LBB0_2:
	movq	%rdi, %r14
	movl	%esi, %r15d
	andl	$524280, %r15d                  ## imm = 0x7FFF8
	je	LBB0_7
## %bb.3:
	movq	%r14, %rdi
	callq	_encoder_on_portb
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	callq	_encoder_on_portc
	testq	%rax, %rax
	je	LBB0_6
LBB0_5:
	movl	(%r14), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
LBB0_6:
	movq	_MC417_RWD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cx_read
	movl	%eax, %ebx
	shll	$3, %ebx
	andl	%r15d, %ebx
	jmp	LBB0_9
LBB0_7:
	xorl	%ebx, %ebx
	testl	$16252928, %esi                 ## imm = 0xF80000
	je	LBB0_9
## %bb.8:
	movl	(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_info
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GP0_IO,4,2                     ## @GP0_IO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Reading GPIO moving on encoder ports\n"

	.comm	_MC417_RWD,4,2                  ## @MC417_RWD
L_.str.1:                               ## @.str.1
	.asciz	"%s: Unsupported\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx23885_gpio_get               ; -- Begin function cx23885_gpio_get
	.p2align	2
_cx23885_gpio_get:                      ; @cx23885_gpio_get
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ands	w20, w1, #0x7
	b.eq	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _GP0_IO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GP0_IO@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_cx_read
	and	w0, w20, w0, lsr #8
	b	LBB0_10
LBB0_2:
	mov	x19, x0
	ands	w20, w1, #0x7fff8
	b.eq	LBB0_7
; %bb.3:
	mov	x0, x19
	bl	_encoder_on_portb
	cbnz	x0, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_encoder_on_portc
	cbz	x0, LBB0_6
LBB0_5:
	ldr	w1, [x19]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
LBB0_6:
Lloh5:
	adrp	x8, _MC417_RWD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MC417_RWD@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_cx_read
	and	w0, w20, w0, lsl #3
	b	LBB0_10
LBB0_7:
	tst	w1, #0xf80000
	b.eq	LBB0_9
; %bb.8:
	ldr	w1, [x19]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
LBB0_9:
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GP0_IO,4,2                     ; @GP0_IO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Reading GPIO moving on encoder ports\n"

	.comm	_MC417_RWD,4,2                  ; @MC417_RWD
l_.str.1:                               ; @.str.1
	.asciz	"%s: Unsupported\n"

.subsections_via_symbols
