	.file	"extr_serial_core.c_uart_do_autoconfig.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	uart_do_autoconfig, @function
uart_do_autoconfig:
.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
	mov	rbp, rdi
	mov	r13, QWORD PTR 8[rdi]
	mov	edi, DWORD PTR CAP_SYS_ADMIN[rip]
	call	capable@PLT
	test	eax, eax
	jne	.L2
	mov	r12d, DWORD PTR EPERM[rip]
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdi, rbp
	call	mutex_lock_interruptible@PLT
	test	rax, rax
	je	.L4
	mov	r12d, DWORD PTR ERESTARTSYS[rip]
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	r12d, DWORD PTR EBUSY[rip]
	mov	rdi, rbp
	neg	r12d
	call	tty_port_users@PLT
	cmp	eax, 1
	je	.L13
.L5:
	mov	rdi, rbp
	call	mutex_unlock@PLT
	mov	eax, r12d
	pop	rbp
	.cfi_remember_state
	.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
.L13:
	.cfi_restore_state
	mov	rdi, rbp
	call	uart_shutdown@PLT
	mov	rax, QWORD PTR PORT_UNKNOWN[rip]
	cmp	QWORD PTR 0[r13], rax
	je	.L6
	mov	rax, QWORD PTR 16[r13]
	mov	rdi, r13
	call	[QWORD PTR 8[rax]]
.L6:
	mov	esi, DWORD PTR UART_CONFIG_TYPE[rip]
	mov	eax, DWORD PTR 8[r13]
	test	DWORD PTR UPF_AUTO_IRQ[rip], eax
	je	.L7
	or	esi, DWORD PTR UART_CONFIG_IRQ[rip]
.L7:
	mov	rax, QWORD PTR 16[r13]
	mov	rdi, r13
	call	[QWORD PTR [rax]]
	mov	esi, 1
	mov	rdi, rbp
	call	uart_startup@PLT
	mov	r12d, eax
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	uart_do_autoconfig, .-uart_do_autoconfig
	.comm	UPF_AUTO_IRQ,4,4
	.comm	UART_CONFIG_TYPE,4,4
	.comm	UART_CONFIG_IRQ,4,4
	.comm	PORT_UNKNOWN,8,8
	.comm	ERESTARTSYS,4,4
	.comm	EPERM,4,4
	.comm	EBUSY,4,4
	.comm	CAP_SYS_ADMIN,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_serial_core.c_uart_do_autoconfig.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	uart_do_autoconfig, %function
uart_do_autoconfig:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L14
	push	{r4, r5, r6, lr}
	ldr	r6, [r0, #4]
	mov	r4, r0
	ldr	r0, [r3]
	bl	capable
	cmp	r0, #0
	bne	.L2
	ldr	r3, .L14+4
	ldr	r5, [r3]
	rsb	r5, r5, #0
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L2:
	mov	r0, r4
	bl	mutex_lock_interruptible
	cmp	r0, #0
	beq	.L4
	ldr	r3, .L14+8
	ldr	r5, [r3]
	rsb	r5, r5, #0
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L4:
	ldr	r3, .L14+12
	mov	r0, r4
	ldr	r5, [r3]
	bl	tty_port_users
	cmp	r0, #1
	rsb	r5, r5, #0
	beq	.L13
.L5:
	mov	r0, r4
	bl	mutex_unlock
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L13:
	mov	r0, r4
	bl	uart_shutdown
	ldr	r3, .L14+16
	ldr	r2, [r6]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L6
	ldr	r3, [r6, #8]
	mov	r0, r6
	ldr	r3, [r3, #4]
	blx	r3
.L6:
	ldr	r3, .L14+20
	ldr	r1, [r6, #4]
	ldr	r2, [r3]
	ldr	r3, .L14+24
	tst	r1, r2
	ldr	r1, [r3]
	ldrne	r3, .L14+28
	mov	r0, r6
	ldrne	r3, [r3]
	orrne	r1, r1, r3
	ldr	r3, [r6, #8]
	ldr	r3, [r3]
	blx	r3
	mov	r1, #1
	mov	r0, r4
	bl	uart_startup
	mov	r5, r0
	b	.L5
.L15:
	.align	2
.L14:
	.word	CAP_SYS_ADMIN
	.word	EPERM
	.word	ERESTARTSYS
	.word	EBUSY
	.word	PORT_UNKNOWN
	.word	UPF_AUTO_IRQ
	.word	UART_CONFIG_TYPE
	.word	UART_CONFIG_IRQ
	.size	uart_do_autoconfig, .-uart_do_autoconfig
	.comm	UPF_AUTO_IRQ,4,4
	.comm	UART_CONFIG_TYPE,4,4
	.comm	UART_CONFIG_IRQ,4,4
	.comm	PORT_UNKNOWN,4,4
	.comm	ERESTARTSYS,4,4
	.comm	EPERM,4,4
	.comm	EBUSY,4,4
	.comm	CAP_SYS_ADMIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
