	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rcar_du_crtc_mode_valid
_rcar_du_crtc_mode_valid:               ## @rcar_du_crtc_mode_valid
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	callq	_to_rcar_crtc
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	andl	(%rbx), %r14d
	je	LBB0_3
## %bb.1:
	movq	(%rax), %rdi
	movq	_RCAR_DU_FEATURE_INTERLACED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rcar_du_has
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movl	4(%rbx), %eax
	subl	8(%rbx), %eax
	cmpl	$20, %eax
	jge	LBB0_5
## %bb.4:
	movq	_MODE_HBLANK_NARROW@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_5:
	movl	12(%rbx), %eax
	subl	16(%rbx), %eax
	cmpl	$1, %r14d
	movl	$2, %ecx
	sbbl	$0, %ecx
	cltd
	idivl	%ecx
	cmpl	$3, %eax
	jae	LBB0_6
## %bb.7:
	movq	_MODE_VBLANK_NARROW@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movq	_MODE_NO_INTERLACE@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_MODE_OK@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.comm	_RCAR_DU_FEATURE_INTERLACED,4,2 ## @RCAR_DU_FEATURE_INTERLACED
	.comm	_MODE_NO_INTERLACE,4,2          ## @MODE_NO_INTERLACE
	.comm	_MODE_HBLANK_NARROW,4,2         ## @MODE_HBLANK_NARROW
	.comm	_MODE_VBLANK_NARROW,4,2         ## @MODE_VBLANK_NARROW
	.comm	_MODE_OK,4,2                    ## @MODE_OK
	.no_dead_strip	_rcar_du_crtc_mode_valid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rcar_du_crtc_mode_valid
_rcar_du_crtc_mode_valid:               ; @rcar_du_crtc_mode_valid
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	bl	_to_rcar_crtc
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	ands	w20, w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	x0, [x0]
Lloh3:
	adrp	x8, _RCAR_DU_FEATURE_INTERLACED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RCAR_DU_FEATURE_INTERLACED@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_rcar_du_has
	cbz	w0, LBB0_5
LBB0_2:
	ldp	w8, w9, [x19, #4]
	sub	w8, w8, w9
	cmp	w8, #20
	b.ge	LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _MODE_HBLANK_NARROW@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MODE_HBLANK_NARROW@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	ldp	w8, w9, [x19, #12]
	sub	w8, w8, w9
	cmp	w20, #0
	mov	w9, #1
	cinc	w9, w9, ne
	sdiv	w8, w8, w9
Lloh8:
	adrp	x9, _MODE_OK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MODE_OK@GOTPAGEOFF]
Lloh10:
	adrp	x10, _MODE_VBLANK_NARROW@GOTPAGE
Lloh11:
	ldr	x10, [x10, _MODE_VBLANK_NARROW@GOTPAGEOFF]
	cmp	w8, #3
	csel	x8, x10, x9, lo
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x8, _MODE_NO_INTERLACE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MODE_NO_INTERLACE@GOTPAGEOFF]
LBB0_6:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.comm	_RCAR_DU_FEATURE_INTERLACED,4,2 ; @RCAR_DU_FEATURE_INTERLACED
	.comm	_MODE_NO_INTERLACE,4,2          ; @MODE_NO_INTERLACE
	.comm	_MODE_HBLANK_NARROW,4,2         ; @MODE_HBLANK_NARROW
	.comm	_MODE_VBLANK_NARROW,4,2         ; @MODE_VBLANK_NARROW
	.comm	_MODE_OK,4,2                    ; @MODE_OK
	.no_dead_strip	_rcar_du_crtc_mode_valid
.subsections_via_symbols
