	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_check_header1
_via_check_header1:                     ## @via_check_header1
	.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	%rdi, %r14
	movq	(%rdi), %rbx
	movq	_state_command@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rsi, %rbx
	jae	LBB0_11
## %bb.1:
	movq	_HALCYON_HEADER1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	%r8d, %edx
	orl	$255, %edx
	movl	%r8d, %r9d
	orl	$768, %r9d                      ## imm = 0x300
	movl	%r8d, %ecx
	orl	$831, %ecx                      ## imm = 0x33F
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edi
	cmpl	%edx, %edi
	jle	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%r9d, %edi
	jl	LBB0_4
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%ecx, %edi
	jg	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	addq	$8, %rbx
	cmpq	%rsi, %rbx
	jb	LBB0_2
	jmp	LBB0_11
LBB0_4:
	movq	_HALCYON_HEADER1MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edi
	cmpl	%r8d, %edi
	jne	LBB0_11
## %bb.5:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_6
LBB0_8:
	movq	_HALCYON_HEADER1MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edi
	cmpl	%r8d, %edi
	jne	LBB0_11
## %bb.9:
	leaq	L_.str.1(%rip), %rdi
LBB0_6:
	callq	_DRM_ERROR
	movq	_state_error@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_11:
	movq	%rbx, (%r14)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_state_command,4,2              ## @state_command
	.comm	_HALCYON_HEADER1,4,2            ## @HALCYON_HEADER1
	.comm	_HALCYON_HEADER1MASK,4,2        ## @HALCYON_HEADER1MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid HALCYON_HEADER1 command. Attempt to access 3D- or command burst area.\n"

	.comm	_state_error,4,2                ## @state_error
L_.str.1:                               ## @.str.1
	.asciz	"Invalid HALCYON_HEADER1 command. Attempt to access VGA registers.\n"

	.no_dead_strip	_via_check_header1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_check_header1
_via_check_header1:                     ; @via_check_header1
	.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, x0
	ldr	x20, [x0]
Lloh0:
	adrp	x8, _state_command@GOTPAGE
Lloh1:
	ldr	x8, [x8, _state_command@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	cmp	x20, x1
	b.hs	LBB0_10
; %bb.1:
Lloh3:
	adrp	x8, _HALCYON_HEADER1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HALCYON_HEADER1@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	orr	w9, w8, #0xff
	orr	w10, w8, #0x300
	mov	w11, #831
	orr	w11, w8, w11
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x20]
	cmp	w12, w9
	ccmp	w12, w10, #0, gt
	b.lt	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w12, w11
	b.gt	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x20, x20, #8
	cmp	x20, x1
	b.lo	LBB0_2
	b	LBB0_10
LBB0_5:
Lloh6:
	adrp	x9, _HALCYON_HEADER1MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _HALCYON_HEADER1MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w9, w9, w12
	cmp	w9, w8
	b.ne	LBB0_10
; %bb.6:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
LBB0_7:
Lloh11:
	adrp	x9, _HALCYON_HEADER1MASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _HALCYON_HEADER1MASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	and	w9, w9, w12
	cmp	w9, w8
	b.ne	LBB0_10
; %bb.8:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_9:
	bl	_DRM_ERROR
Lloh16:
	adrp	x8, _state_error@GOTPAGE
Lloh17:
	ldr	x8, [x8, _state_error@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
LBB0_10:
	str	x20, [x19]
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_state_command,4,2              ; @state_command
	.comm	_HALCYON_HEADER1,4,2            ; @HALCYON_HEADER1
	.comm	_HALCYON_HEADER1MASK,4,2        ; @HALCYON_HEADER1MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid HALCYON_HEADER1 command. Attempt to access 3D- or command burst area.\n"

	.comm	_state_error,4,2                ; @state_error
l_.str.1:                               ; @.str.1
	.asciz	"Invalid HALCYON_HEADER1 command. Attempt to access VGA registers.\n"

	.no_dead_strip	_via_check_header1
.subsections_via_symbols
