	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max6697_init_chip
_max6697_init_chip:                     ## @max6697_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_dev_get_platdata
	movq	%rax, %rbx
	movq	16(%r14), %r12
	movl	(%r12), %r13d
	movq	(%r15), %rax
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.8:
	testq	%rax, %rax
	jne	LBB0_9
## %bb.10:
	cmpq	$0, 40(%rbx)
	je	LBB0_11
LBB0_12:
	movq	_MAX6697_CONF_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	4(%r12), %edx
	andl	%eax, %edx
	cmovnel	%eax, %edx
	cmpq	$0, 32(%rbx)
	jne	LBB0_14
	jmp	LBB0_16
LBB0_1:
	testq	%rax, %rax
	je	LBB0_2
LBB0_9:
	leaq	-88(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	callq	_max6697_get_config_of
	cmpq	$0, 40(%rbx)
	jne	LBB0_12
LBB0_11:
	xorl	%edx, %edx
	cmpq	$0, 32(%rbx)
	je	LBB0_16
LBB0_14:
	movq	_MAX6581_CONF_EXTENDED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r12)
	je	LBB0_16
## %bb.15:
	orl	%eax, %edx
	movl	$64, 8(%r14)
LBB0_16:
	cmpl	$0, (%rbx)
	je	LBB0_19
## %bb.17:
	movq	_MAX6697_CONF_RESISTANCE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r12)
	je	LBB0_19
## %bb.18:
	orl	%eax, %edx
	incl	%r13d
LBB0_19:
	cmpq	$0, 24(%rbx)
	je	LBB0_21
## %bb.20:
	movq	_MAX6693_CONF_BETA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	4(%r12), %ecx
	andl	%eax, %ecx
	cmovnel	%eax, %ecx
	orl	%ecx, %edx
LBB0_21:
	movq	_MAX6697_REG_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_31
## %bb.22:
	movq	_MAX6697_REG_ALERT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	16(%rbx), %edi
	callq	_MAX6697_MAP_BITS
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_31
## %bb.23:
	movq	_MAX6697_REG_OVERT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	12(%rbx), %edi
	callq	_MAX6697_MAP_BITS
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_31
## %bb.24:
	movq	(%r14), %rax
	movq	_max6581@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_30
## %bb.25:
	movl	(%rbx), %edi
	sarl	%edi
	callq	_hweight8
	movq	%rax, %r12
	movq	_MAX6581_REG_RESISTANCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	sarl	%edx
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_31
## %bb.26:
	movq	_MAX6581_REG_IDEALITY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%rbx), %edx
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_31
## %bb.27:
	movq	_MAX6581_REG_IDEALITY_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%rbx), %edx
	sarl	%edx
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_31
## %bb.28:
	addl	%r12d, %r13d
	jmp	LBB0_30
LBB0_2:
	movq	_MAX6697_REG_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	testl	%eax, %eax
	js	LBB0_31
## %bb.3:
	movq	(%r14), %rcx
	movq	_max6581@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_29
## %bb.4:
	movq	_MAX6581_CONF_EXTENDED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movl	$64, 8(%r14)
LBB0_6:
	movq	_MAX6581_REG_RESISTANCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	testl	%eax, %eax
	js	LBB0_31
## %bb.7:
	movl	%eax, %edi
	callq	_hweight8
	addl	%eax, %r13d
	jmp	LBB0_30
LBB0_29:
	movq	_MAX6697_CONF_RESISTANCE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %r13d
LBB0_30:
	movq	_MAX6697_CONV_TIME@GOTPCREL(%rip), %rax
	imull	(%rax), %r13d
	movl	%r13d, 12(%r14)
	xorl	%eax, %eax
