	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drm_lock_take
_drm_lock_take:                         ## @drm_lock_take
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	16(%rdi), %r12
	addq	$8, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_bh
	movq	__DRM_LOCK_CONT@GOTPCREL(%rip), %r14
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	orl	%eax, %ebx
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_cmpxchg
	cmpl	%r15d, %eax
	je	LBB0_7
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %r15d
	movq	__DRM_LOCK_HELD@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%r15d, %ebx
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r14), %ebx
	orl	%r15d, %ebx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	orl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	4(%r13), %ecx
	addl	(%r13), %ecx
	xorl	%eax, %eax
	cmpl	$2, %ecx
	jl	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r14), %eax
	jmp	LBB0_5
LBB0_7:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_bh
	movl	%r15d, %edi
	callq	__DRM_LOCKING_CONTEXT
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	cmpl	%r14d, %eax
	jne	LBB0_11
## %bb.8:
	movq	__DRM_LOCK_HELD@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_11
## %bb.9:
	movq	_DRM_KERNEL_CONTEXT@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	cmpl	%r14d, (%rax)
	je	LBB0_14
## %bb.10:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_DRM_ERROR
	jmp	LBB0_14
LBB0_11:
	movl	%ebx, %edi
	callq	__DRM_LOCKING_CONTEXT
	cmpl	%r14d, %eax
	jne	LBB0_13
## %bb.12:
	movl	$1, %r15d
	movq	__DRM_LOCK_HELD@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	jne	LBB0_14
LBB0_13:
	xorl	%r15d, %r15d
LBB0_14:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	__DRM_LOCK_HELD,4,2             ## @_DRM_LOCK_HELD
	.comm	__DRM_LOCK_CONT,4,2             ## @_DRM_LOCK_CONT
	.comm	_DRM_KERNEL_CONTEXT,4,2         ## @DRM_KERNEL_CONTEXT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d holds heavyweight lock\n"

	.no_dead_strip	_drm_lock_take
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drm_lock_take
_drm_lock_take:                         ; @drm_lock_take
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x22, x0
	ldr	x24, [x0, #16]
	add	x23, x0, #8
	mov	x0, x23
	bl	_spin_lock_bh
Lloh0:
	adrp	x25, __DRM_LOCK_HELD@GOTPAGE
Lloh1:
	ldr	x25, [x25, __DRM_LOCK_HELD@GOTPAGEOFF]
Lloh2:
	adrp	x26, __DRM_LOCK_CONT@GOTPAGE
Lloh3:
	ldr	x26, [x26, __DRM_LOCK_CONT@GOTPAGEOFF]
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	orr	w8, w8, w19
	ldp	w9, w10, [x22]
	add	w9, w10, w9
	ldr	w10, [x26]
	cmp	w9, #1
	csel	w9, w10, wzr, gt
	orr	w21, w8, w9
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x24
	mov	x1, x20
	mov	x2, x21
	bl	_cmpxchg
	cmp	w0, w20
	b.eq	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w20, [x24]
	ldr	w8, [x25]
	tst	w8, w20
	b.eq	LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x26]
	orr	w21, w8, w20
	b	LBB0_2
LBB0_5:
	mov	x0, x23
	bl	_spin_unlock_bh
	mov	x0, x20
	bl	__DRM_LOCKING_CONTEXT
	cmp	w0, w19
	b.ne	LBB0_9
; %bb.6:
	ldr	w8, [x25]
	tst	w8, w20
	b.eq	LBB0_9
; %bb.7:
Lloh4:
	adrp	x8, _DRM_KERNEL_CONTEXT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DRM_KERNEL_CONTEXT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w8, w19
	b.eq	LBB0_12
; %bb.8:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_DRM_ERROR
	b	LBB0_12
LBB0_9:
	mov	x0, x21
	bl	__DRM_LOCKING_CONTEXT
	cmp	w0, w19
	b.ne	LBB0_12
; %bb.10:
	ldr	w8, [x25]
	tst	w8, w21
	b.eq	LBB0_12
; %bb.11:
	mov	w0, #1
	b	LBB0_13
LBB0_12:
	mov	w0, #0
LBB0_13:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	__DRM_LOCK_HELD,4,2             ; @_DRM_LOCK_HELD
	.comm	__DRM_LOCK_CONT,4,2             ; @_DRM_LOCK_CONT
	.comm	_DRM_KERNEL_CONTEXT,4,2         ; @DRM_KERNEL_CONTEXT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d holds heavyweight lock\n"

	.no_dead_strip	_drm_lock_take
.subsections_via_symbols
