	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function save_sample
_save_sample:                           ## @save_sample
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	incl	%eax
	movq	_MAX_CPU_SAMPLES@GOTPCREL(%rip), %r8
	cltd
	idivl	(%r8)
	movl	%edx, (%rdi)
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.1:
	movq	_CPUSTATES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_4
## %bb.2:
	movq	8(%rbx), %rdi
	movslq	%edx, %rdx
	movq	(%rdi,%rdx,8), %rdx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rsi,%rdi,8), %rcx
	movq	%rcx, (%rdx,%rdi,8)
	incq	%rdi
	movslq	(%rax), %rcx
	cmpq	%rcx, %rdi
	jl	LBB0_3
LBB0_4:
	movl	16(%rbx), %eax
	movl	24(%rbx), %esi
	leal	1(%rax), %edx
	movl	(%r8), %ecx
	cmpl	%ecx, %eax
	cmovgel	%ecx, %edx
	movl	%edx, 16(%rbx)
	leaq	L_.str(%rip), %rdi
	callq	_HRDBG
	movq	%rbx, %rdi
	callq	_get_avg_load
	movl	%eax, 20(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_CPU_SAMPLES,4,2            ## @MAX_CPU_SAMPLES
	.comm	_CPUSTATES,4,2                  ## @CPUSTATES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sample count for CPU no. %d went to %d"

	.no_dead_strip	_save_sample
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function save_sample
_save_sample:                           ; @save_sample
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0]
	add	w9, w8, #1
Lloh0:
	adrp	x8, _MAX_CPU_SAMPLES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_CPU_SAMPLES@GOTPAGEOFF]
	ldr	w10, [x8]
	sdiv	w11, w9, w10
	msub	w11, w11, w10, w9
	str	w11, [x0]
	cbz	x1, LBB0_4
; %bb.1:
Lloh2:
	adrp	x9, _CPUSTATES@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CPUSTATES@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w10, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x10, #0
	ldr	x12, [x19, #8]
	ldr	x11, [x12, w11, sxtw #3]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x12, x10, #3
	ldr	x13, [x1, x12]
	str	x13, [x11, x12]
	add	x10, x10, #1
	ldrsw	x12, [x9]
	cmp	x10, x12
	b.lt	LBB0_3
LBB0_4:
	ldr	w9, [x19, #16]
	ldr	w8, [x8]
	cmp	w9, w8
	csinc	w2, w8, w9, ge
	str	w2, [x19, #16]
	ldr	w1, [x19, #24]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HRDBG
	mov	x0, x19
	bl	_get_avg_load
	str	w0, [x19, #20]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_CPU_SAMPLES,4,2            ; @MAX_CPU_SAMPLES
	.comm	_CPUSTATES,4,2                  ; @CPUSTATES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sample count for CPU no. %d went to %d"

	.no_dead_strip	_save_sample
.subsections_via_symbols
