	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_swr_set_matrix                 ## -- Begin function swr_set_matrix
	.p2align	4, 0x90
_swr_set_matrix:                        ## @swr_set_matrix
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rdi, %r15
	cmpq	$0, 40(%rdi)
	je	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_3:
	movl	%edx, %ebx
	movq	(%r15), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	8(%r15), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	16(%r15), %r12d
	testl	%r12d, %r12d
	jg	LBB0_5
## %bb.4:
	movl	32(%r15), %edi
	callq	_av_get_channel_layout_nb_channels
	movl	%eax, %r12d
LBB0_5:
	movl	20(%r15), %eax
	testl	%eax, %eax
	jg	LBB0_7
## %bb.6:
	movl	28(%r15), %edi
	callq	_av_get_channel_layout_nb_channels
	testl	%eax, %eax
	jle	LBB0_29
LBB0_7:
	movslq	%ebx, %r14
	movl	%eax, %r10d
	movl	%r12d, %edx
	shlq	$3, %r14
	movl	%edx, %eax
	andl	$-4, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	addq	$-4, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, %rcx
	shrq	$2, %rcx
	incq	%rcx
	movq	%rcx, %rax
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	andq	$-2, %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %r13d
	andl	$3, %r13d
	xorl	%esi, %esi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=1
	addq	%r14, %rax
	incq	%rsi
	cmpq	%r10, %rsi
	je	LBB0_29
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_22 Depth 2
                                        ##     Child Loop BB0_14 Depth 2
                                        ##     Child Loop BB0_16 Depth 2
	testl	%r12d, %r12d
	jle	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%r15), %rcx
	movq	8(%r15), %rbx
	movq	(%rcx,%rsi,8), %r8
	movq	(%rbx,%rsi,8), %r9
	cmpl	$4, %r12d
	jae	LBB0_17
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	xorl	%r11d, %r11d
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r11, %rcx
	notq	%rcx
	addq	%rdx, %rcx
	testq	%r13, %r13
	je	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rbx
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movsd	(%rax,%r11,8), %xmm0            ## xmm0 = mem[0],zero
	movsd	%xmm0, (%r8,%r11,8)
	movsd	%xmm0, (%r9,%r11,8)
	incq	%r11
	decq	%rbx
	jne	LBB0_14
LBB0_15:                                ##   in Loop: Header=BB0_9 Depth=1
	cmpq	$3, %rcx
	jb	LBB0_8
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movsd	(%rax,%r11,8), %xmm0            ## xmm0 = mem[0],zero
	movsd	%xmm0, (%r8,%r11,8)
	movsd	%xmm0, (%r9,%r11,8)
	movsd	8(%rax,%r11,8), %xmm0           ## xmm0 = mem[0],zero
	movsd	%xmm0, 8(%r8,%r11,8)
	movsd	%xmm0, 8(%r9,%r11,8)
	movsd	16(%rax,%r11,8), %xmm0          ## xmm0 = mem[0],zero
	movsd	%xmm0, 16(%r8,%r11,8)
	movsd	%xmm0, 16(%r9,%r11,8)
	movsd	24(%rax,%r11,8), %xmm0          ## xmm0 = mem[0],zero
	movsd	%xmm0, 24(%r8,%r11,8)
	movsd	%xmm0, 24(%r9,%r11,8)
	addq	$4, %r11
	cmpq	%r11, %rdx
	jne	LBB0_16
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r9, %rcx
	subq	%r8, %rcx
	cmpq	$32, %rcx
	jb	LBB0_11
## %bb.18:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r14, %rcx
	imulq	%rsi, %rcx
	addq	-48(%rbp), %rcx                 ## 8-byte Folded Reload
	movq	%r8, %rdi
	subq	%rcx, %rdi
	cmpq	$32, %rdi
	jb	LBB0_11
## %bb.19:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r9, %rdi
	subq	%rcx, %rdi
	movl	$0, %r11d
	cmpq	$32, %rdi
	jb	LBB0_12
