	.file	"extr_max310x.c_max310x_set_baud.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	max310x_set_baud, @function
max310x_set_baud:
.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
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	ecx, DWORD PTR [rdi]
	mov	rbx, rdi
	mov	eax, ecx
	cdq
	idiv	esi
	cmp	eax, 7
	ja	.L2
	mov	r13d, DWORD PTR MAX310X_BRGCFG_4XMODE_BIT[rip]
	mov	ebp, 4
.L3:
	cmp	ebp, eax
	jbe	.L10
	mov	r12d, 16
	xor	edx, edx
	mov	r14d, 1
.L5:
	mov	esi, DWORD PTR MAX310X_BRGDIVMSB_REG[rip]
	mov	rdi, rbx
	imul	ebp, r12d
	call	max310x_port_write@PLT
	mov	esi, DWORD PTR MAX310X_BRGDIVLSB_REG[rip]
	mov	edx, r14d
	mov	rdi, rbx
	call	max310x_port_write@PLT
	mov	esi, DWORD PTR MAX310X_BRGCFG_REG[rip]
	mov	edx, r13d
	mov	rdi, rbx
	call	max310x_port_write@PLT
	mov	eax, DWORD PTR [rbx]
	xor	edx, edx
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	sal	eax, 4
	div	ebp
	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
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	cmp	eax, 15
	ja	.L6
	mov	r13d, DWORD PTR MAX310X_BRGCFG_2XMODE_BIT[rip]
	sal	esi, 3
	mov	r14d, 1
	mov	ebp, 8
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	xor	edx, edx
	imul	esi, ebp
	div	ebp
	mov	r14d, eax
.L4:
	mov	eax, ecx
	xor	edx, edx
	mov	r12d, r14d
	div	esi
	sal	r12d, 4
	mov	eax, edx
	xor	edx, edx
	sal	eax, 4
	div	esi
	mov	edx, r14d
	shr	edx, 8
	or	r13d, eax
	add	r12d, eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	mov	ebp, 16
	xor	r13d, r13d
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	max310x_set_baud, .-max310x_set_baud
	.comm	MAX310X_BRGDIVMSB_REG,4,4
	.comm	MAX310X_BRGDIVLSB_REG,4,4
	.comm	MAX310X_BRGCFG_REG,4,4
	.comm	MAX310X_BRGCFG_4XMODE_BIT,4,4
	.comm	MAX310X_BRGCFG_2XMODE_BIT,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_max310x.c_max310x_set_baud.c"
	.text
	.global	__aeabi_idiv
	.global	__aeabi_uidiv
	.global	__aeabi_uidivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	max310x_set_baud, %function
max310x_set_baud:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r9, [r0]
	mov	r4, r0
	mov	r0, r9
	mov	r5, r1
	bl	__aeabi_idiv
	cmp	r0, #7
	bhi	.L2
	mov	r7, #4
	ldr	r3, .L11
	ldr	r8, [r3]
.L3:
	cmp	r7, r0
	movhi	r5, #16
	movhi	r2, #0
	movhi	r6, #1
	bls	.L10
.L5:
	ldr	r3, .L11+4
	mov	r0, r4
	ldr	r1, [r3]
	bl	max310x_port_write
	ldr	r3, .L11+8
	mov	r2, r6
	ldr	r1, [r3]
	mov	r0, r4
	bl	max310x_port_write
	ldr	r3, .L11+12
	mov	r2, r8
	ldr	r1, [r3]
	mov	r0, r4
	bl	max310x_port_write
	ldr	r0, [r4]
	mul	r1, r5, r7
	lsl	r0, r0, #4
	bl	__aeabi_uidiv
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	cmp	r0, #15
	bhi	.L6
	mov	r6, #1
	mov	r7, #8
	ldr	r3, .L11+16
	lsl	r5, r5, #3
	ldr	r8, [r3]
.L4:
	mov	r1, r5
	mov	r0, r9
	bl	__aeabi_uidivmod
	mov	r0, r1
	mov	r1, r5
	lsl	r0, r0, #4
	bl	__aeabi_uidiv
	lsr	r2, r6, #8
	orr	r8, r8, r0
	add	r5, r0, r6, lsl #4
	b	.L5
.L6:
	mov	r7, #16
	mov	r8, #0
	b	.L3
.L10:
	mov	r1, r7
	bl	__aeabi_uidiv
	mul	r5, r7, r5
	mov	r6, r0
	b	.L4
.L12:
	.align	2
.L11:
	.word	MAX310X_BRGCFG_4XMODE_BIT
	.word	MAX310X_BRGDIVMSB_REG
	.word	MAX310X_BRGDIVLSB_REG
	.word	MAX310X_BRGCFG_REG
	.word	MAX310X_BRGCFG_2XMODE_BIT
	.size	max310x_set_baud, .-max310x_set_baud
	.comm	MAX310X_BRGDIVMSB_REG,4,4
	.comm	MAX310X_BRGDIVLSB_REG,4,4
	.comm	MAX310X_BRGCFG_REG,4,4
	.comm	MAX310X_BRGCFG_4XMODE_BIT,4,4
	.comm	MAX310X_BRGCFG_2XMODE_BIT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
