	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saa7146_pgtable_build
_saa7146_pgtable_build:                 ## @saa7146_pgtable_build
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	16(%rsi), %rdi
	callq	_videobuf_to_dma
	movq	%rax, %r13
	movq	8(%rax), %rbx
	movl	(%rax), %r12d
	movq	8(%r15), %rax
	movl	8(%rax), %esi
	movq	%r14, %rdi
	callq	_saa7146_format_by_fourcc
	movq	%rax, %r14
	movslq	%r12d, %rdi
	callq	_DEB_EE
	movl	4(%r14), %edi
	callq	_IS_PLANAR
	movq	(%r15), %rsi
	testq	%rax, %rax
	je	LBB0_91
## %bb.1:
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movl	%r12d, -56(%rbp)                ## 4-byte Spill
	movq	8(%r15), %rax
	movl	4(%rax), %r15d
	imull	(%rax), %r15d
	movl	(%r14), %ecx
	cmpl	$16, %ecx
	je	LBB0_4
## %bb.2:
	movl	$-1, %eax
	cmpl	$12, %ecx
	jne	LBB0_90
## %bb.3:
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leal	(%r14,%r15), %ecx
	movl	%ecx, %eax
	cltd
	idivl	%r14d
	movl	%eax, %r13d
	leal	3(%r15), %esi
	testl	%r15d, %r15d
	cmovnsl	%r15d, %esi
	sarl	$2, %esi
	addl	%r15d, %esi
	leal	(%r14,%rsi), %eax
	cltd
	idivl	%r14d
	movl	%eax, %edi
	movl	%r15d, %eax
	shrl	$31, %eax
	addl	%r15d, %eax
	sarl	%eax
	addl	%ecx, %eax
	cltd
	idivl	%r14d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %eax
	jmp	LBB0_5
LBB0_91:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rdx
	movl	%r12d, %ecx
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_saa7146_pgtable_build_single   ## TAILCALL
LBB0_4:
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leal	(%r14,%r15), %eax
	cltd
	idivl	%r14d
	movl	%eax, %r13d
	movl	%r15d, %ecx
	shrl	$31, %ecx
	addl	%r15d, %ecx
	sarl	%ecx
	addl	%r15d, %ecx
	leal	(%r14,%rcx), %eax
	cltd
	idivl	%r14d
	movl	%eax, %edi
	leal	(%r14,%r15,2), %eax
	cltd
	idivl	%r14d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %eax
