	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_write_lock                 ## -- Begin function ttm_write_lock
	.p2align	4, 0x90
_ttm_write_lock:                        ## @ttm_write_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movl	(%rdi), %r14d
	callq	___ttm_write_lock
	movl	%r14d, %edi
	movl	%eax, %esi
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.1:
	callq	_wait_event_interruptible
	movl	%eax, %r14d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	leaq	4(%rbx), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	movq	_TTM_WRITE_LOCK_PENDING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 8(%rbx)
	movq	%rbx, %rdi
	callq	_wake_up_all
	movq	%r15, %rdi
	callq	_spin_unlock
	jmp	LBB0_4
LBB0_3:
	callq	_wait_event
	xorl	%r14d, %r14d
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_WRITE_LOCK_PENDING,4,2     ## @TTM_WRITE_LOCK_PENDING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_write_lock                 ; -- Begin function ttm_write_lock
	.p2align	2
_ttm_write_lock:                        ; @ttm_write_lock
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	w20, [x0]
	bl	___ttm_write_lock
	mov	x1, x0
	mov	x0, x20
	cbz	w21, LBB0_3
; %bb.1:
	bl	_wait_event_interruptible
	mov	x20, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_4
; %bb.2:
	add	x21, x19, #4
	mov	x0, x21
	bl	_spin_lock
Lloh0:
	adrp	x8, _TTM_WRITE_LOCK_PENDING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TTM_WRITE_LOCK_PENDING@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	bic	w8, w9, w8
	str	w8, [x19, #8]
	mov	x0, x19
	bl	_wake_up_all
	mov	x0, x21
	bl	_spin_unlock
	b	LBB0_4
LBB0_3:
	bl	_wait_event
	mov	w20, #0
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_WRITE_LOCK_PENDING,4,2     ; @TTM_WRITE_LOCK_PENDING
.subsections_via_symbols
