	.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, %rbx
	movq	%rdi, %r13
	movq	(%rdi), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	16(%rsi), %rdi
	callq	_videobuf_to_dma
	movq	8(%rax), %r14
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	(%rax), %r12d
	movq	8(%rbx), %rax
	movl	8(%rax), %esi
	movq	%r13, %rdi
	callq	_saa7146_format_by_fourcc
	movq	%rax, %r15
	leaq	L_.str(%rip), %rdi
	movq	%r13, %rsi
	movl	%r12d, %r13d
	movq	%rbx, %rdx
	movl	%r12d, %ecx
	callq	_DEB_EE
	movl	4(%r15), %edi
	callq	_IS_PLANAR
	movq	(%rbx), %rsi
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	8(%rbx), %rax
	movl	4(%rax), %ebx
	imull	(%rax), %ebx
	movl	(%r15), %ecx
	cmpl	$16, %ecx
	je	LBB0_5
## %bb.2:
	movl	$-1, %eax
	cmpl	$12, %ecx
	jne	LBB0_90
## %bb.3:
	movq	%rsi, %r15
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leal	(%rdi,%rbx), %esi
	movl	%esi, %eax
	cltd
	idivl	%edi
	movl	%eax, %r12d
	decl	%r12d
	leal	3(%rbx), %ecx
	testl	%ebx, %ebx
	cmovnsl	%ebx, %ecx
	sarl	$2, %ecx
	addl	%ebx, %ecx
	leal	(%rdi,%rcx), %eax
	cltd
	idivl	%edi
	movl	%eax, %r8d
	decl	%r8d
	movl	%ebx, %eax
	shrl	$31, %eax
	addl	%ebx, %eax
	sarl	%eax
	addl	%esi, %eax
	cltd
	idivl	%edi
	movl	%eax, %r9d
	decl	%r9d
	movl	%ebx, %eax
	cltd
	idivl	%edi
	movl	%edx, %r10d
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, (%rsp)
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movl	%r8d, %ecx
	movq	%r9, -96(%rbp)                  ## 8-byte Spill
	movl	%r9d, %r8d
	jmp	LBB0_6
LBB0_4:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rdx
	movl	%r13d, %ecx
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_saa7146_pgtable_build_single   ## TAILCALL
LBB0_5:
	movq	%rsi, %r15
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leal	(%rdi,%rbx), %eax
	cltd
	idivl	%edi
	movl	%eax, %r12d
	decl	%r12d
	movl	%ebx, %ecx
	shrl	$31, %ecx
	addl	%ebx, %ecx
	sarl	%ecx
	addl	%ebx, %ecx
	leal	(%rdi,%rcx), %eax
	cltd
	idivl	%edi
	movl	%eax, %r9d
	decl	%r9d
	leal	(%rdi,%rbx,2), %eax
	cltd
	idivl	%edi
	movl	%eax, %r8d
	decl	%r8d
	movl	%ebx, %eax
	cltd
	idivl	%edi
	movl	%edx, %r10d
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, (%rsp)
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movl	%r9d, %ecx
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
                                        ## kill: def $r8d killed $r8d killed $r8
LBB0_6:
	movl	%r10d, -48(%rbp)                ## 4-byte Spill
	movl	%r10d, %r9d
	callq	_DEB_CAP
	movq	%r15, %rax
	movq	(%r15), %rbx
	movq	16(%r15), %r15
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	32(%rax), %rax
	testl	%r13d, %r13d
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_13
## %bb.7:
	movl	%r12d, -76(%rbp)                ## 4-byte Spill
	xorl	%r12d, %r12d
	movl	%r13d, -72(%rbp)                ## 4-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=1
	incl	%r12d
	addq	$16, %r14
	cmpl	-72(%rbp), %r12d                ## 4-byte Folded Reload
	je	LBB0_12
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	cmpl	$0, (%r14)
	jle	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	callq	_sg_dma_address
	subq	8(%r14), %rax
	movq	%rax, %rdi
	callq	_cpu_to_le32
	movl	%eax, (%rbx)
	addq	$4, %rbx
	addl	$4096, %r13d                    ## imm = 0x1000
	cmpl	(%r14), %r13d
	jl	LBB0_11
	jmp	LBB0_8
