	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ms_sensors_read_serial         ## -- Begin function ms_sensors_read_serial
	.p2align	4, 0x90
_ms_sensors_read_serial:                ## @ms_sensors_read_serial
	.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	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	$0, -96(%rbp)
	movl	(%rdi), %eax
	movl	%eax, -80(%rbp)
	movl	$2, -76(%rbp)
	leaq	-84(%rbp), %rcx
	movq	%rcx, -72(%rbp)
	movl	12(%rdi), %ecx
	movl	%ecx, -64(%rbp)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movl	%eax, -56(%rbp)
	leaq	-96(%rbp), %rax
	movq	%rax, -48(%rbp)
	movl	%ecx, -40(%rbp)
	movq	_MS_SENSORS_SERIAL_READ_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_be16
	movl	%eax, -84(%rbp)
	movl	$8, -52(%rbp)
	movl	8(%r15), %edi
	leaq	-80(%rbp), %rsi
	movl	$2, %edx
	callq	_i2c_transfer
	testl	%eax, %eax
	js	LBB0_9
## %bb.1:
	movq	-96(%rbp), %rdi
	callq	_be64_to_cpu
	movl	%eax, %ebx
	leaq	4(%r15), %r14
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_dbg
	movzwl	%bx, %edi
	callq	_ms_sensors_crc_valid
	testl	%eax, %eax
	je	LBB0_8
## %bb.2:
	shrl	$16, %ebx
	movl	%ebx, %edi
	callq	_ms_sensors_crc_valid
	testl	%eax, %eax
	je	LBB0_8
## %bb.3:
	callq	_ms_sensors_crc_valid
	testl	%eax, %eax
	je	LBB0_8
## %bb.4:
	callq	_ms_sensors_crc_valid
	testl	%eax, %eax
	je	LBB0_8
## %bb.5:
	movq	_MS_SENSORS_SERIAL_READ_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_be16
	movl	%eax, -84(%rbp)
	movl	$6, -52(%rbp)
	movq	$0, -96(%rbp)
	movl	8(%r15), %edi
	leaq	-80(%rbp), %rsi
	movl	$2, %edx
	callq	_i2c_transfer
	testl	%eax, %eax
	js	LBB0_13
## %bb.6:
	movq	-96(%rbp), %rdi
	callq	_be64_to_cpu
	movl	%eax, %r15d
	movl	%eax, %ebx
	sarl	$16, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_dbg
	andl	$16777215, %ebx                 ## imm = 0xFFFFFF
	movl	%ebx, %edi
	callq	_ms_sensors_crc_valid
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	sarl	$31, %r15d
	andl	$16777215, %r15d                ## imm = 0xFFFFFF
	movl	%r15d, %edi
	callq	_ms_sensors_crc_valid
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_11
LBB0_8:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_9:
	movl	%eax, %ebx
	addq	$4, %r15
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
LBB0_10:
	callq	_dev_err
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_14
## %bb.12:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	jmp	LBB0_10
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_MS_SENSORS_SERIAL_READ_MSB,4,2 ## @MS_SENSORS_SERIAL_READ_MSB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to read device serial number"

L_.str.1:                               ## @.str.1
	.asciz	"Serial MSB raw : %llx\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_MS_SENSORS_SERIAL_READ_LSB,4,2 ## @MS_SENSORS_SERIAL_READ_LSB
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ms_sensors_read_serial         ; -- Begin function ms_sensors_read_serial
	.p2align	2
_ms_sensors_read_serial:                ; @ms_sensors_read_serial
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	str	xzr, [sp, #16]
	ldr	w8, [x0]
	mov	w9, #2
	stp	w8, w9, [sp, #24]
	add	x9, sp, #12
	str	x9, [sp, #32]
	ldr	w9, [x0, #12]
Lloh3:
	adrp	x10, _I2C_M_RD@GOTPAGE
Lloh4:
	ldr	x10, [x10, _I2C_M_RD@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	orr	w8, w10, w8
	str	w9, [sp, #40]
	str	w8, [sp, #48]
	add	x8, sp, #16
	str	x8, [sp, #56]
	str	w9, [sp, #64]
Lloh6:
	adrp	x8, _MS_SENSORS_SERIAL_READ_MSB@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MS_SENSORS_SERIAL_READ_MSB@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_cpu_to_be16
	str	w0, [sp, #12]
	mov	w8, #8
	str	w8, [sp, #52]
	ldr	w0, [x19, #8]
	add	x1, sp, #24
	mov	w2, #2
	bl	_i2c_transfer
	tbnz	w0, #31, LBB0_10
; %bb.1:
	ldr	x0, [sp, #16]
	bl	_be64_to_cpu
	mov	x21, x0
	add	x20, x19, #4
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dev_dbg
	and	w0, w21, #0xffff
	bl	_ms_sensors_crc_valid
	cbz	w0, LBB0_9
; %bb.2:
	lsr	w0, w21, #16
	bl	_ms_sensors_crc_valid
	cbz	w0, LBB0_9
; %bb.3:
	bl	_ms_sensors_crc_valid
	cbz	w0, LBB0_9
; %bb.4:
	bl	_ms_sensors_crc_valid
	cbz	w0, LBB0_9
; %bb.5:
Lloh11:
	adrp	x8, _MS_SENSORS_SERIAL_READ_LSB@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MS_SENSORS_SERIAL_READ_LSB@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_cpu_to_be16
	str	w0, [sp, #12]
	mov	w8, #6
	str	w8, [sp, #52]
	str	xzr, [sp, #16]
	ldr	w0, [x19, #8]
	add	x1, sp, #24
	mov	w2, #2
	bl	_i2c_transfer
	tbnz	w0, #31, LBB0_14
; %bb.6:
	ldr	x0, [sp, #16]
	bl	_be64_to_cpu
	mov	x19, x0
	asr	w21, w0, #16
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dev_dbg
	and	w0, w21, #0xffffff
	bl	_ms_sensors_crc_valid
	cbz	w0, LBB0_9
; %bb.7:
	asr	w8, w19, #31
	and	w0, w8, #0xffffff
	bl	_ms_sensors_crc_valid
	cbz	w0, LBB0_9
; %bb.8:
	mov	w21, #0
	b	LBB0_12
LBB0_9:
Lloh16:
	adrp	x8, _ENODEV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_12
LBB0_10:
	mov	x21, x0
	add	x0, x19, #4
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
LBB0_11:
	bl	_dev_err
LBB0_12:
	ldur	x8, [x29, #-40]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.13:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_14:
	mov	x21, x0
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	b	LBB0_11
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_MS_SENSORS_SERIAL_READ_MSB,4,2 ; @MS_SENSORS_SERIAL_READ_MSB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to read device serial number"

l_.str.1:                               ; @.str.1
	.asciz	"Serial MSB raw : %llx\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_MS_SENSORS_SERIAL_READ_LSB,4,2 ; @MS_SENSORS_SERIAL_READ_LSB
.subsections_via_symbols
