	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_audio_remap_set_channel_layout ## -- Begin function hb_audio_remap_set_channel_layout
	.p2align	4, 0x90
_hb_audio_remap_set_channel_layout:     ## @hb_audio_remap_set_channel_layout
	.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
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	$0, (%rdi)
	movq	_AV_CH_LAYOUT_STEREO_DOWNMIX@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jne	LBB0_3
## %bb.2:
	movq	_AV_CH_LAYOUT_STEREO@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
LBB0_3:
	movq	%r14, %rdi
	callq	_av_get_channel_layout_nb_channels
	movl	%eax, 4(%rbx)
	movq	_HB_AUDIO_REMAP_MAX_CHANNELS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_4
## %bb.11:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_hb_log                         ## TAILCALL
LBB0_4:
	movq	8(%rbx), %rsi
	movq	16(%rbx), %rdi
	cmpq	%rdi, %rsi
	je	LBB0_10
## %bb.5:
	movq	24(%rbx), %rcx
	movq	%r14, %rdx
	callq	_hb_audio_remap_build_table
	movl	4(%rbx), %eax
	testl	%eax, %eax
	jle	LBB0_10
## %bb.6:
	movq	24(%rbx), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rdx,4), %esi
	cmpq	%rsi, %rdx
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_8
	jmp	LBB0_10
LBB0_9:
	movl	$1, (%rbx)
LBB0_10:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_CH_LAYOUT_STEREO_DOWNMIX,8,3 ## @AV_CH_LAYOUT_STEREO_DOWNMIX
	.comm	_AV_CH_LAYOUT_STEREO,8,3        ## @AV_CH_LAYOUT_STEREO
	.comm	_HB_AUDIO_REMAP_MAX_CHANNELS,4,2 ## @HB_AUDIO_REMAP_MAX_CHANNELS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hb_audio_remap_set_channel_layout: too many channels (%d)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_audio_remap_set_channel_layout ; -- Begin function hb_audio_remap_set_channel_layout
	.p2align	2
_hb_audio_remap_set_channel_layout:     ; @hb_audio_remap_set_channel_layout
	.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
	cbz	x0, LBB0_9
; %bb.1:
	mov	x19, x0
	str	wzr, [x0]
Lloh0:
	adrp	x8, _AV_CH_LAYOUT_STEREO_DOWNMIX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_CH_LAYOUT_STEREO_DOWNMIX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _AV_CH_LAYOUT_STEREO@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AV_CH_LAYOUT_STEREO@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x1
	csel	x20, x9, x1, eq
	mov	x0, x20
	bl	_av_get_channel_layout_nb_channels
	str	w0, [x19, #4]
Lloh6:
	adrp	x8, _HB_AUDIO_REMAP_MAX_CHANNELS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HB_AUDIO_REMAP_MAX_CHANNELS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w0, w8
	b.le	LBB0_3
; %bb.2:
	mov	x1, x0
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_hb_log
LBB0_3:
	ldp	x1, x0, [x19, #8]
	cmp	x1, x0
	b.eq	LBB0_9
; %bb.4:
	ldr	x3, [x19, #24]
	mov	x2, x20
	bl	_hb_audio_remap_build_table
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.5:
	mov	x9, #0
	ldr	x10, [x19, #24]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10, x9, lsl #2]
	cmp	x9, x11
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_6
	b	LBB0_9
LBB0_8:
	mov	w8, #1
	str	w8, [x19]
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_CH_LAYOUT_STEREO_DOWNMIX,8,3 ; @AV_CH_LAYOUT_STEREO_DOWNMIX
	.comm	_AV_CH_LAYOUT_STEREO,8,3        ; @AV_CH_LAYOUT_STEREO
	.comm	_HB_AUDIO_REMAP_MAX_CHANNELS,4,2 ; @HB_AUDIO_REMAP_MAX_CHANNELS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hb_audio_remap_set_channel_layout: too many channels (%d)"

.subsections_via_symbols
