	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmw_gmr2_bind
_vmw_gmr2_bind:                         ## @vmw_gmr2_bind
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	_VMW_PPN_PER_REMAP@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_1
## %bb.2:
	movq	%r12, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_3
LBB0_1:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
                                        ## kill: def $eax killed $eax def $rax
LBB0_3:
	cmpq	$1, %rdx
	sbbl	$-1, %eax
	movq	_VMW_PPN_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	imull	%r12d, %ecx
	leal	(%rax,%rax,8), %edx
	leal	(%rdx,%rdx,2), %edx
	addl	%eax, %edx
	leal	(%rcx,%rdx), %r13d
	addl	$28, %r13d
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_VMW_FIFO_RESERVE
	movq	%rax, %r14
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_15
LBB0_5:
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, -128(%rbp)
	movq	%r12, -120(%rbp)
	movq	_SVGA_CMD_DEFINE_GMR2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	4(%r14), %rdi
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, (%r14)
	leaq	-128(%rbp), %rsi
	movl	$24, %edx
	callq	_memcpy
	movl	%r15d, -104(%rbp)
	movq	_VMW_PPN_SIZE@GOTPCREL(%rip), %rax
	cmpq	$5, (%rax)
	jb	LBB0_6
## %bb.7:
	movq	_SVGA_REMAP_GMR2_PPN64@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_SVGA_REMAP_GMR2_PPN32@GOTPCREL(%rip), %rax
LBB0_8:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	leaq	28(%rcx), %r14
	movl	(%rax), %eax
	movl	%eax, -84(%rbp)
	testq	%r12, %r12
	je	LBB0_14
## %bb.9:
	xorl	%r15d, %r15d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %r13
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	-64(%rbp), %r15d                ## 4-byte Reload
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	addl	%eax, %r15d
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	subq	%rax, %r12
	je	LBB0_14
LBB0_10:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	_VMW_PPN_PER_REMAP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_min
	movq	%rax, %r12
	movl	%r15d, -88(%rbp)
	movq	%rax, -96(%rbp)
	movq	_SVGA_CMD_REMAP_GMR2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	4(%r14), %rdi
	movl	%eax, (%r14)
	leaq	-104(%rbp), %rsi
	movl	$24, %edx
	callq	_memcpy
	addq	$28, %r14
	testq	%r12, %r12
	movl	%r15d, -64(%rbp)                ## 4-byte Spill
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_VMW_PPN_SIZE@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_10 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	callq	_vmw_piter_dma_addr
	movzbl	(%r13), %ecx
	sarl	%cl, %eax
	movl	%eax, (%r14)
	movq	(%r15), %rax
	andq	$-4, %rax
	addq	%rax, %r14
	movq	%rbx, %rdi
	callq	_vmw_piter_next
	decq	%r12
	jne	LBB0_12
	jmp	LBB0_13
LBB0_14:
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	movslq	%ebx, %rax
	andq	$-4, %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addq	%rax, %rcx
	xorl	%edi, %edi
	cmpq	%rcx, %r14
	setne	%dil
	callq	_BUG_ON
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_vmw_fifo_commit
	xorl	%eax, %eax
LBB0_15:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VMW_PPN_PER_REMAP,8,3          ## @VMW_PPN_PER_REMAP
	.comm	_VMW_PPN_SIZE,8,3               ## @VMW_PPN_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SVGA_CMD_DEFINE_GMR2,4,2       ## @SVGA_CMD_DEFINE_GMR2
	.comm	_SVGA_REMAP_GMR2_PPN64,4,2      ## @SVGA_REMAP_GMR2_PPN64
	.comm	_SVGA_REMAP_GMR2_PPN32,4,2      ## @SVGA_REMAP_GMR2_PPN32
	.comm	_SVGA_CMD_REMAP_GMR2,4,2        ## @SVGA_CMD_REMAP_GMR2
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_vmw_gmr2_bind
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmw_gmr2_bind
_vmw_gmr2_bind:                         ; @vmw_gmr2_bind
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x24, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x25, _VMW_PPN_PER_REMAP@GOTPAGE
Lloh1:
	ldr	x25, [x25, _VMW_PPN_PER_REMAP@GOTPAGEOFF]
	ldr	x8, [x25]
	udiv	x9, x2, x8
	msub	x8, x9, x8, x2
	cmp	x8, #0
