	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stk3310_write_event
_stk3310_write_event:                   ## @stk3310_write_event
	.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
	movl	%r9d, %r15d
	movl	%ecx, %r12d
	callq	_iio_priv
	movq	%rax, %r13
	movq	8(%rax), %r14
	movl	4(%rax), %edi
	leaq	-44(%rbp), %rsi
	callq	_regmap_field_read
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	testl	%r15d, %r15d
	js	LBB0_4
## %bb.3:
	movq	_stk3310_ps_max@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	-44(%rbp), %ecx
	cmpl	%r15d, (%rax,%rcx,4)
	jl	LBB0_4
## %bb.5:
	movq	_IIO_EV_DIR_RISING@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_7
## %bb.6:
	movq	_STK3310_REG_THDH_PS@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_1:
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_7:
	movq	_IIO_EV_DIR_FALLING@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_4
## %bb.8:
	movq	_STK3310_REG_THDL_PS@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %ebx
	movl	%r15d, %edi
	callq	_cpu_to_be16
	movl	%eax, -48(%rbp)
	movl	(%r13), %edi
	leaq	-48(%rbp), %rdx
	movl	%ebx, %esi
	movl	$2, %ecx
	callq	_regmap_bulk_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_11
## %bb.10:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_11
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_stk3310_ps_max,8,3             ## @stk3310_ps_max
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IIO_EV_DIR_RISING,4,2          ## @IIO_EV_DIR_RISING
	.comm	_STK3310_REG_THDH_PS,4,2        ## @STK3310_REG_THDH_PS
	.comm	_IIO_EV_DIR_FALLING,4,2         ## @IIO_EV_DIR_FALLING
	.comm	_STK3310_REG_THDL_PS,4,2        ## @STK3310_REG_THDL_PS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to set PS threshold!\n"

	.no_dead_strip	_stk3310_write_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stk3310_write_event
_stk3310_write_event:                   ; @stk3310_write_event
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x5
	mov	x22, x3
	bl	_iio_priv
	mov	x21, x0
	ldr	x19, [x0, #8]
	ldr	w0, [x0, #4]
	add	x1, sp, #8
	bl	_regmap_field_read
	tbnz	w0, #31, LBB0_5
; %bb.1:
	tbnz	w20, #31, LBB0_10
; %bb.2:
Lloh0:
	adrp	x8, _stk3310_ps_max@GOTPAGE
Lloh1:
	ldr	x8, [x8, _stk3310_ps_max@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w9, [sp, #8]
	ldr	w8, [x8, x9, lsl #2]
	cmp	w8, w20
	b.lt	LBB0_10
; %bb.3:
Lloh3:
	adrp	x8, _IIO_EV_DIR_RISING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IIO_EV_DIR_RISING@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_6
; %bb.4:
Lloh6:
	adrp	x8, _STK3310_REG_THDH_PS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STK3310_REG_THDH_PS@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	mov	x23, x0
	b	LBB0_11
LBB0_6:
Lloh8:
	adrp	x8, _IIO_EV_DIR_FALLING@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IIO_EV_DIR_FALLING@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_10
; %bb.7:
Lloh11:
	adrp	x8, _STK3310_REG_THDL_PS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _STK3310_REG_THDL_PS@GOTPAGEOFF]
LBB0_8:
	ldr	w22, [x8]
	mov	x0, x20
	bl	_cpu_to_be16
	str	w0, [sp, #12]
	ldr	w0, [x21]
	add	x2, sp, #12
	mov	x1, x22
	mov	w3, #2
	bl	_regmap_bulk_write
	mov	x23, x0
	tbz	w0, #31, LBB0_11
; %bb.9:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_11
LBB0_10:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_11:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_stk3310_ps_max,8,3             ; @stk3310_ps_max
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IIO_EV_DIR_RISING,4,2          ; @IIO_EV_DIR_RISING
	.comm	_STK3310_REG_THDH_PS,4,2        ; @STK3310_REG_THDH_PS
	.comm	_IIO_EV_DIR_FALLING,4,2         ; @IIO_EV_DIR_FALLING
	.comm	_STK3310_REG_THDL_PS,4,2        ; @STK3310_REG_THDL_PS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to set PS threshold!\n"

	.no_dead_strip	_stk3310_write_event
.subsections_via_symbols
