	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gm200_grctx_generate_tpc_mask  ## -- Begin function gm200_grctx_generate_tpc_mask
	.p2align	4, 0x90
_gm200_grctx_generate_tpc_mask:         ## @gm200_grctx_generate_tpc_mask
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r10
	testq	%r10, %r10
	je	LBB0_1
## %bb.2:
	movq	8(%rdi), %r9
	movq	24(%rdi), %rax
	movq	(%rax), %r8
	xorl	%esi, %esi
	cmpq	$1, %r10
	jne	LBB0_4
## %bb.3:
	xorl	%r12d, %r12d
	xorl	%edx, %edx
	jmp	LBB0_6
LBB0_1:
	xorl	%edx, %edx
	jmp	LBB0_8
LBB0_4:
	movq	%r10, %r15
	andq	$-2, %r15
	leal	(%r8,%r8), %r14d
	xorl	%r12d, %r12d
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%r9,%r12,4), %ecx
	movzbl	4(%r9,%r12,4), %r11d
	movl	$-1, %ebx
	shll	%cl, %ebx
	notl	%ebx
	movl	%esi, %ecx
	shll	%cl, %ebx
	movl	$-1, %eax
	movl	%r11d, %ecx
	shll	%cl, %eax
	movslq	%ebx, %rbx
	orq	%rdx, %rbx
	notl	%eax
	leal	(%r8,%rsi), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movslq	%eax, %rdx
	orq	%rbx, %rdx
	addq	$2, %r12
	addl	%r14d, %esi
	cmpq	%r12, %r15
	jne	LBB0_5
LBB0_6:
	testb	$1, %r10b
	je	LBB0_8
## %bb.7:
	movb	(%r9,%r12,4), %cl
	movl	$-1, %eax
	shll	%cl, %eax
	notl	%eax
	imull	%r12d, %r8d
	movl	%r8d, %ecx
	shll	%cl, %eax
	cltq
	orq	%rax, %rdx
LBB0_8:
	movl	16(%rdi), %edi
	movl	$4211140, %esi                  ## imm = 0x4041C4
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nvkm_wr32                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gm200_grctx_generate_tpc_mask  ; -- Begin function gm200_grctx_generate_tpc_mask
	.p2align	2
_gm200_grctx_generate_tpc_mask:         ; @gm200_grctx_generate_tpc_mask
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	.cfi_offset w19, -8
	.cfi_offset w20, -16
	.cfi_offset w21, -24
	.cfi_offset w22, -32
	.cfi_offset w23, -40
	.cfi_offset w24, -48
	ldr	x10, [x0]
	cbz	x10, LBB0_3
; %bb.1:
	ldr	x9, [x0, #8]
	ldr	x8, [x0, #24]
	ldr	x8, [x8]
	cmp	x10, #4
	b.hs	LBB0_4
; %bb.2:
	mov	x11, #0
	mov	x2, #0
	b	LBB0_7
LBB0_3:
	mov	x2, #0
	b	LBB0_9
LBB0_4:
	mov	w16, #0
	mov	x14, #0
	mov	x15, #0
	mov	x13, #0
	mov	x12, #0
	and	x11, x10, #0xfffffffffffffffc
	lsl	w17, w8, #1
	add	w1, w17, w8
	lsl	w2, w8, #2
	add	x3, x9, #8
	mov	w4, #-1
	mov	x5, x11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w6, w7, [x3, #-8]
	lsl	w6, w4, w6
	lsl	w7, w4, w7
	ldp	w19, w20, [x3], #16
	lsl	w19, w4, w19
	lsl	w20, w4, w20
	mvn	w6, w6
	mvn	w7, w7
	mvn	w19, w19
	mvn	w20, w20
	add	w21, w8, w16
	add	w22, w17, w16
	add	w23, w1, w16
	lsl	w6, w6, w16
	lsl	w7, w7, w21
	lsl	w19, w19, w22
	lsl	w20, w20, w23
	sxtw	x6, w6
	sxtw	x7, w7
	sxtw	x19, w19
	sxtw	x20, w20
	orr	x14, x14, x6
	orr	x15, x15, x7
	orr	x13, x13, x19
	orr	x12, x12, x20
	add	w16, w16, w2
	subs	x5, x5, #4
	b.ne	LBB0_5
; %bb.6:
	orr	x14, x15, x14
	orr	x13, x13, x14
	orr	x2, x12, x13
	cmp	x10, x11
	b.eq	LBB0_9
LBB0_7:
	sub	x10, x10, x11
	mul	w12, w11, w8
	mov	w13, #-1
	add	x9, x9, x11, lsl #2
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9], #4
	lsl	w11, w13, w11
	mvn	w11, w11
	lsl	w11, w11, w12
	sxtw	x11, w11
	orr	x2, x2, x11
	add	w12, w12, w8
	subs	x10, x10, #1
	b.ne	LBB0_8
LBB0_9:
	ldr	w0, [x0, #16]
	mov	w1, #16836
	movk	w1, #64, lsl #16
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #48             ; 16-byte Folded Reload
	b	_nvkm_wr32
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
