	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function find_free_channel
_find_free_channel:                     ## @find_free_channel
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_INTEL_MSIC_ADC1CNTL1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	-44(%rbp), %rsi
	callq	_intel_msic_reg_read
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movq	_MSIC_ADC_ENBL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_2
## %bb.3:
	movq	_ADC_CHANLS_MAX@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	cmpl	$0, (%rax)
	movl	$0, %ebx
	jle	LBB0_10
## %bb.4:
	xorl	%ebx, %ebx
	movq	_ADC_CHNL_START_ADDR@GOTPCREL(%rip), %r13
	leaq	-44(%rbp), %r14
	movq	_MSIC_STOPBIT_MASK@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	addq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_intel_msic_reg_read
	testl	%eax, %eax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r12), %eax
	testl	%eax, -44(%rbp)
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	movq	_ADC_CHANLS_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	LBB0_5
## %bb.9:
	xorl	%ebx, %ebx
LBB0_10:
	movq	_ADC_LOOP_MAX@GOTPCREL(%rip), %rax
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	subl	(%rcx), %r15d
	cmpl	(%rax), %ebx
	cmovlel	%ebx, %r15d
	jmp	LBB0_11
LBB0_2:
	xorl	%r15d, %r15d
	jmp	LBB0_11
LBB0_6:
	movl	%eax, %r15d
LBB0_11:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INTEL_MSIC_ADC1CNTL1,8,3       ## @INTEL_MSIC_ADC1CNTL1
	.comm	_MSIC_ADC_ENBL,4,2              ## @MSIC_ADC_ENBL
	.comm	_ADC_CHANLS_MAX,4,2             ## @ADC_CHANLS_MAX
	.comm	_ADC_CHNL_START_ADDR,8,3        ## @ADC_CHNL_START_ADDR
	.comm	_MSIC_STOPBIT_MASK,4,2          ## @MSIC_STOPBIT_MASK
	.comm	_ADC_LOOP_MAX,4,2               ## @ADC_LOOP_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_find_free_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function find_free_channel
_find_free_channel:                     ; @find_free_channel
	.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
Lloh0:
	adrp	x8, _INTEL_MSIC_ADC1CNTL1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INTEL_MSIC_ADC1CNTL1@GOTPAGEOFF]
Lloh2:
	ldr	x0, [x8]
	add	x1, sp, #12
	bl	_intel_msic_reg_read
	cbnz	w0, LBB0_10
; %bb.1:
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _MSIC_ADC_ENBL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MSIC_ADC_ENBL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.2:
Lloh6:
	adrp	x20, _ADC_CHANLS_MAX@GOTPAGE
Lloh7:
	ldr	x20, [x20, _ADC_CHANLS_MAX@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	mov	x19, #0
Lloh8:
	adrp	x21, _ADC_CHNL_START_ADDR@GOTPAGE
Lloh9:
	ldr	x21, [x21, _ADC_CHNL_START_ADDR@GOTPAGEOFF]
Lloh10:
	adrp	x22, _MSIC_STOPBIT_MASK@GOTPAGE
Lloh11:
	ldr	x22, [x22, _MSIC_STOPBIT_MASK@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	add	x0, x19, x8
	add	x1, sp, #12
	bl	_intel_msic_reg_read
	cbnz	w0, LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x19, x19, #1
	ldrsw	x8, [x20]
	cmp	x19, x8
	b.lt	LBB0_4
LBB0_7:
	mov	w19, #0
LBB0_8:
Lloh12:
	adrp	x8, _ADC_LOOP_MAX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ADC_LOOP_MAX@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _EINVAL@GOTPAGE
Lloh16:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w19, w8
	csneg	w0, w19, w9, le
	b	LBB0_10
LBB0_9:
	mov	w0, #0
LBB0_10:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_INTEL_MSIC_ADC1CNTL1,8,3       ; @INTEL_MSIC_ADC1CNTL1
	.comm	_MSIC_ADC_ENBL,4,2              ; @MSIC_ADC_ENBL
	.comm	_ADC_CHANLS_MAX,4,2             ; @ADC_CHANLS_MAX
	.comm	_ADC_CHNL_START_ADDR,8,3        ; @ADC_CHNL_START_ADDR
	.comm	_MSIC_STOPBIT_MASK,4,2          ; @MSIC_STOPBIT_MASK
	.comm	_ADC_LOOP_MAX,4,2               ; @ADC_LOOP_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_find_free_channel
.subsections_via_symbols