## %bb.20:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_26
## %bb.21:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_22:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movups	(%rax,%rcx,8), %xmm0
	movups	16(%rax,%rcx,8), %xmm1
	movups	%xmm0, (%r8,%rcx,8)
	movups	%xmm1, 16(%r8,%rcx,8)
	movups	%xmm0, (%r9,%rcx,8)
	movups	%xmm1, 16(%r9,%rcx,8)
	movups	32(%rax,%rcx,8), %xmm0
	movups	48(%rax,%rcx,8), %xmm1
	movups	%xmm0, 32(%r8,%rcx,8)
	movups	%xmm1, 48(%r8,%rcx,8)
	movups	%xmm0, 32(%r9,%rcx,8)
	movups	%xmm1, 48(%r9,%rcx,8)
	addq	$8, %rcx
	addq	$-2, %rbx
	jne	LBB0_22
## %bb.23:                              ##   in Loop: Header=BB0_9 Depth=1
	testb	$1, -64(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_25
LBB0_24:                                ##   in Loop: Header=BB0_9 Depth=1
	movups	(%rax,%rcx,8), %xmm0
	movups	16(%rax,%rcx,8), %xmm1
	movups	%xmm0, (%r8,%rcx,8)
	movups	%xmm1, 16(%r8,%rcx,8)
	movups	%xmm0, (%r9,%rcx,8)
	movups	%xmm1, 16(%r9,%rcx,8)
LBB0_25:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, %r11
	cmpq	%rdx, %rcx
	je	LBB0_8
	jmp	LBB0_12
LBB0_26:                                ##   in Loop: Header=BB0_9 Depth=1
	xorl	%ecx, %ecx
	testb	$1, -64(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_24
	jmp	LBB0_25
LBB0_29:
	movl	$1, 24(%r15)
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_swr_set_matrix                 ; -- Begin function swr_set_matrix
	.p2align	2
_swr_set_matrix:                        ; @swr_set_matrix
	.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
	cbz	x0, LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #40]
	cbz	x8, LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	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	_AVERROR
LBB0_3:
	mov	x22, x2
	mov	x20, x1
	ldr	x0, [x19]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x0, [x19, #8]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w21, [x19, #16]
	cmp	w21, #0
	b.gt	LBB0_5
; %bb.4:
	ldr	w0, [x19, #32]
	bl	_av_get_channel_layout_nb_channels
	mov	x21, x0
LBB0_5:
	ldr	w0, [x19, #20]
	cmp	w0, #0
	b.gt	LBB0_7
; %bb.6:
	ldr	w0, [x19, #28]
	bl	_av_get_channel_layout_nb_channels
	cmp	w0, #1
	b.lt	LBB0_19
LBB0_7:
	mov	x8, #0
	mov	w9, w0
	mov	w10, w21
	sbfiz	x11, x22, #3, #32
	and	x12, x10, #0xfffffff8
	lsl	x13, x10, #3
	and	x13, x13, #0x7ffffffc0
	mov	x14, x20
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x8, x8, #1
	add	x14, x14, x11
	cmp	x8, x9
	b.eq	LBB0_19
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_17 Depth 2
                                        ;     Child Loop BB0_12 Depth 2
	cmp	w21, #1
	b.lt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	lsl	x16, x8, #3
	ldp	x15, x17, [x19]
	ldr	x15, [x15, x16]
	ldr	x16, [x17, x16]
	cmp	w21, #8
	b.hs	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x17, #0
LBB0_12:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x0, x17, #3
	ldr	d0, [x14, x0]
	str	d0, [x15, x0]
	str	d0, [x16, x0]
	add	x17, x17, #1
	cmp	x10, x17
	b.ne	LBB0_12
	b	LBB0_8
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x17, #0
	sub	x0, x16, x15
	cmp	x0, #64
	b.lo	LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_9 Depth=1
	madd	x0, x11, x8, x20
	sub	x1, x15, x0
	cmp	x1, #64
	b.lo	LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=1
	sub	x0, x16, x0
	cmp	x0, #64
	b.lo	LBB0_12
; %bb.16:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x17, #0
LBB0_17:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x0, x14, x17
	ldp	q0, q1, [x0]
	ldp	q2, q3, [x0, #32]
	add	x0, x15, x17
	stp	q0, q1, [x0]
	stp	q2, q3, [x0, #32]
	add	x0, x16, x17
	stp	q0, q1, [x0]
	stp	q2, q3, [x0, #32]
	add	x17, x17, #64
	cmp	x13, x17
	b.ne	LBB0_17
; %bb.18:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x17, x12
	cmp	x12, x10
	b.ne	LBB0_12
	b	LBB0_8
LBB0_19:
	mov	w8, #1
	str	w8, [x19, #24]
	mov	w0, #0
	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	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