LBB0_5:
	cltd
	idivl	%r14d
	movl	%edi, -80(%rbp)                 ## 4-byte Spill
	movl	%edi, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movslq	%edx, %rdi
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	callq	_DEB_CAP
	movl	%r15d, %eax
	cltd
	idivl	%r14d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r14
	movq	16(%rax), %r12
	movq	32(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	movl	%edx, -76(%rbp)                 ## 4-byte Spill
	jle	LBB0_6
## %bb.7:
	movq	%r13, -112(%rbp)                ## 8-byte Spill
	xorl	%r13d, %r13d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	incl	%r13d
	addq	$16, %rbx
	cmpl	-56(%rbp), %r13d                ## 4-byte Folded Reload
	je	LBB0_12
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	cmpl	$0, (%rbx)
	jle	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	callq	_sg_dma_address
	subq	8(%rbx), %rax
	movq	%rax, %rdi
	callq	_cpu_to_le32
	movl	%eax, (%r14)
	addq	$4, %r14
	addl	$4096, %r15d                    ## imm = 0x1000
	cmpl	(%rbx), %r15d
	jl	LBB0_10
	jmp	LBB0_11
LBB0_12:
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	(%rsi), %r14
	movq	-112(%rbp), %r13                ## 8-byte Reload
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_6:
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
LBB0_13:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %r10d
	leal	-1(%r13), %ecx
	movabsq	$8589934584, %r8                ## imm = 0x1FFFFFFF8
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	8(%rax), %rax
	movq	8(%rax), %rax
	movq	%rax, 8(%rsi)
	movslq	-76(%rbp), %rdx                 ## 4-byte Folded Reload
	addq	%rax, %rdx
	movq	%rdx, 24(%rsi)
	addq	%rax, %rdi
	movq	%rdi, 40(%rsi)
	cmpl	%r13d, %r15d
	jge	LBB0_15
## %bb.14:
	movl	%ecx, %r11d
	cmpl	$1023, %r11d                    ## imm = 0x3FF
	jle	LBB0_32
	jmp	LBB0_44
LBB0_15:
	movslq	%ecx, %rsi
	movl	%r15d, %r11d
	subl	%r13d, %r11d
	cmpl	$7, %r11d
	jb	LBB0_26
## %bb.16:
	leaq	(%r14,%rsi,4), %rax
	movq	%r12, %rdx
	subq	%rax, %rdx
	cmpq	$32, %rdx
	jb	LBB0_26
## %bb.17:
	incq	%r11
	movq	%r11, %r9
	andq	%r8, %r9
	leaq	-8(%r9), %rax
	movq	%rax, %rdx
	shrq	$3, %rdx
	incq	%rdx
	movl	%edx, %ebx
	andl	$3, %ebx
	cmpq	$24, %rax
	jae	LBB0_19
## %bb.18:
	xorl	%eax, %eax
	jmp	LBB0_21
LBB0_19:
	movabsq	$4611686018427387896, %rax      ## imm = 0x3FFFFFFFFFFFFFF8
	orq	$4, %rax
	andq	%rax, %rdx
	leaq	(%r14,%rsi,4), %rdi
	addq	$112, %rdi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movups	-112(%rdi,%rax,4), %xmm0
	movups	-96(%rdi,%rax,4), %xmm1
	movups	%xmm0, (%r12,%rax,4)
	movups	%xmm1, 16(%r12,%rax,4)
	movups	-80(%rdi,%rax,4), %xmm0
	movups	-64(%rdi,%rax,4), %xmm1
	movups	%xmm0, 32(%r12,%rax,4)
	movups	%xmm1, 48(%r12,%rax,4)
	movups	-48(%rdi,%rax,4), %xmm0
	movups	-32(%rdi,%rax,4), %xmm1
	movups	%xmm0, 64(%r12,%rax,4)
	movups	%xmm1, 80(%r12,%rax,4)
	movdqu	-16(%rdi,%rax,4), %xmm0
	movups	(%rdi,%rax,4), %xmm1
	movdqu	%xmm0, 96(%r12,%rax,4)
	movups	%xmm1, 112(%r12,%rax,4)
	addq	$32, %rax
	addq	$-4, %rdx
	jne	LBB0_20
LBB0_21:
	testq	%rbx, %rbx
	je	LBB0_24
## %bb.22:
	leaq	(%rax,%rsi), %rdx
	leaq	(%r14,%rdx,4), %rdx
	addq	$16, %rdx
	leaq	(%r12,%rax,4), %rax
	addq	$16, %rax
	shlq	$5, %rbx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rdx,%rdi), %xmm0
	movups	(%rdx,%rdi), %xmm1
	movdqu	%xmm0, -16(%rax,%rdi)
	movups	%xmm1, (%rax,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %rbx
	jne	LBB0_23
LBB0_24:
	leaq	(%r12,%r9,4), %r12
	cmpq	%r9, %r11
	je	LBB0_30
## %bb.25:
	addq	%r9, %rsi
LBB0_26:
	movl	%r15d, %edx
	subl	%esi, %edx
	movl	%esi, %eax
	notl	%eax
	addl	%r15d, %eax
	andl	$7, %edx
	je	LBB0_28
	.p2align	4, 0x90
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%rsi,4), %edi
	movl	%edi, (%r12)
	incq	%rsi
	addq	$4, %r12
	decl	%edx
	jne	LBB0_27
LBB0_28:
	cmpl	$6, %eax
	jbe	LBB0_30
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%rsi,4), %eax
	movl	%eax, (%r12)
	movl	4(%r14,%rsi,4), %eax
	movl	%eax, 4(%r12)
	movl	8(%r14,%rsi,4), %eax
	movl	%eax, 8(%r12)
	movl	12(%r14,%rsi,4), %eax
	movl	%eax, 12(%r12)
	movl	16(%r14,%rsi,4), %eax
	movl	%eax, 16(%r12)
	movl	20(%r14,%rsi,4), %eax
	movl	%eax, 20(%r12)
	movl	24(%r14,%rsi,4), %eax
	movl	%eax, 24(%r12)
	movl	28(%r14,%rsi,4), %eax
	movl	%eax, 28(%r12)
	addq	$8, %rsi
	addq	$32, %r12
	cmpl	%esi, %r15d
	jne	LBB0_29
