	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max44009_write_event_value
_max44009_write_event_value:            ## @max44009_write_event_value
	.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, %r12d
	movl	%r8d, %r14d
	movl	%ecx, %r15d
	movq	%rsi, %rbx
	movl	16(%rbp), %r13d
	callq	_iio_priv
	movq	_IIO_EV_INFO_VALUE@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	jne	LBB0_2
## %bb.1:
	movq	(%rbx), %rdx
	movq	_IIO_LIGHT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_2
## %bb.3:
	movq	%rax, %r14
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_max44009_threshold_byte_from_fraction
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_6
## %bb.4:
	movl	%r15d, %edi
	callq	_max44009_get_thr_reg
	testl	%eax, %eax
	js	LBB0_5
## %bb.7:
	movl	(%r14), %edi
	movl	%eax, %esi
	movl	%ebx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_i2c_smbus_write_byte_data      ## TAILCALL
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%eax, %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_IIO_EV_INFO_VALUE,4,2          ## @IIO_EV_INFO_VALUE
	.comm	_IIO_LIGHT,8,3                  ## @IIO_LIGHT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_max44009_write_event_value
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max44009_write_event_value
_max44009_write_event_value:            ; @max44009_write_event_value
	.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	x21, x6
	mov	x22, x5
	mov	x24, x4
	mov	x20, x3
	mov	x23, x1
	bl	_iio_priv
Lloh0:
	adrp	x8, _IIO_EV_INFO_VALUE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IIO_EV_INFO_VALUE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w24
	b.ne	LBB0_5
; %bb.1:
	ldr	x8, [x23]
Lloh3:
	adrp	x9, _IIO_LIGHT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IIO_LIGHT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	mov	x19, x0
	mov	x0, x22
	mov	x1, x21
	bl	_max44009_threshold_byte_from_fraction
	mov	x21, x0
	tbnz	w0, #31, LBB0_6
; %bb.3:
	mov	x0, x20
	bl	_max44009_get_thr_reg
	mov	x1, x0
	tbnz	w0, #31, LBB0_7
; %bb.4:
	ldr	w0, [x19]
	mov	x2, 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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_i2c_smbus_write_byte_data
LBB0_5:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_6:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x21, x1
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_IIO_EV_INFO_VALUE,4,2          ; @IIO_EV_INFO_VALUE
	.comm	_IIO_LIGHT,8,3                  ; @IIO_LIGHT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_max44009_write_event_value
.subsections_via_symbols
