	.file	"extr_cpddk.c_cp_set_baud.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	cp_set_baud
	.type	cp_set_baud, @function
cp_set_baud:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	rbx, rdi
	sub	rsp, 16
	.cfi_def_cfa_offset 32
	mov	ecx, DWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	cmp	ecx, 2
	je	.L2
	cmp	ecx, 3
	je	.L85
	cmp	ecx, 6
	je	.L86
.L5:
	mov	DWORD PTR 8[rbx], esi
.L23:
.L26:
.L27:
	mov	eax, DWORD PTR 24[rbx]
	lea	edx, -7[rcx]
	mov	rdi, QWORD PTR 64[rbx]
	and	eax, -56
	mov	DWORD PTR 24[rbx], eax
	cmp	edx, 1
	jbe	.L28
	cmp	ecx, 4
	je	.L28
	mov	esi, DWORD PTR 8[rbx]
	cmp	ecx, 1
	jne	.L31
	test	esi, esi
	jne	.L87
.L31:
	mov	QWORD PTR 72[rbx], 0
	cmp	ecx, 1
	je	.L88
.L35:
	mov	edx, DWORD PTR 28[rbx]
	mov	DWORD PTR [rsp], 0
	mov	DWORD PTR 4[rsp], 0
	mov	eax, edx
	and	edx, -5
	or	eax, 4
	mov	DWORD PTR 28[rbx], eax
.L32:
.L38:
.L39:
.L40:
	mov	esi, DWORD PTR 56[rbx]
	call	l@PLT
	mov	rax, QWORD PTR 40[rbx]
	movsx	rdx, DWORD PTR 24[rbx]
	mov	esi, DWORD PTR 56[rbx]
	mov	rdi, QWORD PTR 64[rbx]
	mov	QWORD PTR 8[rax], rdx
	mov	eax, DWORD PTR 4[rsp]
	mov	rdx, QWORD PTR 40[rbx]
	sal	eax, 8
	or	eax, DWORD PTR [rsp]
	cdqe
	mov	QWORD PTR 44[rdx], rax
	mov	edx, DWORD PTR 28[rbx]
	call	l@PLT
	cmp	DWORD PTR [rbx], 1
	mov	edx, DWORD PTR 32[rbx]
	jne	.L42
	mov	eax, edx
	or	ah, 1
	cmp	QWORD PTR 48[rbx], 0
	jne	.L44
.L42:
	mov	eax, edx
	and	ah, -2
.L44:
	mov	rdx, QWORD PTR 40[rbx]
	mov	DWORD PTR 32[rbx], eax
	cdqe
	mov	QWORD PTR 12[rdx], rax
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L89
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	pop	rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L85:
	.cfi_restore_state
	cmp	QWORD PTR 96[rdi], 0
	je	.L4
.L2:
	mov	edx, DWORD PTR 4[rbx]
	and	edx, -8
	cmp	QWORD PTR 80[rbx], 0
	je	.L90
.L9:
	mov	DWORD PTR 4[rbx], edx
	mov	DWORD PTR 8[rbx], 2048000
.L12:
.L19:
.L20:
.L21:
.L22:
	mov	esi, DWORD PTR 88[rbx]
	mov	rdi, QWORD PTR 64[rbx]
	call	l@PLT
	mov	ecx, DWORD PTR [rbx]
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L28:
	mov	edx, DWORD PTR [rdi]
	or	eax, 12
	mov	DWORD PTR [rsp], 0
	mov	DWORD PTR 24[rbx], eax
	mov	DWORD PTR 8[rbx], edx
	mov	edx, DWORD PTR 28[rbx]
	mov	DWORD PTR 4[rsp], 0
	and	edx, -5
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L90:
.L8:
	endbr64
	add	esi, 32000
	movsx	rax, esi
	sar	esi, 31
	imul	rax, rax, 274877907
	sar	rax, 44
	sub	eax, esi
	sal	eax, 6
	je	.L9
	cmp	eax, 1024
	jg	.L9
	cmp	eax, 512
	jg	.L91
	cmp	eax, 256
	jg	.L92
	cmp	eax, 128
	jg	.L93
	cmp	eax, 64
	jg	.L94
	or	edx, 6
	mov	DWORD PTR 8[rbx], 64000
	mov	DWORD PTR 4[rbx], edx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	QWORD PTR 80[rdi], 0
	je	.L47
	and	DWORD PTR 24[rbx], -56
	mov	rdi, QWORD PTR 64[rbx]
	mov	DWORD PTR 8[rbx], 2048000
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L88:
	mov	QWORD PTR 48[rbx], 0
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L91:
	or	edx, 2
	mov	DWORD PTR 8[rbx], 1024000
	mov	DWORD PTR 4[rbx], edx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L87:
	cmp	QWORD PTR 72[rbx], 0
	mov	edi, DWORD PTR [rdi]
	jne	.L95
	cmp	QWORD PTR 48[rbx], 0
	je	.L36
	or	eax, 55