LBB0_12:
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	movq	(%rdx), %rbx
	movl	-76(%rbp), %r12d                ## 4-byte Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_13:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
LBB0_14:
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movabsq	$8589934584, %r8                ## imm = 0x1FFFFFFF8
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	8(%rax), %rax
	movq	8(%rax), %rax
	movq	%rax, 8(%rdx)
	movslq	%ecx, %rcx
	addq	%rax, %rcx
	movq	%rcx, 24(%rdx)
	movslq	%esi, %rcx
	addq	%rax, %rcx
	movq	%rcx, 40(%rdx)
	movl	%r14d, %r11d
	subl	%r12d, %r11d
	jge	LBB0_16
## %bb.15:
	movl	%r12d, %r10d
	movq	-56(%rbp), %r11                 ## 8-byte Reload
	jmp	LBB0_34
LBB0_16:
	movslq	%r12d, %rdx
	leal	1(%r14), %r10d
	cmpl	$7, %r11d
	jb	LBB0_17
## %bb.18:
	leaq	(%rbx,%rdx,4), %rax
	movq	%r15, %rcx
	subq	%rax, %rcx
	cmpq	$32, %rcx
	jae	LBB0_20
LBB0_17:
	movq	-56(%rbp), %r11                 ## 8-byte Reload
LBB0_29:
	movl	%r14d, %eax
	subl	%edx, %eax
	leal	1(%rax), %ecx
	andl	$7, %ecx
	je	LBB0_31
	.p2align	4, 0x90
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rdx,4), %esi
	movl	%esi, (%r15)
	incq	%rdx
	addq	$4, %r15
	decl	%ecx
	jne	LBB0_30
LBB0_31:
	cmpl	$7, %eax
	jb	LBB0_34
## %bb.32:
	movslq	%r14d, %rax
	incq	%rax
	.p2align	4, 0x90
LBB0_33:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rdx,4), %ecx
	movl	%ecx, (%r15)
	movl	4(%rbx,%rdx,4), %ecx
	movl	%ecx, 4(%r15)
	movl	8(%rbx,%rdx,4), %ecx
	movl	%ecx, 8(%r15)
	movl	12(%rbx,%rdx,4), %ecx
	movl	%ecx, 12(%r15)
	movl	16(%rbx,%rdx,4), %ecx
	movl	%ecx, 16(%r15)
	movl	20(%rbx,%rdx,4), %ecx
	movl	%ecx, 20(%r15)
	movl	24(%rbx,%rdx,4), %ecx
	movl	%ecx, 24(%r15)
	movl	28(%rbx,%rdx,4), %ecx
	movl	%ecx, 28(%r15)
	addq	$8, %rdx
	addq	$32, %r15
	cmpl	%edx, %eax
	jne	LBB0_33
	jmp	LBB0_34
LBB0_20:
	incq	%r11
	movq	%r11, %r9
	andq	%r8, %r9
	leaq	-8(%r9), %rax
	movq	%rax, %rcx
	shrq	$3, %rcx
	incq	%rcx
	movl	%ecx, %edi
	andl	$3, %edi
	cmpq	$24, %rax
	jae	LBB0_22
## %bb.21:
	xorl	%eax, %eax
	jmp	LBB0_24
LBB0_22:
	movabsq	$4611686018427387896, %rax      ## imm = 0x3FFFFFFFFFFFFFF8
	orq	$4, %rax
	andq	%rax, %rcx
	leaq	(%rbx,%rdx,4), %rsi
	addq	$112, %rsi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movups	-112(%rsi,%rax,4), %xmm0
	movups	-96(%rsi,%rax,4), %xmm1
	movups	%xmm0, (%r15,%rax,4)
	movups	%xmm1, 16(%r15,%rax,4)
	movups	-80(%rsi,%rax,4), %xmm0
	movups	-64(%rsi,%rax,4), %xmm1
	movups	%xmm0, 32(%r15,%rax,4)
	movups	%xmm1, 48(%r15,%rax,4)
	movups	-48(%rsi,%rax,4), %xmm0
	movups	-32(%rsi,%rax,4), %xmm1
	movups	%xmm0, 64(%r15,%rax,4)
	movups	%xmm1, 80(%r15,%rax,4)
	movdqu	-16(%rsi,%rax,4), %xmm0
	movups	(%rsi,%rax,4), %xmm1
	movdqu	%xmm0, 96(%r15,%rax,4)
	movups	%xmm1, 112(%r15,%rax,4)
	addq	$32, %rax
	addq	$-4, %rcx
	jne	LBB0_23
