	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dispc_wb_setup
_dispc_wb_setup:                        ## @dispc_wb_setup
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rsi, %r14
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	_OMAP_DSS_WB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	(%rcx), %r11d
	movl	4(%rcx), %r15d
	movq	_OMAP_DSS_OVL_CAP_SCALE@GOTPCREL(%rip), %rax
	movq	_OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r13d
	orl	(%rax), %r13d
	movq	_DISPLAY_FLAGS_INTERLACED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	testl	%eax, 8(%rcx)
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movl	%r15d, %eax
	shrl	$31, %eax
	addl	%r15d, %eax
	sarl	%eax
	movl	%eax, %r15d
LBB0_2:
	movl	32(%r14), %esi
	movl	28(%r14), %edx
	movl	20(%r14), %r9d
	movl	16(%r14), %r10d
	movl	(%r14), %ebx
	movl	12(%r14), %eax
	subq	$8, %rsp
	leaq	L_.str(%rip), %rdi
	movl	%r11d, %ecx
	movl	%r15d, %r8d
	pushq	%rax
	pushq	%rbx
	pushq	%r10
	movq	%r11, -88(%rbp)                 ## 8-byte Spill
	callq	_DSSDBG
	addq	$32, %rsp
	movl	32(%r14), %ecx
	movl	28(%r14), %r8d
	movl	24(%r14), %r9d
	movl	20(%r14), %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	16(%r14), %r11d
	movl	12(%r14), %eax
	movl	8(%r14), %ebx
	movl	(%r14), %r12d
	movl	4(%r14), %r10d
	subq	$8, %rsp
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r13d, %edx
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	pushq	%r13
	pushq	$1
	pushq	%r10
	pushq	$0
	pushq	%rbx
	pushq	$0
	pushq	%rax
	pushq	%r12
	pushq	%r11
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	pushq	%r15
	pushq	-88(%rbp)                       ## 8-byte Folded Reload
	pushq	$0
	pushq	$0
	callq	_dispc_ovl_setup_common
	addq	$128, %rsp
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.3:
	movl	(%r14), %eax
	andl	$-8, %eax
	xorl	%ebx, %ebx
	cmpl	$128, %eax
	sete	%bl
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edi
	callq	_DISPC_OVL_ATTRIBUTES
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dispc_read_reg
	movl	%eax, %edi
	movl	%ebx, %esi
	movl	$10, %edx
	movl	$10, %ecx
	callq	_FLD_MOD
	movl	%eax, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	$18, %edx
	movl	$16, %ecx
	callq	_FLD_MOD
	movl	%eax, %edi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	%r14d, %esi
	movl	$19, %edx
	movl	$19, %ecx
	callq	_FLD_MOD
	xorl	%esi, %esi
	testl	%r14d, %r14d
	setne	%sil
	movl	%eax, %edi
	movl	$26, %edx
	movl	$24, %ecx
	callq	_FLD_MOD
	movl	%eax, %ebx
	movl	%r13d, %edi
	callq	_DISPC_OVL_ATTRIBUTES
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_dispc_write_reg
	xorl	%ebx, %ebx
	testl	%r14d, %r14d
	movq	%r15, %r14
	jne	LBB0_10
## %bb.4:
	movq	_DSS_WB_TV_MGR@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, (%rax)
	jne	LBB0_6
## %bb.5:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	leaq	12(%rdx), %rax
	movl	16(%rdx), %edi
	jmp	LBB0_7
LBB0_6:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	12(%rdx), %edi
	addl	20(%rdx), %edi
	leaq	16(%rdx), %rax
LBB0_7:
	movq	_DISPLAY_FLAGS_INTERLACED@GOTPCREL(%rip), %rcx
	addl	(%rax), %edi
	movl	(%rcx), %eax
	testl	%eax, 8(%rdx)
	je	LBB0_9
## %bb.8:
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	movl	%eax, %edi
LBB0_9:
	movl	$255, %esi
	callq	_min
	movl	%eax, %ebx
LBB0_10:
	movl	%r13d, %edi
	callq	_DISPC_OVL_ATTRIBUTES2
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	movl	$7, %ecx
	xorl	%r8d, %r8d
	callq	_REG_FLD_MOD
LBB0_11:
	movl	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OMAP_DSS_WB,4,2                ## @OMAP_DSS_WB
	.comm	_OMAP_DSS_OVL_CAP_SCALE,4,2     ## @OMAP_DSS_OVL_CAP_SCALE
	.comm	_OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,4,2 ## @OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA
	.comm	_DISPLAY_FLAGS_INTERLACED,4,2   ## @DISPLAY_FLAGS_INTERLACED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dispc_wb_setup, pa %x, pa_uv %x, %d,%d -> %dx%d, cmode %x, rot %d\n"

	.comm	_DSS_WB_TV_MGR,4,2              ## @DSS_WB_TV_MGR
	.no_dead_strip	_dispc_wb_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dispc_wb_setup
