	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function imx6ul_adc_init
_imx6ul_adc_init:                       ## @imx6ul_adc_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	%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	%rdi, %rbx
	leaq	20(%rdi), %r14
	movq	%r14, %rdi
	callq	_reinit_completion
	movq	_REG_ADC_CFG@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	_ADC_CONV_MODE_MASK@GOTPCREL(%rip), %rcx
	movq	_ADC_INPUT_CLK_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	_ADC_12BIT_MODE@GOTPCREL(%rip), %rax
	movq	_ADC_IPG_CLK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%edx, %ecx
	movq	_ADC_CLK_DIV_MASK@GOTPCREL(%rip), %rax
	movq	_ADC_SAMPLE_MODE_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rax), %edx
	movq	_ADC_CLK_DIV_8@GOTPCREL(%rip), %rsi
	movq	_ADC_SHORT_SAMPLE_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rsi), %eax
	notl	%edx
	andl	%ecx, %edx
	orl	%edx, %eax
	cmpq	$0, 24(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_ADC_AVGS_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %eax
	movl	(%rbx), %edx
	movq	_ADC_AVGS_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%edx, %eax
LBB0_2:
	movq	_ADC_HARDWARE_TRIGGER@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	notl	%edi
	andl	%eax, %edi
	movq	(%r15), %rsi
	addq	8(%rbx), %rsi
	callq	_writel
	movq	_ADC_AIEN@GOTPCREL(%rip), %rax
	movq	_ADC_CONV_DISABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_REG_ADC_HC0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_writel
	movq	_REG_ADC_GC@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	_ADC_CAL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	xorl	%ecx, %ecx
	cmpq	$0, 24(%rbx)
	je	LBB0_4
## %bb.3:
	movq	_ADC_AVGE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_4:
	orl	%ecx, %eax
	movq	(%r13), %rsi
	addq	8(%rbx), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	_ADC_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	_REG_ADC_GS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	_ADC_CALF@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.8:
	movl	16(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_5:
	movl	16(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
LBB0_6:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_9:
	movq	(%r15), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	orl	(%r12), %eax
	movq	(%r15), %rsi
	addq	8(%rbx), %rsi
	movl	%eax, %edi
	callq	_writel
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_ADC_CFG,8,3                ## @REG_ADC_CFG
	.comm	_ADC_CONV_MODE_MASK,4,2         ## @ADC_CONV_MODE_MASK
	.comm	_ADC_INPUT_CLK_MASK,4,2         ## @ADC_INPUT_CLK_MASK
	.comm	_ADC_12BIT_MODE,4,2             ## @ADC_12BIT_MODE
	.comm	_ADC_IPG_CLK,4,2                ## @ADC_IPG_CLK
	.comm	_ADC_CLK_DIV_MASK,4,2           ## @ADC_CLK_DIV_MASK
	.comm	_ADC_SAMPLE_MODE_MASK,4,2       ## @ADC_SAMPLE_MODE_MASK
	.comm	_ADC_CLK_DIV_8,4,2              ## @ADC_CLK_DIV_8
	.comm	_ADC_SHORT_SAMPLE_MODE,4,2      ## @ADC_SHORT_SAMPLE_MODE
	.comm	_ADC_AVGS_MASK,4,2              ## @ADC_AVGS_MASK
	.comm	_ADC_AVGS_SHIFT,4,2             ## @ADC_AVGS_SHIFT
	.comm	_ADC_HARDWARE_TRIGGER,4,2       ## @ADC_HARDWARE_TRIGGER
	.comm	_ADC_AIEN,4,2                   ## @ADC_AIEN
	.comm	_ADC_CONV_DISABLE,4,2           ## @ADC_CONV_DISABLE
	.comm	_REG_ADC_HC0,8,3                ## @REG_ADC_HC0
	.comm	_REG_ADC_GC,8,3                 ## @REG_ADC_GC
	.comm	_ADC_CAL,4,2                    ## @ADC_CAL
	.comm	_ADC_AVGE,4,2                   ## @ADC_AVGE
	.comm	_ADC_TIMEOUT,4,2                ## @ADC_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout for adc calibration\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_REG_ADC_GS,8,3                 ## @REG_ADC_GS
	.comm	_ADC_CALF,4,2                   ## @ADC_CALF
L_.str.1:                               ## @.str.1
	.asciz	"ADC calibration failed\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_imx6ul_adc_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function imx6ul_adc_init
_imx6ul_adc_init:                       ; @imx6ul_adc_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	add	x20, x0, #20
	mov	x0, x20
	bl	_reinit_completion
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x21, _REG_ADC_CFG@GOTPAGE
Lloh1:
	ldr	x21, [x21, _REG_ADC_CFG@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
Lloh2:
	adrp	x8, _ADC_CONV_MODE_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ADC_CONV_MODE_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _ADC_INPUT_CLK_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ADC_INPUT_CLK_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _ADC_12BIT_MODE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ADC_12BIT_MODE@GOTPAGEOFF]
	bic	w8, w0, w8
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _ADC_IPG_CLK@GOTPAGE
Lloh12:
	ldr	x10, [x10, _ADC_IPG_CLK@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	orr	w9, w10, w9
	orr	w8, w9, w8
Lloh14:
	adrp	x9, _ADC_CLK_DIV_MASK@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ADC_CLK_DIV_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _ADC_SAMPLE_MODE_MASK@GOTPAGE
Lloh18:
	ldr	x10, [x10, _ADC_SAMPLE_MODE_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	orr	w9, w10, w9
	bic	w8, w8, w9
Lloh20:
	adrp	x9, _ADC_CLK_DIV_8@GOTPAGE
Lloh21:
	ldr	x9, [x9, _ADC_CLK_DIV_8@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
Lloh23:
	adrp	x10, _ADC_SHORT_SAMPLE_MODE@GOTPAGE
Lloh24:
	ldr	x10, [x10, _ADC_SHORT_SAMPLE_MODE@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	orr	w9, w10, w9
	orr	w8, w9, w8
	ldr	x9, [x19, #24]
	cbz	x9, LBB0_2
; %bb.1:
Lloh26:
	adrp	x9, _ADC_AVGS_MASK@GOTPAGE
Lloh27:
	ldr	x9, [x9, _ADC_AVGS_MASK@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	bic	w8, w8, w9
	ldr	w9, [x19]
Lloh29:
	adrp	x10, _ADC_AVGS_SHIFT@GOTPAGE
Lloh30:
	ldr	x10, [x10, _ADC_AVGS_SHIFT@GOTPAGEOFF]
Lloh31:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
LBB0_2:
Lloh32:
	adrp	x22, _ADC_HARDWARE_TRIGGER@GOTPAGE
Lloh33:
	ldr	x22, [x22, _ADC_HARDWARE_TRIGGER@GOTPAGEOFF]
	ldr	w9, [x22]
	bic	w0, w8, w9
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel
Lloh34:
	adrp	x8, _ADC_AIEN@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ADC_AIEN@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
Lloh37:
	adrp	x9, _ADC_CONV_DISABLE@GOTPAGE
Lloh38:
	ldr	x9, [x9, _ADC_CONV_DISABLE@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x8, [x19, #8]
Lloh40:
	adrp	x9, _REG_ADC_HC0@GOTPAGE
Lloh41:
	ldr	x9, [x9, _REG_ADC_HC0@GOTPAGEOFF]
Lloh42:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #8]
Lloh43:
	adrp	x23, _REG_ADC_GC@GOTPAGE
Lloh44:
	ldr	x23, [x23, _REG_ADC_GC@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
Lloh45:
	adrp	x8, _ADC_CAL@GOTPAGE
Lloh46:
	ldr	x8, [x8, _ADC_CAL@GOTPAGEOFF]
Lloh47:
	ldr	w8, [x8]
	orr	w8, w8, w0
	ldr	x9, [x19, #24]
Lloh48:
	adrp	x10, _ADC_AVGE@GOTPAGE
Lloh49:
	ldr	x10, [x10, _ADC_AVGE@GOTPAGEOFF]
Lloh50:
	ldr	w10, [x10]
	cmp	x9, #0
	csel	w9, wzr, w10, eq
	orr	w0, w8, w9
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
Lloh51:
	adrp	x8, _ADC_TIMEOUT@GOTPAGE
Lloh52:
	ldr	x8, [x8, _ADC_TIMEOUT@GOTPAGEOFF]
Lloh53:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_5
; %bb.3:
	ldr	x8, [x19, #8]
Lloh54:
	adrp	x9, _REG_ADC_GS@GOTPAGE
Lloh55:
	ldr	x9, [x9, _REG_ADC_GS@GOTPAGEOFF]
Lloh56:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh57:
	adrp	x8, _ADC_CALF@GOTPAGE
Lloh58:
	ldr	x8, [x8, _ADC_CALF@GOTPAGEOFF]
Lloh59:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.4:
	ldr	w0, [x19, #16]
Lloh60:
	adrp	x1, l_.str.1@PAGE
Lloh61:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh62:
	adrp	x8, _EINVAL@GOTPAGE
Lloh63:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
	ldr	w0, [x19, #16]
Lloh64:
	adrp	x1, l_.str@PAGE
Lloh65:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh66:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh67:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_7:
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x22]
	orr	w0, w8, w0
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #0
LBB0_8:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGot	Lloh62, Lloh63
	.loh AdrpAdd	Lloh60, Lloh61
	.loh AdrpLdrGot	Lloh66, Lloh67
	.loh AdrpAdd	Lloh64, Lloh65
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_ADC_CFG,8,3                ; @REG_ADC_CFG
	.comm	_ADC_CONV_MODE_MASK,4,2         ; @ADC_CONV_MODE_MASK
	.comm	_ADC_INPUT_CLK_MASK,4,2         ; @ADC_INPUT_CLK_MASK
	.comm	_ADC_12BIT_MODE,4,2             ; @ADC_12BIT_MODE
	.comm	_ADC_IPG_CLK,4,2                ; @ADC_IPG_CLK
	.comm	_ADC_CLK_DIV_MASK,4,2           ; @ADC_CLK_DIV_MASK
	.comm	_ADC_SAMPLE_MODE_MASK,4,2       ; @ADC_SAMPLE_MODE_MASK
	.comm	_ADC_CLK_DIV_8,4,2              ; @ADC_CLK_DIV_8
	.comm	_ADC_SHORT_SAMPLE_MODE,4,2      ; @ADC_SHORT_SAMPLE_MODE
	.comm	_ADC_AVGS_MASK,4,2              ; @ADC_AVGS_MASK
	.comm	_ADC_AVGS_SHIFT,4,2             ; @ADC_AVGS_SHIFT
	.comm	_ADC_HARDWARE_TRIGGER,4,2       ; @ADC_HARDWARE_TRIGGER
	.comm	_ADC_AIEN,4,2                   ; @ADC_AIEN
	.comm	_ADC_CONV_DISABLE,4,2           ; @ADC_CONV_DISABLE
	.comm	_REG_ADC_HC0,8,3                ; @REG_ADC_HC0
	.comm	_REG_ADC_GC,8,3                 ; @REG_ADC_GC
	.comm	_ADC_CAL,4,2                    ; @ADC_CAL
	.comm	_ADC_AVGE,4,2                   ; @ADC_AVGE
	.comm	_ADC_TIMEOUT,4,2                ; @ADC_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout for adc calibration\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_REG_ADC_GS,8,3                 ; @REG_ADC_GS
	.comm	_ADC_CALF,4,2                   ; @ADC_CALF
l_.str.1:                               ; @.str.1
	.asciz	"ADC calibration failed\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_imx6ul_adc_init
.subsections_via_symbols
