	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mc13783_adc_do_conversion      ## -- Begin function mc13783_adc_do_conversion
	.p2align	4, 0x90
_mc13783_adc_do_conversion:             ## @mc13783_adc_do_conversion
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %ebx
	movl	%esi, %r12d
	movq	%rdi, %r15
	callq	_mutex_lock
	movq	_MC13783_ADC0_ADINC1@GOTPCREL(%rip), %rcx
	movq	_MC13783_ADC0_ADINC2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MC13783_ADC1_ADEN@GOTPCREL(%rip), %rsi
	movq	_MC13783_ADC1_ADTRIGIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rsi), %eax
	movq	_MC13783_ADC1_ASC@GOTPCREL(%rip), %rsi
	orl	(%rsi), %eax
	xorl	%esi, %esi
	cmpl	$8, %ebx
	jb	LBB0_2
## %bb.1:
	movq	_MC13783_ADC1_ADSEL@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
LBB0_2:
	orl	%esi, %eax
	orl	(%rcx), %edx
	cmpl	$130, %r12d
	je	LBB0_6
## %bb.3:
	cmpl	$129, %r12d
	je	LBB0_8
## %bb.4:
	cmpl	$128, %r12d
	jne	LBB0_7
## %bb.5:
	movq	_MC13783_ADC0_ADREFEN@GOTPCREL(%rip), %rcx
	movq	_MC13783_ADC0_ADREFMODE@GOTPCREL(%rip), %rsi
	movq	_MC13783_ADC0_TSMOD0@GOTPCREL(%rip), %rdi
	movq	_MC13783_ADC0_TSMOD1@GOTPCREL(%rip), %rbx
	orl	(%rcx), %edx
	orl	(%rsi), %edx
	orl	(%rdi), %edx
	orl	(%rbx), %edx
LBB0_6:
	movq	_MC13783_ADC1_CHAN1_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$4, %ebx
	shll	%cl, %ebx
	orl	%eax, %ebx
	jmp	LBB0_9
LBB0_8:
	andl	$7, %ebx
	movq	_MC13783_ADC1_CHAN0_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	orl	%eax, %ebx
	movq	_MC13783_ADC1_RAND@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
LBB0_9:
	movq	_MC13783_REG_ADC_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_mc13783_reg_write
	movq	_MC13783_REG_ADC_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_mc13783_reg_write
	leaq	16(%r15), %rdi
	callq	_wait_for_completion_interruptible
	movq	_MC13783_REG_ADC_2@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_mc13783_reg_read
	movl	(%rbx), %esi
	leaq	4(%r14), %rdx
	movq	%r15, %rdi
	callq	_mc13783_reg_read
	movl	(%rbx), %esi
	leaq	8(%r14), %rdx
	movq	%r15, %rdi
	callq	_mc13783_reg_read
	movl	(%rbx), %esi
	addq	$12, %r14
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_mc13783_reg_read
	cmpq	$0, 8(%r15)
	je	LBB0_11
## %bb.10:
	movq	%r15, %rdi
	callq	_mc13783_adc_set_ts_irq_mode
LBB0_11:
	movq	%r15, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MC13783_ADC0_ADINC1,4,2        ## @MC13783_ADC0_ADINC1
	.comm	_MC13783_ADC0_ADINC2,4,2        ## @MC13783_ADC0_ADINC2
	.comm	_MC13783_ADC1_ADEN,4,2          ## @MC13783_ADC1_ADEN
	.comm	_MC13783_ADC1_ADTRIGIGN,4,2     ## @MC13783_ADC1_ADTRIGIGN
	.comm	_MC13783_ADC1_ASC,4,2           ## @MC13783_ADC1_ASC
	.comm	_MC13783_ADC1_ADSEL,4,2         ## @MC13783_ADC1_ADSEL
	.comm	_MC13783_ADC0_ADREFEN,4,2       ## @MC13783_ADC0_ADREFEN
	.comm	_MC13783_ADC0_ADREFMODE,4,2     ## @MC13783_ADC0_ADREFMODE
	.comm	_MC13783_ADC0_TSMOD0,4,2        ## @MC13783_ADC0_TSMOD0
	.comm	_MC13783_ADC0_TSMOD1,4,2        ## @MC13783_ADC0_TSMOD1
	.comm	_MC13783_ADC1_CHAN1_SHIFT,4,2   ## @MC13783_ADC1_CHAN1_SHIFT
	.comm	_MC13783_ADC1_CHAN0_SHIFT,4,2   ## @MC13783_ADC1_CHAN0_SHIFT
	.comm	_MC13783_ADC1_RAND,4,2          ## @MC13783_ADC1_RAND
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MC13783_REG_ADC_0,4,2          ## @MC13783_REG_ADC_0
	.comm	_MC13783_REG_ADC_1,4,2          ## @MC13783_REG_ADC_1
	.comm	_MC13783_REG_ADC_2,4,2          ## @MC13783_REG_ADC_2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mc13783_adc_do_conversion      ; -- Begin function mc13783_adc_do_conversion
	.p2align	2
_mc13783_adc_do_conversion:             ; @mc13783_adc_do_conversion
	.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	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_mutex_lock
Lloh0:
	adrp	x8, _MC13783_ADC0_ADINC1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MC13783_ADC0_ADINC1@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _MC13783_ADC0_ADINC2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MC13783_ADC0_ADINC2@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh6:
	adrp	x8, _MC13783_ADC1_ADEN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MC13783_ADC1_ADEN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _MC13783_ADC1_ADTRIGIGN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MC13783_ADC1_ADTRIGIGN@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh12:
	adrp	x9, _MC13783_ADC1_ASC@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MC13783_ADC1_ASC@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _MC13783_ADC1_ADSEL@GOTPAGE
