	.file	"extr_mixer_scarlett_gen2.c_scarlett2_init_routing.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	scarlett2_init_routing, @function
scarlett2_init_routing:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, 128
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	mov	rdi, r13
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	lea	rbp, connect_order.1936[rip]
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	r14, rbp
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	edx, DWORD PTR SCARLETT2_PORT_TYPE_PCM[rip]
	mov	rsi, QWORD PTR SCARLETT2_PORT_OUT[rip]
	call	scarlett2_get_port_start_num@PLT
	mov	rdx, QWORD PTR SCARLETT2_PORT_OUT[rip]
	mov	r9, QWORD PTR SCARLETT2_PORT_IN[rip]
	mov	r8d, eax
	mov	rax, QWORD PTR SCARLETT2_PORT_TYPE_PCM[rip]
	mov	rax, QWORD PTR 0[r13+rax*8]
	mov	ebx, DWORD PTR [rax+rdx*4]
	mov	edx, 129
.L6:
	mov	rsi, r9
	mov	rdi, r13
	mov	DWORD PTR 12[rsp], r8d
	mov	DWORD PTR 8[rsp], edx
	call	scarlett2_get_port_start_num@PLT
	movsx	rdx, DWORD PTR 8[rsp]
	test	ebx, ebx
	mov	r9, QWORD PTR SCARLETT2_PORT_IN[rip]
	mov	r8d, DWORD PTR 12[rsp]
	mov	rdx, QWORD PTR 0[r13+rdx*8]
	mov	esi, DWORD PTR [rdx+r9*4]
	je	.L12
	test	esi, esi
	jle	.L12
	lea	ecx, 1[r8]
	mov	edx, ebx
	lea	edi, [rax+rbx]
	movsx	rcx, ecx
	.p2align 4,,10
	.p2align 3
.L3:
	mov	eax, edi
	mov	r8d, ecx
	sub	eax, edx
	sub	edx, 1
	mov	DWORD PTR -4[r12+rcx*4], eax
	mov	eax, ebx
	add	rcx, 1
	sub	eax, edx
	cmp	esi, eax
	jle	.L2
	test	edx, edx
	jne	.L3
.L2:
	add	r14, 4
	test	r15d, r15d
	js	.L5
	mov	ebx, edx
	mov	edx, r15d
	mov	r15d, DWORD PTR 4[r14]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edx, DWORD PTR SCARLETT2_PORT_TYPE_PCM[rip]
	mov	rsi, r9
	mov	rdi, r13
	mov	r15d, 128
	call	scarlett2_get_port_start_num@PLT
	mov	rdx, QWORD PTR SCARLETT2_PORT_IN[rip]
	mov	r8, QWORD PTR SCARLETT2_PORT_OUT[rip]
	mov	ebx, eax
	mov	rax, QWORD PTR SCARLETT2_PORT_TYPE_PCM[rip]
	mov	rax, QWORD PTR 0[r13+rax*8]
	mov	r14d, DWORD PTR [rax+rdx*4]
	mov	edx, 129
.L11:
	mov	rsi, r8
	mov	rdi, r13
	mov	DWORD PTR 8[rsp], edx
	call	scarlett2_get_port_start_num@PLT
	movsx	rdx, DWORD PTR 8[rsp]
	mov	r8, QWORD PTR SCARLETT2_PORT_OUT[rip]
	mov	rdx, QWORD PTR 0[r13+rdx*8]
	mov	esi, DWORD PTR [rdx+r8*4]
	test	r14d, r14d
	je	.L13
	test	esi, esi
	jle	.L13
	cdqe
	lea	rdx, [r12+rax*4]
	mov	eax, r14d
	.p2align 4,,10
	.p2align 3
.L8:
	mov	ecx, ebx
	sub	eax, 1
	add	ebx, 1
	add	rdx, 4
	mov	DWORD PTR -4[rdx], ecx
	mov	ecx, r14d
	sub	ecx, eax
	cmp	esi, ecx
	jle	.L7
	test	eax, eax
	jne	.L8
.L7:
	add	rbp, 4
	test	r15d, r15d
	js	.L1
	mov	edx, r15d
	mov	r14d, eax
	mov	r15d, DWORD PTR 4[rbp]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	edx, ebx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	mov	eax, r14d
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	scarlett2_init_routing, .-scarlett2_init_routing
	.section	.rodata
	.align 16
	.type	connect_order.1936, @object
	.size	connect_order.1936, 16