LBB0_31:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX6697_REG_CONFIG,4,2         ## @MAX6697_REG_CONFIG
	.comm	_max6581,8,3                    ## @max6581
	.comm	_MAX6581_CONF_EXTENDED,4,2      ## @MAX6581_CONF_EXTENDED
	.comm	_MAX6581_REG_RESISTANCE,4,2     ## @MAX6581_REG_RESISTANCE
	.comm	_MAX6697_CONF_RESISTANCE,4,2    ## @MAX6697_CONF_RESISTANCE
	.comm	_MAX6697_CONF_TIMEOUT,4,2       ## @MAX6697_CONF_TIMEOUT
	.comm	_MAX6693_CONF_BETA,4,2          ## @MAX6693_CONF_BETA
	.comm	_MAX6697_REG_ALERT_MASK,4,2     ## @MAX6697_REG_ALERT_MASK
	.comm	_MAX6697_REG_OVERT_MASK,4,2     ## @MAX6697_REG_OVERT_MASK
	.comm	_MAX6581_REG_IDEALITY,4,2       ## @MAX6581_REG_IDEALITY
	.comm	_MAX6581_REG_IDEALITY_SELECT,4,2 ## @MAX6581_REG_IDEALITY_SELECT
	.comm	_MAX6697_CONV_TIME,4,2          ## @MAX6697_CONV_TIME
	.no_dead_strip	_max6697_init_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max6697_init_chip
