	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_hdmi_avi_infoframe_from_display_mode ## -- Begin function drm_hdmi_avi_infoframe_from_display_mode
	.p2align	4, 0x90
_drm_hdmi_avi_infoframe_from_display_mode: ## @drm_hdmi_avi_infoframe_from_display_mode
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rdx, %r14
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.3:
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_hdmi_avi_infoframe_init
	testl	%eax, %eax
	js	LBB0_18
## %bb.4:
	movq	_DRM_MODE_FLAG_DBLCLK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_6
## %bb.5:
	movl	$1, (%rbx)
LBB0_6:
	movq	%r14, %rdi
	callq	_drm_match_cea_mode
	movl	%eax, 4(%rbx)
	movq	%r15, %rdi
	callq	_is_hdmi2_sink
	movl	4(%rbx), %ecx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	cmpl	$64, %ecx
	jg	LBB0_11
LBB0_8:
	testl	%ecx, %ecx
	je	LBB0_12
## %bb.9:
	movq	%r14, %rdi
	callq	_drm_match_hdmi_mode
	movq	_DRM_MODE_FLAG_3D_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	andl	(%r14), %r15d
	movl	%eax, %edi
	callq	_drm_valid_hdmi_vic
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	testl	%r15d, %r15d
	jne	LBB0_12
LBB0_11:
	movl	$0, 4(%rbx)
LBB0_12:
	movq	_HDMI_PICTURE_ASPECT_NONE@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	movl	%eax, 8(%rbx)
	movq	_HDMI_CONTENT_TYPE_GRAPHICS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%rbx)
	movq	$0, 24(%rbx)
	movl	4(%r14), %r14d
	cmpl	%eax, %r14d
	jne	LBB0_14
## %bb.13:
	movl	4(%rbx), %edi
	callq	_drm_get_cea_aspect_ratio
	movl	%eax, %r14d
LBB0_14:
	movq	_HDMI_PICTURE_ASPECT_16_9@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jbe	LBB0_17
## %bb.15:
	movl	4(%rbx), %edi
	callq	_drm_get_cea_aspect_ratio
	cmpl	%eax, %r14d
	jne	LBB0_2
## %bb.16:
	movl	(%r15), %r14d
LBB0_17:
	movl	%r14d, 8(%rbx)
	movq	_HDMI_ACTIVE_ASPECT_PICTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	_HDMI_SCAN_MODE_UNDERSCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_18
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DRM_MODE_FLAG_DBLCLK,4,2       ## @DRM_MODE_FLAG_DBLCLK
	.comm	_DRM_MODE_FLAG_3D_MASK,4,2      ## @DRM_MODE_FLAG_3D_MASK
	.comm	_HDMI_PICTURE_ASPECT_NONE,4,2   ## @HDMI_PICTURE_ASPECT_NONE
	.comm	_HDMI_CONTENT_TYPE_GRAPHICS,4,2 ## @HDMI_CONTENT_TYPE_GRAPHICS
	.comm	_HDMI_PICTURE_ASPECT_16_9,4,2   ## @HDMI_PICTURE_ASPECT_16_9
	.comm	_HDMI_ACTIVE_ASPECT_PICTURE,4,2 ## @HDMI_ACTIVE_ASPECT_PICTURE
	.comm	_HDMI_SCAN_MODE_UNDERSCAN,4,2   ## @HDMI_SCAN_MODE_UNDERSCAN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_hdmi_avi_infoframe_from_display_mode ; -- Begin function drm_hdmi_avi_infoframe_from_display_mode
	.p2align	2
_drm_hdmi_avi_infoframe_from_display_mode: ; @drm_hdmi_avi_infoframe_from_display_mode
	.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
	cbz	x0, LBB0_17
; %bb.1:
	mov	x20, x2
	cbz	x2, LBB0_17
; %bb.2:
	mov	x21, x1
	mov	x19, x0
	bl	_hdmi_avi_infoframe_init
	tbnz	w0, #31, LBB0_18
