	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_setmaster_ioctl            ## -- Begin function drm_setmaster_ioctl
	.p2align	4, 0x90
_drm_setmaster_ioctl:                   ## @drm_setmaster_ioctl
	.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
	movq	%rdx, %r15
	movq	%rdi, %r14
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_drm_is_current_master
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_10
## %bb.1:
	cmpq	$0, 8(%r14)
	je	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	cmpl	$0, 8(%r15)
	je	LBB0_5
## %bb.6:
	cmpq	$0, 8(%rax)
	je	LBB0_8
## %bb.7:
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_LEASE
	jmp	LBB0_2
LBB0_5:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_drm_new_set_master
	jmp	LBB0_9
LBB0_8:
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_drm_set_master
LBB0_9:
	movl	%eax, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Attempt to set lessee %d as master\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_setmaster_ioctl            ; -- Begin function drm_setmaster_ioctl
	.p2align	2
_drm_setmaster_ioctl:                   ; @drm_setmaster_ioctl
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x2
	mov	x19, x0
	bl	_mutex_lock
	mov	x0, x20
	bl	_drm_is_current_master
	cbz	x0, LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_4
LBB0_2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x8, [x20]
	cbz	x8, LBB0_3
; %bb.6:
	ldr	w9, [x20, #8]
	cbz	w9, LBB0_9
; %bb.7:
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_10
; %bb.8:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_LEASE
	b	LBB0_3
LBB0_9:
	mov	x0, x19
	mov	x1, x20
	bl	_drm_new_set_master
	b	LBB0_11
LBB0_10:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_drm_set_master
LBB0_11:
	mov	x20, x0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Attempt to set lessee %d as master\n"

.subsections_via_symbols
