	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hdspm_external_sample_rate
_hdspm_external_sample_rate:            ## @hdspm_external_sample_rate
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r15
	movq	_HDSPM_statusRegister2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hdspm_read
	movl	%eax, %r14d
	movq	_HDSPM_statusRegister@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_hdspm_read
	movl	%eax, %r12d
	testq	%r15, %r15
	je	LBB0_9
## %bb.1:
	movq	_HDSPM_timecodeRegister@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_hdspm_read
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_hdspm_autosync_ref
	movl	%eax, %edx
	movq	_HDSPM_AES32_AUTOSYNC_FROM_WORD@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_4
## %bb.2:
	movq	_HDSPM_AES32_wcLock@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_HDSPM_AES32_wcFreq_bit@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrl	%cl, %r12d
	andl	$15, %r12d
	movl	%r12d, %edi
	jmp	LBB0_8
LBB0_4:
	movq	_HDSPM_AES32_AUTOSYNC_FROM_AES1@GOTPCREL(%rip), %rsi
	xorl	%eax, %eax
	movl	%edx, %ecx
	subl	(%rsi), %ecx
	jl	LBB0_16
## %bb.5:
	movq	_HDSPM_AES32_AUTOSYNC_FROM_AES8@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jg	LBB0_16
## %bb.6:
	movq	_HDSPM_LockAES@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	sarl	%cl, %edx
	testl	%r14d, %edx
	je	LBB0_16
## %bb.7:
	shll	$2, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %r15d
	andl	$15, %r15d
	movl	%r15d, %edi
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HDSPM_bit2freq                 ## TAILCALL
LBB0_9:
	movq	_HDSPM_wcLock@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	testl	%r14d, (%rcx)
	je	LBB0_13
## %bb.10:
	movq	_HDSPM_SelSyncRef0@GOTPCREL(%rip), %rcx
	testl	%r12d, (%rcx)
	jne	LBB0_13
## %bb.11:
	movq	_HDSPM_wcFreqMask@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r14d, %ecx
	addl	$-128, %ecx
	cmpl	$5, %ecx
	ja	LBB0_13
## %bb.12:
	movslq	%ecx, %rax
	leaq	l_switch.table.hdspm_external_sample_rate(%rip), %rcx
	movq	_HDSPM_SelSyncRefMask@GOTPCREL(%rip), %rdx
	andl	(%rdx), %r14d
	movl	(%rcx,%rax,4), %eax
	movq	_HDSPM_SelSyncRef_WORD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r14d
	je	LBB0_16
LBB0_13:
	movq	_HDSPM_madiLock@GOTPCREL(%rip), %rcx
	testl	%r12d, (%rcx)
	je	LBB0_16
## %bb.14:
	movq	_HDSPM_madiFreqMask@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	%r12d, %ecx
	addl	$-134, %ecx
	xorl	%eax, %eax
	cmpl	$8, %ecx
	ja	LBB0_16
## %bb.15:
	movslq	%ecx, %rax
	leaq	l_switch.table.hdspm_external_sample_rate.1(%rip), %rcx
	movl	(%rcx,%rax,4), %eax
LBB0_16:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDSPM_statusRegister2,4,2      ## @HDSPM_statusRegister2
	.comm	_HDSPM_statusRegister,4,2       ## @HDSPM_statusRegister
	.comm	_HDSPM_timecodeRegister,4,2     ## @HDSPM_timecodeRegister
	.comm	_HDSPM_AES32_AUTOSYNC_FROM_WORD,4,2 ## @HDSPM_AES32_AUTOSYNC_FROM_WORD
	.comm	_HDSPM_AES32_wcLock,4,2         ## @HDSPM_AES32_wcLock
	.comm	_HDSPM_AES32_wcFreq_bit,4,2     ## @HDSPM_AES32_wcFreq_bit
	.comm	_HDSPM_AES32_AUTOSYNC_FROM_AES1,4,2 ## @HDSPM_AES32_AUTOSYNC_FROM_AES1
	.comm	_HDSPM_AES32_AUTOSYNC_FROM_AES8,4,2 ## @HDSPM_AES32_AUTOSYNC_FROM_AES8
	.comm	_HDSPM_LockAES,4,2              ## @HDSPM_LockAES
	.comm	_HDSPM_wcLock,4,2               ## @HDSPM_wcLock
	.comm	_HDSPM_SelSyncRef0,4,2          ## @HDSPM_SelSyncRef0
	.comm	_HDSPM_wcFreqMask,4,2           ## @HDSPM_wcFreqMask
	.comm	_HDSPM_SelSyncRefMask,4,2       ## @HDSPM_SelSyncRefMask
	.comm	_HDSPM_SelSyncRef_WORD,4,2      ## @HDSPM_SelSyncRef_WORD
	.comm	_HDSPM_madiLock,4,2             ## @HDSPM_madiLock
	.comm	_HDSPM_madiFreqMask,4,2         ## @HDSPM_madiFreqMask
	.no_dead_strip	_hdspm_external_sample_rate
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.hdspm_external_sample_rate
l_switch.table.hdspm_external_sample_rate:
	.long	96000                           ## 0x17700
	.long	88200                           ## 0x15888
	.long	64000                           ## 0xfa00
	.long	48000                           ## 0xbb80
	.long	44100                           ## 0xac44
	.long	32000                           ## 0x7d00

	.p2align	2                               ## @switch.table.hdspm_external_sample_rate.1
