	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function xv_calc_out_rect
LCPI0_0:
	.quad	0x3f1a36e2eb1c432d              ## double 1.0E-4
LCPI0_1:
	.quad	0xbff0000000000000              ## double -1
LCPI0_2:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_xv_calc_out_rect:                      ## @xv_calc_out_rect
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%edx, %r15d
	movq	%rsi, %r12
	movl	%edi, %ebx
	xorl	%eax, %eax
	callq	_config_get_ptr
	movl	%r15d, (%r12)
	movl	%r14d, 4(%r12)
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_video_driver_get_aspect_ratio
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	movl	%ebx, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_video_viewport_get_scaled_integer ## TAILCALL
LBB0_2:
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_video_driver_get_aspect_ratio
	movl	%r15d, %r13d
	cvtsi2ss	%r13, %xmm2
	movl	%r14d, %ebx
	cvtsi2ss	%rbx, %xmm1
	movaps	%xmm0, %xmm3
	divss	%xmm1, %xmm2
	movss	%xmm2, -48(%rbp)                ## 4-byte Spill
	movaps	%xmm2, %xmm0
	movss	%xmm3, -44(%rbp)                ## 4-byte Spill
	subss	%xmm3, %xmm0
	callq	_fabs
	movsd	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	jbe	LBB0_7
LBB0_4:
	movq	$0, 8(%r12)
	movl	%r15d, 16(%r12)
LBB0_5:
	movl	%r14d, 20(%r12)
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movss	-48(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movss	-44(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jbe	LBB0_9
## %bb.8:
	divss	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm0
	addsd	LCPI0_1(%rip), %xmm0
	movsd	LCPI0_2(%rip), %xmm1            ## xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	addsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2sd	%r13, %xmm2
	cvtss2sd	%xmm0, %xmm0
	subsd	%xmm0, %xmm1
	mulsd	%xmm2, %xmm1
	cvttsd2si	%xmm1, %rax
	movl	%eax, 8(%r12)
	movl	$0, 12(%r12)
	addsd	%xmm2, %xmm2
	mulsd	%xmm0, %xmm2
	cvttsd2si	%xmm2, %rax
	movl	%eax, 16(%r12)
	jmp	LBB0_5
LBB0_9:
	divss	%xmm1, %xmm0
	cvtss2sd	%xmm0, %xmm0
	addsd	LCPI0_1(%rip), %xmm0
	movsd	LCPI0_2(%rip), %xmm1            ## xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	addsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2sd	%rbx, %xmm2
	cvtss2sd	%xmm0, %xmm0
	subsd	%xmm0, %xmm1
	mulsd	%xmm2, %xmm1
	cvttsd2si	%xmm1, %rax
	movl	$0, 8(%r12)
	movl	%eax, 12(%r12)
	movl	%r15d, 16(%r12)
	addsd	%xmm2, %xmm2
	mulsd	%xmm0, %xmm2
	cvttsd2si	%xmm2, %rax
	movl	%eax, 20(%r12)
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_xv_calc_out_rect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xv_calc_out_rect
_xv_calc_out_rect:                      ; @xv_calc_out_rect
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-64]!             ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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 b8, -56
	.cfi_offset b9, -64
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
	bl	_config_get_ptr
	stp	w21, w20, [x19]
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
	bl	_video_driver_get_aspect_ratio
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	x3, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #64               ; 16-byte Folded Reload
	b	_video_viewport_get_scaled_integer
LBB0_2:
	cbz	w22, LBB0_4
; %bb.3:
	bl	_video_driver_get_aspect_ratio
	fmov	s8, s0
	ucvtf	s0, w21
	ucvtf	s1, w20
	fdiv	s9, s0, s1
	fsub	s0, s9, s8
	bl	_fabs
	mov	x8, #17197
	movk	x8, #60188, lsl #16
	movk	x8, #14050, lsl #32
	movk	x8, #16154, lsl #48
	fmov	d1, x8
	fcmp	d0, d1
	b.pl	LBB0_6
LBB0_4:
	str	xzr, [x19, #8]
	stp	w21, w20, [x19, #16]
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #64               ; 16-byte Folded Reload
	ret
LBB0_6:
	fcmp	s9, s8
	b.le	LBB0_8
; %bb.7:
	fdiv	s0, s8, s9
	fcvt	d0, s0
	fmov	d1, #-1.00000000
	fadd	d0, d0, d1
	fmov	d1, #0.50000000
	fmul	d0, d0, d1
	fadd	d0, d0, d1
	fcvt	s0, d0
	ucvtf	d2, w21
	fcvt	d0, s0
	fsub	d1, d1, d0
	fmul	d1, d1, d2
	fcvtzu	w8, d1
	stp	w8, wzr, [x19, #8]
	fadd	d1, d2, d2
	fmul	d0, d1, d0
	fcvtzu	w8, d0
	stp	w8, w20, [x19, #16]
	b	LBB0_5
LBB0_8:
	fdiv	s0, s9, s8
	fcvt	d0, s0
	fmov	d1, #-1.00000000
	fadd	d0, d0, d1
	fmov	d1, #0.50000000
	fmul	d0, d0, d1
	fadd	d0, d0, d1
	fcvt	s0, d0
	ucvtf	d2, w20
	fcvt	d0, s0
	fsub	d1, d1, d0
	fmul	d1, d1, d2
	fcvtzu	w8, d1
	stp	wzr, w8, [x19, #8]
	fadd	d1, d2, d2
	fmul	d0, d1, d0
	fcvtzu	w8, d0
	stp	w21, w8, [x19, #16]
	b	LBB0_5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_xv_calc_out_rect
.subsections_via_symbols