LBB0_24:
	testq	%rdi, %rdi
	je	LBB0_27
## %bb.25:
	leaq	(%rax,%rdx), %rcx
	leaq	(%rbx,%rcx,4), %rcx
	addq	$16, %rcx
	leaq	(%r15,%rax,4), %rax
	addq	$16, %rax
	shlq	$5, %rdi
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_26:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rcx,%rsi), %xmm0
	movups	(%rcx,%rsi), %xmm1
	movdqu	%xmm0, -16(%rax,%rsi)
	movups	%xmm1, (%rax,%rsi)
	addq	$32, %rsi
	cmpq	%rsi, %rdi
	jne	LBB0_26
LBB0_27:
	leaq	(%r15,%r9,4), %r15
	cmpq	%r9, %r11
	movq	-56(%rbp), %r11                 ## 8-byte Reload
	jne	LBB0_28
LBB0_34:
	cmpl	$1023, %r10d                    ## imm = 0x3FF
	jg	LBB0_47
## %bb.35:
	movl	-4(%r15), %edx
	movl	$1023, %esi                     ## imm = 0x3FF
	subl	%r10d, %esi
	cmpl	$7, %esi
	jb	LBB0_45
## %bb.36:
	incq	%rsi
	movq	%rsi, %r9
	andq	%r8, %r9
	movd	%edx, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%r9), %rdi
	movq	%rdi, %rcx
	shrq	$3, %rcx
	incq	%rcx
	movl	%ecx, %eax
	andl	$7, %eax
	cmpq	$56, %rdi
	jae	LBB0_38
## %bb.37:
	xorl	%edi, %edi
	jmp	LBB0_40
LBB0_38:
	andq	$-8, %rcx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_39:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%r15,%rdi,4)
	movdqu	%xmm0, 16(%r15,%rdi,4)
	movdqu	%xmm0, 32(%r15,%rdi,4)
	movdqu	%xmm0, 48(%r15,%rdi,4)
	movdqu	%xmm0, 64(%r15,%rdi,4)
	movdqu	%xmm0, 80(%r15,%rdi,4)
	movdqu	%xmm0, 96(%r15,%rdi,4)
	movdqu	%xmm0, 112(%r15,%rdi,4)
	movdqu	%xmm0, 128(%r15,%rdi,4)
	movdqu	%xmm0, 144(%r15,%rdi,4)
	movdqu	%xmm0, 160(%r15,%rdi,4)
	movdqu	%xmm0, 176(%r15,%rdi,4)
	movdqu	%xmm0, 192(%r15,%rdi,4)
	movdqu	%xmm0, 208(%r15,%rdi,4)
	movdqu	%xmm0, 224(%r15,%rdi,4)
	movdqu	%xmm0, 240(%r15,%rdi,4)
	addq	$64, %rdi
	addq	$-8, %rcx
	jne	LBB0_39
LBB0_40:
	testq	%rax, %rax
	je	LBB0_43
