	.file	"extr_pci_virtio_console.c_pci_vtcon_control_tx.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	pci_vtcon_control_tx, @function
pci_vtcon_control_tx:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	xor	edi, edi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdx
	sub	rsp, 32
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	cmp	ecx, 1
	sete	dil
	call	assert@PLT
	mov	rdx, QWORD PTR [rbx]
	mov	r12, QWORD PTR 16[rbp]
	mov	eax, DWORD PTR [rdx]
	cmp	eax, 128
	je	.L2
	cmp	eax, 129
	jne	.L1
	mov	r8d, DWORD PTR VTCON_MAXPORTS[rip]
	mov	DWORD PTR [r12], 1
	xor	ebx, ebx
	test	r8d, r8d
	jg	.L4
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L17
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	rdi, rbp
	call	pci_vtcon_announce_port@PLT
	mov	esi, DWORD PTR 4[rbp]
	test	esi, esi
	jne	.L18
.L6:
	add	rbx, 1
	cmp	DWORD PTR VTCON_MAXPORTS[rip], ebx
	jle	.L1
.L4:
	mov	rdx, QWORD PTR 16[r12]
	lea	rax, [rbx+rbx*2]
	lea	rbp, [rdx+rax*8]
	mov	edi, DWORD PTR 8[rbp]
	test	edi, edi
	jne	.L19
	mov	esi, DWORD PTR 4[rbp]
	test	esi, esi
	je	.L6
.L18:
	mov	esi, 1
	mov	rdi, rbp
	call	pci_vtcon_open_port@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rdi, QWORD PTR 8[rdx]
	cmp	rdi, QWORD PTR 8[r12]
	jnb	.L20
	mov	rdx, QWORD PTR 16[r12]
	lea	rax, [rdi+rdi*2]
	lea	rax, [rdx+rax*8]
	mov	ecx, DWORD PTR [rax]
	test	ecx, ecx
	je	.L1
	mov	eax, DWORD PTR VTCON_CONSOLE_PORT[rip]
	mov	QWORD PTR 8[rsp], rdi
	mov	rsi, rsp
	xor	ecx, ecx
	xor	edx, edx
	mov	rdi, r12
	mov	DWORD PTR 16[rsp], 1
	mov	DWORD PTR [rsp], eax
	call	pci_vtcon_control_send@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	call	WPRINTF@PLT
	jmp	.L1
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pci_vtcon_control_tx, .-pci_vtcon_control_tx
	.comm	VTCON_MAXPORTS,4,4
	.comm	VTCON_CONSOLE_PORT,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_pci_virtio_console.c_pci_vtcon_control_tx.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pci_vtcon_control_tx, %function
pci_vtcon_control_tx:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r4, r0
	sub	r0, r3, #1
	clz	r0, r0
	mov	r5, r2
	ldr	r3, .L27
	sub	sp, sp, #20
	lsr	r0, r0, #5
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	assert
	ldr	r2, [r5]
	ldr	r6, [r4, #12]
	ldr	r3, [r2]
	cmp	r3, #128
	beq	.L2
	cmp	r3, #129
	bne	.L1
	mov	r3, #1
	ldr	r7, .L27+4
	str	r3, [r6]
	ldr	r3, [r7]
	cmp	r3, #0
	ble	.L1
	mov	r5, #0
	b	.L4
.L5:
	ldr	r3, [r4, #4]
	cmp	r3, #0
	bne	.L24
.L6:
	ldr	r3, [r7]
	add	r5, r5, #1
	cmp	r3, r5
	ble	.L1
.L4:
	ldr	r4, [r6, #8]
	add	r4, r4, r5, lsl #4
	ldr	r3, [r4, #8]
	cmp	r3, #0
	beq	.L5
	mov	r0, r4
	bl	pci_vtcon_announce_port
	ldr	r3, [r4, #4]
	cmp	r3, #0
	beq	.L6
.L24:
	mov	r0, r4
	mov	r1, #1
	bl	pci_vtcon_open_port
	ldr	r3, [r7]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L4
.L1:
	ldr	r3, .L27
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L25
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L2:
	ldr	r1, [r2, #4]
	ldr	r3, [r6, #4]
	cmp	r1, r3
	bcs	.L26
	ldr	r3, [r6, #8]
	ldr	r3, [r3, r1, lsl #4]
	cmp	r3, #0
	beq	.L1
	mov	r3, #0
	mov	ip, #1
	ldr	r2, .L27+8
	str	r1, [sp, #4]
	ldr	lr, [r2]
	mov	r0, r6
	mov	r2, r3
	mov	r1, sp
	str	lr, [sp]
	str	ip, [sp, #8]
	bl	pci_vtcon_control_send
	b	.L1
.L26:
	mov	r0, r1
	bl	WPRINTF
	b	.L1
.L25:
	bl	__stack_chk_fail
.L28:
	.align	2
.L27:
	.word	.LC0
	.word	VTCON_MAXPORTS
	.word	VTCON_CONSOLE_PORT
	.size	pci_vtcon_control_tx, .-pci_vtcon_control_tx
	.comm	VTCON_MAXPORTS,4,4
	.comm	VTCON_CONSOLE_PORT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
