	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calculate_recout
_calculate_recout:                      ## @calculate_recout
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	32(%rdi), %rcx
	movq	48(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	cmpq	%rcx, (%rax)
	sete	%al
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_3
LBB0_1:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_3:
	movq	56(%rdi), %rsi
	movq	(%rcx), %rax
	movq	40(%rdi), %rdx
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.5:
	cmpq	%rcx, (%rdx)
	sete	%dl
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_6
LBB0_4:
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
LBB0_6:
	movl	8(%rcx), %r9d
	movq	16(%rcx), %r12
	movl	24(%rcx), %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	(%rsi), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	8(%rsi), %rbx
	movq	_VIEW_3D_FORMAT_TOP_AND_BOTTOM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, (%rdi)
	subq	40(%rsi), %rax
	jle	LBB0_7
## %bb.8:
	movl	16(%rsi), %ecx
	movl	48(%rsi), %r10d
	movslq	%ecx, %r13
	imulq	%r13, %rax
	movslq	%r10d, %r8
	movq	%rax, %rdx
	orq	%r8, %rdx
	shrq	$32, %rdx
	je	LBB0_9
## %bb.10:
	cqto
	idivq	%r8
	movq	%rax, %r8
	jmp	LBB0_11
LBB0_7:
	movl	16(%rsi), %ecx
	movl	48(%rsi), %r10d
	movslq	%ecx, %r13
	movq	%rbx, %r8
	jmp	LBB0_12
LBB0_9:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r10d
	movl	%eax, %r8d
LBB0_11:
	addq	%rbx, %r8
	movq	%r8, (%rdi)
LBB0_12:
	imull	%r9d, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%r10d
	movslq	%eax, %r10
	leaq	(%r8,%r10), %rax
	addq	%r13, %rbx
	movl	%ebx, %ecx
	subl	%r8d, %ecx
	cmpq	%rbx, %rax
	cmovgl	%ecx, %r10d
	movl	%r10d, 8(%rdi)
	movq	24(%rsi), %r9
	leaq	16(%rdi), %rbx
	movq	%r9, 16(%rdi)
	subq	56(%rsi), %r12
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	jle	LBB0_13
## %bb.14:
	movl	32(%rsi), %ecx
	movl	64(%rsi), %r14d
	movslq	%ecx, %r11
	imulq	%r11, %r12
	movslq	%r14d, %rsi
	movq	%r12, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_15
## %bb.16:
	movq	%r12, %rax
	cqto
	idivq	%rsi
	movq	%rax, %rsi
	jmp	LBB0_17
LBB0_13:
	movl	32(%rsi), %ecx
	movl	64(%rsi), %r14d
	movslq	%ecx, %r11
	movq	%r9, %rsi
	jmp	LBB0_18
LBB0_15:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%r14d
	movl	%eax, %esi
LBB0_17:
	addq	%r9, %rsi
	movq	%rsi, (%rbx)
LBB0_18:
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	cmpq	%r13, %r15
	sete	%r12b
	imull	-52(%rbp), %ecx                 ## 4-byte Folded Reload
	movl	%ecx, %eax
	cltd
	idivl	%r14d
	leaq	24(%rdi), %r14
	cltq
	leaq	(%rsi,%rax), %rdx
	addq	%r11, %r9
	movl	%r9d, %ecx
	subl	%esi, %ecx
	cmpq	%r9, %rdx
	cmovgl	%ecx, %eax
	movl	%eax, 24(%rdi)
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	testb	%r12b, %bl
	je	LBB0_20
## %bb.19:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_23
LBB0_20:
	cmpq	%r13, %r15
	sete	%cl
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	testb	%cl, %dl
	jne	LBB0_24
## %bb.21:
	leaq	8(%rdi), %r14
	testb	%bl, %bl
	je	LBB0_26
## %bb.22:
	movl	%r10d, %eax
	movq	%r8, %rsi
LBB0_23:
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movslq	%ecx, %rcx
	addq	%rsi, %rcx
	movq	%rcx, (%rdi)
	incl	%eax
LBB0_24:
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, (%r14)
LBB0_25:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	movl	%edx, %ecx
	movl	%r10d, %eax
	testb	%cl, %cl
	jne	LBB0_24
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_VIEW_3D_FORMAT_TOP_AND_BOTTOM,8,3 ## @VIEW_3D_FORMAT_TOP_AND_BOTTOM
	.no_dead_strip	_calculate_recout
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calculate_recout
_calculate_recout:                      ; @calculate_recout
	.cfi_startproc
; %bb.0:
	ldr	x10, [x0, #32]
	ldp	x8, x12, [x0, #48]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x8]
	cmp	x8, x10
	cset	w8, eq
LBB0_2:
	ldr	x14, [x10]
	ldr	x9, [x0, #40]
	cbz	x9, LBB0_4
; %bb.3:
	ldr	x9, [x9]
	cmp	x9, x10
	cset	w9, eq
LBB0_4:
	ldr	w15, [x10, #8]
	ldr	x1, [x10, #16]
	ldr	w13, [x10, #24]
Lloh0:
	adrp	x10, _VIEW_3D_FORMAT_TOP_AND_BOTTOM@GOTPAGE
Lloh1:
	ldr	x10, [x10, _VIEW_3D_FORMAT_TOP_AND_BOTTOM@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	ldp	x11, x16, [x12]
	str	x16, [x0]
	ldr	x17, [x12, #40]
	subs	x14, x14, x17
	b.le	LBB0_6
; %bb.5:
	ldr	w3, [x12, #16]
	sxtw	x17, w3
	mul	x14, x14, x17
	ldrsw	x2, [x12, #48]
	sdiv	x14, x14, x2
	add	x14, x14, x16
	str	x14, [x0]
                                        ; kill: def $w3 killed $w3 killed $x3 def $x3
	b	LBB0_7
LBB0_6:
	ldr	w3, [x12, #16]
	ldr	w2, [x12, #48]
	sxtw	x17, w3
	mov	x14, x16
LBB0_7:
	mul	w15, w3, w15
	sdiv	w15, w15, w2
	add	x2, x14, w15, sxtw
	add	x16, x16, x17
	sub	w17, w16, w14
	cmp	x2, x16
	csel	w16, w17, w15, gt
	mov	x15, x0
	str	w16, [x15, #8]!
	ldr	x2, [x12, #24]
	mov	x17, x15
	str	x2, [x17, #8]!
	ldr	x3, [x12, #56]
	subs	x3, x1, x3
	b.le	LBB0_9
; %bb.8:
	ldr	w4, [x12, #32]
	sxtw	x1, w4
	mul	x5, x3, x1
	ldrsw	x3, [x12, #64]
	sdiv	x12, x5, x3
	add	x12, x12, x2
	str	x12, [x17]
                                        ; kill: def $w4 killed $w4 killed $x4 def $x4
	b	LBB0_10
LBB0_9:
	ldr	w4, [x12, #32]
	ldr	w3, [x12, #64]
	sxtw	x1, w4
	mov	x12, x2
LBB0_10:
	cmp	x11, x10
	cset	w5, eq
	mul	w13, w4, w13
	sdiv	w13, w13, w3
	add	x3, x12, w13, sxtw
	add	x1, x2, x1
	sub	w2, w1, w12
	cmp	x3, x1
	csel	w13, w2, w13, gt
	mov	x1, x0
	str	w13, [x1, #24]!
	and	w2, w9, w5
	tbnz	w2, #0, LBB0_14
; %bb.11:
	cmp	x11, x10
	cset	w10, eq
	and	w10, w8, w10
	tbnz	w10, #0, LBB0_15
; %bb.12:
	mov	x13, x16
	tbz	w9, #0, LBB0_17
; %bb.13:
	mov	x12, x14
	mov	x17, x0
	mov	x1, x15
LBB0_14:
	cmp	w13, #0
	cinc	w8, w13, lt
	asr	w8, w8, #1
	add	x8, x12, w8, sxtw
	str	x8, [x17]
	add	w13, w13, #1
LBB0_15:
	cmp	w13, #0
	cinc	w8, w13, lt
	asr	w8, w8, #1
	str	w8, [x1]
LBB0_16:
	ret
LBB0_17:
	mov	x1, x15
	tbnz	w8, #0, LBB0_15
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_VIEW_3D_FORMAT_TOP_AND_BOTTOM,8,3 ; @VIEW_3D_FORMAT_TOP_AND_BOTTOM
	.no_dead_strip	_calculate_recout
.subsections_via_symbols
