	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function clone_engines
_clone_engines:                         ## @clone_engines
	.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	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_i915_gem_context_lock_engines
	movq	%rax, %r13
	movq	_engines@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r13), %rdx
	movq	%r13, %rdi
	callq	_struct_size
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movq	%rax, %r12
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	addq	$16, %rdi
	callq	_init_rcu_head
	movq	(%r13), %rax
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_2
LBB0_10:
	movq	%rbx, (%r12)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_i915_gem_context_user_engines
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_i915_gem_context_unlock_engines
	movl	(%r15), %edi
	callq	_free_engines
	movl	(%r15), %edi
	movq	%r12, %rsi
	callq	_RCU_INIT_POINTER
	movq	%r15, %rdi
	testl	%r14d, %r14d
	je	LBB0_12
## %bb.11:
	callq	_i915_gem_context_set_user_engines
	xorl	%eax, %eax
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r12), %rcx
	movq	$0, (%rcx,%rbx,8)
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	cmpq	%rax, %rbx
	jae	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rcx
	movq	(%rcx,%rbx,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rcx), %r14
	movq	%r14, %rdi
	callq	_intel_engine_is_virtual
	movq	%r15, %rdi
	movq	%r14, %rsi
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	callq	_intel_execlists_clone_virtual
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	callq	_intel_context_create
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r12), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	jne	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rax
	jmp	LBB0_9
LBB0_12:
	callq	_i915_gem_context_clear_user_engines
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_13:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	___free_engines
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_14:
	movq	%rbx, %rdi
	callq	_i915_gem_context_unlock_engines
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_engines,4,2                    ## @engines
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_clone_engines
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function clone_engines
_clone_engines:                         ; @clone_engines
	.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	x20, x1
	mov	x19, x0
	mov	x0, x1
	bl	_i915_gem_context_lock_engines
	mov	x22, x0
Lloh0:
	adrp	x8, _engines@GOTPAGE
Lloh1:
	ldr	x8, [x8, _engines@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	x2, [x0]
	bl	_struct_size
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_16
; %bb.1:
	mov	x21, x0
	add	x0, x0, #16
	bl	_init_rcu_head
	ldr	x8, [x22]
	cbz	x8, LBB0_11
; %bb.2:
	mov	x23, #0
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x21, #8]
	str	xzr, [x9, x23, lsl #3]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x23, x23, #1
	cmp	x23, x8
	b.hs	LBB0_12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x22, #8]
	ldr	x9, [x9, x23, lsl #3]
	cbz	x9, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x24, [x9]
	mov	x0, x24
	bl	_intel_engine_is_virtual
	cbz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	mov	x1, x24
	bl	_intel_execlists_clone_virtual
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	mov	x1, x24
	bl	_intel_context_create
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x21, #8]
	lsl	x9, x23, #3
	str	x0, [x8, x9]
	ldr	x8, [x21, #8]
	ldr	x0, [x8, x9]
	bl	_IS_ERR_OR_NULL
	cbnz	x0, LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x22]
	b	LBB0_4
LBB0_11:
	mov	x23, #0
LBB0_12:
	str	x23, [x21]
	mov	x0, x20
	bl	_i915_gem_context_user_engines
	mov	x22, x0
	mov	x0, x20
	bl	_i915_gem_context_unlock_engines
	ldr	w0, [x19]
	bl	_free_engines
	ldr	w0, [x19]
	mov	x1, x21
	bl	_RCU_INIT_POINTER
	mov	x0, x19
	cbz	w22, LBB0_14
; %bb.13:
	bl	_i915_gem_context_set_user_engines
	mov	w0, #0
	b	LBB0_17
LBB0_14:
	bl	_i915_gem_context_clear_user_engines
	mov	w0, #0
	b	LBB0_17
LBB0_15:
	mov	x0, x21
	mov	x1, x23
	bl	___free_engines
LBB0_16:
	mov	x0, x20
	bl	_i915_gem_context_unlock_engines
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_engines,4,2                    ; @engines
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_clone_engines
.subsections_via_symbols
