	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ads1015_enable_event_config
_ads1015_enable_event_config:           ## @ads1015_enable_event_config
	.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	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	16(%rdi), %rax
	movq	(%rsi), %rcx
	movl	(%rax,%rcx,8), %ebx
	movl	4(%rax,%rcx,8), %r12d
	callq	_ads1015_event_channel_enabled
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	(%r13), %rax
	cmpq	(%r14), %rax
	jne	LBB0_4
## %bb.2:
	movl	8(%r13), %eax
	movq	_ADS1015_CFG_COMP_MODE_TRAD@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpl	(%rcx), %eax
	jne	LBB0_14
## %bb.3:
	movq	_ADS1015_CFG_COMP_MODE_WINDOW@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_14
LBB0_4:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_5:
	movq	_ADS1015_CFG_COMP_MODE_TRAD@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_7
## %bb.6:
	movb	8(%r14), %cl
	decb	%cl
	movl	$-1, %edi
	shll	%cl, %edi
	leal	-1(%r12), %esi
	callq	_max
	movl	%eax, %ebx
LBB0_7:
	movl	12(%r13), %edi
	movq	_ADS1015_LO_THRESH_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movb	12(%r14), %cl
	shll	%cl, %ebx
	movl	%ebx, %edx
	callq	_regmap_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.8:
	movl	12(%r13), %edi
	movq	_ADS1015_HI_THRESH_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movb	12(%r14), %cl
	shll	%cl, %r12d
	movl	%r12d, %edx
	callq	_regmap_write
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_9
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_ads1015_set_power_state
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movq	(%r14), %rsi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_ads1015_event_channel_enable
	movq	(%r14), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r13, %rdi
	callq	_ads1015_get_adc_result
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movl	%eax, %ebx
	movq	(%r14), %rsi
	movq	%r13, %rdi
	callq	_ads1015_event_channel_disable
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_ads1015_set_power_state
	jmp	LBB0_14
LBB0_10:
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_12:
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_ADS1015_CFG_COMP_MODE_TRAD,4,2 ## @ADS1015_CFG_COMP_MODE_TRAD
	.comm	_ADS1015_CFG_COMP_MODE_WINDOW,4,2 ## @ADS1015_CFG_COMP_MODE_WINDOW
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ADS1015_LO_THRESH_REG,4,2      ## @ADS1015_LO_THRESH_REG
	.comm	_ADS1015_HI_THRESH_REG,4,2      ## @ADS1015_HI_THRESH_REG
	.no_dead_strip	_ads1015_enable_event_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ads1015_enable_event_config
_ads1015_enable_event_config:           ; @ads1015_enable_event_config
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	x9, [x1]
	add	x8, x8, x9, lsl #3
	ldp	w22, w23, [x8]
	bl	_ads1015_event_channel_enabled
	cbz	x0, LBB0_5
; %bb.1:
	ldr	x8, [x19]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	ldr	w8, [x19, #8]
Lloh0:
	adrp	x9, _ADS1015_CFG_COMP_MODE_TRAD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ADS1015_CFG_COMP_MODE_TRAD@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _ADS1015_CFG_COMP_MODE_WINDOW@GOTPAGE
Lloh4:
	ldr	x10, [x10, _ADS1015_CFG_COMP_MODE_WINDOW@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w10, w21, #0, eq
	b.eq	LBB0_4
; %bb.3:
	mov	w22, #0
	b	LBB0_9
LBB0_4:
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_9
LBB0_5:
Lloh9:
	adrp	x8, _ADS1015_CFG_COMP_MODE_TRAD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ADS1015_CFG_COMP_MODE_TRAD@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_7
; %bb.6:
	ldr	w8, [x20, #8]
	sub	w8, w8, #1
	mov	w9, #-1
	lsl	w0, w9, w8
	sub	w1, w23, #1
	bl	_max
	mov	x22, x0
LBB0_7:
	ldr	w0, [x19, #12]
Lloh12:
	adrp	x8, _ADS1015_LO_THRESH_REG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ADS1015_LO_THRESH_REG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	w8, [x20, #12]
	lsl	w2, w22, w8
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_9
; %bb.8:
	ldr	w0, [x19, #12]
Lloh15:
	adrp	x8, _ADS1015_HI_THRESH_REG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ADS1015_HI_THRESH_REG@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	ldr	w8, [x20, #12]
	lsl	w2, w23, w8
	bl	_regmap_write
	mov	x22, x0
	cbz	w0, LBB0_10
LBB0_9:
	mov	x0, x22
	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
LBB0_10:
	mov	x0, x19
	mov	w1, #1
	bl	_ads1015_set_power_state
	tbnz	w0, #31, LBB0_13
; %bb.11:
	ldr	x1, [x20]
	mov	x0, x19
	mov	x2, x21
	bl	_ads1015_event_channel_enable
	ldr	x1, [x20]
	add	x2, sp, #12
	mov	x0, x19
	bl	_ads1015_get_adc_result
	mov	x22, x0
	cbz	w0, LBB0_9
; %bb.12:
	ldr	x1, [x20]
	mov	x0, x19
	bl	_ads1015_event_channel_disable
	mov	x0, x19
	mov	w1, #0
	bl	_ads1015_set_power_state
	b	LBB0_9
LBB0_13:
	mov	x22, x0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ADS1015_CFG_COMP_MODE_TRAD,4,2 ; @ADS1015_CFG_COMP_MODE_TRAD
	.comm	_ADS1015_CFG_COMP_MODE_WINDOW,4,2 ; @ADS1015_CFG_COMP_MODE_WINDOW
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ADS1015_LO_THRESH_REG,4,2      ; @ADS1015_LO_THRESH_REG
	.comm	_ADS1015_HI_THRESH_REG,4,2      ; @ADS1015_HI_THRESH_REG
	.no_dead_strip	_ads1015_enable_event_config
.subsections_via_symbols