.L83:
	mov	DWORD PTR 24[rbx], eax
	mov	rcx, rsp
	lea	rdx, 4[rsp]
.L82:
	call	l141@PLT
	mov	edx, DWORD PTR 28[rbx]
	mov	rdi, QWORD PTR 64[rbx]
	and	edx, -5
	mov	DWORD PTR 28[rbx], edx
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L86:
	cmp	QWORD PTR 80[rdi], 0
	jne	.L5
.L47:
	mov	DWORD PTR 8[rbx], 0
	mov	rdx, QWORD PTR 16[rbx]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L25:
	bt	rdx, rax
	jnc	.L24
	add	DWORD PTR 8[rbx], 64000
.L24:
	add	eax, 1
	cmp	eax, 32
	jne	.L25
	jmp	.L27
.L92:
	or	edx, 3
	mov	DWORD PTR 8[rbx], 512000
	mov	DWORD PTR 4[rbx], edx
	jmp	.L22
.L36:
	or	eax, 48
	jmp	.L83
.L93:
	or	edx, 4
	mov	DWORD PTR 8[rbx], 256000
	mov	DWORD PTR 4[rbx], edx
	jmp	.L22
.L95:
	or	eax, 54
	test	edi, edi
	lea	rdx, 4[rsp]
	mov	rcx, rsp
	mov	DWORD PTR 24[rbx], eax
	lea	eax, 15[rdi]
	cmovs	edi, eax
	sar	edi, 4
	jmp	.L82
.L94:
	or	edx, 5
	mov	DWORD PTR 8[rbx], 128000
	mov	DWORD PTR 4[rbx], edx
	jmp	.L22
.L89:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	cp_set_baud, .-cp_set_baud
	.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_cpddk.c_cp_set_baud.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	cp_set_baud
	.syntax unified
	.arm
	.fpu softvfp
	.type	cp_set_baud, %function
cp_set_baud:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, lr}
	ldr	ip, [r0]
	ldr	r3, .L82
	sub	sp, sp, #16
	cmp	ip, #2
	mov	r4, r0
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	beq	.L2
	cmp	ip, #3
	beq	.L70
	cmp	ip, #6
	beq	.L71
