	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wf_ad7417_init_chip
_wf_ad7417_init_chip:                   ## @wf_ad7417_init_chip
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	$5, -32(%rbp)
	movq	8(%rdi), %rdi
	leaq	-32(%rbp), %r14
	movq	%r14, %rsi
	movl	$2, %edx
	callq	_i2c_master_send
	movl	$1, -32(%rbp)
	movq	8(%rbx), %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_i2c_master_send
	xorl	%r14d, %r14d
	testl	%eax, %eax
	jle	LBB0_3
## %bb.1:
	movq	8(%rbx), %rdi
	leaq	-32(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_master_recv
	testl	%eax, %eax
	jle	LBB0_3
## %bb.2:
	movl	-32(%rbp), %r14d
	movq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_dbg
	andl	$254, %r14d
	movl	$1, -32(%rbp)
	movl	%r14d, -28(%rbp)
	movq	8(%rbx), %rdi
	leaq	-32(%rbp), %rsi
	movl	$2, %edx
	callq	_i2c_master_send
	testl	%eax, %eax
	jg	LBB0_4
LBB0_3:
	movq	8(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
LBB0_4:
	movl	%r14d, (%rbx)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ADC config reg: %02x\n"

L_.str.1:                               ## @.str.1
	.asciz	"Error reading ADC config\n"

	.no_dead_strip	_wf_ad7417_init_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function wf_ad7417_init_chip
lCPI0_0:
	.long	5                               ; 0x5
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_wf_ad7417_init_chip:                   ; @wf_ad7417_init_chip
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #8]
	ldr	x0, [x0, #8]
	add	x1, sp, #8
	mov	w2, #2
	bl	_i2c_master_send
	mov	w8, #1
	str	w8, [sp, #8]
	ldr	x0, [x19, #8]
	add	x1, sp, #8
	mov	w2, #1
	bl	_i2c_master_send
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.1:
	ldr	x0, [x19, #8]
	mov	w21, #1
	add	x1, sp, #8
	mov	w2, #1
	bl	_i2c_master_recv
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.2:
	ldr	w20, [sp, #8]
	ldr	x0, [x19, #8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
	and	w20, w20, #0xfe
	stp	w21, w20, [sp, #8]
	ldr	x0, [x19, #8]
	add	x1, sp, #8
	mov	w2, #2
	bl	_i2c_master_send
	cmp	w0, #0
	b.gt	LBB0_5
	b	LBB0_4
LBB0_3:
	mov	w20, #0
LBB0_4:
	ldr	x0, [x19, #8]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_5:
	str	w20, [x19]
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ADC config reg: %02x\n"

l_.str.1:                               ; @.str.1
	.asciz	"Error reading ADC config\n"

	.no_dead_strip	_wf_ad7417_init_chip
.subsections_via_symbols