LBB0_30:
	movl	%r15d, %r11d
	cmpl	$1023, %r11d                    ## imm = 0x3FF
	jg	LBB0_44
LBB0_32:
	movl	-4(%r12), %esi
	movl	$1023, %ebx                     ## imm = 0x3FF
	subl	%r11d, %ebx
	cmpl	$7, %ebx
	jb	LBB0_42
## %bb.33:
	incq	%rbx
	movq	%rbx, %r9
	andq	%r8, %r9
	movd	%esi, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%r9), %rdi
	movq	%rdi, %rdx
	shrq	$3, %rdx
	incq	%rdx
	movl	%edx, %eax
	andl	$7, %eax
	cmpq	$56, %rdi
	jae	LBB0_35
## %bb.34:
	xorl	%edi, %edi
	jmp	LBB0_37
LBB0_35:
	andq	$-8, %rdx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_36:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%r12,%rdi,4)
	movdqu	%xmm0, 16(%r12,%rdi,4)
	movdqu	%xmm0, 32(%r12,%rdi,4)
	movdqu	%xmm0, 48(%r12,%rdi,4)
	movdqu	%xmm0, 64(%r12,%rdi,4)
	movdqu	%xmm0, 80(%r12,%rdi,4)
	movdqu	%xmm0, 96(%r12,%rdi,4)
	movdqu	%xmm0, 112(%r12,%rdi,4)
	movdqu	%xmm0, 128(%r12,%rdi,4)
	movdqu	%xmm0, 144(%r12,%rdi,4)
	movdqu	%xmm0, 160(%r12,%rdi,4)
	movdqu	%xmm0, 176(%r12,%rdi,4)
	movdqu	%xmm0, 192(%r12,%rdi,4)
	movdqu	%xmm0, 208(%r12,%rdi,4)
	movdqu	%xmm0, 224(%r12,%rdi,4)
	movdqu	%xmm0, 240(%r12,%rdi,4)
	addq	$64, %rdi
	addq	$-8, %rdx
	jne	LBB0_36
LBB0_37:
	testq	%rax, %rax
	je	LBB0_40
