	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function maxim_thermocouple_read
_maxim_thermocouple_read:               ## @maxim_thermocouple_read
	.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
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movl	(%rax), %eax
	movl	(%rsi), %r13d
	shll	$3, %r13d
	addl	8(%rsi), %r13d
	cmpl	$4, %eax
	je	LBB0_4
## %bb.1:
	cmpl	$2, %eax
	jne	LBB0_5
## %bb.2:
	movl	8(%r12), %edi
	leaq	-48(%rbp), %rsi
	movl	$2, %edx
	callq	_spi_read
	movl	%eax, %ebx
	movl	-48(%rbp), %edi
	callq	_be16_to_cpu
	jmp	LBB0_3
LBB0_4:
	movl	8(%r12), %edi
	leaq	-44(%rbp), %rsi
	movl	$4, %edx
	callq	_spi_read
	movl	%eax, %ebx
	movl	-44(%rbp), %edi
	callq	_be32_to_cpu
LBB0_3:
	movl	%eax, (%r14)
	testl	%ebx, %ebx
	jne	LBB0_9
	jmp	LBB0_6
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	testl	%ebx, %ebx
	jne	LBB0_9
LBB0_6:
	movl	(%r14), %edi
	movq	(%r12), %rax
	testl	%edi, 4(%rax)
	je	LBB0_8
## %bb.7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_8:
	movl	%r13d, %ecx
	sarl	%cl, %edi
	movq	16(%r15), %rsi
	decq	%rsi
	callq	_sign_extend32
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_maxim_thermocouple_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function maxim_thermocouple_read
_maxim_thermocouple_read:               ; @maxim_thermocouple_read
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x0]
	ldr	w8, [x8]
	ldr	w23, [x1, #8]
	ldr	w24, [x1]
	cmp	w8, #4
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #2
	b.ne	LBB0_4
; %bb.2:
	ldr	w0, [x21, #8]
	add	x1, sp, #12
	mov	w2, #2
	bl	_spi_read
	mov	x22, x0
	ldr	w0, [sp, #12]
	bl	_be16_to_cpu
	str	w0, [x19]
	cbnz	w22, LBB0_8
	b	LBB0_5
LBB0_3:
	ldr	w0, [x21, #8]
	add	x1, sp, #8
	mov	w2, #4
	bl	_spi_read
	mov	x22, x0
	ldr	w0, [sp, #8]
	bl	_be32_to_cpu
	str	w0, [x19]
	cbnz	w22, LBB0_8
	b	LBB0_5
LBB0_4:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	cbnz	w22, LBB0_8
LBB0_5:
	ldr	w8, [x19]
	ldr	x9, [x21]
	ldr	w9, [x9, #4]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_8
LBB0_7:
	add	w9, w23, w24, lsl #3
	asr	w0, w8, w9
	ldr	x8, [x20, #16]
	sub	x1, x8, #1
	bl	_sign_extend32
	mov	w22, #0
	str	w0, [x19]
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_maxim_thermocouple_read
.subsections_via_symbols
