	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_drm_front_gem_import_sg_table ## -- Begin function xen_drm_front_gem_import_sg_table
	.p2align	4, 0x90
_xen_drm_front_gem_import_sg_table:     ## @xen_drm_front_gem_import_sg_table
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	(%rdi), %r12
	movq	(%rsi), %rax
	movq	(%rax), %r15
	movq	%r15, %rsi
	callq	_gem_create_obj
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	je	LBB0_1
## %bb.5:
	movq	%rbx, %rdi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_CAST                       ## TAILCALL
LBB0_1:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_gem_alloc_pages_array
	testl	%eax, %eax
	js	LBB0_6
## %bb.2:
	movq	%r14, 16(%rbx)
	movl	4(%rbx), %esi
	movl	8(%rbx), %ecx
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_drm_prime_sg_to_page_addr_arrays
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	movl	(%r12), %r12d
	movq	%rbx, %rdi
	callq	_xen_drm_front_dbuf_to_cookie
	movl	4(%rbx), %ecx
	movl	%ecx, (%rsp)
	movl	%r12d, %edi
	movl	%eax, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movq	%r15, %r9
	callq	_xen_drm_front_dbuf_create
	testl	%eax, %eax
	js	LBB0_6
## %bb.4:
	movl	(%r14), %edx
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	callq	_DRM_DEBUG
	movq	%rbx, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	%eax, %edi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Imported buffer of size %zu with nents %u\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_drm_front_gem_import_sg_table ; -- Begin function xen_drm_front_gem_import_sg_table
	.p2align	2
_xen_drm_front_gem_import_sg_table:     ; @xen_drm_front_gem_import_sg_table
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	ldr	x22, [x0]
	ldr	x8, [x1]
	ldr	x20, [x8]
	mov	x1, x20
	bl	_gem_create_obj
	mov	x21, x0
	bl	_IS_ERR_OR_NULL
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ERR_CAST
LBB0_2:
	mov	x0, x21
	mov	x1, x20
	bl	_gem_alloc_pages_array
	tbnz	w0, #31, LBB0_6
; %bb.3:
	str	x19, [x21, #16]
	ldp	w1, w3, [x21, #4]
	mov	x0, x19
	mov	x2, #0
	bl	_drm_prime_sg_to_page_addr_arrays
	tbnz	w0, #31, LBB0_6
; %bb.4:
	ldr	w22, [x22]
	mov	x0, x21
	bl	_xen_drm_front_dbuf_to_cookie
	mov	x1, x0
	ldr	w6, [x21, #4]
	mov	x0, x22
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	x5, x20
	bl	_xen_drm_front_dbuf_create
	tbnz	w0, #31, LBB0_6
; %bb.5:
	ldr	w2, [x19]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_DRM_DEBUG
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ERR_PTR
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Imported buffer of size %zu with nents %u\n"

.subsections_via_symbols
