	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpc18xx_dac_write_raw
_lpc18xx_dac_write_raw:                 ## @lpc18xx_dac_write_raw
	.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	%r8, %rbx
	movl	%edx, %r15d
	callq	_iio_priv
	cmpq	$128, %rbx
	jne	LBB0_4
## %bb.1:
	testl	%r15d, %r15d
	js	LBB0_4
## %bb.2:
	movq	%rax, %r14
	movq	_LPC18XX_DAC_CR_VALUE_MASK@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jl	LBB0_4
## %bb.3:
	movq	_LPC18XX_DAC_CR_VALUE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r15d
	movq	_LPC18XX_DAC_CR_BIAS@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_LPC18XX_DAC_CR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	movl	%r15d, %edi
	callq	_writel
	movq	_LPC18XX_DAC_CTRL_DMA_ENA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_LPC18XX_DAC_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	callq	_writel
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LPC18XX_DAC_CR_VALUE_MASK,4,2  ## @LPC18XX_DAC_CR_VALUE_MASK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LPC18XX_DAC_CR_BIAS,4,2        ## @LPC18XX_DAC_CR_BIAS
	.comm	_LPC18XX_DAC_CR_VALUE_SHIFT,4,2 ## @LPC18XX_DAC_CR_VALUE_SHIFT
	.comm	_LPC18XX_DAC_CR,8,3             ## @LPC18XX_DAC_CR
	.comm	_LPC18XX_DAC_CTRL_DMA_ENA,4,2   ## @LPC18XX_DAC_CTRL_DMA_ENA
	.comm	_LPC18XX_DAC_CTRL,8,3           ## @LPC18XX_DAC_CTRL
	.no_dead_strip	_lpc18xx_dac_write_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lpc18xx_dac_write_raw
_lpc18xx_dac_write_raw:                 ; @lpc18xx_dac_write_raw
	.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	x21, x4
	mov	x20, x2
	bl	_iio_priv
	cmp	x21, #128
	b.ne	LBB0_4
; %bb.1:
	tbnz	w20, #31, LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _LPC18XX_DAC_CR_VALUE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LPC18XX_DAC_CR_VALUE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.lt	LBB0_4
; %bb.3:
	mov	x19, x0
Lloh3:
	adrp	x8, _LPC18XX_DAC_CR_BIAS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LPC18XX_DAC_CR_BIAS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _LPC18XX_DAC_CR_VALUE_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _LPC18XX_DAC_CR_VALUE_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	lsl	w9, w20, w9
	orr	w20, w9, w8
	bl	_mutex_lock
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x9, _LPC18XX_DAC_CR@GOTPAGE
Lloh10:
	ldr	x9, [x9, _LPC18XX_DAC_CR@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x20
	bl	_writel
Lloh12:
	adrp	x8, _LPC18XX_DAC_CTRL_DMA_ENA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LPC18XX_DAC_CTRL_DMA_ENA@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
Lloh15:
	adrp	x9, _LPC18XX_DAC_CTRL@GOTPAGE
Lloh16:
	ldr	x9, [x9, _LPC18XX_DAC_CTRL@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_LPC18XX_DAC_CR_VALUE_MASK,4,2  ; @LPC18XX_DAC_CR_VALUE_MASK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LPC18XX_DAC_CR_BIAS,4,2        ; @LPC18XX_DAC_CR_BIAS
	.comm	_LPC18XX_DAC_CR_VALUE_SHIFT,4,2 ; @LPC18XX_DAC_CR_VALUE_SHIFT
	.comm	_LPC18XX_DAC_CR,8,3             ; @LPC18XX_DAC_CR
	.comm	_LPC18XX_DAC_CTRL_DMA_ENA,4,2   ; @LPC18XX_DAC_CTRL_DMA_ENA
	.comm	_LPC18XX_DAC_CTRL,8,3           ; @LPC18XX_DAC_CTRL
	.no_dead_strip	_lpc18xx_dac_write_raw
.subsections_via_symbols
