	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_compat_shader_add          ## -- Begin function vmw_compat_shader_add
	.p2align	4, 0x90
_vmw_compat_shader_add:                 ## @vmw_compat_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r13
	movl	%r8d, %ebx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	%rdi, %r14
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, -104(%rbp)
	movl	%edx, %edi
	movl	%r8d, %esi
	callq	_vmw_shader_id_ok
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	movq	%rax, %r14
	movq	%rax, -96(%rbp)
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_12:
	movl	%r13d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	_vmw_bo_bo_free@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_vmw_sys_ne_placement@GOTPCREL(%rip), %rcx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%r13, %rdx
	movl	$1, %r8d
	callq	_vmw_bo_init
	movq	%r13, %rbx
	movl	%eax, %r13d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_12
## %bb.6:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_ttm_bo_reserve
	movl	%eax, %r13d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_11
## %bb.7:
	movq	%rbx, %r15
	movq	%rbx, %rdi
	callq	_PAGE_ALIGN
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_ttm_bo_kmap
	movl	%eax, %r13d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r14, %rdi
	callq	_ttm_bo_unreserve
	jmp	LBB0_11
LBB0_9:
	leaq	-48(%rbp), %r13
	leaq	-52(%rbp), %rsi
	movq	%r13, %rdi
	callq	_ttm_kmap_obj_virtual
	movl	%eax, %edi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_memcpy
	movl	-52(%rbp), %edi
	callq	_WARN_ON
	movq	%r13, %rdi
	callq	_ttm_bo_kunmap
	movq	_vmw_sys_placement@GOTPCREL(%rip), %rsi
	leaq	-104(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ttm_bo_validate
	movl	%eax, %r13d
	xorl	%ebx, %ebx
	testl	%eax, %eax
	setne	%bl
	movl	%ebx, %edi
	callq	_WARN_ON
	movq	%r14, %rdi
	callq	_ttm_bo_unreserve
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%r15, %rdx
	xorl	%ecx, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_vmw_shader_alloc
	movq	%rax, %r14
	movq	%rax, -88(%rbp)
	movl	%ebx, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movq	16(%rbp), %rbx
	movq	_vmw_cmdbuf_res_shader@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%r12d, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_vmw_shader_key
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	movl	%eax, %edx
	movq	%r14, %rcx
	movq	%rbx, %r8
	callq	_vmw_cmdbuf_res_add
	movl	%eax, %r13d
	leaq	-88(%rbp), %rdi
	callq	_vmw_resource_unreference
LBB0_11:
	leaq	-96(%rbp), %rdi
	callq	_vmw_bo_unreference
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_vmw_sys_ne_placement,4,2       ## @vmw_sys_ne_placement
	.comm	_vmw_bo_bo_free,4,2             ## @vmw_bo_bo_free
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_vmw_sys_placement,4,2          ## @vmw_sys_placement
	.comm	_vmw_cmdbuf_res_shader,4,2      ## @vmw_cmdbuf_res_shader
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_compat_shader_add          ; -- Begin function vmw_compat_shader_add
	.p2align	2
_vmw_compat_shader_add:                 ; @vmw_compat_shader_add
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x19, x6
	mov	x23, x5
	mov	x21, x4
	mov	x26, x3
	mov	x22, x2
	mov	x20, x1
	mov	x24, x0
	mov	x8, #4294967296
	str	x8, [sp, #40]
	mov	x0, x2
	mov	x1, x4
	bl	_vmw_shader_id_ok
	cbz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	mov	x25, x0
	str	x0, [sp, #32]
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_6
; %bb.2:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w27, w8
LBB0_5:
	mov	x0, x27
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_6:
Lloh7:
	adrp	x8, _vmw_bo_bo_free@GOTPAGE
Lloh8:
	ldr	x8, [x8, _vmw_bo_bo_free@GOTPAGEOFF]
Lloh9:
	ldr	w5, [x8]
Lloh10:
	adrp	x3, _vmw_sys_ne_placement@GOTPAGE
Lloh11:
	ldr	x3, [x3, _vmw_sys_ne_placement@GOTPAGEOFF]
	mov	x0, x24
	mov	x1, x25
	mov	x2, x23
	mov	w4, #1
	bl	_vmw_bo_init
	mov	x27, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_5
; %bb.7:
	mov	x0, x25
	mov	w1, #0
	mov	w2, #1
	mov	x3, #0
	bl	_ttm_bo_reserve
	mov	x27, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_12
; %bb.8:
	mov	x0, x23
	bl	_PAGE_ALIGN
Lloh12:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	asr	w2, w0, w8
	add	x3, sp, #24
	mov	x0, x25
	mov	w1, #0
	bl	_ttm_bo_kmap
	mov	x27, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_10
; %bb.9:
	mov	x0, x25
	bl	_ttm_bo_unreserve
	b	LBB0_12
LBB0_10:
	add	x0, sp, #24
	add	x1, sp, #20
	bl	_ttm_kmap_obj_virtual
	mov	x1, x26
	mov	x2, x23
	bl	_memcpy
	ldr	w0, [sp, #20]
	bl	_WARN_ON
	add	x0, sp, #24
	bl	_ttm_bo_kunmap
Lloh15:
	adrp	x1, _vmw_sys_placement@GOTPAGE
Lloh16:
	ldr	x1, [x1, _vmw_sys_placement@GOTPAGEOFF]
	add	x2, sp, #40
	mov	x0, x25
	bl	_ttm_bo_validate
	mov	x27, x0
	cmp	w0, #0
	cset	w26, ne
	mov	x0, x26
	bl	_WARN_ON
	mov	x0, x25
	bl	_ttm_bo_unreserve
	mov	x0, x24
	mov	x1, x25
	mov	x2, x23
	mov	w3, #0
	mov	x4, x21
	bl	_vmw_shader_alloc
	mov	x23, x0
	str	x0, [sp, #8]
	mov	x0, x26
	bl	_unlikely
	cbnz	x0, LBB0_12
; %bb.11:
Lloh17:
	adrp	x8, _vmw_cmdbuf_res_shader@GOTPAGE
Lloh18:
	ldr	x8, [x8, _vmw_cmdbuf_res_shader@GOTPAGEOFF]
Lloh19:
	ldr	w24, [x8]
	mov	x0, x22
	mov	x1, x21
	bl	_vmw_shader_key
	mov	x2, x0
	mov	x0, x20
	mov	x1, x24
	mov	x3, x23
	mov	x4, x19
	bl	_vmw_cmdbuf_res_add
	mov	x27, x0
	add	x0, sp, #8
	bl	_vmw_resource_unreference
LBB0_12:
	add	x0, sp, #32
	bl	_vmw_bo_unreference
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_vmw_sys_ne_placement,4,2       ; @vmw_sys_ne_placement
	.comm	_vmw_bo_bo_free,4,2             ; @vmw_bo_bo_free
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_vmw_sys_placement,4,2          ; @vmw_sys_placement
	.comm	_vmw_cmdbuf_res_shader,4,2      ; @vmw_cmdbuf_res_shader
.subsections_via_symbols
