	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm501_calc_clock
_sm501_calc_clock:                      ## @sm501_calc_clock
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -76(%rbp)                 ## 4-byte Spill
	testl	%edx, %edx
	jle	LBB0_1
## %bb.2:
	movq	%r8, %r14
	movq	%rcx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$1, %r15d
	movl	$128, -72(%rbp)                 ## 4-byte Folded Spill
	movl	$64, -68(%rbp)                  ## 4-byte Folded Spill
	movl	$32, -64(%rbp)                  ## 4-byte Folded Spill
	movl	$16, -60(%rbp)                  ## 4-byte Folded Spill
	movl	$8, -56(%rbp)                   ## 4-byte Folded Spill
	movl	$4, -52(%rbp)                   ## 4-byte Folded Spill
	movl	$2, -48(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_3 Depth=1
	addl	$2, %r15d
	addl	$256, -72(%rbp)                 ## 4-byte Folded Spill
                                        ## imm = 0x100
	subl	$-128, -68(%rbp)                ## 4-byte Folded Spill
	addl	$64, -64(%rbp)                  ## 4-byte Folded Spill
	addl	$32, -60(%rbp)                  ## 4-byte Folded Spill
	addl	$16, -56(%rbp)                  ## 4-byte Folded Spill
	addl	$8, -52(%rbp)                   ## 4-byte Folded Spill
	addl	$4, -48(%rbp)                   ## 4-byte Folded Spill
	cmpl	-76(%rbp), %r15d                ## 4-byte Folded Reload
	jg	LBB0_20
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_DIV_ROUND_CLOSEST
	subq	%r13, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovsq	%rax, %rcx
	cmpq	(%r14), %rcx
	jge	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, (%r14)
	movq	%r12, (%rbx)
	movl	%r15d, 8(%rbx)
	movl	$0, 12(%rbx)
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_DIV_ROUND_CLOSEST
	subq	%r13, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovsq	%rax, %rcx
	cmpq	(%r14), %rcx
	jge	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, (%r14)
	movq	%r12, (%rbx)
	movl	%r15d, 8(%rbx)
	movl	$1, 12(%rbx)
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_DIV_ROUND_CLOSEST
	subq	%r13, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovsq	%rax, %rcx
	cmpq	(%r14), %rcx
	jge	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, (%r14)
	movq	%r12, (%rbx)
	movl	%r15d, 8(%rbx)
	movl	$2, 12(%rbx)
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_DIV_ROUND_CLOSEST
	subq	%r13, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovsq	%rax, %rcx
	cmpq	(%r14), %rcx
	jge	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, (%r14)
	movq	%r12, (%rbx)
	movl	%r15d, 8(%rbx)
	movl	$3, 12(%rbx)
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	callq	_DIV_ROUND_CLOSEST
	subq	%r13, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovsq	%rax, %rcx
	cmpq	(%r14), %rcx
	jge	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, (%r14)
	movq	%r12, (%rbx)
	movl	%r15d, 8(%rbx)
	movl	$4, 12(%rbx)
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	callq	_DIV_ROUND_CLOSEST
	subq	%r13, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovsq	%rax, %rcx
	cmpq	(%r14), %rcx
	jge	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, (%r14)
	movq	%r12, (%rbx)
	movl	%r15d, 8(%rbx)
	movl	$5, 12(%rbx)
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	callq	_DIV_ROUND_CLOSEST
	subq	%r13, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovsq	%rax, %rcx
	cmpq	(%r14), %rcx
	jge	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, (%r14)
	movq	%r12, (%rbx)
	movl	%r15d, 8(%rbx)
	movl	$6, 12(%rbx)
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movl	-72(%rbp), %esi                 ## 4-byte Reload
	callq	_DIV_ROUND_CLOSEST
	subq	%r13, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovsq	%rax, %rcx
	cmpq	(%r14), %rcx
	jge	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, (%r14)
	movq	%r12, (%rbx)
	movl	%r15d, 8(%rbx)
	movl	$7, 12(%rbx)
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_19
LBB0_1:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_20:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_sm501_calc_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sm501_calc_clock
_sm501_calc_clock:                      ; @sm501_calc_clock
	.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
	str	w2, [sp]                        ; 4-byte Folded Spill
	cmp	w2, #1
	b.lt	LBB0_19
; %bb.1:
	mov	x19, x4
	mov	x20, x3
	mov	x22, x1
	mov	x23, x0
	mov	w24, #1
	mov	w8, #128
	stp	w8, wzr, [sp, #8]               ; 8-byte Folded Spill
	mov	w8, #64
	str	w8, [sp, #4]                    ; 4-byte Folded Spill
	mov	w27, #32
	mov	w28, #16
	mov	w21, #8
	mov	w25, #2
	mov	w26, #4
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w24, w24, #2
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	add	w9, w8, #256
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	add	w8, w8, #128
	stp	w8, w9, [sp, #4]                ; 8-byte Folded Spill
	add	w27, w27, #64
	add	w28, w28, #32
	add	w21, w21, #16
	add	w26, w26, #8
	add	w25, w25, #4
	ldr	w8, [sp]                        ; 4-byte Folded Reload
	cmp	w24, w8
	b.gt	LBB0_20
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x24
	bl	_DIV_ROUND_CLOSEST
	subs	x8, x0, x23
	cneg	x8, x8, mi
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	x8, [x19]
	str	x20, [x22]
	mov	w8, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	stp	w24, wzr, [x22, #8]
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	mov	x1, x25
	bl	_DIV_ROUND_CLOSEST
	subs	x8, x0, x23
	cneg	x8, x8, mi
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	str	x8, [x19]
	str	x20, [x22]
	mov	w9, #1
	stp	w24, w9, [x22, #8]
	mov	w8, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	mov	x1, x26
	bl	_DIV_ROUND_CLOSEST
	subs	x8, x0, x23
	cneg	x8, x8, mi
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	str	x8, [x19]
	str	x20, [x22]
	mov	w8, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	mov	w8, #2
	stp	w24, w8, [x22, #8]
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_DIV_ROUND_CLOSEST
	subs	x8, x0, x23
	cneg	x8, x8, mi
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	str	x8, [x19]
	str	x20, [x22]
	mov	w8, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	mov	w8, #3
	stp	w24, w8, [x22, #8]
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	mov	x1, x28
	bl	_DIV_ROUND_CLOSEST
	subs	x8, x0, x23
	cneg	x8, x8, mi
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_3 Depth=1
	str	x8, [x19]
	str	x20, [x22]
	mov	w8, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	mov	w8, #4
	stp	w24, w8, [x22, #8]
LBB0_13:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	mov	x1, x27
	bl	_DIV_ROUND_CLOSEST
	subs	x8, x0, x23
	cneg	x8, x8, mi
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_3 Depth=1
	str	x8, [x19]
	str	x20, [x22]
	mov	w8, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	mov	w8, #5
	stp	w24, w8, [x22, #8]
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	ldr	w1, [sp, #4]                    ; 4-byte Folded Reload
	bl	_DIV_ROUND_CLOSEST
	subs	x8, x0, x23
	cneg	x8, x8, mi
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_3 Depth=1
	str	x8, [x19]
	str	x20, [x22]
	mov	w8, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	mov	w8, #6
	stp	w24, w8, [x22, #8]
LBB0_17:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	ldr	w1, [sp, #8]                    ; 4-byte Folded Reload
	bl	_DIV_ROUND_CLOSEST
	subs	x8, x0, x23
	cneg	x8, x8, mi
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_2
; %bb.18:                               ;   in Loop: Header=BB0_3 Depth=1
	str	x8, [x19]
	str	x20, [x22]
	mov	w8, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	mov	w8, #7
	stp	w24, w8, [x22, #8]
	b	LBB0_2
LBB0_19:
	str	wzr, [sp, #12]                  ; 4-byte Folded Spill
LBB0_20:
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_sm501_calc_clock
.subsections_via_symbols