l_switch.table.hdspm_external_sample_rate.1:
	.long	96000                           ## 0x17700
	.long	88200                           ## 0x15888
	.long	64000                           ## 0xfa00
	.long	48000                           ## 0xbb80
	.long	44100                           ## 0xac44
	.long	32000                           ## 0x7d00
	.long	192000                          ## 0x2ee00
	.long	176400                          ## 0x2b110
	.long	128000                          ## 0x1f400

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hdspm_external_sample_rate
_hdspm_external_sample_rate:            ; @hdspm_external_sample_rate
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x22, x0
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _HDSPM_statusRegister2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HDSPM_statusRegister2@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_hdspm_read
	mov	x20, x0
Lloh3:
	adrp	x8, _HDSPM_statusRegister@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HDSPM_statusRegister@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_hdspm_read
	mov	x19, x0
	cbz	x21, LBB0_8
; %bb.1:
Lloh6:
	adrp	x8, _HDSPM_timecodeRegister@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HDSPM_timecodeRegister@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_hdspm_read
	mov	x21, x0
	mov	x0, x22
	bl	_hdspm_autosync_ref
Lloh9:
	adrp	x8, _HDSPM_AES32_AUTOSYNC_FROM_WORD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HDSPM_AES32_AUTOSYNC_FROM_WORD@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.2:
Lloh12:
	adrp	x8, _HDSPM_AES32_wcLock@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HDSPM_AES32_wcLock@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_4
; %bb.3:
Lloh15:
	adrp	x8, _HDSPM_AES32_wcFreq_bit@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HDSPM_AES32_wcFreq_bit@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	lsr	w8, w19, w8
	b	LBB0_7
LBB0_4:
Lloh18:
	adrp	x8, _HDSPM_AES32_AUTOSYNC_FROM_AES1@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HDSPM_AES32_AUTOSYNC_FROM_AES1@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _HDSPM_AES32_AUTOSYNC_FROM_AES8@GOTPAGE
