	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max14656_hw_init
_max14656_hw_init:                      ## @max14656_hw_init
	.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
	movl	$0, -20(%rbp)
	movq	(%rdi), %rbx
	movq	_MAX14656_DEVICE_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_max14656_read_reg
	testq	%rax, %rax
	jne	LBB0_1
## %bb.3:
	movl	-20(%rbp), %r14d
	movq	_DEVICE_VENDOR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%r14d, %edx
	cmpl	$32, %edx
	jne	LBB0_4
## %bb.5:
	movq	_DEVICE_REV_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	movq	_MAX14656_CONTROL_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CONTROL2_ADC_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_max14656_write_reg
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:
	movq	_CONTROL1_DEFAULT@GOTPCREL(%rip), %rax
	movq	_CONTROL1_INT_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_MAX14656_CONTROL_1@GOTPCREL(%rip), %rax
	movq	_CONTROL1_INT_ACTIVE_HIGH@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	(%rax), %esi
	movq	_CONTROL1_EDGE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_max14656_write_reg
	testq	%rax, %rax
	jne	LBB0_6
## %bb.8:
	movq	_MAX14656_INTMASK_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$3, %edx
	callq	_max14656_write_reg
	testq	%rax, %rax
	jne	LBB0_6
## %bb.9:
	movq	_MAX14656_INTMASK_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_max14656_write_reg
	testq	%rax, %rax
	je	LBB0_10
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_4:
	sarl	$4, %edx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_dev_info
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX14656_DEVICE_ID,4,2         ## @MAX14656_DEVICE_ID
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_DEVICE_VENDOR_MASK,4,2         ## @DEVICE_VENDOR_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wrong vendor ID %d\n"

	.comm	_DEVICE_REV_MASK,4,2            ## @DEVICE_REV_MASK
	.comm	_MAX14656_CONTROL_2,4,2         ## @MAX14656_CONTROL_2
	.comm	_CONTROL2_ADC_EN,4,2            ## @CONTROL2_ADC_EN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX14656_CONTROL_1,4,2         ## @MAX14656_CONTROL_1
	.comm	_CONTROL1_DEFAULT,4,2           ## @CONTROL1_DEFAULT
	.comm	_CONTROL1_INT_EN,4,2            ## @CONTROL1_INT_EN
	.comm	_CONTROL1_INT_ACTIVE_HIGH,4,2   ## @CONTROL1_INT_ACTIVE_HIGH
	.comm	_CONTROL1_EDGE,4,2              ## @CONTROL1_EDGE
	.comm	_MAX14656_INTMASK_1,4,2         ## @MAX14656_INTMASK_1
	.comm	_MAX14656_INTMASK_2,4,2         ## @MAX14656_INTMASK_2
L_.str.1:                               ## @.str.1
	.asciz	"detected revision %d\n"

	.no_dead_strip	_max14656_hw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max14656_hw_init
_max14656_hw_init:                      ; @max14656_hw_init
	.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
	str	wzr, [sp, #12]
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _MAX14656_DEVICE_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX14656_DEVICE_ID@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_max14656_read_reg
	cbnz	x0, LBB0_8
; %bb.1:
	ldr	w20, [sp, #12]
Lloh3:
	adrp	x8, _DEVICE_VENDOR_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DEVICE_VENDOR_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w20
	cmp	w8, #32
	b.ne	LBB0_7
; %bb.2:
Lloh6:
	adrp	x8, _DEVICE_REV_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DEVICE_REV_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
Lloh9:
	adrp	x8, _MAX14656_CONTROL_2@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAX14656_CONTROL_2@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _CONTROL2_ADC_EN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CONTROL2_ADC_EN@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_max14656_write_reg
	cbnz	x0, LBB0_6
; %bb.3:
Lloh15:
	adrp	x8, _MAX14656_CONTROL_1@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MAX14656_CONTROL_1@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _CONTROL1_DEFAULT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CONTROL1_DEFAULT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _CONTROL1_INT_EN@GOTPAGE
Lloh22:
	ldr	x9, [x9, _CONTROL1_INT_EN@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh24:
	adrp	x9, _CONTROL1_INT_ACTIVE_HIGH@GOTPAGE
Lloh25:
	ldr	x9, [x9, _CONTROL1_INT_ACTIVE_HIGH@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh27:
	adrp	x9, _CONTROL1_EDGE@GOTPAGE
Lloh28:
	ldr	x9, [x9, _CONTROL1_EDGE@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_max14656_write_reg
	cbnz	x0, LBB0_6
; %bb.4:
Lloh30:
	adrp	x8, _MAX14656_INTMASK_1@GOTPAGE
Lloh31:
	ldr	x8, [x8, _MAX14656_INTMASK_1@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #3
	bl	_max14656_write_reg
	cbnz	x0, LBB0_6
; %bb.5:
Lloh33:
	adrp	x8, _MAX14656_INTMASK_2@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MAX14656_INTMASK_2@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_max14656_write_reg
	cbz	x0, LBB0_11
LBB0_6:
Lloh36:
	adrp	x8, _EINVAL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
	asr	w2, w8, #4
Lloh38:
	adrp	x1, l_.str@PAGE
Lloh39:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_8:
Lloh40:
	adrp	x8, _ENODEV@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
LBB0_11:
	and	w2, w21, w20
Lloh42:
	adrp	x1, l_.str.1@PAGE
Lloh43:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	mov	w0, #0
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX14656_DEVICE_ID,4,2         ; @MAX14656_DEVICE_ID
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_DEVICE_VENDOR_MASK,4,2         ; @DEVICE_VENDOR_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wrong vendor ID %d\n"

	.comm	_DEVICE_REV_MASK,4,2            ; @DEVICE_REV_MASK
	.comm	_MAX14656_CONTROL_2,4,2         ; @MAX14656_CONTROL_2
	.comm	_CONTROL2_ADC_EN,4,2            ; @CONTROL2_ADC_EN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX14656_CONTROL_1,4,2         ; @MAX14656_CONTROL_1
	.comm	_CONTROL1_DEFAULT,4,2           ; @CONTROL1_DEFAULT
	.comm	_CONTROL1_INT_EN,4,2            ; @CONTROL1_INT_EN
	.comm	_CONTROL1_INT_ACTIVE_HIGH,4,2   ; @CONTROL1_INT_ACTIVE_HIGH
	.comm	_CONTROL1_EDGE,4,2              ; @CONTROL1_EDGE
	.comm	_MAX14656_INTMASK_1,4,2         ; @MAX14656_INTMASK_1
	.comm	_MAX14656_INTMASK_2,4,2         ; @MAX14656_INTMASK_2
l_.str.1:                               ; @.str.1
	.asciz	"detected revision %d\n"

	.no_dead_strip	_max14656_hw_init
.subsections_via_symbols
