	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc4_validate_bin_cl            ## -- Begin function vc4_validate_bin_cl
	.p2align	4, 0x90
_vc4_validate_bin_cl:                   ## @vc4_validate_bin_cl
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	32(%rcx), %rax
	movq	(%rax), %r14
	xorl	%r12d, %r12d
	movq	_cmd_info@GOTPCREL(%rip), %rbx
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	leaq	(,%r15,8), %rax
	addq	%r13, %rax
	movq	(%rax), %rax
	addq	%rax, %r12
	movq	_VC4_PACKET_GEM_HANDLES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	movl	$0, %ecx
	cmovneq	%rax, %rcx
	addq	%rcx, -48(%rbp)                 ## 8-byte Folded Spill
	movq	_VC4_PACKET_HALT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	_cmd_info@GOTPCREL(%rip), %rbx
	je	LBB0_15
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r14, %r12
	jge	LBB0_15
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%r12), %r15
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	movq	%r15, %rdx
	cmpq	%rax, %r15
	jae	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rbx), %r13
	leaq	(%rdx,%rdx,2), %r15
	movl	8(%r13,%r15,8), %ecx
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r13,%r15,8), %r8
	leaq	(%r8,%r12), %rax
	cmpq	%r14, %rax
	jg	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx), %r14
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r12), %rbx
	movq	_VC4_PACKET_GEM_HANDLES@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%r8, %rdx
	callq	_memcpy
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	16(%r13,%r15,8), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	incq	%r14
	incq	%rbx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%rdx, %r14
	movq	%rbx, %rdx
	callq	*%rax
	movq	%r14, %rdx
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	leaq	8(,%r15,8), %rax
	addq	%r13, %rax
	movl	(%rax), %ecx
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	jmp	LBB0_21
LBB0_15:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addq	(%rax), %rcx
	movq	%rcx, 24(%rax)
	cmpl	$0, 16(%rax)
	je	LBB0_16
## %bb.17:
	cmpl	$0, 12(%rax)
	je	LBB0_19
## %bb.18:
	xorl	%ebx, %ebx
	cmpl	$0, 8(%rax)
	jne	LBB0_22
LBB0_19:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_20
LBB0_3:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_4
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	xorl	%ebx, %ebx
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	jmp	LBB0_21
LBB0_8:
	addq	%r12, %r14
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r12, %rsi
	movq	%r14, %r9
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	jmp	LBB0_21
LBB0_16:
	leaq	L_.str.4(%rip), %rdi
LBB0_20:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_DEBUG
LBB0_21:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_22:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cmd_info,8,3                   ## @cmd_info
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"0x%08x: packet %d out of bounds\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"0x%08x: packet %d invalid\n"

L_.str.2:                               ## @.str.2
	.asciz	"0x%08x: packet %d (%s) length 0x%08x exceeds bounds (0x%08x)\n"

	.comm	_VC4_PACKET_GEM_HANDLES,8,3     ## @VC4_PACKET_GEM_HANDLES
L_.str.3:                               ## @.str.3
	.asciz	"0x%08x: packet %d (%s) failed to validate\n"

	.comm	_VC4_PACKET_HALT,8,3            ## @VC4_PACKET_HALT
L_.str.4:                               ## @.str.4
	.asciz	"Bin CL missing VC4_PACKET_START_TILE_BINNING\n"

L_.str.5:                               ## @.str.5
	.asciz	"Bin CL missing VC4_PACKET_INCREMENT_SEMAPHORE + VC4_PACKET_FLUSH\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc4_validate_bin_cl            ; -- Begin function vc4_validate_bin_cl
	.p2align	2
