	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_drm_front_evtchnl_create_all ## -- Begin function xen_drm_front_evtchnl_create_all
	.p2align	4, 0x90
_xen_drm_front_evtchnl_create_all:      ## @xen_drm_front_evtchnl_create_all
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	16(%rdi), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 8(%r14)
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movl	16(%r14), %ecx
	testl	%ecx, %ecx
	jle	LBB0_9
## %bb.2:
	addq	$4, %rax
	movq	_EVTCHNL_TYPE_REQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%rax, %rdx
	callq	_evtchnl_alloc
	testl	%eax, %eax
	js	LBB0_7
## %bb.3:
	movl	$12, %r13d
	xorl	%ebx, %ebx
	movq	_EVTCHNL_TYPE_EVT@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	leaq	(%rax,%r13), %rdx
	addq	$-12, %rdx
	movl	(%r12), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_evtchnl_alloc
	testl	%eax, %eax
	js	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movslq	16(%r14), %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r14), %rdx
	addq	%r13, %rdx
	movq	_EVTCHNL_TYPE_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_evtchnl_alloc
	addq	$8, %r13
	testl	%eax, %eax
	jns	LBB0_4
LBB0_7:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_11
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_11:
	movq	%r14, %rdi
	callq	_xen_drm_front_evtchnl_free_all
	jmp	LBB0_12
LBB0_9:
	movl	%ecx, (%r14)
	xorl	%r15d, %r15d
LBB0_12:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EVTCHNL_TYPE_REQ,4,2           ## @EVTCHNL_TYPE_REQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error allocating control channel\n"

	.comm	_EVTCHNL_TYPE_EVT,4,2           ## @EVTCHNL_TYPE_EVT
L_.str.1:                               ## @.str.1
	.asciz	"Error allocating in-event channel\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_drm_front_evtchnl_create_all ; -- Begin function xen_drm_front_evtchnl_create_all
	.p2align	2
_xen_drm_front_evtchnl_create_all:      ; @xen_drm_front_evtchnl_create_all
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	ldr	w0, [x0, #16]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_8
; %bb.1:
	ldr	w8, [x19, #16]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.2:
	add	x2, x0, #4
Lloh3:
	adrp	x22, _EVTCHNL_TYPE_REQ@GOTPAGE
Lloh4:
	ldr	x22, [x22, _EVTCHNL_TYPE_REQ@GOTPAGEOFF]
	ldr	w3, [x22]
	mov	x0, x19
	mov	w1, #0
	bl	_evtchnl_alloc
	tbnz	w0, #31, LBB0_7
; %bb.3:
	mov	x21, #0
	mov	w23, #12
Lloh5:
	adrp	x24, _EVTCHNL_TYPE_EVT@GOTPAGE
Lloh6:
	ldr	x24, [x24, _EVTCHNL_TYPE_EVT@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x23
	sub	x2, x8, #12
	ldr	w3, [x24]
	mov	x0, x19
	mov	x1, x21
	bl	_evtchnl_alloc
	tbnz	w0, #31, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x19, #16]
	cmp	x21, x8
	b.ge	LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	add	x2, x8, x23
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x21
	bl	_evtchnl_alloc
	add	x23, x23, #8
	tbz	w0, #31, LBB0_4
LBB0_7:
	mov	x20, x0
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_9
LBB0_8:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x19
	bl	_xen_drm_front_evtchnl_free_all
	b	LBB0_11
LBB0_10:
	mov	w20, #0
	str	w8, [x19]
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	x20, x0
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EVTCHNL_TYPE_REQ,4,2           ; @EVTCHNL_TYPE_REQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error allocating control channel\n"

	.comm	_EVTCHNL_TYPE_EVT,4,2           ; @EVTCHNL_TYPE_EVT
l_.str.1:                               ; @.str.1
	.asciz	"Error allocating in-event channel\n"

.subsections_via_symbols
