	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dispc_init_mflag
_dispc_init_mflag:                      ## @dispc_init_mflag
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_DISPC_GLOBAL_MFLAG_ATTRIBUTE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_dispc_write_reg
	movq	%r14, %rdi
	callq	_dispc_get_num_ovls
	testl	%eax, %eax
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_dispc_ovl_get_fifo_size
	movl	%eax, %r15d
	movq	(%r14), %rax
	movl	(%rax), %r12d
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_dispc_ovl_set_mflag
	movl	%r15d, %eax
	shrl	$31, %eax
	addl	%r15d, %eax
	sarl	%eax
	cltd
	idivl	%r12d
	movl	%eax, %ecx
	leal	(%r15,%r15,4), %edx
	leal	(%r15,%r15,4), %eax
	addl	$7, %eax
	testl	%edx, %edx
	cmovnsl	%edx, %eax
	sarl	$3, %eax
	cltd
	idivl	%r12d
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%ecx, %edx
	movl	%eax, %ecx
	callq	_dispc_ovl_set_mflag_threshold
	incl	%ebx
	movq	%r14, %rdi
	callq	_dispc_get_num_ovls
	cmpl	%eax, %ebx
	jl	LBB0_2
LBB0_3:
	movq	(%r14), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_4
## %bb.5:
	movq	_OMAP_DSS_WB@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_dispc_ovl_get_fifo_size
	movl	%eax, %ebx
	movq	(%r14), %rax
	movl	(%rax), %r12d
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_dispc_ovl_set_mflag
	movl	%ebx, %eax
	shrl	$31, %eax
	addl	%ebx, %eax
	sarl	%eax
	cltd
	idivl	%r12d
	movl	%eax, %ecx
	leal	(%rbx,%rbx,4), %edx
	leal	(%rbx,%rbx,4), %eax
	addl	$7, %eax
	testl	%edx, %edx
	cmovnsl	%edx, %eax
	sarl	$3, %eax
	cltd
	idivl	%r12d
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%ecx, %edx
	movl	%eax, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dispc_ovl_set_mflag_threshold  ## TAILCALL
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DISPC_GLOBAL_MFLAG_ATTRIBUTE,4,2 ## @DISPC_GLOBAL_MFLAG_ATTRIBUTE
	.comm	_OMAP_DSS_WB,4,2                ## @OMAP_DSS_WB
	.no_dead_strip	_dispc_init_mflag
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dispc_init_mflag
_dispc_init_mflag:                      ; @dispc_init_mflag
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _DISPC_GLOBAL_MFLAG_ATTRIBUTE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DISPC_GLOBAL_MFLAG_ATTRIBUTE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_dispc_write_reg
	mov	x0, x19
	bl	_dispc_get_num_ovls
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w20, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_dispc_ovl_get_fifo_size
	mov	x21, x0
	ldr	x8, [x19]
	ldr	w22, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_dispc_ovl_set_mflag
	cmp	w21, #0
	cinc	w8, w21, lt
	asr	w8, w8, #1
	sdiv	w2, w8, w22
	add	w8, w21, w21, lsl #2
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #3
	sdiv	w3, w8, w22
	mov	x0, x19
	mov	x1, x20
	bl	_dispc_ovl_set_mflag_threshold
	add	w20, w20, #1
	mov	x0, x19
	bl	_dispc_get_num_ovls
	cmp	w20, w0
	b.lt	LBB0_2
LBB0_3:
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_5
; %bb.4:
Lloh3:
	adrp	x21, _OMAP_DSS_WB@GOTPAGE
Lloh4:
	ldr	x21, [x21, _OMAP_DSS_WB@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_dispc_ovl_get_fifo_size
	mov	x20, x0
	ldr	x8, [x19]
	ldr	w22, [x8]
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #1
	bl	_dispc_ovl_set_mflag
	cmp	w20, #0
	cinc	w8, w20, lt
	asr	w8, w8, #1
	sdiv	w2, w8, w22
	add	w8, w20, w20, lsl #2
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #3
	ldr	w1, [x21]
	sdiv	w3, w8, w22
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_dispc_ovl_set_mflag_threshold
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DISPC_GLOBAL_MFLAG_ATTRIBUTE,4,2 ; @DISPC_GLOBAL_MFLAG_ATTRIBUTE
	.comm	_OMAP_DSS_WB,4,2                ; @OMAP_DSS_WB
	.no_dead_strip	_dispc_init_mflag
.subsections_via_symbols
