	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv41_timer_init
_nv41_timer_init:                       ## @nv41_timer_init
	.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	%rdi, %r15
	movq	(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%rax), %r12d
	movl	$1, %r13d
	movl	%r12d, %eax
	cmpl	$62499, %r12d                   ## imm = 0xF423
	jg	LBB0_3
## %bb.1:
	movl	$1, %r13d
	movl	%r12d, %ecx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %eax
	cltd
	idivl	%r13d
                                        ## kill: def $eax killed $eax def $rax
	addl	%ecx, %eax
	incl	%r13d
	movl	%eax, %ecx
	cmpl	$62500, %eax                    ## imm = 0xF424
	jl	LBB0_2
LBB0_3:
	imull	$-858993459, %eax, %ecx         ## imm = 0xCCCCCCCD
	movl	$31250, %edx                    ## imm = 0x7A12
	cmpl	$858993460, %ecx                ## imm = 0x33333334
	jae	LBB0_4
## %bb.11:
	movslq	%eax, %rcx
	imulq	$1717986919, %rcx, %rax         ## imm = 0x66666667
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$33, %rax
	addl	%edx, %eax
	imull	$-858993459, %eax, %esi         ## imm = 0xCCCCCCCD
	addl	$429496729, %esi                ## imm = 0x19999999
	movl	$6250, %edx                     ## imm = 0x186A
	cmpl	$858993458, %esi                ## imm = 0x33333332
	ja	LBB0_4
## %bb.12:
	imulq	$1374389535, %rcx, %rax         ## imm = 0x51EB851F
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$35, %rax
	addl	%edx, %eax
	imull	$-858993459, %eax, %esi         ## imm = 0xCCCCCCCD
	addl	$429496729, %esi                ## imm = 0x19999999
	movl	$1250, %edx                     ## imm = 0x4E2
	cmpl	$858993458, %esi                ## imm = 0x33333332
	ja	LBB0_4
## %bb.13:
	imulq	$274877907, %rcx, %rax          ## imm = 0x10624DD3
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$35, %rax
	addl	%edx, %eax
	imull	$-858993459, %eax, %esi         ## imm = 0xCCCCCCCD
	addl	$429496729, %esi                ## imm = 0x19999999
	movl	$250, %edx
	cmpl	$858993458, %esi                ## imm = 0x33333332
	ja	LBB0_4
## %bb.14:
	imulq	$1759218605, %rcx, %rax         ## imm = 0x68DB8BAD
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$40, %rax
	addl	%edx, %eax
	imull	$-858993459, %eax, %esi         ## imm = 0xCCCCCCCD
	addl	$429496729, %esi                ## imm = 0x19999999
	movl	$50, %edx
	cmpl	$858993458, %esi                ## imm = 0x33333332
	ja	LBB0_4
## %bb.15:
	imulq	$351843721, %rcx, %rax          ## imm = 0x14F8B589
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$40, %rax
	addl	%edx, %eax
	imull	$-858993459, %eax, %esi         ## imm = 0xCCCCCCCD
	addl	$429496729, %esi                ## imm = 0x19999999
	movl	$10, %edx
	cmpl	$858993458, %esi                ## imm = 0x33333332
	ja	LBB0_4
## %bb.16:
	imulq	$1125899907, %rcx, %rax         ## imm = 0x431BDE83
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$44, %rax
	addl	%ecx, %eax
	movl	$2, %edx
LBB0_4:
	testb	$1, %al
	jne	LBB0_5
## %bb.17:
	movl	%edx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, %r14d
	shrl	$31, %r14d
	addl	%eax, %r14d
	sarl	%r14d
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	movl	%r14d, %ecx
	orl	%ebx, %ecx
	movl	%ebx, %edx
	movl	%r14d, %eax
	testb	$1, %cl
	je	LBB0_18
