	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_parse_header2
_via_parse_header2:                     ## @via_parse_header2
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %r14
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rax
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movslq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %r15
	movl	4(%r14), %ebx
	movq	_HC_REG_TRANS_SET@GOTPCREL(%rip), %rax
	movq	_HC_REG_BASE@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	(%rax), %rdi
	addq	$8, %r14
	movl	%ebx, %esi
	callq	_VIA_WRITE
	andl	$-65536, %ebx                   ## imm = 0xFFFF0000
	cmpl	$8388608, %ebx                  ## imm = 0x800000
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_14
## %bb.1:
	cmpq	%r13, %r14
	jae	LBB0_24
## %bb.2:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%rcx), %ecx
	xorl	%ebx, %ebx
	movq	_HC_REG_TRANS_SPACE@GOTPCREL(%rip), %r13
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%rdi, %r14
	jae	LBB0_24
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	cmpl	%ecx, %eax
	jge	LBB0_24
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r14), %esi
	movq	_HC_ACMD_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%esi, %eax
	movq	_HC_ACMD_HCmdB@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_24
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%r15, %r14
	jbe	LBB0_11
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	cmpq	%rdi, %r14
	jae	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_HALCYON_FIREMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r14), %eax
	xorl	%ecx, %ecx
	movq	_HALCYON_FIRECMD@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	sete	%cl
	leaq	(%r14,%rcx,4), %r14
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movslq	(%rcx), %rdx
	leal	1(%rdx), %eax
	movl	%eax, (%rcx)
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%rcx), %ecx
	cmpl	%ecx, %eax
	jge	LBB0_3
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	(%rsi), %rsi
	movq	8(%rsi,%rdx,8), %r15
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %edi
	andl	$63, %edi
	addq	(%r13), %rdi
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addq	(%r12), %rdi
	addq	$4, %r14
	callq	_VIA_WRITE
	addl	$4, %ebx
	cmpq	%r15, %r14
	ja	LBB0_7
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=2
	movl	%ebx, %edi
	andl	$63, %edi
	addq	(%r13), %rdi
	movl	(%r14), %esi
	jmp	LBB0_12
LBB0_14:
	cmpq	%r13, %r14
	jae	LBB0_24
## %bb.15:
	xorl	%ebx, %ebx
	movq	_HC_HEADER2@GOTPCREL(%rip), %r15
	movq	%r14, %r13
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%rbx), %esi
	cmpl	(%r15), %esi
	je	LBB0_23
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_HALCYON_HEADER1MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%esi, %eax
	movq	_HALCYON_HEADER1@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_23
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_VIA_VIDEOMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%esi, %eax
	movq	_VIA_VIDEO_HEADER5@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_VIA_VIDEO_HEADER6@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	%ebx, %edi
	andl	$60, %edi
	movq	_HC_REG_TRANS_SPACE@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	addq	(%r12), %rdi
	addq	$4, %r13
	callq	_VIA_WRITE
	leaq	(%r14,%rbx), %rax
	addq	$4, %rax
	addq	$4, %rbx
	cmpq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	jb	LBB0_16
LBB0_21:
	addq	%rbx, %r14
	jmp	LBB0_24
LBB0_23:
	movq	%r13, %r14
LBB0_24:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax)
	movq	_state_command@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HC_REG_TRANS_SET,8,3           ## @HC_REG_TRANS_SET
	.comm	_HC_REG_BASE,8,3                ## @HC_REG_BASE
	.comm	_HC_ACMD_MASK,4,2               ## @HC_ACMD_MASK
	.comm	_HC_ACMD_HCmdB,4,2              ## @HC_ACMD_HCmdB
	.comm	_HC_REG_TRANS_SPACE,8,3         ## @HC_REG_TRANS_SPACE
	.comm	_HALCYON_FIREMASK,4,2           ## @HALCYON_FIREMASK
	.comm	_HALCYON_FIRECMD,4,2            ## @HALCYON_FIRECMD
	.comm	_HC_HEADER2,4,2                 ## @HC_HEADER2
	.comm	_HALCYON_HEADER1MASK,4,2        ## @HALCYON_HEADER1MASK
	.comm	_HALCYON_HEADER1,4,2            ## @HALCYON_HEADER1
	.comm	_VIA_VIDEOMASK,4,2              ## @VIA_VIDEOMASK
	.comm	_VIA_VIDEO_HEADER5,4,2          ## @VIA_VIDEO_HEADER5
	.comm	_VIA_VIDEO_HEADER6,4,2          ## @VIA_VIDEO_HEADER6
	.comm	_state_command,4,2              ## @state_command
	.no_dead_strip	_via_parse_header2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_parse_header2
