	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_vgpu_get_dmabuf          ## -- Begin function intel_vgpu_get_dmabuf
	.p2align	4, 0x90
_intel_vgpu_get_dmabuf:                 ## @intel_vgpu_get_dmabuf
	.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
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movq	(%rax), %r14
	callq	_mutex_lock
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_pick_dmabuf_by_num
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %r13
	movl	12(%rax), %esi
	movq	%r14, %rdi
	callq	_vgpu_create_gem
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	%rax, %r14
	movl	12(%r13), %eax
	movl	%eax, 4(%r14)
	movq	_DRM_CLOEXEC@GOTPCREL(%rip), %rax
	movq	_DRM_RDWR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	orl	(%rax), %esi
	movq	%r14, %rdi
	callq	_i915_gem_prime_export
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_10
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	movq	%rbx, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
LBB0_4:
	movq	%r14, %rdi
	callq	_i915_gem_object_put
	jmp	LBB0_8
LBB0_5:
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_7:
	subl	(%rax), %r15d
LBB0_8:
	movq	%r12, %rdi
	callq	_mutex_unlock
LBB0_9:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%r14, %rdi
	callq	_i915_gem_object_put
	movl	(%r15), %esi
	movq	_DRM_CLOEXEC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dma_buf_fd
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_14
## %bb.11:
	movq	%r13, %rdi
	callq	_dmabuf_obj_get
	cmpl	$0, (%r13)
	je	LBB0_13
## %bb.12:
	movl	$0, (%r13)
	movq	%r13, %rdi
	callq	_dmabuf_obj_put
LBB0_13:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	4(%r12), %r12d
	movl	8(%r13), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	addq	$4, %r13
	movq	%r13, %rdi
	callq	_kref_read
	movl	%eax, %r13d
	movl	(%rbx), %edi
	callq	_file_count
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_kref_read
	movl	%eax, (%rsp)
	leaq	L_.str.4(%rip), %rdi
	movl	%r12d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	movl	%r15d, %r8d
	movl	%ebx, %r9d
	callq	_gvt_dbg_dpy
	jmp	LBB0_9
LBB0_14:
	leaq	L_.str.3(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	movq	%rbx, %rdi
	callq	_dma_buf_put
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid dmabuf id:%d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"create gvt gem obj failed\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DRM_CLOEXEC,4,2                ## @DRM_CLOEXEC
	.comm	_DRM_RDWR,4,2                   ## @DRM_RDWR
L_.str.2:                               ## @.str.2
	.asciz	"export dma-buf failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"create dma-buf fd failed ret:%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"vgpu%d: dmabuf:%d, dmabuf ref %d, fd:%d\n        file count: %ld, GEM ref: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_vgpu_get_dmabuf          ; -- Begin function intel_vgpu_get_dmabuf
	.p2align	2
_intel_vgpu_get_dmabuf:                 ; @intel_vgpu_get_dmabuf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x20
	bl	_pick_dmabuf_by_num
	cbz	x0, LBB0_5
; %bb.1:
	mov	x22, x0
	ldr	w1, [x0, #12]
	mov	x0, x21
	bl	_vgpu_create_gem
	cbz	x0, LBB0_6
; %bb.2:
	mov	x20, x0
	ldr	w8, [x22, #12]
Lloh0:
	adrp	x21, _DRM_CLOEXEC@GOTPAGE
Lloh1:
	ldr	x21, [x21, _DRM_CLOEXEC@GOTPAGEOFF]
	str	w8, [x0, #4]
	ldr	w8, [x21]
Lloh2:
	adrp	x24, _DRM_RDWR@GOTPAGE
Lloh3:
	ldr	x24, [x24, _DRM_RDWR@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w1, w9, w8
	bl	_i915_gem_prime_export
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_10
; %bb.3:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_gvt_vgpu_err
	mov	x0, x23
	bl	_PTR_ERR
	mov	x21, x0
LBB0_4:
	mov	x0, x20
	bl	_i915_gem_object_put
	b	LBB0_8
LBB0_5:
	str	x20, [sp]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gvt_vgpu_err
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_gvt_vgpu_err
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_10:
	mov	x0, x20
	bl	_i915_gem_object_put
	ldr	w8, [x21]
	ldr	w9, [x24]
	orr	w1, w9, w8
	mov	x0, x23
	bl	_dma_buf_fd
	mov	x21, x0
	tbnz	w0, #31, LBB0_14
; %bb.11:
	mov	x0, x22
	bl	_dmabuf_obj_get
	ldr	w8, [x22]
	cbz	w8, LBB0_13
; %bb.12:
	str	wzr, [x22]
	mov	x0, x22
	bl	_dmabuf_obj_put
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
	ldr	w19, [x19, #4]
	ldr	w24, [x22, #8]
	add	x0, x22, #4
	bl	_kref_read
	mov	x22, x0
	ldr	w0, [x23]
	bl	_file_count
	mov	x23, x0
	mov	x0, x20
	bl	_kref_read
	mov	x6, x0
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x19
	mov	x2, x24
	mov	x3, x22
	mov	x4, x21
	mov	x5, x23
	bl	_gvt_dbg_dpy
	b	LBB0_9
LBB0_14:
	str	x21, [sp]
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_gvt_vgpu_err
	mov	x0, x23
	bl	_dma_buf_put
	b	LBB0_4
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid dmabuf id:%d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"create gvt gem obj failed\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DRM_CLOEXEC,4,2                ; @DRM_CLOEXEC
	.comm	_DRM_RDWR,4,2                   ; @DRM_RDWR
l_.str.2:                               ; @.str.2
	.asciz	"export dma-buf failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"create dma-buf fd failed ret:%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"vgpu%d: dmabuf:%d, dmabuf ref %d, fd:%d\n        file count: %ld, GEM ref: %d\n"

.subsections_via_symbols