## %bb.41:
	leaq	(%r15,%rdi,4), %rcx
	addq	$16, %rcx
	shlq	$5, %rax
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_42:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -16(%rcx,%rdi)
	movdqu	%xmm0, (%rcx,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %rax
	jne	LBB0_42
LBB0_43:
	cmpq	%r9, %rsi
	je	LBB0_47
## %bb.44:
	addl	%r9d, %r10d
	leaq	(%r15,%r9,4), %r15
LBB0_45:
	movl	$1024, %eax                     ## imm = 0x400
	subl	%r10d, %eax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_46:                                ## =>This Inner Loop Header: Depth=1
	movl	%edx, (%r15,%rcx,4)
	incq	%rcx
	cmpl	%ecx, %eax
	jne	LBB0_46
LBB0_47:
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movl	%r15d, %r10d
	subl	%r14d, %r10d
	jl	LBB0_64
## %bb.48:
	movslq	%r14d, %rax
	leal	1(%r15), %r14d
	cmpl	$7, %r10d
	jb	LBB0_59
## %bb.49:
	leaq	(%rbx,%rax,4), %rcx
	movq	%r11, %rdx
	subq	%rcx, %rdx
	cmpq	$32, %rdx
	jb	LBB0_59
## %bb.50:
	incq	%r10
	movq	%r10, %r9
	andq	%r8, %r9
	leaq	-8(%r9), %rdx
	movq	%rdx, %rdi
	shrq	$3, %rdi
	incq	%rdi
	movl	%edi, %ecx
	andl	$3, %ecx
	cmpq	$24, %rdx
	jae	LBB0_52
## %bb.51:
	xorl	%esi, %esi
	jmp	LBB0_54
LBB0_28:
	addq	%r9, %rdx
	jmp	LBB0_29
LBB0_52:
	movabsq	$4611686018427387896, %rdx      ## imm = 0x3FFFFFFFFFFFFFF8
	orq	$4, %rdx
	andq	%rdx, %rdi
	leaq	(%rbx,%rax,4), %rdx
	addq	$112, %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_53:                                ## =>This Inner Loop Header: Depth=1
	movups	-112(%rdx,%rsi,4), %xmm0
	movups	-96(%rdx,%rsi,4), %xmm1
	movups	%xmm0, (%r11,%rsi,4)
	movups	%xmm1, 16(%r11,%rsi,4)
	movups	-80(%rdx,%rsi,4), %xmm0
	movups	-64(%rdx,%rsi,4), %xmm1
	movups	%xmm0, 32(%r11,%rsi,4)
	movups	%xmm1, 48(%r11,%rsi,4)
	movups	-48(%rdx,%rsi,4), %xmm0
	movups	-32(%rdx,%rsi,4), %xmm1
	movups	%xmm0, 64(%r11,%rsi,4)
	movups	%xmm1, 80(%r11,%rsi,4)
	movdqu	-16(%rdx,%rsi,4), %xmm0
	movups	(%rdx,%rsi,4), %xmm1
	movdqu	%xmm0, 96(%r11,%rsi,4)
	movups	%xmm1, 112(%r11,%rsi,4)
	addq	$32, %rsi
	addq	$-4, %rdi
	jne	LBB0_53
LBB0_54:
	testq	%rcx, %rcx
	je	LBB0_57
## %bb.55:
	leaq	(%rsi,%rax), %rdx
	leaq	(%rbx,%rdx,4), %rdx
	addq	$16, %rdx
	leaq	(%r11,%rsi,4), %rsi
	addq	$16, %rsi
	shlq	$5, %rcx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_56:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rdx,%rdi), %xmm0
	movups	(%rdx,%rdi), %xmm1
	movdqu	%xmm0, -16(%rsi,%rdi)
	movups	%xmm1, (%rsi,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %rcx
	jne	LBB0_56
LBB0_57:
	leaq	(%r11,%r9,4), %r11
	cmpq	%r9, %r10
	je	LBB0_64
## %bb.58:
	addq	%r9, %rax
LBB0_59:
	movl	%r15d, %ecx
	subl	%eax, %ecx
	leal	1(%rcx), %edx
	andl	$7, %edx
	je	LBB0_61
	.p2align	4, 0x90
LBB0_60:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rax,4), %esi
	movl	%esi, (%r11)
	incq	%rax
	addq	$4, %r11
	decl	%edx
	jne	LBB0_60
LBB0_61:
	cmpl	$7, %ecx
	jb	LBB0_64
## %bb.62:
	movslq	%r15d, %rcx
	incq	%rcx
	.p2align	4, 0x90
