	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_legacy_addctx              ## -- Begin function drm_legacy_addctx
	.p2align	4, 0x90
_drm_legacy_addctx:                     ## @drm_legacy_addctx
	.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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_DRIVER_KMS_LEGACY_CONTEXT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_drm_core_check_feature
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_DRIVER_LEGACY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_drm_core_check_feature
	testl	%eax, %eax
	je	LBB0_9
LBB0_2:
	movq	%r12, %rdi
	callq	_drm_legacy_ctxbitmap_next
	movl	%eax, %ebx
	movq	_DRM_KERNEL_CONTEXT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_drm_legacy_ctxbitmap_next
	movl	%eax, %ebx
LBB0_4:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	testl	%ebx, %ebx
	js	LBB0_7
## %bb.5:
	movl	%ebx, (%r15)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	%rax, %rbx
	movq	%rax, %r13
	addq	$4, %r13
	movq	%r13, %rdi
	callq	_INIT_LIST_HEAD
	movl	(%r15), %eax
	movl	%eax, (%rbx)
	movq	%r14, 8(%rbx)
	movq	%r12, %rdi
	callq	_mutex_lock
	leaq	4(%r12), %rsi
	movq	%r13, %rdi
	callq	_list_add
	movq	%r12, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_9:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_10:
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRIVER_KMS_LEGACY_CONTEXT,4,2  ## @DRIVER_KMS_LEGACY_CONTEXT
	.comm	_DRIVER_LEGACY,4,2              ## @DRIVER_LEGACY
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_DRM_KERNEL_CONTEXT,4,2         ## @DRM_KERNEL_CONTEXT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Not enough free contexts.\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.2:                               ## @.str.2
	.asciz	"out of memory\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_legacy_addctx              ; -- Begin function drm_legacy_addctx
	.p2align	2
_drm_legacy_addctx:                     ; @drm_legacy_addctx
	.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, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _DRIVER_KMS_LEGACY_CONTEXT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRIVER_KMS_LEGACY_CONTEXT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_drm_core_check_feature
	cbnz	w0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _DRIVER_LEGACY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DRIVER_LEGACY@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_drm_core_check_feature
	cbz	w0, LBB0_9
LBB0_2:
	mov	x0, x19
	bl	_drm_legacy_ctxbitmap_next
	mov	x22, x0
Lloh6:
	adrp	x8, _DRM_KERNEL_CONTEXT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DRM_KERNEL_CONTEXT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_drm_legacy_ctxbitmap_next
	mov	x22, x0
LBB0_4:
	str	x22, [sp]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	tbnz	w22, #31, LBB0_7
; %bb.5:
	str	w22, [x21]
Lloh11:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kmalloc
	cbz	x0, LBB0_8
; %bb.6:
	mov	x22, x0
	add	x23, x0, #4
	mov	x0, x23
	bl	_INIT_LIST_HEAD
	ldr	w8, [x21]
	str	w8, [x22]
	str	x20, [x22, #8]
	mov	x0, x19
	bl	_mutex_lock
	add	x1, x19, #4
	mov	x0, x23
	bl	_list_add
	mov	x0, x19
	bl	_mutex_unlock
	mov	w22, #0
	b	LBB0_11
LBB0_7:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG
	b	LBB0_11
LBB0_8:
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh20:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_11:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_DRIVER_KMS_LEGACY_CONTEXT,4,2  ; @DRIVER_KMS_LEGACY_CONTEXT
	.comm	_DRIVER_LEGACY,4,2              ; @DRIVER_LEGACY
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_DRM_KERNEL_CONTEXT,4,2         ; @DRM_KERNEL_CONTEXT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Not enough free contexts.\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.2:                               ; @.str.2
	.asciz	"out of memory\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