Lloh16:
	ldr	x10, [x10, _MC13783_ADC1_ADSEL@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh17:
	ldr	w9, [x10]
	cmp	w21, #7
	csel	w9, w9, wzr, hi
	orr	w8, w8, w9
	cmp	w22, #130
	b.eq	LBB0_4
; %bb.1:
	cmp	w22, #129
	b.eq	LBB0_5
; %bb.2:
	cmp	w22, #128
	b.ne	LBB0_9
; %bb.3:
Lloh18:
	adrp	x9, _MC13783_ADC0_ADREFEN@GOTPAGE
Lloh19:
	ldr	x9, [x9, _MC13783_ADC0_ADREFEN@GOTPAGEOFF]
Lloh20:
	adrp	x10, _MC13783_ADC0_ADREFMODE@GOTPAGE
Lloh21:
	ldr	x10, [x10, _MC13783_ADC0_ADREFMODE@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
Lloh23:
	ldr	w10, [x10]
Lloh24:
	adrp	x11, _MC13783_ADC0_TSMOD0@GOTPAGE
Lloh25:
	ldr	x11, [x11, _MC13783_ADC0_TSMOD0@GOTPAGEOFF]
Lloh26:
	adrp	x12, _MC13783_ADC0_TSMOD1@GOTPAGE
Lloh27:
	ldr	x12, [x12, _MC13783_ADC0_TSMOD1@GOTPAGEOFF]
Lloh28:
	ldr	w11, [x11]
Lloh29:
	ldr	w12, [x12]
	orr	w9, w9, w2
	orr	w9, w9, w10
	orr	w9, w9, w11
	orr	w2, w9, w12
LBB0_4:
Lloh30:
	adrp	x9, _MC13783_ADC1_CHAN1_SHIFT@GOTPAGE
Lloh31:
	ldr	x9, [x9, _MC13783_ADC1_CHAN1_SHIFT@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	mov	w10, #4
	lsl	w9, w10, w9
	orr	w21, w9, w8
	b	LBB0_6
LBB0_5:
	and	w9, w21, #0x7
Lloh33:
	adrp	x10, _MC13783_ADC1_CHAN0_SHIFT@GOTPAGE
Lloh34:
	ldr	x10, [x10, _MC13783_ADC1_CHAN0_SHIFT@GOTPAGEOFF]
Lloh35:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
Lloh36:
	adrp	x9, _MC13783_ADC1_RAND@GOTPAGE
Lloh37:
	ldr	x9, [x9, _MC13783_ADC1_RAND@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w21, w8, w9
LBB0_6:
Lloh39:
	adrp	x8, _MC13783_REG_ADC_0@GOTPAGE
Lloh40:
	ldr	x8, [x8, _MC13783_REG_ADC_0@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mc13783_reg_write
Lloh42:
	adrp	x8, _MC13783_REG_ADC_1@GOTPAGE
Lloh43:
	ldr	x8, [x8, _MC13783_REG_ADC_1@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_mc13783_reg_write
	add	x0, x19, #16
	bl	_wait_for_completion_interruptible
Lloh45:
	adrp	x21, _MC13783_REG_ADC_2@GOTPAGE
Lloh46:
	ldr	x21, [x21, _MC13783_REG_ADC_2@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x20
	bl	_mc13783_reg_read
	ldr	w1, [x21]
	add	x2, x20, #4
	mov	x0, x19
	bl	_mc13783_reg_read
	ldr	w1, [x21]
	add	x2, x20, #8
	mov	x0, x19
	bl	_mc13783_reg_read
	ldr	w1, [x21]
	add	x2, x20, #12
	mov	x0, x19
	bl	_mc13783_reg_read
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_mc13783_adc_set_ts_irq_mode
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_10
LBB0_9:
Lloh47:
	adrp	x8, _EINVAL@GOTPAGE
Lloh48:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh49:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh28
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_MC13783_ADC0_ADINC1,4,2        ; @MC13783_ADC0_ADINC1
	.comm	_MC13783_ADC0_ADINC2,4,2        ; @MC13783_ADC0_ADINC2
	.comm	_MC13783_ADC1_ADEN,4,2          ; @MC13783_ADC1_ADEN
	.comm	_MC13783_ADC1_ADTRIGIGN,4,2     ; @MC13783_ADC1_ADTRIGIGN
	.comm	_MC13783_ADC1_ASC,4,2           ; @MC13783_ADC1_ASC
	.comm	_MC13783_ADC1_ADSEL,4,2         ; @MC13783_ADC1_ADSEL
	.comm	_MC13783_ADC0_ADREFEN,4,2       ; @MC13783_ADC0_ADREFEN
	.comm	_MC13783_ADC0_ADREFMODE,4,2     ; @MC13783_ADC0_ADREFMODE
	.comm	_MC13783_ADC0_TSMOD0,4,2        ; @MC13783_ADC0_TSMOD0
	.comm	_MC13783_ADC0_TSMOD1,4,2        ; @MC13783_ADC0_TSMOD1
	.comm	_MC13783_ADC1_CHAN1_SHIFT,4,2   ; @MC13783_ADC1_CHAN1_SHIFT
	.comm	_MC13783_ADC1_CHAN0_SHIFT,4,2   ; @MC13783_ADC1_CHAN0_SHIFT
	.comm	_MC13783_ADC1_RAND,4,2          ; @MC13783_ADC1_RAND
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MC13783_REG_ADC_0,4,2          ; @MC13783_REG_ADC_0
	.comm	_MC13783_REG_ADC_1,4,2          ; @MC13783_REG_ADC_1
	.comm	_MC13783_REG_ADC_2,4,2          ; @MC13783_REG_ADC_2
.subsections_via_symbols