## %bb.38:
	leaq	(%r12,%rdi,4), %rdx
	addq	$16, %rdx
	shlq	$5, %rax
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_39:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -16(%rdx,%rdi)
	movdqu	%xmm0, (%rdx,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %rax
	jne	LBB0_39
LBB0_40:
	cmpq	%r9, %rbx
	je	LBB0_44
## %bb.41:
	addl	%r9d, %r11d
	leaq	(%r12,%r9,4), %r12
LBB0_42:
	movl	$1024, %eax                     ## imm = 0x400
	subl	%r11d, %eax
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_43:                                ## =>This Inner Loop Header: Depth=1
	movl	%esi, (%r12,%rdx,4)
	incq	%rdx
	cmpl	%edx, %eax
	jne	LBB0_43
LBB0_44:
	movl	-80(%rbp), %r11d                ## 4-byte Reload
	decl	%r11d
	cmpl	%r15d, %r10d
	jge	LBB0_46
## %bb.45:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	cmpl	$1023, %r11d                    ## imm = 0x3FF
	jle	LBB0_64
	jmp	LBB0_76
LBB0_46:
	movslq	%r11d, %rsi
	movl	%r10d, %r11d
	subl	%r15d, %r11d
	cmpl	$7, %r11d
	jae	LBB0_48
## %bb.47:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_58
LBB0_48:
	leaq	(%r14,%rsi,4), %rax
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	subq	%rax, %rdx
	cmpq	$32, %rdx
	jb	LBB0_58
## %bb.49:
	incq	%r11
	movq	%r11, %r9
	andq	%r8, %r9
	leaq	-8(%r9), %rax
	movq	%rax, %rdx
	shrq	$3, %rdx
	incq	%rdx
	movl	%edx, %r15d
	andl	$3, %r15d
	cmpq	$24, %rax
	jae	LBB0_51
## %bb.50:
	xorl	%eax, %eax
	jmp	LBB0_53
LBB0_51:
	movabsq	$4611686018427387896, %rax      ## imm = 0x3FFFFFFFFFFFFFF8
	orq	$4, %rax
	andq	%rax, %rdx
	leaq	(%r14,%rsi,4), %rdi
	addq	$112, %rdi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_52:                                ## =>This Inner Loop Header: Depth=1
	movups	-112(%rdi,%rax,4), %xmm0
	movups	-96(%rdi,%rax,4), %xmm1
	movups	%xmm0, (%rbx,%rax,4)
	movups	%xmm1, 16(%rbx,%rax,4)
	movups	-80(%rdi,%rax,4), %xmm0
	movups	-64(%rdi,%rax,4), %xmm1
	movups	%xmm0, 32(%rbx,%rax,4)
	movups	%xmm1, 48(%rbx,%rax,4)
	movups	-48(%rdi,%rax,4), %xmm0
	movups	-32(%rdi,%rax,4), %xmm1
	movups	%xmm0, 64(%rbx,%rax,4)
	movups	%xmm1, 80(%rbx,%rax,4)
	movdqu	-16(%rdi,%rax,4), %xmm0
	movups	(%rdi,%rax,4), %xmm1
	movdqu	%xmm0, 96(%rbx,%rax,4)
	movups	%xmm1, 112(%rbx,%rax,4)
	addq	$32, %rax
	addq	$-4, %rdx
	jne	LBB0_52
LBB0_53:
	testq	%r15, %r15
	je	LBB0_56
## %bb.54:
	leaq	(%rax,%rsi), %rdx
	leaq	(%r14,%rdx,4), %rdx
	addq	$16, %rdx
	leaq	(%rbx,%rax,4), %rax
	addq	$16, %rax
	shlq	$5, %r15
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_55:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rdx,%rdi), %xmm0
	movups	(%rdx,%rdi), %xmm1
	movdqu	%xmm0, -16(%rax,%rdi)
	movups	%xmm1, (%rax,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %r15
	jne	LBB0_55
LBB0_56:
	leaq	(%rbx,%r9,4), %rbx
	cmpq	%r9, %r11
	je	LBB0_62
## %bb.57:
	addq	%r9, %rsi
LBB0_58:
	movl	%r10d, %edx
	subl	%esi, %edx
	movl	%esi, %eax
	notl	%eax
	addl	%r10d, %eax
	andl	$7, %edx
	je	LBB0_60
	.p2align	4, 0x90
LBB0_59:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%rsi,4), %edi
	movl	%edi, (%rbx)
	incq	%rsi
	addq	$4, %rbx
	decl	%edx
	jne	LBB0_59
LBB0_60:
	cmpl	$6, %eax
	jbe	LBB0_62
	.p2align	4, 0x90
LBB0_61:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%rsi,4), %eax
	movl	%eax, (%rbx)
	movl	4(%r14,%rsi,4), %eax
	movl	%eax, 4(%rbx)
	movl	8(%r14,%rsi,4), %eax
	movl	%eax, 8(%rbx)
	movl	12(%r14,%rsi,4), %eax
	movl	%eax, 12(%rbx)
	movl	16(%r14,%rsi,4), %eax
	movl	%eax, 16(%rbx)
	movl	20(%r14,%rsi,4), %eax
	movl	%eax, 20(%rbx)
	movl	24(%r14,%rsi,4), %eax
	movl	%eax, 24(%rbx)
	movl	28(%r14,%rsi,4), %eax
	movl	%eax, 28(%rbx)
	addq	$8, %rsi
	addq	$32, %rbx
	cmpl	%esi, %r10d
	jne	LBB0_61
LBB0_62:
	movl	%r10d, %r11d
	cmpl	$1023, %r11d                    ## imm = 0x3FF
	jg	LBB0_76
LBB0_64:
	movl	-4(%rbx), %eax
	movl	$1023, %r10d                    ## imm = 0x3FF
	subl	%r11d, %r10d
	cmpl	$7, %r10d
	jb	LBB0_74