_dispc_wb_setup:                        ; @dispc_wb_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x22, x4
	mov	x21, x3
	mov	x23, x2
	mov	x25, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _OMAP_DSS_WB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OMAP_DSS_WB@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	ldp	w24, w8, [x3]
Lloh3:
	adrp	x9, _OMAP_DSS_OVL_CAP_SCALE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _OMAP_DSS_OVL_CAP_SCALE@GOTPAGEOFF]
Lloh5:
	adrp	x10, _OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA@GOTPAGE
Lloh6:
	ldr	x10, [x10, _OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	ldr	w10, [x10]
	orr	w26, w10, w9
	ldr	w9, [x3, #8]
Lloh9:
	adrp	x28, _DISPLAY_FLAGS_INTERLACED@GOTPAGE
Lloh10:
	ldr	x28, [x28, _DISPLAY_FLAGS_INTERLACED@GOTPAGEOFF]
	ldr	w10, [x28]
	cmp	w8, #0
	cinc	w11, w8, lt
	asr	w11, w11, #1
	tst	w10, w9
	csel	w27, w8, w11, eq
	ldr	w1, [x1, #32]
	ldr	w2, [x25, #28]
	ldp	w6, w5, [x25, #16]
	ldr	w7, [x25]
	ldr	w8, [x25, #12]
	str	w8, [sp]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x24
	mov	x4, x27
	bl	_DSSDBG
	ldp	w4, w3, [x25, #28]
	ldp	w8, w5, [x25, #20]
	ldp	w10, w9, [x25, #12]
	ldp	w13, w11, [x25, #4]
	ldr	w12, [x25]
	str	w23, [sp, #56]
	str	x21, [sp, #48]
	mov	w14, #1
	stp	w13, w14, [sp, #36]
	stp	w11, wzr, [sp, #28]
	stp	w10, wzr, [sp, #20]
	stp	w9, w12, [sp, #12]
	stp	w27, w8, [sp, #4]
	str	w24, [sp]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x26
	mov	w6, #0
	mov	w7, #0
	bl	_dispc_ovl_setup_common
	mov	x24, x0
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	w8, [x25]
	and	w8, w8, #0xfffffff8
	cmp	w8, #128
	cset	w25, eq
	mov	x0, x20
	bl	_DISPC_OVL_ATTRIBUTES
	mov	x1, x0
	mov	x0, x19
	bl	_dispc_read_reg
	mov	x1, x25
	mov	w2, #10
	mov	w3, #10
	bl	_FLD_MOD
	mov	x1, x22
	mov	w2, #18
	mov	w3, #16
	bl	_FLD_MOD
	mov	x1, x23
	mov	w2, #19
	mov	w3, #19
	bl	_FLD_MOD
	cmp	w23, #0
	cset	w1, ne
	mov	w2, #26
	mov	w3, #24
	bl	_FLD_MOD
	mov	x25, x0
	mov	x0, x20
	bl	_DISPC_OVL_ATTRIBUTES
	mov	x1, x0
	mov	x0, x19
	mov	x2, x25
	bl	_dispc_write_reg
	cbz	w23, LBB0_3
; %bb.2:
	mov	w21, #0
	b	LBB0_7
LBB0_3:
Lloh13:
	adrp	x8, _DSS_WB_TV_MGR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DSS_WB_TV_MGR@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_5
; %bb.4:
	add	x9, x21, #12
	ldr	w8, [x21, #16]
	b	LBB0_6
LBB0_5:
	ldr	w8, [x21, #20]
	ldr	w9, [x21, #12]
	add	w8, w9, w8
	add	x9, x21, #16
LBB0_6:
	ldr	w9, [x9]
	add	w8, w8, w9
	ldr	w9, [x21, #8]
	ldr	w10, [x28]
	cmp	w8, #0
	cinc	w11, w8, lt
	asr	w11, w11, #1
	tst	w10, w9
	csel	w0, w8, w11, eq
	mov	w1, #255
	bl	_min
	mov	x21, x0
LBB0_7:
	mov	x0, x20
	bl	_DISPC_OVL_ATTRIBUTES2
	mov	x1, x0
	mov	x0, x19
	mov	x2, x21
	mov	w3, #7
	mov	w4, #0
	bl	_REG_FLD_MOD
LBB0_8:
	mov	x0, x24
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_OMAP_DSS_WB,4,2                ; @OMAP_DSS_WB
	.comm	_OMAP_DSS_OVL_CAP_SCALE,4,2     ; @OMAP_DSS_OVL_CAP_SCALE
	.comm	_OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,4,2 ; @OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA
	.comm	_DISPLAY_FLAGS_INTERLACED,4,2   ; @DISPLAY_FLAGS_INTERLACED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dispc_wb_setup, pa %x, pa_uv %x, %d,%d -> %dx%d, cmode %x, rot %d\n"

	.comm	_DSS_WB_TV_MGR,4,2              ; @DSS_WB_TV_MGR
	.no_dead_strip	_dispc_wb_setup
.subsections_via_symbols
