	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_via_parse_command_stream       ## -- Begin function via_parse_command_stream
	.p2align	4, 0x90
_via_parse_command_stream:              ## @via_parse_command_stream
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -56(%rbp)
	movq	(%rdi), %r15
	movl	$0, -44(%rbp)
	xorl	%r14d, %r14d
	cmpl	$4, %edx
	jb	LBB0_17
## %bb.1:
	movl	%edx, %ebx
	andl	$-4, %ebx
	addq	%rsi, %rbx
	movl	$133, %eax
	leaq	LJTI0_0(%rip), %r13
	leaq	-56(%rbp), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	leaq	-44(%rbp), %rcx
	callq	_via_parse_header2
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
                                        ## kill: def $eax killed $eax def $rax
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rsi
	cmpq	%rbx, %rsi
	jae	LBB0_15
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	addl	$-128, %eax
	cmpl	$5, %eax
	ja	LBB0_16
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	(%r13,%rax,4), %rax
	addq	%r13, %rax
	jmpq	*%rax
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_via_parse_vheader6
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_via_parse_vheader5
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_via_parse_header1
	jmp	LBB0_13
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rsi), %esi
	movl	$130, %eax
	movq	_HALCYON_HEADER2@GOTPCREL(%rip), %rcx
	cmpl	%esi, (%rcx)
	je	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_HALCYON_HEADER1MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	%esi, %ecx
	movl	$131, %eax
	movq	_HALCYON_HEADER1@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_VIA_VIDEOMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	%esi, %ecx
	movl	$129, %eax
	movq	_VIA_VIDEO_HEADER5@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	$128, %eax
	movq	_VIA_VIDEO_HEADER6@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movl	$132, %eax
	jmp	LBB0_14
LBB0_15:
	cmpl	$132, %eax
	jne	LBB0_17
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_17:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
LJTI0_0:
	.long	L0_0_set_6
	.long	L0_0_set_5
	.long	L0_0_set_12
	.long	L0_0_set_4
	.long	L0_0_set_16
	.long	L0_0_set_7
	.end_data_region
                                        ## -- End function
	.comm	_HALCYON_HEADER2,4,2            ## @HALCYON_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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid / Unimplemented DMA HEADER command. 0x%x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_via_parse_command_stream       ; -- Begin function via_parse_command_stream
	.p2align	2
_via_parse_command_stream:              ; @via_parse_command_stream
	.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	x8, x0
	mov	w0, #0
	str	x1, [sp, #8]
	ldr	x19, [x8]
	str	wzr, [sp, #4]
	cmp	w2, #4
	b.lo	LBB0_21
; %bb.1:
	and	w8, w2, #0xfffffffc
	add	x20, x1, x8
	mov	w0, #133
Lloh0:
	adrp	x22, lJTI0_0@PAGE
Lloh1:
	add	x22, x22, lJTI0_0@PAGEOFF
Lloh2:
	adrp	x23, _HALCYON_HEADER2@GOTPAGE
Lloh3:
	ldr	x23, [x23, _HALCYON_HEADER2@GOTPAGEOFF]
Lloh4:
	adrp	x24, _HALCYON_HEADER1MASK@GOTPAGE
Lloh5:
	ldr	x24, [x24, _HALCYON_HEADER1MASK@GOTPAGEOFF]
Lloh6:
	adrp	x25, _HALCYON_HEADER1@GOTPAGE
Lloh7:
	ldr	x25, [x25, _HALCYON_HEADER1@GOTPAGEOFF]
Lloh8:
	adrp	x26, _VIA_VIDEOMASK@GOTPAGE
Lloh9:
	ldr	x26, [x26, _VIA_VIDEOMASK@GOTPAGEOFF]
Lloh10:
	adrp	x27, _VIA_VIDEO_HEADER5@GOTPAGE
Lloh11:
	ldr	x27, [x27, _VIA_VIDEO_HEADER5@GOTPAGEOFF]
Lloh12:
	adrp	x28, _VIA_VIDEO_HEADER6@GOTPAGE
Lloh13:
	ldr	x28, [x28, _VIA_VIDEO_HEADER6@GOTPAGEOFF]
Lloh14:
	adrp	x21, l_.str@PAGE
Lloh15:
	add	x21, x21, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x1, sp, #8
	add	x3, sp, #4
	mov	x0, x19
	mov	x2, x20
	bl	_via_parse_header2
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x1, [sp, #8]
	cmp	x1, x20
	b.hs	LBB0_18
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w0, #128
	cmp	w8, #5
	b.hi	LBB0_19
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	adr	x9, LBB0_2
	ldrb	w10, [x22, x8]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, x20
	bl	_via_parse_vheader6
	b	LBB0_3
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, x20
	bl	_via_parse_vheader5
	b	LBB0_3
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, x20
	bl	_via_parse_header1
	b	LBB0_3
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x23]
	ldr	w1, [x1]
	cmp	w8, w1
	b.ne	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #130
	b	LBB0_3
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x24]
	and	w8, w8, w1
	ldr	w9, [x25]
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #131
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x26]
	and	w8, w8, w1
	ldr	w9, [x27]
	cmp	w8, w9
	b.ne	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #129
	b	LBB0_3
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x28]
	cmp	w8, w9
	b.ne	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #128
	b	LBB0_3
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_DRM_ERROR
	mov	w0, #132
	b	LBB0_3
LBB0_18:
	cmp	w0, #132
	b.ne	LBB0_20
LBB0_19:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_21
LBB0_20:
	mov	w0, #0
LBB0_21:
	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 AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_19-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
                                        ; -- End function
	.comm	_HALCYON_HEADER2,4,2            ; @HALCYON_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
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid / Unimplemented DMA HEADER command. 0x%x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