Lloh2:
	adrp	x26, _VMW_PPN_SIZE@GOTPAGE
Lloh3:
	ldr	x26, [x26, _VMW_PPN_SIZE@GOTPAGEOFF]
	cinc	w8, w9, ne
	ldr	w9, [x26]
	mul	w9, w9, w21
	mov	w10, #28
	madd	w8, w8, w10, w9
	add	w20, w8, #28
	mov	x1, x20
	bl	_VMW_FIFO_RESERVE
	mov	x23, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_2:
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	str	w24, [sp, #56]
Lloh7:
	adrp	x8, _SVGA_CMD_DEFINE_GMR2@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SVGA_CMD_DEFINE_GMR2@GOTPAGEOFF]
	str	x21, [sp, #64]
Lloh9:
	ldr	w8, [x8]
	add	x0, x23, #4
	str	x23, [sp, #8]                   ; 8-byte Folded Spill
	mov	x27, x23
	str	w8, [x27], #28
	add	x1, sp, #56
	mov	w2, #24
	bl	_memcpy
	str	w24, [sp, #32]
	ldr	x8, [x26]
Lloh10:
	adrp	x9, _SVGA_REMAP_GMR2_PPN64@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SVGA_REMAP_GMR2_PPN64@GOTPAGEOFF]
Lloh12:
	adrp	x10, _SVGA_REMAP_GMR2_PPN32@GOTPAGE
Lloh13:
	ldr	x10, [x10, _SVGA_REMAP_GMR2_PPN32@GOTPAGEOFF]
	cmp	x8, #4
	csel	x8, x9, x10, hi
	ldr	w8, [x8]
	str	w8, [sp, #52]
	cbz	x21, LBB0_8
; %bb.3:
	mov	w28, #0
Lloh14:
	adrp	x19, _SVGA_CMD_REMAP_GMR2@GOTPAGE
Lloh15:
	ldr	x19, [x19, _SVGA_CMD_REMAP_GMR2@GOTPAGEOFF]
Lloh16:
	adrp	x20, _PAGE_SHIFT@GOTPAGE
Lloh17:
	ldr	x20, [x20, _PAGE_SHIFT@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w28, w28, w23
	subs	x21, x21, x23
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	ldr	x1, [x25]
	mov	x0, x21
	bl	_min
	mov	x23, x0
	str	w28, [sp, #48]
	str	x0, [sp, #40]
	ldr	w8, [x19]
	add	x0, x27, #4
	str	w8, [x27], #28
	add	x1, sp, #32
	mov	w2, #24
	bl	_memcpy
	cbz	x23, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x24, x23
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	bl	_vmw_piter_dma_addr
	ldr	w8, [x20]
	asr	w8, w0, w8
	str	w8, [x27]
	ldr	x8, [x26]
	and	x8, x8, #0xfffffffffffffffc
	add	x27, x27, x8
	mov	x0, x22
	bl	_vmw_piter_next
	subs	x24, x24, #1
	b.ne	LBB0_7
	b	LBB0_4
LBB0_8:
	ldp	x9, x19, [sp, #8]               ; 16-byte Folded Reload
	sxtw	x8, w19
	and	x8, x8, #0xfffffffffffffffc
	add	x8, x9, x8
	cmp	x27, x8
	cset	w0, ne
	bl	_BUG_ON
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x19
	bl	_vmw_fifo_commit
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_VMW_PPN_PER_REMAP,8,3          ; @VMW_PPN_PER_REMAP
	.comm	_VMW_PPN_SIZE,8,3               ; @VMW_PPN_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SVGA_CMD_DEFINE_GMR2,4,2       ; @SVGA_CMD_DEFINE_GMR2
	.comm	_SVGA_REMAP_GMR2_PPN64,4,2      ; @SVGA_REMAP_GMR2_PPN64
	.comm	_SVGA_REMAP_GMR2_PPN32,4,2      ; @SVGA_REMAP_GMR2_PPN32
	.comm	_SVGA_CMD_REMAP_GMR2,4,2        ; @SVGA_CMD_REMAP_GMR2
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_vmw_gmr2_bind
.subsections_via_symbols