LBB0_63:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rax,4), %edx
	movl	%edx, (%r11)
	movl	4(%rbx,%rax,4), %edx
	movl	%edx, 4(%r11)
	movl	8(%rbx,%rax,4), %edx
	movl	%edx, 8(%r11)
	movl	12(%rbx,%rax,4), %edx
	movl	%edx, 12(%r11)
	movl	16(%rbx,%rax,4), %edx
	movl	%edx, 16(%r11)
	movl	20(%rbx,%rax,4), %edx
	movl	%edx, 20(%r11)
	movl	24(%rbx,%rax,4), %edx
	movl	%edx, 24(%r11)
	movl	28(%rbx,%rax,4), %edx
	movl	%edx, 28(%r11)
	addq	$8, %rax
	addq	$32, %r11
	cmpl	%eax, %ecx
	jne	LBB0_63
LBB0_64:
	cmpl	$1023, %r14d                    ## imm = 0x3FF
	jg	LBB0_77
## %bb.65:
	movl	-4(%r11), %eax
	movl	$1023, %edx                     ## imm = 0x3FF
	subl	%r14d, %edx
	cmpl	$7, %edx
	jb	LBB0_75
## %bb.66:
	incq	%rdx
	movq	%rdx, %r9
	andq	%r8, %r9
	movd	%eax, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%r9), %rsi
	movq	%rsi, %rdi
	shrq	$3, %rdi
	incq	%rdi
	movl	%edi, %ecx
	andl	$7, %ecx
	cmpq	$56, %rsi
	jae	LBB0_68
## %bb.67:
	xorl	%esi, %esi
	jmp	LBB0_70
LBB0_68:
	andq	$-8, %rdi
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_69:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%r11,%rsi,4)
	movdqu	%xmm0, 16(%r11,%rsi,4)
	movdqu	%xmm0, 32(%r11,%rsi,4)
	movdqu	%xmm0, 48(%r11,%rsi,4)
	movdqu	%xmm0, 64(%r11,%rsi,4)
	movdqu	%xmm0, 80(%r11,%rsi,4)
	movdqu	%xmm0, 96(%r11,%rsi,4)
	movdqu	%xmm0, 112(%r11,%rsi,4)
	movdqu	%xmm0, 128(%r11,%rsi,4)
	movdqu	%xmm0, 144(%r11,%rsi,4)
	movdqu	%xmm0, 160(%r11,%rsi,4)
	movdqu	%xmm0, 176(%r11,%rsi,4)
	movdqu	%xmm0, 192(%r11,%rsi,4)
	movdqu	%xmm0, 208(%r11,%rsi,4)
	movdqu	%xmm0, 224(%r11,%rsi,4)
	movdqu	%xmm0, 240(%r11,%rsi,4)
	addq	$64, %rsi
	addq	$-8, %rdi
	jne	LBB0_69
LBB0_70:
	testq	%rcx, %rcx
	je	LBB0_73
## %bb.71:
	leaq	(%r11,%rsi,4), %rsi
	addq	$16, %rsi
	shlq	$5, %rcx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_72:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -16(%rsi,%rdi)
	movdqu	%xmm0, (%rsi,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %rcx
	jne	LBB0_72
LBB0_73:
	cmpq	%r9, %rdx
	je	LBB0_77
## %bb.74:
	addl	%r9d, %r14d
	leaq	(%r11,%r9,4), %r11
LBB0_75:
	movl	$1024, %ecx                     ## imm = 0x400
	subl	%r14d, %ecx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_76:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, (%r11,%rdx,4)
	incq	%rdx
	cmpl	%edx, %ecx
	jne	LBB0_76
LBB0_77:
	xorl	%eax, %eax
	cmpl	$1023, %r12d                    ## imm = 0x3FF
	jg	LBB0_90
## %bb.78:
	movslq	%r12d, %r9
	leaq	(%rbx,%r9,4), %rdx
	movl	(%rbx,%r9,4), %esi
	movl	$1023, %r10d                    ## imm = 0x3FF
	subl	%r12d, %r10d
	cmpl	$7, %r10d
	jb	LBB0_88
## %bb.79:
	incq	%r10
	andq	%r10, %r8
	movd	%esi, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%r8), %rax
	movq	%rax, %rcx
	shrq	$3, %rcx
	incq	%rcx
	movl	%ecx, %r11d
	andl	$7, %r11d
	cmpq	$56, %rax
	jae	LBB0_81
## %bb.80:
	xorl	%edi, %edi
	jmp	LBB0_83
