	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_perf_rammap            ## -- Begin function nouveau_perf_rammap
	.p2align	4, 0x90
_nouveau_perf_rammap:                   ## @nouveau_perf_rammap
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	callq	_nouveau_drm
	movq	%rax, %r15
	leaq	-96(%rbp), %rdx
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	$80, %esi
	callq	_bit_table
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	cmpl	$2, -96(%rbp)
	jne	LBB0_8
## %bb.2:
	movq	-88(%rbp), %rax
	movl	16(%rax), %esi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_ROMPTR
	testq	%rax, %rax
	je	LBB0_21
## %bb.3:
	movq	%rax, %r14
	movslq	4(%rax), %rax
	movl	(%r14), %ecx
	movl	%ecx, (%r12)
	movl	8(%r14), %ecx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%ecx, (%rdx)
	movl	16(%r14), %ecx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%ecx, (%rdx)
	movl	12(%r14), %ecx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%ecx, (%rdx)
	cmpl	$0, 20(%r14)
	jle	LBB0_21
## %bb.4:
	movslq	-44(%rbp), %rcx                 ## 4-byte Folded Reload
	imulq	$274877907, %rcx, %r15          ## imm = 0x10624DD3
	movq	%r15, %rcx
	shrq	$63, %rcx
	sarq	$38, %r15
	addl	%ecx, %r15d
	leaq	(%r14,%rax,4), %r12
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movslq	(%rax), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movslq	(%rcx), %rcx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movslq	(%rdx), %rdx
	imulq	%rcx, %rdx
	addq	%rax, %rdx
	leaq	(%r12,%rdx,4), %r12
	incl	%ebx
	cmpl	20(%r14), %ebx
	jge	LBB0_21
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_ROM16
	cmpl	%eax, %r15d
	jl	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	8(%r12), %edi
	callq	_ROM16
	cmpl	%eax, %r15d
	jg	LBB0_5
	jmp	LBB0_25
LBB0_8:
	movl	(%r15), %edi
	callq	_nv_device
	cmpl	$73, (%rax)
	je	LBB0_10
## %bb.9:
	movl	(%r15), %edi
	callq	_nv_device
	cmpl	$75, (%rax)
	jne	LBB0_11
LBB0_10:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_11:
	movq	%r12, %rbx
	xorl	%r12d, %r12d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	movq	%rbx, %rdx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	callq	_nouveau_perf_entry
	testq	%rax, %rax
	je	LBB0_25
## %bb.12:
	movq	%rax, %r15
	movl	$1, %r13d
	xorl	%r12d, %r12d
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_15 Depth=1
	callq	_ROM16
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	cmpl	%eax, -44(%rbp)                 ## 4-byte Folded Reload
	jle	LBB0_24
LBB0_14:                                ##   in Loop: Header=BB0_15 Depth=1
	leal	1(%r13), %r14d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	movq	%rbx, %rdx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	callq	_nouveau_perf_entry
	movq	%rax, %r15
	movl	%r14d, %r13d
	testq	%rax, %rax
	je	LBB0_25
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	leal	-32(%rax), %ecx
	cmpl	$4, %ecx
	ja	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	cmpl	$255, (%r15)
	je	LBB0_14
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	44(%r15), %edi
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_15 Depth=1
	addl	$-37, %eax
	cmpl	$26, %eax
	ja	LBB0_14
## %bb.19:                              ##   in Loop: Header=BB0_15 Depth=1
	cmpl	$255, (%r15)
	je	LBB0_14
## %bb.20:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	48(%r15), %edi
	jmp	LBB0_13
LBB0_21:
	xorl	%r12d, %r12d
LBB0_25:
	movq	%r12, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movslq	(%rcx), %rax
	leaq	(%r15,%rax,4), %r12
	movl	$0, (%rbx)
	movl	$0, (%rcx)
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_perf_rammap            ; -- Begin function nouveau_perf_rammap
	.p2align	2
_nouveau_perf_rammap:                   ; @nouveau_perf_rammap
	.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
	mov	x20, x5
	mov	x21, x4
	mov	x19, x3
	mov	x23, x2
	mov	x22, x1
	mov	x24, x0
	bl	_nouveau_drm
	mov	x25, x0
	mov	x2, sp
	mov	x0, x24
	mov	w1, #80
	bl	_bit_table
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	w8, [sp]
	cmp	w8, #2
	b.ne	LBB0_8
; %bb.2:
	ldr	x8, [sp, #8]
	ldr	w1, [x8, #16]
	mov	x0, x24
	bl	_ROMPTR
	cbz	x0, LBB0_21
; %bb.3:
	mov	x24, x0
	ldp	w9, w8, [x0]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	str	w9, [x23]
	ldr	w9, [x0, #8]
	str	w9, [x19]
	ldr	w9, [x0, #16]
	str	w9, [x21]
	ldr	w9, [x0, #12]
	str	w9, [x20]
	ldr	w9, [x0, #20]
	cmp	w9, #1
	b.lt	LBB0_21
; %bb.4:
	mov	w23, #0
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x9, w22, w9
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w25, w9, w10
	add	x22, x24, x8, lsl #2
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x19]
	ldr	w9, [x21]
	ldr	w10, [x20]
	madd	w8, w10, w9, w8
	add	x22, x22, w8, sxtw #2
	add	w23, w23, #1
	ldr	w8, [x24, #20]
	cmp	w23, w8
	b.ge	LBB0_21
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	bl	_ROM16
	cmp	w25, w0
	b.lt	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x22, #8]
	bl	_ROM16
	cmp	w25, w0
	b.gt	LBB0_5
	b	LBB0_22
LBB0_8:
	ldr	w0, [x25]
	bl	_nv_device
	ldr	w8, [x0]
	cmp	w8, #73
	b.eq	LBB0_10
; %bb.9:
	ldr	w0, [x25]
	bl	_nv_device
	ldr	w8, [x0]
	cmp	w8, #75
	b.ne	LBB0_11
LBB0_10:
	cmp	w22, #0
	cinc	w8, w22, lt
	asr	w22, w8, #1
LBB0_11:
	mov	x0, x24
	mov	w1, #0
	mov	x2, x23
	mov	x3, x19
	mov	x4, x21
	mov	x5, x20
	bl	_nouveau_perf_entry
	cbz	x0, LBB0_21
; %bb.12:
	mov	x25, x0
	mov	w26, #1
	mov	w27, #1000
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	bl	_ROM16
	mul	w8, w0, w27
	cmp	w22, w8
	b.le	LBB0_23
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	w28, w26, #1
	mov	x0, x24
	mov	x1, x26
	mov	x2, x23
	mov	x3, x19
	mov	x4, x21
	mov	x5, x20
	bl	_nouveau_perf_entry
	mov	x25, x0
	mov	x26, x28
	cbz	x0, LBB0_21
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23]
	sub	w9, w8, #32
	cmp	w9, #4
	b.hi	LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x25]
	cmp	w8, #255
	b.eq	LBB0_14
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w0, [x25, #44]
	b	LBB0_13
LBB0_18:                                ;   in Loop: Header=BB0_15 Depth=1
	sub	w8, w8, #37
	cmp	w8, #26
	b.hi	LBB0_14
; %bb.19:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x25]
	cmp	w8, #255
	b.eq	LBB0_14
; %bb.20:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w0, [x25, #48]
	b	LBB0_13
LBB0_21:
	mov	x22, #0
LBB0_22:
	mov	x0, x22
	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
LBB0_23:
	ldrsw	x8, [x19]
	add	x22, x25, x8, lsl #2
	str	wzr, [x23]
	str	wzr, [x19]
	b	LBB0_22
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
