unsafe fn with_penalty(input: &mut input_state_t, p: usize, pi: i32) -> Option<bool> {
        if pi < INF_PENALTY {
            /*1042: "Compute the badness b of the current page, using
             * awful_bad if the box is too full." */
            let b = if page_so_far[1] < page_so_far[0] {
                if page_so_far[3] != Scaled::ZERO
                    || page_so_far[4] != Scaled::ZERO
                    || page_so_far[5] != Scaled::ZERO
                {
                    0
                } else {
                    badness(page_so_far[0] - page_so_far[1], page_so_far[2])
                }
            } else if page_so_far[1] - page_so_far[0] > page_so_far[6] {
                AWFUL_BAD
            } else {
                badness(page_so_far[1] - page_so_far[0], page_so_far[6])
            };

            let mut c = if b < AWFUL_BAD {
                if pi <= EJECT_PENALTY {
                    pi as i32
                } else if b < INF_BAD {
                    b + pi + insert_penalties
                } else {
                    100000
                }
            /* DEPLORABLE */
            } else {
                b
            };

            if insert_penalties >= 10000 {
                c = MAX_HALFWORD
            }

            if c <= least_page_cost {
                best_page_break = Some(p);
                best_size = page_so_far[0];
                least_page_cost = c;
                let mut r = *LLIST_link(PAGE_INS_HEAD) as usize;

                while r != PAGE_INS_HEAD {
                    let mut r_pins = PageInsertion(r);
                    r_pins.set_best_ins_ptr(r_pins.last_ins_ptr());
                    r = *LLIST_link(r) as usize;
                }
            }

            if c == AWFUL_BAD || pi <= EJECT_PENALTY {
                fire_up(input, p);
                if output_active {
                    /* "user's output routine will act" */
                    return Some(true);
                }
                /* "the page has been shipped out by the default output routine" */
                return Some(false);
            }
        }
        None
    }
/*1040: "Check if node p is the new champion breakpoint; then if it is
     * time for a page break, prepare for output, and either fire up the
     * user's output routine and return or ship out the page and goto
     * done." We reach this point when p is a glue, kern, or penalty, and
     * there's already content on the page -- so this might be a place to
     * break the page. */
"Check if node p is the new champion breakpoint; then if it is
time for a page break, prepare for output, and either fire up the
user's output routine and return or ship out the page and goto
done." We reach this point when p is a glue, kern, or penalty, and
there's already content on the page -- so this might be a place to
break the page.
" Check if node p is the new champion breakpoint ; then if it is time for a page break prepare for output and either fire up the user ' s output routine and return or ship out the page and goto done . " We reach this point when p is a glue kern or penalty and there ' s already content on the page -- so this might be a place to break the page .
unsafe fn with_penalty(input: &mut input_state_t, p: usize, pi: i32) -> Option<bool> {
        if pi < INF_PENALTY {
            /*1042: "Compute the badness b of the current page, using
             * awful_bad if the box is too full." */
            let b = if page_so_far[1] < page_so_far[0] {
                if page_so_far[3] != Scaled::ZERO
                    || page_so_far[4] != Scaled::ZERO
                    || page_so_far[5] != Scaled::ZERO
                {
                    0
                } else {
                    badness(page_so_far[0] - page_so_far[1], page_so_far[2])
                }
            } else if page_so_far[1] - page_so_far[0] > page_so_far[6] {
                AWFUL_BAD
            } else {
                badness(page_so_far[1] - page_so_far[0], page_so_far[6])
            };
            let mut c = if b < AWFUL_BAD {
                if pi <= EJECT_PENALTY {
                    pi as i32
                } else if b < INF_BAD {
                    b + pi + insert_penalties
                } else {
                    100000
                }
            /* DEPLORABLE */
            } else {
                b
            };
            if insert_penalties >= 10000 {
                c = MAX_HALFWORD
            }
            if c <= least_page_cost {
                best_page_break = Some(p);
                best_size = page_so_far[0];
                least_page_cost = c;
                let mut r = *LLIST_link(PAGE_INS_HEAD) as usize;
                while r != PAGE_INS_HEAD {
                    let mut r_pins = PageInsertion(r);
                    r_pins.set_best_ins_ptr(r_pins.last_ins_ptr());
                    r = *LLIST_link(r) as usize;
                }
            }
            if c == AWFUL_BAD || pi <= EJECT_PENALTY {
                fire_up(input, p);
                if output_active {
                    /* "user's output routine will act" */
                    return Some(true);
                }
                /* "the page has been shipped out by the default output routine" */
                return Some(false);
            }
        }
        None
    }
unsafe fn with_penalty ( input : & mut input_state_t , p : usize , pi : i32 ) -> Option < bool > { if pi < INF_PENALTY { /*1042: "Compute the badness b of the current page, using
             * awful_bad if the box is too full." */ let b = if page_so_far [ 1 ] < page_so_far [ 0 ] { if page_so_far [ 3 ] != Scaled :: ZERO || page_so_far [ 4 ] != Scaled :: ZERO || page_so_far [ 5 ] != Scaled :: ZERO { 0 } else { badness ( page_so_far [ 0 ] - page_so_far [ 1 ] , page_so_far [ 2 ] ) } } else if page_so_far [ 1 ] - page_so_far [ 0 ] > page_so_far [ 6 ] { AWFUL_BAD } else { badness ( page_so_far [ 1 ] - page_so_far [ 0 ] , page_so_far [ 6 ] ) } ; let mut c = if b < AWFUL_BAD { if pi <= EJECT_PENALTY { pi as i32 } else if b < INF_BAD { b + pi + insert_penalties } else { 100000 } /* DEPLORABLE */ } else { b } ; if insert_penalties >= 10000 { c = MAX_HALFWORD } if c <= least_page_cost { best_page_break = Some ( p ) ; best_size = page_so_far [ 0 ] ; least_page_cost = c ; let mut r = * LLIST_link ( PAGE_INS_HEAD ) as usize ; while r != PAGE_INS_HEAD { let mut r_pins = PageInsertion ( r ) ; r_pins . set_best_ins_ptr ( r_pins . last_ins_ptr ( ) ) ; r = * LLIST_link ( r ) as usize ; } } if c == AWFUL_BAD || pi <= EJECT_PENALTY { fire_up ( input , p ) ; if output_active { /* "user's output routine will act" */ return Some ( true ) ; } /* "the page has been shipped out by the default output routine" */ return Some ( false ) ; } } None }
1040: "Check if node p is the new champion breakpoint; then if it is
 time for a page break, prepare for output, and either fire up the
 user's output routine and return or ship out the page and goto
 done."
1040 : " Check if node p is the new champion breakpoint ; then if it is time for a page break prepare for output and either fire up the user ' s output routine and return or ship out the page and goto done . "
input
&mut input_state_t
p
usize
pi
i32