	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hdcd_scan
_hdcd_scan:                             ## @hdcd_scan
	.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
                                        ## kill: def $r9d killed $r9d def $r9
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movl	%r8d, %r13d
	movq	%rcx, %r12
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_HDCD_MAX_CHANNELS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r14, %rax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rdi
	leal	(,%r14,4), %edx
	xorl	%r15d, %r15d
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	xorl	%esi, %esi
	callq	_memset
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, %r14d
	cmovlel	%eax, %r14d
	movl	%eax, %edi
	testl	%eax, %eax
	jle	LBB0_7
## %bb.1:
	xorl	%eax, %eax
	movq	%rbx, %rcx
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	subl	%r13d, %edx
	movl	%edx, (%rcx)
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rax
	addq	$24, %rcx
	cmpq	%rax, %rdi
	je	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx), %edx
	testl	%edx, %edx
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, (%rsi,%rax,4)
	cmpl	%r13d, %edx
	ja	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	$0, 16(%rcx)
	movl	%edx, %r13d
	jmp	LBB0_5
LBB0_7:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	testl	%r13d, %r13d
	jle	LBB0_17
## %bb.8:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %r9d
	subl	%r15d, %r9d
	subq	$8, %rsp
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	leaq	-68(%rbp), %rcx
	movq	%r12, %r8
	pushq	%r14
	callq	_hdcd_integrate
	addq	$16, %rsp
	addl	%eax, %r15d
	movl	-68(%rbp), %ecx
	testl	%ecx, %ecx
	jne	LBB0_10
## %bb.16:                              ##   in Loop: Header=BB0_9 Depth=1
	imull	%r14d, %eax
	cltq
	leaq	(%r12,%rax,4), %r12
	cmpl	%r15d, %r13d
	jg	LBB0_9
	jmp	LBB0_17
LBB0_10:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	jle	LBB0_17
## %bb.11:
	leaq	8(%rbx), %rax
	xorl	%edx, %edx
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%rdx
	addq	$24, %rax
	cmpq	%rdx, %r8
	je	LBB0_17
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	btl	%edx, %ecx
	jae	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	-4(%rax), %esi
	movl	(%rax), %edi
	movl	%esi, -8(%rax)
	cmpl	$-1, %edi
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	$0, (%rax)
	jmp	LBB0_15
LBB0_17:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	jle	LBB0_23
## %bb.18:
	addq	$8, %rbx
	xorl	%eax, %eax
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_19 Depth=1
	incq	%rax
	addq	$24, %rbx
	cmpq	%rax, %rdx
	je	LBB0_23
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%rcx,%rax,4)
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	cmpl	$0, -8(%rbx)
	jne	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	incl	(%rbx)
	jmp	LBB0_22
LBB0_23:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_25
## %bb.24:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HDCD_MAX_CHANNELS,4,2          ## @HDCD_MAX_CHANNELS
	.no_dead_strip	_hdcd_scan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hdcd_scan
_hdcd_scan:                             ; @hdcd_scan
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	sp, sp, #16
	mov	x25, x5
	mov	x24, x4
	mov	x22, x3
	mov	x21, x2
	mov	x20, x1
	mov	x23, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _HDCD_MAX_CHANNELS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HDCD_MAX_CHANNELS@GOTPAGEOFF]
Lloh5:
	ldr	w12, [x8]
	lsl	x8, x12, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x19, x9, x8
	mov	sp, x19
	lsl	w2, w12, #2
	mov	x0, x19
	mov	w1, #0
	bl	_memset
	cmp	w25, w21
	csel	w26, w25, w21, gt
	mov	w27, w21
	cmp	w21, #1
	b.lt	LBB0_7
; %bb.1:
	mov	w8, #1
	mov	x9, x27
	mov	x10, x20
	mov	x11, x19
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	sub	w12, w12, w24
	str	w12, [x10]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x11, x11, #4
	add	x10, x10, #24
	subs	x9, x9, #1
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x10]
	cbz	w12, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w8, [x11]
	cmp	w12, w24
	b.hi	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	str	xzr, [x10, #16]
	mov	x24, x12
	b	LBB0_2
LBB0_7:
	cmp	w24, #1
	b.lt	LBB0_11
; %bb.8:
	mov	w25, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	sub	w5, w24, w25
	sub	x3, x29, #92
	mov	x0, x23
	mov	x1, x20
	mov	x2, x21
	mov	x4, x22
	mov	x6, x26
	bl	_hdcd_integrate
	add	w25, w0, w25
	ldur	w8, [x29, #-92]
	cbnz	w8, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mul	w8, w0, w26
	add	x22, x22, w8, sxtw #2
	cmp	w24, w25
	b.gt	LBB0_9
	b	LBB0_18
LBB0_11:
	mov	w25, #0
	b	LBB0_18
LBB0_12:
	cmp	w21, #1
	b.lt	LBB0_18
; %bb.13:
	mov	x9, #0
	add	x10, x20, #8
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x9, x9, #1
	add	x10, x10, #24
	cmp	x27, x9
	b.eq	LBB0_18
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	lsr	w11, w8, w9
	tbz	w11, #0, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldur	w11, [x10, #-4]
	stur	w11, [x10, #-8]
	ldr	w11, [x10]
	cmn	w11, #1
	b.ne	LBB0_14
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	str	wzr, [x10]
	b	LBB0_14
LBB0_18:
	cmp	w21, #1
	b.lt	LBB0_24
; %bb.19:
	add	x8, x20, #8
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_21 Depth=1
	add	x19, x19, #4
	add	x8, x8, #24
	subs	x27, x27, #1
	b.eq	LBB0_24
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x19]
	cbz	w9, LBB0_20
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	ldur	w9, [x8, #-8]
	cbnz	w9, LBB0_20
; %bb.23:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	b	LBB0_20
LBB0_24:
	ldur	x8, [x29, #-88]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_26
; %bb.25:
	mov	x0, x25
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_26:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_HDCD_MAX_CHANNELS,4,2          ; @HDCD_MAX_CHANNELS
	.no_dead_strip	_hdcd_scan
.subsections_via_symbols
