	.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, %r14
	callq	_nv_device
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_nouveau_timer_init
	testl	%eax, %eax
	jne	LBB0_17
## %bb.1:
	cmpl	$65, (%rbx)
	jge	LBB0_2
## %bb.14:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_nv_warn
	movq	_NV04_PTIMER_NUMERATOR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_nv_rd32
	movl	$1, %r15d
	movq	_NV04_PTIMER_DENOMINATOR@GOTPCREL(%rip), %r13
	testl	%eax, %eax
	je	LBB0_15
## %bb.16:
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_nv_rd32
	movl	%eax, %ecx
	xorl	%eax, %eax
	movl	$1, %ebx
	testl	%ecx, %ecx
	jne	LBB0_17
	jmp	LBB0_13
LBB0_2:
	movl	4(%rbx), %ecx
	movl	$1, %r12d
	movl	%ecx, %r13d
	cmpl	$62499, %ecx                    ## imm = 0xF423
	jg	LBB0_5
## %bb.3:
	movl	$1, %r12d
	movl	%ecx, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %eax
	cltd
	idivl	%r12d
	addl	%eax, %r13d
	incl	%r12d
	cmpl	$62500, %r13d                   ## imm = 0xF424
	jl	LBB0_4
LBB0_5:
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	leal	-1(%r12), %edx
	movq	%r14, %rdi
	movl	$37408, %esi                    ## imm = 0x9220
	callq	_nv_wr32
	imull	$-858993459, %r13d, %eax        ## imm = 0xCCCCCCCD
	movl	$31250, %ecx                    ## imm = 0x7A12
	cmpl	$858993460, %eax                ## imm = 0x33333334
	jae	LBB0_6
## %bb.18:
	movslq	%r13d, %rax
	imulq	$1717986919, %rax, %r13         ## imm = 0x66666667
	movq	%r13, %rcx
	shrq	$63, %rcx
	sarq	$33, %r13
	addl	%ecx, %r13d
	imull	$-858993459, %r13d, %edx        ## imm = 0xCCCCCCCD
	addl	$429496729, %edx                ## imm = 0x19999999
	movl	$6250, %ecx                     ## imm = 0x186A
	cmpl	$858993458, %edx                ## imm = 0x33333332
	ja	LBB0_6
## %bb.19:
	imulq	$1374389535, %rax, %r13         ## imm = 0x51EB851F
	movq	%r13, %rcx
	shrq	$63, %rcx
	sarq	$35, %r13
	addl	%ecx, %r13d
	imull	$-858993459, %r13d, %edx        ## imm = 0xCCCCCCCD
	addl	$429496729, %edx                ## imm = 0x19999999
	movl	$1250, %ecx                     ## imm = 0x4E2
	cmpl	$858993458, %edx                ## imm = 0x33333332
	ja	LBB0_6
## %bb.20:
	imulq	$274877907, %rax, %r13          ## imm = 0x10624DD3
	movq	%r13, %rcx
	shrq	$63, %rcx
	sarq	$35, %r13
	addl	%ecx, %r13d
	imull	$-858993459, %r13d, %edx        ## imm = 0xCCCCCCCD
	addl	$429496729, %edx                ## imm = 0x19999999
	movl	$250, %ecx
	cmpl	$858993458, %edx                ## imm = 0x33333332
	ja	LBB0_6
## %bb.21:
	imulq	$1759218605, %rax, %r13         ## imm = 0x68DB8BAD
	movq	%r13, %rcx
	shrq	$63, %rcx
	sarq	$40, %r13
	addl	%ecx, %r13d
	imull	$-858993459, %r13d, %edx        ## imm = 0xCCCCCCCD
	addl	$429496729, %edx                ## imm = 0x19999999
	movl	$50, %ecx
	cmpl	$858993458, %edx                ## imm = 0x33333332
	ja	LBB0_6
## %bb.22:
	imulq	$351843721, %rax, %r13          ## imm = 0x14F8B589
	movq	%r13, %rcx
	shrq	$63, %rcx
	sarq	$40, %r13
	addl	%ecx, %r13d
	imull	$-858993459, %r13d, %edx        ## imm = 0xCCCCCCCD
	addl	$429496729, %edx                ## imm = 0x19999999
	movl	$10, %ecx
	cmpl	$858993458, %edx                ## imm = 0x33333332
	ja	LBB0_6
## %bb.23:
	imulq	$1125899907, %rax, %r13         ## imm = 0x431BDE83
	movq	%r13, %rax
	shrq	$63, %rax
	sarq	$44, %r13
	addl	%eax, %r13d
	movl	$2, %ecx
LBB0_6:
	testb	$1, %r13b
	jne	LBB0_7
