	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smm665_read_adc
_smm665_read_adc:                       ## @smm665_read_adc
	.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
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	8(%rdi), %r14
	leal	(,%r15,8), %esi
	movq	%r14, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %ebx
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_1
## %bb.2:
	movl	(%r12), %edi
	callq	_udelay
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_i2c_smbus_read_word_swapped
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	%r12d, %ecx
	shrl	$11, %ecx
	andl	$15, %ecx
	cmpl	%r15d, %ecx
	jne	LBB0_5
## %bb.6:
	movq	_SMM665_ADC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%eax, %r12d
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	testl	%ebx, %ebx
	cmovsl	%ebx, %r12d
	jmp	LBB0_7
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_7
LBB0_5:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_7:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unexpected return code %d when setting ADC index"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read ADC value: error %d"

L_.str.2:                               ## @.str.2
	.asciz	"Unexpected RADC: Expected %d got %d"

	.comm	_SMM665_ADC_MASK,4,2            ## @SMM665_ADC_MASK
	.no_dead_strip	_smm665_read_adc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smm665_read_adc
_smm665_read_adc:                       ; @smm665_read_adc
	.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, x1
	mov	x22, x0
	ldr	x19, [x0, #8]
	lsl	w1, w1, #3
	mov	x0, x19
	bl	_i2c_smbus_read_byte_data
Lloh0:
	adrp	x8, _ENXIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_4
; %bb.1:
	ldr	w0, [x22]
	bl	_udelay
	mov	x0, x19
	mov	w1, #0
	bl	_i2c_smbus_read_word_swapped
	mov	x21, x0
	tbnz	w0, #31, LBB0_5
; %bb.2:
	ubfx	w8, w21, #11, #4
	cmp	w8, w20
	b.ne	LBB0_6
; %bb.3:
Lloh3:
	adrp	x8, _SMM665_ADC_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SMM665_ADC_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w21, w8, w21
	b	LBB0_7
LBB0_4:
	mov	x21, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_dbg
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w21, #0
	csneg	w21, w21, w8, lt
	b	LBB0_7
LBB0_5:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_dbg
	b	LBB0_7
LBB0_6:
	str	x8, [sp]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_dbg
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unexpected return code %d when setting ADC index"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read ADC value: error %d"

l_.str.2:                               ; @.str.2
	.asciz	"Unexpected RADC: Expected %d got %d"

	.comm	_SMM665_ADC_MASK,4,2            ; @SMM665_ADC_MASK
	.no_dead_strip	_smm665_read_adc
.subsections_via_symbols
