	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stmpe_read_temp
_stmpe_read_temp:                       ## @stmpe_read_temp
	.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, %r13
	movq	%rdi, %rbx
	leaq	16(%rdi), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	leaq	20(%rbx), %r12
	movq	%r12, %rdi
	callq	_reinit_completion
	movq	(%r13), %rax
	movq	%rax, (%rbx)
	movq	_STMPE_TEMP_CHANNEL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.3:
	movl	24(%rbx), %edi
	movq	_STMPE_REG_TEMP_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_STMPE_START_ONE_TEMP_CONV@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_stmpe_reg_write
	movq	_STMPE_ADC_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	jle	LBB0_4
## %bb.5:
	imulq	$449960, 8(%rbx), %rax          ## imm = 0x6DDA8
	leaq	1023(%rax), %rcx
	testq	%rax, %rax
	cmovnsq	%rax, %rcx
	shrq	$10, %rcx
	addl	$-273150, %ecx                  ## imm = 0xFFFBD502
	movl	%ecx, (%r14)
	movq	%r15, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_1:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_4:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STMPE_TEMP_CHANNEL,8,3         ## @STMPE_TEMP_CHANNEL
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_STMPE_REG_TEMP_CTRL,4,2        ## @STMPE_REG_TEMP_CTRL
	.comm	_STMPE_START_ONE_TEMP_CONV,4,2  ## @STMPE_START_ONE_TEMP_CONV
	.comm	_STMPE_ADC_TIMEOUT,4,2          ## @STMPE_ADC_TIMEOUT
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_stmpe_read_temp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stmpe_read_temp
_stmpe_read_temp:                       ; @stmpe_read_temp
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x23, x1
	mov	x21, x0
	add	x19, x0, #16
	mov	x0, x19
	bl	_mutex_lock
	add	x22, x21, #20
	mov	x0, x22
	bl	_reinit_completion
	ldr	x8, [x23]
	str	x8, [x21]
Lloh0:
	adrp	x9, _STMPE_TEMP_CHANNEL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STMPE_TEMP_CHANNEL@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	w0, [x21, #24]
Lloh3:
	adrp	x8, _STMPE_REG_TEMP_CTRL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STMPE_REG_TEMP_CTRL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _STMPE_START_ONE_TEMP_CONV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STMPE_START_ONE_TEMP_CONV@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_stmpe_reg_write
Lloh9:
	adrp	x8, _STMPE_ADC_TIMEOUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _STMPE_ADC_TIMEOUT@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_wait_for_completion_timeout
	cmp	x0, #0
	b.le	LBB0_4
; %bb.2:
	ldr	x8, [x21, #8]
	mov	w9, #56744
	movk	w9, #6, lsl #16
	mul	x8, x8, x9
	add	x9, x8, #1023
	cmp	x8, #0
	csel	x8, x9, x8, lt
	lsr	x8, x8, #10
	sub	w8, w8, #66, lsl #12            ; =270336
	sub	w8, w8, #2814
	str	w8, [x20]
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_6
LBB0_3:
	mov	x0, x19
	bl	_mutex_unlock
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
Lloh14:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_STMPE_TEMP_CHANNEL,8,3         ; @STMPE_TEMP_CHANNEL
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_STMPE_REG_TEMP_CTRL,4,2        ; @STMPE_REG_TEMP_CTRL
	.comm	_STMPE_START_ONE_TEMP_CONV,4,2  ; @STMPE_START_ONE_TEMP_CONV
	.comm	_STMPE_ADC_TIMEOUT,4,2          ; @STMPE_ADC_TIMEOUT
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_stmpe_read_temp
.subsections_via_symbols
