	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmw_shader_define
_vmw_shader_define:                     ## @vmw_shader_define
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r15d
	movl	%edx, %r14d
	movq	%rsi, %rbx
	callq	_vmw_priv
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_vmw_fpriv
	movq	(%rax), %r13
	movq	$0, -48(%rbp)
	movq	_SVGA3D_INVALID_ID@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_1
LBB0_6:
	cmpl	$128, %r14d
	je	LBB0_7
## %bb.8:
	cmpl	$129, %r14d
	jne	LBB0_14
## %bb.9:
	movq	_SVGA3D_SHADERTYPE_PS@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_1:
	leaq	-48(%rbp), %rdx
	movq	%r13, %rdi
	movl	%r15d, %esi
	xorl	%ecx, %ecx
	callq	_vmw_user_bo_lookup
	movl	%eax, %ebx
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_VMW_DEBUG_USER
	jmp	LBB0_13
LBB0_7:
	movq	_SVGA3D_SHADERTYPE_VS@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %r14d
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_ttm_read_lock
	movl	%eax, %ebx
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	movl	24(%rbp), %eax
	movl	16(%rbp), %r9d
	movq	-48(%rbp), %rsi
	subq	$8, %rsp
	movq	%r12, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%r14d, %r8d
	pushq	32(%rbp)
	pushq	%r13
	pushq	%rax
	callq	_vmw_user_shader_alloc
	addq	$32, %rsp
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_ttm_read_unlock
	jmp	LBB0_12
LBB0_14:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_5
LBB0_3:
	movq	-48(%rbp), %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	imull	(%rax), %ecx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	addl	%edx, %eax
	cmpl	%eax, %ecx
	jge	LBB0_6
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
LBB0_5:
	callq	_VMW_DEBUG_USER
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	leaq	-48(%rbp), %rdi
	callq	_vmw_bo_unreference
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SVGA3D_INVALID_ID,4,2          ## @SVGA3D_INVALID_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't find buffer for shader creation.\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Illegal buffer- or shader size.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SVGA3D_SHADERTYPE_VS,4,2       ## @SVGA3D_SHADERTYPE_VS
	.comm	_SVGA3D_SHADERTYPE_PS,4,2       ## @SVGA3D_SHADERTYPE_PS
L_.str.2:                               ## @.str.2
	.asciz	"Illegal shader type.\n"

	.no_dead_strip	_vmw_shader_define
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmw_shader_define
_vmw_shader_define:                     ; @vmw_shader_define
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x7
	mov	x20, x6
	mov	x21, x5
	mov	x23, x4
	mov	x26, x3
	mov	x25, x2
	mov	x24, x1
	bl	_vmw_priv
	mov	x22, x0
	mov	x0, x24
	bl	_vmw_fpriv
	ldr	x24, [x0]
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _SVGA3D_INVALID_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SVGA3D_INVALID_ID@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w26
	b.ne	LBB0_4
LBB0_1:
	cmp	w25, #128
	b.eq	LBB0_6
; %bb.2:
	cmp	w25, #129
	b.ne	LBB0_9
; %bb.3:
Lloh3:
	adrp	x8, _SVGA3D_SHADERTYPE_PS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SVGA3D_SHADERTYPE_PS@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
	add	x2, sp, #8
	mov	x0, x24
	mov	x1, x26
	mov	x3, #0
	bl	_vmw_user_bo_lookup
	mov	x26, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_10
; %bb.5:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_VMW_DEBUG_USER
	b	LBB0_14
LBB0_6:
Lloh7:
	adrp	x8, _SVGA3D_SHADERTYPE_VS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SVGA3D_SHADERTYPE_VS@GOTPAGEOFF]
LBB0_7:
	ldr	w25, [x8]
	mov	x0, x22
	mov	w1, #1
	bl	_ttm_read_lock
	mov	x26, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_13
; %bb.8:
	ldr	x8, [x29, #16]
	ldr	x1, [sp, #8]
	str	x8, [sp]
	mov	x0, x22
	mov	x2, x23
	mov	x3, x21
	mov	x4, x25
	mov	x5, x20
	mov	x6, x19
	mov	x7, x24
	bl	_vmw_user_shader_alloc
	mov	x26, x0
	mov	x0, x22
	bl	_ttm_read_unlock
	b	LBB0_13
LBB0_9:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_10:
	ldr	x8, [sp, #8]
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	mul	w8, w9, w8
	add	w9, w21, w23
	cmp	w8, w9
	b.ge	LBB0_1
; %bb.11:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_12:
	bl	_VMW_DEBUG_USER
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w26, w8
LBB0_13:
	add	x0, sp, #8
	bl	_vmw_bo_unreference
LBB0_14:
	mov	x0, x26
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_SVGA3D_INVALID_ID,4,2          ; @SVGA3D_INVALID_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't find buffer for shader creation.\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Illegal buffer- or shader size.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SVGA3D_SHADERTYPE_VS,4,2       ; @SVGA3D_SHADERTYPE_VS
	.comm	_SVGA3D_SHADERTYPE_PS,4,2       ; @SVGA3D_SHADERTYPE_PS
l_.str.2:                               ; @.str.2
	.asciz	"Illegal shader type.\n"

	.no_dead_strip	_vmw_shader_define
.subsections_via_symbols
