	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g4x_sprite_check_scaling
_g4x_sprite_check_scaling:              ## @g4x_sprite_check_scaling
	.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	%rsi, %rbx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	leaq	8(%rsi), %r14
	movq	(%rsi), %rax
	movq	16(%rsi), %rcx
	leaq	12(%rsi), %r15
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	(%rcx), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_drm_rect_width
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_drm_rect_height
	movl	%eax, %r14d
	movzwl	14(%rbx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_drm_rect_width
	movl	%eax, %r13d
	movl	%eax, %ebx
	sarl	$16, %ebx
	movq	%r15, %rdi
	callq	_drm_rect_height
	movl	%eax, %edx
	sarl	$16, %edx
	xorl	%r15d, %r15d
	cmpl	%r12d, %ebx
	jne	LBB0_2
## %bb.1:
	cmpl	%r14d, %edx
	je	LBB0_17
LBB0_2:
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	testl	%ecx, (%rsi)
	je	LBB0_3
## %bb.9:
	movl	$6, %r8d
	testl	$65536, %eax                    ## imm = 0x10000
	je	LBB0_4
## %bb.10:
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_16
LBB0_3:
	movl	$3, %r8d
LBB0_4:
	cmpl	$196608, %r13d                  ## imm = 0x30000
	jl	LBB0_8
## %bb.5:
	cmpl	%r8d, %edx
	jl	LBB0_8
## %bb.6:
	cmpl	$134283263, %r13d               ## imm = 0x800FFFF
	ja	LBB0_8
## %bb.7:
	cmpl	$134283264, %eax                ## imm = 0x8010000
	jge	LBB0_8
## %bb.11:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	imull	%eax, %ecx
	andl	$63, %ecx
	imull	%eax, %ebx
	addl	%ecx, %ebx
	cmpl	$4097, %ebx                     ## imm = 0x1001
	jb	LBB0_13
## %bb.12:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%ebx, %esi
	jmp	LBB0_15
LBB0_8:
	movl	$2048, (%rsp)                   ## imm = 0x800
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%ebx, %esi
	movl	$3, %ecx
	movl	$2048, %r9d                     ## imm = 0x800
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_17:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	cmpl	$4097, %esi                     ## imm = 0x1001
	jb	LBB0_17
## %bb.14:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r15d, %r15d
LBB0_15:
	movl	$4096, %edx                     ## imm = 0x1000
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Source height must be even with interlaced modes\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Source dimensions (%dx%d) exceed hardware limits (%dx%d - %dx%d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Fetch width (%d) exceeds hardware max with scaling (%u)\n"

L_.str.3:                               ## @.str.3
	.asciz	"Stride (%u) exceeds hardware max with scaling (%u)\n"

	.no_dead_strip	_g4x_sprite_check_scaling
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g4x_sprite_check_scaling
_g4x_sprite_check_scaling:              ; @g4x_sprite_check_scaling
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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, x1
	mov	x20, x0
	add	x21, x1, #8
	ldr	x8, [x1, #16]
	add	x22, x1, #12
	ldr	x9, [x1]
	ldr	w24, [x9]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	w25, [x8]
	mov	x0, x21
	bl	_drm_rect_width
	mov	x23, x0
	mov	x0, x21
	bl	_drm_rect_height
	mov	x21, x0
	ldrh	w27, [x19, #14]
	mov	x0, x22
	bl	_drm_rect_width
	mov	x19, x0
	asr	w26, w0, #16
	mov	x0, x22
	bl	_drm_rect_height
	asr	w8, w0, #16
	cmp	w26, w23
	ccmp	w8, w21, #0, eq
	b.eq	LBB0_15
; %bb.1:
	ldr	w9, [x20]
Lloh0:
	adrp	x10, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_4
; %bb.2:
	tbnz	w0, #16, LBB0_11
; %bb.3:
	mov	w9, #6
	cmp	w19, #48, lsl #12               ; =196608
	b.ge	LBB0_5
	b	LBB0_10
LBB0_4:
	mov	w9, #3
	cmp	w19, #48, lsl #12               ; =196608
	b.lt	LBB0_10
LBB0_5:
	cmp	w8, w9
	b.lt	LBB0_10
; %bb.6:
	mov	w10, #134283263
	cmp	w19, w10
	b.hi	LBB0_10
; %bb.7:
	cmp	w0, w10
	b.gt	LBB0_10
; %bb.8:
	mul	w8, w27, w25
	and	w8, w8, #0x3f
	madd	w8, w26, w25, w8
	cmp	w8, #1, lsl #12                 ; =4096
	b.ls	LBB0_13
; %bb.9:
	mov	w9, #4096
	stp	x8, x9, [sp]
Lloh3:
	adrp	x0, l_.str.2@PAGE
Lloh4:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_10:
	mov	w10, #2048
	stp	x10, x10, [sp, #32]
	mov	w10, #3
	stp	x10, x9, [sp, #16]
	stp	x26, x8, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_11:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
LBB0_12:
	bl	_DRM_DEBUG_KMS
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
LBB0_13:
	cmp	w24, #1, lsl #12                ; =4096
	b.ls	LBB0_15
; %bb.14:
	mov	w8, #4096
	stp	x24, x8, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_12
LBB0_15:
	mov	w0, #0
LBB0_16:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Source height must be even with interlaced modes\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Source dimensions (%dx%d) exceed hardware limits (%dx%d - %dx%d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Fetch width (%d) exceeds hardware max with scaling (%u)\n"

l_.str.3:                               ; @.str.3
	.asciz	"Stride (%u) exceeds hardware max with scaling (%u)\n"

	.no_dead_strip	_g4x_sprite_check_scaling
.subsections_via_symbols
