	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_mode_create_lease_ioctl    ## -- Begin function drm_mode_create_lease_ioctl
	.p2align	4, 0x90
_drm_mode_create_lease_ioctl:           ## @drm_mode_create_lease_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	%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, %r15
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	8(%rdx), %r12
	movq	16(%rdx), %rbx
	movq	_DRIVER_MODESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_drm_core_check_feature
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	cmpq	$0, 16(%r12)
	je	LBB0_7
## %bb.2:
	leaq	L_.str(%rip), %rdi
LBB0_3:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_LEASE
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_4:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_5:
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_13
## %bb.8:
	movl	8(%r14), %eax
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rcx
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	testl	%edx, %eax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_3
LBB0_11:
	movl	20(%r14), %edi
	callq	_u64_to_user_ptr
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	movl	$4, %esi
	callq	_array_size
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	movl	%eax, %esi
	callq	_memdup_user
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_13:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_3
LBB0_14:
	leaq	-48(%rbp), %rdi
	callq	_idr_init
	movq	%r13, %rdi
	movq	%r15, %rsi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rcx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %r8
	callq	_fill_object_idr
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_kfree
	testl	%ebx, %ebx
	je	LBB0_17
## %bb.15:
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_LEASE
LBB0_16:
	leaq	-48(%rbp), %rdi
	callq	_idr_destroy
	jmp	LBB0_6
LBB0_17:
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rax
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	andl	8(%r14), %edi
	callq	_get_unused_fd_flags
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_16
## %bb.18:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_LEASE
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	callq	_drm_lease_create
	movq	%rax, %r15
	movq	%rax, -72(%rbp)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %r14d
	jmp	LBB0_22
LBB0_20:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_LEASE
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_file_clone_open
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_23
## %bb.21:
	movq	%r12, %rdi
	callq	_PTR_ERR
	movl	%eax, %r14d
	leaq	-72(%rbp), %rdi
	callq	_drm_master_put