_max6697_init_chip:                     ; @max6697_init_chip
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x1
	mov	x19, x0
	mov	x0, x1
	bl	_dev_get_platdata
	ldr	x22, [x19, #16]
	ldr	w23, [x22]
	ldr	x8, [x20]
	cbz	x0, LBB0_4
; %bb.1:
	cbnz	x8, LBB0_5
; %bb.2:
	mov	x21, x0
	ldr	x8, [x21, #40]
	cbnz	x8, LBB0_6
LBB0_3:
	mov	w2, #0
	ldr	x8, [x21, #32]
	cbnz	x8, LBB0_7
	b	LBB0_9
LBB0_4:
	cbz	x8, LBB0_21
LBB0_5:
	mov	x21, sp
	mov	x0, sp
	mov	w1, #0
	mov	w2, #48
	bl	_memset
	ldr	x0, [x20]
	mov	x1, sp
	bl	_max6697_get_config_of
	ldr	x8, [x21, #40]
	cbz	x8, LBB0_3
LBB0_6:
	ldr	w8, [x22, #4]
Lloh0:
	adrp	x9, _MAX6697_CONF_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MAX6697_CONF_TIMEOUT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	csel	w2, wzr, w9, eq
	ldr	x8, [x21, #32]
	cbz	x8, LBB0_9
LBB0_7:
	ldr	w9, [x22, #4]
Lloh3:
	adrp	x8, _MAX6581_CONF_EXTENDED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX6581_CONF_EXTENDED@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_9
; %bb.8:
	orr	w2, w8, w2
	mov	w8, #64
	str	w8, [x19, #8]
LBB0_9:
	ldr	w8, [x21]
	cbz	w8, LBB0_11
; %bb.10:
Lloh6:
	adrp	x8, _MAX6697_CONF_RESISTANCE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX6697_CONF_RESISTANCE@GOTPAGEOFF]
	ldr	w9, [x22, #4]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w9
	orr	w8, w8, w2
	cinc	w23, w23, ne
	csel	w2, w2, w8, eq
LBB0_11:
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_13
; %bb.12:
	ldr	w8, [x22, #4]
Lloh9:
	adrp	x9, _MAX6693_CONF_BETA@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MAX6693_CONF_BETA@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	csel	w8, wzr, w9, eq
	orr	w2, w8, w2
LBB0_13:
Lloh12:
	adrp	x8, _MAX6697_REG_CONFIG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAX6697_REG_CONFIG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_29
; %bb.14:
Lloh15:
	adrp	x8, _MAX6697_REG_ALERT_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MAX6697_REG_ALERT_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w22, [x8]
	ldr	w0, [x21, #16]
	bl	_MAX6697_MAP_BITS
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_29
; %bb.15:
Lloh18:
	adrp	x8, _MAX6697_REG_OVERT_MASK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MAX6697_REG_OVERT_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w22, [x8]
	ldr	w0, [x21, #12]
	bl	_MAX6697_MAP_BITS
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_29
; %bb.16:
	ldr	x8, [x19]
Lloh21:
	adrp	x9, _max6581@GOTPAGE
Lloh22:
	ldr	x9, [x9, _max6581@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_28
; %bb.17:
	ldr	w8, [x21]
	asr	w0, w8, #1
	bl	_hweight8
	mov	x22, x0
Lloh24:
	adrp	x8, _MAX6581_REG_RESISTANCE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MAX6581_REG_RESISTANCE@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	ldr	w8, [x21]
	asr	w2, w8, #1
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_29
; %bb.18:
Lloh27:
	adrp	x8, _MAX6581_REG_IDEALITY@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MAX6581_REG_IDEALITY@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	ldr	w2, [x21, #4]
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_29
; %bb.19:
Lloh30:
	adrp	x8, _MAX6581_REG_IDEALITY_SELECT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _MAX6581_REG_IDEALITY_SELECT@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	ldr	w8, [x21, #8]
	asr	w2, w8, #1
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_29
; %bb.20:
	add	w23, w23, w22
	b	LBB0_28
LBB0_21:
Lloh33:
	adrp	x8, _MAX6697_REG_CONFIG@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MAX6697_REG_CONFIG@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_29
; %bb.22:
	ldr	x8, [x19]
Lloh36:
	adrp	x9, _max6581@GOTPAGE
Lloh37:
	ldr	x9, [x9, _max6581@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_27
; %bb.23:
Lloh39:
	adrp	x8, _MAX6581_CONF_EXTENDED@GOTPAGE
Lloh40:
	ldr	x8, [x8, _MAX6581_CONF_EXTENDED@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_25
; %bb.24:
	mov	w8, #64
	str	w8, [x19, #8]
LBB0_25:
Lloh42:
	adrp	x8, _MAX6581_REG_RESISTANCE@GOTPAGE
Lloh43:
	ldr	x8, [x8, _MAX6581_REG_RESISTANCE@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_29
; %bb.26:
	bl	_hweight8
	add	w23, w23, w0
	b	LBB0_28
LBB0_27:
Lloh45:
	adrp	x8, _MAX6697_CONF_RESISTANCE@GOTPAGE
Lloh46:
	ldr	x8, [x8, _MAX6697_CONF_RESISTANCE@GOTPAGEOFF]
Lloh47:
	ldr	w8, [x8]
	tst	w8, w0
	cinc	w23, w23, ne
LBB0_28:
	mov	w0, #0
Lloh48:
	adrp	x8, _MAX6697_CONV_TIME@GOTPAGE
Lloh49:
	ldr	x8, [x8, _MAX6697_CONV_TIME@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
	mul	w8, w8, w23
	str	w8, [x19, #12]
LBB0_29:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX6697_REG_CONFIG,4,2         ; @MAX6697_REG_CONFIG
	.comm	_max6581,8,3                    ; @max6581
	.comm	_MAX6581_CONF_EXTENDED,4,2      ; @MAX6581_CONF_EXTENDED
	.comm	_MAX6581_REG_RESISTANCE,4,2     ; @MAX6581_REG_RESISTANCE
	.comm	_MAX6697_CONF_RESISTANCE,4,2    ; @MAX6697_CONF_RESISTANCE
	.comm	_MAX6697_CONF_TIMEOUT,4,2       ; @MAX6697_CONF_TIMEOUT
	.comm	_MAX6693_CONF_BETA,4,2          ; @MAX6693_CONF_BETA
	.comm	_MAX6697_REG_ALERT_MASK,4,2     ; @MAX6697_REG_ALERT_MASK
	.comm	_MAX6697_REG_OVERT_MASK,4,2     ; @MAX6697_REG_OVERT_MASK
	.comm	_MAX6581_REG_IDEALITY,4,2       ; @MAX6581_REG_IDEALITY
	.comm	_MAX6581_REG_IDEALITY_SELECT,4,2 ; @MAX6581_REG_IDEALITY_SELECT
	.comm	_MAX6697_CONV_TIME,4,2          ; @MAX6697_CONV_TIME
	.no_dead_strip	_max6697_init_chip
.subsections_via_symbols