## %bb.6:
	cmpl	$65535, %r14d                   ## imm = 0xFFFF
	jle	LBB0_7
	jmp	LBB0_8
LBB0_5:
	movl	%eax, %r14d
	movl	%edx, %ebx
	cmpl	$65535, %r14d                   ## imm = 0xFFFF
	jg	LBB0_8
LBB0_7:
	cmpl	$65536, %ebx                    ## imm = 0x10000
	jl	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %ecx
	movl	%ebx, %eax
	sarl	%r14d
	sarl	%ebx
	cmpl	$131071, %ecx                   ## imm = 0x1FFFF
	jg	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$131071, %eax                   ## imm = 0x1FFFF
	jg	LBB0_8
LBB0_10:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_nvkm_debug
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_nvkm_debug
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_nvkm_debug
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_nvkm_debug
	imull	%r13d, %r12d
	imull	%ebx, %r12d
	movl	%r12d, %eax
	cltd
	idivl	%r14d
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_nvkm_debug
	decl	%r13d
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	$37408, %esi                    ## imm = 0x9220
	movl	%r13d, %edx
	callq	_nvkm_wr32
	movq	_NV04_PTIMER_NUMERATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_nvkm_wr32
	movq	_NV04_PTIMER_DENOMINATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nvkm_wr32                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"input frequency : %dHz\n"

L_.str.1:                               ## @.str.1
	.asciz	"input multiplier: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"numerator       : %08x\n"

L_.str.3:                               ## @.str.3
	.asciz	"denominator     : %08x\n"

L_.str.4:                               ## @.str.4
	.asciz	"timer frequency : %dHz\n"

	.comm	_NV04_PTIMER_NUMERATOR,4,2      ## @NV04_PTIMER_NUMERATOR
	.comm	_NV04_PTIMER_DENOMINATOR,4,2    ## @NV04_PTIMER_DENOMINATOR
	.no_dead_strip	_nv41_timer_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv41_timer_init
_nv41_timer_init:                       ; @nv41_timer_init
	.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, x0
	ldr	x19, [x0]
	ldr	w22, [x19]
	mov	w8, #62499
	mov	w21, #1
	cmp	w22, w8
	b.gt	LBB0_3
; %bb.1:
	mov	w8, #62500
	mov	x23, x22
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	sdiv	w9, w23, w21
	add	w21, w21, #1
	add	w23, w9, w23
	cmp	w23, w8
	b.lt	LBB0_2
	b	LBB0_4
LBB0_3:
	mov	x23, x22
LBB0_4:
	mov	w8, #52429
	movk	w8, #52428, lsl #16
	mul	w9, w23, w8
	mov	w10, #13108
	movk	w10, #13107, lsl #16
	cmp	w9, w10
	b.lo	LBB0_6
; %bb.5:
	mov	w24, #31250
	b	LBB0_17
LBB0_6:
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x9, w23, w9
	lsr	x10, x9, #63
	asr	x9, x9, #33
	add	w10, w9, w10
	mov	w9, #39321
	movk	w9, #6553, lsl #16
	madd	w11, w10, w8, w9
	mov	w8, #13106
	movk	w8, #13107, lsl #16
	cmp	w11, w8
	b.ls	LBB0_8
; %bb.7:
	mov	w24, #6250
	mov	x23, x10
	b	LBB0_17
LBB0_8:
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	smull	x10, w23, w10
	lsr	x11, x10, #63
	asr	x10, x10, #35
	add	w11, w10, w11
	mov	w10, #52429
	movk	w10, #52428, lsl #16
	madd	w9, w11, w10, w9
	cmp	w9, w8
	b.ls	LBB0_10
; %bb.9:
	mov	w24, #1250
	mov	x23, x11
	b	LBB0_17
LBB0_10:
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w23, w8
	lsr	x9, x8, #63
	asr	x8, x8, #35
	add	w11, w8, w9
	mov	w8, #39321
	movk	w8, #6553, lsl #16
	madd	w10, w11, w10, w8
	mov	w9, #13106
	movk	w9, #13107, lsl #16
	cmp	w10, w9
	b.ls	LBB0_12
