	.file	"extr_ctl.c_ctl_isc_mode_sync.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ctl_isc_mode_sync, @function
ctl_isc_mode_sync:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	r13, QWORD PTR [rsi]
	call	mtx_lock@PLT
	cmp	QWORD PTR ctl_max_luns[rip], r13
	jbe	.L2
	mov	rax, QWORD PTR 8[r12]
	mov	r13, QWORD PTR [rax+r13*8]
	test	r13, r13
	je	.L2
	lea	r14, 4[r13]
	mov	rdi, r14
	call	mtx_lock@PLT
	mov	rdi, r12
	call	mtx_unlock@PLT
	mov	eax, DWORD PTR 0[r13]
	test	DWORD PTR CTL_LUN_DISABLED[rip], eax
	jne	.L10
	mov	rsi, QWORD PTR CTL_NUM_MODE_PAGES[rip]
	test	rsi, rsi
	je	.L10
	mov	r8d, DWORD PTR SMPH_PC_MASK[rip]
	mov	edi, DWORD PTR 0[rbp]
	xor	edx, edx
	mov	rax, QWORD PTR 8[r13]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	add	rdx, 1
	add	rax, 24
	cmp	rsi, rdx
	je	.L10
.L9:
	mov	ecx, DWORD PTR [rax]
	and	ecx, r8d
	cmp	ecx, edi
	jne	.L7
	mov	rcx, QWORD PTR 8[rbp]
	cmp	QWORD PTR 8[rax], rcx
	jne	.L7
	mov	esi, DWORD PTR 16[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	edi, DWORD PTR 20[rax]
	call	memcpy@PLT
	mov	rdi, rbp
	call	ctl_get_initindex@PLT
	mov	rsi, rax
	cmp	rax, -1
	jne	.L18
.L10:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, r14
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	mtx_unlock@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, r12
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	mtx_unlock@PLT
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	edx, DWORD PTR CTL_UA_MODE_CHANGE[rip]
	mov	rdi, r13
	call	ctl_est_ua_all@PLT
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	ctl_isc_mode_sync, .-ctl_isc_mode_sync
	.comm	ctl_max_luns,8,8
	.comm	SMPH_PC_MASK,4,4
	.comm	CTL_UA_MODE_CHANGE,4,4
	.comm	CTL_NUM_MODE_PAGES,8,8
	.comm	CTL_LUN_DISABLED,4,4
	.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_ctl.c_ctl_isc_mode_sync.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ctl_isc_mode_sync, %function
ctl_isc_mode_sync:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r5, [r1]
	mov	r4, r1
	mov	r7, r0
	bl	mtx_lock
	ldr	r3, .L18
	ldr	r3, [r3]
	cmp	r3, r5
	bls	.L2
	ldr	r3, [r7, #4]
	ldr	r5, [r3, r5, lsl #2]
	cmp	r5, #0
	beq	.L2
	add	r6, r5, #4
	mov	r0, r6
	bl	mtx_lock
	mov	r0, r7
	bl	mtx_unlock
	ldr	r2, .L18+4
	ldr	r3, [r5]
	ldr	r2, [r2]
	ands	r3, r3, r2
	bne	.L10
	ldr	r2, .L18+8
	ldr	ip, [r2]
	cmp	ip, #0
	beq	.L10
	ldr	r1, [r5, #8]
	ldr	r2, .L18+12
	mov	r0, r1
	ldr	r7, [r4]
	ldr	lr, [r2]
	b	.L9
.L7:
	cmp	ip, r3
	add	r0, r0, #16
	beq	.L10
.L9:
	ldr	r2, [r1, r3, lsl #4]
	add	r3, r3, #1
	and	r2, r2, lr
	cmp	r2, r7
	bne	.L7
	ldr	r8, [r0, #4]
	ldr	r2, [r4, #4]
	cmp	r8, r2
	bne	.L7
	ldr	r2, [r0, #8]
	ldr	r1, [r4, #8]
	ldr	r0, [r0, #12]
	bl	memcpy
	mov	r0, r4
	bl	ctl_get_initindex
	cmn	r0, #1
	bne	.L17
.L10:
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, lr}
	b	mtx_unlock
.L2:
	mov	r0, r7
	pop	{r4, r5, r6, r7, r8, lr}
	b	mtx_unlock
.L17:
	ldr	r3, .L18+16
	mov	r1, r0
	ldr	r2, [r3]
	mov	r0, r5
	bl	ctl_est_ua_all
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, lr}
	b	mtx_unlock
.L19:
	.align	2
.L18:
	.word	ctl_max_luns
	.word	CTL_LUN_DISABLED
	.word	CTL_NUM_MODE_PAGES
	.word	SMPH_PC_MASK
	.word	CTL_UA_MODE_CHANGE
	.size	ctl_isc_mode_sync, .-ctl_isc_mode_sync
	.comm	ctl_max_luns,4,4
	.comm	SMPH_PC_MASK,4,4
	.comm	CTL_UA_MODE_CHANGE,4,4
	.comm	CTL_NUM_MODE_PAGES,4,4
	.comm	CTL_LUN_DISABLED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
