	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adc12138_init
_adc12138_init:                         ## @adc12138_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	addq	$16, %rdi
	callq	_reinit_completion
	movq	_ADC12138_MODE_AUTO_CAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_adc12138_mode_programming
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movq	%rbx, %rdi
	callq	_adc12138_read_status
	testl	%eax, %eax
	js	LBB0_9
## %bb.2:
	movl	$100, %edi
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_adc12138_wait_eoc
	movq	%rbx, %rdi
	callq	_adc12138_read_status
	movq	_ADC12138_STATUS_CAL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_4:
	movl	(%rbx), %eax
	addl	$-6, %eax
	roll	$30, %eax
	cmpl	$8, %eax
	jae	LBB0_5
## %bb.7:
	movl	$139, %ecx
	btl	%eax, %ecx
	jb	LBB0_8
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_6:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_8:
	cltq
	leaq	l_switch.table.adc12138_init(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_adc12138_mode_programming
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_ADC12138_MODE_AUTO_CAL,4,2     ## @ADC12138_MODE_AUTO_CAL
	.comm	_ADC12138_STATUS_CAL,4,2        ## @ADC12138_STATUS_CAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Auto Cal sequence is still in progress: %#x\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_ADC12138_MODE_ACQUISITION_TIME_6,4,2 ## @ADC12138_MODE_ACQUISITION_TIME_6
	.comm	_ADC12138_MODE_ACQUISITION_TIME_10,4,2 ## @ADC12138_MODE_ACQUISITION_TIME_10
	.comm	_ADC12138_MODE_ACQUISITION_TIME_18,4,2 ## @ADC12138_MODE_ACQUISITION_TIME_18
	.comm	_ADC12138_MODE_ACQUISITION_TIME_34,4,2 ## @ADC12138_MODE_ACQUISITION_TIME_34
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_adc12138_init
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.adc12138_init
l_switch.table.adc12138_init:
	.quad	_ADC12138_MODE_ACQUISITION_TIME_6
	.quad	_ADC12138_MODE_ACQUISITION_TIME_10
	.quad	_ADC12138_MODE_ACQUISITION_TIME_6
	.quad	_ADC12138_MODE_ACQUISITION_TIME_18
	.quad	_ADC12138_MODE_ACQUISITION_TIME_6
	.quad	_ADC12138_MODE_ACQUISITION_TIME_6
	.quad	_ADC12138_MODE_ACQUISITION_TIME_6
	.quad	_ADC12138_MODE_ACQUISITION_TIME_34

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adc12138_init
_adc12138_init:                         ; @adc12138_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	add	x0, x0, #16
	bl	_reinit_completion
Lloh0:
	adrp	x8, _ADC12138_MODE_AUTO_CAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ADC12138_MODE_AUTO_CAL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_adc12138_mode_programming
	cbnz	w0, LBB0_8
; %bb.1:
	mov	x0, x19
	bl	_adc12138_read_status
	tbnz	w0, #31, LBB0_8
; %bb.2:
	mov	w0, #100
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x19
	bl	_adc12138_wait_eoc
	mov	x0, x19
	bl	_adc12138_read_status
Lloh3:
	adrp	x8, _ADC12138_STATUS_CAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ADC12138_STATUS_CAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.3:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
	ldr	w8, [x19]
	sub	w8, w8, #6
	ror	w8, w8, #2
	cmp	w8, #8
	b.hs	LBB0_6
; %bb.5:
	mov	w9, #139
	lsr	w9, w9, w8
	tbnz	w9, #0, LBB0_9
LBB0_6:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_9:
Lloh12:
	adrp	x9, l_switch.table.adc12138_init@PAGE
Lloh13:
	add	x9, x9, l_switch.table.adc12138_init@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_adc12138_mode_programming
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ADC12138_MODE_AUTO_CAL,4,2     ; @ADC12138_MODE_AUTO_CAL
	.comm	_ADC12138_STATUS_CAL,4,2        ; @ADC12138_STATUS_CAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Auto Cal sequence is still in progress: %#x\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_ADC12138_MODE_ACQUISITION_TIME_6,4,2 ; @ADC12138_MODE_ACQUISITION_TIME_6
	.comm	_ADC12138_MODE_ACQUISITION_TIME_10,4,2 ; @ADC12138_MODE_ACQUISITION_TIME_10
	.comm	_ADC12138_MODE_ACQUISITION_TIME_18,4,2 ; @ADC12138_MODE_ACQUISITION_TIME_18
	.comm	_ADC12138_MODE_ACQUISITION_TIME_34,4,2 ; @ADC12138_MODE_ACQUISITION_TIME_34
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_adc12138_init
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.adc12138_init
l_switch.table.adc12138_init:
	.quad	_ADC12138_MODE_ACQUISITION_TIME_6
	.quad	_ADC12138_MODE_ACQUISITION_TIME_10
	.quad	_ADC12138_MODE_ACQUISITION_TIME_6
	.quad	_ADC12138_MODE_ACQUISITION_TIME_18
	.quad	_ADC12138_MODE_ACQUISITION_TIME_6
	.quad	_ADC12138_MODE_ACQUISITION_TIME_6
	.quad	_ADC12138_MODE_ACQUISITION_TIME_6
	.quad	_ADC12138_MODE_ACQUISITION_TIME_34

.subsections_via_symbols
