	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun4i_gpadc_read
_sun4i_gpadc_read:                      ## @sun4i_gpadc_read
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_iio_priv
	movq	%rax, %r13
	leaq	12(%rax), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %ebx
	movl	%r12d, %edx
	callq	_sun4i_prepare_for_irq
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	%ebx, %edi
	callq	_enable_irq
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	leaq	16(%r13), %rbx
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	xorl	%eax, %eax
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%ebx, (%r13)
	setne	%al
	movl	4(%r13,%rax,4), %eax
	movl	%eax, (%r12)
	movl	(%r14), %edi
	callq	_pm_runtime_mark_last_busy
	xorl	%r12d, %r12d
	jmp	LBB0_4
LBB0_2:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_4:
	movl	(%r14), %edi
	callq	_pm_runtime_put_autosuspend
	movl	%ebx, %edi
	callq	_disable_irq
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_sun4i_gpadc_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun4i_gpadc_read
_sun4i_gpadc_read:                      ; @sun4i_gpadc_read
	.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, x3
	mov	x22, x2
	mov	x24, x1
	mov	x21, x0
	bl	_iio_priv
	mov	x23, x0
	add	x20, x0, #12
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x21
	mov	x1, x24
	mov	x2, x19
	bl	_sun4i_prepare_for_irq
	mov	x24, x0
	cbnz	w0, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_enable_irq
	add	x24, x23, #16
	mov	w0, #1000
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x24
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_3
; %bb.2:
	ldr	w8, [x23]
	cmp	w8, w19
	mov	w8, #8
	mov	w9, #4
	csel	x8, x9, x8, eq
	ldr	w8, [x23, x8]
	str	w8, [x22]
	ldr	w0, [x21]
	bl	_pm_runtime_mark_last_busy
	mov	w24, #0
	b	LBB0_4
LBB0_3:
Lloh0:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_4:
	ldr	w0, [x21]
	bl	_pm_runtime_put_autosuspend
	mov	x0, x19
	bl	_disable_irq
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x24
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_sun4i_gpadc_read
.subsections_via_symbols