Lloh22:
	ldr	x9, [x9, _HDSPM_AES32_AUTOSYNC_FROM_AES8@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	subs	w8, w0, w8
	ccmp	w0, w9, #0, ge
	b.gt	LBB0_16
; %bb.5:
Lloh24:
	adrp	x9, _HDSPM_LockAES@GOTPAGE
Lloh25:
	ldr	x9, [x9, _HDSPM_LockAES@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	asr	w9, w9, w8
	tst	w9, w20
	b.eq	LBB0_16
; %bb.6:
	lsl	w8, w8, #2
	lsr	w8, w21, w8
LBB0_7:
	and	w0, w8, #0xf
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_HDSPM_bit2freq
LBB0_8:
Lloh27:
	adrp	x8, _HDSPM_wcLock@GOTPAGE
Lloh28:
	ldr	x8, [x8, _HDSPM_wcLock@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_12
; %bb.9:
Lloh30:
	adrp	x8, _HDSPM_SelSyncRef0@GOTPAGE
Lloh31:
	ldr	x8, [x8, _HDSPM_SelSyncRef0@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	tst	w8, w19
	b.ne	LBB0_12
; %bb.10:
Lloh33:
	adrp	x8, _HDSPM_wcFreqMask@GOTPAGE
Lloh34:
	ldr	x8, [x8, _HDSPM_wcFreqMask@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	and	w8, w8, w20
	sub	w8, w8, #128
	cmp	w8, #5
	b.hi	LBB0_12
; %bb.11:
Lloh36:
	adrp	x9, l_switch.table.hdspm_external_sample_rate@PAGE
Lloh37:
	add	x9, x9, l_switch.table.hdspm_external_sample_rate@PAGEOFF
	ldr	w0, [x9, w8, sxtw #2]
Lloh38:
	adrp	x8, _HDSPM_SelSyncRefMask@GOTPAGE
Lloh39:
	ldr	x8, [x8, _HDSPM_SelSyncRefMask@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	and	w8, w8, w20
Lloh41:
	adrp	x9, _HDSPM_SelSyncRef_WORD@GOTPAGE
Lloh42:
	ldr	x9, [x9, _HDSPM_SelSyncRef_WORD@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_13
	b	LBB0_17
LBB0_12:
	mov	w0, #0
LBB0_13:
Lloh44:
	adrp	x8, _HDSPM_madiLock@GOTPAGE
Lloh45:
	ldr	x8, [x8, _HDSPM_madiLock@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_17
; %bb.14:
Lloh47:
	adrp	x8, _HDSPM_madiFreqMask@GOTPAGE
Lloh48:
	ldr	x8, [x8, _HDSPM_madiFreqMask@GOTPAGEOFF]
Lloh49:
	ldr	w8, [x8]
	and	w8, w8, w19
	sub	w8, w8, #134
	cmp	w8, #8
	b.hi	LBB0_16
; %bb.15:
Lloh50:
	adrp	x9, l_switch.table.hdspm_external_sample_rate.1@PAGE
Lloh51:
	add	x9, x9, l_switch.table.hdspm_external_sample_rate.1@PAGEOFF
	ldr	w0, [x9, w8, sxtw #2]
	b	LBB0_17
LBB0_16:
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.comm	_HDSPM_statusRegister2,4,2      ; @HDSPM_statusRegister2
	.comm	_HDSPM_statusRegister,4,2       ; @HDSPM_statusRegister
	.comm	_HDSPM_timecodeRegister,4,2     ; @HDSPM_timecodeRegister
	.comm	_HDSPM_AES32_AUTOSYNC_FROM_WORD,4,2 ; @HDSPM_AES32_AUTOSYNC_FROM_WORD
	.comm	_HDSPM_AES32_wcLock,4,2         ; @HDSPM_AES32_wcLock
	.comm	_HDSPM_AES32_wcFreq_bit,4,2     ; @HDSPM_AES32_wcFreq_bit
	.comm	_HDSPM_AES32_AUTOSYNC_FROM_AES1,4,2 ; @HDSPM_AES32_AUTOSYNC_FROM_AES1
	.comm	_HDSPM_AES32_AUTOSYNC_FROM_AES8,4,2 ; @HDSPM_AES32_AUTOSYNC_FROM_AES8
	.comm	_HDSPM_LockAES,4,2              ; @HDSPM_LockAES
	.comm	_HDSPM_wcLock,4,2               ; @HDSPM_wcLock
	.comm	_HDSPM_SelSyncRef0,4,2          ; @HDSPM_SelSyncRef0
	.comm	_HDSPM_wcFreqMask,4,2           ; @HDSPM_wcFreqMask
	.comm	_HDSPM_SelSyncRefMask,4,2       ; @HDSPM_SelSyncRefMask
	.comm	_HDSPM_SelSyncRef_WORD,4,2      ; @HDSPM_SelSyncRef_WORD
	.comm	_HDSPM_madiLock,4,2             ; @HDSPM_madiLock
	.comm	_HDSPM_madiFreqMask,4,2         ; @HDSPM_madiFreqMask
	.no_dead_strip	_hdspm_external_sample_rate
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.hdspm_external_sample_rate
l_switch.table.hdspm_external_sample_rate:
	.long	96000                           ; 0x17700
	.long	88200                           ; 0x15888
	.long	64000                           ; 0xfa00
	.long	48000                           ; 0xbb80
	.long	44100                           ; 0xac44
	.long	32000                           ; 0x7d00

	.p2align	2                               ; @switch.table.hdspm_external_sample_rate.1
l_switch.table.hdspm_external_sample_rate.1:
	.long	96000                           ; 0x17700
	.long	88200                           ; 0x15888
	.long	64000                           ; 0xfa00
	.long	48000                           ; 0xbb80
	.long	44100                           ; 0xac44
	.long	32000                           ; 0x7d00
	.long	192000                          ; 0x2ee00
	.long	176400                          ; 0x2b110
	.long	128000                          ; 0x1f400

.subsections_via_symbols
