	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_mode_page_flip_ioctl       ## -- Begin function drm_mode_page_flip_ioctl
	.p2align	4, 0x90
_drm_mode_page_flip_ioctl:              ## @drm_mode_page_flip_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	_EINVAL@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	subl	(%r14), %ebx
	movq	_DRM_MODE_PAGE_FLIP_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	testl	%eax, (%rsi)
	jne	LBB0_18
## %bb.1:
	movq	%rsi, %r12
	cmpq	$0, 8(%rsi)
	jne	LBB0_18
## %bb.2:
	movq	%rdx, %r13
	movq	%rdi, %r15
	movl	24(%r12), %esi
	movq	_DRM_MODE_OBJECT_CRTC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_drm_mode_object_find
	testq	%rax, %rax
	je	LBB0_15
## %bb.3:
	movq	%rax, %rdi
	callq	_obj_to_crtc
	movq	%rax, %r14
	leaq	8(%rax), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	cmpq	$0, 16(%r14)
	je	LBB0_16
## %bb.4:
	movq	24(%r14), %rax
	cmpq	$0, (%rax)
	je	LBB0_17
## %bb.5:
	movl	20(%r12), %esi
	movq	%r15, %rdi
	callq	_drm_framebuffer_lookup
	testq	%rax, %rax
	je	LBB0_17
## %bb.6:
	movl	40(%r14), %ebx
	movl	44(%r14), %r8d
	cmpq	$0, 32(%r14)
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.7:
	movl	%ebx, %edi
	movl	%r8d, %esi
	movl	%r8d, -56(%rbp)                 ## 4-byte Spill
	callq	_swap
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	movq	-48(%rbp), %rax                 ## 8-byte Reload
LBB0_8:
	movl	(%rax), %esi
	movl	4(%rax), %edx
	movl	%esi, %edi
	subl	%ebx, %edi
	jl	LBB0_12
## %bb.9:
	movl	%edx, %ecx
	subl	%r8d, %ecx
	jl	LBB0_12
## %bb.10:
	cmpl	%edi, (%r14)
	jg	LBB0_12
## %bb.11:
	cmpl	%ecx, 4(%r14)
	jle	LBB0_19
LBB0_12:
	movl	(%r14), %r9d
	movl	4(%r14), %r10d
	cmpq	$0, 32(%r14)
	leaq	L_.str.2(%rip), %rcx
	leaq	L_.str.1(%rip), %rax
	cmoveq	%rcx, %rax
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %ecx
	pushq	%rax
	pushq	%r10
	callq	_DRM_DEBUG_KMS
	addq	$16, %rsp
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_14:
	callq	_drm_framebuffer_unreference
	jmp	LBB0_17
LBB0_15:
	xorl	%ebx, %ebx
	subl	(%r14), %ebx
	jmp	LBB0_18
LBB0_16:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
LBB0_18:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	_DRM_MODE_PAGE_FLIP_EVENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%ebx, %ebx
	testl	%ecx, (%r12)
	je	LBB0_23
## %bb.20:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movl	(%r13), %eax
	cmpl	$11, %eax
	jbe	LBB0_30
## %bb.21:
	addl	$-12, %eax
	movl	%eax, (%r13)
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_29
## %bb.22:
	movq	%rax, %rdx
	movq	_DRM_EVENT_FLIP_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rdx, %rcx
	addq	$24, %rcx
	movl	%eax, 28(%rdx)
	movl	$12, 24(%rdx)
	movl	16(%r12), %eax
	movl	%eax, 32(%rdx)
	movq	%rcx, 16(%rdx)
	movq	%r13, 8(%rdx)
	movq	_kfree@GOTPCREL(%rip), %rax
	movq	%rax, (%rdx)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_24
LBB0_23:
	xorl	%edx, %edx
LBB0_24:
	movq	16(%r14), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	24(%r14), %rcx
	movq	%r14, %rdi
	movq	%rax, %rsi
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	callq	*(%rcx)
	testl	%eax, %eax
	je	LBB0_28
## %bb.25:
	movl	%eax, %ebx
	movq	_DRM_MODE_PAGE_FLIP_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_13
## %bb.26:
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	addl	$12, (%r13)
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
	jmp	LBB0_13
LBB0_28:
	xorl	%edi, %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, 16(%r14)
	setne	%dil
	callq	_WARN_ON
	xorl	%ebx, %ebx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	jne	LBB0_14
	jmp	LBB0_17
LBB0_29:
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	addl	$12, (%r13)
LBB0_30:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DRM_MODE_PAGE_FLIP_FLAGS,4,2   ## @DRM_MODE_PAGE_FLIP_FLAGS
	.comm	_DRM_MODE_OBJECT_CRTC,4,2       ## @DRM_MODE_OBJECT_CRTC
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid fb size %ux%u for CRTC viewport %ux%u+%d+%d%s.\n"

L_.str.1:                               ## @.str.1
	.asciz	" (inverted)"

L_.str.2:                               ## @.str.2
	.space	1

	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_DRM_MODE_PAGE_FLIP_EVENT,4,2   ## @DRM_MODE_PAGE_FLIP_EVENT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_DRM_EVENT_FLIP_COMPLETE,4,2    ## @DRM_EVENT_FLIP_COMPLETE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_mode_page_flip_ioctl       ; -- Begin function drm_mode_page_flip_ioctl
	.p2align	2
