	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_dx_shader_add              ## -- Begin function vmw_dx_shader_add
	.p2align	4, 0x90
_vmw_dx_shader_add:                     ## @vmw_dx_shader_add
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r15
	movl	%ecx, %ebx
	movl	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rsi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	$1, -72(%rbp)
	movq	_vmw_shader_dx_size@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	jne	LBB0_2
## %bb.1:
	movl	$40, %edi
	callq	_ttm_round_pot
	movq	%rax, (%r12)
LBB0_2:
	movl	%r13d, %edi
	movl	%ebx, %esi
	callq	_vmw_shader_id_ok
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_vmw_mem_glob
	movq	(%r12), %rsi
	leaq	-72(%rbp), %rdx
	movl	%eax, %edi
	callq	_ttm_mem_global_alloc
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %r15d
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	je	LBB0_14
## %bb.7:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_14
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_14
LBB0_8:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, %rbx
	leaq	24(%rax), %r12
	movq	%r12, -80(%rbp)
	movq	%r14, 16(%rax)
	movq	_SVGA_COTABLE_DXSHADER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_vmw_context_cotable
	movl	%eax, %edi
	callq	_vmw_resource_reference
	movl	%eax, 12(%rbx)
	movl	%r13d, 4(%rbx)
	movl	$0, (%rbx)
	movq	%rbx, %rdi
	addq	$8, %rdi
	callq	_INIT_LIST_HEAD
	movq	_vmw_dx_shader_res_free@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_vmw_dx_shader_func@GOTPCREL(%rip), %r8
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_vmw_resource_init
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:
	movq	_vmw_cmdbuf_res_shader@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%r13d, %edi
	xorl	%esi, %esi
	callq	_vmw_shader_key
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	movl	%eax, %edx
	movq	%r12, %rcx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	callq	_vmw_cmdbuf_res_add
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:
	movl	4(%rbx), %eax
	movl	%eax, 28(%rbx)
	movq	_vmw_hw_shader_destroy@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	xorl	%r15d, %r15d
LBB0_13:
	leaq	-80(%rbp), %rdi
	callq	_vmw_resource_unreference
LBB0_14:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_vmw_mem_glob
	movq	(%r12), %rsi
	movl	%eax, %edi
	callq	_ttm_mem_global_free
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_vmw_shader_dx_size,8,3         ## @vmw_shader_dx_size
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Out of graphics memory for shader creation.\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SVGA_COTABLE_DXSHADER,4,2      ## @SVGA_COTABLE_DXSHADER
	.comm	_vmw_dx_shader_res_free,4,2     ## @vmw_dx_shader_res_free
	.comm	_vmw_dx_shader_func,4,2         ## @vmw_dx_shader_func
	.comm	_vmw_cmdbuf_res_shader,4,2      ## @vmw_cmdbuf_res_shader
	.comm	_vmw_hw_shader_destroy,4,2      ## @vmw_hw_shader_destroy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_dx_shader_add              ; -- Begin function vmw_dx_shader_add
	.p2align	2
_vmw_dx_shader_add:                     ; @vmw_dx_shader_add
	.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, x4
	mov	x23, x3
	mov	x21, x2
	mov	x24, x1
	mov	x20, x0
	ldr	x22, [x1, #8]
	mov	w8, #1
	str	x8, [sp]
Lloh0:
	adrp	x25, _vmw_shader_dx_size@GOTPAGE
Lloh1:
	ldr	x25, [x25, _vmw_shader_dx_size@GOTPAGEOFF]
	ldr	x8, [x25]
	cbnz	x8, LBB0_2
; %bb.1:
	mov	w0, #40
	bl	_ttm_round_pot
	str	x0, [x25]
LBB0_2:
	mov	x0, x21
	mov	x1, x23
	bl	_vmw_shader_id_ok
	cbz	w0, LBB0_6
; %bb.3:
	mov	x0, x22
	bl	_vmw_mem_glob
	ldr	x1, [x25]
	mov	x2, sp
	bl	_ttm_mem_global_alloc
	cbz	w0, LBB0_8
; %bb.4:
	mov	x26, x0
Lloh2:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_13
; %bb.5:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_13
LBB0_6:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_13
LBB0_8:
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kmalloc
	cbz	x0, LBB0_14
; %bb.9:
	mov	x23, x0
	add	x25, x0, #24
	str	x25, [sp, #8]
	str	x24, [x0, #16]
Lloh12:
	adrp	x8, _SVGA_COTABLE_DXSHADER@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SVGA_COTABLE_DXSHADER@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_vmw_context_cotable
	bl	_vmw_resource_reference
	str	w0, [x23, #12]
	stp	wzr, w21, [x23]
	add	x0, x23, #8
	bl	_INIT_LIST_HEAD
Lloh15:
	adrp	x8, _vmw_dx_shader_res_free@GOTPAGE
Lloh16:
	ldr	x8, [x8, _vmw_dx_shader_res_free@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
Lloh18:
	adrp	x4, _vmw_dx_shader_func@GOTPAGE
Lloh19:
	ldr	x4, [x4, _vmw_dx_shader_func@GOTPAGEOFF]
	mov	x0, x22
	mov	x1, x25
	mov	w2, #1
	bl	_vmw_resource_init
	mov	x26, x0
	cbnz	w0, LBB0_12
; %bb.10:
Lloh20:
	adrp	x8, _vmw_cmdbuf_res_shader@GOTPAGE
Lloh21:
	ldr	x8, [x8, _vmw_cmdbuf_res_shader@GOTPAGEOFF]
Lloh22:
	ldr	w22, [x8]
	mov	x0, x21
	mov	w1, #0
	bl	_vmw_shader_key
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	mov	x3, x25
	mov	x4, x19
	bl	_vmw_cmdbuf_res_add
	mov	x26, x0
	cbnz	w0, LBB0_12
; %bb.11:
	ldr	w8, [x23, #4]
Lloh23:
	adrp	x9, _vmw_hw_shader_destroy@GOTPAGE
Lloh24:
	ldr	x9, [x9, _vmw_hw_shader_destroy@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	stp	w9, w8, [x23, #24]
LBB0_12:
	add	x0, sp, #8
	bl	_vmw_resource_unreference
LBB0_13:
	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
LBB0_14:
	mov	x0, x22
	bl	_vmw_mem_glob
	ldr	x1, [x25]
	bl	_ttm_mem_global_free
Lloh26:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_vmw_shader_dx_size,8,3         ; @vmw_shader_dx_size
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Out of graphics memory for shader creation.\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SVGA_COTABLE_DXSHADER,4,2      ; @SVGA_COTABLE_DXSHADER
	.comm	_vmw_dx_shader_res_free,4,2     ; @vmw_dx_shader_res_free
	.comm	_vmw_dx_shader_func,4,2         ; @vmw_dx_shader_func
	.comm	_vmw_cmdbuf_res_shader,4,2      ; @vmw_cmdbuf_res_shader
	.comm	_vmw_hw_shader_destroy,4,2      ; @vmw_hw_shader_destroy
.subsections_via_symbols
