	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_check_vheader5
_via_check_vheader5:                    ## @via_check_vheader5
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	movq	%rsi, %rax
	subq	%rbx, %rax
	cmpq	$15, %rax
	jg	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	_state_error@GOTPCREL(%rip), %r12
	jmp	LBB0_10
LBB0_2:
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	_VIA_VIDEOMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	notl	%edi
	andl	(%rbx), %edi
	callq	_verify_mmio_address
	movq	_state_error@GOTPCREL(%rip), %r12
	testq	%rax, %rax
	jne	LBB0_10
## %bb.3:
	cmpl	$16056320, 8(%rbx)              ## imm = 0xF50000
	jne	LBB0_4
## %bb.5:
	movl	4(%rbx), %r15d
	leaq	16(%rbx), %rax
	movq	%rax, -48(%rbp)
	cmpl	$0, 12(%rbx)
	je	LBB0_6
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
LBB0_10:
	movl	(%r12), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	-48(%rbp), %rdi
	movq	%r13, %rsi
	movl	%r15d, %edx
	callq	_eat_words
	testq	%rax, %rax
	jne	LBB0_10
## %bb.7:
	andl	$3, %r15d
	je	LBB0_9
## %bb.8:
	movl	$4, %edx
	subl	%r15d, %edx
	leaq	-48(%rbp), %rdi
	movq	%r13, %rsi
	callq	_verify_video_tail
	testq	%rax, %rax
	jne	LBB0_10
LBB0_9:
	movq	-48(%rbp), %rax
	movq	%rax, (%r14)
	movq	_state_command@GOTPCREL(%rip), %r12
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Illegal termination of video header5 command\n"

	.comm	_state_error,4,2                ## @state_error
	.comm	_VIA_VIDEOMASK,4,2              ## @VIA_VIDEOMASK
L_.str.1:                               ## @.str.1
	.asciz	"Illegal header5 header data\n"

	.comm	_state_command,4,2              ## @state_command
	.no_dead_strip	_via_check_vheader5
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_check_vheader5
_via_check_vheader5:                    ; @via_check_vheader5
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x22, [x0]
	sub	x8, x1, x22
	cmp	x8, #15
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_6
LBB0_2:
	mov	x20, x1
	mov	x19, x0
	ldr	w8, [x22]
Lloh2:
	adrp	x9, _VIA_VIDEOMASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _VIA_VIDEOMASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	bic	w0, w8, w9
	bl	_verify_mmio_address
	cbnz	x0, LBB0_7
; %bb.3:
	ldr	w8, [x22, #8]
	cmp	w8, #3920, lsl #12              ; =16056320
	b.ne	LBB0_5
; %bb.4:
	ldr	w21, [x22, #4]
	add	x8, x22, #16
	str	x8, [sp, #8]
	ldr	w8, [x22, #12]
	cbz	w8, LBB0_9
LBB0_5:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_6:
	bl	_DRM_ERROR
LBB0_7:
Lloh7:
	adrp	x8, _state_error@GOTPAGE
Lloh8:
	ldr	x8, [x8, _state_error@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_9:
	add	x0, sp, #8
	mov	x1, x20
	mov	x2, x21
	bl	_eat_words
	cbnz	x0, LBB0_7
; %bb.10:
	ands	w8, w21, #0x3
	b.eq	LBB0_12
; %bb.11:
	mov	w9, #4
	sub	w2, w9, w8
	add	x0, sp, #8
	mov	x1, x20
	bl	_verify_video_tail
	cbnz	x0, LBB0_7
LBB0_12:
	ldr	x8, [sp, #8]
	str	x8, [x19]
Lloh9:
	adrp	x8, _state_command@GOTPAGE
Lloh10:
	ldr	x8, [x8, _state_command@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Illegal termination of video header5 command\n"

	.comm	_state_error,4,2                ; @state_error
	.comm	_VIA_VIDEOMASK,4,2              ; @VIA_VIDEOMASK
l_.str.1:                               ; @.str.1
	.asciz	"Illegal header5 header data\n"

	.comm	_state_command,4,2              ; @state_command
	.no_dead_strip	_via_check_vheader5
.subsections_via_symbols
