	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function framebuffer_check
_framebuffer_check:                     ## @framebuffer_check
	.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
	movq	%rdi, %rbx
	callq	_format_check
	movl	32(%rbx), %esi
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_8
LBB0_2:
	movl	%esi, %edi
	callq	_drm_format_horz_chroma_subsampling
	movl	%eax, %r14d
	movl	32(%rbx), %edi
	callq	_drm_format_vert_chroma_subsampling
	movl	%eax, %r13d
	movl	32(%rbx), %edi
	callq	_drm_format_num_planes
	movl	(%rbx), %r12d
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.3:
	movl	%eax, %r15d
	movl	%r12d, %eax
	cltd
	idivl	%r14d
	testl	%edx, %edx
	je	LBB0_9
LBB0_4:
	movl	4(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
LBB0_5:
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_7:
	subl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	4(%rbx), %r13d
	testl	%r13d, %r13d
	je	LBB0_11
## %bb.10:
	movl	%r13d, %eax
	cltd
	idivl	-44(%rbp)                       ## 4-byte Folded Reload
	testl	%edx, %edx
	je	LBB0_12
LBB0_11:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%r13d, %esi
	jmp	LBB0_5
LBB0_12:
	testl	%r15d, %r15d
	jle	LBB0_22
## %bb.13:
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movl	32(%rbx), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_drm_format_plane_cpp
	movl	%eax, %ecx
	movq	24(%rbx), %rax
	cmpl	$0, (%rax)
	movl	$0, %esi
	je	LBB0_21
## %bb.14:
	movl	%r15d, %eax
	decq	%rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$1, %edi
	xorl	%r8d, %r8d
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %eax
	cltd
	idivl	%edi
	imull	%ecx, %eax
	movq	_UINT_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	ja	LBB0_23
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	8(%rbx), %rdx
	movq	16(%rbx), %rdi
	movl	(%rdx,%r8,4), %esi
	imull	%esi, %r13d
	addl	(%rdi,%r8,4), %r13d
	cmpl	%ecx, %r13d
	ja	LBB0_23
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	cmpl	%eax, %esi
	jb	LBB0_24
## %bb.18:                              ##   in Loop: Header=BB0_15 Depth=1
	cmpq	%r8, -56(%rbp)                  ## 8-byte Folded Reload
	je	LBB0_22
## %bb.19:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	(%rbx), %r12d
	movl	4(%rbx), %eax
	cltd
	idivl	-44(%rbp)                       ## 4-byte Folded Reload
	movl	%eax, %r13d
	movl	32(%rbx), %edi
	leaq	1(%r8), %r15
	movl	%r15d, %esi
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	callq	_drm_format_plane_cpp
	movl	%eax, %ecx
	movq	24(%rbx), %rax
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	cmpl	$0, 4(%rax,%rdx,4)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movq	%r15, %r8
	jne	LBB0_15
## %bb.20:
	movq	%r15, %rsi
LBB0_21:
	leaq	L_.str.3(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	jmp	LBB0_5
LBB0_22:
	xorl	%r14d, %r14d
	jmp	LBB0_8
LBB0_23:
	movq	_ERANGE@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_7
LBB0_24:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%r8d, %edx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad framebuffer format 0x%08x\n"

L_.str.1:                               ## @.str.1
	.asciz	"bad framebuffer width %u\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"bad framebuffer height %u\n"

L_.str.3:                               ## @.str.3
	.asciz	"no buffer object handle for plane %d\n"

	.comm	_UINT_MAX,4,2                   ## @UINT_MAX
	.comm	_ERANGE,4,2                     ## @ERANGE
L_.str.4:                               ## @.str.4
	.asciz	"bad pitch %u for plane %d\n"

	.no_dead_strip	_framebuffer_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function framebuffer_check
_framebuffer_check:                     ; @framebuffer_check
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_format_check
	ldr	w1, [x19, #32]
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
	b	LBB0_7
LBB0_2:
	mov	x0, x1
	bl	_drm_format_horz_chroma_subsampling
	mov	x20, x0
	ldr	w0, [x19, #32]
	bl	_drm_format_vert_chroma_subsampling
	mov	x21, x0
	ldr	w0, [x19, #32]
	bl	_drm_format_num_planes
	ldr	w25, [x19]
	cbz	w25, LBB0_4
; %bb.3:
	sdiv	w8, w25, w20
	msub	w8, w8, w20, w25
	cbz	w8, LBB0_8
LBB0_4:
	ldr	w1, [x19, #4]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_5:
	bl	_DRM_DEBUG_KMS
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_7:
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	ldr	w23, [x19, #4]
	cbz	w23, LBB0_10
; %bb.9:
	sdiv	w8, w23, w21
	msub	w8, w8, w21, w23
	cbz	w8, LBB0_11
LBB0_10:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x23
	b	LBB0_5
LBB0_11:
	mov	x24, x0
	cmp	w0, #1
	b.lt	LBB0_19
; %bb.12:
	ldr	w0, [x19, #32]
	mov	w1, #0
	bl	_drm_format_plane_cpp
	ldr	x8, [x19, #24]
	ldr	w8, [x8]
	cbz	w8, LBB0_20
; %bb.13:
	mov	x22, #0
	mov	w8, w24
	sub	x26, x8, #1
	mov	w8, #1
Lloh8:
	adrp	x27, _UINT_MAX@GOTPAGE
Lloh9:
	ldr	x27, [x27, _UINT_MAX@GOTPAGEOFF]
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	sdiv	w8, w25, w8
	mul	w8, w8, w0
	ldr	w9, [x27]
	cmp	w8, w9
	b.hi	LBB0_22
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	lsl	x10, x22, #2
	ldp	x11, x12, [x19, #8]
	ldr	w1, [x11, x10]
	ldr	w10, [x12, x10]
	madd	w10, w1, w23, w10
	cmp	w10, w9
	b.hi	LBB0_22
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	cmp	w1, w8
	b.lo	LBB0_23
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	cmp	x26, x22
	b.eq	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
	ldp	w25, w8, [x19]
	ldr	w0, [x19, #32]
	add	x24, x22, #1
	sdiv	w23, w8, w21
	mov	x1, x24
	bl	_drm_format_plane_cpp
	ldr	x8, [x19, #24]
	add	x8, x8, x22, lsl #2
	ldr	w9, [x8, #4]
	mov	x22, x24
	mov	x8, x20
	cbnz	w9, LBB0_14
	b	LBB0_21
LBB0_19:
	mov	w20, #0
	b	LBB0_7
LBB0_20:
	mov	w22, #0
LBB0_21:
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x22
	b	LBB0_5
LBB0_22:
Lloh12:
	adrp	x8, _ERANGE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
	b	LBB0_6
LBB0_23:
	str	x22, [sp]
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad framebuffer format 0x%08x\n"

l_.str.1:                               ; @.str.1
	.asciz	"bad framebuffer width %u\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"bad framebuffer height %u\n"

l_.str.3:                               ; @.str.3
	.asciz	"no buffer object handle for plane %d\n"

	.comm	_UINT_MAX,4,2                   ; @UINT_MAX
	.comm	_ERANGE,4,2                     ; @ERANGE
l_.str.4:                               ; @.str.4
	.asciz	"bad pitch %u for plane %d\n"

	.no_dead_strip	_framebuffer_check
.subsections_via_symbols
