	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hda_codec_parse_format
_hda_codec_parse_format:                ## @hda_codec_parse_format
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movl	%edi, %ebx
	movq	%rsi, %rdi
	callq	_assert
	movq	_HDA_CODEC_FMT_BASE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	movl	$48000, %ecx                    ## imm = 0xBB80
	movl	$44100, %eax                    ## imm = 0xAC44
	cmovel	%ecx, %eax
	movl	%eax, (%r14)
	movq	_HDA_CODEC_FMT_MULT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%ebx, %ecx
	cmpl	$128, %ecx
	je	LBB0_5
## %bb.1:
	cmpl	$129, %ecx
	je	LBB0_4
## %bb.2:
	cmpl	$130, %ecx
	jne	LBB0_7
## %bb.3:
	addl	%eax, %eax
	jmp	LBB0_6
LBB0_5:
	shll	$2, %eax
	jmp	LBB0_6
LBB0_4:
	leal	(%rax,%rax,2), %eax
LBB0_6:
	movl	%eax, (%r14)
LBB0_7:
	movq	_HDA_CODEC_FMT_DIV_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%ebx, %esi
	sarl	%cl, %esi
	movq	_HDA_CODEC_FMT_DIV_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %esi
	incl	%esi
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%esi
	movl	%eax, (%r14)
	movq	_HDA_CODEC_FMT_BITS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	%ebx, %esi
	leal	-131(%rsi), %eax
	cmpl	$4, %eax
	jae	LBB0_8
## %bb.9:
	cltq
	leaq	l_switch.table.hda_codec_parse_format(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movq	_HDA_CODEC_FMT_CHAN_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	incl	%ebx
	movl	%ebx, 4(%r14)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_DPRINTF
	movl	$-1, %eax
LBB0_10:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDA_CODEC_FMT_BASE_MASK,4,2    ## @HDA_CODEC_FMT_BASE_MASK
	.comm	_HDA_CODEC_FMT_MULT_MASK,4,2    ## @HDA_CODEC_FMT_MULT_MASK
	.comm	_HDA_CODEC_FMT_DIV_SHIFT,4,2    ## @HDA_CODEC_FMT_DIV_SHIFT
	.comm	_HDA_CODEC_FMT_DIV_MASK,4,2     ## @HDA_CODEC_FMT_DIV_MASK
	.comm	_HDA_CODEC_FMT_BITS_MASK,4,2    ## @HDA_CODEC_FMT_BITS_MASK
	.comm	_AFMT_U8,4,2                    ## @AFMT_U8
	.comm	_AFMT_S16_LE,4,2                ## @AFMT_S16_LE
	.comm	_AFMT_S24_LE,4,2                ## @AFMT_S24_LE
	.comm	_AFMT_S32_LE,4,2                ## @AFMT_S32_LE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown format bits: 0x%x\n"

	.comm	_HDA_CODEC_FMT_CHAN_MASK,4,2    ## @HDA_CODEC_FMT_CHAN_MASK
	.no_dead_strip	_hda_codec_parse_format
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.hda_codec_parse_format
l_switch.table.hda_codec_parse_format:
	.quad	_AFMT_U8
	.quad	_AFMT_S32_LE
	.quad	_AFMT_S24_LE
	.quad	_AFMT_S16_LE

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hda_codec_parse_format
_hda_codec_parse_format:                ; @hda_codec_parse_format
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	mov	x0, x1
	bl	_assert
Lloh0:
	adrp	x8, _HDA_CODEC_FMT_BASE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HDA_CODEC_FMT_BASE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w20
	mov	w8, #44100
	mov	w9, #48000
	csel	w8, w9, w8, eq
	str	w8, [x19]
Lloh3:
	adrp	x9, _HDA_CODEC_FMT_MULT_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _HDA_CODEC_FMT_MULT_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w9, w9, w20
	cmp	w9, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w9, #129
	b.eq	LBB0_5
; %bb.2:
	cmp	w9, #130
	b.ne	LBB0_7
; %bb.3:
	lsl	w8, w8, #1
	b	LBB0_6
LBB0_4:
	lsl	w8, w8, #2
	b	LBB0_6
LBB0_5:
	add	w8, w8, w8, lsl #1
LBB0_6:
	str	w8, [x19]
LBB0_7:
Lloh6:
	adrp	x9, _HDA_CODEC_FMT_DIV_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _HDA_CODEC_FMT_DIV_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _HDA_CODEC_FMT_DIV_MASK@GOTPAGE
Lloh10:
	ldr	x10, [x10, _HDA_CODEC_FMT_DIV_MASK@GOTPAGEOFF]
	asr	w9, w20, w9
Lloh11:
	ldr	w10, [x10]
	and	w9, w9, w10
	add	w9, w9, #1
	sdiv	w8, w8, w9
	str	w8, [x19]
Lloh12:
	adrp	x8, _HDA_CODEC_FMT_BITS_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HDA_CODEC_FMT_BITS_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	and	w1, w8, w20
	sub	w8, w1, #131
	cmp	w8, #4
	b.hs	LBB0_9
; %bb.8:
	mov	w0, #0
Lloh15:
	adrp	x9, l_switch.table.hda_codec_parse_format@PAGE
Lloh16:
	add	x9, x9, l_switch.table.hda_codec_parse_format@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
Lloh17:
	adrp	x9, _HDA_CODEC_FMT_CHAN_MASK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _HDA_CODEC_FMT_CHAN_MASK@GOTPAGEOFF]
	ldr	w8, [x8]
Lloh19:
	ldr	w9, [x9]
	and	w9, w9, w20
	add	w9, w9, #1
	stp	w9, w8, [x19, #4]
	b	LBB0_10
LBB0_9:
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINTF
	mov	w0, #-1
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_HDA_CODEC_FMT_BASE_MASK,4,2    ; @HDA_CODEC_FMT_BASE_MASK
	.comm	_HDA_CODEC_FMT_MULT_MASK,4,2    ; @HDA_CODEC_FMT_MULT_MASK
	.comm	_HDA_CODEC_FMT_DIV_SHIFT,4,2    ; @HDA_CODEC_FMT_DIV_SHIFT
	.comm	_HDA_CODEC_FMT_DIV_MASK,4,2     ; @HDA_CODEC_FMT_DIV_MASK
	.comm	_HDA_CODEC_FMT_BITS_MASK,4,2    ; @HDA_CODEC_FMT_BITS_MASK
	.comm	_AFMT_U8,4,2                    ; @AFMT_U8
	.comm	_AFMT_S16_LE,4,2                ; @AFMT_S16_LE
	.comm	_AFMT_S24_LE,4,2                ; @AFMT_S24_LE
	.comm	_AFMT_S32_LE,4,2                ; @AFMT_S32_LE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown format bits: 0x%x\n"

	.comm	_HDA_CODEC_FMT_CHAN_MASK,4,2    ; @HDA_CODEC_FMT_CHAN_MASK
	.no_dead_strip	_hda_codec_parse_format
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.hda_codec_parse_format
l_switch.table.hda_codec_parse_format:
	.quad	_AFMT_U8
	.quad	_AFMT_S32_LE
	.quad	_AFMT_S24_LE
	.quad	_AFMT_S16_LE

.subsections_via_symbols