LBB0_22:
	movl	%ebx, %edi
	callq	_put_unused_fd
	leaq	-48(%rbp), %rdi
	callq	_idr_destroy
	leaq	L_.str.8(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_LEASE
	movl	%r14d, %ebx
	jmp	LBB0_6
LBB0_23:
	movq	8(%r12), %r13
	leaq	8(%r13), %rdi
	callq	_drm_master_put
	movq	%r15, 8(%r13)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, (%r13)
	movl	(%r15), %edx
	leaq	L_.str.6(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_LEASE
	movl	%ebx, 12(%r14)
	movl	(%r15), %eax
	movl	%eax, 16(%r14)
	movl	%ebx, %edi
	movq	%r12, %rsi
	callq	_fd_install
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_LEASE
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_DRIVER_MODESET,4,2             ## @DRIVER_MODESET
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"recursive leasing not allowed\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"no objects in lease\n"

	.comm	_O_CLOEXEC,4,2                  ## @O_CLOEXEC
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
L_.str.2:                               ## @.str.2
	.asciz	"invalid flags\n"

L_.str.3:                               ## @.str.3
	.asciz	"lease object lookup failed: %i\n"

L_.str.4:                               ## @.str.4
	.asciz	"Creating lease\n"

L_.str.5:                               ## @.str.5
	.asciz	"Allocating lease file\n"

L_.str.6:                               ## @.str.6
	.asciz	"Returning fd %d id %d\n"

L_.str.7:                               ## @.str.7
	.asciz	"drm_mode_create_lease_ioctl succeeded\n"

L_.str.8:                               ## @.str.8
	.asciz	"drm_mode_create_lease_ioctl failed: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_mode_create_lease_ioctl    ; -- Begin function drm_mode_create_lease_ioctl
	.p2align	2
_drm_mode_create_lease_ioctl:           ; @drm_mode_create_lease_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x2
	mov	x19, x1
	mov	x23, x0
	ldp	x22, x21, [x2, #8]
Lloh0:
	adrp	x8, _DRIVER_MODESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRIVER_MODESET@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_drm_core_check_feature
	cbz	w0, LBB0_4
; %bb.1:
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_7
; %bb.2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
LBB0_3:
	bl	_DRM_DEBUG_LEASE
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh7:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_7:
	ldr	x24, [x19]
	cbz	x24, LBB0_13
; %bb.8:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_11
; %bb.9:
Lloh9:
	adrp	x9, _O_CLOEXEC@GOTPAGE
Lloh10:
	ldr	x9, [x9, _O_CLOEXEC@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _O_NONBLOCK@GOTPAGE
Lloh13:
	ldr	x10, [x10, _O_NONBLOCK@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	orr	w9, w10, w9
	bics	wzr, w8, w9
	b.eq	LBB0_11
; %bb.10:
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_3
LBB0_11:
	ldr	w0, [x19, #20]
	bl	_u64_to_user_ptr
	mov	x25, x0
	mov	x0, x24
	mov	w1, #4
	bl	_array_size
	mov	x1, x0
	mov	x0, x25
	bl	_memdup_user
	mov	x25, x0
	bl	_IS_ERR
	cbz	x0, LBB0_14
; %bb.12:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_PTR_ERR
LBB0_13:
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_14:
	add	x0, sp, #24
	bl	_idr_init
	add	x2, sp, #24
	mov	x0, x23
	mov	x1, x20
	mov	x3, x24
	mov	x4, x25
	bl	_fill_object_idr
	mov	x20, x0
	mov	x0, x25
	bl	_kfree
	cbz	w20, LBB0_17
; %bb.15:
	str	x20, [sp]
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_DEBUG_LEASE
LBB0_16:
	add	x0, sp, #24
	bl	_idr_destroy
	b	LBB0_6
LBB0_17:
	ldr	w8, [x19, #8]
Lloh21:
	adrp	x9, _O_CLOEXEC@GOTPAGE
Lloh22:
	ldr	x9, [x9, _O_CLOEXEC@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
Lloh24:
	adrp	x10, _O_NONBLOCK@GOTPAGE
Lloh25:
	ldr	x10, [x10, _O_NONBLOCK@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	orr	w9, w10, w9
	and	w0, w9, w8
	bl	_get_unused_fd_flags
	mov	x20, x0
	tbnz	w0, #31, LBB0_16
; %bb.18:
Lloh27:
	adrp	x0, l_.str.4@PAGE
Lloh28:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_DEBUG_LEASE
	add	x1, sp, #24
	mov	x0, x22
	bl	_drm_lease_create
	mov	x22, x0
	str	x0, [sp, #16]
	bl	_IS_ERR
	cbz	x0, LBB0_20
; %bb.19:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x19, x0
	b	LBB0_22
LBB0_20:
Lloh29:
	adrp	x0, l_.str.5@PAGE
Lloh30:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_DEBUG_LEASE
	mov	x0, x21
	bl	_file_clone_open
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_23
; %bb.21:
	mov	x0, x21
	bl	_PTR_ERR
	mov	x19, x0
	add	x0, sp, #16
	bl	_drm_master_put
LBB0_22:
	mov	x0, x20
	bl	_put_unused_fd
	add	x0, sp, #24
	bl	_idr_destroy
	str	x19, [sp]
Lloh31:
	adrp	x0, l_.str.8@PAGE
Lloh32:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_DRM_DEBUG_LEASE
	mov	x20, x19
	b	LBB0_6
LBB0_23:
	ldr	x23, [x21, #8]
	add	x0, x23, #8
	bl	_drm_master_put
	str	x22, [x23, #8]
	movi.2s	v0, #1
	str	d0, [x23]
	ldr	w8, [x22]
	mov	x9, x20
	stp	x9, x8, [sp]
Lloh33:
	adrp	x0, l_.str.6@PAGE
Lloh34:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_DRM_DEBUG_LEASE
	ldr	w8, [x22]
	stp	w20, w8, [x19, #12]
	mov	x0, x20
	mov	x1, x21
	bl	_fd_install
Lloh35:
	adrp	x0, l_.str.7@PAGE
Lloh36:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_DRM_DEBUG_LEASE
	mov	w20, #0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_DRIVER_MODESET,4,2             ; @DRIVER_MODESET
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"recursive leasing not allowed\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"no objects in lease\n"

	.comm	_O_CLOEXEC,4,2                  ; @O_CLOEXEC
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
l_.str.2:                               ; @.str.2
	.asciz	"invalid flags\n"

l_.str.3:                               ; @.str.3
	.asciz	"lease object lookup failed: %i\n"

l_.str.4:                               ; @.str.4
	.asciz	"Creating lease\n"

l_.str.5:                               ; @.str.5
	.asciz	"Allocating lease file\n"

l_.str.6:                               ; @.str.6
	.asciz	"Returning fd %d id %d\n"

l_.str.7:                               ; @.str.7
	.asciz	"drm_mode_create_lease_ioctl succeeded\n"

l_.str.8:                               ; @.str.8
	.asciz	"drm_mode_create_lease_ioctl failed: %d\n"

.subsections_via_symbols