.L5:
	str	r1, [r4, #8]
.L23:
.L26:
.L27:
	sub	r3, ip, #7
	cmp	ip, #4
	cmpne	r3, #1
	ldr	r3, [r4, #16]
	movhi	r1, #1
	bic	r3, r3, #55
	movls	r1, #0
	ldr	r0, [r4, #40]
	str	r3, [r4, #16]
	bhi	.L72
	ldr	ip, [r0]
	ldr	r2, [r4, #20]
	orr	r3, r3, #12
	str	r3, [r4, #16]
	str	ip, [r4, #8]
	str	r1, [sp, #4]
	str	r1, [sp, #8]
	bic	r2, r2, #4
.L31:
.L37:
.L38:
.L39:
	ldr	r1, [r4, #36]
	bl	l
	ldr	r3, [r4, #28]
	ldr	r2, [r4, #16]
	ldr	r1, [sp, #8]
	str	r2, [r3, #8]
	ldr	r3, [sp, #4]
	ldr	r2, [r4, #28]
	orr	r3, r3, r1, lsl #8
	str	r3, [r2, #44]
	ldr	r1, [r4, #36]
	ldr	r2, [r4, #20]
	ldr	r0, [r4, #40]
	bl	l
	ldr	r3, [r4]
	cmp	r3, #1
	beq	.L40
	ldr	r3, [r4, #24]
.L41:
	bic	r3, r3, #256
.L43:
	ldr	r2, [r4, #28]
	str	r3, [r4, #24]
	str	r3, [r2, #12]
	ldr	r3, .L82
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L73
	add	sp, sp, #16
	@ sp needed
	pop	{r4, pc}
.L70:
	ldr	r3, [r0, #56]
	cmp	r3, #0
	beq	.L4
.L2:
	ldr	r3, [r4, #48]
	ldr	r2, [r4, #4]
	cmp	r3, #0
	bic	r2, r2, #7
	beq	.L74
.L9:
	mov	r3, #2048000
	str	r2, [r4, #4]
	str	r3, [r4, #8]
.L12:
.L19:
.L20:
.L21:
.L22:
	ldr	r1, [r4, #52]
	ldr	r0, [r4, #40]
	bl	l
	ldr	ip, [r4]
	b	.L27
.L40:
	ldr	r2, [r4, #32]
	ldr	r3, [r4, #24]
	cmp	r2, #0
	orrne	r3, r3, #256
	bne	.L43
	b	.L41
.L72:
	sub	r2, ip, #1
	clz	r2, r2
	ldr	r1, [r4, #8]
	lsr	r2, r2, #5
	cmp	r1, #0
	moveq	r2, #0
	cmp	r2, #0
	bne	.L75
.L30:
.L34:
	mov	r3, #0
	cmp	ip, #1
	str	r3, [r4, #44]
	streq	r3, [r4, #32]
	mov	r3, #0
	ldr	r2, [r4, #20]
	str	r3, [sp, #4]
	orr	r1, r2, #4
	str	r1, [r4, #20]
	bic	r2, r2, #4
	str	r3, [sp, #8]
	b	.L39
.L74:
.L8:
	ldr	r3, .L82+4
	add	r1, r1, #32000
	smull	r0, r3, r1, r3
	asr	r1, r1, #31
	rsb	r3, r1, r3, asr #12
	lsls	r3, r3, #6
	movne	r1, #1
	moveq	r1, #0
	cmp	r3, #1024
	movgt	r1, #0
	andle	r1, r1, #1
	cmp	r1, #0
	beq	.L9
	cmp	r3, #512
	bgt	.L76
	cmp	r3, #256
	bgt	.L77
	cmp	r3, #128
	bgt	.L78
	cmp	r3, #64
	bgt	.L79
	mov	r3, #64000
	orr	r2, r2, #6
	stmib	r4, {r2, r3}
	b	.L22
.L4:
	ldr	r3, [r0, #48]
	cmp	r3, #0
	beq	.L46
	mov	r2, #2048000
	ldr	r3, [r4, #16]
	ldr	r0, [r4, #40]
	bic	r3, r3, #55
	str	r2, [r4, #8]
	str	r3, [r4, #16]
	b	.L30
.L76:
	mov	r3, #1024000
	orr	r2, r2, #2
	stmib	r4, {r2, r3}
	b	.L22
.L71:
	ldr	r3, [r0, #48]
	cmp	r3, #0
	bne	.L5
.L46:
	mov	r2, #0
	mov	r3, r2
	ldr	r1, [r4, #12]
	str	r2, [r4, #8]
.L25:
.L24:
	lsr	r2, r1, r3
	tst	r2, #1
	ldrne	r2, [r4, #8]
	add	r3, r3, #1
	addne	r2, r2, #64000
	strne	r2, [r4, #8]
	cmp	r3, #32
	bne	.L25
	b	.L27
.L75:
	ldr	r2, [r4, #44]
	ldr	r0, [r0]
	cmp	r2, #0
	bne	.L80
	ldr	r2, [r4, #32]
	cmp	r2, #0
	orreq	r3, r3, #48
	bne	.L81
.L68:
	str	r3, [r4, #16]
.L67:
	add	r2, sp, #8
	add	r3, sp, #4
	bl	l141
	ldr	r2, [r4, #20]
	ldr	r0, [r4, #40]
	bic	r2, r2, #4
	str	r2, [r4, #20]
	b	.L39
.L77:
	mov	r3, #512000
	orr	r2, r2, #3
	stmib	r4, {r2, r3}
	b	.L22
.L81:
	orr	r3, r3, #55
	b	.L68
.L78:
	mov	r3, #256000
	orr	r2, r2, #4
	stmib	r4, {r2, r3}
	b	.L22
.L80:
	add	r2, r0, #15
	cmp	r0, #0
	movlt	r0, r2
	orr	r3, r3, #54
	str	r3, [r4, #16]
	asr	r0, r0, #4
	b	.L67
.L79:
	mov	r3, #128000
	orr	r2, r2, #5
	stmib	r4, {r2, r3}
	b	.L22
.L73:
	bl	__stack_chk_fail
.L83:
	.align	2
.L82:
	.word	.LC0
	.word	274877907
	.size	cp_set_baud, .-cp_set_baud
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
