	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omapfb_setup_plane
_omapfb_setup_plane:                    ## @omapfb_setup_plane
	.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
	movl	%edx, %ebx
	movl	%esi, %r12d
	movq	%rdi, %r14
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movaps	%xmm0, -80(%rbp)
	callq	_omapfb_scaling
	cvtsi2ss	%r12d, %xmm1
	mulss	%xmm0, %xmm1
	cvttss2si	%xmm1, %r13d
	xorps	%xmm1, %xmm1
	cvtsi2ss	%ebx, %xmm1
	mulss	%xmm0, %xmm1
	cvttss2si	%xmm1, %r15d
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	movl	%r15d, %r8d
	callq	_RARCH_LOG
	imull	%r12d, %ebx
	imull	8(%r14), %ebx
	imull	12(%r14), %ebx
	movq	16(%r14), %rax
	cmpl	32(%rax), %ebx
	jle	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_2:
	movl	(%r14), %ebx
	movl	4(%r14), %r12d
	movl	24(%r14), %edi
	movq	_OMAPFB_QUERY_PLANE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rdx
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
LBB0_4:
	xorl	%eax, %eax
	callq	_RARCH_ERR
LBB0_5:
	movl	$-1, %eax
LBB0_6:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%r12d, %ecx
	movl	%ebx, %r12d
	shrl	$31, %r12d
	addl	%ebx, %r12d
	sarl	%r12d
	movl	%r13d, %eax
	shrl	$31, %eax
	addl	%r13d, %eax
	sarl	%eax
	subl	%eax, %r12d
	movl	%r13d, %ebx
	movl	%ecx, %r13d
	shrl	$31, %r13d
	addl	%ecx, %r13d
	sarl	%r13d
	movl	%r15d, %eax
	shrl	$31, %eax
	addl	%r15d, %eax
	sarl	%eax
	subl	%eax, %r13d
	movl	%r12d, -80(%rbp)
	movl	%r13d, -76(%rbp)
	movl	%ebx, -72(%rbp)
	movl	%r15d, -68(%rbp)
	movq	$0, -64(%rbp)
	movl	24(%r14), %edi
	movq	_OMAPFB_SETUP_PLANE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rdx
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.3(%rip), %rdi
	movl	%r12d, %esi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_5
LBB0_9:
	movq	16(%r14), %rax
	movaps	-80(%rbp), %xmm0
	movaps	-64(%rbp), %xmm1
	movups	%xmm1, 16(%rax)
	movups	%xmm0, (%rax)
	xorl	%eax, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"omap_video: scaling %dx%d to %dx%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"omap_video: fb dimensions too large for allocated buffer\n"

	.comm	_OMAPFB_QUERY_PLANE,4,2         ## @OMAPFB_QUERY_PLANE
L_.str.2:                               ## @.str.2
	.asciz	"[video_omap]: setup plane (query) failed\n"

	.comm	_OMAPFB_SETUP_PLANE,4,2         ## @OMAPFB_SETUP_PLANE
L_.str.3:                               ## @.str.3
	.asciz	"[video_omap]: setup plane (param = %d %d %d %d) failed\n"

	.no_dead_strip	_omapfb_setup_plane
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omapfb_setup_plane
_omapfb_setup_plane:                    ; @omapfb_setup_plane
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	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
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #32]
	bl	_omapfb_scaling
	scvtf	s1, w23
	fmul	s1, s0, s1
	fcvtzs	w20, s1
	scvtf	s1, w22
	fmul	s0, s0, s1
	fcvtzs	w21, s0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	mov	x2, x22
	mov	x3, x20
	mov	x4, x21
	bl	_RARCH_LOG
	ldp	w8, w9, [x19]
	cmp	w8, #0
	cinc	w25, w8, lt
	cmp	w20, #0
	cinc	w26, w20, lt
	cmp	w9, #0
	cinc	w24, w9, lt
	cmp	w21, #0
	mul	w8, w22, w23
	ldp	w9, w10, [x19, #8]
	mul	w8, w8, w9
	cinc	w23, w21, lt
	mul	w8, w8, w10
	ldr	x9, [x19, #16]
	ldr	w9, [x9, #32]
	cmp	w8, w9
	b.le	LBB0_2
; %bb.1:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_2:
	ldr	w0, [x19, #24]
Lloh4:
	adrp	x8, _OMAPFB_QUERY_PLANE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _OMAPFB_QUERY_PLANE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x2, sp, #32
	bl	_ioctl
	cbz	x0, LBB0_4
; %bb.3:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_4:
	asr	w8, w25, #1
	sub	w22, w8, w26, asr #1
	asr	w8, w24, #1
	sub	w23, w8, w23, asr #1
	stp	w22, w23, [sp, #32]
	stp	w20, w21, [sp, #40]
	str	xzr, [sp, #48]
	ldr	w0, [x19, #24]
Lloh9:
	adrp	x8, _OMAPFB_SETUP_PLANE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _OMAPFB_SETUP_PLANE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x2, sp, #32
	bl	_ioctl
	cbz	x0, LBB0_8
; %bb.5:
	stp	x20, x21, [sp, #16]
	stp	x22, x23, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_6:
	bl	_RARCH_ERR
	mov	w0, #-1
LBB0_7:
	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
	add	sp, sp, #144
	ret
LBB0_8:
	ldr	x8, [x19, #16]
	ldp	q0, q1, [sp, #32]
	stp	q0, q1, [x8]
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"omap_video: scaling %dx%d to %dx%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"omap_video: fb dimensions too large for allocated buffer\n"

	.comm	_OMAPFB_QUERY_PLANE,4,2         ; @OMAPFB_QUERY_PLANE
l_.str.2:                               ; @.str.2
	.asciz	"[video_omap]: setup plane (query) failed\n"

	.comm	_OMAPFB_SETUP_PLANE,4,2         ; @OMAPFB_SETUP_PLANE
l_.str.3:                               ; @.str.3
	.asciz	"[video_omap]: setup plane (param = %d %d %d %d) failed\n"

	.no_dead_strip	_omapfb_setup_plane
.subsections_via_symbols