_drm_mode_page_flip_ioctl:              ; @drm_mode_page_flip_ioctl
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x19, _EINVAL@GOTPAGE
Lloh1:
	ldr	x19, [x19, _EINVAL@GOTPAGEOFF]
	ldr	w8, [x19]
	neg	w23, w8
	ldr	w8, [x1]
Lloh2:
	adrp	x9, _DRM_MODE_PAGE_FLIP_FLAGS@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DRM_MODE_PAGE_FLIP_FLAGS@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	bics	wzr, w8, w9
	b.ne	LBB0_16
; %bb.1:
	mov	x24, x1
	ldr	x8, [x1, #8]
	cbnz	x8, LBB0_16
; %bb.2:
	mov	x22, x2
	mov	x20, x0
	ldr	w1, [x24, #24]
Lloh5:
	adrp	x8, _DRM_MODE_OBJECT_CRTC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DRM_MODE_OBJECT_CRTC@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	bl	_drm_mode_object_find
	cbz	x0, LBB0_13
; %bb.3:
	bl	_obj_to_crtc
	mov	x25, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x25, #16]
	cbz	x8, LBB0_14
; %bb.4:
	ldr	x8, [x25, #24]
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.5:
	ldr	w1, [x24, #20]
	mov	x0, x20
	bl	_drm_framebuffer_lookup
	cbz	x0, LBB0_15
; %bb.6:
	mov	x21, x0
	ldp	w23, w26, [x25, #40]
	ldr	x8, [x25, #32]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x23
	mov	x1, x26
	bl	_swap
LBB0_8:
	ldp	w1, w2, [x21]
	subs	w8, w1, w23
	ccmp	w2, w26, #8, ge
	b.lt	LBB0_11
; %bb.9:
	ldr	w9, [x25]
	cmp	w9, w8
	b.gt	LBB0_11
; %bb.10:
	ldr	w8, [x25, #4]
	sub	w9, w2, w26
	cmp	w8, w9
	b.le	LBB0_17
LBB0_11:
	ldp	w5, w6, [x25]
	ldr	x8, [x25, #32]
Lloh8:
	adrp	x9, l_.str.1@PAGE
Lloh9:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh10:
	adrp	x10, l_.str.2@PAGE
Lloh11:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	x8, #0
	csel	x7, x10, x9, eq
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x23
	mov	x4, x26
	bl	_DRM_DEBUG_KMS
Lloh14:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_12:
	mov	x0, x21
	bl	_drm_framebuffer_unreference
	b	LBB0_15
LBB0_13:
	ldr	w8, [x19]
	neg	w23, w8
	b	LBB0_16
LBB0_14:
Lloh17:
	adrp	x8, _EBUSY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_15:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_16:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_17:
	ldr	w8, [x24]
Lloh20:
	adrp	x28, _DRM_MODE_PAGE_FLIP_EVENT@GOTPAGE
Lloh21:
	ldr	x28, [x28, _DRM_MODE_PAGE_FLIP_EVENT@GOTPAGEOFF]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_21
; %bb.18:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w23, w8
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w8, [x22]
	cmp	w8, #11
	b.ls	LBB0_29
; %bb.19:
	sub	w8, w8, #12
	str	w8, [x22]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh25:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_28
; %bb.20:
	mov	x26, x0
Lloh28:
	adrp	x8, _DRM_EVENT_FLIP_COMPLETE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _DRM_EVENT_FLIP_COMPLETE@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	mov	w9, #12
	mov	x10, x0
	str	w9, [x10, #24]!
	ldr	w9, [x24, #16]
	stp	w8, w9, [x0, #28]
	str	x10, [x0, #16]
Lloh31:
	adrp	x8, _kfree@GOTPAGE
Lloh32:
	ldr	x8, [x8, _kfree@GOTPAGEOFF]
	stp	x8, x22, [x0]
	b	LBB0_22
LBB0_21:
	mov	x26, #0
LBB0_22:
	ldp	x27, x8, [x25, #16]
	ldr	x8, [x8]
	mov	x0, x25
	mov	x1, x21
	mov	x2, x26
	blr	x8
	cbz	w0, LBB0_25
; %bb.23:
	mov	x23, x0
	ldr	w8, [x24]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.24:
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w8, [x22]
	add	w8, w8, #12
	str	w8, [x22]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x26
	bl	_kfree
	b	LBB0_12
LBB0_25:
	ldr	x8, [x25, #16]
	cmp	x8, x21
	cset	w0, ne
	bl	_WARN_ON
	cbz	x27, LBB0_27
; %bb.26:
	mov	x0, x27
	bl	_drm_framebuffer_unreference
LBB0_27:
	mov	w23, #0
	b	LBB0_15
LBB0_28:
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w8, [x22]
	add	w8, w8, #12
	str	w8, [x22]
LBB0_29:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DRM_MODE_PAGE_FLIP_FLAGS,4,2   ; @DRM_MODE_PAGE_FLIP_FLAGS
	.comm	_DRM_MODE_OBJECT_CRTC,4,2       ; @DRM_MODE_OBJECT_CRTC
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid fb size %ux%u for CRTC viewport %ux%u+%d+%d%s.\n"

l_.str.1:                               ; @.str.1
	.asciz	" (inverted)"

l_.str.2:                               ; @.str.2
	.space	1

	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_DRM_MODE_PAGE_FLIP_EVENT,4,2   ; @DRM_MODE_PAGE_FLIP_EVENT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_DRM_EVENT_FLIP_COMPLETE,4,2    ; @DRM_EVENT_FLIP_COMPLETE
.subsections_via_symbols
