	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iadc_do_conversion
_iadc_do_conversion:                    ## @iadc_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	%rdx, %r14
	movq	%rdi, %r15
	callq	_iadc_configure
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	_IADC_DEF_AVG_SAMPLES@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	movq	_IADC_CONV_TIME_MIN_US@GOTPCREL(%rip), %r12
	imull	(%r12), %eax
	addl	%eax, %eax
	cmpq	$0, 8(%r15)
	je	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	movl	%eax, %esi
	jmp	LBB0_7
LBB0_1:
	movl	%eax, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_iadc_set_state
	jmp	LBB0_11
LBB0_4:
	leaq	4(%r15), %rbx
	movl	%eax, %edi
	callq	_usecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	(%r12), %esi
	movq	%r15, %rdi
LBB0_7:
	callq	_iadc_poll_wait_eoc
	movl	%eax, %ebx
	testl	%ebx, %ebx
	jne	LBB0_10
LBB0_9:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_iadc_read_result
	movl	%eax, %ebx
LBB0_10:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_iadc_set_state
	testl	%ebx, %ebx
	jns	LBB0_12
LBB0_11:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	testl	%ebx, %ebx
	jne	LBB0_10
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_IADC_DEF_AVG_SAMPLES,4,2       ## @IADC_DEF_AVG_SAMPLES
	.comm	_IADC_CONV_TIME_MIN_US,4,2      ## @IADC_CONV_TIME_MIN_US
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"conversion failed\n"

	.no_dead_strip	_iadc_do_conversion
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iadc_do_conversion
_iadc_do_conversion:                    ; @iadc_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, x2
	mov	x19, x0
	bl	_iadc_configure
	tbnz	w0, #31, LBB0_7
; %bb.1:
Lloh0:
	adrp	x8, _IADC_DEF_AVG_SAMPLES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IADC_DEF_AVG_SAMPLES@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_BIT
Lloh3:
	adrp	x22, _IADC_CONV_TIME_MIN_US@GOTPAGE
Lloh4:
	ldr	x22, [x22, _IADC_CONV_TIME_MIN_US@GOTPAGEOFF]
	ldr	w8, [x22]
	mul	w8, w0, w8
	lsl	w1, w8, #1
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_4
; %bb.2:
	add	x21, x19, #4
	mov	x0, x1
	bl	_usecs_to_jiffies
	mov	x1, x0
	mov	x0, x21
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_10
; %bb.3:
	ldr	w1, [x22]
LBB0_4:
	mov	x0, x19
	bl	_iadc_poll_wait_eoc
	mov	x21, x0
	cbnz	w21, LBB0_6
LBB0_5:
	mov	x0, x19
	mov	x1, x20
	bl	_iadc_read_result
	mov	x21, x0
LBB0_6:
	mov	x0, x19
	mov	w1, #0
	bl	_iadc_set_state
	tbz	w21, #31, LBB0_9
	b	LBB0_8
LBB0_7:
	mov	x21, x0
	mov	x0, x19
	mov	w1, #0
	bl	_iadc_set_state
LBB0_8:
	ldr	w0, [x19]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_9:
	mov	x0, x21
	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
LBB0_10:
Lloh7:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w21, w8
	cbnz	w21, LBB0_6
	b	LBB0_5
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_IADC_DEF_AVG_SAMPLES,4,2       ; @IADC_DEF_AVG_SAMPLES
	.comm	_IADC_CONV_TIME_MIN_US,4,2      ; @IADC_CONV_TIME_MIN_US
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"conversion failed\n"

	.no_dead_strip	_iadc_do_conversion
.subsections_via_symbols