## %bb.65:
	incq	%r10
	movq	%r10, %r9
	andq	%r8, %r9
	movd	%eax, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%r9), %rdx
	movq	%rdx, %rdi
	shrq	$3, %rdi
	incq	%rdi
	movl	%edi, %esi
	andl	$7, %esi
	cmpq	$56, %rdx
	jae	LBB0_67
## %bb.66:
	xorl	%edx, %edx
	jmp	LBB0_69
LBB0_67:
	andq	$-8, %rdi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_68:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%rbx,%rdx,4)
	movdqu	%xmm0, 16(%rbx,%rdx,4)
	movdqu	%xmm0, 32(%rbx,%rdx,4)
	movdqu	%xmm0, 48(%rbx,%rdx,4)
	movdqu	%xmm0, 64(%rbx,%rdx,4)
	movdqu	%xmm0, 80(%rbx,%rdx,4)
	movdqu	%xmm0, 96(%rbx,%rdx,4)
	movdqu	%xmm0, 112(%rbx,%rdx,4)
	movdqu	%xmm0, 128(%rbx,%rdx,4)
	movdqu	%xmm0, 144(%rbx,%rdx,4)
	movdqu	%xmm0, 160(%rbx,%rdx,4)
	movdqu	%xmm0, 176(%rbx,%rdx,4)
	movdqu	%xmm0, 192(%rbx,%rdx,4)
	movdqu	%xmm0, 208(%rbx,%rdx,4)
	movdqu	%xmm0, 224(%rbx,%rdx,4)
	movdqu	%xmm0, 240(%rbx,%rdx,4)
	addq	$64, %rdx
	addq	$-8, %rdi
	jne	LBB0_68
LBB0_69:
	testq	%rsi, %rsi
	je	LBB0_72
## %bb.70:
	leaq	(%rbx,%rdx,4), %rdx
	addq	$16, %rdx
	shlq	$5, %rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_71:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -16(%rdx,%rdi)
	movdqu	%xmm0, (%rdx,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %rsi
	jne	LBB0_71
LBB0_72:
	cmpq	%r9, %r10
	je	LBB0_76
## %bb.73:
	addl	%r9d, %r11d
	leaq	(%rbx,%r9,4), %rbx
LBB0_74:
	movl	$1024, %edx                     ## imm = 0x400
	subl	%r11d, %edx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_75:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, (%rbx,%rsi,4)
	incq	%rsi
	cmpl	%esi, %edx
	jne	LBB0_75
LBB0_76:
	cmpl	$1024, %r13d                    ## imm = 0x400
	jg	LBB0_89
## %bb.77:
	movslq	%ecx, %r9
	leaq	(%r14,%r9,4), %rsi
	cmpl	$1024, %r9d                     ## imm = 0x400
	movl	$1023, %r10d                    ## imm = 0x3FF
	cmovgel	%ecx, %r10d
	movl	(%r14,%r9,4), %edi
	subl	%r13d, %r10d
	incl	%r10d
	cmpl	$7, %r10d
	jb	LBB0_87
## %bb.78:
	incq	%r10
	andq	%r10, %r8
	movd	%edi, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%r8), %rax
	movq	%rax, %rdx
	shrq	$3, %rdx
	incq	%rdx
	movl	%edx, %r11d
	andl	$7, %r11d
	cmpq	$56, %rax
	jae	LBB0_80
## %bb.79:
	xorl	%ebx, %ebx
	jmp	LBB0_82
LBB0_80:
	andq	$-8, %rdx
	leaq	(%r14,%r9,4), %rax
	addq	$240, %rax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_81:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -240(%rax,%rbx,4)
	movdqu	%xmm0, -224(%rax,%rbx,4)
	movdqu	%xmm0, -208(%rax,%rbx,4)
	movdqu	%xmm0, -192(%rax,%rbx,4)
	movdqu	%xmm0, -176(%rax,%rbx,4)
	movdqu	%xmm0, -160(%rax,%rbx,4)
	movdqu	%xmm0, -144(%rax,%rbx,4)
	movdqu	%xmm0, -128(%rax,%rbx,4)
	movdqu	%xmm0, -112(%rax,%rbx,4)
	movdqu	%xmm0, -96(%rax,%rbx,4)
	movdqu	%xmm0, -80(%rax,%rbx,4)
	movdqu	%xmm0, -64(%rax,%rbx,4)
	movdqu	%xmm0, -48(%rax,%rbx,4)
	movdqu	%xmm0, -32(%rax,%rbx,4)
	movdqu	%xmm0, -16(%rax,%rbx,4)
	movdqu	%xmm0, (%rax,%rbx,4)
	addq	$64, %rbx
	addq	$-8, %rdx
	jne	LBB0_81