; %bb.11:
	mov	w24, #250
	mov	x23, x11
	b	LBB0_17
LBB0_12:
	mov	w10, #35757
	movk	w10, #26843, lsl #16
	smull	x10, w23, w10
	lsr	x11, x10, #63
	asr	x10, x10, #40
	add	w11, w10, w11
	mov	w10, #52429
	movk	w10, #52428, lsl #16
	madd	w8, w11, w10, w8
	cmp	w8, w9
	b.ls	LBB0_14
; %bb.13:
	mov	w24, #50
	mov	x23, x11
	b	LBB0_17
LBB0_14:
	mov	w8, #46473
	movk	w8, #5368, lsl #16
	smull	x8, w23, w8
	lsr	x9, x8, #63
	asr	x8, x8, #40
	add	w8, w8, w9
	mov	w9, #39321
	movk	w9, #6553, lsl #16
	madd	w9, w8, w10, w9
	mov	w10, #13106
	movk	w10, #13107, lsl #16
	cmp	w9, w10
	b.ls	LBB0_16
; %bb.15:
	mov	w24, #10
	mov	x23, x8
	b	LBB0_17
LBB0_16:
	mov	w8, #56963
	movk	w8, #17179, lsl #16
	smull	x8, w23, w8
	lsr	x9, x8, #63
	asr	x8, x8, #44
	add	w23, w8, w9
	mov	w24, #2
LBB0_17:
	tbnz	w23, #0, LBB0_19
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	cmp	w23, #0
	cinc	w8, w23, lt
	asr	w23, w8, #1
	cmp	w24, #0
	cinc	w8, w24, lt
	asr	w24, w8, #1
	orr	w8, w23, w24
	tbz	w8, #0, LBB0_18
LBB0_19:
	cmp	w23, #16, lsl #12               ; =65536
	b.ge	LBB0_21
; %bb.20:
	cmp	w24, #16, lsl #12               ; =65536
	b.lt	LBB0_23
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	mov	x9, x23
	mov	x8, x24
	asr	w23, w23, #1
	asr	w24, w24, #1
	cmp	w9, #32, lsl #12                ; =131072
	b.ge	LBB0_21
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	cmp	w8, #32, lsl #12                ; =131072
	b.ge	LBB0_21
LBB0_23:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	bl	_nvkm_debug
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_nvkm_debug
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x23
	bl	_nvkm_debug
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x2, x24
	bl	_nvkm_debug
	mul	w8, w21, w22
	mul	w8, w8, w24
	sdiv	w2, w8, w23
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_nvkm_debug
	sub	w2, w21, #1
	mov	x0, x19
	mov	w1, #37408
	bl	_nvkm_wr32
Lloh10:
	adrp	x8, _NV04_PTIMER_NUMERATOR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NV04_PTIMER_NUMERATOR@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x23
	bl	_nvkm_wr32
Lloh13:
	adrp	x8, _NV04_PTIMER_DENOMINATOR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NV04_PTIMER_DENOMINATOR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x24
	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
	b	_nvkm_wr32
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"input frequency : %dHz\n"

l_.str.1:                               ; @.str.1
	.asciz	"input multiplier: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"numerator       : %08x\n"

l_.str.3:                               ; @.str.3
	.asciz	"denominator     : %08x\n"

l_.str.4:                               ; @.str.4
	.asciz	"timer frequency : %dHz\n"

	.comm	_NV04_PTIMER_NUMERATOR,4,2      ; @NV04_PTIMER_NUMERATOR
	.comm	_NV04_PTIMER_DENOMINATOR,4,2    ; @NV04_PTIMER_DENOMINATOR
	.no_dead_strip	_nv41_timer_init
.subsections_via_symbols
