	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function palmas_gpadc_start_conversion
_palmas_gpadc_start_conversion:         ## @palmas_gpadc_start_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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	8(%rdi), %r15
	movq	%r15, %rdi
	callq	_init_completion
	movl	4(%r14), %edi
	movq	_PALMAS_GPADC_BASE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_PALMAS_GPADC_SW_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PALMAS_GPADC_SW_SELECT_SW_START_CONV0@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %r8d
	callq	_palmas_update_bits
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	movq	_PALMAS_ADC_CONVERSION_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movl	4(%r14), %edi
	movl	(%r12), %esi
	movq	_PALMAS_GPADC_SW_CONV0_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-36(%rbp), %rcx
	movl	$2, %r8d
	callq	_palmas_bulk_read
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movl	$4095, %ebx                     ## imm = 0xFFF
	andl	-36(%rbp), %ebx
	jmp	LBB0_8
LBB0_1:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_6:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_2:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_8:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PALMAS_GPADC_BASE,4,2          ## @PALMAS_GPADC_BASE
	.comm	_PALMAS_GPADC_SW_SELECT,4,2     ## @PALMAS_GPADC_SW_SELECT
	.comm	_PALMAS_GPADC_SW_SELECT_SW_START_CONV0,4,2 ## @PALMAS_GPADC_SW_SELECT_SW_START_CONV0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SELECT_SW_START write failed: %d\n"

	.comm	_PALMAS_ADC_CONVERSION_TIMEOUT,4,2 ## @PALMAS_ADC_CONVERSION_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"conversion not completed\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_PALMAS_GPADC_SW_CONV0_LSB,4,2  ## @PALMAS_GPADC_SW_CONV0_LSB
L_.str.2:                               ## @.str.2
	.asciz	"SW_CONV0_LSB read failed: %d\n"

	.no_dead_strip	_palmas_gpadc_start_conversion
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function palmas_gpadc_start_conversion
_palmas_gpadc_start_conversion:         ; @palmas_gpadc_start_conversion
	.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	x19, x0
	add	x20, x0, #8
	mov	x0, x20
	bl	_init_completion
	ldr	w0, [x19, #4]
Lloh0:
	adrp	x22, _PALMAS_GPADC_BASE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PALMAS_GPADC_BASE@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x8, _PALMAS_GPADC_SW_SELECT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PALMAS_GPADC_SW_SELECT@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
Lloh5:
	adrp	x8, _PALMAS_GPADC_SW_SELECT_SW_START_CONV0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PALMAS_GPADC_SW_SELECT_SW_START_CONV0@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	mov	x4, x3
	bl	_palmas_update_bits
	tbnz	w0, #31, LBB0_4
; %bb.1:
Lloh8:
	adrp	x8, _PALMAS_ADC_CONVERSION_TIMEOUT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PALMAS_ADC_CONVERSION_TIMEOUT@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_5
; %bb.2:
	ldr	w0, [x19, #4]
	ldr	w1, [x22]
Lloh11:
	adrp	x8, _PALMAS_GPADC_SW_CONV0_LSB@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PALMAS_GPADC_SW_CONV0_LSB@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	w4, #2
	bl	_palmas_bulk_read
	tbnz	w0, #31, LBB0_6
; %bb.3:
	ldr	w8, [sp, #12]
	and	w21, w8, #0xfff
	b	LBB0_7
LBB0_4:
	mov	x21, x0
	ldr	w0, [x19]
	str	x21, [sp]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_7
LBB0_5:
	ldr	w0, [x19]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh18:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_7
LBB0_6:
	mov	x21, x0
	ldr	w0, [x19]
	str	x21, [sp]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_PALMAS_GPADC_BASE,4,2          ; @PALMAS_GPADC_BASE
	.comm	_PALMAS_GPADC_SW_SELECT,4,2     ; @PALMAS_GPADC_SW_SELECT
	.comm	_PALMAS_GPADC_SW_SELECT_SW_START_CONV0,4,2 ; @PALMAS_GPADC_SW_SELECT_SW_START_CONV0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SELECT_SW_START write failed: %d\n"

	.comm	_PALMAS_ADC_CONVERSION_TIMEOUT,4,2 ; @PALMAS_ADC_CONVERSION_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"conversion not completed\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_PALMAS_GPADC_SW_CONV0_LSB,4,2  ; @PALMAS_GPADC_SW_CONV0_LSB
l_.str.2:                               ; @.str.2
	.asciz	"SW_CONV0_LSB read failed: %d\n"

	.no_dead_strip	_palmas_gpadc_start_conversion
.subsections_via_symbols
