	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scratch_get_header
_scratch_get_header:                    ## @scratch_get_header
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	_DBG_SCRATCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rdx
	leaq	L_.str(%rip), %rsi
	callq	_PDEBUG
	movq	(%rbx), %rax
	xorl	%ecx, %ecx
	cmpq	%rax, 8(%rbx)
	je	LBB0_11
## %bb.1:
	movq	_USBVISION_NUM_HEADERMARKER@GOTPCREL(%rip), %r15
	movq	_USBVISION_HEADER_LENGTH@GOTPCREL(%rip), %r12
	movq	_USBVISION_MAGIC_1@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx), %rax
	cmpq	%rax, 8(%rbx)
	je	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %rcx
	movl	(%rcx,%rax,4), %ecx
	movl	%ecx, 24(%rbx)
	incq	%rax
	movslq	(%r15), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rdx, (%rbx)
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_scratch_get
	movq	(%r14), %rax
	cmpq	(%r13), %rax
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rax
	movq	_USBVISION_MAGIC_2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	16(%r14), %ecx
	cmpl	(%r12), %ecx
	jne	LBB0_9
## %bb.8:
	movl	20(%r14), %eax
	movl	24(%r14), %edx
	shll	$8, %eax
	cltq
	addq	48(%r14), %rax
	movq	%rax, 56(%r14)
	shll	$8, %edx
	movslq	%edx, %rax
	addq	32(%r14), %rax
	movq	%rax, 40(%r14)
	jmp	LBB0_11
LBB0_10:
	xorl	%ecx, %ecx
LBB0_11:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DBG_SCRATCH,4,2                ## @DBG_SCRATCH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"from read_ptr=%d"

	.comm	_USBVISION_NUM_HEADERMARKER,4,2 ## @USBVISION_NUM_HEADERMARKER
	.comm	_USBVISION_HEADER_LENGTH,4,2    ## @USBVISION_HEADER_LENGTH
	.comm	_USBVISION_MAGIC_1,8,3          ## @USBVISION_MAGIC_1
	.comm	_USBVISION_MAGIC_2,8,3          ## @USBVISION_MAGIC_2
	.no_dead_strip	_scratch_get_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scratch_get_header
_scratch_get_header:                    ; @scratch_get_header
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _DBG_SCRATCH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DBG_SCRATCH@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	x2, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PDEBUG
	ldp	x8, x9, [x20]
	cmp	x9, x8
	b.ne	LBB0_3
LBB0_1:
	mov	w0, #0
LBB0_2:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
Lloh5:
	adrp	x21, _USBVISION_NUM_HEADERMARKER@GOTPAGE
Lloh6:
	ldr	x21, [x21, _USBVISION_NUM_HEADERMARKER@GOTPAGEOFF]
Lloh7:
	adrp	x22, _USBVISION_HEADER_LENGTH@GOTPAGE
Lloh8:
	ldr	x22, [x22, _USBVISION_HEADER_LENGTH@GOTPAGEOFF]
Lloh9:
	adrp	x23, _USBVISION_MAGIC_1@GOTPAGE
Lloh10:
	ldr	x23, [x23, _USBVISION_MAGIC_1@GOTPAGEOFF]
Lloh11:
	adrp	x24, _USBVISION_MAGIC_2@GOTPAGE
Lloh12:
	ldr	x24, [x24, _USBVISION_MAGIC_2@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldp	x8, x9, [x20]
	cmp	x9, x8
	b.eq	LBB0_1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x20, #16]
	ldr	w9, [x9, x8, lsl #2]
	str	w9, [x20, #24]
	add	x8, x8, #1
	ldrsw	x9, [x21]
	udiv	x10, x8, x9
	msub	x8, x10, x9, x8
	str	x8, [x20]
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_scratch_get
	ldr	x8, [x19]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19, #16]
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.8:
	ldr	x8, [x19, #48]
	ldp	w9, w10, [x19, #20]
	lsl	w9, w9, #8
	add	x8, x8, w9, sxtw
	str	x8, [x19, #56]
	ldr	x8, [x19, #32]
	lsl	w9, w10, #8
	add	x8, x8, w9, sxtw
	str	x8, [x19, #40]
	b	LBB0_2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_DBG_SCRATCH,4,2                ; @DBG_SCRATCH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"from read_ptr=%d"

	.comm	_USBVISION_NUM_HEADERMARKER,4,2 ; @USBVISION_NUM_HEADERMARKER
	.comm	_USBVISION_HEADER_LENGTH,4,2    ; @USBVISION_HEADER_LENGTH
	.comm	_USBVISION_MAGIC_1,8,3          ; @USBVISION_MAGIC_1
	.comm	_USBVISION_MAGIC_2,8,3          ; @USBVISION_MAGIC_2
	.no_dead_strip	_scratch_get_header
.subsections_via_symbols
