	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_yuv_setup_frame
_ivtv_yuv_setup_frame:                  ## @ivtv_yuv_setup_frame
	.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
	movslq	(%rdi), %r15
	movq	_IVTV_YUV_BUFFERS@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	104(%rdi), %r13
	leaq	(%r15,%r15,4), %r14
	shlq	$4, %r14
	movl	4(%rdi), %ebx
	movl	(%r13,%r14), %r11d
	movl	24(%rsi), %eax
	movl	%eax, 4(%r13,%r14)
	movl	36(%rsi), %ecx
	movl	%ecx, 76(%r13,%r14)
	movl	32(%rsi), %ecx
	movl	%ecx, 72(%r13,%r14)
	movl	28(%rsi), %r10d
	movl	%r10d, 8(%r13,%r14)
	movl	12(%rsi), %ecx
	movl	%ecx, 68(%r13,%r14)
	movl	20(%rsi), %edx
	movl	%edx, 64(%r13,%r14)
	movl	16(%rsi), %edx
	movl	%edx, 60(%r13,%r14)
	movl	8(%rsi), %r8d
	movl	%r8d, 12(%r13,%r14)
	movl	%ecx, 56(%r13,%r14)
	movl	(%rsi), %edx
	movl	%edx, 16(%r13,%r14)
	movl	4(%rsi), %esi
	movl	%esi, 20(%r13,%r14)
	addl	%esi, %eax
	xorl	%ecx, %ecx
	cmpl	$496, %eax                      ## imm = 0x1F0
	setl	%cl
	movl	%ecx, 24(%r13,%r14)
	movl	$0, (%r13,%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 28(%r13,%r14)
	movl	$0, 44(%r13,%r14)
	movq	_IVTV_YUV_MODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	8(%rdi), %eax
	movl	%eax, 48(%r13,%r14)
	testl	%ebx, %ebx
	jns	LBB0_2
## %bb.1:
	movl	12(%rdi), %ebx
	decl	%ebx
LBB0_2:
	leaq	(%r14,%r13), %r12
	leaq	(%r14,%r13), %rcx
	addq	$28, %rcx
	cmpl	$130, %eax
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movl	%r11d, -44(%rbp)                ## 4-byte Spill
	je	LBB0_5
## %bb.3:
	cmpl	$128, %eax
	jne	LBB0_16
## %bb.4:
	movl	$0, 52(%r13,%r14)
	cmpl	$512, %esi                      ## imm = 0x200
	setge	%al
	cmpl	$1021, %esi                     ## imm = 0x3FD
	setge	%dl
	addl	$-1021, %esi                    ## imm = 0xFC03
	cmpl	$-444, %esi                     ## imm = 0xFE44
	setb	%bl
	andb	%al, %bl
	movzbl	%bl, %eax
	movl	%eax, (%rcx)
	movl	%r10d, %eax
	shrl	$31, %eax
	addl	%r10d, %eax
	sarl	%eax
	cmpl	%eax, %r8d
	setl	%al
	orb	%dl, %al
	movzbl	%al, %edx
	jmp	LBB0_19
LBB0_5:
	leaq	(%r14,%r13), %rax
	addq	$52, %rax
	cmpl	$576, %esi                      ## imm = 0x240
	jg	LBB0_8
## %bb.6:
	cmpl	%ebx, %esi
	jle	LBB0_8
## %bb.7:
	cmpl	$721, %edx                      ## imm = 0x2D1
	jge	LBB0_8
## %bb.15:
	movl	$1, (%rax)
	jmp	LBB0_17
LBB0_16:
	movl	$1, 52(%r13,%r14)
LBB0_17:
	movl	$1, (%rcx)
LBB0_18:
	movl	$1, %edx
LBB0_19:
	movl	%edx, 4(%rcx)
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	leaq	24(%rdi), %rbx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	$80, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movups	64(%r12), %xmm0
	movups	%xmm0, 64(%rbx)
	movups	(%r12), %xmm0
	movups	16(%r12), %xmm1
	movups	32(%r12), %xmm2
	movups	48(%r12), %xmm3
	movups	%xmm3, 48(%rbx)
	movups	%xmm2, 32(%rbx)
	movups	%xmm1, 16(%rbx)
	movups	%xmm0, (%rbx)
	movl	$1, (%r12)
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_IVTV_DEBUG_YUV
LBB0_21:
	decl	%r15d
	movl	%r15d, %eax
	cltd
	idivl	-48(%rbp)                       ## 4-byte Folded Reload
	movslq	%edx, %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	orl	%ecx, (%r12)
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	16(%rcx), %rcx
	movq	%rcx, 40(%r13,%r14)
	leaq	(%rax,%rax,4), %rax
	shlq	$4, %rax
	xorl	%edx, %edx
	cmpq	40(%r13,%rax), %rcx
	setne	%dl
	movl	%edx, 36(%r13,%r14)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	$0, (%rax)
	cmpl	$512, %esi                      ## imm = 0x200
	jl	LBB0_12
## %bb.9:
	leal	-577(%rsi), %eax
	cmpl	$444, %eax                      ## imm = 0x1BC
	jb	LBB0_12
## %bb.10:
	cmpl	$721, %edx                      ## imm = 0x2D1
	jl	LBB0_13
## %bb.11:
	cmpl	$1021, %esi                     ## imm = 0x3FD
	jae	LBB0_17
LBB0_12:
	movl	$0, (%rcx)
LBB0_14:
	movl	%r10d, %eax
	shrl	$31, %eax
	addl	%r10d, %eax
	sarl	%eax
	xorl	%edx, %edx
	cmpl	%eax, %r8d
	jge	LBB0_19
	jmp	LBB0_18
LBB0_13:
	movl	$1, (%rcx)
	cmpl	$1020, %esi                     ## imm = 0x3FC
	jbe	LBB0_14
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_IVTV_YUV_BUFFERS,4,2           ## @IVTV_YUV_BUFFERS
	.comm	_IVTV_YUV_MODE_MASK,4,2         ## @IVTV_YUV_MODE_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Requesting reg update for frame %d\n"

	.no_dead_strip	_ivtv_yuv_setup_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtv_yuv_setup_frame
_ivtv_yuv_setup_frame:                  ; @ivtv_yuv_setup_frame
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
Lloh0:
	adrp	x8, _IVTV_YUV_BUFFERS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IVTV_YUV_BUFFERS@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	ldr	x23, [x0, #104]
	mov	w8, #80
	ldp	w21, w14, [x0]
                                        ; kill: def $w21 killed $w21 def $x21
	sxtw	x21, w21
	madd	x20, x21, x8, x23
	ldr	w25, [x20]
	ldr	w8, [x1, #24]
	str	w8, [x20, #4]
	ldr	d0, [x1, #32]
	str	d0, [x20, #72]
	ldr	w10, [x1, #28]
	ldr	w9, [x1, #20]
	str	w9, [x20, #64]
	ldr	w9, [x1, #8]
	stp	w10, w9, [x20, #8]
	ldur	d0, [x1, #12]
	str	s0, [x20, #68]
	str	d0, [x20, #56]
	ldp	w13, w12, [x1]
	stp	w13, w12, [x20, #16]
	add	w8, w12, w8
	cmp	w8, #496
	cset	w8, lt
	str	w8, [x20, #24]
	str	wzr, [x20]
	mov	x11, x20
	str	xzr, [x11, #28]!
	stur	xzr, [x20, #36]
	str	wzr, [x20, #44]
	ldr	w8, [x0, #8]
Lloh3:
	adrp	x15, _IVTV_YUV_MODE_MASK@GOTPAGE
Lloh4:
	ldr	x15, [x15, _IVTV_YUV_MODE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w15, [x15]
	and	w15, w15, w8
	str	w15, [x20, #48]
	tbz	w14, #31, LBB0_2
; %bb.1:
	ldr	w8, [x19, #12]
	sub	w14, w8, #1
LBB0_2:
	add	x8, x20, #32
	cmp	w15, #130
	b.eq	LBB0_5
; %bb.3:
	cmp	w15, #128
	b.ne	LBB0_9
; %bb.4:
	mov	w13, #80
	madd	x13, x21, x13, x23
	str	wzr, [x13, #52]
	sub	w13, w12, #1021
	cmp	w12, #511
	mov	w14, #-444
	ccmp	w13, w14, #2, gt
	cset	w13, lo
	cmp	w10, #0
	cinc	w10, w10, lt
	cmp	w12, #1020
	str	w13, [x11]
	asr	w10, w10, #1
	ccmp	w9, w10, #8, le
	cset	w12, lt
	b	LBB0_11
LBB0_5:
	mov	w15, #80
	madd	x15, x21, x15, x23
	add	x15, x15, #52
	cmp	w12, #576
	b.gt	LBB0_14
; %bb.6:
	cmp	w12, w14
	b.le	LBB0_14
; %bb.7:
	cmp	w13, #721
	b.ge	LBB0_14
; %bb.8:
	mov	w12, #1
	str	w12, [x15]
	b	LBB0_10
LBB0_9:
	mov	w9, #80
	madd	x9, x21, x9, x23
	mov	w12, #1
	str	w12, [x9, #52]
LBB0_10:
	str	w12, [x11]
LBB0_11:
	str	w12, [x8]
	add	x22, x19, #24
	mov	w26, #80
	mov	x0, x22
	mov	x1, x20
	mov	w2, #80
	bl	_memcmp
	cbz	x0, LBB0_13
; %bb.12:
	ldr	q0, [x20]
	str	q0, [x22]
	ldp	q0, q1, [x20, #16]
	ldp	q2, q3, [x20, #48]
	stp	q2, q3, [x22, #48]
	stp	q0, q1, [x22, #16]
	mov	w8, #1
	str	w8, [x20]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_IVTV_DEBUG_YUV
LBB0_13:
	madd	x8, x21, x26, x23
	sub	w9, w21, #1
	sdiv	w10, w9, w24
	msub	w9, w10, w24, w9
	ldr	w10, [x20]
	orr	w10, w10, w25
	str	w10, [x20]
	ldr	x10, [x19, #16]
	str	x10, [x8, #40]
	smaddl	x9, w9, w26, x23
	ldr	x9, [x9, #40]
	cmp	x10, x9
	cset	w9, ne
	str	w9, [x8, #36]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_14:
	str	wzr, [x15]
	cmp	w12, #512
	b.lt	LBB0_18
; %bb.15:
	sub	w14, w12, #577
	cmp	w14, #444
	b.lo	LBB0_18
; %bb.16:
	cmp	w13, #721
	b.lt	LBB0_20
; %bb.17:
	cmp	w12, #1021
	b.hs	LBB0_23
LBB0_18:
	mov	w12, #0
	str	wzr, [x11]
	cmp	w10, #0
	cinc	w10, w10, lt
	cmp	w9, w10, asr #1
	b.ge	LBB0_11
LBB0_19:
	mov	w12, #1
	b	LBB0_11
LBB0_20:
	mov	w13, #1
	str	w13, [x11]
	cmp	w10, #0
	cinc	w10, w10, lt
	cmp	w12, #1020
	b.hi	LBB0_19
; %bb.21:
	asr	w10, w10, #1
	cmp	w9, w10
	b.lt	LBB0_19
; %bb.22:
	mov	w12, #0
	b	LBB0_11
LBB0_23:
	mov	w9, #1
	str	w9, [x11]
	mov	w12, #1
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_IVTV_YUV_BUFFERS,4,2           ; @IVTV_YUV_BUFFERS
	.comm	_IVTV_YUV_MODE_MASK,4,2         ; @IVTV_YUV_MODE_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Requesting reg update for frame %d\n"

	.no_dead_strip	_ivtv_yuv_setup_frame
.subsections_via_symbols
