	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_legacy_lock                ## -- Begin function drm_legacy_lock
	.p2align	4, 0x90
_drm_legacy_lock:                       ## @drm_legacy_lock
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	_entry@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_current@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_DECLARE_WAITQUEUE
	movq	8(%rbx), %r15
	movq	_DRIVER_LEGACY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_drm_core_check_feature
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	incl	(%rbx)
	movq	(%r12), %r14
	movq	_DRM_KERNEL_CONTEXT@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	(%r13), %edi
	callq	_task_pid_nr
	cmpq	%rbx, %r14
	jne	LBB0_6
## %bb.2:
	movq	(%r12), %rdx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r13d, %r13d
LBB0_5:
	subl	(%rax), %r13d
	jmp	LBB0_18
LBB0_6:
	movq	(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_8
## %bb.7:
	movl	(%rcx), %ecx
	jmp	LBB0_9
LBB0_8:
	movl	$-1, %ecx
LBB0_9:
	movl	8(%r12), %r8d
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	leaq	8(%r15), %rdi
	movq	_entry@GOTPCREL(%rip), %rsi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_add_wait_queue
	leaq	12(%r15), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_bh
	incl	16(%r15)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_spin_unlock_bh
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %r14
	movq	_drm_global_mutex@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	___set_current_state
	cmpq	$0, (%r15)
	je	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r12), %rsi
	movq	%r15, %rdi
	callq	_drm_lock_take
	testq	%rax, %rax
	jne	LBB0_16
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	callq	_schedule
	movq	%rbx, %rdi
	callq	_mutex_lock
	movl	(%r13), %edi
	callq	_signal_pending
	testq	%rax, %rax
	je	LBB0_10
## %bb.13:
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	jmp	LBB0_15
LBB0_14:
	movq	_SIGTERM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r13), %esi
	xorl	%r13d, %r13d
	xorl	%edx, %edx
	callq	_send_sig
	movq	_EINTR@GOTPCREL(%rip), %rax
LBB0_15:
	subl	(%rax), %r13d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_17
LBB0_16:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, 24(%r15)
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r15)
	xorl	%r13d, %r13d
LBB0_17:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_spin_lock_bh
	decl	16(%r15)
	movq	%r14, %rdi
	callq	_spin_unlock_bh
	movq	_TASK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___set_current_state
	movq	_entry@GOTPCREL(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_remove_wait_queue
	movq	(%r12), %rsi
	testl	%r13d, %r13d
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	testl	%r13d, %r13d
	je	LBB0_19
LBB0_18:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	%rbx, %rdi
	callq	_drm_is_current_master
	testl	%eax, %eax
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	jne	LBB0_21
## %bb.20:
	movq	(%r12), %rax
	movq	%rax, 8(%rdi)
	movq	(%r15), %rax
	movq	%rax, 16(%rdi)
LBB0_21:
	movq	(%rdi), %rax
	movq	(%rax), %rcx
	xorl	%r13d, %r13d
	testq	%rcx, %rcx
	je	LBB0_18
## %bb.22:
	movq	__DRM_LOCK_QUIESCENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r12)
	je	LBB0_18
## %bb.23:
	callq	*%rcx
	testq	%rax, %rax
	je	LBB0_18
