	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_addctx                     ## -- Begin function drm_addctx
	.p2align	4, 0x90
_drm_addctx:                            ## @drm_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, %r12
	movq	%rdi, %r15
	callq	_drm_ctxbitmap_next
	movl	%eax, (%r12)
	movq	_DRM_KERNEL_CONTEXT@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jne	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_drm_ctxbitmap_next
	movl	%eax, (%r12)
LBB0_2:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	cmpl	$-1, (%r12)
	je	LBB0_3
## %bb.5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %rbx
	movq	%rax, %r13
	addq	$4, %r13
	movq	%r13, %rdi
	callq	_INIT_LIST_HEAD
	movl	(%r12), %eax
	movl	%eax, (%rbx)
	movq	%r14, 8(%rbx)
	movq	%r15, %rdi
	callq	_mutex_lock
	leaq	8(%r15), %rsi
	movq	%r13, %rdi
	callq	_list_add
	incl	4(%r15)
	movq	%r15, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
LBB0_4:
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.2:                               ## @.str.2
	.asciz	"out of memory\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_addctx                     ; -- Begin function drm_addctx
	.p2align	2
_drm_addctx:                            ; @drm_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
	bl	_drm_ctxbitmap_next
	str	w0, [x21]
Lloh0:
	adrp	x8, _DRM_KERNEL_CONTEXT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_KERNEL_CONTEXT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	mov	x8, x0
	cmp	w9, w0
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_drm_ctxbitmap_next
	str	w0, [x21]
	mov	x8, x0
LBB0_2:
	str	x8, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	ldr	w8, [x21]
	cmn	w8, #1
	b.eq	LBB0_5
; %bb.3:
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kmalloc
	cbz	x0, LBB0_6
; %bb.4:
	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, #8
	mov	x0, x23
	bl	_list_add
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_8
LBB0_5:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	bl	_DRM_DEBUG
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.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	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.2:                               ; @.str.2
	.asciz	"out of memory\n"

.subsections_via_symbols