connect_order.1936:
	.long	129
	.long	128
	.long	130
	.long	-1
	.comm	SCARLETT2_PORT_TYPE_PCM,8,8
	.comm	SCARLETT2_PORT_OUT,8,8
	.comm	SCARLETT2_PORT_IN,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_mixer_scarlett_gen2.c_scarlett2_init_routing.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	scarlett2_init_routing, %function
scarlett2_init_routing:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r4, .L18
	ldr	r8, .L18+4
	ldr	r2, [r4]
	sub	sp, sp, #12
	mov	r6, r1
	mov	r7, r0
	mov	r0, r1
	ldr	r1, [r8]
	bl	scarlett2_get_port_start_num
	mov	r9, #128
	mov	r5, r0
	mov	r10, #129
	ldr	r3, .L18+8
	ldr	r2, [r8]
	str	r3, [sp, #4]
	str	r3, [sp]
	ldr	r3, [r4]
	ldr	r3, [r6, r3, lsl #2]
	ldr	r4, [r3, r2, lsl #2]
	ldr	r3, .L18+12
	ldr	r1, [r3]
.L5:
	mov	r2, r10
	mov	r0, r6
	bl	scarlett2_get_port_start_num
	ldr	r2, .L18+12
	ldr	r3, [r6, r10, lsl #2]
	ldr	r1, [r2]
	ldr	r10, [r3, r1, lsl #2]
	cmp	r4, #0
	cmpne	r10, #0
	ble	.L2
	mov	r3, #0
	sub	ip, r5, #-1073741823
	add	ip, r7, ip, lsl #2
	add	fp, r5, #1
.L3:
	subs	r4, r4, #1
	movne	r2, #1
	moveq	r2, #0
	add	lr, r0, r3
	add	r5, fp, r3
	add	r3, r3, #1
	cmp	r10, r3
	movle	r2, #0
	andgt	r2, r2, #1
	cmp	r2, #0
	str	lr, [ip, #4]!
	bne	.L3
.L2:
	cmp	r9, #0
	blt	.L4
	ldr	r3, [sp]
	mov	r10, r9
	ldr	r9, [r3], #4
	str	r3, [sp]
	b	.L5
.L4:
	ldr	r10, .L18
	mov	r0, r6
	ldr	r2, [r10]
	bl	scarlett2_get_port_start_num
	mov	r5, #128
	mov	r4, r0
	mov	r9, #129
	ldr	r3, [r10]
	ldr	r2, .L18+12
	ldr	r3, [r6, r3, lsl #2]
	ldr	r2, [r2]
	ldr	r1, [r8]
	ldr	r10, [r3, r2, lsl #2]
	ldr	fp, [sp, #4]
.L9:
	mov	r2, r9
	mov	r0, r6
	bl	scarlett2_get_port_start_num
	ldr	r3, [r6, r9, lsl #2]
	ldr	r1, [r8]
	ldr	ip, [r3, r1, lsl #2]
	mov	r3, r10
	cmp	r10, #0
	cmpne	ip, #0
	ble	.L6
	sub	r0, r0, #-1073741823
	add	r0, r7, r0, lsl #2
.L7:
	sub	r3, r3, #1
	sub	r2, r10, r3
	cmp	r3, #0
	cmpne	ip, r2
	str	r4, [r0, #4]!
	add	r4, r4, #1
	bgt	.L7
.L6:
	cmp	r5, #0
	movge	r9, r5
	movge	r10, r3
	ldrge	r5, [fp], #4
	bge	.L9
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L19:
	.align	2
.L18:
	.word	SCARLETT2_PORT_TYPE_PCM
	.word	SCARLETT2_PORT_OUT
	.word	.LANCHOR0+8
	.word	SCARLETT2_PORT_IN
	.size	scarlett2_init_routing, .-scarlett2_init_routing
	.comm	SCARLETT2_PORT_TYPE_PCM,4,4
	.comm	SCARLETT2_PORT_OUT,4,4
	.comm	SCARLETT2_PORT_IN,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	connect_order.4220, %object
	.size	connect_order.4220, 16
connect_order.4220:
	.word	129
	.word	128
	.word	130
	.word	-1
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
