	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v9_0_setup_rb
_gfx_v9_0_setup_rb:                     ## @gfx_v9_0_setup_rb
	.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
	movl	(%rdi), %eax
	cltd
	idivl	4(%rdi)
	movl	%eax, %r12d
	addq	$20, %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movl	8(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movl	4(%r15), %edx
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%r13d
	cmpl	%eax, %r13d
	jge	LBB0_8
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	testl	%edx, %edx
	jle	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	movl	$-1, %ecx
	callq	_gfx_v9_0_select_se_sh
	movq	%r15, %rdi
	callq	_gfx_v9_0_get_rb_active_bitmap
	movl	4(%r15), %edx
	movl	%r13d, %ecx
	imull	%edx, %ecx
	addl	%r14d, %ecx
	imull	%r12d, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	orl	%eax, %ebx
	incl	%r14d
	cmpl	%edx, %r14d
	jl	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%r15), %eax
	jmp	LBB0_7
LBB0_1:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%r15, %rdi
	movl	$-1, %esi
	movl	$-1, %edx
	movl	$-1, %ecx
	callq	_gfx_v9_0_select_se_sh
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	%ebx, 12(%r15)
	movl	%ebx, %edi
	callq	_hweight32
	movl	%eax, 16(%r15)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_gfx_v9_0_setup_rb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_v9_0_setup_rb
_gfx_v9_0_setup_rb:                     ; @gfx_v9_0_setup_rb
	.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
	ldp	w23, w24, [x0]
	add	x20, x0, #20
	mov	x0, x20
	bl	_mutex_lock
	ldr	w9, [x19, #8]
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.1:
	mov	w22, #0
	mov	w21, #0
	ldr	w8, [x19, #4]
	sdiv	w24, w23, w24
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w22, w22, #1
	cmp	w22, w9
	b.ge	LBB0_8
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #0
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	mov	w3, #-1
	bl	_gfx_v9_0_select_se_sh
	mov	x0, x19
	bl	_gfx_v9_0_get_rb_active_bitmap
	ldr	w8, [x19, #4]
	madd	w9, w22, w8, w23
	mul	w9, w9, w24
	lsl	w9, w0, w9
	orr	w21, w9, w21
	add	w23, w23, #1
	cmp	w23, w8
	b.lt	LBB0_5
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x19, #8]
	b	LBB0_2
LBB0_7:
	mov	w21, #0
LBB0_8:
	mov	x0, x19
	mov	w1, #-1
	mov	w2, #-1
	mov	w3, #-1
	bl	_gfx_v9_0_select_se_sh
	mov	x0, x20
	bl	_mutex_unlock
	str	w21, [x19, #12]
	mov	x0, x21
	bl	_hweight32
	str	w0, [x19, #16]
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_gfx_v9_0_setup_rb
.subsections_via_symbols