_vc4_validate_bin_cl:                   ; @vc4_validate_bin_cl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	stp	x1, x2, [sp, #48]               ; 16-byte Folded Spill
	mov	x24, #0
	mov	x25, #0
	str	x3, [sp, #40]                   ; 8-byte Folded Spill
	ldr	x8, [x3, #32]
Lloh0:
	adrp	x19, _cmd_info@GOTPAGE
Lloh1:
	ldr	x19, [x19, _cmd_info@GOTPAGEOFF]
	ldr	x26, [x8]
	mov	w23, #24
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x28]
	add	x24, x8, x24
Lloh2:
	adrp	x9, _VC4_PACKET_GEM_HANDLES@GOTPAGE
Lloh3:
	ldr	x9, [x9, _VC4_PACKET_GEM_HANDLES@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x27, x9
	csel	x8, xzr, x8, eq
	add	x25, x8, x25
Lloh5:
	adrp	x8, _VC4_PACKET_HALT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VC4_PACKET_HALT@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x27, x8
	mov	w23, #24
	b.eq	LBB0_11
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x24, x26
	b.ge	LBB0_11
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [sp, #56]                   ; 8-byte Folded Reload
	add	x22, x8, x24
	ldr	x27, [x22]
	ldr	x0, [x19]
	bl	_ARRAY_SIZE
	cmp	x27, x0
	b.hs	LBB0_15
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x20, [x19]
	madd	x21, x27, x23, x20
	ldr	w8, [x21, #8]!
	cbz	w8, LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	madd	x28, x27, x23, x20
	ldr	x2, [x28]
	add	x9, x2, x24
	cmp	x9, x26
	b.gt	LBB0_17
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	add	x23, x8, x25
Lloh8:
	adrp	x8, _VC4_PACKET_GEM_HANDLES@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VC4_PACKET_GEM_HANDLES@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x27, x8
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x23
	mov	x1, x22
	bl	_memcpy
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	w8, #24
	madd	x8, x27, x8, x20
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_1
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x1, x23, #1
	add	x2, x22, #1
	ldr	x0, [sp, #40]                   ; 8-byte Folded Reload
	blr	x8
	cbz	x0, LBB0_1
; %bb.10:
	ldr	w8, [x21]
	stp	x27, x8, [sp, #8]
	str	x24, [sp]
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_20
LBB0_11:
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x8, [x9]
	add	x8, x8, x25
	str	x8, [x9, #24]
	ldr	w8, [x9, #16]
	cbz	w8, LBB0_18
; %bb.12:
	ldr	w8, [x9, #12]
	cbz	w8, LBB0_19
; %bb.13:
	ldr	w8, [x9, #8]
	cbz	w8, LBB0_19
; %bb.14:
	mov	w0, #0
	b	LBB0_21
LBB0_15:
	stp	x24, x27, [sp]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_20
LBB0_16:
	stp	x24, x27, [sp]
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_20
LBB0_17:
	add	x9, x24, x26
	stp	x2, x9, [sp, #24]
	stp	x27, x8, [sp, #8]
	str	x24, [sp]
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_20
LBB0_18:
Lloh19:
	adrp	x0, l_.str.4@PAGE
Lloh20:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_20
LBB0_19:
Lloh21:
	adrp	x0, l_.str.5@PAGE
Lloh22:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_20:
	bl	_DRM_DEBUG
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_21:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_cmd_info,8,3                   ; @cmd_info
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"0x%08x: packet %d out of bounds\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"0x%08x: packet %d invalid\n"

l_.str.2:                               ; @.str.2
	.asciz	"0x%08x: packet %d (%s) length 0x%08x exceeds bounds (0x%08x)\n"

	.comm	_VC4_PACKET_GEM_HANDLES,8,3     ; @VC4_PACKET_GEM_HANDLES
l_.str.3:                               ; @.str.3
	.asciz	"0x%08x: packet %d (%s) failed to validate\n"

	.comm	_VC4_PACKET_HALT,8,3            ; @VC4_PACKET_HALT
l_.str.4:                               ; @.str.4
	.asciz	"Bin CL missing VC4_PACKET_START_TILE_BINNING\n"

l_.str.5:                               ; @.str.5
	.asciz	"Bin CL missing VC4_PACKET_INCREMENT_SEMAPHORE + VC4_PACKET_FLUSH\n"

.subsections_via_symbols
