	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpc18xx_adc_read_chan
_lpc18xx_adc_read_chan:                 ## @lpc18xx_adc_read_chan
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	(%rdi), %r15d
	movl	%esi, %edi
	callq	_BIT
	movl	%eax, %ebx
	orl	%r15d, %ebx
	movq	_LPC18XX_ADC_CR_START_NOW@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_LPC18XX_ADC_CR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	_LPC18XX_ADC_GDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r14), %rdi
	movq	_LPC18XX_ADC_CONV_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%ebx, %edx
	movl	%ebx, %esi
	movl	$3, %ecx
	movl	$9, %r8d
	callq	_readl_poll_timeout
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r15d
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	jmp	LBB0_3
LBB0_2:
	movq	_LPC18XX_ADC_SAMPLE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %ebx
	movq	_LPC18XX_ADC_SAMPLE_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movl	%ebx, %r15d
LBB0_3:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LPC18XX_ADC_CR_START_NOW,4,2   ## @LPC18XX_ADC_CR_START_NOW
	.comm	_LPC18XX_ADC_CR,8,3             ## @LPC18XX_ADC_CR
	.comm	_LPC18XX_ADC_GDR,8,3            ## @LPC18XX_ADC_GDR
	.comm	_LPC18XX_ADC_CONV_DONE,4,2      ## @LPC18XX_ADC_CONV_DONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"adc read timed out\n"

	.comm	_LPC18XX_ADC_SAMPLE_SHIFT,4,2   ## @LPC18XX_ADC_SAMPLE_SHIFT
	.comm	_LPC18XX_ADC_SAMPLE_MASK,4,2    ## @LPC18XX_ADC_SAMPLE_MASK
	.no_dead_strip	_lpc18xx_adc_read_chan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lpc18xx_adc_read_chan
_lpc18xx_adc_read_chan:                 ; @lpc18xx_adc_read_chan
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	ldr	w20, [x0]
	mov	x0, x1
	bl	_BIT
	orr	w8, w0, w20
Lloh0:
	adrp	x9, _LPC18XX_ADC_CR_START_NOW@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LPC18XX_ADC_CR_START_NOW@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	orr	w20, w8, w9
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _LPC18XX_ADC_CR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LPC18XX_ADC_CR@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x20
	bl	_writel
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x9, _LPC18XX_ADC_GDR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _LPC18XX_ADC_GDR@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x0, x9, x8
Lloh9:
	adrp	x8, _LPC18XX_ADC_CONV_DONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LPC18XX_ADC_CONV_DONE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w2, w8, w20
	mov	x1, x20
	mov	w3, #3
	mov	w4, #9
	bl	_readl_poll_timeout
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	ldr	w0, [x19, #4]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	b	LBB0_3
LBB0_2:
Lloh14:
	adrp	x8, _LPC18XX_ADC_SAMPLE_SHIFT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LPC18XX_ADC_SAMPLE_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	asr	w8, w20, w8
Lloh17:
	adrp	x9, _LPC18XX_ADC_SAMPLE_MASK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _LPC18XX_ADC_SAMPLE_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	and	w21, w8, w9
LBB0_3:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_LPC18XX_ADC_CR_START_NOW,4,2   ; @LPC18XX_ADC_CR_START_NOW
	.comm	_LPC18XX_ADC_CR,8,3             ; @LPC18XX_ADC_CR
	.comm	_LPC18XX_ADC_GDR,8,3            ; @LPC18XX_ADC_GDR
	.comm	_LPC18XX_ADC_CONV_DONE,4,2      ; @LPC18XX_ADC_CONV_DONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"adc read timed out\n"

	.comm	_LPC18XX_ADC_SAMPLE_SHIFT,4,2   ; @LPC18XX_ADC_SAMPLE_SHIFT
	.comm	_LPC18XX_ADC_SAMPLE_MASK,4,2    ; @LPC18XX_ADC_SAMPLE_MASK
	.no_dead_strip	_lpc18xx_adc_read_chan
.subsections_via_symbols