LBB0_81:
	andq	$-8, %rcx
	leaq	(%rbx,%r9,4), %rax
	addq	$240, %rax
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_82:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -240(%rax,%rdi,4)
	movdqu	%xmm0, -224(%rax,%rdi,4)
	movdqu	%xmm0, -208(%rax,%rdi,4)
	movdqu	%xmm0, -192(%rax,%rdi,4)
	movdqu	%xmm0, -176(%rax,%rdi,4)
	movdqu	%xmm0, -160(%rax,%rdi,4)
	movdqu	%xmm0, -144(%rax,%rdi,4)
	movdqu	%xmm0, -128(%rax,%rdi,4)
	movdqu	%xmm0, -112(%rax,%rdi,4)
	movdqu	%xmm0, -96(%rax,%rdi,4)
	movdqu	%xmm0, -80(%rax,%rdi,4)
	movdqu	%xmm0, -64(%rax,%rdi,4)
	movdqu	%xmm0, -48(%rax,%rdi,4)
	movdqu	%xmm0, -32(%rax,%rdi,4)
	movdqu	%xmm0, -16(%rax,%rdi,4)
	movdqu	%xmm0, (%rax,%rdi,4)
	addq	$64, %rdi
	addq	$-8, %rcx
	jne	LBB0_82
LBB0_83:
	testq	%r11, %r11
	je	LBB0_86
## %bb.84:
	addq	%r9, %rdi
	leaq	(%rbx,%rdi,4), %rax
	addq	$16, %rax
	shlq	$5, %r11
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_85:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -16(%rax,%rcx)
	movdqu	%xmm0, (%rax,%rcx)
	addq	$32, %rcx
	cmpq	%rcx, %r11
	jne	LBB0_85
LBB0_86:
	xorl	%eax, %eax
	cmpq	%r8, %r10
	je	LBB0_90
## %bb.87:
	addl	%r8d, %r12d
	leaq	(%rdx,%r8,4), %rdx
LBB0_88:
	movl	$1024, %ecx                     ## imm = 0x400
	subl	%r12d, %ecx
	xorl	%eax, %eax
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_89:                                ## =>This Inner Loop Header: Depth=1
	movl	%esi, (%rdx,%rdi,4)
	incq	%rdi
	cmpl	%edi, %ecx
	jne	LBB0_89
