	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function si1145_trigger_set_state
_si1145_trigger_set_state:              ## @si1145_trigger_set_state
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	callq	_iio_trigger_get_drvdata
	movq	%rax, %rdi
	callq	_iio_priv
	movq	%rax, %r15
	movq	%rax, %r14
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.1:
	movl	$1, (%r15)
	movl	8(%r15), %edi
	movq	_SI1145_REG_INT_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SI1145_INT_CFG_OE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_8
## %bb.2:
	movl	8(%r15), %edi
	movq	_SI1145_REG_IRQ_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SI1145_MASK_ALL_IE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_8
## %bb.3:
	movl	12(%r15), %esi
	movq	%r15, %rdi
	callq	_si1145_set_meas_rate
	testl	%eax, %eax
	js	LBB0_8
## %bb.4:
	movq	_SI1145_CMD_PSALS_AUTO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_si1145_command
	movl	%eax, %r12d
	testl	%eax, %eax
	jns	LBB0_10
	jmp	LBB0_9
LBB0_8:
	movl	%eax, %r12d
	jmp	LBB0_9
LBB0_5:
	xorl	%r12d, %r12d
LBB0_9:
	movq	_SI1145_CMD_PSALS_PAUSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_si1145_command
	testl	%r12d, %r12d
	movl	%eax, %ebx
	cmovnel	%r12d, %ebx
	testl	%eax, %eax
	cmovnsl	%r12d, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_si1145_set_meas_rate
	testl	%ebx, %ebx
	movl	%eax, %r12d
	cmovnel	%ebx, %r12d
	testl	%eax, %eax
	cmovnsl	%ebx, %r12d
	movl	8(%r15), %edi
	movq	_SI1145_REG_IRQ_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%r12d, %r12d
	movl	%eax, %ebx
	cmovnel	%r12d, %ebx
	testl	%eax, %eax
	cmovnsl	%r12d, %ebx
	movl	8(%r15), %edi
	movq	_SI1145_REG_INT_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%ebx, %ebx
	movl	%eax, %r12d
	cmovnel	%ebx, %r12d
	testl	%eax, %eax
	cmovnsl	%ebx, %r12d
	movl	$0, (%r15)
LBB0_10:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SI1145_REG_INT_CFG,4,2         ## @SI1145_REG_INT_CFG
	.comm	_SI1145_INT_CFG_OE,4,2          ## @SI1145_INT_CFG_OE
	.comm	_SI1145_REG_IRQ_ENABLE,4,2      ## @SI1145_REG_IRQ_ENABLE
	.comm	_SI1145_MASK_ALL_IE,4,2         ## @SI1145_MASK_ALL_IE
	.comm	_SI1145_CMD_PSALS_AUTO,4,2      ## @SI1145_CMD_PSALS_AUTO
	.comm	_SI1145_CMD_PSALS_PAUSE,4,2     ## @SI1145_CMD_PSALS_PAUSE
	.no_dead_strip	_si1145_trigger_set_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function si1145_trigger_set_state
_si1145_trigger_set_state:              ; @si1145_trigger_set_state
	.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, x1
	bl	_iio_trigger_get_drvdata
	bl	_iio_priv
	mov	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
Lloh0:
	adrp	x23, _SI1145_REG_IRQ_ENABLE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SI1145_REG_IRQ_ENABLE@GOTPAGEOFF]
Lloh2:
	adrp	x22, _SI1145_REG_INT_CFG@GOTPAGE
Lloh3:
	ldr	x22, [x22, _SI1145_REG_INT_CFG@GOTPAGEOFF]
	cbz	w21, LBB0_6
; %bb.1:
	mov	w8, #1
	str	w8, [x20]
	ldr	w0, [x20, #8]
	ldr	w1, [x22]
Lloh4:
	adrp	x8, _SI1145_INT_CFG_OE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SI1145_INT_CFG_OE@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_5
; %bb.2:
	ldr	w0, [x20, #8]
	ldr	w1, [x23]
Lloh7:
	adrp	x8, _SI1145_MASK_ALL_IE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SI1145_MASK_ALL_IE@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_5
; %bb.3:
	ldr	w1, [x20, #12]
	mov	x0, x20
	bl	_si1145_set_meas_rate
	tbnz	w0, #31, LBB0_5
; %bb.4:
Lloh10:
	adrp	x8, _SI1145_CMD_PSALS_AUTO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SI1145_CMD_PSALS_AUTO@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_si1145_command
	mov	x21, x0
	tbz	w0, #31, LBB0_7
	b	LBB0_6
LBB0_5:
	mov	x21, x0
LBB0_6:
Lloh13:
	adrp	x8, _SI1145_CMD_PSALS_PAUSE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SI1145_CMD_PSALS_PAUSE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_si1145_command
	cmp	w21, #0
	mov	w24, #-1
	ccmp	w0, w24, #0, eq
	csel	w21, w21, w0, gt
	mov	x0, x20
	mov	w1, #0
	bl	_si1145_set_meas_rate
	cmp	w21, #0
	ccmp	w0, w24, #0, eq
	csel	w21, w21, w0, gt
	ldr	w0, [x20, #8]
	ldr	w1, [x23]
	mov	w2, #0
	bl	_i2c_smbus_write_byte_data
	cmp	w21, #0
	ccmp	w0, w24, #0, eq
	csel	w21, w21, w0, gt
	ldr	w0, [x20, #8]
	ldr	w1, [x22]
	mov	w2, #0
	bl	_i2c_smbus_write_byte_data
	cmp	w21, #0
	ccmp	w0, w24, #0, eq
	csel	w21, w21, w0, gt
	str	wzr, [x20]
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_SI1145_REG_INT_CFG,4,2         ; @SI1145_REG_INT_CFG
	.comm	_SI1145_INT_CFG_OE,4,2          ; @SI1145_INT_CFG_OE
	.comm	_SI1145_REG_IRQ_ENABLE,4,2      ; @SI1145_REG_IRQ_ENABLE
	.comm	_SI1145_MASK_ALL_IE,4,2         ; @SI1145_MASK_ALL_IE
	.comm	_SI1145_CMD_PSALS_AUTO,4,2      ; @SI1145_CMD_PSALS_AUTO
	.comm	_SI1145_CMD_PSALS_PAUSE,4,2     ; @SI1145_CMD_PSALS_PAUSE
	.no_dead_strip	_si1145_trigger_set_state
.subsections_via_symbols
