	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adc5_do_conversion
_adc5_do_conversion:                    ## @adc5_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_mutex_lock
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_adc5_configure
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_8
LBB0_2:
	cmpq	$0, 8(%r15)
	je	LBB0_5
LBB0_3:
	movq	%r15, %rdi
	callq	_adc5_poll_wait_eoc
	testl	%eax, %eax
	jns	LBB0_7
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_8
LBB0_5:
	leaq	4(%r15), %rdi
	movq	_ADC5_CONV_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_6
LBB0_7:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_adc5_read_voltage_data
	movl	%eax, %ebx
LBB0_8:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_debug
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ADC configure failed with %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"EOC bit not set\n"

	.comm	_ADC5_CONV_TIMEOUT,4,2          ## @ADC5_CONV_TIMEOUT
L_.str.2:                               ## @.str.2
	.asciz	"Did not get completion timeout.\n"

	.no_dead_strip	_adc5_do_conversion
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adc5_do_conversion
_adc5_do_conversion:                    ; @adc5_do_conversion
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x3
	mov	x21, x1
	mov	x19, x0
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x21
	bl	_adc5_configure
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	str	x21, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_7
LBB0_2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
LBB0_3:
	mov	x0, x19
	bl	_adc5_poll_wait_eoc
	tbz	w0, #31, LBB0_6
; %bb.4:
	mov	x21, x0
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_7
LBB0_5:
	add	x0, x19, #4
Lloh4:
	adrp	x8, _ADC5_CONV_TIMEOUT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ADC5_CONV_TIMEOUT@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_8
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_adc5_read_voltage_data
	mov	x21, x0
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_8:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_debug
	b	LBB0_3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ADC configure failed with %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"EOC bit not set\n"

	.comm	_ADC5_CONV_TIMEOUT,4,2          ; @ADC5_CONV_TIMEOUT
l_.str.2:                               ; @.str.2
	.asciz	"Did not get completion timeout.\n"

	.no_dead_strip	_adc5_do_conversion
.subsections_via_symbols