## %bb.24:
	movq	(%r12), %rsi
	leaq	L_.str.5(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_entry,4,2                      ## @entry
	.comm	_current,4,2                    ## @current
	.comm	_DRIVER_LEGACY,4,2              ## @DRIVER_LEGACY
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_DRM_KERNEL_CONTEXT,8,3         ## @DRM_KERNEL_CONTEXT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Process %d using kernel context %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n"

	.comm	_TASK_INTERRUPTIBLE,4,2         ## @TASK_INTERRUPTIBLE
	.comm	_SIGTERM,4,2                    ## @SIGTERM
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_drm_global_mutex,4,2           ## @drm_global_mutex
	.comm	_TASK_RUNNING,4,2               ## @TASK_RUNNING
L_.str.2:                               ## @.str.2
	.asciz	"%d %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"interrupted"

L_.str.4:                               ## @.str.4
	.asciz	"has lock"

	.comm	__DRM_LOCK_QUIESCENT,4,2        ## @_DRM_LOCK_QUIESCENT
L_.str.5:                               ## @.str.5
	.asciz	"%d waiting for DMA quiescent\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_legacy_lock                ; -- Begin function drm_legacy_lock
	.p2align	2
_drm_legacy_lock:                       ; @drm_legacy_lock
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _entry@GOTPAGE
Lloh1:
	ldr	x8, [x8, _entry@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x26, _current@GOTPAGE
Lloh4:
	ldr	x26, [x26, _current@GOTPAGEOFF]
	ldr	w1, [x26]
	bl	_DECLARE_WAITQUEUE
	ldr	x22, [x21, #8]
Lloh5:
	adrp	x8, _DRIVER_LEGACY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DRIVER_LEGACY@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_drm_core_check_feature
	cbz	w0, LBB0_3
; %bb.1:
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
	ldr	x23, [x19]
Lloh8:
	adrp	x8, _DRM_KERNEL_CONTEXT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DRM_KERNEL_CONTEXT@GOTPAGEOFF]
Lloh10:
	ldr	x24, [x8]
	ldr	w0, [x26]
	bl	_task_pid_nr
	mov	x1, x0
	cmp	x23, x24
	b.ne	LBB0_5
; %bb.2:
	ldr	x2, [x19]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_DRM_ERROR
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh15:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_23
LBB0_5:
	ldr	x8, [x22]
	cbz	x8, LBB0_7
; %bb.6:
	ldr	w8, [x8]
	b	LBB0_8
LBB0_7:
	mov	w8, #-1
LBB0_8:
	ldr	w9, [x19, #8]
	stp	x8, x9, [sp, #8]
	str	x1, [sp]
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x23
	bl	_DRM_DEBUG
	add	x23, x22, #8
Lloh19:
	adrp	x1, _entry@GOTPAGE
Lloh20:
	ldr	x1, [x1, _entry@GOTPAGEOFF]
	mov	x0, x23
	bl	_add_wait_queue
	add	x24, x22, #12
	mov	x0, x24
	bl	_spin_lock_bh
	ldr	w8, [x22, #16]
	add	w8, w8, #1
	str	w8, [x22, #16]
	mov	x0, x24
	bl	_spin_unlock_bh
Lloh21:
	adrp	x27, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh22:
	ldr	x27, [x27, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
Lloh23:
	adrp	x25, _drm_global_mutex@GOTPAGE
Lloh24:
	ldr	x25, [x25, _drm_global_mutex@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x27]
	bl	___set_current_state
	ldr	x8, [x22]
	cbz	x8, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x1, [x19]
	mov	x0, x22
	bl	_drm_lock_take
	cbnz	x0, LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x25
	bl	_mutex_unlock
	bl	_schedule
	mov	x0, x25
	bl	_mutex_lock
	ldr	w0, [x26]
	bl	_signal_pending
	cbz	x0, LBB0_9
	b	LBB0_13
LBB0_12:
Lloh25:
	adrp	x8, _SIGTERM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SIGTERM@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	ldr	w1, [x26]
	mov	w2, #0
	bl	_send_sig
LBB0_13:
Lloh28:
	adrp	x8, _EINTR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_15
LBB0_14:
	mov	w25, #0
	str	x21, [x22, #24]
Lloh31:
	adrp	x8, _jiffies@GOTPAGE
Lloh32:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	str	w8, [x22, #20]
LBB0_15:
	mov	x0, x24
	bl	_spin_lock_bh
	ldr	w8, [x22, #16]
	sub	w8, w8, #1
	str	w8, [x22, #16]
	mov	x0, x24
	bl	_spin_unlock_bh
Lloh34:
	adrp	x8, _TASK_RUNNING@GOTPAGE
Lloh35:
	ldr	x8, [x8, _TASK_RUNNING@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	bl	___set_current_state
Lloh37:
	adrp	x1, _entry@GOTPAGE
Lloh38:
	ldr	x1, [x1, _entry@GOTPAGEOFF]
	mov	x0, x23
	bl	_remove_wait_queue
	ldr	x1, [x19]
Lloh39:
	adrp	x8, l_.str.3@PAGE
Lloh40:
	add	x8, x8, l_.str.3@PAGEOFF
Lloh41:
	adrp	x9, l_.str.4@PAGE
Lloh42:
	add	x9, x9, l_.str.4@PAGEOFF
	cmp	w25, #0
	csel	x8, x9, x8, eq
	str	x8, [sp]
Lloh43:
	adrp	x0, l_.str.2@PAGE
Lloh44:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG
	cbnz	w25, LBB0_23
; %bb.16:
	mov	x0, x21
	bl	_drm_is_current_master
	cbnz	w0, LBB0_18
; %bb.17:
	ldr	x8, [x19]
	ldr	x9, [x22]
	stp	x8, x9, [x20, #8]
LBB0_18:
	ldr	x8, [x20]
	ldr	x8, [x8]
	cbz	x8, LBB0_22
; %bb.19:
	ldr	w9, [x19, #8]
Lloh45:
	adrp	x10, __DRM_LOCK_QUIESCENT@GOTPAGE
Lloh46:
	ldr	x10, [x10, __DRM_LOCK_QUIESCENT@GOTPAGEOFF]
Lloh47:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_22
; %bb.20:
	mov	x0, x20
	blr	x8
	cbz	x0, LBB0_22
; %bb.21:
	ldr	x1, [x19]
Lloh48:
	adrp	x0, l_.str.5@PAGE
Lloh49:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_DEBUG
Lloh50:
	adrp	x8, _EBUSY@GOTPAGE
Lloh51:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_4
LBB0_22:
	mov	w25, #0
LBB0_23:
	mov	x0, x25
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh50, Lloh51
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_entry,4,2                      ; @entry
	.comm	_current,4,2                    ; @current
	.comm	_DRIVER_LEGACY,4,2              ; @DRIVER_LEGACY
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_DRM_KERNEL_CONTEXT,8,3         ; @DRM_KERNEL_CONTEXT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Process %d using kernel context %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n"

	.comm	_TASK_INTERRUPTIBLE,4,2         ; @TASK_INTERRUPTIBLE
	.comm	_SIGTERM,4,2                    ; @SIGTERM
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_drm_global_mutex,4,2           ; @drm_global_mutex
	.comm	_TASK_RUNNING,4,2               ; @TASK_RUNNING
l_.str.2:                               ; @.str.2
	.asciz	"%d %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"interrupted"

l_.str.4:                               ; @.str.4
	.asciz	"has lock"

	.comm	__DRM_LOCK_QUIESCENT,4,2        ; @_DRM_LOCK_QUIESCENT
l_.str.5:                               ; @.str.5
	.asciz	"%d waiting for DMA quiescent\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