## %bb.24:
	movl	%ecx, %ebx
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %r15d
	shrl	$31, %r15d
	addl	%r13d, %r15d
	sarl	%r15d
	shrl	$31, %ebx
	addl	%ecx, %ebx
	sarl	%ebx
	movl	%r15d, %eax
	orl	%ebx, %eax
	movl	%ebx, %ecx
	movl	%r15d, %r13d
	testb	$1, %al
	je	LBB0_25
## %bb.8:
	cmpl	$65535, %r15d                   ## imm = 0xFFFF
	jle	LBB0_9
	jmp	LBB0_10
LBB0_7:
	movl	%r13d, %r15d
	movl	%ecx, %ebx
	cmpl	$65535, %r15d                   ## imm = 0xFFFF
	jg	LBB0_10
LBB0_9:
	cmpl	$65536, %ebx                    ## imm = 0x10000
	jl	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %ecx
	movl	%ebx, %eax
	sarl	%r15d
	sarl	%ebx
	cmpl	$131071, %ecx                   ## imm = 0x1FFFF
	jg	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$131071, %eax                   ## imm = 0x1FFFF
	jg	LBB0_10
LBB0_12:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edx
	callq	_nv_debug
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_nv_debug
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_nv_debug
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_nv_debug
	imull	%r13d, %r12d
	imull	%ebx, %r12d
	movl	%r12d, %eax
	cltd
	idivl	%r15d
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_nv_debug
	movq	_NV04_PTIMER_NUMERATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_nv_wr32
	movq	_NV04_PTIMER_DENOMINATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_nv_wr32
	xorl	%ebx, %ebx
	movq	_NV04_PTIMER_INTR_EN_0@GOTPCREL(%rip), %r13
	movl	$-1, %r15d
	movq	_NV04_PTIMER_INTR_0@GOTPCREL(%rip), %r12
	jmp	LBB0_13
LBB0_15:
	movl	$1, %ebx
LBB0_13:
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_nv_wr32
	movl	(%r13), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_nv_wr32
	xorl	%eax, %eax
LBB0_17:
	addq	$8, %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	"unknown input clock freq\n"

	.comm	_NV04_PTIMER_NUMERATOR,4,2      ## @NV04_PTIMER_NUMERATOR
	.comm	_NV04_PTIMER_DENOMINATOR,4,2    ## @NV04_PTIMER_DENOMINATOR
L_.str.1:                               ## @.str.1
	.asciz	"input frequency : %dHz\n"

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

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

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

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

	.comm	_NV04_PTIMER_INTR_0,4,2         ## @NV04_PTIMER_INTR_0
	.comm	_NV04_PTIMER_INTR_EN_0,4,2      ## @NV04_PTIMER_INTR_EN_0
	.comm	_PLL_CORE,4,2                   ## @PLL_CORE
	.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	x19, x0
	bl	_nv_device
	mov	x20, x0
	mov	x0, x19
	bl	_nouveau_timer_init
	cbnz	w0, LBB0_32
; %bb.1:
	ldr	w8, [x20]
	cmp	w8, #65
	b.ge	LBB0_5
; %bb.2:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_nv_warn
Lloh2:
	adrp	x22, _NV04_PTIMER_NUMERATOR@GOTPAGE