LBB0_90:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dev:%p, buf:%p, sg_len:%d\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"size:%d, m1:%d, m2:%d, m3:%d, o1:%d, o2:%d\n"

	.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, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x1
	mov	x25, x0
	ldr	x20, [x0]
	add	x0, x1, #16
	bl	_videobuf_to_dma
	mov	x22, x0
	ldr	x23, [x0, #8]
	ldr	w24, [x0]
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #8]
	mov	x0, x25
	bl	_saa7146_format_by_fourcc
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x25
	mov	x2, x19
	mov	x3, x24
	bl	_DEB_EE
	ldr	w0, [x21, #4]
	bl	_IS_PLANAR
	ldr	x25, [x19]
	cbz	x0, LBB0_4
; %bb.1:
	ldr	x8, [x19, #8]
	ldp	w9, w8, [x8]
	mul	w1, w8, w9
	ldr	w8, [x21]
	cmp	w8, #16
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #12
	b.ne	LBB0_15
; %bb.3:
Lloh2:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	add	w9, w8, w1
	sdiv	w10, w9, w8
	sub	w20, w10, #1
	add	w10, w1, #3
	cmp	w1, #0
	csel	w10, w10, w1, lt
	add	w10, w1, w10, asr #2
	add	w11, w8, w10
	sdiv	w11, w11, w8
	cinc	w12, w1, lt
	sub	w3, w11, #1
	add	w9, w9, w12, asr #1
	sdiv	w9, w9, w8
	sub	w4, w9, #1
	sdiv	w9, w1, w8
	msub	w5, w9, w8, w1
	sdiv	w9, w10, w8
	msub	w27, w9, w8, w10
	b	LBB0_6
LBB0_4:
	mov	x0, x20
	mov	x1, x25
	mov	x2, x23
	mov	x3, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_saa7146_pgtable_build_single
LBB0_5:
Lloh5:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	add	w9, w8, w1
	sdiv	w9, w9, w8
	sub	w20, w9, #1
	cmp	w1, #0
	cinc	w9, w1, lt
	add	w9, w1, w9, asr #1
	add	w10, w8, w9
	sdiv	w10, w10, w8
	sub	w3, w10, #1
	add	w10, w8, w1, lsl #1
	sdiv	w10, w10, w8
	sub	w4, w10, #1
	sdiv	w10, w1, w8
	msub	w5, w10, w8, w1
	sdiv	w10, w9, w8
	msub	w27, w10, w8, w9
LBB0_6:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x20
	str	x3, [sp, #24]                   ; 8-byte Folded Spill
                                        ; kill: def $w3 killed $w3 killed $x3
	stp	w4, w5, [sp, #16]               ; 8-byte Folded Spill
	mov	x6, x27
	bl	_DEB_CAP
	ldr	x28, [x25]
	ldr	x19, [x25, #16]
	ldr	x21, [x25, #32]
	cmp	w24, #1
	b.lt	LBB0_13
; %bb.7:
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
	mov	w20, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w20, w20, #1
	add	x23, x23, #16
	cmp	w20, w24
	b.eq	LBB0_12
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w26, #0
LBB0_11:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x23
	bl	_sg_dma_address
	ldr	x8, [x23, #8]
	sub	x0, x0, x8
	bl	_cpu_to_le32
	str	w0, [x28], #4
	ldr	w8, [x23]
	add	w26, w26, #1, lsl #12           ; =4096
	cmp	w26, w8
	b.lt	LBB0_11
	b	LBB0_8
LBB0_12:
	ldr	x28, [x25]
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
LBB0_13:
	ldr	x16, [sp, #24]                  ; 8-byte Folded Reload
	ldr	w9, [sp, #20]                   ; 4-byte Folded Reload
	ldr	x8, [x22, #8]
	ldr	x8, [x8, #8]
	str	x8, [x25, #8]
	add	x9, x8, w9, sxtw
	str	x9, [x25, #24]
	add	x8, x8, w27, sxtw
	str	x8, [x25, #40]
	subs	w10, w16, w20
	b.ge	LBB0_16
; %bb.14:
	mov	x8, x20
	ldr	w17, [sp, #16]                  ; 4-byte Folded Reload
	b	LBB0_25
LBB0_15:
	mov	w0, #-1
	b	LBB0_58
LBB0_16:
	sxtw	x9, w20
	add	w8, w16, #1
	cmp	w10, #15
	b.hs	LBB0_18
; %bb.17:
	ldr	w17, [sp, #16]                  ; 4-byte Folded Reload
	b	LBB0_23
LBB0_18:
	add	x13, x28, x9, lsl #2
	sub	x11, x19, x13
	cmp	x11, #64
	ldr	w17, [sp, #16]                  ; 4-byte Folded Reload
	b.lo	LBB0_23
; %bb.19:
	add	x10, x10, #1
	and	x11, x10, #0x1fffffff0
	add	x9, x11, x9
	add	x12, x19, x11, lsl #2
	add	x13, x13, #32
	add	x14, x19, #32
	mov	x15, x11
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:
	mov	x19, x12
	cmp	x10, x11
	b.ne	LBB0_23
; %bb.22:
	mov	x19, x12
	b	LBB0_25
LBB0_23:
	add	x10, x28, x9, lsl #2
	sub	w9, w16, w9
	add	w9, w9, #1
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10], #4
	str	w11, [x19], #4
	subs	w9, w9, #1
	b.ne	LBB0_24
LBB0_25:
	cmp	w8, #1023
	b.gt	LBB0_33
; %bb.26:
	ldur	w9, [x19, #-4]
	mov	w10, #1023
	sub	w10, w10, w8
	cmp	w10, #15
	b.hs	LBB0_28
; %bb.27:
	mov	x10, x19
	b	LBB0_31
LBB0_28:
	add	x11, x10, #1
	and	x12, x11, #0x1fffffff0
	add	w8, w8, w12
	add	x10, x19, x12, lsl #2
	dup.4s	v0, w9
	add	x13, x19, #32
	mov	x14, x12
LBB0_29:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x13, #-32]
	stp	q0, q0, [x13], #64
	subs	x14, x14, #16
	b.ne	LBB0_29
; %bb.30:
	cmp	x11, x12
	b.eq	LBB0_33
LBB0_31:
	sub	w8, w8, #1024
LBB0_32:                                ; =>This Inner Loop Header: Depth=1
	str	w9, [x10], #4
	adds	w8, w8, #1
	b.lo	LBB0_32
LBB0_33:
	subs	w9, w17, w16
	b.lt	LBB0_42
; %bb.34:
	sxtw	x8, w16
	add	w16, w17, #1
	cmp	w9, #15
	b.lo	LBB0_40
; %bb.35:
	add	x12, x28, x8, lsl #2
	sub	x10, x21, x12
	cmp	x10, #64
	b.lo	LBB0_40
; %bb.36:
	add	x9, x9, #1
	and	x10, x9, #0x1fffffff0
	add	x8, x10, x8
	add	x11, x21, x10, lsl #2
	add	x12, x12, #32
	add	x13, x21, #32
	mov	x14, x10
LBB0_37:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x12, #-32]
	ldp	q2, q3, [x12], #64
	stp	q0, q1, [x13, #-32]
	stp	q2, q3, [x13], #64
	subs	x14, x14, #16
	b.ne	LBB0_37
; %bb.38:
	mov	x21, x11
	cmp	x9, x10
	b.ne	LBB0_40
; %bb.39:
	mov	x21, x11
	b	LBB0_42
LBB0_40:
	add	x9, x28, x8, lsl #2
	sub	w8, w17, w8
	add	w8, w8, #1
LBB0_41:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9], #4
	str	w10, [x21], #4
	subs	w8, w8, #1
	b.ne	LBB0_41
LBB0_42:
	cmp	w16, #1023
	b.gt	LBB0_50
; %bb.43:
	ldur	w8, [x21, #-4]
	mov	w9, #1023
	sub	w9, w9, w16
	cmp	w9, #15
	b.hs	LBB0_45
; %bb.44:
	mov	x9, x21
	b	LBB0_48
LBB0_45:
	add	x10, x9, #1
	and	x11, x10, #0x1fffffff0
	add	w16, w16, w11
	add	x9, x21, x11, lsl #2
	dup.4s	v0, w8
	add	x12, x21, #32
	mov	x13, x11
LBB0_46:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x12, #-32]
	stp	q0, q0, [x12], #64
	subs	x13, x13, #16
	b.ne	LBB0_46
; %bb.47:
	cmp	x10, x11
	b.eq	LBB0_50
LBB0_48:
	sub	w10, w16, #1024
LBB0_49:                                ; =>This Inner Loop Header: Depth=1
	str	w8, [x9], #4
	adds	w10, w10, #1
	b.lo	LBB0_49
LBB0_50:
	cmp	w20, #1023
	b.gt	LBB0_57
; %bb.51:
	add	x8, x28, w20, sxtw #2
	ldr	w9, [x8]
	mov	w10, #1023
	sub	w10, w10, w20
	cmp	w10, #15
	b.lo	LBB0_55
; %bb.52:
	mov	x11, x20
	sxtw	x12, w11
	add	x10, x10, #1
	and	x11, x10, #0x1fffffff0
	add	w20, w20, w11
	add	x8, x8, x11, lsl #2
	dup.4s	v0, w9
	add	x12, x28, x12, lsl #2
	add	x12, x12, #32
	mov	x13, x11
LBB0_53:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x12, #-32]
	stp	q0, q0, [x12], #64
	subs	x13, x13, #16
	b.ne	LBB0_53
; %bb.54:
	cmp	x10, x11
	b.eq	LBB0_57
LBB0_55:
	sub	w10, w20, #1024
LBB0_56:                                ; =>This Inner Loop Header: Depth=1
	str	w9, [x8], #4
	adds	w10, w10, #1
	b.lo	LBB0_56
LBB0_57:
	mov	w0, #0
LBB0_58:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dev:%p, buf:%p, sg_len:%d\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"size:%d, m1:%d, m2:%d, m3:%d, o1:%d, o2:%d\n"

	.no_dead_strip	_saa7146_pgtable_build
.subsections_via_symbols