; %bb.3:
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _DRM_MODE_FLAG_DBLCLK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_MODE_FLAG_DBLCLK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	mov	w8, #1
	str	w8, [x19]
LBB0_5:
	mov	x0, x20
	bl	_drm_match_cea_mode
	str	w0, [x19, #4]
	mov	x0, x21
	bl	_is_hdmi2_sink
	ldr	w8, [x19, #4]
	cbnz	w0, LBB0_7
; %bb.6:
	cmp	w8, #64
	b.gt	LBB0_10
LBB0_7:
	cbz	w8, LBB0_11
; %bb.8:
	mov	x0, x20
	bl	_drm_match_hdmi_mode
	ldr	w21, [x20]
Lloh3:
	adrp	x8, _DRM_MODE_FLAG_3D_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DRM_MODE_FLAG_3D_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	bl	_drm_valid_hdmi_vic
	cbz	x0, LBB0_11
; %bb.9:
	and	w8, w22, w21
	cbnz	w8, LBB0_11
LBB0_10:
	str	wzr, [x19, #4]
LBB0_11:
Lloh6:
	adrp	x21, _HDMI_PICTURE_ASPECT_NONE@GOTPAGE
Lloh7:
	ldr	x21, [x21, _HDMI_PICTURE_ASPECT_NONE@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh8:
	adrp	x9, _HDMI_CONTENT_TYPE_GRAPHICS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _HDMI_CONTENT_TYPE_GRAPHICS@GOTPAGEOFF]
	str	w8, [x19, #8]
Lloh10:
	ldr	w9, [x9]
	str	w9, [x19, #32]
	str	xzr, [x19, #24]
	ldr	w20, [x20, #4]
	cmp	w20, w8
	b.ne	LBB0_13
; %bb.12:
	ldr	w0, [x19, #4]
	bl	_drm_get_cea_aspect_ratio
	mov	x20, x0
LBB0_13:
Lloh11:
	adrp	x8, _HDMI_PICTURE_ASPECT_16_9@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HDMI_PICTURE_ASPECT_16_9@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ls	LBB0_16
; %bb.14:
	ldr	w0, [x19, #4]
	bl	_drm_get_cea_aspect_ratio
	cmp	w20, w0
	b.ne	LBB0_17
; %bb.15:
	ldr	w20, [x21]
LBB0_16:
	mov	w0, #0
Lloh14:
	adrp	x8, _HDMI_ACTIVE_ASPECT_PICTURE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _HDMI_ACTIVE_ASPECT_PICTURE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x19, #16]
Lloh17:
	adrp	x8, _HDMI_SCAN_MODE_UNDERSCAN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _HDMI_SCAN_MODE_UNDERSCAN@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	stp	w20, w8, [x19, #8]
	b	LBB0_18
LBB0_17:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_18:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DRM_MODE_FLAG_DBLCLK,4,2       ; @DRM_MODE_FLAG_DBLCLK
	.comm	_DRM_MODE_FLAG_3D_MASK,4,2      ; @DRM_MODE_FLAG_3D_MASK
	.comm	_HDMI_PICTURE_ASPECT_NONE,4,2   ; @HDMI_PICTURE_ASPECT_NONE
	.comm	_HDMI_CONTENT_TYPE_GRAPHICS,4,2 ; @HDMI_CONTENT_TYPE_GRAPHICS
	.comm	_HDMI_PICTURE_ASPECT_16_9,4,2   ; @HDMI_PICTURE_ASPECT_16_9
	.comm	_HDMI_ACTIVE_ASPECT_PICTURE,4,2 ; @HDMI_ACTIVE_ASPECT_PICTURE
	.comm	_HDMI_SCAN_MODE_UNDERSCAN,4,2   ; @HDMI_SCAN_MODE_UNDERSCAN
.subsections_via_symbols
