	.file	"extr_sisusb_con.c_sisusbcon_switch.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"ASSERT ORIGIN != SCREENBUF!\n"
	.text
	.p2align 4
	.type	sisusbcon_switch, @function
sisusbcon_switch:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	edi, DWORD PTR 24[rdi]
	call	sisusb_get_sisusb_lock_and_check@PLT
	test	rax, rax
	je	.L2
	mov	rsi, rax
	mov	rdi, rbx
	mov	rbp, rax
	call	sisusb_is_inactive@PLT
	lea	r13, 16[rbp]
	test	rax, rax
	jne	.L9
	mov	rax, QWORD PTR [rbx]
	cmp	rax, QWORD PTR 8[rbx]
	je	.L11
	mov	rsi, QWORD PTR 8[rbp]
	mov	edi, DWORD PTR 16[rbx]
	add	esi, DWORD PTR 0[rbp]
	sub	esi, eax
	call	min@PLT
	mov	rsi, QWORD PTR 8[rbx]
	mov	rdi, QWORD PTR [rbx]
	mov	edx, eax
	mov	r12d, eax
	call	memcpy@PLT
	xor	ecx, ecx
	xor	edx, edx
	mov	rsi, rbx
	mov	rdi, rbp
	call	sisusb_haddr@PLT
	mov	rsi, QWORD PTR [rbx]
	mov	ecx, r12d
	mov	rdi, rbp
	mov	edx, eax
	call	sisusb_copy_memory@PLT
.L9:
	mov	rdi, r13
	call	mutex_unlock@PLT
.L2:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	rdi, r13
	call	mutex_unlock@PLT
	mov	rdi, QWORD PTR 24[rbp]
	lea	rsi, .LC0[rip]
	call	dev_dbg@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	sisusbcon_switch, .-sisusbcon_switch
	.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_sisusb_con.c_sisusbcon_switch.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"ASSERT ORIGIN != SCREENBUF!\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sisusbcon_switch, %function
sisusbcon_switch:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	ldr	r0, [r0, #12]
	bl	sisusb_get_sisusb_lock_and_check
	subs	r5, r0, #0
	beq	.L2
	mov	r1, r5
	mov	r0, r4
	bl	sisusb_is_inactive
	subs	r7, r0, #0
	add	r8, r5, #8
	bne	.L9
	ldm	r4, {r1, r3}
	cmp	r1, r3
	beq	.L11
	ldr	r2, [r5, #4]
	ldr	r3, [r5]
	ldr	r0, [r4, #8]
	add	r3, r3, r2
	sub	r1, r3, r1
	bl	min
	ldr	r1, [r4, #4]
	mov	r2, r0
	mov	r6, r0
	ldr	r0, [r4]
	bl	memcpy
	mov	r1, r4
	mov	r3, r7
	mov	r2, r7
	mov	r0, r5
	ldr	r9, [r4]
	bl	sisusb_haddr
	mov	r3, r6
	mov	r2, r0
	mov	r1, r9
	mov	r0, r5
	bl	sisusb_copy_memory
.L9:
	mov	r0, r8
	bl	mutex_unlock
.L2:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	mov	r0, r8
	bl	mutex_unlock
	ldr	r0, [r5, #12]
	ldr	r1, .L12
	bl	dev_dbg
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	.align	2
.L12:
	.word	.LC0
	.size	sisusbcon_switch, .-sisusbcon_switch
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
