	.file	"extr_8250_omap.c_omap_8250_get_divisor.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	omap_8250_get_divisor, @function
omap_8250_get_divisor:
.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
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	ebp, DWORD PTR [rdi]
	cmp	esi, 38400
	jne	.L2
	mov	eax, DWORD PTR 4[rdi]
	and	eax, DWORD PTR UPF_SPD_MASK[rip]
	cmp	eax, DWORD PTR UPF_SPD_CUST[rip]
	je	.L8
.L2:
	lea	eax, [rbx+rbx*2]
	mov	edi, ebp
	lea	esi, [rbx+rax*4]
	call	DIV_ROUND_CLOSEST@PLT
	mov	esi, ebx
	mov	edi, ebp
	mov	r13d, eax
	sal	esi, 4
	call	DIV_ROUND_CLOSEST@PLT
	mov	esi, 1
	test	r13d, r13d
	mov	ecx, r13d
	cmove	ecx, esi
	test	eax, eax
	mov	edi, ebx
	cmovne	esi, eax
	mov	eax, ebp
	xor	edx, edx
	imul	rax, rax, 1321528399
	shr	rax, 34
	div	ecx
	xor	edx, edx
	sub	edi, eax
	mov	eax, ebp
	shr	eax, 4
	div	esi
	sub	ebx, eax
	cmp	edi, ebx
	jnb	.L9
	mov	rax, QWORD PTR UART_OMAP_MDR1_13X_MODE[rip]
	mov	DWORD PTR [r12], ecx
	mov	QWORD PTR 8[r12], rax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L9:
	.cfi_restore_state
	mov	rax, QWORD PTR UART_OMAP_MDR1_16X_MODE[rip]
	mov	DWORD PTR [r12], esi
	mov	QWORD PTR 8[r12], rax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L8:
	.cfi_restore_state
	mov	eax, DWORD PTR 8[rdi]
	mov	edx, DWORD PTR UART_DIV_MAX[rip]
	and	edx, eax
	mov	DWORD PTR [r12], edx
	test	eax, 65536
	je	.L3
	mov	rax, QWORD PTR UART_OMAP_MDR1_13X_MODE[rip]
	mov	QWORD PTR 8[r12], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rax, QWORD PTR UART_OMAP_MDR1_16X_MODE[rip]
	mov	QWORD PTR 8[r12], rax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	omap_8250_get_divisor, .-omap_8250_get_divisor
	.comm	UPF_SPD_MASK,4,4
	.comm	UPF_SPD_CUST,4,4
	.comm	UART_OMAP_MDR1_16X_MODE,8,8
	.comm	UART_OMAP_MDR1_13X_MODE,8,8
	.comm	UART_DIV_MAX,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_8250_omap.c_omap_8250_get_divisor.c"
	.text
	.global	__aeabi_uidiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	omap_8250_get_divisor, %function
omap_8250_get_divisor:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	cmp	r1, #38400
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r1
	mov	r6, r2
	ldr	r8, [r0]
	bne	.L2
	ldr	r3, .L9
	ldr	r2, .L9+4
	ldr	r1, [r3]
	ldr	r3, [r0, #4]
	ldr	r2, [r2]
	and	r3, r3, r1
	cmp	r3, r2
	beq	.L8
.L2:
	add	r1, r4, r4, lsl #1
	add	r1, r4, r1, lsl #2
	mov	r0, r8
	bl	DIV_ROUND_CLOSEST
	mov	r5, r0
	lsl	r1, r4, #4
	mov	r0, r8
	bl	DIV_ROUND_CLOSEST
	cmp	r5, #1
	movcc	r5, #1
	ldr	r3, .L9+8
	cmp	r0, #1
	umull	r2, r3, r8, r3
	movcs	r7, r0
	mov	r1, r5
	lsr	r0, r3, #2
	movcc	r7, #1
	bl	__aeabi_uidiv
	mov	r3, r0
	mov	r1, r7
	lsr	r0, r8, #4
	sub	r8, r4, r3
	bl	__aeabi_uidiv
	sub	r4, r4, r0
	cmp	r8, r4
	ldrcs	r3, .L9+12
	ldrcc	r3, .L9+16
	ldrcs	r3, [r3]
	ldrcc	r3, [r3]
	strcs	r7, [r6]
	strcc	r5, [r6]
	str	r3, [r6, #4]
	pop	{r4, r5, r6, r7, r8, pc}
.L8:
	ldr	r3, .L9+20
	ldr	r2, [r0, #8]
	ldr	r3, [r3]
	tst	r2, #65536
	and	r3, r3, r2
	str	r3, [r6]
	ldrne	r3, .L9+16
	ldreq	r3, .L9+12
	ldr	r3, [r3]
	str	r3, [r6, #4]
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	.align	2
.L9:
	.word	UPF_SPD_MASK
	.word	UPF_SPD_CUST
	.word	1321528399
	.word	UART_OMAP_MDR1_16X_MODE
	.word	UART_OMAP_MDR1_13X_MODE
	.word	UART_DIV_MAX
	.size	omap_8250_get_divisor, .-omap_8250_get_divisor
	.comm	UPF_SPD_MASK,4,4
	.comm	UPF_SPD_CUST,4,4
	.comm	UART_OMAP_MDR1_16X_MODE,4,4
	.comm	UART_OMAP_MDR1_13X_MODE,4,4
	.comm	UART_DIV_MAX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