LBB0_82:
	testq	%r11, %r11
	je	LBB0_85
## %bb.83:
	addq	%r9, %rbx
	leaq	(%r14,%rbx,4), %rax
	addq	$16, %rax
	shlq	$5, %r11
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_84:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -16(%rax,%rdx)
	movdqu	%xmm0, (%rax,%rdx)
	addq	$32, %rdx
	cmpq	%rdx, %r11
	jne	LBB0_84
LBB0_85:
	xorl	%eax, %eax
	cmpq	%r8, %r10
	je	LBB0_90
## %bb.86:
	addl	%r8d, %ecx
	leaq	(%rsi,%r8,4), %rsi
LBB0_87:
	decl	%ecx
	.p2align	4, 0x90
LBB0_88:                                ## =>This Inner Loop Header: Depth=1
	movl	%edi, (%rsi)
	addq	$4, %rsi
	incl	%ecx
	cmpl	$1023, %ecx                     ## imm = 0x3FF
	jl	LBB0_88
LBB0_89:
	xorl	%eax, %eax
LBB0_90:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.no_dead_strip	_saa7146_pgtable_build
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function saa7146_pgtable_build
_saa7146_pgtable_build:                 ; @saa7146_pgtable_build
	.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	x23, x1
	mov	x22, x0
	ldr	x24, [x0]
	add	x0, x1, #16
	bl	_videobuf_to_dma
	mov	x19, x0
	ldr	x20, [x0, #8]
	ldr	w21, [x0]
	ldr	x8, [x23, #8]
	ldr	w1, [x8, #8]
	mov	x0, x22
	bl	_saa7146_format_by_fourcc
	mov	x25, x0
	sxtw	x0, w21
	bl	_DEB_EE
	ldr	w0, [x25, #4]
	bl	_IS_PLANAR
	ldr	x22, [x23]
	cbz	x0, LBB0_4
; %bb.1:
	ldr	x8, [x23, #8]
	ldp	w9, w8, [x8]
	mul	w26, w8, w9
	ldr	w8, [x25]
	cmp	w8, #16
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #12
	b.ne	LBB0_15
; %bb.3:
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
	add	w8, w25, w26
	sdiv	w24, w8, w25
	add	w9, w26, #3
	cmp	w26, #0
	csel	w9, w9, w26, lt
	add	w9, w26, w9, asr #2
	add	w10, w25, w9
	sdiv	w11, w10, w25
	cinc	w10, w26, lt
	add	w10, w8, w10, asr #1
	sdiv	w8, w9, w25
	msub	w8, w8, w25, w9
	sdiv	w9, w10, w25
	b	LBB0_6
LBB0_4:
	mov	x0, x24
	mov	x1, x22
	mov	x2, x20
	mov	x3, x21
	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
	b	_saa7146_pgtable_build_single
LBB0_5:
Lloh3:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w25, [x8]
	add	w8, w25, w26
	sdiv	w24, w8, w25
	cmp	w26, #0
	cinc	w8, w26, lt
	add	w8, w26, w8, asr #1
	add	w9, w25, w8
	sdiv	w11, w9, w25
	add	w9, w25, w26, lsl #1
	sdiv	w10, w8, w25
	msub	w8, w10, w25, w8
	sdiv	w9, w9, w25
LBB0_6:
	str	w9, [sp, #36]                   ; 4-byte Folded Spill
	sxtw	x23, w8
	str	w11, [sp, #20]                  ; 4-byte Folded Spill
	mov	w28, w11
	mov	x0, x23
	bl	_DEB_CAP
	sub	w8, w24, #1
	str	x8, [sp, #40]                   ; 8-byte Folded Spill
	sdiv	w8, w26, w25
	msub	w27, w8, w25, w26
	ldr	x26, [x22]
	ldr	x8, [x22, #16]
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	ldr	x8, [x22, #32]
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	cmp	w21, #1
	b.lt	LBB0_13
; %bb.7:
	str	w24, [sp, #4]                   ; 4-byte Folded Spill
	mov	w24, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w24, w24, #1
	add	x20, x20, #16
	cmp	w24, w21
	b.eq	LBB0_12
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w25, #0
LBB0_11:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	bl	_sg_dma_address
	ldr	x8, [x20, #8]
	sub	x0, x0, x8
	bl	_cpu_to_le32
	str	w0, [x26], #4
	ldr	w8, [x20]
	add	w25, w25, #1, lsl #12           ; =4096
	cmp	w25, w8
	b.lt	LBB0_11
	b	LBB0_8
LBB0_12:
	ldr	x26, [x22]
	ldr	w24, [sp, #4]                   ; 4-byte Folded Reload
LBB0_13:
	ldr	w8, [sp, #36]                   ; 4-byte Folded Reload
	mov	w8, w8
	ldr	x9, [x19, #8]
	ldr	x9, [x9, #8]
	str	x9, [x22, #8]
	add	x10, x9, w27, sxtw
	str	x10, [x22, #24]
	add	x9, x9, x23
	str	x9, [x22, #40]
	cmp	w28, w24
	b.ge	LBB0_16
; %bb.14:
	ldr	x10, [sp, #8]                   ; 8-byte Folded Reload
	ldr	x17, [sp, #40]                  ; 8-byte Folded Reload
	mov	x12, x17
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w16, [sp, #20]                  ; 4-byte Folded Reload
	b	LBB0_26
LBB0_15:
	mov	w0, #-1
	b	LBB0_60
LBB0_16:
	ldr	x17, [sp, #40]                  ; 8-byte Folded Reload
	sxtw	x9, w17
	sub	w10, w28, w24
	cmp	w10, #15
	b.hs	LBB0_18
; %bb.17:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w16, [sp, #20]                  ; 4-byte Folded Reload
	ldr	x14, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_23
LBB0_18:
	add	x13, x26, x9, lsl #2
	ldr	x14, [sp, #8]                   ; 8-byte Folded Reload
	sub	x11, x14, x13
	cmp	x11, #64
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w16, [sp, #20]                  ; 4-byte Folded Reload
	b.lo	LBB0_23
; %bb.19:
	add	x11, x10, #1
	and	x12, x11, #0x1fffffff0
	add	x9, x12, x9
	add	x10, x14, x12, lsl #2
	add	x13, x13, #32
	add	x14, x14, #32
	mov	x15, x12
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x13, #-32]
	ldp	q2, q3, [x13], #64
	stp	q0, q1, [x14, #-32]
	stp	q2, q3, [x14], #64
	subs	x15, x15, #16
	b.ne	LBB0_20
; %bb.21:
	cmp	x11, x12
	b.eq	LBB0_25
; %bb.22:
	mov	x14, x10
LBB0_23:
	mov	x10, x14
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x26, x9, lsl #2]
	str	w11, [x10], #4
	add	x9, x9, #1
	cmp	w28, w9
	b.ne	LBB0_24
LBB0_25:
	mov	x12, x28
LBB0_26:
	sub	w9, w16, #1
	cmp	w12, #1023
	b.gt	LBB0_34
; %bb.27:
	ldur	w11, [x10, #-4]
	mov	w13, #1023
	sub	w13, w13, w12
	cmp	w13, #15
	b.hs	LBB0_29
; %bb.28:
	mov	x13, x10
	b	LBB0_32
LBB0_29:
	add	x14, x13, #1
	and	x15, x14, #0x1fffffff0
	add	w12, w12, w15
	add	x13, x10, x15, lsl #2
	dup.4s	v0, w11
	add	x10, x10, #32
	mov	x16, x15
LBB0_30:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x10, #-32]
	stp	q0, q0, [x10], #64
	subs	x16, x16, #16
	b.ne	LBB0_30
; %bb.31:
	cmp	x14, x15
	b.eq	LBB0_34
LBB0_32:
	sub	w10, w12, #1024
LBB0_33:                                ; =>This Inner Loop Header: Depth=1
	str	w11, [x13], #4
	adds	w10, w10, #1
	b.lo	LBB0_33
LBB0_34:
	cmp	w8, w28
	b.ge	LBB0_36
; %bb.35:
	mov	x10, x0
	cmp	w9, #1024
	b.lt	LBB0_45
	b	LBB0_52
LBB0_36:
	sxtw	x9, w9
	sub	w10, w8, w28
	cmp	w10, #15
	b.lo	LBB0_42
; %bb.37:
	add	x13, x26, x9, lsl #2
	sub	x11, x0, x13
	cmp	x11, #64
	b.lo	LBB0_42
; %bb.38:
	add	x11, x10, #1
	and	x12, x11, #0x1fffffff0
	add	x9, x12, x9
	add	x10, x0, x12, lsl #2
	add	x13, x13, #32
	add	x14, x0, #32
	mov	x15, x12
LBB0_39:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x13, #-32]
	ldp	q2, q3, [x13], #64
	stp	q0, q1, [x14, #-32]
	stp	q2, q3, [x14], #64
	subs	x15, x15, #16
	b.ne	LBB0_39
; %bb.40:
	cmp	x11, x12
	b.eq	LBB0_44
; %bb.41:
	mov	x0, x10
LBB0_42:
	mov	x10, x0
LBB0_43:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x26, x9, lsl #2]
	str	w11, [x10], #4
	add	x9, x9, #1
	cmp	w8, w9
	b.ne	LBB0_43
LBB0_44:
	mov	x9, x8
	cmp	w9, #1024
	b.ge	LBB0_52
LBB0_45:
	ldur	w8, [x10, #-4]
	mov	w11, #1023
	sub	w11, w11, w9
	cmp	w11, #15
	b.hs	LBB0_47
; %bb.46:
	mov	x11, x10
	b	LBB0_50
LBB0_47:
	add	x12, x11, #1
	and	x13, x12, #0x1fffffff0
	add	w9, w9, w13
	add	x11, x10, x13, lsl #2
	dup.4s	v0, w8
	add	x10, x10, #32
	mov	x14, x13
LBB0_48:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x10, #-32]
	stp	q0, q0, [x10], #64
	subs	x14, x14, #16
	b.ne	LBB0_48
; %bb.49:
	cmp	x12, x13
	b.eq	LBB0_52
LBB0_50:
	sub	w9, w9, #1024
LBB0_51:                                ; =>This Inner Loop Header: Depth=1
	str	w8, [x11], #4
	adds	w9, w9, #1
	b.lo	LBB0_51
LBB0_52:
	cmp	w24, #1024
	b.gt	LBB0_59
; %bb.53:
	add	x8, x26, w17, sxtw #2
	ldr	w9, [x8]
	mov	w10, #1023
	cmp	w17, #1023
	csel	w10, w17, w10, gt
	sub	w10, w10, w24
	add	w10, w10, #1
	cmp	w10, #15
	b.lo	LBB0_57
; %bb.54:
	mov	x11, x17
	sxtw	x12, w11
	add	x10, x10, #1
	and	x11, x10, #0x1fffffff0
	add	w17, w17, w11
	add	x8, x8, x11, lsl #2
	dup.4s	v0, w9
	add	x12, x26, x12, lsl #2
	add	x12, x12, #32
	mov	x13, x11
LBB0_55:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x12, #-32]
	stp	q0, q0, [x12], #64
	subs	x13, x13, #16
	b.ne	LBB0_55
; %bb.56:
	cmp	x10, x11
	b.eq	LBB0_59
LBB0_57:
	sub	w10, w17, #1
LBB0_58:                                ; =>This Inner Loop Header: Depth=1
	str	w9, [x8], #4
	add	w10, w10, #1
	cmp	w10, #1023
	b.lt	LBB0_58
LBB0_59:
	mov	w0, #0
LBB0_60:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.no_dead_strip	_saa7146_pgtable_build
.subsections_via_symbols
