	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max3191x_readout_locked
_max3191x_readout_locked:               ## @max3191x_readout_locked
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	72(%rdi), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_to_spi_device
	leaq	64(%r13), %rsi
	movq	%rax, %rdi
	callq	_spi_sync
	testl	%eax, %eax
	je	LBB0_1
## %bb.26:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rsi
LBB0_24:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_dev_err_ratelimited
	jmp	LBB0_25
LBB0_1:
	cmpl	$0, (%r13)
	jle	LBB0_22
## %bb.2:
	movq	_STATUS_BYTE_ENABLED@GOTPCREL(%rip), %r14
	xorl	%r12d, %r12d
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	xorl	%r15d, %r15d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	movslq	(%r13), %rax
	cmpq	%rax, %r12
	jge	LBB0_22
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	cmpq	(%r14), %rax
	jne	LBB0_14
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	56(%r13), %rax
	movl	(%rax,%r12,8), %ecx
	movl	%ecx, -56(%rbp)
	movl	4(%rax,%r12,8), %r14d
	movl	%r14d, %r15d
	andl	$248, %r15d
	movq	_max3191x_crc8@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-56(%rbp), %rsi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_crc8
	movl	%eax, %ebx
	xorl	%edx, %edx
	cmpl	%eax, %r15d
	setne	%dl
	movl	48(%r13), %esi
	movl	%r12d, %edi
	callq	___assign_bit
	cmpl	%ebx, %r15d
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_err_ratelimited
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, %r15d
	shrl	%r15d
	movl	44(%r13), %esi
	movl	%r15d, %edx
	andl	$1, %edx
	movl	%r12d, %edi
	callq	___assign_bit
	andl	$1, %r15d
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.2(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_err_ratelimited
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, 32(%r13)
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, %ebx
	shrl	$2, %ebx
	andl	$1, %ebx
	movl	%ebx, %edx
	xorl	$1, %edx
	movl	40(%r13), %esi
	movl	%r12d, %edi
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	callq	___assign_bit
	testl	%ebx, %ebx
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.3(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_err_ratelimited
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, %edx
	notl	%edx
	andl	$1, %edx
	movl	36(%r13), %esi
	movl	%r12d, %edi
	callq	___assign_bit
	andl	$5, %r14d
	cmpl	$4, %r14d
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.4(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_warn_ratelimited
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_STATUS_BYTE_ENABLED@GOTPCREL(%rip), %r14
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%r13), %rax
	testq	%rax, %rax
	je	LBB0_21
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, 32(%r13)
	jne	LBB0_21
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	%r15d, %ebx
	cmpl	$1, (%rax)
	movq	8(%rax), %rax
	movq	%r12, %rcx
	movl	$0, %edx
	cmoveq	%rdx, %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_gpiod_get_value_cansleep
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_23
## %bb.17:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	16(%r13), %esi
	movl	%r12d, %edi
	movl	%r15d, %edx
	callq	___assign_bit
	testl	%r15d, %r15d
	movl	%ebx, %r15d
	je	LBB0_21
## %bb.18:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_3 Depth=1
	testl	%r15d, %r15d
	jne	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.6(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_err_ratelimited
	jmp	LBB0_21
LBB0_22:
	xorl	%r15d, %r15d
LBB0_25:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SPI receive error %d\n"

	.comm	_STATUS_BYTE_ENABLED,8,3        ## @STATUS_BYTE_ENABLED
	.comm	_max3191x_crc8,4,2              ## @max3191x_crc8
L_.str.1:                               ## @.str.1
	.asciz	"chip %d: CRC error\n"

L_.str.2:                               ## @.str.2
	.asciz	"chip %d: overtemperature\n"

L_.str.3:                               ## @.str.3
	.asciz	"chip %d: undervoltage\n"

L_.str.4:                               ## @.str.4
	.asciz	"chip %d: voltage warn\n"

L_.str.5:                               ## @.str.5
	.asciz	"GPIO read error %d\n"

L_.str.6:                               ## @.str.6
	.asciz	"chip %d: fault\n"

	.no_dead_strip	_max3191x_readout_locked
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max3191x_readout_locked
_max3191x_readout_locked:               ; @max3191x_readout_locked
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	ldr	x19, [x0, #72]
	mov	x0, x19
	bl	_to_spi_device
	add	x1, x20, #64
	bl	_spi_sync
	cbz	w0, LBB0_3
; %bb.1:
	mov	x24, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x19
	mov	x2, x24
	bl	_dev_err_ratelimited
	b	LBB0_22
LBB0_3:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.4:
	mov	x25, #0
	mov	x21, #0
	mov	w22, #0
	mov	w28, #0
Lloh2:
	adrp	x27, _STATUS_BYTE_ENABLED@GOTPAGE
Lloh3:
	ldr	x27, [x27, _STATUS_BYTE_ENABLED@GOTPAGEOFF]
Lloh4:
	adrp	x23, _max3191x_crc8@GOTPAGE
Lloh5:
	ldr	x23, [x23, _max3191x_crc8@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x20]
	add	x25, x25, #8
	cmp	x21, x8
	b.ge	LBB0_21
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x20, #56]
	add	x8, x8, x25
	ldr	w9, [x8]
	str	w9, [sp, #12]
	ldr	w26, [x8, #4]
	and	w28, w26, #0xf8
	ldr	w0, [x23]
	add	x1, sp, #12
	mov	w2, #1
	mov	w3, #0
	bl	_crc8
	mov	x24, x0
	cmp	w28, w0
	cset	w2, ne
	ldr	w1, [x20, #48]
	mov	x0, x21
	bl	___assign_bit
	cmp	w28, w24
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	bl	_dev_err_ratelimited
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	lsr	w24, w26, #1
	ubfx	w28, w26, #1, #1
	ldr	w1, [x20, #44]
	mov	x0, x21
	mov	x2, x28
	bl	___assign_bit
	tbz	w24, #0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x21
	bl	_dev_err_ratelimited
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x20, #32]
	cbnz	w8, LBB0_16
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	ubfx	w8, w26, #2, #1
	eor	w22, w8, #0x1
	ldr	w1, [x20, #40]
	mov	x0, x21
	mov	x2, x22
	bl	___assign_bit
	tbnz	w26, #2, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x21
	bl	_dev_err_ratelimited
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	mvn	w8, w26
	and	w2, w8, #0x1
	ldr	w1, [x20, #36]
	mov	x0, x21
	bl	___assign_bit
	mov	w8, #5
	and	w8, w26, w8
	cmp	w8, #4
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x21
	bl	_dev_warn_ratelimited
LBB0_16:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_5
; %bb.17:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w9, [x20, #32]
	cbnz	w9, LBB0_5
; %bb.18:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w9, [x8]
	ldr	x8, [x8, #8]
	cmp	w9, #1
	csel	x9, xzr, x21, eq
	ldr	x0, [x8, x9, lsl #3]
	bl	_gpiod_get_value_cansleep
	mov	x24, x0
	tbnz	w0, #31, LBB0_23
; %bb.19:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x20, #16]
	mov	x0, x21
	mov	x2, x24
	bl	___assign_bit
	cmp	w24, #0
	ccmp	w22, #0, #0, ne
	ccmp	w28, #0, #0, eq
	b.ne	LBB0_5
; %bb.20:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
Lloh14:
	adrp	x1, l_.str.6@PAGE
Lloh15:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x2, x21
	bl	_dev_err_ratelimited
	b	LBB0_5
LBB0_21:
	mov	w24, #0
LBB0_22:
	mov	x0, x24
	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
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_23:
Lloh16:
	adrp	x1, l_.str.5@PAGE
Lloh17:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SPI receive error %d\n"

	.comm	_STATUS_BYTE_ENABLED,8,3        ; @STATUS_BYTE_ENABLED
	.comm	_max3191x_crc8,4,2              ; @max3191x_crc8
l_.str.1:                               ; @.str.1
	.asciz	"chip %d: CRC error\n"

l_.str.2:                               ; @.str.2
	.asciz	"chip %d: overtemperature\n"

l_.str.3:                               ; @.str.3
	.asciz	"chip %d: undervoltage\n"

l_.str.4:                               ; @.str.4
	.asciz	"chip %d: voltage warn\n"

l_.str.5:                               ; @.str.5
	.asciz	"GPIO read error %d\n"

l_.str.6:                               ; @.str.6
	.asciz	"chip %d: fault\n"

	.no_dead_strip	_max3191x_readout_locked
.subsections_via_symbols
