	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function telem_evtlog_read
_telem_evtlog_read:                     ## @telem_evtlog_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r13
	leaq	-48(%rbp), %rsi
	callq	_telem_get_unitconfig
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-48(%rbp), %rax
	movl	(%rax), %ecx
	cmpl	%r14d, %ecx
	cmovll	%ecx, %r14d
	movq	8(%rax), %rdi
	callq	_readq
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	xorl	%ebx, %ebx
	movq	_BYTES_PER_LONG@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rax
	movq	_TELEM_SSRAM_STARTTIME_OFFSET@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	addq	8(%rax), %rdi
	callq	_readq
	movq	%rax, 16(%r13)
	testl	%r14d, %r14d
	movq	_TELEM_SSRAM_EVTLOG_OFFSET@GOTPCREL(%rip), %rbx
	jle	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-48(%rbp), %rax
	movq	(%rbx), %rcx
	addq	8(%rax), %rcx
	movslq	(%r15), %rax
	movslq	%r12d, %rdi
	imulq	%rax, %rdi
	addq	%rcx, %rdi
	callq	_readq
	movq	8(%r13), %rcx
	movq	%rax, (%rcx,%r12,8)
	incq	%r12
	cmpq	%r12, %r14
	jne	LBB0_6
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdi
	callq	_readq
	testq	%rax, %rax
	je	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	_TELEM_SSRAM_READ_TIMEOUT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jg	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rax, %rcx
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdi
	callq	_readq
	testq	%rax, %rax
	jne	LBB0_4
LBB0_8:
	leaq	L_.str(%rip), %rdi
LBB0_9:
	callq	_pr_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_15
LBB0_1:
	movl	%eax, %r14d
	jmp	LBB0_15
LBB0_11:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_9
LBB0_14:
	movq	%rcx, %rax
	movq	%rcx, (%r13)
LBB0_15:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Ssram under update. Please Try Later\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_TELEM_SSRAM_STARTTIME_OFFSET,8,3 ## @TELEM_SSRAM_STARTTIME_OFFSET
	.comm	_TELEM_SSRAM_EVTLOG_OFFSET,8,3  ## @TELEM_SSRAM_EVTLOG_OFFSET
	.comm	_BYTES_PER_LONG,4,2             ## @BYTES_PER_LONG
	.comm	_TELEM_SSRAM_READ_TIMEOUT,4,2   ## @TELEM_SSRAM_READ_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"Timeout while reading Events\n"

	.no_dead_strip	_telem_evtlog_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function telem_evtlog_read
_telem_evtlog_read:                     ; @telem_evtlog_read
	.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	x21, x2
	mov	x20, x1
	add	x1, sp, #8
	bl	_telem_get_unitconfig
	tbnz	w0, #31, LBB0_12
; %bb.1:
	ldr	x8, [sp, #8]
	ldr	w9, [x8]
	cmp	w9, w21
	csel	w19, w9, w21, lt
	ldr	x0, [x8, #8]
	bl	_readq
	cbz	x0, LBB0_10
; %bb.2:
	mov	x21, x0
	mov	w22, #0
Lloh0:
	adrp	x23, _TELEM_SSRAM_STARTTIME_OFFSET@GOTPAGE
Lloh1:
	ldr	x23, [x23, _TELEM_SSRAM_STARTTIME_OFFSET@GOTPAGEOFF]
Lloh2:
	adrp	x24, _TELEM_SSRAM_EVTLOG_OFFSET@GOTPAGE
Lloh3:
	ldr	x24, [x24, _TELEM_SSRAM_EVTLOG_OFFSET@GOTPAGEOFF]
Lloh4:
	adrp	x25, _BYTES_PER_LONG@GOTPAGE
Lloh5:
	ldr	x25, [x25, _BYTES_PER_LONG@GOTPAGEOFF]
Lloh6:
	adrp	x26, _TELEM_SSRAM_READ_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x26, [x26, _TELEM_SSRAM_READ_TIMEOUT@GOTPAGEOFF]
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	x8, [sp, #8]
	ldr	x8, [x8, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readq
	str	x0, [x20, #16]
	cmp	w19, #1
	b.lt	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x27, #0
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [sp, #8]
	ldr	x8, [x8, #8]
	ldr	x9, [x24]
	add	x8, x9, x8
	ldrsw	x9, [x25]
	sxtw	x10, w27
	madd	x0, x9, x10, x8
	bl	_readq
	ldr	x8, [x20, #8]
	str	x0, [x8, x27, lsl #3]
	add	x27, x27, #1
	cmp	x19, x27
	b.ne	LBB0_5
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [sp, #8]
	ldr	x0, [x8, #8]
	bl	_readq
	cbz	x0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x26]
	cmp	w22, w8
	b.gt	LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	x21, x0
	b.eq	LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w22, w22, #1
	ldr	x8, [sp, #8]
	ldr	x0, [x8, #8]
	bl	_readq
	mov	x21, x0
	cbnz	x0, LBB0_3
LBB0_10:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
LBB0_11:
	bl	_pr_err
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_15
LBB0_12:
	mov	x19, x0
	b	LBB0_15
LBB0_13:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_14:
	str	x21, [x20]
LBB0_15:
	mov	x0, x19
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Ssram under update. Please Try Later\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_TELEM_SSRAM_STARTTIME_OFFSET,8,3 ; @TELEM_SSRAM_STARTTIME_OFFSET
	.comm	_TELEM_SSRAM_EVTLOG_OFFSET,8,3  ; @TELEM_SSRAM_EVTLOG_OFFSET
	.comm	_BYTES_PER_LONG,4,2             ; @BYTES_PER_LONG
	.comm	_TELEM_SSRAM_READ_TIMEOUT,4,2   ; @TELEM_SSRAM_READ_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"Timeout while reading Events\n"

	.no_dead_strip	_telem_evtlog_read
.subsections_via_symbols
