	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv04_timer_init
_nv04_timer_init:                       ## @nv04_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), %rbx
	movq	_NV04_PTIMER_NUMERATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_nvkm_rd32
	movl	%eax, %r12d
	movq	_NV04_PTIMER_DENOMINATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_nvkm_rd32
	testl	%r12d, %r12d
	setne	%cl
	testl	%eax, %eax
	setne	%dl
	testb	%dl, %cl
	movl	$1, %r14d
	cmovel	%r14d, %r12d
	cmovnel	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_nvkm_warn
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%r12d, %rax
	imulq	$1717986919, %rax, %rcx         ## imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$33, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	movslq	%r14d, %rcx
	imulq	$1717986919, %rcx, %rdx         ## imm = 0x66666667
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$33, %rdx
	addl	%esi, %edx
	leal	(%rdx,%rdx,4), %edx
	subl	%edx, %ecx
	orl	%eax, %ecx
	jne	LBB0_2
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movslq	%r12d, %rax
	imulq	$1717986919, %rax, %r12         ## imm = 0x66666667
	movq	%r12, %rax
	shrq	$63, %rax
	sarq	$33, %r12
	addl	%eax, %r12d
	movslq	%r14d, %rax
	imulq	$1717986919, %rax, %r14         ## imm = 0x66666667
	movq	%r14, %rax
	shrq	$63, %rax
	sarq	$33, %r14
	addl	%eax, %r14d
	jmp	LBB0_1
LBB0_2:
	movl	%r12d, %eax
	orl	%r14d, %eax
	testb	$1, %al
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jne	LBB0_3
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %r13d
	shrl	$31, %r13d
	addl	%r12d, %r13d
	sarl	%r13d
	movl	%r14d, %ebx
	shrl	$31, %ebx
	addl	%r14d, %ebx
	sarl	%ebx
	movl	%r13d, %eax
	orl	%ebx, %eax
	movl	%ebx, %r14d
	movl	%r13d, %r12d
	testb	$1, %al
	je	LBB0_10
## %bb.4:
	cmpl	$65535, %r13d                   ## imm = 0xFFFF
	jle	LBB0_5
	jmp	LBB0_6
LBB0_3:
	movl	%r12d, %r13d
	movl	%r14d, %ebx
	cmpl	$65535, %r13d                   ## imm = 0xFFFF
	jg	LBB0_6
LBB0_5:
	cmpl	$65536, %ebx                    ## imm = 0x10000
	jl	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %ecx
	movl	%ebx, %eax
	sarl	%r13d
	sarl	%ebx
	cmpl	$131071, %ecx                   ## imm = 0x1FFFF
	jg	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$131071, %eax                   ## imm = 0x1FFFF
	jg	LBB0_6
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_nvkm_debug
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_nvkm_debug
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_nvkm_debug
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_nvkm_debug
	movq	_NV04_PTIMER_NUMERATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_nvkm_wr32
	movq	_NV04_PTIMER_DENOMINATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %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
	.comm	_NV04_PTIMER_NUMERATOR,4,2      ## @NV04_PTIMER_NUMERATOR
	.comm	_NV04_PTIMER_DENOMINATOR,4,2    ## @NV04_PTIMER_DENOMINATOR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown input clock freq\n"

L_.str.1:                               ## @.str.1
	.asciz	"input frequency : %dHz\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"

	.no_dead_strip	_nv04_timer_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv04_timer_init
_nv04_timer_init:                       ; @nv04_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]
Lloh0:
	adrp	x23, _NV04_PTIMER_NUMERATOR@GOTPAGE
Lloh1:
	ldr	x23, [x23, _NV04_PTIMER_NUMERATOR@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_nvkm_rd32
	mov	x21, x0
Lloh2:
	adrp	x24, _NV04_PTIMER_DENOMINATOR@GOTPAGE
Lloh3:
	ldr	x24, [x24, _NV04_PTIMER_DENOMINATOR@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	bl	_nvkm_rd32
	cmp	w21, #0
	cset	w8, ne
	cmp	w0, #0
	cset	w9, ne
	tst	w8, w9
	csinc	w21, w21, wzr, ne
	csinc	w22, w0, wzr, ne
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_nvkm_warn
	mov	w8, #26215
	movk	w8, #26214, lsl #16
	smull	x9, w21, w8
	lsr	x10, x9, #63
	asr	x9, x9, #33
	add	w9, w9, w10
	add	w9, w9, w9, lsl #2
	sub	w9, w21, w9
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	smull	x10, w22, w8
	lsr	x11, x10, #63
	asr	x10, x10, #33
	add	w10, w10, w11
	add	w10, w10, w10, lsl #2
	sub	w10, w22, w10
	orr	w9, w9, w10
	cbnz	w9, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	smull	x9, w21, w8
	lsr	x10, x9, #63
	asr	x9, x9, #33
	smull	x11, w22, w8
	lsr	x12, x11, #63
	asr	x11, x11, #33
	add	w21, w9, w10
	smull	x9, w21, w8
	lsr	x10, x9, #63
	asr	x9, x9, #33
	add	w9, w9, w10
	add	w9, w9, w9, lsl #2
	sub	w9, w21, w9
	add	w22, w11, w12
	b	LBB0_1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	w21, #0
	cinc	w8, w21, lt
	asr	w21, w8, #1
	cmp	w22, #0
	cinc	w8, w22, lt
	asr	w22, w8, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	orr	w8, w21, w22
	tbz	w8, #0, LBB0_3
; %bb.5:
	cmp	w21, #16, lsl #12               ; =65536
	b.ge	LBB0_7
; %bb.6:
	cmp	w22, #16, lsl #12               ; =65536
	b.lt	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x9, x21
	mov	x8, x22
	asr	w21, w21, #1
	asr	w22, w22, #1
	cmp	w9, #32, lsl #12                ; =131072
	b.ge	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	cmp	w8, #32, lsl #12                ; =131072
	b.ge	LBB0_7
LBB0_9:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	w2, #0
	bl	_nvkm_debug
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_nvkm_debug
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	bl	_nvkm_debug
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	mov	w2, #0
	bl	_nvkm_debug
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x21
	bl	_nvkm_wr32
	ldr	w1, [x24]
	mov	x0, x19
	mov	x2, x22
	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 AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_NV04_PTIMER_NUMERATOR,4,2      ; @NV04_PTIMER_NUMERATOR
	.comm	_NV04_PTIMER_DENOMINATOR,4,2    ; @NV04_PTIMER_DENOMINATOR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown input clock freq\n"

l_.str.1:                               ; @.str.1
	.asciz	"input frequency : %dHz\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"

	.no_dead_strip	_nv04_timer_init
.subsections_via_symbols