_via_parse_header2:                     ; @via_parse_header2
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x3
	mov	x20, x2
	mov	x19, x1
	mov	x22, x0
	ldr	x8, [x1]
	ldr	x9, [x0]
	ldrsw	x10, [x3]
	ldr	x26, [x9, x10, lsl #3]
	ldr	w23, [x8, #4]
Lloh0:
	adrp	x9, _HC_REG_TRANS_SET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HC_REG_TRANS_SET@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x25, _HC_REG_BASE@GOTPAGE
Lloh4:
	ldr	x25, [x25, _HC_REG_BASE@GOTPAGEOFF]
	ldr	x10, [x25]
	add	x0, x10, x9
	add	x24, x8, #8
	mov	x1, x23
	bl	_VIA_WRITE
	and	w8, w23, #0xffff0000
	cmp	w8, #2048, lsl #12              ; =8388608
	b.ne	LBB0_14
; %bb.1:
	cmp	x24, x20
	b.hs	LBB0_24
; %bb.2:
	mov	w23, #0
	ldr	w8, [x21]
	ldr	w9, [x22, #8]
Lloh5:
	adrp	x28, _HC_ACMD_HCmdB@GOTPAGE
Lloh6:
	ldr	x28, [x28, _HC_ACMD_HCmdB@GOTPAGEOFF]
Lloh7:
	adrp	x27, _HC_REG_TRANS_SPACE@GOTPAGE
Lloh8:
	ldr	x27, [x27, _HC_REG_TRANS_SPACE@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	x24, x20
	b.hs	LBB0_24
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	cmp	w8, w9
	b.ge	LBB0_24
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x24]
Lloh9:
	adrp	x8, _HC_ACMD_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HC_ACMD_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w8, w8, w1
	ldr	w9, [x28]
	cmp	w8, w9
	b.ne	LBB0_24
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x24, x26
	b.ls	LBB0_11
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	x24, x20
	b.hs	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x24]
Lloh12:
	adrp	x9, _HALCYON_FIREMASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _HALCYON_FIREMASK@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh15:
	adrp	x9, _HALCYON_FIRECMD@GOTPAGE
Lloh16:
	ldr	x9, [x9, _HALCYON_FIRECMD@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w8, eq
	add	x24, x24, w8, uxtw #2
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldrsw	x8, [x21]
	add	x8, x8, #1
	str	w8, [x21]
	ldr	w9, [x22, #8]
	cmp	w8, w9
	b.ge	LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x10, [x22]
	ldr	x26, [x10, x8, lsl #3]
	b	LBB0_3
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x27]
	ldr	x9, [x25]
	and	w10, w23, #0x3f
	add	x8, x8, x10
	add	x0, x8, x9
	add	x24, x24, #4
LBB0_12:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	bl	_VIA_WRITE
	add	w23, w23, #4
	cmp	x24, x26
	b.hi	LBB0_7
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	ldr	w1, [x24], #4
	ldr	x8, [x27]
	ldr	x9, [x25]
	and	w10, w23, #0x3f
	add	x8, x8, x10
	add	x0, x8, x9
	b	LBB0_12
LBB0_14:
	cmp	x24, x20
	b.hs	LBB0_24
; %bb.15:
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	mov	x21, #0
Lloh18:
	adrp	x22, _HC_HEADER2@GOTPAGE
Lloh19:
	ldr	x22, [x22, _HC_HEADER2@GOTPAGEOFF]
Lloh20:
	adrp	x26, _HALCYON_HEADER1@GOTPAGE
Lloh21:
	ldr	x26, [x26, _HALCYON_HEADER1@GOTPAGEOFF]
Lloh22:
	adrp	x28, _VIA_VIDEO_HEADER5@GOTPAGE
Lloh23:
	ldr	x28, [x28, _VIA_VIDEO_HEADER5@GOTPAGEOFF]
Lloh24:
	adrp	x19, _VIA_VIDEO_HEADER6@GOTPAGE
Lloh25:
	ldr	x19, [x19, _VIA_VIDEO_HEADER6@GOTPAGEOFF]
	mov	x27, x24
Lloh26:
	adrp	x23, _HC_REG_TRANS_SPACE@GOTPAGE
Lloh27:
	ldr	x23, [x23, _HC_REG_TRANS_SPACE@GOTPAGEOFF]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24, x21]
	ldr	w8, [x22]
	cmp	w1, w8
	b.eq	LBB0_21
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
Lloh28:
	adrp	x8, _HALCYON_HEADER1MASK@GOTPAGE
Lloh29:
	ldr	x8, [x8, _HALCYON_HEADER1MASK@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	and	w8, w8, w1
	ldr	w9, [x26]
	cmp	w8, w9
	b.eq	LBB0_21
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
Lloh31:
	adrp	x8, _VIA_VIDEOMASK@GOTPAGE
Lloh32:
	ldr	x8, [x8, _VIA_VIDEOMASK@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	and	w8, w8, w1
	ldr	w9, [x28]
	ldr	w10, [x19]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.eq	LBB0_22
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x23]
	ldr	x9, [x25]
	and	w10, w21, #0x3c
	add	x8, x8, x10
	add	x0, x8, x9
	add	x27, x27, #4
	bl	_VIA_WRITE
	add	x21, x21, #4
	add	x8, x24, x21
	cmp	x8, x20
	b.lo	LBB0_16
; %bb.20:
	mov	x24, x8
	b	LBB0_23
LBB0_21:
	mov	x24, x27
	b	LBB0_23
LBB0_22:
	add	x24, x24, x21
LBB0_23:
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
LBB0_24:
	str	x24, [x19]
Lloh34:
	adrp	x8, _state_command@GOTPAGE
Lloh35:
	ldr	x8, [x8, _state_command@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_HC_REG_TRANS_SET,8,3           ; @HC_REG_TRANS_SET
	.comm	_HC_REG_BASE,8,3                ; @HC_REG_BASE
	.comm	_HC_ACMD_MASK,4,2               ; @HC_ACMD_MASK
	.comm	_HC_ACMD_HCmdB,4,2              ; @HC_ACMD_HCmdB
	.comm	_HC_REG_TRANS_SPACE,8,3         ; @HC_REG_TRANS_SPACE
	.comm	_HALCYON_FIREMASK,4,2           ; @HALCYON_FIREMASK
	.comm	_HALCYON_FIRECMD,4,2            ; @HALCYON_FIRECMD
	.comm	_HC_HEADER2,4,2                 ; @HC_HEADER2
	.comm	_HALCYON_HEADER1MASK,4,2        ; @HALCYON_HEADER1MASK
	.comm	_HALCYON_HEADER1,4,2            ; @HALCYON_HEADER1
	.comm	_VIA_VIDEOMASK,4,2              ; @VIA_VIDEOMASK
	.comm	_VIA_VIDEO_HEADER5,4,2          ; @VIA_VIDEO_HEADER5
	.comm	_VIA_VIDEO_HEADER6,4,2          ; @VIA_VIDEO_HEADER6
	.comm	_state_command,4,2              ; @state_command
	.no_dead_strip	_via_parse_header2
.subsections_via_symbols
