// File: /workspace/github_c_makefile_star2_O1/anachronic[P]st/st.c
// Function: selnormalize
void
selnormalize(void)
{
	int i;

	if (sel.type == SEL_REGULAR && sel.ob.y != sel.oe.y) {
		sel.nb.x = sel.ob.y < sel.oe.y ? sel.ob.x : sel.oe.x;
		sel.ne.x = sel.ob.y < sel.oe.y ? sel.oe.x : sel.ob.x;
	} else {
		sel.nb.x = MIN(sel.ob.x, sel.oe.x);
		sel.ne.x = MAX(sel.ob.x, sel.oe.x);
	}
	sel.nb.y = MIN(sel.ob.y, sel.oe.y);
	sel.ne.y = MAX(sel.ob.y, sel.oe.y);

	selsnap(&sel.nb.x, &sel.nb.y, -1);
	selsnap(&sel.ne.x, &sel.ne.y, +1);

	/* expand selection over line breaks */
	if (sel.type == SEL_RECTANGULAR)
		return;

  i = tlinelen(TLINE(sel.nb.y));
	if (sel.nb.x > i)
		sel.nb.x = i;
  if (sel.ne.x >= tlinelen(TLINE(sel.ne.y)))
    sel.ne.x = term.col - 1;
}

// Assembly:
cmpl $0x1, 0x12697(%rip)     # 0x188c4
jne 0x623d
movl 0x126b3(%rip), %eax     # 0x188e8
cmpl %eax, 0x126a5(%rip)     # 0x188e0
jne 0x625b
movl 0x12699(%rip), %ecx     # 0x188dc
movl 0x1269b(%rip), %eax     # 0x188e4
cmpl %eax, %ecx
movl %eax, %edx
cmovll %ecx, %edx
movl %edx, 0x12676(%rip)     # 0x188cc
cmovgl %ecx, %eax
jmp 0x6275
movl 0x1267b(%rip), %eax     # 0x188dc
movl 0x1267d(%rip), %ecx     # 0x188e4
movl %ecx, %edx
cmovll %eax, %edx
movl %edx, 0x1265a(%rip)     # 0x188cc
cmovll %ecx, %eax
pushq %r14
pushq %rbx
pushq %rax
movl %eax, 0x12655(%rip)     # 0x188d4
leaq 0x1264e(%rip), %rbx     # 0x188d4
movl 0x12654(%rip), %eax     # 0x188e0
movl 0x12656(%rip), %ecx     # 0x188e8
cmpl %ecx, %eax
movl %ecx, %edx
cmovll %eax, %edx
movl %edx, 0x12631(%rip)     # 0x188d0
leaq 0x1262a(%rip), %rsi     # 0x188d0
cmovgl %eax, %ecx
movl %ecx, 0x12629(%rip)     # 0x188d8
leaq 0x12622(%rip), %r14     # 0x188d8
leaq 0x1260f(%rip), %rdi     # 0x188cc
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x89d2
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x89d2
cmpl $0x2, 0x125e6(%rip)     # 0x188c4
je 0x6423
movl 0x125e6(%rip), %eax     # 0x188d0
movl 0x16498(%rip), %esi     # 0x1c788
leaq 0x125f9(%rip), %rcx     # 0x188f0
subl %esi, %eax
jge 0x6332
movl 0x1647f(%rip), %edx     # 0x1c780
addl %edx, %eax
addl $0x7d1, %eax            # imm = 0x7D1
cltq
imulq $0x10624dd3, %rax, %rdx # imm = 0x10624DD3
movq %rdx, %rdi
shrq $0x3f, %rdi
sarq $0x27, %rdx
addl %edi, %edx
imull $0x7d0, %edx, %edx      # imm = 0x7D0
subl %edx, %eax
cltq
leaq (%rcx,%rax,8), %rax
addq $0x10, %rax
jmp 0x633f
cltq
shlq $0x3, %rax
addq 0x125b9(%rip), %rax     # 0x188f8
movq (%rax), %r8
movl 0x125ac(%rip), %eax     # 0x188f4
movl %eax, %edx
sarl $0x1f, %edx
andl %eax, %edx
movq %rax, %rdi
shlq $0x4, %rdi
leaq (%rdi,%r8), %r9
addq $-0xc, %r9
movl %eax, %r8d
testl %r8d, %r8d
jle 0x637f
movzwl (%r9), %r10d
addq $-0x10, %r9
decl %r8d
testl $0x201, %r10d           # imm = 0x201
je 0x6361
incl %r8d
jmp 0x6382
movl %edx, %r8d
cmpl %r8d, 0x12543(%rip)     # 0x188cc
jle 0x6392
movl %r8d, 0x1253a(%rip)     # 0x188cc
movl 0x1253f(%rip), %r8d     # 0x188d8
subl %esi, %r8d
jge 0x63dc
movl 0x163dc(%rip), %esi     # 0x1c780
addl %r8d, %esi
addl $0x7d1, %esi            # imm = 0x7D1
movslq %esi, %rsi
imulq $0x10624dd3, %rsi, %r8  # imm = 0x10624DD3
movq %r8, %r9
shrq $0x3f, %r9
sarq $0x27, %r8
addl %r9d, %r8d
imull $0x7d0, %r8d, %r8d      # imm = 0x7D0
subl %r8d, %esi
movslq %esi, %rsi
leaq (%rcx,%rsi,8), %rsi
addq $0x10, %rsi
jmp 0x63ea
movslq %r8d, %rsi
shlq $0x3, %rsi
addq 0x1250e(%rip), %rsi     # 0x188f8
movl 0x124e4(%rip), %ecx     # 0x188d4
movq (%rsi), %rsi
addq %rsi, %rdi
addq $-0xc, %rdi
movl %eax, %esi
testl %esi, %esi
jle 0x6417
movzwl (%rdi), %r8d
addq $-0x10, %rdi
decl %esi
testl $0x201, %r8d            # imm = 0x201
je 0x63fc
incl %esi
movl %esi, %edx
cmpl %edx, %ecx
jl 0x6423
decl %eax
movl %eax, 0x124b1(%rip)     # 0x188d4
addq $0x8, %rsp
popq %rbx
popq %r14
retq