Lloh3:
	ldr	x22, [x22, _NV04_PTIMER_NUMERATOR@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_nv_rd32
Lloh4:
	adrp	x21, _NV04_PTIMER_DENOMINATOR@GOTPAGE
Lloh5:
	ldr	x21, [x21, _NV04_PTIMER_DENOMINATOR@GOTPAGEOFF]
	cbz	w0, LBB0_11
; %bb.3:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_nv_rd32
	cbnz	w0, LBB0_31
; %bb.4:
	mov	w2, #1
Lloh6:
	adrp	x22, _NV04_PTIMER_NUMERATOR@GOTPAGE
Lloh7:
	ldr	x22, [x22, _NV04_PTIMER_NUMERATOR@GOTPAGEOFF]
	mov	w20, #1
	b	LBB0_30
LBB0_5:
	ldr	w20, [x20, #4]
	mov	w8, #62499
	mov	w21, #1
	cmp	w20, w8
	b.gt	LBB0_8
; %bb.6:
	mov	w8, #62500
	mov	x22, x20
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sdiv	w9, w22, w21
	add	w21, w21, #1
	add	w22, w9, w22
	cmp	w22, w8
	b.lt	LBB0_7
	b	LBB0_9
LBB0_8:
	mov	x22, x20
LBB0_9:
	sub	w2, w21, #1
	mov	x0, x19
	mov	w1, #37408
	bl	_nv_wr32
	mov	w8, #52429
	movk	w8, #52428, lsl #16
	mul	w9, w22, w8
	mov	w10, #13108
	movk	w10, #13107, lsl #16
	cmp	w9, w10
	b.lo	LBB0_12
; %bb.10:
	mov	w23, #31250
	b	LBB0_23
LBB0_11:
	mov	w2, #1
	mov	w20, #1
	b	LBB0_30
LBB0_12:
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x9, w22, 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_14
; %bb.13:
	mov	w23, #6250
	mov	x22, x10
	b	LBB0_23
LBB0_14:
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	smull	x10, w22, 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_16
; %bb.15:
	mov	w23, #1250
	mov	x22, x11
	b	LBB0_23
LBB0_16:
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w22, 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_18
; %bb.17:
	mov	w23, #250
	mov	x22, x11
	b	LBB0_23
LBB0_18:
	mov	w10, #35757
	movk	w10, #26843, lsl #16
	smull	x10, w22, 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_20
; %bb.19:
	mov	w23, #50
	mov	x22, x11
	b	LBB0_23
LBB0_20:
	mov	w8, #46473
	movk	w8, #5368, lsl #16
	smull	x8, w22, 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_22
; %bb.21:
	mov	w23, #10
	mov	x22, x8
	b	LBB0_23
LBB0_22:
	mov	w8, #56963
	movk	w8, #17179, lsl #16
	smull	x8, w22, w8
	lsr	x9, x8, #63
	asr	x8, x8, #44
	add	w22, w8, w9
	mov	w23, #2
LBB0_23:
	tbnz	w22, #0, LBB0_25
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	cmp	w22, #0
	cinc	w8, w22, lt
	asr	w22, w8, #1
	cmp	w23, #0
	cinc	w8, w23, lt
	asr	w23, w8, #1
	orr	w8, w22, w23
	tbz	w8, #0, LBB0_24
LBB0_25:
	cmp	w22, #16, lsl #12               ; =65536
	b.ge	LBB0_27
; %bb.26:
	cmp	w23, #16, lsl #12               ; =65536
	b.lt	LBB0_29
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	mov	x9, x22
	mov	x8, x23
	asr	w22, w22, #1
	asr	w23, w23, #1
	cmp	w9, #32, lsl #12                ; =131072
	b.ge	LBB0_27
; %bb.28:                               ;   in Loop: Header=BB0_27 Depth=1
	cmp	w8, #32, lsl #12                ; =131072
	b.ge	LBB0_27
LBB0_29:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_nv_debug
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_nv_debug
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	bl	_nv_debug
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	x2, x23
	bl	_nv_debug
	mul	w8, w21, w20
	mul	w8, w8, w23
	sdiv	w2, w8, w22
Lloh16:
	adrp	x1, l_.str.5@PAGE
Lloh17:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_nv_debug
Lloh18:
	adrp	x8, _NV04_PTIMER_NUMERATOR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _NV04_PTIMER_NUMERATOR@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_nv_wr32
Lloh21:
	adrp	x8, _NV04_PTIMER_DENOMINATOR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NV04_PTIMER_DENOMINATOR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x23
	bl	_nv_wr32
	mov	w20, #0
Lloh24:
	adrp	x21, _NV04_PTIMER_INTR_EN_0@GOTPAGE
Lloh25:
	ldr	x21, [x21, _NV04_PTIMER_INTR_EN_0@GOTPAGEOFF]
	mov	w2, #-1
Lloh26:
	adrp	x22, _NV04_PTIMER_INTR_0@GOTPAGE
Lloh27:
	ldr	x22, [x22, _NV04_PTIMER_INTR_0@GOTPAGEOFF]
LBB0_30:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_nv_wr32
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x20
	bl	_nv_wr32
LBB0_31:
	mov	w0, #0
LBB0_32:
	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
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown input clock freq\n"

	.comm	_NV04_PTIMER_NUMERATOR,4,2      ; @NV04_PTIMER_NUMERATOR
	.comm	_NV04_PTIMER_DENOMINATOR,4,2    ; @NV04_PTIMER_DENOMINATOR
l_.str.1:                               ; @.str.1
	.asciz	"input frequency : %dHz\n"

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

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

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

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

	.comm	_NV04_PTIMER_INTR_0,4,2         ; @NV04_PTIMER_INTR_0
	.comm	_NV04_PTIMER_INTR_EN_0,4,2      ; @NV04_PTIMER_INTR_EN_0
	.comm	_PLL_CORE,4,2                   ; @PLL_CORE
	.no_dead_strip	_nv04_timer_init
.subsections_via_symbols
