	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_drm_front_dbuf_create      ## -- Begin function xen_drm_front_dbuf_create
	.p2align	4, 0x90
_xen_drm_front_dbuf_create:             ## @xen_drm_front_dbuf_create
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -104(%rbp)                 ## 8-byte Spill
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	24(%rdi), %rbx
	movq	_GENERIC_OP_EVT_CHNL@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	xorl	%edi, %edi
	testq	%rbx, %rbx
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_16
LBB0_3:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%r13, %rdi
	movq	%rax, %rsi
	movq	%r15, %rbx
	movq	%r15, %rdx
	movq	%rax, %r15
	callq	_dbuf_add_to_list
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	leaq	-136(%rbp), %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movl	16(%r13), %eax
	movl	%eax, -108(%rbp)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-104(%rbp), %r14                ## 8-byte Reload
	movq	%r13, %rbx
	movq	%r14, %rdi
	callq	_DIV_ROUND_UP
	movl	%eax, -112(%rbp)
	movq	16(%rbp), %rax
	movq	%rax, -120(%rbp)
	movq	%r15, %r12
	movq	%r15, -128(%rbp)
	movq	8(%r13), %rax
	movq	%rax, -136(%rbp)
	leaq	-136(%rbp), %rdi
	callq	_xen_front_pgdir_shbuf_alloc
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leaq	4(%rbx), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	movq	_XENDISPL_OP_DBUF_CREATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_be_prepare_req
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%rax, %rbx
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_xen_front_pgdir_shbuf_get_dir_start
	movl	%eax, 48(%rbx)
	movq	%r14, 40(%rbx)
	movq	%r13, %r14
	movq	%r13, 32(%rbx)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%rbx)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%rbx)
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%rbx)
	cmpq	$0, -136(%rbp)
	je	LBB0_9
## %bb.8:
	movq	_XENDISPL_DBUF_FLG_REQ_ALLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_9:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_be_stream_do_io
	movl	%eax, %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	testl	%r13d, %r13d
	js	LBB0_10
## %bb.11:
	movq	%r15, %rdi
	callq	_be_stream_wait_io
	testl	%eax, %eax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	js	LBB0_13
## %bb.12:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_xen_front_pgdir_shbuf_map
	testl	%eax, %eax
	js	LBB0_13
## %bb.17:
	movq	%r15, %rdi
	callq	_mutex_unlock
	xorl	%r13d, %r13d
	jmp	LBB0_16
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_6:
	movl	%eax, %r13d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_15
LBB0_10:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_13:
	movl	%eax, %r13d
LBB0_14:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_15:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_dbuf_free
LBB0_16:
	movl	%r13d, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GENERIC_OP_EVT_CHNL,8,3        ## @GENERIC_OP_EVT_CHNL
	.comm	_EIO,4,2                        ## @EIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_XENDISPL_OP_DBUF_CREATE,4,2    ## @XENDISPL_OP_DBUF_CREATE
	.comm	_XENDISPL_DBUF_FLG_REQ_ALLOC,4,2 ## @XENDISPL_DBUF_FLG_REQ_ALLOC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_drm_front_dbuf_create      ; -- Begin function xen_drm_front_dbuf_create
	.p2align	2
_xen_drm_front_dbuf_create:             ; @xen_drm_front_dbuf_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x26, x6
	mov	x24, x5
	mov	x22, x4
	mov	x23, x3
	mov	x25, x2
	mov	x27, x1
	mov	x20, x0
	ldr	x28, [x0, #24]
Lloh0:
	adrp	x8, _GENERIC_OP_EVT_CHNL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GENERIC_OP_EVT_CHNL@GOTPAGEOFF]
Lloh2:
	ldr	x19, [x8]
	cmp	x28, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_16
LBB0_3:
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	cbz	x0, LBB0_11
; %bb.4:
	mov	x21, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x27
	bl	_dbuf_add_to_list
	mov	x0, sp
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	ldr	w8, [x20, #16]
	str	w8, [sp, #28]
Lloh8:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_DIV_ROUND_UP
	str	w0, [sp, #24]
	stp	x21, x26, [sp, #8]
	ldr	x8, [x20, #8]
	str	x8, [sp]
	mov	x0, sp
	bl	_xen_front_pgdir_shbuf_alloc
	mov	x26, x27
	tbnz	w0, #31, LBB0_12
; %bb.5:
	add	x19, x28, x19, lsl #2
	mov	x0, x19
	bl	_mutex_lock
	add	x28, x20, #4
	mov	x0, x28
	bl	_spin_lock_irqsave
Lloh11:
	adrp	x8, _XENDISPL_OP_DBUF_CREATE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _XENDISPL_OP_DBUF_CREATE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_be_prepare_req
	mov	x27, x0
	mov	x0, x21
	bl	_xen_front_pgdir_shbuf_get_dir_start
	str	w0, [x27, #48]
	stp	x26, x24, [x27, #32]
	mov	x24, x26
	stp	x23, x25, [x27, #16]
	str	x22, [x27, #8]
	ldr	x8, [sp]
	cbz	x8, LBB0_7
; %bb.6:
Lloh14:
	adrp	x8, _XENDISPL_DBUF_FLG_REQ_ALLOC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _XENDISPL_DBUF_FLG_REQ_ALLOC@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [x27]
	orr	w8, w9, w8
	str	w8, [x27]
LBB0_7:
	mov	x0, x19
	mov	x1, x27
	bl	_be_stream_do_io
	mov	x27, x0
	mov	x0, x28
	bl	_spin_unlock_irqrestore
	tbnz	w27, #31, LBB0_14
; %bb.8:
	mov	x0, x19
	bl	_be_stream_wait_io
	tbnz	w0, #31, LBB0_13
; %bb.9:
	mov	x0, x21
	bl	_xen_front_pgdir_shbuf_map
	tbnz	w0, #31, LBB0_13
; %bb.10:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w27, #0
	b	LBB0_16
LBB0_11:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_12:
	mov	x27, x0
	mov	x24, x26
	b	LBB0_15
LBB0_13:
	mov	x27, x0
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_15:
	mov	x0, x20
	mov	x1, x24
	bl	_dbuf_free
LBB0_16:
	mov	x0, x27
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_GENERIC_OP_EVT_CHNL,8,3        ; @GENERIC_OP_EVT_CHNL
	.comm	_EIO,4,2                        ; @EIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_XENDISPL_OP_DBUF_CREATE,4,2    ; @XENDISPL_OP_DBUF_CREATE
	.comm	_XENDISPL_DBUF_FLG_REQ_ALLOC,4,2 ; @XENDISPL_DBUF_FLG_REQ_ALLOC
.subsections_via_symbols
