	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tps6507x_adc_conversion
_tps6507x_adc_conversion:               ## @tps6507x_adc_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	_TPS6507X_REG_TSCMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	callq	_tps6507x_write_u8
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %rbx
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_10
LBB0_2:
	movq	_TPS6507X_REG_ADCONFIG@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_TPS6507X_ADCONFIG_CONVERT_TS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_tps6507x_write_u8
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rax, %rbx
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_10
LBB0_4:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	leaq	-52(%rbp), %r13
	movq	_TPS6507X_ADCONFIG_START_CONVERSION@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r12, %rdi
	movq	%r13, %rdx
	callq	_tps6507x_read_u8
	testq	%rax, %rax
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r14), %eax
	testl	%eax, -52(%rbp)
	jne	LBB0_5
## %bb.7:
	movq	_TPS6507X_REG_ADRESULT_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_tps6507x_read_u8
	testq	%rax, %rax
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	je	LBB0_12
## %bb.8:
	movq	%rax, %rbx
	movl	(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_10
LBB0_9:
	movq	%rax, %rbx
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_10:
	callq	_dev_err
LBB0_11:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_TPS6507X_REG_ADRESULT_2_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-44(%rbp), %eax
	shll	$8, %eax
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	%eax, (%r15)
	movq	_TPS6507X_REG_ADRESULT_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_tps6507x_read_u8
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	%rax, %rbx
	movl	(%r12), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_10
LBB0_14:
	movl	(%r15), %ecx
	orl	-44(%rbp), %ecx
	movl	%ecx, (%r15)
	movl	(%r12), %edi
	leaq	L_.str.5(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_dbg
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_TPS6507X_REG_TSCMODE,4,2       ## @TPS6507X_REG_TSCMODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TSC mode read failed\n"

	.comm	_TPS6507X_REG_ADCONFIG,4,2      ## @TPS6507X_REG_ADCONFIG
	.comm	_TPS6507X_ADCONFIG_CONVERT_TS,4,2 ## @TPS6507X_ADCONFIG_CONVERT_TS
L_.str.1:                               ## @.str.1
	.asciz	"ADC config write failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"ADC config read failed\n"

	.comm	_TPS6507X_ADCONFIG_START_CONVERSION,4,2 ## @TPS6507X_ADCONFIG_START_CONVERSION
	.comm	_TPS6507X_REG_ADRESULT_2,4,2    ## @TPS6507X_REG_ADRESULT_2
L_.str.3:                               ## @.str.3
	.asciz	"ADC result 2 read failed\n"

	.comm	_TPS6507X_REG_ADRESULT_2_MASK,4,2 ## @TPS6507X_REG_ADRESULT_2_MASK
	.comm	_TPS6507X_REG_ADRESULT_1,4,2    ## @TPS6507X_REG_ADRESULT_1
L_.str.4:                               ## @.str.4
	.asciz	"ADC result 1 read failed\n"

L_.str.5:                               ## @.str.5
	.asciz	"TSC channel %d = 0x%X\n"

	.no_dead_strip	_tps6507x_adc_conversion
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tps6507x_adc_conversion
_tps6507x_adc_conversion:               ; @tps6507x_adc_conversion
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _TPS6507X_REG_TSCMODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TPS6507X_REG_TSCMODE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_tps6507x_write_u8
	cbz	x0, LBB0_2
; %bb.1:
	mov	x22, x0
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
LBB0_2:
Lloh5:
	adrp	x23, _TPS6507X_REG_ADCONFIG@GOTPAGE
Lloh6:
	ldr	x23, [x23, _TPS6507X_REG_ADCONFIG@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh7:
	adrp	x8, _TPS6507X_ADCONFIG_CONVERT_TS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TPS6507X_ADCONFIG_CONVERT_TS@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_tps6507x_write_u8
	cbz	x0, LBB0_4
; %bb.3:
	mov	x22, x0
	ldr	w0, [x19]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_4:
Lloh12:
	adrp	x24, _TPS6507X_ADCONFIG_START_CONVERSION@GOTPAGE
Lloh13:
	ldr	x24, [x24, _TPS6507X_ADCONFIG_START_CONVERSION@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	add	x2, sp, #12
	mov	x0, x19
	bl	_tps6507x_read_u8
	cbnz	x0, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x24]
	tst	w9, w8
	b.ne	LBB0_5
; %bb.7:
Lloh14:
	adrp	x8, _TPS6507X_REG_ADRESULT_2@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TPS6507X_REG_ADRESULT_2@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_tps6507x_read_u8
	cbz	x0, LBB0_12
; %bb.8:
	mov	x22, x0
	ldr	w0, [x19]
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_9:
	mov	x22, x0
	ldr	w0, [x19]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_10:
	bl	_dev_err
LBB0_11:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_12:
	ldr	w8, [sp, #8]
Lloh21:
	adrp	x9, _TPS6507X_REG_ADRESULT_2_MASK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _TPS6507X_REG_ADRESULT_2_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	and	w8, w9, w8
	lsl	w8, w8, #8
	str	w8, [x21]
Lloh24:
	adrp	x8, _TPS6507X_REG_ADRESULT_1@GOTPAGE
Lloh25:
	ldr	x8, [x8, _TPS6507X_REG_ADRESULT_1@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_tps6507x_read_u8
	mov	x22, x0
	cbz	x0, LBB0_14
; %bb.13:
	ldr	w0, [x19]
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_10
LBB0_14:
	ldr	w8, [sp, #8]
	ldr	w9, [x21]
	orr	w3, w9, w8
	str	w3, [x21]
	ldr	w0, [x19]
Lloh29:
	adrp	x1, l_.str.5@PAGE
Lloh30:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_TPS6507X_REG_TSCMODE,4,2       ; @TPS6507X_REG_TSCMODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TSC mode read failed\n"

	.comm	_TPS6507X_REG_ADCONFIG,4,2      ; @TPS6507X_REG_ADCONFIG
	.comm	_TPS6507X_ADCONFIG_CONVERT_TS,4,2 ; @TPS6507X_ADCONFIG_CONVERT_TS
l_.str.1:                               ; @.str.1
	.asciz	"ADC config write failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"ADC config read failed\n"

	.comm	_TPS6507X_ADCONFIG_START_CONVERSION,4,2 ; @TPS6507X_ADCONFIG_START_CONVERSION
	.comm	_TPS6507X_REG_ADRESULT_2,4,2    ; @TPS6507X_REG_ADRESULT_2
l_.str.3:                               ; @.str.3
	.asciz	"ADC result 2 read failed\n"

	.comm	_TPS6507X_REG_ADRESULT_2_MASK,4,2 ; @TPS6507X_REG_ADRESULT_2_MASK
	.comm	_TPS6507X_REG_ADRESULT_1,4,2    ; @TPS6507X_REG_ADRESULT_1
l_.str.4:                               ; @.str.4
	.asciz	"ADC result 1 read failed\n"

l_.str.5:                               ; @.str.5
	.asciz	"TSC channel %d = 0x%X\n"

	.no_dead_strip	_tps6507x_adc_conversion
.subsections_via_symbols
