\hypertarget{qdivrem_8c_source}{}\doxysection{qdivrem.\+c}
\label{qdivrem_8c_source}\index{libkern/qdivrem.c@{libkern/qdivrem.c}}
\mbox{\hyperlink{qdivrem_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/3-\/Clause}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 1992, 1993}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00005}00005 \textcolor{comment}{ *      The Regents of the University of California.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00007}00007 \textcolor{comment}{ * This software was developed by the Computer Systems Engineering group}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00008}00008 \textcolor{comment}{ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-\/66 and}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00009}00009 \textcolor{comment}{ * contributed to Berkeley.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00011}00011 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00012}00012 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00013}00013 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00014}00014 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00015}00015 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00016}00016 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00017}00017 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00018}00018 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00019}00019 \textcolor{comment}{ * 3. Neither the name of the University nor the names of its contributors}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00020}00020 \textcolor{comment}{ *    may be used to endorse or promote products derived from this software}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00021}00021 \textcolor{comment}{ *    without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00022}00022 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00023}00023 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00024}00024 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00025}00025 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00026}00026 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00027}00027 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00028}00028 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00029}00029 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00030}00030 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00031}00031 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00032}00032 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00033}00033 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00034}00034 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00037}\mbox{\hyperlink{qdivrem_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00037}} \mbox{\hyperlink{qdivrem_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00039}00039 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00040}00040 \textcolor{comment}{ * Multiprecision divide.  This algorithm is from Knuth vol. 2 (2nd ed),}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00041}00041 \textcolor{comment}{ * section 4.3.1, pp. 257-\/-\/259.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00042}00042 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{quad_8h}{libkern/quad.h}}>}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00045}00045 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00046}\mbox{\hyperlink{qdivrem_8c_a111da81ae5883147168bbb8366377b10}{00046}} \textcolor{preprocessor}{\#define B       (1 << HALF\_BITS)        }\textcolor{comment}{/* digit base */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00048}00048 \textcolor{comment}{/* Combine two `digits' to make a single two-\/digit number. */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00049}\mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{00049}} \textcolor{preprocessor}{\#define COMBINE(a, b) (((u\_long)(a) << HALF\_BITS) | (b))}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00051}00051 \textcolor{comment}{/* select a type for digits in base B: use unsigned short if they fit */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00052}00052 \textcolor{preprocessor}{\#if ULONG\_MAX == 0xffffffff \&\& USHRT\_MAX >= 0xffff}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00053}00053 \textcolor{keyword}{typedef} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{qdivrem_8c_a1ccdbb05e74a54e497614b31914b6ca1}{digit}};}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00054}00054 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00055}\mbox{\hyperlink{qdivrem_8c_a1ccdbb05e74a54e497614b31914b6ca1}{00055}} \textcolor{keyword}{typedef} u\_long \mbox{\hyperlink{qdivrem_8c_a1ccdbb05e74a54e497614b31914b6ca1}{digit}};}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00056}00056 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00058}00058 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00059}00059 \textcolor{comment}{ * Shift p[0]..p[len] left `sh' bits, ignoring any bits that}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00060}00060 \textcolor{comment}{ * `fall out' the left (there never will be any such anyway).}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00061}00061 \textcolor{comment}{ * We may assume len >= 0.  NOTE THAT THIS WRITES len+1 DIGITS.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00062}00062 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00063}00063 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00064}\mbox{\hyperlink{qdivrem_8c_a47d14a07088f1fc61f509f88e04a77ce}{00064}} \mbox{\hyperlink{qdivrem_8c_a47d14a07088f1fc61f509f88e04a77ce}{\_\_shl}}(\mbox{\hyperlink{qdivrem_8c_a1ccdbb05e74a54e497614b31914b6ca1}{digit}} *p, \textcolor{keywordtype}{int} len, \textcolor{keywordtype}{int} sh)}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00065}00065 \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00066}00066         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00068}00068         \textcolor{keywordflow}{for} (i = 0; i < len; i++)}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00069}00069                 p[i] = \mbox{\hyperlink{quad_8h_adf04943239a977f38017d6bbf53a4b36}{LHALF}}(p[i] << sh) | (p[i + 1] >> (\mbox{\hyperlink{quad_8h_a652f8dfd5ad718480293127346c8110f}{HALF\_BITS}} -\/ sh));}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00070}00070         p[i] = \mbox{\hyperlink{quad_8h_adf04943239a977f38017d6bbf53a4b36}{LHALF}}(p[i] << sh);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00071}00071 \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00073}00073 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00074}00074 \textcolor{comment}{ * \_\_qdivrem(u, v, rem) returns u/v and, optionally, sets *rem to u\%v.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00075}00075 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00076}00076 \textcolor{comment}{ * We do this in base 2-\/sup-\/HALF\_BITS, so that all intermediate products}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00077}00077 \textcolor{comment}{ * fit within u\_long.  As a consequence, the maximum length dividend and}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00078}00078 \textcolor{comment}{ * divisor are 4 `digits' in this base (they are shorter if they have}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00079}00079 \textcolor{comment}{ * leading zeros).}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00080}00080 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00081}00081 u\_quad\_t}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00082}\mbox{\hyperlink{qdivrem_8c_a19096e3df18062999062c914a569c7d6}{00082}} \mbox{\hyperlink{qdivrem_8c_a19096e3df18062999062c914a569c7d6}{\_\_qdivrem}}(u\_quad\_t uq, u\_quad\_t vq, u\_quad\_t *arq)}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00083}00083 \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00084}00084         \textcolor{keyword}{union }\mbox{\hyperlink{unionuu}{uu}} tmp;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00085}00085         \mbox{\hyperlink{qdivrem_8c_a1ccdbb05e74a54e497614b31914b6ca1}{digit}} *u, *v, *\mbox{\hyperlink{unionuu_a3ce40dca10fdac763f032c2062fcb310}{q}};}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00086}00086         \mbox{\hyperlink{qdivrem_8c_a1ccdbb05e74a54e497614b31914b6ca1}{digit}} \mbox{\hyperlink{muldi3_8c_ae6c3ee9933cc50ea02782419401e84f0}{v1}}, v2;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00087}00087         u\_long qhat, rhat, t;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00088}00088         \textcolor{keywordtype}{int} m, n, d, j, i;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00089}00089         \mbox{\hyperlink{qdivrem_8c_a1ccdbb05e74a54e497614b31914b6ca1}{digit}} uspace[5], vspace[5], qspace[5];}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00091}00091         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00092}00092 \textcolor{comment}{         * Take care of special cases: divide by zero, and u < v.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00093}00093 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00094}00094         \textcolor{keywordflow}{if} (vq == 0) \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00095}00095                 \textcolor{comment}{/* divide by zero. */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00096}00096                 \textcolor{keyword}{static} \textcolor{keyword}{volatile} \textcolor{keyword}{const} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} zero = 0;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00097}00097 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00098}00098                 tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_abec92cc72a096640b821b8cd56a02495}{H}}] = tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_aa73214aa5f2f94f63d90bb4e3d99fe53}{L}}] = 1 / zero;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00099}00099                 \textcolor{keywordflow}{if} (arq)}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00100}00100                         *arq = \mbox{\hyperlink{unionuu_a1acb113b0a5af8871b5634516981d300}{uq}};}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00101}00101                 \textcolor{keywordflow}{return} (tmp.\mbox{\hyperlink{unionuu_a3ce40dca10fdac763f032c2062fcb310}{q}});}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00102}00102         \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00103}00103         \textcolor{keywordflow}{if} (\mbox{\hyperlink{unionuu_a1acb113b0a5af8871b5634516981d300}{uq}} < vq) \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00104}00104                 \textcolor{keywordflow}{if} (arq)}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00105}00105                         *arq = \mbox{\hyperlink{unionuu_a1acb113b0a5af8871b5634516981d300}{uq}};}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00106}00106                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00107}00107         \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00108}00108         u = \&uspace[0];}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00109}00109         v = \&vspace[0];}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00110}00110         \mbox{\hyperlink{unionuu_a3ce40dca10fdac763f032c2062fcb310}{q}} = \&qspace[0];}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00111}00111 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00112}00112         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00113}00113 \textcolor{comment}{         * Break dividend and divisor into digits in base B, then}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00114}00114 \textcolor{comment}{         * count leading zeros to determine m and n.  When done, we}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00115}00115 \textcolor{comment}{         * will have:}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00116}00116 \textcolor{comment}{         *      u = (u[1]u[2]...u[m+n]) sub B}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00117}00117 \textcolor{comment}{         *      v = (v[1]v[2]...v[n]) sub B}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00118}00118 \textcolor{comment}{         *      v[1] != 0}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00119}00119 \textcolor{comment}{         *      1 < n <= 4 (if n = 1, we use a different division algorithm)}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00120}00120 \textcolor{comment}{         *      m >= 0 (otherwise u < v, which we already checked)}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00121}00121 \textcolor{comment}{         *      m + n = 4}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00122}00122 \textcolor{comment}{         * and thus}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00123}00123 \textcolor{comment}{         *      m = 4 -\/ n <= 2}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00124}00124 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00125}00125         tmp.\mbox{\hyperlink{unionuu_a1acb113b0a5af8871b5634516981d300}{uq}} = \mbox{\hyperlink{unionuu_a1acb113b0a5af8871b5634516981d300}{uq}};}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00126}00126         u[0] = 0;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00127}00127         u[1] = \mbox{\hyperlink{quad_8h_a92c7de42051862b2d44e2f0ccd9ca475}{HHALF}}(tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_abec92cc72a096640b821b8cd56a02495}{H}}]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00128}00128         u[2] = \mbox{\hyperlink{quad_8h_adf04943239a977f38017d6bbf53a4b36}{LHALF}}(tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_abec92cc72a096640b821b8cd56a02495}{H}}]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00129}00129         u[3] = \mbox{\hyperlink{quad_8h_a92c7de42051862b2d44e2f0ccd9ca475}{HHALF}}(tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_aa73214aa5f2f94f63d90bb4e3d99fe53}{L}}]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00130}00130         u[4] = \mbox{\hyperlink{quad_8h_adf04943239a977f38017d6bbf53a4b36}{LHALF}}(tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_aa73214aa5f2f94f63d90bb4e3d99fe53}{L}}]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00131}00131         tmp.\mbox{\hyperlink{unionuu_a1acb113b0a5af8871b5634516981d300}{uq}} = vq;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00132}00132         v[1] = \mbox{\hyperlink{quad_8h_a92c7de42051862b2d44e2f0ccd9ca475}{HHALF}}(tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_abec92cc72a096640b821b8cd56a02495}{H}}]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00133}00133         v[2] = \mbox{\hyperlink{quad_8h_adf04943239a977f38017d6bbf53a4b36}{LHALF}}(tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_abec92cc72a096640b821b8cd56a02495}{H}}]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00134}00134         v[3] = \mbox{\hyperlink{quad_8h_a92c7de42051862b2d44e2f0ccd9ca475}{HHALF}}(tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_aa73214aa5f2f94f63d90bb4e3d99fe53}{L}}]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00135}00135         v[4] = \mbox{\hyperlink{quad_8h_adf04943239a977f38017d6bbf53a4b36}{LHALF}}(tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_aa73214aa5f2f94f63d90bb4e3d99fe53}{L}}]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00136}00136         \textcolor{keywordflow}{for} (n = 4; v[1] == 0; v++) \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00137}00137                 \textcolor{keywordflow}{if} (-\/-\/n == 1) \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00138}00138                         u\_long rbj;     \textcolor{comment}{/* r*B+u[j] (not root boy jim) */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00139}00139                         \mbox{\hyperlink{qdivrem_8c_a1ccdbb05e74a54e497614b31914b6ca1}{digit}} q1, q2, q3, q4;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00141}00141                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00142}00142 \textcolor{comment}{                         * Change of plan, per exercise 16.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00143}00143 \textcolor{comment}{                         *      r = 0;}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00144}00144 \textcolor{comment}{                         *      for j = 1..4:}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00145}00145 \textcolor{comment}{                         *              q[j] = floor((r*B + u[j]) / v),}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00146}00146 \textcolor{comment}{                         *              r = (r*B + u[j]) \% v;}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00147}00147 \textcolor{comment}{                         * We unroll this completely here.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00148}00148 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00149}00149                         t = v[2];       \textcolor{comment}{/* nonzero, by definition */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00150}00150                         q1 = u[1] / t;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00151}00151                         rbj = \mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{COMBINE}}(u[1] \% t, u[2]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00152}00152                         q2 = rbj / t;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00153}00153                         rbj = \mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{COMBINE}}(rbj \% t, u[3]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00154}00154                         q3 = rbj / t;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00155}00155                         rbj = \mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{COMBINE}}(rbj \% t, u[4]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00156}00156                         q4 = rbj / t;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00157}00157                         \textcolor{keywordflow}{if} (arq)}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00158}00158                                 *arq = rbj \% t;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00159}00159                         tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_abec92cc72a096640b821b8cd56a02495}{H}}] = \mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{COMBINE}}(q1, q2);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00160}00160                         tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_aa73214aa5f2f94f63d90bb4e3d99fe53}{L}}] = \mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{COMBINE}}(q3, q4);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00161}00161                         \textcolor{keywordflow}{return} (tmp.\mbox{\hyperlink{unionuu_a3ce40dca10fdac763f032c2062fcb310}{q}});}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00162}00162                 \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00163}00163         \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00164}00164 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00165}00165         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00166}00166 \textcolor{comment}{         * By adjusting q once we determine m, we can guarantee that}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00167}00167 \textcolor{comment}{         * there is a complete four-\/digit quotient at \&qspace[1] when}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00168}00168 \textcolor{comment}{         * we finally stop.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00169}00169 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00170}00170         \textcolor{keywordflow}{for} (m = 4 -\/ n; u[1] == 0; u++)}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00171}00171                 m-\/-\/;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00172}00172         \textcolor{keywordflow}{for} (i = 4 -\/ m; -\/-\/i >= 0;)}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00173}00173                 \mbox{\hyperlink{unionuu_a3ce40dca10fdac763f032c2062fcb310}{q}}[i] = 0;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00174}00174         \mbox{\hyperlink{unionuu_a3ce40dca10fdac763f032c2062fcb310}{q}} += 4 -\/ m;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00175}00175 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00176}00176         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00177}00177 \textcolor{comment}{         * Here we run Program D, translated from MIX to C and acquiring}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00178}00178 \textcolor{comment}{         * a few minor changes.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00179}00179 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00180}00180 \textcolor{comment}{         * D1: choose multiplier 1 << d to ensure v[1] >= B/2.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00181}00181 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00182}00182         d = 0;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00183}00183         \textcolor{keywordflow}{for} (t = v[1]; t < \mbox{\hyperlink{qdivrem_8c_a111da81ae5883147168bbb8366377b10}{B}} / 2; t <<= 1)}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00184}00184                 d++;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00185}00185         \textcolor{keywordflow}{if} (d > 0) \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00186}00186                 \mbox{\hyperlink{qdivrem_8c_a47d14a07088f1fc61f509f88e04a77ce}{\_\_shl}}(\&u[0], m + n, d);            \textcolor{comment}{/* u <<= d */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00187}00187                 \mbox{\hyperlink{qdivrem_8c_a47d14a07088f1fc61f509f88e04a77ce}{\_\_shl}}(\&v[1], n -\/ 1, d);            \textcolor{comment}{/* v <<= d */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00188}00188         \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00189}00189         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00190}00190 \textcolor{comment}{         * D2: j = 0.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00191}00191 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00192}00192         j = 0;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00193}00193         \mbox{\hyperlink{muldi3_8c_ae6c3ee9933cc50ea02782419401e84f0}{v1}} = v[1];    \textcolor{comment}{/* for D3 -\/-\/ note that v[1..n] are constant */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00194}00194         v2 = v[2];      \textcolor{comment}{/* for D3 */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00195}00195         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00196}00196                 \mbox{\hyperlink{qdivrem_8c_a1ccdbb05e74a54e497614b31914b6ca1}{digit}} uj0, uj1, uj2;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00198}00198                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00199}00199 \textcolor{comment}{                 * D3: Calculate qhat (\(\backslash\)\string^q, in TeX notation).}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00200}00200 \textcolor{comment}{                 * Let qhat = min((u[j]*B + u[j+1])/v[1], B-\/1), and}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00201}00201 \textcolor{comment}{                 * let rhat = (u[j]*B + u[j+1]) mod v[1].}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00202}00202 \textcolor{comment}{                 * While rhat < B and v[2]*qhat > rhat*B+u[j+2],}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00203}00203 \textcolor{comment}{                 * decrement qhat and increase rhat correspondingly.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00204}00204 \textcolor{comment}{                 * Note that if rhat >= B, v[2]*qhat < rhat*B.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00205}00205 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00206}00206                 uj0 = u[j + 0]; \textcolor{comment}{/* for D3 only -\/-\/ note that u[j+...] change */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00207}00207                 uj1 = u[j + 1]; \textcolor{comment}{/* for D3 only */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00208}00208                 uj2 = u[j + 2]; \textcolor{comment}{/* for D3 only */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00209}00209                 \textcolor{keywordflow}{if} (uj0 == \mbox{\hyperlink{muldi3_8c_ae6c3ee9933cc50ea02782419401e84f0}{v1}}) \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00210}00210                         qhat = \mbox{\hyperlink{qdivrem_8c_a111da81ae5883147168bbb8366377b10}{B}};}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00211}00211                         rhat = uj1;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00212}00212                         \textcolor{keywordflow}{goto} qhat\_too\_big;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00213}00213                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00214}00214                         u\_long nn = \mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{COMBINE}}(uj0, uj1);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00215}00215                         qhat = nn / \mbox{\hyperlink{muldi3_8c_ae6c3ee9933cc50ea02782419401e84f0}{v1}};}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00216}00216                         rhat = nn \% \mbox{\hyperlink{muldi3_8c_ae6c3ee9933cc50ea02782419401e84f0}{v1}};}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00217}00217                 \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00218}00218                 \textcolor{keywordflow}{while} (v2 * qhat > \mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{COMBINE}}(rhat, uj2)) \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00219}00219         qhat\_too\_big:}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00220}00220                         qhat-\/-\/;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00221}00221                         \textcolor{keywordflow}{if} ((rhat += \mbox{\hyperlink{muldi3_8c_ae6c3ee9933cc50ea02782419401e84f0}{v1}}) >= \mbox{\hyperlink{qdivrem_8c_a111da81ae5883147168bbb8366377b10}{B}})}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00222}00222                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00223}00223                 \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00224}00224                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00225}00225 \textcolor{comment}{                 * D4: Multiply and subtract.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00226}00226 \textcolor{comment}{                 * The variable `t' holds any borrows across the loop.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00227}00227 \textcolor{comment}{                 * We split this up so that we do not require v[0] = 0,}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00228}00228 \textcolor{comment}{                 * and to eliminate a final special case.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00229}00229 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00230}00230                 \textcolor{keywordflow}{for} (t = 0, i = n; i > 0; i-\/-\/) \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00231}00231                         t = u[i + j] -\/ v[i] * qhat -\/ t;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00232}00232                         u[i + j] = \mbox{\hyperlink{quad_8h_adf04943239a977f38017d6bbf53a4b36}{LHALF}}(t);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00233}00233                         t = (\mbox{\hyperlink{qdivrem_8c_a111da81ae5883147168bbb8366377b10}{B}} -\/ \mbox{\hyperlink{quad_8h_a92c7de42051862b2d44e2f0ccd9ca475}{HHALF}}(t)) \& (\mbox{\hyperlink{qdivrem_8c_a111da81ae5883147168bbb8366377b10}{B}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00234}00234                 \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00235}00235                 t = u[j] -\/ t;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00236}00236                 u[j] = \mbox{\hyperlink{quad_8h_adf04943239a977f38017d6bbf53a4b36}{LHALF}}(t);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00237}00237                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00238}00238 \textcolor{comment}{                 * D5: test remainder.}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00239}00239 \textcolor{comment}{                 * There is a borrow if and only if HHALF(t) is nonzero;}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00240}00240 \textcolor{comment}{                 * in that (rare) case, qhat was too large (by exactly 1).}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00241}00241 \textcolor{comment}{                 * Fix it by adding v[1..n] to u[j..j+n].}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00242}00242 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00243}00243                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{quad_8h_a92c7de42051862b2d44e2f0ccd9ca475}{HHALF}}(t)) \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00244}00244                         qhat-\/-\/;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00245}00245                         \textcolor{keywordflow}{for} (t = 0, i = n; i > 0; i-\/-\/) \{ \textcolor{comment}{/* D6: add back. */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00246}00246                                 t += u[i + j] + v[i];}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00247}00247                                 u[i + j] = \mbox{\hyperlink{quad_8h_adf04943239a977f38017d6bbf53a4b36}{LHALF}}(t);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00248}00248                                 t = \mbox{\hyperlink{quad_8h_a92c7de42051862b2d44e2f0ccd9ca475}{HHALF}}(t);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00249}00249                         \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00250}00250                         u[j] = \mbox{\hyperlink{quad_8h_adf04943239a977f38017d6bbf53a4b36}{LHALF}}(u[j] + t);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00251}00251                 \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00252}00252                 \mbox{\hyperlink{unionuu_a3ce40dca10fdac763f032c2062fcb310}{q}}[j] = qhat;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00253}00253         \} \textcolor{keywordflow}{while} (++j <= m);             \textcolor{comment}{/* D7: loop on j. */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00254}00254 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00255}00255         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00256}00256 \textcolor{comment}{         * If caller wants the remainder, we have to calculate it as}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00257}00257 \textcolor{comment}{         * u[m..m+n] >> d (this is at most n digits and thus fits in}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00258}00258 \textcolor{comment}{         * u[m+1..m+n], but we may need more source digits).}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00259}00259 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00260}00260         \textcolor{keywordflow}{if} (arq) \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00261}00261                 \textcolor{keywordflow}{if} (d) \{}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00262}00262                         \textcolor{keywordflow}{for} (i = m + n; i > m; -\/-\/i)}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00263}00263                                 u[i] = (u[i] >> d) |}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00264}00264                                     \mbox{\hyperlink{quad_8h_adf04943239a977f38017d6bbf53a4b36}{LHALF}}(u[i -\/ 1] << (\mbox{\hyperlink{quad_8h_a652f8dfd5ad718480293127346c8110f}{HALF\_BITS}} -\/ d));}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00265}00265                         u[i] = 0;}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00266}00266                 \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00267}00267                 tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_abec92cc72a096640b821b8cd56a02495}{H}}] = \mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{COMBINE}}(uspace[1], uspace[2]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00268}00268                 tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_aa73214aa5f2f94f63d90bb4e3d99fe53}{L}}] = \mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{COMBINE}}(uspace[3], uspace[4]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00269}00269                 *arq = tmp.\mbox{\hyperlink{unionuu_a3ce40dca10fdac763f032c2062fcb310}{q}};}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00270}00270         \}}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00271}00271 }
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00272}00272         tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_abec92cc72a096640b821b8cd56a02495}{H}}] = \mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{COMBINE}}(qspace[1], qspace[2]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00273}00273         tmp.\mbox{\hyperlink{unionuu_a8f74169d11a6ab4a569ec546a1704313}{ul}}[\mbox{\hyperlink{quad_8h_aa73214aa5f2f94f63d90bb4e3d99fe53}{L}}] = \mbox{\hyperlink{qdivrem_8c_a152dd91c3a7a672cde53646a9cb62594}{COMBINE}}(qspace[3], qspace[4]);}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00274}00274         \textcolor{keywordflow}{return} (tmp.\mbox{\hyperlink{unionuu_a3ce40dca10fdac763f032c2062fcb310}{q}});}
\DoxyCodeLine{\Hypertarget{qdivrem_8c_source_l00275}00275 \}}

\end{DoxyCode}
