	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function moxtet_gpio_get_value
_moxtet_gpio_get_value:                 ## @moxtet_gpio_get_value
	.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, %r14d
	callq	_gpiochip_get_data
	movq	%rax, %rbx
	movq	8(%rax), %rax
	movl	(%rax), %r15d
	movl	%r14d, %edi
	callq	_BIT
	testl	%r15d, %eax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	callq	_moxtet_device_read
	movl	%eax, %ebx
	testl	%ebx, %ebx
	js	LBB0_7
LBB0_6:
	movl	%r14d, %edi
	callq	_BIT
	xorl	%ecx, %ecx
	testl	%ebx, %eax
	setne	%cl
	movl	%ecx, %ebx
	jmp	LBB0_7
LBB0_2:
	movq	8(%rbx), %rax
	movl	4(%rax), %r15d
	movl	%r14d, %edi
	callq	_BIT
	testl	%r15d, %eax
	je	LBB0_8
## %bb.3:
	movl	(%rbx), %edi
	callq	_moxtet_device_written
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_7
## %bb.4:
	movq	_MOXTET_GPIO_INPUTS@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	testl	%ebx, %ebx
	jns	LBB0_6
	jmp	LBB0_7
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MOXTET_GPIO_INPUTS,4,2         ## @MOXTET_GPIO_INPUTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_moxtet_gpio_get_value
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function moxtet_gpio_get_value
_moxtet_gpio_get_value:                 ; @moxtet_gpio_get_value
	.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	x19, x1
	bl	_gpiochip_get_data
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	w21, [x8]
	mov	x0, x19
	bl	_BIT
	tst	w0, w21
	b.eq	LBB0_3
; %bb.1:
	ldr	w0, [x20]
	bl	_moxtet_device_read
	mov	x20, x0
	tbnz	w20, #31, LBB0_7
LBB0_2:
	mov	x0, x19
	bl	_BIT
	tst	w0, w20
	cset	w20, ne
	b	LBB0_7
LBB0_3:
	ldr	x8, [x20, #8]
	ldr	w21, [x8, #4]
	mov	x0, x19
	bl	_BIT
	tst	w0, w21
	b.eq	LBB0_6
; %bb.4:
	ldr	w0, [x20]
	bl	_moxtet_device_written
	mov	x20, x0
	tbnz	w0, #31, LBB0_7
; %bb.5:
Lloh0:
	adrp	x8, _MOXTET_GPIO_INPUTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MOXTET_GPIO_INPUTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	lsl	w20, w20, w8
	tbz	w20, #31, LBB0_2
	b	LBB0_7
LBB0_6:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_7:
	mov	x0, x20
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MOXTET_GPIO_INPUTS,4,2         ; @MOXTET_GPIO_INPUTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_moxtet_gpio_get_value
.subsections_via_symbols
