	/*4:*/
	#line 253 "ctex.w"
	/*6:*/
	#line 285 "ctex.w"

static int s_no(const char*str);

	/*:6*/	/*9:*/
	#line 329 "ctex.w"

#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

	/*:9*/
	#line 253 "ctex.w"

#define banner "This is TeX, Version 3.14159265 (HINT)" \

#define odd(X) ((X) &1) 
#define chr(X) ((unsigned char) (X) ) 
#define ord(X) ((unsigned int) (X) ) 
#define abs(X) ((X) >-(X) ?(X) :-(X) ) 
#define round(X) ((int) ((X) >=0.0?floor((X) +0.5) :ceil((X) -0.5) ) )  \

#define mem_bot 0 \

#define mem_top 30000 \
 \

#define font_base 0 \

#define hash_size 2100 \

#define hash_prime 1777
#define hyph_size 307 \
 \

#define incr(A) A= A+1
#define decr(A) A= A-1
#define negate(A) A= -A
#define loop while(true) 
#define do_nothing 
#define empty 0 \

#define text_char unsigned char
#define first_text_char 0
#define last_text_char 255 \

#define null_code 00
#define carriage_return 015
#define invalid_code 0177 \

#define reset_OK(A) erstat(A) ==0
#define rewrite_OK(A) erstat(A) ==0 \

#define t_open_in term_in.f= stdin
#define t_open_out term_out.f= stdout \

#define update_terminal fflush(term_out.f) 
#define clear_terminal fflush(term_in.f) 
#define wake_up_terminal do_nothing \

#define loc cur_input.loc_field \

#define si(A) A
#define so(A) A \

#define length(A) (str_start[A+1]-str_start[A])  \
 \

#define cur_length (pool_ptr-str_start[str_ptr])  \

#define append_char(A)  \
{str_pool[pool_ptr]= si(A) ;incr(pool_ptr) ; \
}
#define flush_char decr(pool_ptr) 
#define str_room(A)  \
{if(pool_ptr+A>pool_size)  \
overflow("pool size",pool_size-init_pool_ptr) ; \
 \
} \

#define flush_string {decr(str_ptr) ;pool_ptr= str_start[str_ptr]; \
} \

#define app_lc_hex(A) l= A; \
if(l<10) append_char(l+'0') else append_char(l-10+'a')  \

#define no_print 16
#define term_only 17
#define log_only 18
#define term_and_log 19
#define pseudo 20
#define new_string 21
#define max_selector 21 \

#define print_ASCII printn \

#define prompt_input(A) {wake_up_terminal;print(A) ;term_input() ; \
} \

#define batch_mode 0
#define nonstop_mode 1
#define scroll_mode 2
#define error_stop_mode 3 \

#define spotless 0
#define warning_issued 1
#define error_message_issued 2
#define fatal_error_stop 3 \

#define hlp1(A) help_line[0]= A;}
#define hlp2(A,B) help_line[1]= A;help_line[0]= B;}
#define hlp3(A,B,C) help_line[2]= A;help_line[1]= B;help_line[0]= C;}
#define hlp4(A,B,C,D) help_line[3]= A;help_line[2]= B;help_line[1]= C;help_line[0]= D;}
#define hlp5(A,B,C,D,E) help_line[4]= A;help_line[3]= B;help_line[2]= C;help_line[1]= D;help_line[0]= E;}
#define hlp6(A,B,C,D,E,F) help_line[5]= A;help_line[4]= B;help_line[3]= C;help_line[2]= D;help_line[1]= E;help_line[0]= F;}
#define help0 help_ptr= 0
#define help1(A) {help_ptr= 1;hlp1(A) 
#define help2(A,B) {help_ptr= 2;hlp2(A,B) 
#define help3(A,B,C) {help_ptr= 3;hlp3(A,B,C) 
#define help4(A,B,C,D) {help_ptr= 4;hlp4(A,B,C,D) 
#define help5(A,B,C,D,E) {help_ptr= 5;hlp5(A,B,C,D,E) 
#define help6(A,B,C,D,E,F) {help_ptr= 6;hlp6(A,B,C,D,E,F)  \

#define succumb {if(interaction==error_stop_mode)  \
interaction= scroll_mode; \
if(log_opened) error() ; \
if(interaction>batch_mode) debug_help() ; \
history= fatal_error_stop;jump_out() ; \
} \

#define check_interrupt {if(interrupt!=0) pause_for_instructions() ; \
} \

#define unity 0200000
#define two 0400000 \

#define nx_plus_y(A,B,C) mult_and_add(A,B,C,07777777777) 
#define mult_integers(A,B) mult_and_add(A,B,0,017777777777)  \

#define inf_bad 10000 \

#define set_glue_ratio_zero(A) A= 0.0
#define set_glue_ratio_one(A) A= 1.0
#define float(A) ((double) (A) ) 
#define unfloat(A) ((glue_ratio) (A) ) 
#define float_constant(A) ((double) (A) )  \

#define min_quarterword 0
#define max_quarterword 255
#define min_halfword 0
#define max_halfword 65535 \

#define qi(A) A+min_quarterword \

#define qo(A) A-min_quarterword \

#define hi(A) A+min_halfword \

#define ho(A) A-min_halfword \
 \

#define sc i \

#define pointer halfword
#define null min_halfword \

#define link(A) mem[A].hh.rh
#define info(A) mem[A].hh.lh \

#define free_avail(A)  \
{link(A) = avail;avail= A; \
decr_dyn_used; \
} \

#define fast_get_avail(A)  \
{A= avail; \
if(A==null) A= get_avail() ; \
else{avail= link(A) ;link(A) = null; \
incr_dyn_used; \
} \
} \

#define empty_flag max_halfword
#define is_empty(A) (link(A) ==empty_flag) 
#define node_size(A) info(A) 
#define llink(A) info(A+1) 
#define rlink(A) link(A+1)  \

#define type(A) mem[A].hh.b0
#define subtype(A) mem[A].hh.b1 \

#define is_char_node(A) (A>=hi_mem_min)  \

#define font(A) type(A) 
#define character(A) subtype(A)  \

#define hlist_node 0
#define box_node_size 7
#define width_offset 1
#define depth_offset 2
#define height_offset 3
#define width(A) mem[A+width_offset].sc
#define depth(A) mem[A+depth_offset].sc
#define height(A) mem[A+height_offset].sc
#define shift_amount(A) mem[A+4].sc
#define list_offset 5
#define list_ptr(A) link(A+list_offset) 
#define glue_order(A) subtype(A+list_offset) 
#define glue_sign(A) type(A+list_offset) 
#define normal 0
#define stretching 1
#define shrinking 2
#define glue_offset 6
#define glue_set(A) mem[A+glue_offset].gr \
 \

#define vlist_node 1 \

#define rule_node 2
#define rule_node_size 4
#define null_flag -010000000000
#define is_running(A) (A==null_flag)  \

#define ins_node 3
#define ins_node_size 5
#define float_cost(A) mem[A+1].i
#define ins_ptr(A) info(A+4) 
#define split_top_ptr(A) link(A+4)  \

#define mark_node 4
#define small_node_size 2
#define mark_ptr(A) mem[A+1].i \

#define adjust_node 5
#define adjust_ptr(A) mark_ptr(A)  \

#define ligature_node 6
#define lig_char(A) A+1
#define lig_ptr(A) link(lig_char(A) )  \

#define disc_node 7
#define replace_count(A) subtype(A) 
#define pre_break(A) llink(A) 
#define post_break(A) rlink(A)  \

#define whatsit_node 8 \

#define math_node 9
#define before 0
#define after 1 \

#define precedes_break(A) (type(A) <math_node) 
#define non_discardable(A) (type(A) <math_node)  \

#define glue_node 10
#define cond_math_glue 98
#define mu_glue 99
#define a_leaders 100
#define c_leaders 101
#define x_leaders 102
#define glue_ptr(A) llink(A) 
#define leader_ptr(A) rlink(A)  \

#define glue_spec_size 4
#define glue_ref_count(A) link(A) 
#define stretch(A) mem[A+2].sc
#define shrink(A) mem[A+3].sc
#define stretch_order(A) type(A) 
#define shrink_order(A) subtype(A) 
#define fil 1
#define fill 2
#define filll 3 \

#define kern_node 11
#define explicit 1
#define acc_kern 2 \

#define penalty_node 12
#define inf_penalty inf_bad
#define eject_penalty (-inf_penalty) 
#define penalty(A) mem[A+1].i \

#define unset_node 13
#define glue_stretch(A) mem[A+glue_offset].sc
#define glue_shrink(A) shift_amount(A) 
#define span_count(A) subtype(A)  \

#define zero_glue mem_bot
#define fil_glue zero_glue+glue_spec_size
#define fill_glue fil_glue+glue_spec_size
#define ss_glue fill_glue+glue_spec_size
#define fil_neg_glue ss_glue+glue_spec_size
#define lo_mem_stat_max fil_neg_glue+glue_spec_size-1 \
 \

#define page_ins_head mem_top
#define contrib_head mem_top-1
#define page_head mem_top-2
#define temp_head mem_top-3
#define hold_head mem_top-4
#define adjust_head mem_top-5
#define active mem_top-7
#define align_head mem_top-8
#define end_span mem_top-9
#define omit_template mem_top-10
#define null_list mem_top-11
#define lig_trick mem_top-12
#define garbage mem_top-12
#define backup_head mem_top-13
#define hi_mem_stat_min mem_top-13 \

#define hi_mem_stat_usage 14 \

#define node_list_display(A)  \
{append_char('.') ;show_node_list(A) ;flush_char; \
} \

#define token_ref_count(A) info(A)  \

#define fast_delete_glue_ref(A)  \
{if(glue_ref_count(A) ==null) free_node(A,glue_spec_size) ; \
else decr(glue_ref_count(A) ) ; \
} \

#define add_token_ref(A) incr(token_ref_count(A) ) 
#define add_glue_ref(A) incr(glue_ref_count(A) )  \

#define escape 0 \

#define relax 0
#define left_brace 1
#define right_brace 2
#define math_shift 3
#define tab_mark 4
#define car_ret 5
#define out_param 5
#define mac_param 6
#define sup_mark 7
#define sub_mark 8
#define ignore 9
#define endv 9
#define spacer 10
#define letter 11
#define other_char 12
#define active_char 13
#define par_end 13
#define match 13
#define comment 14
#define end_match 14
#define stop 14
#define invalid_char 15
#define delim_num 15
#define max_char_code 15 \

#define char_num 16
#define math_char_num 17
#define mark 18
#define xray 19
#define make_box 20
#define hmove 21
#define vmove 22
#define un_hbox 23
#define un_vbox 24
#define remove_item 25 \

#define hskip 26
#define vskip 27
#define mskip 28
#define kern 29
#define mkern 30
#define leader_ship 31
#define halign 32
#define valign 33
#define no_align 34
#define vrule 35
#define hrule 36
#define insert 37
#define vadjust 38
#define ignore_spaces 39
#define after_assignment 40
#define after_group 41
#define break_penalty 42
#define start_par 43
#define ital_corr 44
#define accent 45
#define math_accent 46
#define discretionary 47
#define eq_no 48
#define left_right 49
#define math_comp 50
#define limit_switch 51
#define above 52
#define math_style 53
#define math_choice 54
#define non_script 55
#define vcenter 56
#define case_shift 57
#define message 58
#define extension 59
#define in_stream 60
#define begin_group 61
#define end_group 62
#define omit 63
#define ex_space 64
#define no_boundary 65
#define radical 66
#define end_cs_name 67
#define min_internal 68
#define char_given 68
#define math_given 69
#define last_item 70 \

#define max_non_prefixed_command 70 \

#define toks_register 71
#define assign_toks 72
#define assign_int 73
#define assign_dimen 74
#define assign_glue 75
#define assign_mu_glue 76
#define assign_font_dimen 77
#define assign_font_int 78 \

#define set_aux 79
#define set_prev_graf 80
#define set_page_dimen 81
#define set_page_int 82 \

#define set_box_dimen 83
#define set_shape 84
#define def_code 85
#define def_family 86
#define set_font 87
#define def_font 88
#define internal_register 89
#define max_internal 89
#define advance 90
#define multiply 91
#define divide 92
#define prefix 93
#define let 94
#define shorthand_def 95
#define read_to_cs 96
#define def 97
#define set_box 98
#define hyph_data 99
#define set_interaction 100
#define max_command 100 \

#define undefined_cs (max_command+1) 
#define expand_after (max_command+2) 
#define no_expand (max_command+3) 
#define input (max_command+4) 
#define if_test (max_command+5) 
#define fi_or_else (max_command+6) 
#define cs_name (max_command+7) 
#define convert (max_command+8) 
#define the (max_command+9) 
#define top_bot_mark (max_command+10) 
#define call (max_command+11) 
#define long_call (max_command+12) 
#define outer_call (max_command+13) 
#define long_outer_call (max_command+14) 
#define end_template (max_command+15) 
#define dont_expand (max_command+16) 
#define glue_ref (max_command+17) 
#define shape_ref (max_command+18) 
#define box_ref (max_command+19) 
#define data (max_command+20)  \

#define vmode 1
#define hmode (vmode+max_command+1) 
#define mmode (hmode+max_command+1)  \

#define ignore_depth -65536000 \

#define mode cur_list.mode_field
#define head cur_list.head_field
#define tail cur_list.tail_field
#define prev_graf cur_list.pg_field
#define aux cur_list.aux_field
#define prev_depth aux.sc
#define space_factor aux.hh.lh
#define clang aux.hh.rh
#define incompleat_noad aux.i
#define mode_line cur_list.ml_field \

#define tail_append(A) {link(tail) = A;tail= link(tail) ; \
} \

#define eq_level_field(A) A.hh.b1
#define eq_type_field(A) A.hh.b0
#define equiv_field(A) A.hh.rh
#define eq_level(A) eq_level_field(eqtb[A]) 
#define eq_type(A) eq_type_field(eqtb[A]) 
#define equiv(A) equiv_field(eqtb[A]) 
#define level_zero min_quarterword
#define level_one (level_zero+1)  \

#define active_base 1
#define single_base (active_base+256) 
#define null_cs (single_base+256) 
#define hash_base (null_cs+1) 
#define frozen_control_sequence (hash_base+hash_size) 
#define frozen_protection frozen_control_sequence
#define frozen_cr (frozen_control_sequence+1) 
#define frozen_end_group (frozen_control_sequence+2) 
#define frozen_right (frozen_control_sequence+3) 
#define frozen_fi (frozen_control_sequence+4) 
#define frozen_end_template (frozen_control_sequence+5) 
#define frozen_endv (frozen_control_sequence+6) 
#define frozen_relax (frozen_control_sequence+7) 
#define end_write (frozen_control_sequence+8) 
#define frozen_dont_expand (frozen_control_sequence+9)  \

#define frozen_null_font (frozen_control_sequence+10)  \

#define font_id_base (frozen_null_font-font_base)  \

#define undefined_control_sequence (frozen_null_font+257) 
#define glue_base (undefined_control_sequence+1)  \

#define line_skip_code 0
#define baseline_skip_code 1
#define par_skip_code 2
#define above_display_skip_code 3
#define below_display_skip_code 4
#define above_display_short_skip_code 5 \

#define below_display_short_skip_code 6 \

#define left_skip_code 7
#define right_skip_code 8
#define top_skip_code 9
#define split_top_skip_code 10
#define tab_skip_code 11
#define space_skip_code 12
#define xspace_skip_code 13
#define par_fill_skip_code 14
#define thin_mu_skip_code 15
#define med_mu_skip_code 16
#define thick_mu_skip_code 17
#define glue_pars 18
#define skip_base (glue_base+glue_pars) 
#define mu_skip_base (skip_base+256) 
#define local_base (mu_skip_base+256)  \

#define skip(A) equiv(skip_base+A) 
#define mu_skip(A) equiv(mu_skip_base+A) 
#define glue_par(A) equiv(glue_base+A) 
#define line_skip glue_par(line_skip_code) 
#define baseline_skip glue_par(baseline_skip_code) 
#define par_skip glue_par(par_skip_code) 
#define above_display_skip glue_par(above_display_skip_code) 
#define below_display_skip glue_par(below_display_skip_code) 
#define above_display_short_skip glue_par(above_display_short_skip_code) 
#define below_display_short_skip glue_par(below_display_short_skip_code) 
#define left_skip glue_par(left_skip_code) 
#define right_skip glue_par(right_skip_code) 
#define top_skip glue_par(top_skip_code) 
#define split_top_skip glue_par(split_top_skip_code) 
#define tab_skip glue_par(tab_skip_code) 
#define space_skip glue_par(space_skip_code) 
#define xspace_skip glue_par(xspace_skip_code) 
#define par_fill_skip glue_par(par_fill_skip_code) 
#define thin_mu_skip glue_par(thin_mu_skip_code) 
#define med_mu_skip glue_par(med_mu_skip_code) 
#define thick_mu_skip glue_par(thick_mu_skip_code)  \

#define par_shape_loc local_base
#define output_routine_loc (local_base+1) 
#define every_par_loc (local_base+2) 
#define every_math_loc (local_base+3) 
#define every_display_loc (local_base+4) 
#define every_hbox_loc (local_base+5) 
#define every_vbox_loc (local_base+6) 
#define every_job_loc (local_base+7) 
#define every_cr_loc (local_base+8) 
#define err_help_loc (local_base+9) 
#define toks_base (local_base+10) 
#define box_base (toks_base+256) 
#define cur_font_loc (box_base+256) 
#define math_font_base (cur_font_loc+1) 
#define cat_code_base (math_font_base+48)  \

#define lc_code_base (cat_code_base+256) 
#define uc_code_base (lc_code_base+256) 
#define sf_code_base (uc_code_base+256) 
#define math_code_base (sf_code_base+256) 
#define int_base (math_code_base+256)  \

#define par_shape_ptr equiv(par_shape_loc) 
#define output_routine equiv(output_routine_loc) 
#define every_par equiv(every_par_loc) 
#define every_math equiv(every_math_loc) 
#define every_display equiv(every_display_loc) 
#define every_hbox equiv(every_hbox_loc) 
#define every_vbox equiv(every_vbox_loc) 
#define every_job equiv(every_job_loc) 
#define every_cr equiv(every_cr_loc) 
#define err_help equiv(err_help_loc) 
#define toks(X) equiv(toks_base+X) 
#define box(A) equiv(box_base+A) 
#define cur_font equiv(cur_font_loc) 
#define fam_fnt(A) equiv(math_font_base+A) 
#define cat_code(A) equiv(cat_code_base+A) 
#define lc_code(A) equiv(lc_code_base+A) 
#define uc_code(A) equiv(uc_code_base+A) 
#define sf_code(A) equiv(sf_code_base+A) 
#define math_code(A) equiv(math_code_base+A)  \
 \

#define null_font font_base
#define var_code 070000 \

#define pretolerance_code 0
#define tolerance_code 1
#define line_penalty_code 2
#define hyphen_penalty_code 3
#define ex_hyphen_penalty_code 4
#define club_penalty_code 5
#define widow_penalty_code 6
#define display_widow_penalty_code 7
#define broken_penalty_code 8
#define bin_op_penalty_code 9
#define rel_penalty_code 10
#define pre_display_penalty_code 11 \

#define post_display_penalty_code 12 \

#define inter_line_penalty_code 13
#define double_hyphen_demerits_code 14
#define final_hyphen_demerits_code 15
#define adj_demerits_code 16
#define mag_code 17
#define delimiter_factor_code 18
#define looseness_code 19
#define time_code 20
#define day_code 21
#define month_code 22
#define year_code 23
#define show_box_breadth_code 24
#define show_box_depth_code 25
#define hbadness_code 26
#define vbadness_code 27
#define pausing_code 28
#define tracing_online_code 29
#define tracing_macros_code 30
#define tracing_stats_code 31
#define tracing_paragraphs_code 32
#define tracing_pages_code 33
#define tracing_output_code 34
#define tracing_lost_chars_code 35
#define tracing_commands_code 36
#define tracing_restores_code 37
#define uc_hyph_code 38
#define output_penalty_code 39
#define max_dead_cycles_code 40
#define hang_after_code 41
#define floating_penalty_code 42
#define global_defs_code 43
#define cur_fam_code 44
#define escape_char_code 45
#define default_hyphen_char_code 46
#define default_skew_char_code 47
#define end_line_char_code 48
#define new_line_char_code 49
#define language_code 50
#define left_hyphen_min_code 51
#define right_hyphen_min_code 52
#define holding_inserts_code 53
#define error_context_lines_code 54
#define int_pars 55
#define count_base (int_base+int_pars) 
#define del_code_base (count_base+256) 
#define dimen_base (del_code_base+256)  \

#define del_code(A) eqtb[del_code_base+A].i
#define count(A) eqtb[count_base+A].i
#define int_par(A) eqtb[int_base+A].i
#define pretolerance int_par(pretolerance_code) 
#define tolerance int_par(tolerance_code) 
#define line_penalty int_par(line_penalty_code) 
#define hyphen_penalty int_par(hyphen_penalty_code) 
#define ex_hyphen_penalty int_par(ex_hyphen_penalty_code) 
#define club_penalty int_par(club_penalty_code) 
#define widow_penalty int_par(widow_penalty_code) 
#define display_widow_penalty int_par(display_widow_penalty_code) 
#define broken_penalty int_par(broken_penalty_code) 
#define bin_op_penalty int_par(bin_op_penalty_code) 
#define rel_penalty int_par(rel_penalty_code) 
#define pre_display_penalty int_par(pre_display_penalty_code) 
#define post_display_penalty int_par(post_display_penalty_code) 
#define inter_line_penalty int_par(inter_line_penalty_code) 
#define double_hyphen_demerits int_par(double_hyphen_demerits_code) 
#define final_hyphen_demerits int_par(final_hyphen_demerits_code) 
#define adj_demerits int_par(adj_demerits_code) 
#define mag int_par(mag_code) 
#define delimiter_factor int_par(delimiter_factor_code) 
#define looseness int_par(looseness_code) 
#define time int_par(time_code) 
#define day int_par(day_code) 
#define month int_par(month_code) 
#define year int_par(year_code) 
#define show_box_breadth int_par(show_box_breadth_code) 
#define show_box_depth int_par(show_box_depth_code) 
#define hbadness int_par(hbadness_code) 
#define vbadness int_par(vbadness_code) 
#define pausing int_par(pausing_code) 
#define tracing_online int_par(tracing_online_code) 
#define tracing_macros int_par(tracing_macros_code) 
#define tracing_stats int_par(tracing_stats_code) 
#define tracing_paragraphs int_par(tracing_paragraphs_code) 
#define tracing_pages int_par(tracing_pages_code) 
#define tracing_output int_par(tracing_output_code) 
#define tracing_lost_chars int_par(tracing_lost_chars_code) 
#define tracing_commands int_par(tracing_commands_code) 
#define tracing_restores int_par(tracing_restores_code) 
#define uc_hyph int_par(uc_hyph_code) 
#define output_penalty int_par(output_penalty_code) 
#define max_dead_cycles int_par(max_dead_cycles_code) 
#define hang_after int_par(hang_after_code) 
#define floating_penalty int_par(floating_penalty_code) 
#define global_defs int_par(global_defs_code) 
#define cur_fam int_par(cur_fam_code) 
#define escape_char int_par(escape_char_code) 
#define default_hyphen_char int_par(default_hyphen_char_code) 
#define default_skew_char int_par(default_skew_char_code) 
#define end_line_char int_par(end_line_char_code) 
#define new_line_char int_par(new_line_char_code) 
#define language int_par(language_code) 
#define left_hyphen_min int_par(left_hyphen_min_code) 
#define right_hyphen_min int_par(right_hyphen_min_code) 
#define holding_inserts int_par(holding_inserts_code) 
#define error_context_lines int_par(error_context_lines_code)  \

#define par_indent_code 0
#define math_surround_code 1
#define line_skip_limit_code 2
#define hsize_code 3
#define vsize_code 4
#define max_depth_code 5
#define split_max_depth_code 6
#define box_max_depth_code 7
#define hfuzz_code 8
#define vfuzz_code 9
#define delimiter_shortfall_code 10
#define null_delimiter_space_code 11
#define script_space_code 12
#define pre_display_size_code 13
#define display_width_code 14
#define display_indent_code 15
#define overfull_rule_code 16
#define hang_indent_code 17
#define h_offset_code 18
#define v_offset_code 19
#define emergency_stretch_code 20
#define dimen_pars 21
#define scaled_base (dimen_base+dimen_pars)  \

#define eqtb_size (scaled_base+255)  \

#define dimen(A) eqtb[scaled_base+A].sc
#define dimen_par(A) eqtb[dimen_base+A].sc
#define par_indent dimen_par(par_indent_code) 
#define math_surround dimen_par(math_surround_code) 
#define line_skip_limit dimen_par(line_skip_limit_code) 
#define hsize dimen_par(hsize_code) 
#define vsize dimen_par(vsize_code) 
#define max_depth dimen_par(max_depth_code) 
#define split_max_depth dimen_par(split_max_depth_code) 
#define box_max_depth dimen_par(box_max_depth_code) 
#define hfuzz dimen_par(hfuzz_code) 
#define vfuzz dimen_par(vfuzz_code) 
#define delimiter_shortfall dimen_par(delimiter_shortfall_code) 
#define null_delimiter_space dimen_par(null_delimiter_space_code) 
#define script_space dimen_par(script_space_code) 
#define pre_display_size dimen_par(pre_display_size_code) 
#define display_width dimen_par(display_width_code) 
#define display_indent dimen_par(display_indent_code) 
#define overfull_rule dimen_par(overfull_rule_code) 
#define hang_indent dimen_par(hang_indent_code) 
#define h_offset dimen_par(h_offset_code) 
#define v_offset dimen_par(v_offset_code) 
#define emergency_stretch dimen_par(emergency_stretch_code)  \

#define next(A) hash[A].lh
#define text(A) hash[A].rh
#define hash_is_full (hash_used==hash_base) 
#define font_id_text(A) text(font_id_base+A)  \

#define save_type(A) save_stack[A].hh.b0
#define save_level(A) save_stack[A].hh.b1 \

#define save_index(A) save_stack[A].hh.rh \

#define restore_old_value 0
#define restore_zero 1
#define insert_token 2
#define level_boundary 3 \

#define bottom_level 0
#define simple_group 1
#define hbox_group 2
#define adjusted_hbox_group 3
#define vbox_group 4
#define vtop_group 5
#define align_group 6
#define no_align_group 7
#define output_group 8
#define math_group 9
#define disc_group 10
#define insert_group 11
#define vcenter_group 12
#define math_choice_group 13
#define semi_simple_group 14
#define math_shift_group 15
#define math_left_group 16
#define max_group_code 16 \

#define check_full_save_stack if(save_ptr>max_save_stack)  \
{max_save_stack= save_ptr; \
if(max_save_stack>save_size-6) overflow("save size",save_size) ; \
 \
} \

#define saved(A) save_stack[save_ptr+A].i \

#define cs_token_flag 07777 \

#define left_brace_token 00400
#define left_brace_limit 01000
#define right_brace_token 01000
#define right_brace_limit 01400
#define math_shift_token 01400
#define tab_token 02000
#define out_param_token 02400
#define space_token 05040
#define letter_token 05400
#define other_token 06000
#define match_token 06400
#define end_match_token 07000 \

#define chr_cmd(A) {print(A) ;print_ASCII(chr_code) ; \
} \

#define state cur_input.state_field
#define index cur_input.index_field
#define start cur_input.start_field
#define limit cur_input.limit_field
#define name cur_input.name_field \

#define mid_line 1
#define skip_blanks (2+max_char_code) 
#define new_line (3+max_char_code+max_char_code)  \

#define terminal_input (name==0) 
#define cur_file input_file[index] \

#define skipping 1
#define defining 2
#define matching 3
#define aligning 4
#define absorbing 5 \

#define token_list 0
#define token_type index
#define param_start limit
#define parameter 0
#define u_template 1
#define v_template 2
#define backed_up 3
#define inserted 4
#define macro 5
#define output_text 6
#define every_par_text 7
#define every_math_text 8
#define every_display_text 9
#define every_hbox_text 10
#define every_vbox_text 11
#define every_job_text 12
#define every_cr_text 13
#define mark_text 14
#define write_text 15 \

#define begin_pseudoprint  \
{l= tally;tally= 0;selector= pseudo; \
trick_count= 1000000; \
}
#define set_trick_count  \
{first_count= tally; \
trick_count= tally+1+error_line-half_error_line; \
if(trick_count<error_line) trick_count= error_line; \
} \

#define push_input  \
{if(input_ptr>max_in_stack)  \
{max_in_stack= input_ptr; \
if(input_ptr==stack_size) overflow("input stack size",stack_size) ; \
 \
} \
input_stack[input_ptr]= cur_input; \
incr(input_ptr) ; \
} \

#define pop_input  \
{decr(input_ptr) ;cur_input= input_stack[input_ptr]; \
} \

#define back_list(A) begin_token_list(A,backed_up) 
#define ins_list(A) begin_token_list(A,inserted)  \

#define any_state_plus(A) case mid_line+A:case skip_blanks+A:case new_line+A \

#define add_delims_to(A) A+math_shift:A+tab_mark:A+mac_param: \
A+sub_mark:A+letter:A+other_char \

#define is_hex(A) (((A>='0') &&(A<='9') ) ||((A>='a') &&(A<='f') ) ) 
#define hex_to_cur_chr  \
if(c<='9') cur_chr= c-'0';else cur_chr= c-'a'+10; \
if(cc<='9') cur_chr= 16*cur_chr+cc-'0'; \
else cur_chr= 16*cur_chr+cc-'a'+10 \

#define no_expand_flag 257 \

#define end_line_char_inactive (end_line_char<0) ||(end_line_char>255)  \

#define store_new_token(A) {q= get_avail() ;link(p) = q;info(q) = A; \
p= q; \
}
#define fast_store_new_token(A) {fast_get_avail(q) ;link(p) = q;info(q) = A; \
p= q; \
} \

#define top_mark_code 0
#define first_mark_code 1
#define bot_mark_code 2
#define split_first_mark_code 3
#define split_bot_mark_code 4
#define top_mark cur_mark[top_mark_code]
#define first_mark cur_mark[first_mark_code]
#define bot_mark cur_mark[bot_mark_code]
#define split_first_mark cur_mark[split_first_mark_code]
#define split_bot_mark cur_mark[split_bot_mark_code] \

#define int_val 0
#define dimen_val 1
#define glue_val 2
#define mu_val 3
#define ident_val 4
#define tok_val 5 \

#define scanned_result(A,B) {cur_val= A;cur_val_level= B;} \

#define input_line_no_code (glue_val+1) 
#define badness_code (glue_val+2)  \

#define max_dimen 07777777777 \

#define octal_token (other_token+'\'') 
#define hex_token (other_token+'"') 
#define alpha_token (other_token+'`') 
#define point_token (other_token+'.') 
#define continental_point_token (other_token+',')  \

#define infinity 017777777777
#define zero_token (other_token+'0') 
#define A_token (letter_token+'A') 
#define other_A_token (other_token+'A')  \

#define scan_normal_dimen scan_dimen(false,false,false)  \

#define set_conversion(A,B) {num= A;denom= B;} \

#define default_rule 26214 \

#define number_code 0
#define roman_numeral_code 1
#define string_code 2
#define meaning_code 3
#define font_name_code 4
#define job_name_code 5 \

#define closed 2
#define just_open 1 \

#define if_char_code 0
#define if_cat_code 1
#define if_int_code 2
#define if_dim_code 3
#define if_odd_code 4
#define if_vmode_code 5
#define if_hmode_code 6
#define if_mmode_code 7
#define if_inner_code 8
#define if_void_code 9
#define if_hbox_code 10
#define if_vbox_code 11
#define ifx_code 12
#define if_eof_code 13
#define if_true_code 14
#define if_false_code 15
#define if_case_code 16 \

#define if_node_size 2
#define if_line_field(A) mem[A+1].i
#define if_code 1
#define fi_code 2
#define else_code 3
#define or_code 4 \

#define get_x_token_or_active_char  \
{get_x_token() ; \
if(cur_cmd==relax) if(cur_chr==no_expand_flag)  \
{cur_cmd= active_char; \
cur_chr= cur_tok-cs_token_flag-active_base; \
} \
} \

#define TEX_area "TeXinputs/" \

#define TEX_font_area "TeXfonts/" \
 \

#define MAX_CUR_FILE_NAME 1024 \

#define append_to_name(A) {c= A;incr(k) ; \
if(k<=file_name_size) name_of_file[k]= xchr[c]; \
} \

#define format_default_length 20
#define format_area_length 11
#define format_ext_length 4
#define format_extension ".fmt" \

#define pack_cur_name pack_file_name(cur_name,cur_area,cur_ext)  \

#define ensure_dvi_open if(output_file_name==0)  \
{if(job_name==0) open_log_file() ; \
pack_job_name(".dvi") ; \
while(!b_open_out(&dvi_file) )  \
prompt_file_name("file name for output",".dvi") ; \
output_file_name= b_make_name_string(&dvi_file) ; \
} \

#define no_tag 0
#define lig_tag 1
#define list_tag 2
#define ext_tag 3 \

#define stop_flag qi(128) 
#define kern_flag qi(128) 
#define skip_byte(A) A.b0
#define next_char(A) A.b1
#define op_byte(A) A.b2
#define rem_byte(A) A.b3 \

#define ext_top(A) A.b0
#define ext_mid(A) A.b1
#define ext_bot(A) A.b2
#define ext_rep(A) A.b3 \

#define slant_code 1
#define space_code 2
#define space_stretch_code 3
#define space_shrink_code 4
#define x_height_code 5
#define quad_code 6
#define extra_space_code 7 \

#define non_char qi(256) 
#define non_address 0 \

#define char_info(A,B) font_info[char_base[A]+B].qqqq
#define char_width(A,B) font_info[width_base[A]+B.b0].sc
#define char_exists(A) (A.b0>min_quarterword) 
#define char_italic(A,B) font_info[italic_base[A]+(qo(B.b2) ) /4].sc
#define height_depth(A) qo(A.b1) 
#define char_height(A,B) font_info[height_base[A]+(B) /16].sc
#define char_depth(A,B) font_info[depth_base[A]+(B) %16].sc
#define char_tag(A) ((qo(A.b2) ) %4)  \

#define char_kern(A,B) font_info[kern_base[A]+256*op_byte(B) +rem_byte(B) ].sc
#define kern_base_offset 256*(128+min_quarterword) 
#define lig_kern_start(A,B) lig_kern_base[A]+B.b3
#define lig_kern_restart(A,B) lig_kern_base[A]+256*op_byte(B) +rem_byte(B) +32768-kern_base_offset \

#define param_end(A) param_base[A]].sc
#define param(A) font_info[A+param_end
#define slant param(slant_code) 
#define space param(space_code) 
#define space_stretch param(space_stretch_code) 
#define space_shrink param(space_shrink_code) 
#define x_height param(x_height_code) 
#define quad param(quad_code) 
#define extra_space param(extra_space_code)  \

#define abort goto bad_tfm \

#define start_font_error_message print_err("Font ") ;sprint_cs(u) ; \
print_char('=') ;print_file_name(nom,aire,"") ; \
if(s>=0)  \
{print(" at ") ;print_scaled(s) ;print("pt") ; \
} \
else if(s!=-1000)  \
{print(" scaled ") ;print_int(-s) ; \
} \

#define fget get(tfm_file) 
#define fbyte tfm_file.d
#define read_sixteen(A) {A= fbyte; \
if(A>127) abort; \
fget;A= A*0400+fbyte; \
}
#define store_four_quarters(A) {fget;a= fbyte;qw.b0= qi(a) ; \
fget;b= fbyte;qw.b1= qi(b) ; \
fget;c= fbyte;qw.b2= qi(c) ; \
fget;d= fbyte;qw.b3= qi(d) ; \
A= qw; \
} \

#define check_byte_range(A) {if((A<bc) ||(A>ec) ) abort;}
#define current_character_being_worked_on k+bc-fmem_ptr \

#define store_scaled(A) {fget;a= fbyte;fget;b= fbyte; \
fget;c= fbyte;fget;d= fbyte; \
sw= (((((d*z) /0400) +(c*z) ) /0400) +(b*z) ) /beta; \
if(a==0) A= sw;else if(a==255) A= sw-alpha;else abort; \
} \

#define check_existence(A)  \
{check_byte_range(A) ; \
qw= char_info(f,A) ; \
if(!char_exists(qw) ) abort; \
} \

#define adjust(A) A[f]= qo(A[f])  \
 \

#define set_char_0 0
#define set1 128
#define set_rule 132
#define put_rule 137
#define nop 138
#define bop 139
#define eop 140
#define push 141
#define pop 142
#define right1 143
#define w0 147
#define w1 148
#define x0 152
#define x1 153
#define down1 157
#define y0 161
#define y1 162
#define z0 166
#define z1 167
#define fnt_num_0 171
#define fnt1 235
#define xxx1 239
#define xxx4 242
#define fnt_def1 243
#define pre 247
#define post 248
#define post_post 249 \

#define id_byte 2 \

#define dvi_out(A) {dvi_buf[dvi_ptr]= A;incr(dvi_ptr) ; \
if(dvi_ptr==dvi_limit) dvi_swap() ; \
} \

#define movement_node_size 3
#define location(A) mem[A+2].i \

#define y_here 1
#define z_here 2
#define yz_OK 3
#define y_OK 4
#define z_OK 5
#define d_fixed 6 \

#define none_seen 0
#define y_seen 6
#define z_seen 12 \

#define synch_h if(cur_h!=dvi_h)  \
{movement(cur_h-dvi_h,right1) ;dvi_h= cur_h; \
}
#define synch_v if(cur_v!=dvi_v)  \
{movement(cur_v-dvi_v,down1) ;dvi_v= cur_v; \
} \

#define billion float_constant(1000000000) 
#define vet_glue(A) glue_temp= A; \
if(glue_temp>billion)  \
glue_temp= billion; \
else if(glue_temp<-billion)  \
glue_temp= -billion \

#define exactly 0
#define additional 1
#define natural 0,additional \

#define noad_size 4
#define nucleus(A) A+1
#define supscr(A) A+2
#define subscr(A) A+3
#define math_type(A) link(A) 
#define fam font
#define math_char 1
#define sub_box 2
#define sub_mlist 3
#define math_text_char 4 \

#define ord_noad (unset_node+3) 
#define op_noad (ord_noad+1) 
#define bin_noad (ord_noad+2) 
#define rel_noad (ord_noad+3) 
#define open_noad (ord_noad+4) 
#define close_noad (ord_noad+5) 
#define punct_noad (ord_noad+6) 
#define inner_noad (ord_noad+7) 
#define limits 1
#define no_limits 2 \

#define left_delimiter(A) A+4
#define right_delimiter(A) A+5
#define radical_noad (inner_noad+1) 
#define radical_noad_size 5
#define fraction_noad (radical_noad+1) 
#define fraction_noad_size 6
#define small_fam(A) mem[A].qqqq.b0
#define small_char(A) mem[A].qqqq.b1
#define large_fam(A) mem[A].qqqq.b2
#define large_char(A) mem[A].qqqq.b3
#define thickness(A) width(A) 
#define default_code 010000000000
#define numerator(A) supscr(A) 
#define denominator(A) subscr(A)  \

#define under_noad (fraction_noad+1) 
#define over_noad (under_noad+1) 
#define accent_noad (over_noad+1) 
#define accent_noad_size 5
#define accent_chr(A) A+4
#define vcenter_noad (accent_noad+1) 
#define left_noad (vcenter_noad+1) 
#define right_noad (left_noad+1) 
#define delimiter(A) nucleus(A) 
#define scripts_allowed(A) (type(A) >=ord_noad) &&(type(A) <left_noad)  \

#define style_node (unset_node+1) 
#define style_node_size 3
#define display_style 0
#define text_style 2
#define script_style 4
#define script_script_style 6
#define cramped 1 \

#define choice_node (unset_node+2) 
#define display_mlist(A) info(A+1) 
#define text_mlist(A) link(A+1) 
#define script_mlist(A) info(A+2) 
#define script_script_mlist(A) link(A+2)  \

#define text_size 0
#define script_size 16
#define script_script_size 32 \

#define mathsy_end(A) fam_fnt(2+A) ]].sc
#define mathsy(A) font_info[A+param_base[mathsy_end
#define math_x_height mathsy(5) 
#define math_quad mathsy(6) 
#define num1 mathsy(8) 
#define num2 mathsy(9) 
#define num3 mathsy(10) 
#define denom1 mathsy(11) 
#define denom2 mathsy(12) 
#define sup1 mathsy(13) 
#define sup2 mathsy(14) 
#define sup3 mathsy(15) 
#define sub1 mathsy(16) 
#define sub2 mathsy(17) 
#define sup_drop mathsy(18) 
#define sub_drop mathsy(19) 
#define delim1 mathsy(20)  \

#define delim2 mathsy(21) 
#define axis_height mathsy(22) 
#define total_mathsy_params 22 \

#define mathex(A) font_info[A+param_base[fam_fnt(3+cur_size) ]].sc
#define default_rule_thickness mathex(8) 
#define big_op_spacing1 mathex(9) 
#define big_op_spacing2 mathex(10) 
#define big_op_spacing3 mathex(11) 
#define big_op_spacing4 mathex(12) 
#define big_op_spacing5 mathex(13) 
#define total_mathex_params 13 \

#define cramped_style(A) 2*(A/2) +cramped
#define sub_style(A) 2*(A/4) +script_style+cramped
#define sup_style(A) 2*(A/4) +script_style+(A%2) 
#define num_style(A) A+2-2*(A/6) 
#define denom_style(A) 2*(A/2) +cramped+2-2*(A/6)  \

#define mu_mult(A) nx_plus_y(n,A,xn_over_d(A,f,0200000) )  \

#define new_hlist(A) mem[nucleus(A) ].i \

#define choose_mlist(A) {p= A(q) ;A(q) = null;} \

#define math_spacing  \
 \
"0234000122*4000133**3**344*0400400*000000234000111*1111112341011" \
 \

#define u_part(A) mem[A+height_offset].i
#define v_part(A) mem[A+depth_offset].i
#define extra_info(A) info(A+list_offset)  \

#define preamble link(align_head) 
#define align_stack_node_size 5 \

#define span_code 256
#define cr_code 257
#define cr_cr_code (cr_code+1) 
#define end_template_token cs_token_flag+frozen_end_template \

#define span_node_size 2 \

#define tight_fit 3 \

#define loose_fit 1 \

#define very_loose_fit 0 \

#define decent_fit 2 \

#define active_node_size 3
#define fitness(A) subtype(A) 
#define break_node(A) rlink(A) 
#define line_number(A) llink(A) 
#define total_demerits(A) mem[A+2].i
#define unhyphenated 0
#define hyphenated 1
#define last_active active \

#define passive_node_size 2
#define cur_break(A) rlink(A) 
#define prev_break(A) llink(A) 
#define serial(A) info(A)  \

#define delta_node_size 7
#define delta_node 2 \

#define do_all_six(A) A(1) ;A(2) ;A(3) ;A(4) ;A(5) ;A(6)  \

#define check_shrinkage(A) if((shrink_order(A) !=normal) &&(shrink(A) !=0) )  \
{A= finite_shrink(A) ; \
} \

#define copy_to_cur_active(A) cur_active_width[A]= active_width[A]
#define update_width(A)  \
cur_active_width[A]= cur_active_width[A]+mem[r+A].sc \

#define awful_bad 07777777777 \

#define set_break_width_to_background(A) break_width[A]= background[A] \

#define convert_to_break_width(A)  \
mem[prev_r+A].sc= mem[prev_r+A].sc \
-cur_active_width[A]+break_width[A]
#define store_break_width(A) active_width[A]= break_width[A]
#define new_delta_to_break_width(A)  \
mem[q+A].sc= break_width[A]-cur_active_width[A] \

#define new_delta_from_break_width(A) mem[q+A].sc=  \
cur_active_width[A]-break_width[A] \

#define combine_two_deltas(A) mem[prev_r+A].sc= mem[prev_r+A].sc+mem[r+A].sc
#define downdate_width(A) cur_active_width[A]= cur_active_width[A]- \
mem[prev_r+A].sc \

#define update_active(A) active_width[A]= active_width[A]+mem[r+A].sc \

#define store_background(A) active_width[A]= background[A] \

#define act_width active_width[1]
#define kern_break {if(!is_char_node(link(cur_p) ) &&auto_breaking)  \
if(type(link(cur_p) ) ==glue_node) try_break(0,unhyphenated) ; \
act_width= act_width+width(cur_p) ; \
} \

#define next_break prev_break \

#define append_charnode_to_t(A) {link(t) = get_avail() ;t= link(t) ; \
font(t) = hf;character(t) = A; \
}
#define set_cur_r {if(j<n) cur_r= qi(hu[j+1]) ;else cur_r= bchar; \
if(odd(hyf[j]) ) cur_rh= hchar;else cur_rh= non_char; \
} \

#define wrap_lig(A) if(ligature_present)  \
{p= new_ligature(hf,cur_l,link(cur_q) ) ; \
if(lft_hit)  \
{subtype(p) = 2;lft_hit= false; \
} \
if(A) if(lig_stack==null)  \
{incr(subtype(p) ) ;rt_hit= false; \
} \
link(cur_q) = p;t= p;ligature_present= false; \
}
#define pop_lig_stack {if(lig_ptr(lig_stack) >null)  \
{link(t) = lig_ptr(lig_stack) ; \
t= link(t) ;incr(j) ; \
} \
p= lig_stack;lig_stack= link(p) ;free_node(p,small_node_size) ; \
if(lig_stack==null) set_cur_r else cur_r= character(lig_stack) ; \
} \

#define advance_major_tail {major_tail= link(major_tail) ;incr(r_count) ; \
} \

#define trie_link(A) trie[A].rh
#define trie_char(A) trie[A].b1
#define trie_op(A) trie[A].b0 \

#define set_cur_lang if(language<=0) cur_lang= 0; \
else if(language>255) cur_lang= 0; \
else cur_lang= language \

#define trie_root trie_l[0] \

#define trie_ref trie_hash
#define trie_back(A) trie[A].lh \

#define active_height active_width
#define cur_height active_height[1]
#define set_height_zero(A) active_height[A]= 0 \

#define deplorable 100000 \

#define inserts_only 1 \

#define box_there 2 \

#define page_ins_node_size 4
#define inserting 0
#define split_up 1
#define broken_ptr(A) link(A+1)  \

#define broken_ins(A) info(A+1) 
#define last_ins_ptr(A) link(A+2) 
#define best_ins_ptr(A) info(A+2)  \

#define page_goal page_so_far[0]
#define page_total page_so_far[1]
#define page_shrink page_so_far[6]
#define page_depth page_so_far[7] \

#define print_plus(A,B) if(page_so_far[A]!=0)  \
{print(" plus ") ;print_scaled(page_so_far[A]) ;print(B) ;} \

#define set_page_so_far_zero(A) page_so_far[A]= 0 \

#define contrib_tail nest[0].tail_field \

#define adjust_space_factor  \
main_s= sf_code(cur_chr) ; \
if(main_s==1000) space_factor= 1000; \
else if(main_s<1000)  \
{if(main_s>0) space_factor= main_s; \
} \
else if(space_factor<1000) space_factor= 1000; \
else space_factor= main_s \

#define pack_lig(X)  \
{main_p= new_ligature(main_f,cur_l,link(cur_q) ) ; \
if(lft_hit)  \
{subtype(main_p) = 2;lft_hit= false; \
} \
if(X) if(lig_stack==null)  \
{incr(subtype(main_p) ) ;rt_hit= false; \
} \
link(cur_q) = main_p;tail= main_p;ligature_present= false; \
} \

#define wrapup(A) if(cur_l<non_char)  \
{if(link(cur_q) >null)  \
if(character(tail) ==qi(hyphen_char[main_f]) ) ins_disc= true; \
if(ligature_present) pack_lig(A) ; \
if(ins_disc)  \
{ins_disc= false; \
if(mode>0) tail_append(new_disc() ) ; \
} \
} \

#define any_mode(A) case vmode+A:case hmode+A:case mmode+A \

#define non_math(A) case vmode+A:case hmode+A \

#define fil_code 0
#define fill_code 1
#define ss_code 2
#define fil_neg_code 3
#define skip_code 4
#define mskip_code 5 \

#define box_flag 010000000000
#define ship_out_flag box_flag+512
#define leader_flag box_flag+513
#define box_code 0
#define copy_code 1
#define last_box_code 2
#define vsplit_code 3
#define vtop_code 4 \

#define fam_in_range ((cur_fam>=0) &&(cur_fam<16) )  \

#define above_code 0
#define over_code 1
#define atop_code 2
#define delimited_code 3 \

#define global (a>=4) 
#define define(A,B,C) if(global) geq_define(A,B,C) ;else eq_define(A,B,C) 
#define word_define(A,B) if(global) geq_word_define(A,B) ;else eq_word_define(A,B)  \

#define char_def_code 0
#define math_char_def_code 1
#define count_def_code 2
#define dimen_def_code 3
#define skip_def_code 4
#define mu_skip_def_code 5
#define toks_def_code 6 \

#define show_code 0
#define show_box_code 1
#define show_the_code 2
#define show_lists 3 \

#define too_small(X) {wake_up_terminal; \
wterm_ln("---! Must increase the %s",X) ; \
 \
goto bad_fmt; \
} \

#define dump_wd(A) {fmt_file.d= A;put(fmt_file) ;}
#define dump_int(A) {fmt_file.d.i= A;put(fmt_file) ;}
#define dump_hh(A) {fmt_file.d.hh= A;put(fmt_file) ;}
#define dump_qqqq(A) {fmt_file.d.qqqq= A;put(fmt_file) ;} \

#define undump_wd(A) {get(fmt_file) ;A= fmt_file.d;}
#define undump_int(A) {get(fmt_file) ;A= fmt_file.d.i;}
#define undump_hh(A) {get(fmt_file) ;A= fmt_file.d.hh;}
#define undump_qqqq(A) {get(fmt_file) ;A= fmt_file.d.qqqq;}
#define undump(A,B,C) {undump_int(x) ;if((x<A) ||(x>B) ) goto bad_fmt;else C= x;}
#define undump_size(A,B,C,D) {undump_int(x) ; \
if(x<A) goto bad_fmt;if(x>B) too_small(C) else D= x;} \

#define dump_four_ASCII  \
w.b0= qi(so(str_pool[k]) ) ;w.b1= qi(so(str_pool[k+1]) ) ; \
w.b2= qi(so(str_pool[k+2]) ) ;w.b3= qi(so(str_pool[k+3]) ) ; \
dump_qqqq(w)  \

#define undump_four_ASCII  \
undump_qqqq(w) ; \
str_pool[k]= si(qo(w.b0) ) ;str_pool[k+1]= si(qo(w.b1) ) ; \
str_pool[k+2]= si(qo(w.b2) ) ;str_pool[k+3]= si(qo(w.b3) )  \

#define write_node_size 2
#define open_node_size 3
#define open_node 0
#define write_node 1
#define close_node 2
#define special_node 3
#define language_node 4
#define what_lang(A) link(A+1) 
#define what_lhm(A) type(A+1) 
#define what_rhm(A) subtype(A+1) 
#define write_tokens(A) link(A+1) 
#define write_stream(A) info(A+1) 
#define open_name(A) link(A+1) 
#define open_area(A) info(A+2) 
#define open_ext(A) link(A+2)  \

#define immediate_code 4
#define set_language_code 5 \

#define adv_past(A) if(subtype(A) ==language_node)  \
{cur_lang= what_lang(A) ;l_hyf= what_lhm(A) ;r_hyf= what_rhm(A) ;} \

#define end_write_token cs_token_flag+end_write \


	#line 254 "ctex.w"

enum{	/*11:*/
	#line 353 "ctex.w"

mem_max= 30000,


mem_min= 0,


buf_size= 500,


error_line= 72,
half_error_line= 42,

max_print_line= 79,
stack_size= 200,
max_in_open= 6,

font_max= 75,

font_mem_size= 20000,
param_size= 60,
nest_size= 40,
max_strings= 3000,
string_vacancies= 8000,


pool_size= 32000,



save_size= 600,

trie_size= 8000,

trie_op_size= 500,
dvi_buf_size= 800,
file_name_size= 40,
empty_string= 256

	/*:11*/
	#line 255 "ctex.w"
};
	/*18:*/
	#line 493 "ctex.w"

typedef uint8_t ASCII_code;

	/*:18*/	/*25:*/
	#line 729 "ctex.w"

typedef uint8_t eight_bits;
typedef struct{FILE*f;text_char d;}alpha_file;
typedef struct{FILE*f;eight_bits d;}byte_file;

	/*:25*/	/*38:*/
	#line 1089 "ctex.w"

typedef int16_t pool_pointer;
typedef int16_t str_number;
typedef uint8_t packed_ASCII_code;

	/*:38*/	/*100:*/
	#line 2121 "ctex.w"

typedef int scaled;
typedef int32_t nonnegative_integer;
typedef int8_t small_number;

	/*:100*/	/*108:*/
	#line 2315 "ctex.w"

#if __SIZEOF_FLOAT__==4
typedef float float32_t;
#else
#error  float type must have size 4
#endif
typedef float glue_ratio;

	/*:108*/	/*112:*/
	#line 2424 "ctex.w"

typedef uint8_t quarterword;
typedef uint16_t halfword;
typedef int8_t two_choices;
typedef int8_t four_choices;
typedef struct{
halfword rh;
union{
halfword lh;
struct{quarterword b0;quarterword b1;};
};}two_halves;
typedef struct{
quarterword b0;
quarterword b1;
quarterword b2;
quarterword b3;
}four_quarters;
typedef struct{
union{
int i;
glue_ratio gr;
two_halves hh;
four_quarters qqqq;
};}memory_word;
typedef struct{FILE*f;memory_word d;}word_file;

	/*:112*/	/*149:*/
	#line 3147 "ctex.w"

typedef int8_t glue_ord;

	/*:149*/	/*211:*/
	#line 4304 "ctex.w"

typedef struct{int16_t mode_field;
pointer head_field,tail_field;
int pg_field,ml_field;
memory_word aux_field;
}list_state_record;

	/*:211*/	/*268:*/
	#line 5870 "ctex.w"

typedef int8_t group_code;

	/*:268*/	/*299:*/
	#line 6446 "ctex.w"

typedef struct{
quarterword state_field,index_field;
halfword start_field,loc_field,limit_field,name_field;
}in_state_record;

	/*:299*/	/*547:*/
	#line 10711 "ctex.w"

typedef int8_t internal_font_number;
typedef int16_t font_index;

	/*:547*/	/*593:*/
	#line 11884 "ctex.w"

typedef int16_t dvi_index;

	/*:593*/	/*919:*/
	#line 18094 "ctex.w"

typedef int16_t trie_pointer;

	/*:919*/	/*924:*/
	#line 18160 "ctex.w"

typedef int16_t hyph_pointer;

	/*:924*/
	#line 256 "ctex.w"

	/*13:*/
	#line 422 "ctex.w"

static int bad;

	/*:13*/	/*20:*/
	#line 534 "ctex.w"

static ASCII_code xord[256];

static text_char xchr[256];


	/*:20*/	/*26:*/
	#line 746 "ctex.w"

static unsigned char name_of_file0[file_name_size+1]= {0},*const name_of_file= name_of_file0-1;

static int name_length;


	/*:26*/	/*30:*/
	#line 848 "ctex.w"

static ASCII_code buffer[buf_size+1];
static int first;
static int last;
static int max_buf_stack;

	/*:30*/	/*32:*/
	#line 921 "ctex.w"

static alpha_file term_in;
static alpha_file term_out;

	/*:32*/	/*39:*/
	#line 1094 "ctex.w"

static packed_ASCII_code str_pool[pool_size+1];
static pool_pointer str_start[max_strings+1];
static pool_pointer pool_ptr;
static str_number str_ptr;
static pool_pointer init_pool_ptr;
static str_number init_str_ptr;

	/*:39*/	/*53:*/
	#line 1336 "ctex.w"

static alpha_file log_file;
static int selector;
static int8_t dig[23];
static int tally;
static int term_offset;

static int file_offset;

static ASCII_code trick_buf[error_line+1];

static int trick_count;
static int first_count;

	/*:53*/	/*72:*/
	#line 1693 "ctex.w"

static int interaction;

	/*:72*/	/*75:*/
	#line 1734 "ctex.w"

static bool deletions_allowed;
static bool set_box_allowed;
static int history;
static int error_count;


	/*:75*/	/*78:*/
	#line 1793 "ctex.w"

static char*help_line[6];
static int help_ptr;
static bool use_err_help;

	/*:78*/	/*95:*/
	#line 2058 "ctex.w"

static int interrupt;
static bool OK_to_interrupt;

	/*:95*/	/*103:*/
	#line 2191 "ctex.w"

static bool arith_error;
static scaled rem;

	/*:103*/	/*114:*/
	#line 2487 "ctex.w"

static pointer temp_ptr;

	/*:114*/	/*115:*/
	#line 2519 "ctex.w"

static memory_word mem0[mem_max-mem_min+1],*const mem= mem0-mem_min;
static pointer lo_mem_max;
static pointer hi_mem_min;

	/*:115*/	/*116:*/
	#line 2532 "ctex.w"

static int var_used,dyn_used;
#ifdef STAT
#define incr_dyn_used incr(dyn_used)
#define decr_dyn_used decr(dyn_used)
#else
#define incr_dyn_used
#define decr_dyn_used
#endif

	/*:116*/	/*117:*/
	#line 2555 "ctex.w"

static pointer avail;
static pointer mem_end;

	/*:117*/	/*123:*/
	#line 2660 "ctex.w"

static pointer rover;

	/*:123*/	/*164:*/
	#line 3363 "ctex.w"

#ifdef DEBUG
static bool is_free0[mem_max-mem_min+1],*const is_free= is_free0-mem_min;
static bool was_free0[mem_max-mem_min+1],*const was_free= was_free0-mem_min;

static pointer was_mem_end,was_lo_max,was_hi_min;

static bool panicking;
#endif

	/*:164*/	/*172:*/
	#line 3517 "ctex.w"

static int font_in_short_display;

	/*:172*/	/*180:*/
	#line 3645 "ctex.w"

static int depth_threshold;
static int breadth_max;

	/*:180*/	/*212:*/
	#line 4322 "ctex.w"

static list_state_record nest[nest_size+1];
static int nest_ptr;
static int max_nest_stack;
static list_state_record cur_list;
static int shown_mode;

	/*:212*/	/*245:*/
	#line 5271 "ctex.w"

static int old_setting;

	/*:245*/	/*252:*/
	#line 5437 "ctex.w"

static memory_word eqtb0[eqtb_size-active_base+1],*const eqtb= eqtb0-active_base;
static quarterword xeq_level0[eqtb_size-int_base+1],*const xeq_level= xeq_level0-int_base;

	/*:252*/	/*255:*/
	#line 5485 "ctex.w"

static two_halves hash0[undefined_control_sequence-hash_base],*const hash= hash0-hash_base;

static pointer hash_used;
static bool no_new_control_sequence;
static int cs_count;

	/*:255*/	/*270:*/
	#line 5879 "ctex.w"

static memory_word save_stack[save_size+1];
static int save_ptr;
static int max_save_stack;
static quarterword cur_level;
static group_code cur_group;
static int cur_boundary;

	/*:270*/	/*285:*/
	#line 6117 "ctex.w"

static int mag_set;

	/*:285*/	/*296:*/
	#line 6375 "ctex.w"

static eight_bits cur_cmd;
static halfword cur_chr;
static pointer cur_cs;
static halfword cur_tok;

	/*:296*/	/*300:*/
	#line 6452 "ctex.w"

static in_state_record input_stack[stack_size+1];
static int input_ptr;
static int max_in_stack;
static in_state_record cur_input;


	/*:300*/	/*303:*/
	#line 6554 "ctex.w"

static int in_open;
static int open_parens;
static alpha_file input_file0[max_in_open],*const input_file= input_file0-1;
static int line;
static int line_stack0[max_in_open],*const line_stack= line_stack0-1;

	/*:303*/	/*304:*/
	#line 6597 "ctex.w"

static int scanner_status;
static pointer warning_index;
static pointer def_ref;

	/*:304*/	/*307:*/
	#line 6721 "ctex.w"

static pointer param_stack[param_size+1];

static int param_ptr;
static int max_param_stack;


	/*:307*/	/*308:*/
	#line 6738 "ctex.w"

static int align_state;

	/*:308*/	/*309:*/
	#line 6749 "ctex.w"

static int base_ptr;

	/*:309*/	/*332:*/
	#line 7126 "ctex.w"

static pointer par_loc;
static halfword par_token;

	/*:332*/	/*360:*/
	#line 7543 "ctex.w"

static bool force_eof;

	/*:360*/	/*381:*/
	#line 7857 "ctex.w"

static pointer cur_mark0[split_bot_mark_code-top_mark_code+1],*const cur_mark= cur_mark0-top_mark_code;


	/*:381*/	/*386:*/
	#line 7906 "ctex.w"

static int long_state;

	/*:386*/	/*387:*/
	#line 7917 "ctex.w"

static pointer pstack[9];

	/*:387*/	/*409:*/
	#line 8300 "ctex.w"

static int cur_val;
static int cur_val_level;

	/*:409*/	/*437:*/
	#line 8670 "ctex.w"

static small_number radix;

	/*:437*/	/*446:*/
	#line 8805 "ctex.w"

static glue_ord cur_order;

	/*:446*/	/*479:*/
	#line 9411 "ctex.w"

static alpha_file read_file[16];
static int8_t read_open[17];

	/*:479*/	/*488:*/
	#line 9598 "ctex.w"

static pointer cond_ptr;
static int if_limit;
static small_number cur_if;
static int if_line;

	/*:488*/	/*492:*/
	#line 9624 "ctex.w"

static int skip_line;

	/*:492*/	/*511:*/
	#line 9951 "ctex.w"

static str_number cur_name;
static char*cur_area;
static char*cur_ext;

	/*:511*/	/*512:*/
	#line 9967 "ctex.w"

static pool_pointer area_delimiter;
static pool_pointer ext_delimiter;
static int cur_file_name_length;

	/*:512*/	/*519:*/
	#line 10102 "ctex.w"

static unsigned char TEX_format_default0[format_default_length]= "TeXformats/plain.fmt",*const TEX_format_default= TEX_format_default0-1;




	/*:519*/	/*526:*/
	#line 10238 "ctex.w"

static bool name_in_progress;
static str_number job_name;
static bool log_opened;

	/*:526*/	/*531:*/
	#line 10310 "ctex.w"

static byte_file dvi_file;
static str_number output_file_name;
static str_number log_name;

	/*:531*/	/*538:*/
	#line 10433 "ctex.w"

static byte_file tfm_file;

	/*:538*/	/*548:*/
	#line 10720 "ctex.w"

static memory_word font_info[font_mem_size+1];

static font_index fmem_ptr;
static internal_font_number font_ptr;
static four_quarters font_check0[font_max-font_base+1],*const font_check= font_check0-font_base;
static scaled font_size0[font_max-font_base+1],*const font_size= font_size0-font_base;
static scaled font_dsize0[font_max-font_base+1],*const font_dsize= font_dsize0-font_base;
static font_index font_params0[font_max-font_base+1],*const font_params= font_params0-font_base;

static str_number font_name0[font_max-font_base+1],*const font_name= font_name0-font_base;
static str_number font_area0[font_max-font_base+1],*const font_area= font_area0-font_base;
static eight_bits font_bc0[font_max-font_base+1],*const font_bc= font_bc0-font_base;

static eight_bits font_ec0[font_max-font_base+1],*const font_ec= font_ec0-font_base;

static pointer font_glue0[font_max-font_base+1],*const font_glue= font_glue0-font_base;

static bool font_used0[font_max-font_base+1],*const font_used= font_used0-font_base;

static int hyphen_char0[font_max-font_base+1],*const hyphen_char= hyphen_char0-font_base;

static int skew_char0[font_max-font_base+1],*const skew_char= skew_char0-font_base;

static font_index bchar_label0[font_max-font_base+1],*const bchar_label= bchar_label0-font_base;


static int16_t font_bchar0[font_max-font_base+1],*const font_bchar= font_bchar0-font_base;

static int16_t font_false_bchar0[font_max-font_base+1],*const font_false_bchar= font_false_bchar0-font_base;


	/*:548*/	/*549:*/
	#line 10761 "ctex.w"

static int char_base0[font_max-font_base+1],*const char_base= char_base0-font_base;

static int width_base0[font_max-font_base+1],*const width_base= width_base0-font_base;

static int height_base0[font_max-font_base+1],*const height_base= height_base0-font_base;

static int depth_base0[font_max-font_base+1],*const depth_base= depth_base0-font_base;

static int italic_base0[font_max-font_base+1],*const italic_base= italic_base0-font_base;

static int lig_kern_base0[font_max-font_base+1],*const lig_kern_base= lig_kern_base0-font_base;

static int kern_base0[font_max-font_base+1],*const kern_base= kern_base0-font_base;

static int exten_base0[font_max-font_base+1],*const exten_base= exten_base0-font_base;

static int param_base0[font_max-font_base+1],*const param_base= param_base0-font_base;


	/*:549*/	/*554:*/
	#line 10850 "ctex.w"

static four_quarters null_character;

	/*:554*/	/*591:*/
	#line 11843 "ctex.w"

static int total_pages;
static scaled max_v;
static scaled max_h;
static int max_push;
static int last_bop;
static int dead_cycles;
static bool doing_leaders;

static quarterword c,f;
static scaled rule_ht,rule_dp,rule_wd;
static pointer g;
static int lq,lr;

	/*:591*/	/*594:*/
	#line 11891 "ctex.w"

static eight_bits dvi_buf[dvi_buf_size+1];
static dvi_index half_buf;
static dvi_index dvi_limit;
static dvi_index dvi_ptr;
static int dvi_offset;

static int dvi_gone;

	/*:594*/	/*604:*/
	#line 12056 "ctex.w"

static pointer down_ptr,right_ptr;

	/*:604*/	/*615:*/
	#line 12278 "ctex.w"

static scaled dvi_h,dvi_v;
static scaled cur_h,cur_v;
static internal_font_number dvi_f;
static int cur_s;

	/*:615*/	/*645:*/
	#line 12882 "ctex.w"

static scaled total_stretch0[filll-normal+1],*const total_stretch= total_stretch0-normal,total_shrink0[filll-normal+1],*const total_shrink= total_shrink0-normal;

static int last_badness;

	/*:645*/	/*646:*/
	#line 12892 "ctex.w"

static pointer adjust_tail;

	/*:646*/	/*660:*/
	#line 13066 "ctex.w"

static int pack_begin_line;


	/*:660*/	/*683:*/
	#line 13482 "ctex.w"

static two_halves empty_field;
static four_quarters null_delimiter;

	/*:683*/	/*718:*/
	#line 14134 "ctex.w"

static pointer cur_mlist;
static small_number cur_style;
static small_number cur_size;
static scaled cur_mu;
static bool mlist_penalties;

	/*:718*/	/*723:*/
	#line 14224 "ctex.w"

static internal_font_number cur_f;
static quarterword cur_c;
static four_quarters cur_i;


	/*:723*/	/*764:*/
	#line 15035 "ctex.w"

static const int magic_offset= -9*ord_noad;

	/*:764*/	/*769:*/
	#line 15233 "ctex.w"

static pointer cur_align;
static pointer cur_span;
static pointer cur_loop;
static pointer align_ptr;
static pointer cur_head,cur_tail;

	/*:769*/	/*813:*/
	#line 16006 "ctex.w"

static pointer just_box;

	/*:813*/	/*820:*/
	#line 16149 "ctex.w"

static pointer passive;
static pointer printed_node;
static halfword pass_number;

	/*:820*/	/*822:*/
	#line 16188 "ctex.w"

static scaled active_width0[6],*const active_width= active_width0-1;

static scaled cur_active_width0[6],*const cur_active_width= cur_active_width0-1;
static scaled background0[6],*const background= background0-1;
static scaled break_width0[6],*const break_width= break_width0-1;

	/*:822*/	/*824:*/
	#line 16245 "ctex.w"

static bool no_shrink_error_yet;

	/*:824*/	/*827:*/
	#line 16297 "ctex.w"

static pointer cur_p;
static bool second_pass;
static bool final_pass;
static int threshold;

	/*:827*/	/*832:*/
	#line 16398 "ctex.w"

static int minimal_demerits0[tight_fit-very_loose_fit+1],*const minimal_demerits= minimal_demerits0-very_loose_fit;

static int minimum_demerits;

static pointer best_place0[tight_fit-very_loose_fit+1],*const best_place= best_place0-very_loose_fit;

static halfword best_pl_line0[tight_fit-very_loose_fit+1],*const best_pl_line= best_pl_line0-very_loose_fit;


	/*:832*/	/*838:*/
	#line 16516 "ctex.w"

static scaled disc_width;

	/*:838*/	/*846:*/
	#line 16656 "ctex.w"

static halfword easy_line;
static halfword last_special_line;

static scaled first_width;

static scaled second_width;
static scaled first_indent;
static scaled second_indent;

	/*:846*/	/*871:*/
	#line 17166 "ctex.w"

static pointer best_bet;
static int fewest_demerits;
static halfword best_line;
static int actual_looseness;

static int line_diff;


	/*:871*/	/*891:*/
	#line 17500 "ctex.w"

static int16_t hc[66];
static small_number hn;
static pointer ha,hb;
static internal_font_number hf;
static int16_t hu[64];
static int hyf_char;
static ASCII_code cur_lang,init_cur_lang;
static int l_hyf,r_hyf,init_l_hyf,init_r_hyf;
static halfword hyf_bchar;

	/*:891*/	/*899:*/
	#line 17633 "ctex.w"

static int8_t hyf[65];
static pointer init_list;
static bool init_lig;
static bool init_lft;

	/*:899*/	/*904:*/
	#line 17757 "ctex.w"

static small_number hyphen_passed;

	/*:904*/	/*906:*/
	#line 17798 "ctex.w"

static halfword cur_l,cur_r;
static pointer cur_q;
static pointer lig_stack;
static bool ligature_present;
static bool lft_hit,rt_hit;

	/*:906*/	/*920:*/
	#line 18101 "ctex.w"

static two_halves trie[trie_size+1];
static small_number hyf_distance0[trie_op_size],*const hyf_distance= hyf_distance0-1;
static small_number hyf_num0[trie_op_size],*const hyf_num= hyf_num0-1;
static quarterword hyf_next0[trie_op_size],*const hyf_next= hyf_next0-1;
static int16_t op_start[256];

	/*:920*/	/*925:*/
	#line 18163 "ctex.w"

static str_number hyph_word[hyph_size+1];
static pointer hyph_list[hyph_size+1];
static hyph_pointer hyph_count;

	/*:925*/	/*942:*/
	#line 18372 "ctex.w"

#ifdef INIT
static int16_t trie_op_hash0[trie_op_size+trie_op_size+1],*const trie_op_hash= trie_op_hash0+trie_op_size;

static quarterword trie_used[256];

static ASCII_code trie_op_lang0[trie_op_size],*const trie_op_lang= trie_op_lang0-1;

static quarterword trie_op_val0[trie_op_size],*const trie_op_val= trie_op_val0-1;

static int trie_op_ptr;
#endif

	/*:942*/	/*946:*/
	#line 18465 "ctex.w"

#ifdef INIT
static packed_ASCII_code trie_c[trie_size+1];

static quarterword trie_o[trie_size+1];

static trie_pointer trie_l[trie_size+1];

static trie_pointer trie_r[trie_size+1];

static trie_pointer trie_ptr;
static trie_pointer trie_hash[trie_size+1];

#endif

	/*:946*/	/*949:*/
	#line 18552 "ctex.w"

#ifdef INIT
static bool trie_taken0[trie_size],*const trie_taken= trie_taken0-1;

static trie_pointer trie_min[256];

static trie_pointer trie_max;
static bool trie_not_ready;
#endif

	/*:949*/	/*970:*/
	#line 18911 "ctex.w"

static scaled best_height_plus_depth;


	/*:970*/	/*979:*/
	#line 19118 "ctex.w"

static pointer page_tail;
static int page_contents;
static scaled page_max_depth;
static pointer best_page_break;
static int least_page_cost;
static scaled best_size;

	/*:979*/	/*981:*/
	#line 19200 "ctex.w"

static scaled page_so_far[8];
static pointer last_glue;
static int last_penalty;
static scaled last_kern;
static int insert_penalties;

	/*:981*/	/*988:*/
	#line 19333 "ctex.w"

static bool output_active;

	/*:988*/	/*1031:*/
	#line 20052 "ctex.w"

static internal_font_number main_f;
static four_quarters main_i;
static four_quarters main_j;
static font_index main_k;
static pointer main_p;
static int main_s;
static halfword bchar;
static halfword false_bchar;
static bool cancel_boundary;
static bool ins_disc;

	/*:1031*/	/*1073:*/
	#line 20825 "ctex.w"

static pointer cur_box;

	/*:1073*/	/*1265:*/
	#line 23411 "ctex.w"

static halfword after_token;

	/*:1265*/	/*1280:*/
	#line 23514 "ctex.w"

static bool long_help_seen;

	/*:1280*/	/*1298:*/
	#line 23700 "ctex.w"

static str_number format_ident;

	/*:1298*/	/*1304:*/
	#line 23781 "ctex.w"

static word_file fmt_file;

	/*:1304*/	/*1330:*/
	#line 24230 "ctex.w"

static int ready_already;

	/*:1330*/	/*1341:*/
	#line 24562 "ctex.w"

static alpha_file write_file[16];
static bool write_open[18];

	/*:1341*/	/*1344:*/
	#line 24593 "ctex.w"

static pointer write_loc;

	/*:1344*/
	#line 257 "ctex.w"



static void initialize(void)
{	/*19:*/
	#line 527 "ctex.w"

int i;

	/*:19*/	/*162:*/
	#line 3322 "ctex.w"

int k;

	/*:162*/	/*926:*/
	#line 18168 "ctex.w"

int z;

	/*:926*/
	#line 261 "ctex.w"

	/*8:*/
	#line 310 "ctex.w"

	/*21:*/
	#line 549 "ctex.w"

xchr[040]= ' ';
xchr[041]= '!';
xchr[042]= '"';
xchr[043]= '#';
xchr[044]= '$';
xchr[045]= '%';
xchr[046]= '&';
xchr[047]= '\'';
xchr[050]= '(';
xchr[051]= ')';
xchr[052]= '*';
xchr[053]= '+';
xchr[054]= ',';
xchr[055]= '-';
xchr[056]= '.';
xchr[057]= '/';
xchr[060]= '0';
xchr[061]= '1';
xchr[062]= '2';
xchr[063]= '3';
xchr[064]= '4';
xchr[065]= '5';
xchr[066]= '6';
xchr[067]= '7';
xchr[070]= '8';
xchr[071]= '9';
xchr[072]= ':';
xchr[073]= ';';
xchr[074]= '<';
xchr[075]= '=';
xchr[076]= '>';
xchr[077]= '?';
xchr[0100]= '@';
xchr[0101]= 'A';
xchr[0102]= 'B';
xchr[0103]= 'C';
xchr[0104]= 'D';
xchr[0105]= 'E';
xchr[0106]= 'F';
xchr[0107]= 'G';
xchr[0110]= 'H';
xchr[0111]= 'I';
xchr[0112]= 'J';
xchr[0113]= 'K';
xchr[0114]= 'L';
xchr[0115]= 'M';
xchr[0116]= 'N';
xchr[0117]= 'O';
xchr[0120]= 'P';
xchr[0121]= 'Q';
xchr[0122]= 'R';
xchr[0123]= 'S';
xchr[0124]= 'T';
xchr[0125]= 'U';
xchr[0126]= 'V';
xchr[0127]= 'W';
xchr[0130]= 'X';
xchr[0131]= 'Y';
xchr[0132]= 'Z';
xchr[0133]= '[';
xchr[0134]= '\\';
xchr[0135]= ']';
xchr[0136]= '^';
xchr[0137]= '_';
xchr[0140]= '`';
xchr[0141]= 'a';
xchr[0142]= 'b';
xchr[0143]= 'c';
xchr[0144]= 'd';
xchr[0145]= 'e';
xchr[0146]= 'f';
xchr[0147]= 'g';
xchr[0150]= 'h';
xchr[0151]= 'i';
xchr[0152]= 'j';
xchr[0153]= 'k';
xchr[0154]= 'l';
xchr[0155]= 'm';
xchr[0156]= 'n';
xchr[0157]= 'o';
xchr[0160]= 'p';
xchr[0161]= 'q';
xchr[0162]= 'r';
xchr[0163]= 's';
xchr[0164]= 't';
xchr[0165]= 'u';
xchr[0166]= 'v';
xchr[0167]= 'w';
xchr[0170]= 'x';
xchr[0171]= 'y';
xchr[0172]= 'z';
xchr[0173]= '{';
xchr[0174]= '|';
xchr[0175]= '}';
xchr[0176]= '~';

	/*:21*/	/*23:*/
	#line 680 "ctex.w"

for(i= 0;i<=037;i++)xchr[i]= ' ';
for(i= 0177;i<=0377;i++)xchr[i]= ' ';

	/*:23*/	/*24:*/
	#line 690 "ctex.w"

for(i= first_text_char;i<=last_text_char;i++)xord[chr(i)]= invalid_code;
for(i= 0200;i<=0377;i++)xord[xchr[i]]= i;
for(i= 0;i<=0176;i++)xord[xchr[i]]= i;

	/*:24*/	/*73:*/
	#line 1696 "ctex.w"
interaction= error_stop_mode;

	/*:73*/	/*76:*/
	#line 1744 "ctex.w"

deletions_allowed= true;set_box_allowed= true;
error_count= 0;

	/*:76*/	/*79:*/
	#line 1798 "ctex.w"

help_ptr= 0;use_err_help= false;

	/*:79*/	/*96:*/
	#line 2062 "ctex.w"

interrupt= 0;OK_to_interrupt= true;

	/*:96*/	/*165:*/
	#line 3373 "ctex.w"

#ifdef DEBUG
was_mem_end= mem_min;
was_lo_max= mem_min;was_hi_min= mem_max;
panicking= false;
#endif

	/*:165*/	/*214:*/
	#line 4342 "ctex.w"

nest_ptr= 0;max_nest_stack= 0;
mode= vmode;head= contrib_head;tail= contrib_head;
prev_depth= ignore_depth;mode_line= 0;
prev_graf= 0;shown_mode= 0;
	/*990:*/
	#line 19343 "ctex.w"

page_contents= empty;page_tail= page_head;link(page_head)= null;
last_glue= max_halfword;last_penalty= 0;last_kern= 0;
page_depth= 0;page_max_depth= 0

	/*:990*/
	#line 4347 "ctex.w"
;

	/*:214*/	/*253:*/
	#line 5441 "ctex.w"

for(k= int_base;k<=eqtb_size;k++)xeq_level[k]= level_one;

	/*:253*/	/*256:*/
	#line 5492 "ctex.w"

no_new_control_sequence= true;
next(hash_base)= 0;text(hash_base)= 0;
for(k= hash_base+1;k<=undefined_control_sequence-1;k++)hash[k]= hash[hash_base];

	/*:256*/	/*271:*/
	#line 5892 "ctex.w"

save_ptr= 0;cur_level= level_one;cur_group= bottom_level;cur_boundary= 0;
max_save_stack= 0;

	/*:271*/	/*286:*/
	#line 6120 "ctex.w"

mag_set= 0;

	/*:286*/	/*382:*/
	#line 7861 "ctex.w"

top_mark= null;first_mark= null;bot_mark= null;
split_first_mark= null;split_bot_mark= null;

	/*:382*/	/*438:*/
	#line 8677 "ctex.w"

cur_val= 0;cur_val_level= int_val;radix= 0;cur_order= normal;

	/*:438*/	/*480:*/
	#line 9415 "ctex.w"

for(k= 0;k<=16;k++)read_open[k]= closed;

	/*:480*/	/*489:*/
	#line 9604 "ctex.w"

cond_ptr= null;if_limit= normal;cur_if= 0;if_line= 0;

	/*:489*/	/*550:*/
	#line 10781 "ctex.w"

for(k= font_base;k<=font_max;k++)font_used[k]= false;

	/*:550*/	/*555:*/
	#line 10853 "ctex.w"

null_character.b0= min_quarterword;null_character.b1= min_quarterword;
null_character.b2= min_quarterword;null_character.b3= min_quarterword;

	/*:555*/	/*592:*/
	#line 11857 "ctex.w"

total_pages= 0;max_v= 0;max_h= 0;max_push= 0;last_bop= -1;
doing_leaders= false;dead_cycles= 0;cur_s= -1;

	/*:592*/	/*595:*/
	#line 11903 "ctex.w"

half_buf= dvi_buf_size/2;dvi_limit= dvi_buf_size;dvi_ptr= 0;
dvi_offset= 0;dvi_gone= 0;

	/*:595*/	/*605:*/
	#line 12059 "ctex.w"

down_ptr= null;right_ptr= null;

	/*:605*/	/*647:*/
	#line 12895 "ctex.w"
adjust_tail= null;last_badness= 0;

	/*:647*/	/*661:*/
	#line 13070 "ctex.w"

pack_begin_line= 0;

	/*:661*/	/*684:*/
	#line 13486 "ctex.w"

empty_field.rh= empty;empty_field.lh= null;
null_delimiter.b0= 0;null_delimiter.b1= min_quarterword;
null_delimiter.b2= 0;null_delimiter.b3= min_quarterword;

	/*:684*/	/*770:*/
	#line 15242 "ctex.w"

align_ptr= null;cur_align= null;cur_span= null;cur_loop= null;
cur_head= null;cur_tail= null;

	/*:770*/	/*927:*/
	#line 18171 "ctex.w"

for(z= 0;z<=hyph_size;z++)
{hyph_word[z]= 0;hyph_list[z]= null;
}
hyph_count= 0;

	/*:927*/	/*989:*/
	#line 19336 "ctex.w"

output_active= false;insert_penalties= 0;

	/*:989*/	/*1032:*/
	#line 20068 "ctex.w"

ligature_present= false;cancel_boundary= false;lft_hit= false;rt_hit= false;
ins_disc= false;

	/*:1032*/	/*1266:*/
	#line 23414 "ctex.w"

after_token= 0;

	/*:1266*/	/*1281:*/
	#line 23517 "ctex.w"
long_help_seen= false;

	/*:1281*/	/*1299:*/
	#line 23703 "ctex.w"

format_ident= 0;

	/*:1299*/	/*1342:*/
	#line 24566 "ctex.w"

for(k= 0;k<=17;k++)write_open[k]= false;

	/*:1342*/
	#line 311 "ctex.w"

#ifdef INIT
	/*163:*/
	#line 3325 "ctex.w"

for(k= mem_bot+1;k<=lo_mem_stat_max;k++)mem[k].sc= 0;


k= mem_bot;while(k<=lo_mem_stat_max)

{glue_ref_count(k)= null+1;
stretch_order(k)= normal;shrink_order(k)= normal;
k= k+glue_spec_size;
}
stretch(fil_glue)= unity;stretch_order(fil_glue)= fil;
stretch(fill_glue)= unity;stretch_order(fill_glue)= fill;
stretch(ss_glue)= unity;stretch_order(ss_glue)= fil;
shrink(ss_glue)= unity;shrink_order(ss_glue)= fil;
stretch(fil_neg_glue)= -unity;stretch_order(fil_neg_glue)= fil;
rover= lo_mem_stat_max+1;
link(rover)= empty_flag;
node_size(rover)= 1000;
llink(rover)= rover;rlink(rover)= rover;
lo_mem_max= rover+1000;link(lo_mem_max)= null;info(lo_mem_max)= null;
for(k= hi_mem_stat_min;k<=mem_top;k++)
mem[k]= mem[lo_mem_max];
	/*789:*/
	#line 15552 "ctex.w"

info(omit_template)= end_template_token;

	/*:789*/	/*796:*/
	#line 15658 "ctex.w"

link(end_span)= max_quarterword+1;info(end_span)= null;

	/*:796*/	/*819:*/
	#line 16119 "ctex.w"

type(last_active)= hyphenated;line_number(last_active)= max_halfword;
subtype(last_active)= 0;

	/*:819*/	/*980:*/
	#line 19171 "ctex.w"

subtype(page_ins_head)= qi(255);
type(page_ins_head)= split_up;link(page_ins_head)= page_ins_head;

	/*:980*/	/*987:*/
	#line 19327 "ctex.w"

type(page_head)= glue_node;subtype(page_head)= normal;

	/*:987*/
	#line 3347 "ctex.w"
;
avail= null;mem_end= mem_top;
hi_mem_min= hi_mem_stat_min;
var_used= lo_mem_stat_max+1-mem_bot;dyn_used= hi_mem_stat_usage;


	/*:163*/	/*221:*/
	#line 4531 "ctex.w"

eq_type(undefined_control_sequence)= undefined_cs;
equiv(undefined_control_sequence)= null;
eq_level(undefined_control_sequence)= level_zero;
for(k= active_base;k<=undefined_control_sequence-1;k++)
eqtb[k]= eqtb[undefined_control_sequence];

	/*:221*/	/*227:*/
	#line 4686 "ctex.w"

equiv(glue_base)= zero_glue;eq_level(glue_base)= level_one;
eq_type(glue_base)= glue_ref;
for(k= glue_base+1;k<=local_base-1;k++)eqtb[k]= eqtb[glue_base];
glue_ref_count(zero_glue)= glue_ref_count(zero_glue)+local_base-glue_base;

	/*:227*/	/*231:*/
	#line 4805 "ctex.w"

par_shape_ptr= null;eq_type(par_shape_loc)= shape_ref;
eq_level(par_shape_loc)= level_one;
for(k= output_routine_loc;k<=toks_base+255;k++)
eqtb[k]= eqtb[undefined_control_sequence];
box(0)= null;eq_type(box_base)= box_ref;eq_level(box_base)= level_one;
for(k= box_base+1;k<=box_base+255;k++)eqtb[k]= eqtb[box_base];
cur_font= null_font;eq_type(cur_font_loc)= data;
eq_level(cur_font_loc)= level_one;
for(k= math_font_base;k<=math_font_base+47;k++)eqtb[k]= eqtb[cur_font_loc];
equiv(cat_code_base)= 0;eq_type(cat_code_base)= data;
eq_level(cat_code_base)= level_one;
for(k= cat_code_base+1;k<=int_base-1;k++)eqtb[k]= eqtb[cat_code_base];
for(k= 0;k<=255;k++)
{cat_code(k)= other_char;math_code(k)= hi(k);sf_code(k)= 1000;
}
cat_code(carriage_return)= car_ret;cat_code(' ')= spacer;
cat_code('\\')= escape;cat_code('%')= comment;
cat_code(invalid_code)= invalid_char;cat_code(null_code)= ignore;
for(k= '0';k<='9';k++)math_code(k)= hi(k+var_code);
for(k= 'A';k<='Z';k++)
{cat_code(k)= letter;cat_code(k+'a'-'A')= letter;
math_code(k)= hi(k+var_code+0x100);
math_code(k+'a'-'A')= hi(k+'a'-'A'+var_code+0x100);
lc_code(k)= k+'a'-'A';lc_code(k+'a'-'A')= k+'a'-'A';
uc_code(k)= k;uc_code(k+'a'-'A')= k;
sf_code(k)= 999;
}

	/*:231*/	/*239:*/
	#line 5214 "ctex.w"

for(k= int_base;k<=del_code_base-1;k++)eqtb[k].i= 0;
mag= 1000;tolerance= 10000;hang_after= 1;max_dead_cycles= 25;
escape_char= '\\';end_line_char= carriage_return;
for(k= 0;k<=255;k++)del_code(k)= -1;
del_code('.')= 0;

	/*:239*/	/*249:*/
	#line 5406 "ctex.w"

for(k= dimen_base;k<=eqtb_size;k++)eqtb[k].sc= 0;

	/*:249*/	/*257:*/
	#line 5497 "ctex.w"

hash_used= frozen_control_sequence;
cs_count= 0;
eq_type(frozen_dont_expand)= dont_expand;
text(frozen_dont_expand)= s_no("notexpanded:");


	/*:257*/	/*551:*/
	#line 10787 "ctex.w"

font_ptr= null_font;fmem_ptr= 7;
font_name[null_font]= s_no("nullfont");font_area[null_font]= empty_string;
hyphen_char[null_font]= '-';skew_char[null_font]= -1;
bchar_label[null_font]= non_address;
font_bchar[null_font]= non_char;font_false_bchar[null_font]= non_char;
font_bc[null_font]= 1;font_ec[null_font]= 0;
font_size[null_font]= 0;font_dsize[null_font]= 0;
char_base[null_font]= 0;width_base[null_font]= 0;
height_base[null_font]= 0;depth_base[null_font]= 0;
italic_base[null_font]= 0;lig_kern_base[null_font]= 0;
kern_base[null_font]= 0;exten_base[null_font]= 0;
font_glue[null_font]= null;font_params[null_font]= 7;
param_base[null_font]= -1;
for(k= 0;k<=6;k++)font_info[k].sc= 0;

	/*:551*/	/*945:*/
	#line 18442 "ctex.w"

for(k= -trie_op_size;k<=trie_op_size;k++)trie_op_hash[k]= 0;
for(k= 0;k<=255;k++)trie_used[k]= min_quarterword;
trie_op_ptr= 0;

	/*:945*/	/*950:*/
	#line 18568 "ctex.w"

trie_not_ready= true;trie_root= 0;trie_c[0]= si(0);trie_ptr= 0;

	/*:950*/	/*1215:*/
	#line 22754 "ctex.w"

text(frozen_protection)= s_no("inaccessible");

	/*:1215*/	/*1300:*/
	#line 23706 "ctex.w"

format_ident= s_no(" (INITEX)");

	/*:1300*/	/*1368:*/
	#line 24801 "ctex.w"

text(end_write)= s_no("endwrite");eq_level(end_write)= level_one;
eq_type(end_write)= outer_call;equiv(end_write)= null;

	/*:1368*/
	#line 313 "ctex.w"

#endif

	/*:8*/
	#line 262 "ctex.w"
;
}
	/*55:*/
	#line 1359 "ctex.w"

#define put(F)    fwrite(&((F).d),sizeof((F).d),1,(F).f)
#define get(F)    fread(&((F).d),sizeof((F).d),1,(F).f)

#define reset(F,N,M)   ((F).f= fopen((char *)(N)+1,M),\
                                 (F).f!=NULL?get(F):0)
#define rewrite(F,N,M) ((F).f= fopen((char *)(N)+1,M))
#define pascal_close(F)    fclose((F).f)
#define eof(F)    feof((F).f)
#define eoln(F)    ((F).d=='\n'||eof(F))
#define erstat(F)   ((F).f==NULL?-1:ferror((F).f))

#define pascal_read(F,X) ((X)= (F).d,get(F))
#define read_ln(F)  do get(F); while (!eoln(F))

#define pascal_write(F, FMT,...)    fprintf(F.f,FMT,## __VA_ARGS__)
#define write_ln(F,...)    pascal_write(F,__VA_ARGS__"\n")

#define wterm(FMT,...) pascal_write(term_out,FMT, ## __VA_ARGS__)
#define wterm_ln(FMT,...) wterm(FMT "\n", ## __VA_ARGS__)
#define wterm_cr         pascal_write(term_out,"\n")
#define wlog(FMT, ...) pascal_write(log_file,FMT, ## __VA_ARGS__)
#define wlog_ln(FMT, ...)   wlog(FMT "\n", ## __VA_ARGS__)
#define wlog_cr         pascal_write(log_file,"\n")

	/*:55*/	/*56:*/
	#line 1386 "ctex.w"

static void print_ln(void)
{switch(selector){
case term_and_log:{wterm_cr;wlog_cr;
term_offset= 0;file_offset= 0;
}break;
case log_only:{wlog_cr;file_offset= 0;
}break;
case term_only:{wterm_cr;term_offset= 0;
}break;
case no_print:case pseudo:case new_string:do_nothing;break;
default:write_ln(write_file[selector]);
}
}

	/*:56*/	/*57:*/
	#line 1405 "ctex.w"

static void print_char(ASCII_code s)
{
if(	/*243:*/
	#line 5247 "ctex.w"
s==new_line_char

	/*:243*/
	#line 1408 "ctex.w"
)
if(selector<pseudo)
{print_ln();return;
}
switch(selector){
case term_and_log:{wterm("%c",xchr[s]);wlog("%c",xchr[s]);
incr(term_offset);incr(file_offset);
if(term_offset==max_print_line)
{wterm_cr;term_offset= 0;
}
if(file_offset==max_print_line)
{wlog_cr;file_offset= 0;
}
}break;
case log_only:{wlog("%c",xchr[s]);incr(file_offset);
if(file_offset==max_print_line)print_ln();
}break;
case term_only:{wterm("%c",xchr[s]);incr(term_offset);
if(term_offset==max_print_line)print_ln();
}break;
case no_print:do_nothing;break;
case pseudo:if(tally<trick_count)trick_buf[tally%error_line]= s;break;
case new_string:{if(pool_ptr<pool_size)append_char(s);
}break;
default:pascal_write(write_file[selector],"%c",xchr[s]);
}
incr(tally);
}

	/*:57*/	/*58:*/
	#line 1445 "ctex.w"

static void print(char*s)
{while(*s!=0)print_char(*s++);
}

static void printn(int s)
{
pool_pointer j;
int nl;
if(s>=str_ptr){print("???");return;}

else if(s<256)
if(s<0){print("???");return;}
else{if(selector>pseudo)
{print_char(s);return;
}
if((	/*243:*/
	#line 5247 "ctex.w"
s==new_line_char

	/*:243*/
	#line 1461 "ctex.w"
))
if(selector<pseudo)
{print_ln();return;
}
nl= new_line_char;new_line_char= -1;

j= str_start[s];
while(j<str_start[s+1])
{print_char(so(str_pool[j]));incr(j);
}
new_line_char= nl;return;
}
j= str_start[s];
while(j<str_start[s+1])
{print_char(so(str_pool[j]));incr(j);
}
}

	/*:58*/	/*59:*/
	#line 1483 "ctex.w"

static void slow_print(int s)
{pool_pointer j;
if((s>=str_ptr)||(s<256))printn(s);
else{j= str_start[s];
while(j<str_start[s+1])
{printn(so(str_pool[j]));incr(j);
}
}
}

	/*:59*/	/*61:*/
	#line 1510 "ctex.w"

static void print_nl(char*s)
{if(((term_offset>0)&&(odd(selector)))||
((file_offset>0)&&(selector>=log_only)))print_ln();
print(s);
}

	/*:61*/	/*62:*/
	#line 1520 "ctex.w"

static void printn_esc(str_number s)
{int c;
	/*242:*/
	#line 5245 "ctex.w"
c= escape_char

	/*:242*/
	#line 1523 "ctex.w"
;
if(c>=0)if(c<256)printn(c);
slow_print(s);
}

static void print_esc(char*s)
{int c;
	/*242:*/
	#line 5245 "ctex.w"
c= escape_char

	/*:242*/
	#line 1530 "ctex.w"
;
if(c>=0)if(c<256)printn(c);
print(s);
}

	/*:62*/	/*63:*/
	#line 1537 "ctex.w"

static void print_the_digs(eight_bits k)

{while(k>0)
{decr(k);
if(dig[k]<10)print_char('0'+dig[k]);
else print_char('A'-10+dig[k]);
}
}

	/*:63*/	/*64:*/
	#line 1553 "ctex.w"

static void print_int(int n)
{int k;
int m;
k= 0;
if(n<0)
{print_char('-');
if(n>-100000000)negate(n);
else{m= -1-n;n= m/10;m= (m%10)+1;k= 1;
if(m<10)dig[0]= m;
else{dig[0]= 0;incr(n);
}
}
}
do{dig[k]= n%10;n= n/10;incr(k);
}while(!(n==0));
print_the_digs(k);
}

	/*:64*/	/*261:*/
	#line 5575 "ctex.w"

static void print_cs(int p)
{if(p<hash_base)
if(p>=single_base)
if(p==null_cs)
{print_esc("csname");print_esc("endcsname");print_char(' ');
}
else{printn_esc(p-single_base);
if(cat_code(p-single_base)==letter)print_char(' ');
}
else if(p<active_base)print_esc("IMPOSSIBLE.");

else printn(p-active_base);
else if(p>=undefined_control_sequence)print_esc("IMPOSSIBLE.");
else if((text(p)<0)||(text(p)>=str_ptr))print_esc("NONEXISTENT.");

else{printn_esc(text(p));
print_char(' ');
}
}

	/*:261*/	/*262:*/
	#line 5599 "ctex.w"

static void sprint_cs(pointer p)
{if(p<hash_base)
if(p<single_base)printn(p-active_base);
else if(p<null_cs)printn_esc(p-single_base);
else{print_esc("csname");print_esc("endcsname");
}
else printn_esc(text(p));
}

	/*:262*/	/*517:*/
	#line 10060 "ctex.w"

static void print_file_name(int n,char*a,char*e)
{print(a);slow_print(n);print(e);
}

static void printn_file_name(int n,int a,int e)
{slow_print(a);slow_print(n);slow_print(e);
}

	/*:517*/	/*698:*/
	#line 13777 "ctex.w"

static void print_size(int s)
{if(s==text_size)print_esc("textfont");
else if(s==script_size)print_esc("scriptfont");
else print_esc("scriptscriptfont");
}

	/*:698*/	/*1354:*/
	#line 24687 "ctex.w"

static void print_write_whatsit(char*s,pointer p)
{print_esc(s);
if(write_stream(p)<16)print_int(write_stream(p));
else if(write_stream(p)==16)print_char('*');

else print_char('-');
}

	/*:1354*/
	#line 264 "ctex.w"

	/*71:*/
	#line 1679 "ctex.w"

static void print_err(char*s)
{if(interaction==error_stop_mode)wake_up_terminal;
print_nl("! ");print(s);
}

	/*:71*/	/*77:*/
	#line 1759 "ctex.w"

static void normalize_selector(void);
static void get_token(void);
static void term_input(void);
static void show_context(void);
static void begin_file_reading(void);
static void open_log_file(void);
static void close_files_and_terminate(void);
static void clear_for_error_prompt(void);
static void give_err_help(void);
#ifdef DEBUG
static void debug_help(void);
#else
#define debug_help() do_nothing
#endif

	/*:77*/	/*80:*/
	#line 1811 "ctex.w"

static void jump_out(void)
{close_files_and_terminate();exit(0);
}

	/*:80*/	/*81:*/
	#line 1818 "ctex.w"

static void error(void)
{
ASCII_code c;
int s1,s2,s3,s4;

if(history<error_message_issued)history= error_message_issued;
print_char('.');show_context();
if(interaction==error_stop_mode)	/*82:*/
	#line 1836 "ctex.w"

loop{resume:clear_for_error_prompt();prompt_input("? ");

if(last==first)return;
c= buffer[first];
if(c>='a')c= c+'A'-'a';
	/*83:*/
	#line 1857 "ctex.w"

switch(c){
case'0':case'1':case'2':case'3':case'4':case'5':case'6':case'7':case'8':case'9':if(deletions_allowed)
	/*87:*/
	#line 1930 "ctex.w"

{s1= cur_tok;s2= cur_cmd;s3= cur_chr;s4= align_state;
align_state= 1000000;OK_to_interrupt= false;
if((last>first+1)&&(buffer[first+1]>='0')&&(buffer[first+1]<='9'))
c= c*10+buffer[first+1]-'0'*11;
else c= c-'0';
while(c>0)
{get_token();
decr(c);
}
cur_tok= s1;cur_cmd= s2;cur_chr= s3;align_state= s4;OK_to_interrupt= true;
help2("I have just deleted some text, as you asked.",
"You can now delete more, or insert, or whatever.");
show_context();goto resume;
}

	/*:87*/
	#line 1860 "ctex.w"
break;

#ifdef DEBUG
case'D':{debug_help();goto resume;}
#endif
case'E':if(base_ptr>0)
{print_nl("You want to edit file ");

slow_print(input_stack[base_ptr].name_field);
print(" at line ");print_int(line);
interaction= scroll_mode;jump_out();
}break;
case'H':	/*88:*/
	#line 1946 "ctex.w"

{if(use_err_help)
{give_err_help();use_err_help= false;
}
else{if(help_ptr==0)
help2("Sorry, I don't know how to help in this situation.",
"Maybe you should try asking a human?");
do{decr(help_ptr);print(help_line[help_ptr]);print_ln();
}while(!(help_ptr==0));
}
help4("Sorry, I already gave what help I could...",
"Maybe you should try asking a human?",
"An error might have occurred before I noticed any problems.",
"``If all else fails, read the instructions.'");
goto resume;
}

	/*:88*/
	#line 1872 "ctex.w"

case'I':	/*86:*/
	#line 1914 "ctex.w"

{begin_file_reading();

if(last>first+1)
{loc= first+1;buffer[first]= ' ';
}
else{prompt_input("insert>");loc= first;

}
first= last;
cur_input.limit_field= last-1;
return;
}

	/*:86*/
	#line 1873 "ctex.w"

case'Q':case'R':case'S':	/*85:*/
	#line 1897 "ctex.w"

{error_count= 0;interaction= batch_mode+c-'Q';
print("OK, entering ");
switch(c){
case'Q':{print_esc("batchmode");decr(selector);
}break;
case'R':print_esc("nonstopmode");break;
case'S':print_esc("scrollmode");
}
print("...");print_ln();update_terminal;return;
}

	/*:85*/
	#line 1874 "ctex.w"

case'X':{interaction= scroll_mode;jump_out();
}break;
default:do_nothing;
}
	/*84:*/
	#line 1881 "ctex.w"

{print("Type <return> to proceed, S to scroll future error messages,");

print_nl("R to run without stopping, Q to run quietly,");
print_nl("I to insert something, ");
if(base_ptr>0)print("E to edit your file,");
if(deletions_allowed)
print_nl("1 or ... or 9 to ignore the next 1 to 9 tokens of input,");
print_nl("H for help, X to quit.");
}

	/*:84*/
	#line 1879 "ctex.w"


	/*:83*/
	#line 1842 "ctex.w"
;
}

	/*:82*/
	#line 1826 "ctex.w"
;
incr(error_count);
if(error_count==100)
{print_nl("(That makes 100 errors; please try again.)");

history= fatal_error_stop;jump_out();
}
	/*89:*/
	#line 1963 "ctex.w"

if(interaction>batch_mode)decr(selector);
if(use_err_help)
{print_ln();give_err_help();
}
else while(help_ptr>0)
{decr(help_ptr);print_nl(help_line[help_ptr]);
}
print_ln();
if(interaction>batch_mode)incr(selector);
print_ln()

	/*:89*/
	#line 1833 "ctex.w"
;
}

	/*:81*/	/*92:*/
	#line 2002 "ctex.w"

static void fatal_error(char*s)
{normalize_selector();
print_err("Emergency stop");help1(s);succumb;

}

	/*:92*/	/*93:*/
	#line 2011 "ctex.w"

static void overflow(char*s,int n)
{normalize_selector();
print_err("TeX capacity exceeded, sorry [");

print(s);print_char('=');print_int(n);print_char(']');
help2("If you really absolutely need more capacity,",
"you can ask a wizard to enlarge me.");
succumb;
}

	/*:93*/	/*94:*/
	#line 2030 "ctex.w"

static void confusion(char*s)

{normalize_selector();
if(history<error_message_issued)
{print_err("This can't happen (");print(s);print_char(')');

help1("I'm broken. Please show this to someone who can fix can fix");
}
else{print_err("I can't go on meeting you like this");

help2("One of your faux pas seems to have wounded me deeply...",
"in fact, I'm barely conscious. Please fix it and try again.");
}
succumb;
}

	/*:94*/
	#line 265 "ctex.w"


	/*:4*/	/*27:*/
	#line 778 "ctex.w"
static bool a_open_in(alpha_file*f)

{reset((*f),name_of_file,"r");return reset_OK((*f));
}

static bool a_open_out(alpha_file*f)

{rewrite((*f),name_of_file,"w");return rewrite_OK((*f));
}

static bool b_open_in(byte_file*f)

{reset((*f),name_of_file,"rb");return reset_OK((*f));
}

static bool b_open_out(byte_file*f)

{rewrite((*f),name_of_file,"wb");return rewrite_OK((*f));
}

static bool w_open_in(word_file*f)

{reset((*f),name_of_file,"rb");return reset_OK((*f));
}

#ifdef INIT
static bool w_open_out(word_file*f)

{rewrite((*f),name_of_file,"wb");return rewrite_OK((*f));
}
#endif

	/*:27*/	/*28:*/
	#line 821 "ctex.w"
static void a_close(alpha_file*f)
{pascal_close((*f));
}

static void b_close(byte_file*f)
{pascal_close((*f));
}

static void w_close(word_file*f)
{pascal_close((*f));
}

	/*:28*/	/*31:*/
	#line 894 "ctex.w"
static bool input_ln(alpha_file*f,bool bypass_eoln)

{int last_nonblank;
if(bypass_eoln)if(!eof((*f)))get((*f));

last= first;
if(eof((*f)))return false;
else{last_nonblank= first;
while(!eoln((*f)))
{if(last>=max_buf_stack)
{max_buf_stack= last+1;
if(max_buf_stack==buf_size)
	/*35:*/
	#line 980 "ctex.w"

if(format_ident==0)
{write_ln(term_out,"Buffer size exceeded!");exit(0);

}
else{cur_input.loc_field= first;cur_input.limit_field= last-1;
overflow("buffer size",buf_size);

}

	/*:35*/
	#line 906 "ctex.w"
;
}
buffer[last]= xord[(*f).d];get((*f));incr(last);
if(buffer[last-1]!=' ')last_nonblank= last;
}
last= last_nonblank;return true;
}
}

	/*:31*/	/*37:*/
	#line 1024 "ctex.w"
static bool init_terminal(void)
{
t_open_in;
loop{wake_up_terminal;pascal_write(term_out,"**");update_terminal;

if(!input_ln(&term_in,true))
{write_ln(term_out);
pascal_write(term_out,"! End of file on the terminal... why?");

return false;
}
loc= first;
while((loc<last)&&(buffer[loc]==' '))incr(loc);
if(loc<last)
{return true;

}
write_ln(term_out,"Please type the name of your input file.");
}
}

	/*:37*/	/*43:*/
	#line 1141 "ctex.w"
static str_number make_string(void)
{if(str_ptr==max_strings)
overflow("number of strings",max_strings-init_str_ptr);

incr(str_ptr);str_start[str_ptr]= pool_ptr;
return str_ptr-1;
}

	/*:43*/	/*45:*/
	#line 1160 "ctex.w"
static bool str_eq_buf(str_number s,int k)

{
pool_pointer j;
bool result;
j= str_start[s];
while(j<str_start[s+1])
{if(so(str_pool[j])!=buffer[k])
{result= false;goto not_found;
}
incr(j);incr(k);
}
result= true;
not_found:return result;
}

	/*:45*/	/*46:*/
	#line 1179 "ctex.w"
static bool strn_eq_str(str_number s,str_number t)

{
pool_pointer j,k;
bool result;
result= false;
if(length(s)!=length(t))goto not_found;
j= str_start[s];k= str_start[t];
while(j<str_start[s+1])
{if(str_pool[j]!=str_pool[k])goto not_found;
incr(j);incr(k);
}
result= true;
not_found:return result;
}

static bool str_eq_str(str_number s,char*t)

{int j,k;
if(length(s)!=(int)strlen(t))return false;
j= str_start[s];k= 0;
while(j<str_start[s+1])
if(str_pool[j++]!=t[k++])return false;
return true;
}

	/*:46*/	/*47:*/
	#line 1211 "ctex.w"

static void get_strings_started(void)
{
int k,l;
str_number g;
pool_ptr= 0;str_ptr= 0;str_start[0]= 0;
	/*48:*/
	#line 1224 "ctex.w"

for(k= 0;k<=255;k++)
{if((	/*49:*/
	#line 1264 "ctex.w"

(k<' ')||(k>'~')

	/*:49*/
	#line 1226 "ctex.w"
))
{append_char('^');append_char('^');
if(k<0100)append_char(k+0100)
else if(k<0200)append_char(k-0100)
else{app_lc_hex(k/16);app_lc_hex(k%16);
}
}
else append_char(k);
g= make_string();
}

	/*:48*/
	#line 1217 "ctex.w"
;
	/*51:*/
	#line 1271 "ctex.w"

make_string();

	/*:51*/
	#line 1218 "ctex.w"
;
}

	/*:47*/	/*52:*/
	#line 1279 "ctex.w"
static int s_no(const char*str)
{
if(str[0]==0)return empty_string;
if(str[1]==0)return str[0];
str_room(strlen(str));
while(*str!=0)append_char(*str++);
return make_string();
}

	/*:52*/	/*65:*/
	#line 1575 "ctex.w"
static void print_two(int n)
{n= abs(n)%100;print_char('0'+(n/10));
print_char('0'+(n%10));
}

	/*:65*/	/*66:*/
	#line 1582 "ctex.w"
static void print_hex(int n)

{int k;
k= 0;print_char('"');
do{dig[k]= n%16;n= n/16;incr(k);
}while(!(n==0));
print_the_digs(k);
}

	/*:66*/	/*68:*/
	#line 1602 "ctex.w"
static void print_roman_int(int n)
{
pool_pointer j,k;
nonnegative_integer u,v;
const char mystery[]= "m2d5c2l5x2v5i";
j= 0;v= 1000;
loop{while(n>=v)
{print_char(so(mystery[j]));n= n-v;
}
if(n<=0)return;
k= j+2;u= v/(so(mystery[k-1])-'0');
if(mystery[k-1]==si('2'))
{k= k+2;u= u/(so(mystery[k-1])-'0');
}
if(n+u>=v)
{print_char(so(mystery[k]));n= n+u;
}
else{j= j+2;v= v/(so(mystery[j-1])-'0');
}
}
}

	/*:68*/	/*69:*/
	#line 1627 "ctex.w"
static void print_current_string(void)
{pool_pointer j;
j= str_start[str_ptr];
while(j<pool_ptr)
{print_char(so(str_pool[j]));incr(j);
}
}

	/*:69*/	/*70:*/
	#line 1645 "ctex.w"
static void term_input(void)
{int k;
update_terminal;
if(!input_ln(&term_in,true))fatal_error("End of file on the terminal!");

term_offset= 0;
decr(selector);
if(last!=first)for(k= first;k<=last-1;k++)printn(buffer[k]);
print_ln();incr(selector);
}

	/*:70*/	/*90:*/
	#line 1978 "ctex.w"
static void int_error(int n)
{print(" (");print_int(n);print_char(')');error();
}

	/*:90*/	/*91:*/
	#line 1986 "ctex.w"
static void normalize_selector(void)
{if(log_opened)selector= term_and_log;
else selector= term_only;
if(job_name==0)open_log_file();
if(interaction==batch_mode)decr(selector);
}

	/*:91*/	/*97:*/
	#line 2070 "ctex.w"
static void pause_for_instructions(void)
{if(OK_to_interrupt)
{interaction= error_stop_mode;
if((selector==log_only)||(selector==no_print))
incr(selector);
print_err("Interruption");

help3("You rang?",
"Try to insert some instructions for me (e.g.,`I\\showlists'),",
"unless you just want to quit by typing `X'.");
deletions_allowed= false;error();deletions_allowed= true;
interrupt= 0;
}
}

	/*:97*/	/*99:*/
	#line 2109 "ctex.w"
static int half(int x)
{if(odd(x))return(x+1)/2;
else return x/2;
}

	/*:99*/	/*101:*/
	#line 2130 "ctex.w"
static scaled round_decimals(small_number k)

{int a;
a= 0;
while(k>0)
{decr(k);a= (a+dig[k]*two)/10;
}
return(a+1)/2;
}

	/*:101*/	/*102:*/
	#line 2152 "ctex.w"
static void print_scaled(scaled s)

{scaled delta;
if(s<0)
{print_char('-');negate(s);
}
print_int(s/unity);
print_char('.');
s= 10*(s%unity)+5;delta= 10;
do{if(delta>unity)s= s+0100000-50000;
print_char('0'+(s/unity));s= 10*(s%unity);delta= delta*10;
}while(!(s<=delta));
}

	/*:102*/	/*104:*/
	#line 2202 "ctex.w"
static scaled mult_and_add(int n,scaled x,scaled y,scaled max_answer)
{if(n<0)
{negate(x);negate(n);
}
if(n==0)return y;
else if(((x<=(max_answer-y)/n)&&(-x<=(max_answer+y)/n)))
return n*x+y;
else{arith_error= true;return 0;
}
}

	/*:104*/	/*105:*/
	#line 2215 "ctex.w"
static scaled x_over_n(scaled x,int n)
{bool negative;
scaled x_over_n;
negative= false;
if(n==0)
{arith_error= true;x_over_n= 0;rem= x;
}
else{if(n<0)
{negate(x);negate(n);negative= true;
}
if(x>=0)
{x_over_n= x/n;rem= x%n;
}
else{x_over_n= -((-x)/n);rem= -((-x)%n);
}
}
if(negative)negate(rem);
return x_over_n;}

	/*:105*/	/*106:*/
	#line 2241 "ctex.w"
static scaled xn_over_d(scaled x,int n,int d)
{bool positive;
nonnegative_integer t,u,v;
scaled xn_over_d;
if(x>=0)positive= true;
else{negate(x);positive= false;
}
t= (x%0100000)*n;
u= (x/0100000)*n+(t/0100000);
v= (u%d)*0100000+(t%0100000);
if(u/d>=0100000)arith_error= true;
else u= 0100000*(u/d)+(v/d);
if(positive)
{xn_over_d= u;rem= v%d;
}
else{xn_over_d= -u;rem= -(v%d);
}
return xn_over_d;}

	/*:106*/	/*107:*/
	#line 2280 "ctex.w"
static halfword badness(scaled t,scaled s)
{int r;

if(t==0)return 0;
else if(s<=0)return inf_bad;
else{if(t<=7230584)r= (t*297)/s;
else if(s>=1663497)r= t/(s/297);
else r= t;
if(r>1290)return inf_bad;
else return(r*r*r+0400000)/01000000;
}
}

	/*:107*/	/*113:*/
	#line 2454 "ctex.w"

#ifdef DEBUG
static void print_word(memory_word w)

{print_int(w.i);print_char(' ');
print_scaled(w.sc);print_char(' ');
print_scaled(round(unity*float(w.gr)));print_ln();

print_int(w.hh.lh);print_char('=');print_int(w.hh.b0);print_char(':');
print_int(w.hh.b1);print_char(';');print_int(w.hh.rh);print_char(' ');
print_int(w.qqqq.b0);print_char(':');print_int(w.qqqq.b1);print_char(':');
print_int(w.qqqq.b2);print_char(':');print_int(w.qqqq.b3);
}
#endif

	/*:113*/	/*118:*/
	#line 2563 "ctex.w"
	/*291:*/
	#line 6254 "ctex.w"

static void show_token_list(int p,int q,int l)
{
int m,c;
ASCII_code match_chr;
ASCII_code n;
match_chr= '#';n= '0';tally= 0;
while((p!=null)&&(tally<l))
{if(p==q)	/*319:*/
	#line 6934 "ctex.w"
set_trick_count

	/*:319*/
	#line 6262 "ctex.w"
;
	/*292:*/
	#line 6271 "ctex.w"

if((p<hi_mem_min)||(p>mem_end))
{print_esc("CLOBBERED.");return;

}
if(info(p)>=cs_token_flag)print_cs(info(p)-cs_token_flag);
else{m= info(p)/0400;c= info(p)%0400;
if(info(p)<0)print_esc("BAD.");

else	/*293:*/
	#line 6287 "ctex.w"

switch(m){
case left_brace:case right_brace:case math_shift:case tab_mark:case sup_mark:case sub_mark:case spacer:
case letter:case other_char:printn(c);break;
case mac_param:{printn(c);printn(c);
}break;
case out_param:{printn(match_chr);
if(c<=9)print_char(c+'0');
else{print_char('!');return;
}
}break;
case match:{match_chr= c;printn(c);incr(n);print_char(n);
if(n>'9')return;
}break;
case end_match:print("->");break;

default:print_esc("BAD.");

}

	/*:293*/
	#line 6280 "ctex.w"
;
}

	/*:292*/
	#line 6263 "ctex.w"
;
p= link(p);
}
if(p!=null)print_esc("ETC.");


}

	/*:291*/
	#line 2563 "ctex.w"

	/*305:*/
	#line 6605 "ctex.w"

static void runaway(void)
{pointer p;
if(scanner_status>skipping)
{print_nl("Runaway ");

switch(scanner_status){
case defining:{print("definition");p= def_ref;
}break;
case matching:{print("argument");p= temp_head;
}break;
case aligning:{print("preamble");p= hold_head;
}break;
case absorbing:{print("text");p= def_ref;
}
}
print_char('?');print_ln();show_token_list(link(p),null,error_line-10);
}
}

	/*:305*/
	#line 2564 "ctex.w"


	/*:118*/	/*119:*/
	#line 2575 "ctex.w"
static pointer get_avail(void)
{pointer p;
p= avail;
if(p!=null)avail= link(avail);
else if(mem_end<mem_max)
{incr(mem_end);p= mem_end;
}
else{decr(hi_mem_min);p= hi_mem_min;
if(hi_mem_min<=lo_mem_max)
{runaway();
overflow("main memory size",mem_max+1-mem_min);


}
}
link(p)= null;
#ifdef STAT
incr(dyn_used);
#endif

return p;
}

	/*:119*/	/*122:*/
	#line 2624 "ctex.w"
static void flush_list(pointer p)

{pointer q,r;
if(p!=null)
{r= p;
do{q= r;r= link(r);
#ifdef STAT
decr(dyn_used);
#endif
}while(!(r==null));
link(q)= avail;avail= p;
}
}

	/*:122*/	/*124:*/
	#line 2671 "ctex.w"
static pointer get_node(int s)
{
pointer p;
pointer q;
int r;
int t;
restart:p= rover;
do{	/*126:*/
	#line 2721 "ctex.w"

q= p+node_size(p);

while(is_empty(q))
{t= rlink(q);
if(q==rover)rover= t;
llink(t)= llink(q);rlink(llink(q))= t;
q= q+node_size(q);
}
r= q-s;
if(r>p+1)	/*127:*/
	#line 2736 "ctex.w"

{node_size(p)= r-p;

rover= p;
goto found;
}

	/*:127*/
	#line 2731 "ctex.w"
;
if(r==p)if(rlink(p)!=p)
	/*128:*/
	#line 2745 "ctex.w"

{rover= rlink(p);t= llink(p);
llink(rover)= t;rlink(t)= rover;
goto found;
}

	/*:128*/
	#line 2733 "ctex.w"
;
node_size(p)= q-p

	/*:126*/
	#line 2679 "ctex.w"
;

p= rlink(p);
}while(!(p==rover));
if(s==010000000000)
{return max_halfword;
}
if(lo_mem_max+2<hi_mem_min)if(lo_mem_max+2<=mem_bot+max_halfword)
	/*125:*/
	#line 2706 "ctex.w"

{if(hi_mem_min-lo_mem_max>=1998)t= lo_mem_max+1000;
else t= lo_mem_max+1+(hi_mem_min-lo_mem_max)/2;

p= llink(rover);q= lo_mem_max;rlink(p)= q;llink(rover)= q;
if(t>mem_bot+max_halfword)t= mem_bot+max_halfword;
rlink(q)= rover;llink(q)= p;link(q)= empty_flag;node_size(q)= t-lo_mem_max;
lo_mem_max= t;link(lo_mem_max)= null;info(lo_mem_max)= null;
rover= q;goto restart;
}

	/*:125*/
	#line 2687 "ctex.w"
;
overflow("main memory size",mem_max+1-mem_min);


found:link(r)= null;
#ifdef STAT
var_used= var_used+s;
#endif

return r;
}

	/*:124*/	/*129:*/
	#line 2756 "ctex.w"
static void free_node(pointer p,halfword s)

{pointer q;
node_size(p)= s;link(p)= empty_flag;
q= llink(rover);llink(p)= q;rlink(p)= rover;
llink(rover)= p;rlink(q)= p;
#ifdef STAT
var_used= var_used-s;
#endif

}

	/*:129*/	/*130:*/
	#line 2773 "ctex.w"

#ifdef INIT
static void sort_avail(void)

{pointer p,q,r;
pointer old_rover;
p= get_node(010000000000);
p= rlink(rover);rlink(rover)= max_halfword;old_rover= rover;
while(p!=old_rover)	/*131:*/
	#line 2795 "ctex.w"

if(p<rover)
{q= p;p= rlink(q);rlink(q)= rover;rover= q;
}
else{q= rover;
while(rlink(q)<p)q= rlink(q);
r= rlink(p);rlink(p)= rlink(q);rlink(q)= p;p= r;
}

	/*:131*/
	#line 2782 "ctex.w"
;
p= rover;
while(rlink(p)!=max_halfword)
{llink(rlink(p))= p;p= rlink(p);
}
rlink(p)= rover;llink(rover)= p;
}
#endif

	/*:130*/	/*135:*/
	#line 2904 "ctex.w"
static pointer new_null_box(void)
{pointer p;
p= get_node(box_node_size);type(p)= hlist_node;
subtype(p)= min_quarterword;
width(p)= 0;depth(p)= 0;height(p)= 0;shift_amount(p)= 0;list_ptr(p)= null;
glue_sign(p)= normal;glue_order(p)= normal;set_glue_ratio_zero(glue_set(p));
return p;
}

	/*:135*/	/*138:*/
	#line 2934 "ctex.w"
static pointer new_rule(void)
{pointer p;
p= get_node(rule_node_size);type(p)= rule_node;
subtype(p)= 0;
width(p)= null_flag;depth(p)= null_flag;height(p)= null_flag;
return p;
}

	/*:138*/	/*143:*/
	#line 3003 "ctex.w"
static pointer new_ligature(quarterword f,quarterword c,pointer q)
{pointer p;
p= get_node(small_node_size);type(p)= ligature_node;
font(lig_char(p))= f;character(lig_char(p))= c;lig_ptr(p)= q;
subtype(p)= 0;return p;
}

static pointer new_lig_item(quarterword c)
{pointer p;
p= get_node(small_node_size);character(p)= c;lig_ptr(p)= null;
return p;
}

	/*:143*/	/*144:*/
	#line 3038 "ctex.w"
static pointer new_disc(void)
{pointer p;
p= get_node(small_node_size);type(p)= disc_node;
replace_count(p)= 0;pre_break(p)= null;post_break(p)= null;
return p;
}

	/*:144*/	/*146:*/
	#line 3072 "ctex.w"
static pointer new_math(scaled w,small_number s)
{pointer p;
p= get_node(small_node_size);type(p)= math_node;
subtype(p)= s;width(p)= w;return p;
}

	/*:146*/	/*150:*/
	#line 3154 "ctex.w"
static pointer new_spec(pointer p)
{pointer q;
q= get_node(glue_spec_size);
mem[q]= mem[p];glue_ref_count(q)= null;
width(q)= width(p);stretch(q)= stretch(p);shrink(q)= shrink(p);
return q;
}

	/*:150*/	/*151:*/
	#line 3167 "ctex.w"
static pointer new_param_glue(small_number n)
{pointer p;
pointer q;
p= get_node(small_node_size);type(p)= glue_node;subtype(p)= n+1;
leader_ptr(p)= null;
q= 	/*223:*/
	#line 4600 "ctex.w"
glue_par(n)

	/*:223*/
	#line 3172 "ctex.w"
;
glue_ptr(p)= q;incr(glue_ref_count(q));
return p;
}

	/*:151*/	/*152:*/
	#line 3180 "ctex.w"
static pointer new_glue(pointer q)
{pointer p;
p= get_node(small_node_size);type(p)= glue_node;subtype(p)= normal;
leader_ptr(p)= null;glue_ptr(p)= q;incr(glue_ref_count(q));
return p;
}

	/*:152*/	/*153:*/
	#line 3194 "ctex.w"
static pointer new_skip_param(small_number n)
{pointer p;
temp_ptr= new_spec(	/*223:*/
	#line 4600 "ctex.w"
glue_par(n)

	/*:223*/
	#line 3196 "ctex.w"
);
p= new_glue(temp_ptr);glue_ref_count(temp_ptr)= null;subtype(p)= n+1;
return p;
}

	/*:153*/	/*155:*/
	#line 3218 "ctex.w"
static pointer new_kern(scaled w)
{pointer p;
p= get_node(small_node_size);type(p)= kern_node;
subtype(p)= normal;
width(p)= w;
return p;
}

	/*:155*/	/*157:*/
	#line 3241 "ctex.w"
static pointer new_penalty(int m)
{pointer p;
p= get_node(small_node_size);type(p)= penalty_node;
subtype(p)= 0;
penalty(p)= m;return p;
}

	/*:157*/	/*166:*/
	#line 3384 "ctex.w"

#ifdef DEBUG
static void check_mem(bool print_locs)
{
int p,q;
bool clobbered;
for(p= mem_min;p<=lo_mem_max;p++)is_free[p]= false;

for(p= hi_mem_min;p<=mem_end;p++)is_free[p]= false;
	/*167:*/
	#line 3404 "ctex.w"

p= avail;q= null;clobbered= false;
while(p!=null)
{if((p>mem_end)||(p<hi_mem_min))clobbered= true;
else if(is_free[p])clobbered= true;
if(clobbered)
{print_nl("AVAIL list clobbered at ");

print_int(q);goto done1;
}
is_free[p]= true;q= p;p= link(q);
}
done1:

	/*:167*/
	#line 3393 "ctex.w"
;
	/*168:*/
	#line 3418 "ctex.w"

p= rover;q= null;clobbered= false;
do{if((p>=lo_mem_max)||(p<mem_min))clobbered= true;
else if((rlink(p)>=lo_mem_max)||(rlink(p)<mem_min))clobbered= true;
else if(!(is_empty(p))||(node_size(p)<2)||
(p+node_size(p)>lo_mem_max)||(llink(rlink(p))!=p))clobbered= true;
if(clobbered)
{print_nl("Double-AVAIL list clobbered at ");
print_int(q);goto done2;
}
for(q= p;q<=p+node_size(p)-1;q++)
{if(is_free[q])
{print_nl("Doubly free location at ");

print_int(q);goto done2;
}
is_free[q]= true;
}
q= p;p= rlink(p);
}while(!(p==rover));
done2:

	/*:168*/
	#line 3394 "ctex.w"
;
	/*169:*/
	#line 3440 "ctex.w"

p= mem_min;
while(p<=lo_mem_max)
{if(is_empty(p))
{print_nl("Bad flag at ");print_int(p);

}
while((p<=lo_mem_max)&&!is_free[p])incr(p);
while((p<=lo_mem_max)&&is_free[p])incr(p);
}

	/*:169*/
	#line 3395 "ctex.w"
;
if(print_locs)	/*170:*/
	#line 3451 "ctex.w"

{print_nl("New busy locs:");
for(p= mem_min;p<=lo_mem_max;p++)
if(!is_free[p]&&((p>was_lo_max)||was_free[p]))
{print_char(' ');print_int(p);
}
for(p= hi_mem_min;p<=mem_end;p++)
if(!is_free[p]&&
((p<was_hi_min)||(p>was_mem_end)||was_free[p]))
{print_char(' ');print_int(p);
}
}

	/*:170*/
	#line 3396 "ctex.w"
;
for(p= mem_min;p<=lo_mem_max;p++)was_free[p]= is_free[p];
for(p= hi_mem_min;p<=mem_end;p++)was_free[p]= is_free[p];

was_mem_end= mem_end;was_lo_max= lo_mem_max;was_hi_min= hi_mem_min;
}
#endif

	/*:166*/	/*171:*/
	#line 3473 "ctex.w"

#ifdef DEBUG
static void search_mem(pointer p)
{int q;
for(q= mem_min;q<=lo_mem_max;q++)
{if(link(q)==p)
{print_nl("LINK(");print_int(q);print_char(')');
}
if(info(q)==p)
{print_nl("INFO(");print_int(q);print_char(')');
}
}
for(q= hi_mem_min;q<=mem_end;q++)
{if(link(q)==p)
{print_nl("LINK(");print_int(q);print_char(')');
}
if(info(q)==p)
{print_nl("INFO(");print_int(q);print_char(')');
}
}
	/*254:*/
	#line 5448 "ctex.w"

for(q= active_base;q<=box_base+255;q++)
{if(equiv(q)==p)
{print_nl("EQUIV(");print_int(q);print_char(')');
}
}

	/*:254*/
	#line 3493 "ctex.w"
;
	/*284:*/
	#line 6104 "ctex.w"

if(save_ptr>0)for(q= 0;q<=save_ptr-1;q++)
{if(equiv_field(save_stack[q])==p)
{print_nl("SAVE(");print_int(q);print_char(')');
}
}

	/*:284*/
	#line 3494 "ctex.w"
;
	/*932:*/
	#line 18218 "ctex.w"

for(q= 0;q<=hyph_size;q++)
{if(hyph_list[q]==p)
{print_nl("HYPH(");print_int(q);print_char(')');
}
}

	/*:932*/
	#line 3495 "ctex.w"
;
}
#endif

	/*:171*/	/*173:*/
	#line 3523 "ctex.w"
static void short_display(int p)
{int n;
while(p>mem_min)
{if(is_char_node(p))
{if(p<=mem_end)
{if(font(p)!=font_in_short_display)
{if((font(p)<font_base)||(font(p)>font_max))
print_char('*');

else	/*266:*/
	#line 5791 "ctex.w"

printn_esc(font_id_text(font(p)))

	/*:266*/
	#line 3532 "ctex.w"
;
print_char(' ');font_in_short_display= font(p);
}
print_ASCII(qo(character(p)));
}
}
else	/*174:*/
	#line 3543 "ctex.w"

switch(type(p)){
case hlist_node:case vlist_node:case ins_node:case whatsit_node:case mark_node:case adjust_node:
case unset_node:print("[]");break;
case rule_node:print_char('|');break;
case glue_node:if(glue_ptr(p)!=zero_glue)print_char(' ');break;
case math_node:print_char('$');break;
case ligature_node:short_display(lig_ptr(p));break;
case disc_node:{short_display(pre_break(p));
short_display(post_break(p));
n= replace_count(p);
while(n>0)
{if(link(p)!=null)p= link(p);
decr(n);
}
}break;
default:do_nothing;
}

	/*:174*/
	#line 3538 "ctex.w"
;
p= link(p);
}
}

	/*:173*/	/*175:*/
	#line 3566 "ctex.w"
static void print_font_and_char(int p)
{if(p>mem_end)print_esc("CLOBBERED.");
else{if((font(p)<font_base)||(font(p)>font_max))print_char('*');

else	/*266:*/
	#line 5791 "ctex.w"

printn_esc(font_id_text(font(p)))

	/*:266*/
	#line 3570 "ctex.w"
;
print_char(' ');print_ASCII(qo(character(p)));
}
}

static void print_mark(int p)
{print_char('{');
if((p<hi_mem_min)||(p>mem_end))print_esc("CLOBBERED.");
else show_token_list(link(p),null,max_print_line-10);
print_char('}');
}

static void print_rule_dimen(scaled d)
{if(is_running(d))print_char('*');else print_scaled(d);

}

	/*:175*/	/*176:*/
	#line 3590 "ctex.w"
static void print_glue(scaled d,int order,char*s)

{print_scaled(d);
if((order<normal)||(order>filll))print("foul");
else if(order>normal)
{print("fil");
while(order>fil)
{print_char('l');decr(order);
}
}
else if(s!=0)print(s);
}

	/*:176*/	/*177:*/
	#line 3605 "ctex.w"
static void print_spec(int p,char*s)

{if((p<mem_min)||(p>=lo_mem_max))print_char('*');

else{print_scaled(width(p));
if(s!=0)print(s);
if(stretch(p)!=0)
{print(" plus ");print_glue(stretch(p),stretch_order(p),s);
}
if(shrink(p)!=0)
{print(" minus ");print_glue(shrink(p),shrink_order(p),s);
}
}
}

	/*:177*/	/*178:*/
	#line 3623 "ctex.w"
	/*690:*/
	#line 13605 "ctex.w"

static void print_fam_and_char(pointer p)
{print_esc("fam");print_int(fam(p));print_char(' ');
print_ASCII(qo(character(p)));
}

static void print_delimiter(pointer p)
{int a;
a= small_fam(p)*256+qo(small_char(p));
a= a*0x1000+large_fam(p)*256+qo(large_char(p));
if(a<0)print_int(a);
else print_hex(a);
}

	/*:690*/	/*691:*/
	#line 13626 "ctex.w"

static void show_info(void);
static void print_subsidiary_data(pointer p,ASCII_code c)

{if(cur_length>=depth_threshold)
{if(math_type(p)!=empty)print(" []");
}
else{append_char(c);
temp_ptr= p;
switch(math_type(p)){
case math_char:{print_ln();print_current_string();print_fam_and_char(p);
}break;
case sub_box:show_info();break;
case sub_mlist:if(info(p)==null)
{print_ln();print_current_string();print("{}");
}
else show_info();break;
default:do_nothing;
}
flush_char;
}
}

	/*:691*/	/*693:*/
	#line 13663 "ctex.w"

static void print_style(int c)
{switch(c/2){
case 0:print_esc("displaystyle");break;
case 1:print_esc("textstyle");break;
case 2:print_esc("scriptstyle");break;
case 3:print_esc("scriptscriptstyle");break;
default:print("Unknown style!");
}
}

	/*:693*/
	#line 3623 "ctex.w"

	/*224:*/
	#line 4606 "ctex.w"

static void print_skip_param(int n)
{switch(n){
case line_skip_code:print_esc("lineskip");break;
case baseline_skip_code:print_esc("baselineskip");break;
case par_skip_code:print_esc("parskip");break;
case above_display_skip_code:print_esc("abovedisplayskip");break;
case below_display_skip_code:print_esc("belowdisplayskip");break;
case above_display_short_skip_code:print_esc("abovedisplayshortskip");break;
case below_display_short_skip_code:print_esc("belowdisplayshortskip");break;
case left_skip_code:print_esc("leftskip");break;
case right_skip_code:print_esc("rightskip");break;
case top_skip_code:print_esc("topskip");break;
case split_top_skip_code:print_esc("splittopskip");break;
case tab_skip_code:print_esc("tabskip");break;
case space_skip_code:print_esc("spaceskip");break;
case xspace_skip_code:print_esc("xspaceskip");break;
case par_fill_skip_code:print_esc("parfillskip");break;
case thin_mu_skip_code:print_esc("thinmuskip");break;
case med_mu_skip_code:print_esc("medmuskip");break;
case thick_mu_skip_code:print_esc("thickmuskip");break;
default:print("[unknown glue parameter!]");
}
}

	/*:224*/
	#line 3624 "ctex.w"


	/*:178*/	/*181:*/
	#line 3661 "ctex.w"
static void show_node_list(int p)
{
int n;
double g;
if(cur_length>depth_threshold)
{if(p>null)print(" []");

return;
}
n= 0;
while(p>mem_min)
{print_ln();print_current_string();
if(p>mem_end)
{print("Bad link, display aborted.");return;

}
incr(n);if(n>breadth_max)
{print("etc.");return;

}
	/*182:*/
	#line 3687 "ctex.w"

if(is_char_node(p))print_font_and_char(p);
else switch(type(p)){
case hlist_node:case vlist_node:case unset_node:	/*183:*/
	#line 3706 "ctex.w"

{if(type(p)==hlist_node)print_esc("h");
else if(type(p)==vlist_node)print_esc("v");
else print_esc("unset");
print("box(");print_scaled(height(p));print_char('+');
print_scaled(depth(p));print(")x");print_scaled(width(p));
if(type(p)==unset_node)
	/*184:*/
	#line 3722 "ctex.w"

{if(span_count(p)!=min_quarterword)
{print(" (");print_int(qo(span_count(p))+1);
print(" columns)");
}
if(glue_stretch(p)!=0)
{print(", stretch ");print_glue(glue_stretch(p),glue_order(p),0);
}
if(glue_shrink(p)!=0)
{print(", shrink ");print_glue(glue_shrink(p),glue_sign(p),0);
}
}

	/*:184*/
	#line 3713 "ctex.w"

else{	/*185:*/
	#line 3745 "ctex.w"

g= float(glue_set(p));
if((g!=float_constant(0))&&(glue_sign(p)!=normal))
{print(", glue set ");
if(glue_sign(p)==shrinking)print("- ");
if(abs(mem[p+glue_offset].i)<04000000)print("?.?");
else if(abs(g)>float_constant(20000))
{if(g>float_constant(0))print_char('>');
else print("< -");
print_glue(20000*unity,glue_order(p),0);
}
else print_glue(round(unity*g),glue_order(p),0);

}

	/*:185*/
	#line 3714 "ctex.w"
;
if(shift_amount(p)!=0)
{print(", shifted ");print_scaled(shift_amount(p));
}
}
node_list_display(list_ptr(p));
}

	/*:183*/
	#line 3690 "ctex.w"
break;
case rule_node:	/*186:*/
	#line 3760 "ctex.w"

{print_esc("rule(");print_rule_dimen(height(p));print_char('+');
print_rule_dimen(depth(p));print(")x");print_rule_dimen(width(p));
}

	/*:186*/
	#line 3691 "ctex.w"
break;
case ins_node:	/*187:*/
	#line 3765 "ctex.w"

{print_esc("insert");print_int(qo(subtype(p)));
print(", natural size ");print_scaled(height(p));
print("; split(");print_spec(split_top_ptr(p),0);
print_char(',');print_scaled(depth(p));
print("); float cost ");print_int(float_cost(p));
node_list_display(ins_ptr(p));
}

	/*:187*/
	#line 3692 "ctex.w"
break;
case whatsit_node:	/*1355:*/
	#line 24696 "ctex.w"

switch(subtype(p)){
case open_node:{print_write_whatsit("openout",p);
print_char('=');printn_file_name(open_name(p),open_area(p),open_ext(p));
}break;
case write_node:{print_write_whatsit("write",p);
print_mark(write_tokens(p));
}break;
case close_node:print_write_whatsit("closeout",p);break;
case special_node:{print_esc("special");
print_mark(write_tokens(p));
}break;
case language_node:{print_esc("setlanguage");
print_int(what_lang(p));print(" (hyphenmin ");
print_int(what_lhm(p));print_char(',');
print_int(what_rhm(p));print_char(')');
}break;
default:print("whatsit?");
}

	/*:1355*/
	#line 3693 "ctex.w"
break;
case glue_node:	/*188:*/
	#line 3774 "ctex.w"

if(subtype(p)>=a_leaders)	/*189:*/
	#line 3792 "ctex.w"

{print_esc("");
if(subtype(p)==c_leaders)print_char('c');
else if(subtype(p)==x_leaders)print_char('x');
print("leaders ");print_spec(glue_ptr(p),0);
node_list_display(leader_ptr(p));
}

	/*:189*/
	#line 3775 "ctex.w"

else{print_esc("glue");
if(subtype(p)!=normal)
{print_char('(');
if(subtype(p)<cond_math_glue)
print_skip_param(subtype(p)-1);
else if(subtype(p)==cond_math_glue)print_esc("nonscript");
else print_esc("mskip");
print_char(')');
}
if(subtype(p)!=cond_math_glue)
{print_char(' ');
if(subtype(p)<cond_math_glue)print_spec(glue_ptr(p),0);
else print_spec(glue_ptr(p),"mu");
}
}

	/*:188*/
	#line 3694 "ctex.w"
break;
case kern_node:	/*190:*/
	#line 3802 "ctex.w"

if(subtype(p)!=mu_glue)
{print_esc("kern");
if(subtype(p)!=normal)print_char(' ');
print_scaled(width(p));
if(subtype(p)==acc_kern)print(" (for accent)");

}
else{print_esc("mkern");print_scaled(width(p));print("mu");
}

	/*:190*/
	#line 3695 "ctex.w"
break;
case math_node:	/*191:*/
	#line 3813 "ctex.w"

{print_esc("math");
if(subtype(p)==before)print("on");
else print("off");
if(width(p)!=0)
{print(", surrounded ");print_scaled(width(p));
}
}

	/*:191*/
	#line 3696 "ctex.w"
break;
case ligature_node:	/*192:*/
	#line 3822 "ctex.w"

{print_font_and_char(lig_char(p));print(" (ligature ");
if(subtype(p)>1)print_char('|');
font_in_short_display= font(lig_char(p));short_display(lig_ptr(p));
if(odd(subtype(p)))print_char('|');
print_char(')');
}

	/*:192*/
	#line 3697 "ctex.w"
break;
case penalty_node:	/*193:*/
	#line 3830 "ctex.w"

{print_esc("penalty ");print_int(penalty(p));
}

	/*:193*/
	#line 3698 "ctex.w"
break;
case disc_node:	/*194:*/
	#line 3837 "ctex.w"

{print_esc("discretionary");
if(replace_count(p)>0)
{print(" replacing ");print_int(replace_count(p));
}
node_list_display(pre_break(p));
append_char('|');show_node_list(post_break(p));flush_char;
}

	/*:194*/
	#line 3699 "ctex.w"
break;
case mark_node:	/*195:*/
	#line 3846 "ctex.w"

{print_esc("mark");print_mark(mark_ptr(p));
}

	/*:195*/
	#line 3700 "ctex.w"
break;
case adjust_node:	/*196:*/
	#line 3850 "ctex.w"

{print_esc("vadjust");node_list_display(adjust_ptr(p));
}

	/*:196*/
	#line 3701 "ctex.w"
break;
	/*689:*/
	#line 13595 "ctex.w"

case style_node:print_style(subtype(p));break;
case choice_node:	/*694:*/
	#line 13674 "ctex.w"

{print_esc("mathchoice");
append_char('D');show_node_list(display_mlist(p));flush_char;
append_char('T');show_node_list(text_mlist(p));flush_char;
append_char('S');show_node_list(script_mlist(p));flush_char;
append_char('s');show_node_list(script_script_mlist(p));flush_char;
}

	/*:694*/
	#line 13597 "ctex.w"
break;
case ord_noad:case op_noad:case bin_noad:case rel_noad:case open_noad:case close_noad:case punct_noad:case inner_noad:
case radical_noad:case over_noad:case under_noad:case vcenter_noad:case accent_noad:
case left_noad:case right_noad:	/*695:*/
	#line 13682 "ctex.w"

{switch(type(p)){
case ord_noad:print_esc("mathord");break;
case op_noad:print_esc("mathop");break;
case bin_noad:print_esc("mathbin");break;
case rel_noad:print_esc("mathrel");break;
case open_noad:print_esc("mathopen");break;
case close_noad:print_esc("mathclose");break;
case punct_noad:print_esc("mathpunct");break;
case inner_noad:print_esc("mathinner");break;
case over_noad:print_esc("overline");break;
case under_noad:print_esc("underline");break;
case vcenter_noad:print_esc("vcenter");break;
case radical_noad:{print_esc("radical");print_delimiter(left_delimiter(p));
}break;
case accent_noad:{print_esc("accent");print_fam_and_char(accent_chr(p));
}break;
case left_noad:{print_esc("left");print_delimiter(delimiter(p));
}break;
case right_noad:{print_esc("right");print_delimiter(delimiter(p));
}
}
if(subtype(p)!=normal)
if(subtype(p)==limits)print_esc("limits");
else print_esc("nolimits");
if(type(p)<left_noad)print_subsidiary_data(nucleus(p),'.');
print_subsidiary_data(supscr(p),'^');
print_subsidiary_data(subscr(p),'_');
}

	/*:695*/
	#line 13600 "ctex.w"
break;
case fraction_noad:	/*696:*/
	#line 13712 "ctex.w"

{print_esc("fraction, thickness ");
if(thickness(p)==default_code)print("= default");
else print_scaled(thickness(p));
if((small_fam(left_delimiter(p))!=0)||
(small_char(left_delimiter(p))!=min_quarterword)||
(large_fam(left_delimiter(p))!=0)||
(large_char(left_delimiter(p))!=min_quarterword))
{print(", left-delimiter ");print_delimiter(left_delimiter(p));
}
if((small_fam(right_delimiter(p))!=0)||
(small_char(right_delimiter(p))!=min_quarterword)||
(large_fam(right_delimiter(p))!=0)||
(large_char(right_delimiter(p))!=min_quarterword))
{print(", right-delimiter ");print_delimiter(right_delimiter(p));
}
print_subsidiary_data(numerator(p),'\\');
print_subsidiary_data(denominator(p),'/');
}

	/*:696*/
	#line 13601 "ctex.w"
break;

	/*:689*/
	#line 3702 "ctex.w"

default:print("Unknown node type!");
}

	/*:182*/
	#line 3681 "ctex.w"
;
p= link(p);
}

}

	/*:181*/	/*197:*/
	#line 3857 "ctex.w"
static void show_box(pointer p)
{	/*235:*/
	#line 5020 "ctex.w"

depth_threshold= show_box_depth;
breadth_max= show_box_breadth

	/*:235*/
	#line 3858 "ctex.w"
;
if(breadth_max<=0)breadth_max= 5;
if(pool_ptr+depth_threshold>=pool_size)
depth_threshold= pool_size-pool_ptr-1;

show_node_list(p);
print_ln();
}

	/*:197*/	/*199:*/
	#line 3881 "ctex.w"
static void delete_token_ref(pointer p)

{if(token_ref_count(p)==null)flush_list(p);
else decr(token_ref_count(p));
}

	/*:199*/	/*200:*/
	#line 3895 "ctex.w"
static void delete_glue_ref(pointer p)
fast_delete_glue_ref(p)

	/*:200*/	/*201:*/
	#line 3903 "ctex.w"
static void flush_node_list(pointer p)
{
pointer q;
while(p!=null)

{q= link(p);
if(is_char_node(p))free_avail(p)
else{switch(type(p)){
case hlist_node:case vlist_node:case unset_node:{flush_node_list(list_ptr(p));
free_node(p,box_node_size);goto done;
}
case rule_node:{free_node(p,rule_node_size);goto done;
}
case ins_node:{flush_node_list(ins_ptr(p));
delete_glue_ref(split_top_ptr(p));
free_node(p,ins_node_size);goto done;
}
case whatsit_node:	/*1357:*/
	#line 24730 "ctex.w"

{switch(subtype(p)){
case open_node:free_node(p,open_node_size);break;
case write_node:case special_node:{delete_token_ref(write_tokens(p));
free_node(p,write_node_size);goto done;
}
case close_node:case language_node:free_node(p,small_node_size);break;
default:confusion("ext3");

}
goto done;
}

	/*:1357*/
	#line 3920 "ctex.w"

case glue_node:{fast_delete_glue_ref(glue_ptr(p));
if(leader_ptr(p)!=null)flush_node_list(leader_ptr(p));
}break;
case kern_node:case math_node:case penalty_node:do_nothing;break;
case ligature_node:flush_node_list(lig_ptr(p));break;
case mark_node:delete_token_ref(mark_ptr(p));break;
case disc_node:{flush_node_list(pre_break(p));
flush_node_list(post_break(p));
}break;
case adjust_node:flush_node_list(adjust_ptr(p));break;
	/*697:*/
	#line 13734 "ctex.w"

case style_node:{free_node(p,style_node_size);goto done;
}
case choice_node:{flush_node_list(display_mlist(p));
flush_node_list(text_mlist(p));
flush_node_list(script_mlist(p));
flush_node_list(script_script_mlist(p));
free_node(p,style_node_size);goto done;
}
case ord_noad:case op_noad:case bin_noad:case rel_noad:case open_noad:case close_noad:case punct_noad:case inner_noad:
case radical_noad:case over_noad:case under_noad:case vcenter_noad:case accent_noad:
{if(math_type(nucleus(p))>=sub_box)
flush_node_list(info(nucleus(p)));
if(math_type(supscr(p))>=sub_box)
flush_node_list(info(supscr(p)));
if(math_type(subscr(p))>=sub_box)
flush_node_list(info(subscr(p)));
if(type(p)==radical_noad)free_node(p,radical_noad_size);
else if(type(p)==accent_noad)free_node(p,accent_noad_size);
else free_node(p,noad_size);
goto done;
}
case left_noad:case right_noad:{free_node(p,noad_size);goto done;
}
case fraction_noad:{flush_node_list(info(numerator(p)));
flush_node_list(info(denominator(p)));
free_node(p,fraction_noad_size);goto done;
}

	/*:697*/
	#line 3931 "ctex.w"

default:confusion("flushing");

}
free_node(p,small_node_size);
done:;}
p= q;
}
}

	/*:201*/	/*203:*/
	#line 3965 "ctex.w"
static pointer copy_node_list(pointer p)

{pointer h;
pointer q;
pointer r;
int words;
h= get_avail();q= h;
while(p!=null)
{	/*204:*/
	#line 3980 "ctex.w"

words= 1;
if(is_char_node(p))r= get_avail();
else	/*205:*/
	#line 3989 "ctex.w"

switch(type(p)){
case hlist_node:case vlist_node:case unset_node:{r= get_node(box_node_size);
mem[r+6]= mem[p+6];mem[r+5]= mem[p+5];
list_ptr(r)= copy_node_list(list_ptr(p));
words= 5;
}break;
case rule_node:{r= get_node(rule_node_size);words= rule_node_size;
}break;
case ins_node:{r= get_node(ins_node_size);mem[r+4]= mem[p+4];
add_glue_ref(split_top_ptr(p));
ins_ptr(r)= copy_node_list(ins_ptr(p));
words= ins_node_size-1;
}break;
case whatsit_node:	/*1356:*/
	#line 24716 "ctex.w"

switch(subtype(p)){
case open_node:{r= get_node(open_node_size);words= open_node_size;
}break;
case write_node:case special_node:{r= get_node(write_node_size);
add_token_ref(write_tokens(p));words= write_node_size;
}break;
case close_node:case language_node:{r= get_node(small_node_size);
words= small_node_size;
}break;
default:confusion("ext2");

}

	/*:1356*/
	#line 4004 "ctex.w"
break;
case glue_node:{r= get_node(small_node_size);add_glue_ref(glue_ptr(p));
glue_ptr(r)= glue_ptr(p);leader_ptr(r)= copy_node_list(leader_ptr(p));
}break;
case kern_node:case math_node:case penalty_node:{r= get_node(small_node_size);
words= small_node_size;
}break;
case ligature_node:{r= get_node(small_node_size);
mem[lig_char(r)]= mem[lig_char(p)];
lig_ptr(r)= copy_node_list(lig_ptr(p));
}break;
case disc_node:{r= get_node(small_node_size);
pre_break(r)= copy_node_list(pre_break(p));
post_break(r)= copy_node_list(post_break(p));
}break;
case mark_node:{r= get_node(small_node_size);add_token_ref(mark_ptr(p));
words= small_node_size;
}break;
case adjust_node:{r= get_node(small_node_size);
adjust_ptr(r)= copy_node_list(adjust_ptr(p));
}break;
default:confusion("copying");

}

	/*:205*/
	#line 3984 "ctex.w"
;
while(words>0)
{decr(words);mem[r+words]= mem[p+words];
}

	/*:204*/
	#line 3973 "ctex.w"
;
link(q)= r;q= r;p= link(p);
}
link(q)= null;q= link(h);free_avail(h);
return q;
}

	/*:203*/	/*210:*/
	#line 4239 "ctex.w"
static void print_mode(int m)
{if(m>0)
switch(m/(max_command+1)){
case 0:print("vertical");break;
case 1:print("horizontal");break;
case 2:print("display math");
}
else if(m==0)print("no");
else switch((-m)/(max_command+1)){
case 0:print("internal vertical");break;
case 1:print("restricted horizontal");break;
case 2:print("math");
}
print(" mode");
}

	/*:210*/	/*215:*/
	#line 4353 "ctex.w"
static void push_nest(void)
{if(nest_ptr>max_nest_stack)
{max_nest_stack= nest_ptr;
if(nest_ptr==nest_size)overflow("semantic nest size",nest_size);

}
nest[nest_ptr]= cur_list;
incr(nest_ptr);head= get_avail();tail= head;prev_graf= 0;mode_line= line;
}

	/*:215*/	/*216:*/
	#line 4368 "ctex.w"
static void pop_nest(void)
{free_avail(head);decr(nest_ptr);cur_list= nest[nest_ptr];
}

	/*:216*/	/*217:*/
	#line 4374 "ctex.w"
static void print_totals(void);
static void show_activities(void)
{int p;
int m;
memory_word a;
pointer q,r;
int t;
nest[nest_ptr]= cur_list;
print_nl("");print_ln();
for(p= nest_ptr;p>=0;p--)
{m= nest[p].mode_field;a= nest[p].aux_field;
print_nl("### ");print_mode(m);
print(" entered at line ");print_int(abs(nest[p].ml_field));
if(m==hmode)if(nest[p].pg_field!=040600000)
{print(" (language");print_int(nest[p].pg_field%0200000);
print(":hyphenmin");print_int(nest[p].pg_field/020000000);
print_char(',');print_int((nest[p].pg_field/0200000)%0100);
print_char(')');
}
if(nest[p].ml_field<0)print(" (\\output routine)");
if(p==0)
{	/*985:*/
	#line 19251 "ctex.w"

if(page_head!=page_tail)
{print_nl("### current page:");
if(output_active)print(" (held over for next output)");

show_box(link(page_head));
if(page_contents>empty)
{print_nl("total height ");print_totals();

print_nl(" goal height ");print_scaled(page_goal);

r= link(page_ins_head);
while(r!=page_ins_head)
{print_ln();print_esc("insert");t= qo(subtype(r));
print_int(t);print(" adds ");
if(count(t)==1000)t= height(r);
else t= x_over_n(height(r),1000)*count(t);
print_scaled(t);
if(type(r)==split_up)
{q= page_head;t= 0;
do{q= link(q);
if((type(q)==ins_node)&&(subtype(q)==subtype(r)))incr(t);
}while(!(q==broken_ins(r)));
print(", #");print_int(t);print(" might split");
}
r= link(r);
}
}
}

	/*:985*/
	#line 4395 "ctex.w"
;
if(link(contrib_head)!=null)
print_nl("### recent contributions:");
}
show_box(link(nest[p].head_field));
	/*218:*/
	#line 4404 "ctex.w"

switch(abs(m)/(max_command+1)){
case 0:{print_nl("prevdepth ");
if(a.sc<=ignore_depth)print("ignored");
else print_scaled(a.sc);
if(nest[p].pg_field!=0)
{print(", prevgraf ");
print_int(nest[p].pg_field);print(" line");
if(nest[p].pg_field!=1)print_char('s');
}
}break;
case 1:{print_nl("spacefactor ");print_int(a.hh.lh);
if(m>0)if(a.hh.rh>0)
{print(", current language ");print_int(a.hh.rh);
}
}break;
case 2:if(a.i!=null)
{print("this will be denominator of:");show_box(a.i);
}
}

	/*:218*/
	#line 4400 "ctex.w"
;
}
}

	/*:217*/	/*236:*/
	#line 5026 "ctex.w"
static void print_param(int n)
{switch(n){
case pretolerance_code:print_esc("pretolerance");break;
case tolerance_code:print_esc("tolerance");break;
case line_penalty_code:print_esc("linepenalty");break;
case hyphen_penalty_code:print_esc("hyphenpenalty");break;
case ex_hyphen_penalty_code:print_esc("exhyphenpenalty");break;
case club_penalty_code:print_esc("clubpenalty");break;
case widow_penalty_code:print_esc("widowpenalty");break;
case display_widow_penalty_code:print_esc("displaywidowpenalty");break;
case broken_penalty_code:print_esc("brokenpenalty");break;
case bin_op_penalty_code:print_esc("binoppenalty");break;
case rel_penalty_code:print_esc("relpenalty");break;
case pre_display_penalty_code:print_esc("predisplaypenalty");break;
case post_display_penalty_code:print_esc("postdisplaypenalty");break;
case inter_line_penalty_code:print_esc("interlinepenalty");break;
case double_hyphen_demerits_code:print_esc("doublehyphendemerits");break;
case final_hyphen_demerits_code:print_esc("finalhyphendemerits");break;
case adj_demerits_code:print_esc("adjdemerits");break;
case mag_code:print_esc("mag");break;
case delimiter_factor_code:print_esc("delimiterfactor");break;
case looseness_code:print_esc("looseness");break;
case time_code:print_esc("time");break;
case day_code:print_esc("day");break;
case month_code:print_esc("month");break;
case year_code:print_esc("year");break;
case show_box_breadth_code:print_esc("showboxbreadth");break;
case show_box_depth_code:print_esc("showboxdepth");break;
case hbadness_code:print_esc("hbadness");break;
case vbadness_code:print_esc("vbadness");break;
case pausing_code:print_esc("pausing");break;
case tracing_online_code:print_esc("tracingonline");break;
case tracing_macros_code:print_esc("tracingmacros");break;
case tracing_stats_code:print_esc("tracingstats");break;
case tracing_paragraphs_code:print_esc("tracingparagraphs");break;
case tracing_pages_code:print_esc("tracingpages");break;
case tracing_output_code:print_esc("tracingoutput");break;
case tracing_lost_chars_code:print_esc("tracinglostchars");break;
case tracing_commands_code:print_esc("tracingcommands");break;
case tracing_restores_code:print_esc("tracingrestores");break;
case uc_hyph_code:print_esc("uchyph");break;
case output_penalty_code:print_esc("outputpenalty");break;
case max_dead_cycles_code:print_esc("maxdeadcycles");break;
case hang_after_code:print_esc("hangafter");break;
case floating_penalty_code:print_esc("floatingpenalty");break;
case global_defs_code:print_esc("globaldefs");break;
case cur_fam_code:print_esc("fam");break;
case escape_char_code:print_esc("escapechar");break;
case default_hyphen_char_code:print_esc("defaulthyphenchar");break;
case default_skew_char_code:print_esc("defaultskewchar");break;
case end_line_char_code:print_esc("endlinechar");break;
case new_line_char_code:print_esc("newlinechar");break;
case language_code:print_esc("language");break;
case left_hyphen_min_code:print_esc("lefthyphenmin");break;
case right_hyphen_min_code:print_esc("righthyphenmin");break;
case holding_inserts_code:print_esc("holdinginserts");break;
case error_context_lines_code:print_esc("errorcontextlines");break;
default:print("[unknown integer parameter!]");
}
}

	/*:236*/	/*240:*/
	#line 5228 "ctex.w"
static void fix_date_and_time(void)
{time= 12*60;
day= 4;
month= 7;
year= 1776;
}

	/*:240*/	/*244:*/
	#line 5253 "ctex.w"
static void begin_diagnostic(void)
{old_setting= selector;
if((tracing_online<=0)&&(selector==term_and_log))
{decr(selector);
if(history==spotless)history= warning_issued;
}
}

static void end_diagnostic(bool blank_line)

{print_nl("");
if(blank_line)print_ln();
selector= old_setting;
}

	/*:244*/	/*246:*/
	#line 5327 "ctex.w"
static void print_length_param(int n)
{switch(n){
case par_indent_code:print_esc("parindent");break;
case math_surround_code:print_esc("mathsurround");break;
case line_skip_limit_code:print_esc("lineskiplimit");break;
case hsize_code:print_esc("hsize");break;
case vsize_code:print_esc("vsize");break;
case max_depth_code:print_esc("maxdepth");break;
case split_max_depth_code:print_esc("splitmaxdepth");break;
case box_max_depth_code:print_esc("boxmaxdepth");break;
case hfuzz_code:print_esc("hfuzz");break;
case vfuzz_code:print_esc("vfuzz");break;
case delimiter_shortfall_code:print_esc("delimitershortfall");break;
case null_delimiter_space_code:print_esc("nulldelimiterspace");break;
case script_space_code:print_esc("scriptspace");break;
case pre_display_size_code:print_esc("predisplaysize");break;
case display_width_code:print_esc("displaywidth");break;
case display_indent_code:print_esc("displayindent");break;
case overfull_rule_code:print_esc("overfullrule");break;
case hang_indent_code:print_esc("hangindent");break;
case h_offset_code:print_esc("hoffset");break;
case v_offset_code:print_esc("voffset");break;
case emergency_stretch_code:print_esc("emergencystretch");break;
default:print("[unknown dimen parameter!]");
}
}

	/*:246*/	/*251:*/
	#line 5419 "ctex.w"
	/*297:*/
	#line 6395 "ctex.w"

static void print_cmd_chr(quarterword cmd,halfword chr_code)
{switch(cmd){
case left_brace:chr_cmd("begin-group character ")break;
case right_brace:chr_cmd("end-group character ")break;
case math_shift:chr_cmd("math shift character ")break;
case mac_param:chr_cmd("macro parameter character ")break;
case sup_mark:chr_cmd("superscript character ")break;
case sub_mark:chr_cmd("subscript character ")break;
case endv:print("end of alignment template");break;
case spacer:chr_cmd("blank space ")break;
case letter:chr_cmd("the letter ")break;
case other_char:chr_cmd("the character ")break;
	/*226:*/
	#line 4675 "ctex.w"

case assign_glue:case assign_mu_glue:if(chr_code<skip_base)
print_skip_param(chr_code-glue_base);
else if(chr_code<mu_skip_base)
{print_esc("skip");print_int(chr_code-skip_base);
}
else{print_esc("muskip");print_int(chr_code-mu_skip_base);
}break;

	/*:226*/	/*230:*/
	#line 4776 "ctex.w"

case assign_toks:if(chr_code>=toks_base)
{print_esc("toks");print_int(chr_code-toks_base);
}
else switch(chr_code){
case output_routine_loc:print_esc("output");break;
case every_par_loc:print_esc("everypar");break;
case every_math_loc:print_esc("everymath");break;
case every_display_loc:print_esc("everydisplay");break;
case every_hbox_loc:print_esc("everyhbox");break;
case every_vbox_loc:print_esc("everyvbox");break;
case every_job_loc:print_esc("everyjob");break;
case every_cr_loc:print_esc("everycr");break;
default:print_esc("errhelp");
}break;

	/*:230*/	/*238:*/
	#line 5204 "ctex.w"

case assign_int:if(chr_code<count_base)print_param(chr_code-int_base);
else{print_esc("count");print_int(chr_code-count_base);
}break;

	/*:238*/	/*248:*/
	#line 5400 "ctex.w"

case assign_dimen:if(chr_code<scaled_base)
print_length_param(chr_code-dimen_base);
else{print_esc("dimen");print_int(chr_code-scaled_base);
}break;

	/*:248*/	/*265:*/
	#line 5733 "ctex.w"

case accent:print_esc("accent");break;
case advance:print_esc("advance");break;
case after_assignment:print_esc("afterassignment");break;
case after_group:print_esc("aftergroup");break;
case assign_font_dimen:print_esc("fontdimen");break;
case begin_group:print_esc("begingroup");break;
case break_penalty:print_esc("penalty");break;
case char_num:print_esc("char");break;
case cs_name:print_esc("csname");break;
case def_font:print_esc("font");break;
case delim_num:print_esc("delimiter");break;
case divide:print_esc("divide");break;
case end_cs_name:print_esc("endcsname");break;
case end_group:print_esc("endgroup");break;
case ex_space:print_esc(" ");break;
case expand_after:print_esc("expandafter");break;
case halign:print_esc("halign");break;
case hrule:print_esc("hrule");break;
case ignore_spaces:print_esc("ignorespaces");break;
case insert:print_esc("insert");break;
case ital_corr:print_esc("/");break;
case mark:print_esc("mark");break;
case math_accent:print_esc("mathaccent");break;
case math_char_num:print_esc("mathchar");break;
case math_choice:print_esc("mathchoice");break;
case multiply:print_esc("multiply");break;
case no_align:print_esc("noalign");break;
case no_boundary:print_esc("noboundary");break;
case no_expand:print_esc("noexpand");break;
case non_script:print_esc("nonscript");break;
case omit:print_esc("omit");break;
case radical:print_esc("radical");break;
case read_to_cs:print_esc("read");break;
case relax:print_esc("relax");break;
case set_box:print_esc("setbox");break;
case set_prev_graf:print_esc("prevgraf");break;
case set_shape:print_esc("parshape");break;
case the:print_esc("the");break;
case toks_register:print_esc("toks");break;
case vadjust:print_esc("vadjust");break;
case valign:print_esc("valign");break;
case vcenter:print_esc("vcenter");break;
case vrule:print_esc("vrule");break;

	/*:265*/	/*334:*/
	#line 7135 "ctex.w"

case par_end:print_esc("par");break;

	/*:334*/	/*376:*/
	#line 7786 "ctex.w"

case input:if(chr_code==0)print_esc("input");else print_esc("endinput");break;

	/*:376*/	/*384:*/
	#line 7877 "ctex.w"

case top_bot_mark:switch(chr_code){
case first_mark_code:print_esc("firstmark");break;
case bot_mark_code:print_esc("botmark");break;
case split_first_mark_code:print_esc("splitfirstmark");break;
case split_bot_mark_code:print_esc("splitbotmark");break;
default:print_esc("topmark");
}break;

	/*:384*/	/*411:*/
	#line 8319 "ctex.w"

case internal_register:if(chr_code==int_val)print_esc("count");
else if(chr_code==dimen_val)print_esc("dimen");
else if(chr_code==glue_val)print_esc("skip");
else print_esc("muskip");break;

	/*:411*/	/*416:*/
	#line 8428 "ctex.w"

case set_aux:if(chr_code==vmode)print_esc("prevdepth");
else print_esc("spacefactor");break;
case set_page_int:if(chr_code==0)print_esc("deadcycles");
else print_esc("insertpenalties");break;
case set_box_dimen:if(chr_code==width_offset)print_esc("wd");
else if(chr_code==height_offset)print_esc("ht");
else print_esc("dp");break;
case last_item:switch(chr_code){
case int_val:print_esc("lastpenalty");break;
case dimen_val:print_esc("lastkern");break;
case glue_val:print_esc("lastskip");break;
case input_line_no_code:print_esc("inputlineno");break;
default:print_esc("badness");
}break;

	/*:416*/	/*468:*/
	#line 9216 "ctex.w"

case convert:switch(chr_code){
case number_code:print_esc("number");break;
case roman_numeral_code:print_esc("romannumeral");break;
case string_code:print_esc("string");break;
case meaning_code:print_esc("meaning");break;
case font_name_code:print_esc("fontname");break;
default:print_esc("jobname");
}break;

	/*:468*/	/*487:*/
	#line 9554 "ctex.w"

case if_test:switch(chr_code){
case if_cat_code:print_esc("ifcat");break;
case if_int_code:print_esc("ifnum");break;
case if_dim_code:print_esc("ifdim");break;
case if_odd_code:print_esc("ifodd");break;
case if_vmode_code:print_esc("ifvmode");break;
case if_hmode_code:print_esc("ifhmode");break;
case if_mmode_code:print_esc("ifmmode");break;
case if_inner_code:print_esc("ifinner");break;
case if_void_code:print_esc("ifvoid");break;
case if_hbox_code:print_esc("ifhbox");break;
case if_vbox_code:print_esc("ifvbox");break;
case ifx_code:print_esc("ifx");break;
case if_eof_code:print_esc("ifeof");break;
case if_true_code:print_esc("iftrue");break;
case if_false_code:print_esc("iffalse");break;
case if_case_code:print_esc("ifcase");break;
default:print_esc("if");
}break;

	/*:487*/	/*491:*/
	#line 9616 "ctex.w"

case fi_or_else:if(chr_code==fi_code)print_esc("fi");
else if(chr_code==or_code)print_esc("or");
else print_esc("else");break;

	/*:491*/	/*780:*/
	#line 15387 "ctex.w"

case tab_mark:if(chr_code==span_code)print_esc("span");
else chr_cmd("alignment tab character ")break;
case car_ret:if(chr_code==cr_code)print_esc("cr");
else print_esc("crcr");break;

	/*:780*/	/*983:*/
	#line 19225 "ctex.w"

case set_page_dimen:switch(chr_code){
case 0:print_esc("pagegoal");break;
case 1:print_esc("pagetotal");break;
case 2:print_esc("pagestretch");break;
case 3:print_esc("pagefilstretch");break;
case 4:print_esc("pagefillstretch");break;
case 5:print_esc("pagefilllstretch");break;
case 6:print_esc("pageshrink");break;
default:print_esc("pagedepth");
}break;

	/*:983*/	/*1052:*/
	#line 20431 "ctex.w"

case stop:if(chr_code==1)print_esc("dump");else print_esc("end");break;

	/*:1052*/	/*1058:*/
	#line 20529 "ctex.w"

case hskip:switch(chr_code){
case skip_code:print_esc("hskip");break;
case fil_code:print_esc("hfil");break;
case fill_code:print_esc("hfill");break;
case ss_code:print_esc("hss");break;
default:print_esc("hfilneg");
}break;
case vskip:switch(chr_code){
case skip_code:print_esc("vskip");break;
case fil_code:print_esc("vfil");break;
case fill_code:print_esc("vfill");break;
case ss_code:print_esc("vss");break;
default:print_esc("vfilneg");
}break;
case mskip:print_esc("mskip");break;
case kern:print_esc("kern");break;
case mkern:print_esc("mkern");break;

	/*:1058*/	/*1071:*/
	#line 20791 "ctex.w"

case hmove:if(chr_code==1)print_esc("moveleft");else print_esc("moveright");break;
case vmove:if(chr_code==1)print_esc("raise");else print_esc("lower");break;
case make_box:switch(chr_code){
case box_code:print_esc("box");break;
case copy_code:print_esc("copy");break;
case last_box_code:print_esc("lastbox");break;
case vsplit_code:print_esc("vsplit");break;
case vtop_code:print_esc("vtop");break;
case vtop_code+vmode:print_esc("vbox");break;
default:print_esc("hbox");
}break;
case leader_ship:if(chr_code==a_leaders)print_esc("leaders");
else if(chr_code==c_leaders)print_esc("cleaders");
else if(chr_code==x_leaders)print_esc("xleaders");
else print_esc("shipout");break;

	/*:1071*/	/*1088:*/
	#line 21052 "ctex.w"

case start_par:if(chr_code==0)print_esc("noindent");else print_esc("indent");break;

	/*:1088*/	/*1107:*/
	#line 21270 "ctex.w"

case remove_item:if(chr_code==glue_node)print_esc("unskip");
else if(chr_code==kern_node)print_esc("unkern");
else print_esc("unpenalty");break;
case un_hbox:if(chr_code==copy_code)print_esc("unhcopy");
else print_esc("unhbox");break;
case un_vbox:if(chr_code==copy_code)print_esc("unvcopy");
else print_esc("unvbox");break;

	/*:1107*/	/*1114:*/
	#line 21341 "ctex.w"

case discretionary:if(chr_code==1)
print_esc("-");else print_esc("discretionary");break;

	/*:1114*/	/*1142:*/
	#line 21700 "ctex.w"

case eq_no:if(chr_code==1)print_esc("leqno");else print_esc("eqno");break;

	/*:1142*/	/*1156:*/
	#line 21948 "ctex.w"

case math_comp:switch(chr_code){
case ord_noad:print_esc("mathord");break;
case op_noad:print_esc("mathop");break;
case bin_noad:print_esc("mathbin");break;
case rel_noad:print_esc("mathrel");break;
case open_noad:print_esc("mathopen");break;
case close_noad:print_esc("mathclose");break;
case punct_noad:print_esc("mathpunct");break;
case inner_noad:print_esc("mathinner");break;
case under_noad:print_esc("underline");break;
default:print_esc("overline");
}break;
case limit_switch:if(chr_code==limits)print_esc("limits");
else if(chr_code==no_limits)print_esc("nolimits");
else print_esc("displaylimits");break;

	/*:1156*/	/*1169:*/
	#line 22084 "ctex.w"

case math_style:print_style(chr_code);break;

	/*:1169*/	/*1178:*/
	#line 22187 "ctex.w"

case above:switch(chr_code){
case over_code:print_esc("over");break;
case atop_code:print_esc("atop");break;
case delimited_code+above_code:print_esc("abovewithdelims");break;
case delimited_code+over_code:print_esc("overwithdelims");break;
case delimited_code+atop_code:print_esc("atopwithdelims");break;
default:print_esc("above");
}break;

	/*:1178*/	/*1188:*/
	#line 22308 "ctex.w"

case left_right:if(chr_code==left_noad)print_esc("left");
else print_esc("right");break;

	/*:1188*/	/*1208:*/
	#line 22621 "ctex.w"

case prefix:if(chr_code==1)print_esc("long");
else if(chr_code==2)print_esc("outer");
else print_esc("global");break;
case def:if(chr_code==0)print_esc("def");
else if(chr_code==1)print_esc("gdef");
else if(chr_code==2)print_esc("edef");
else print_esc("xdef");break;

	/*:1208*/	/*1219:*/
	#line 22781 "ctex.w"

case let:if(chr_code!=normal)print_esc("futurelet");else print_esc("let");break;

	/*:1219*/	/*1222:*/
	#line 22833 "ctex.w"

case shorthand_def:switch(chr_code){
case char_def_code:print_esc("chardef");break;
case math_char_def_code:print_esc("mathchardef");break;
case count_def_code:print_esc("countdef");break;
case dimen_def_code:print_esc("dimendef");break;
case skip_def_code:print_esc("skipdef");break;
case mu_skip_def_code:print_esc("muskipdef");break;
default:print_esc("toksdef");
}break;
case char_given:{print_esc("char");print_hex(chr_code);
}break;
case math_given:{print_esc("mathchar");print_hex(chr_code);
}break;

	/*:1222*/	/*1230:*/
	#line 22977 "ctex.w"

case def_code:if(chr_code==cat_code_base)print_esc("catcode");
else if(chr_code==math_code_base)print_esc("mathcode");
else if(chr_code==lc_code_base)print_esc("lccode");
else if(chr_code==uc_code_base)print_esc("uccode");
else if(chr_code==sf_code_base)print_esc("sfcode");
else print_esc("delcode");break;
case def_family:print_size(chr_code-math_font_base);break;

	/*:1230*/	/*1250:*/
	#line 23248 "ctex.w"

case hyph_data:if(chr_code==1)print_esc("patterns");
else print_esc("hyphenation");break;

	/*:1250*/	/*1254:*/
	#line 23285 "ctex.w"

case assign_font_int:if(chr_code==0)print_esc("hyphenchar");
else print_esc("skewchar");break;

	/*:1254*/	/*1260:*/
	#line 23370 "ctex.w"

case set_font:{print("select font ");slow_print(font_name[chr_code]);
if(font_size[chr_code]!=font_dsize[chr_code])
{print(" at ");print_scaled(font_size[chr_code]);
print("pt");
}
}break;

	/*:1260*/	/*1262:*/
	#line 23388 "ctex.w"

case set_interaction:switch(chr_code){
case batch_mode:print_esc("batchmode");break;
case nonstop_mode:print_esc("nonstopmode");break;
case scroll_mode:print_esc("scrollmode");break;
default:print_esc("errorstopmode");
}break;

	/*:1262*/	/*1272:*/
	#line 23450 "ctex.w"

case in_stream:if(chr_code==0)print_esc("closein");
else print_esc("openin");break;

	/*:1272*/	/*1277:*/
	#line 23485 "ctex.w"

case message:if(chr_code==0)print_esc("message");
else print_esc("errmessage");break;

	/*:1277*/	/*1286:*/
	#line 23552 "ctex.w"

case case_shift:if(chr_code==lc_code_base)print_esc("lowercase");
else print_esc("uppercase");break;

	/*:1286*/	/*1291:*/
	#line 23603 "ctex.w"

case xray:switch(chr_code){
case show_box_code:print_esc("showbox");break;
case show_the_code:print_esc("showthe");break;
case show_lists:print_esc("showlists");break;
default:print_esc("show");
}break;

	/*:1291*/	/*1294:*/
	#line 23652 "ctex.w"

case undefined_cs:print("undefined");break;
case call:print("macro");break;
case long_call:print_esc("long macro");break;
case outer_call:print_esc("outer macro");break;
case long_outer_call:{print_esc("long");print_esc("outer macro");
}break;
case end_template:print_esc("outer endtemplate");break;

	/*:1294*/	/*1345:*/
	#line 24596 "ctex.w"

case extension:switch(chr_code){
case open_node:print_esc("openout");break;
case write_node:print_esc("write");break;
case close_node:print_esc("closeout");break;
case special_node:print_esc("special");break;
case immediate_code:print_esc("immediate");break;
case set_language_code:print_esc("setlanguage");break;
default:print("[unknown extension!]");
}break;

	/*:1345*/
	#line 6408 "ctex.w"

default:print("[unknown command code!]");
}
}

	/*:297*/
	#line 5419 "ctex.w"

#ifdef STAT
static void show_eqtb(pointer n)
{if(n<active_base)print_char('?');
else if(n<glue_base)	/*222:*/
	#line 4542 "ctex.w"

{sprint_cs(n);print_char('=');print_cmd_chr(eq_type(n),equiv(n));
if(eq_type(n)>=call)
{print_char(':');show_token_list(link(equiv(n)),null,32);
}
}

	/*:222*/
	#line 5423 "ctex.w"

else if(n<local_base)	/*228:*/
	#line 4692 "ctex.w"

if(n<skip_base)
{print_skip_param(n-glue_base);print_char('=');
if(n<glue_base+thin_mu_skip_code)print_spec(equiv(n),"pt");
else print_spec(equiv(n),"mu");
}
else if(n<mu_skip_base)
{print_esc("skip");print_int(n-skip_base);print_char('=');
print_spec(equiv(n),"pt");
}
else{print_esc("muskip");print_int(n-mu_skip_base);print_char('=');
print_spec(equiv(n),"mu");
}

	/*:228*/
	#line 5424 "ctex.w"

else if(n<int_base)	/*232:*/
	#line 4834 "ctex.w"

if(n==par_shape_loc)
{print_esc("parshape");print_char('=');
if(par_shape_ptr==null)print_char('0');
else print_int(info(par_shape_ptr));
}
else if(n<toks_base)
{print_cmd_chr(assign_toks,n);print_char('=');
if(equiv(n)!=null)show_token_list(link(equiv(n)),null,32);
}
else if(n<box_base)
{print_esc("toks");print_int(n-toks_base);print_char('=');
if(equiv(n)!=null)show_token_list(link(equiv(n)),null,32);
}
else if(n<cur_font_loc)
{print_esc("box");print_int(n-box_base);print_char('=');
if(equiv(n)==null)print("void");
else{depth_threshold= 0;breadth_max= 1;show_node_list(equiv(n));
}
}
else if(n<cat_code_base)	/*233:*/
	#line 4857 "ctex.w"

{if(n==cur_font_loc)print("current font");
else if(n<math_font_base+16)
{print_esc("textfont");print_int(n-math_font_base);
}
else if(n<math_font_base+32)
{print_esc("scriptfont");print_int(n-math_font_base-16);
}
else{print_esc("scriptscriptfont");print_int(n-math_font_base-32);
}
print_char('=');
printn_esc(hash[font_id_base+equiv(n)].rh);

}

	/*:233*/
	#line 4854 "ctex.w"

else	/*234:*/
	#line 4872 "ctex.w"

if(n<math_code_base)
{if(n<lc_code_base)
{print_esc("catcode");print_int(n-cat_code_base);
}
else if(n<uc_code_base)
{print_esc("lccode");print_int(n-lc_code_base);
}
else if(n<sf_code_base)
{print_esc("uccode");print_int(n-uc_code_base);
}
else{print_esc("sfcode");print_int(n-sf_code_base);
}
print_char('=');print_int(equiv(n));
}
else{print_esc("mathcode");print_int(n-math_code_base);
print_char('=');print_int(ho(equiv(n)));
}

	/*:234*/
	#line 4855 "ctex.w"


	/*:232*/
	#line 5425 "ctex.w"

else if(n<dimen_base)	/*241:*/
	#line 5235 "ctex.w"

{if(n<count_base)print_param(n-int_base);
else if(n<del_code_base)
{print_esc("count");print_int(n-count_base);
}
else{print_esc("delcode");print_int(n-del_code_base);
}
print_char('=');print_int(eqtb[n].i);
}

	/*:241*/
	#line 5426 "ctex.w"

else if(n<=eqtb_size)	/*250:*/
	#line 5409 "ctex.w"

{if(n<scaled_base)print_length_param(n-dimen_base);
else{print_esc("dimen");print_int(n-scaled_base);
}
print_char('=');print_scaled(eqtb[n].sc);print("pt");
}

	/*:250*/
	#line 5427 "ctex.w"

else print_char('?');
}
#endif

	/*:251*/	/*258:*/
	#line 5512 "ctex.w"
static pointer id_lookup(int j,int l)
{
int h;
int d;
pointer p;
int k;
	/*260:*/
	#line 5559 "ctex.w"

h= buffer[j];
for(k= j+1;k<=j+l-1;k++)
{h= h+h+buffer[k];
while(h>=hash_prime)h= h-hash_prime;
}

	/*:260*/
	#line 5518 "ctex.w"
;
p= h+hash_base;
loop{if(text(p)>0)if(length(text(p))==l)
if(str_eq_buf(text(p),j))goto found;
if(next(p)==0)
{if(no_new_control_sequence)
p= undefined_control_sequence;
else	/*259:*/
	#line 5533 "ctex.w"

{if(text(p)>0)
{do{if(hash_is_full)overflow("hash size",hash_size);

decr(hash_used);
}while(!(text(hash_used)==0));
next(p)= hash_used;p= hash_used;
}
str_room(l);d= cur_length;
while(pool_ptr>str_start[str_ptr])
{decr(pool_ptr);str_pool[pool_ptr+l]= str_pool[pool_ptr];
}
for(k= j;k<=j+l-1;k++)append_char(buffer[k]);
text(p)= make_string();pool_ptr= pool_ptr+d;
#ifdef STAT
incr(cs_count);
#endif

}

	/*:259*/
	#line 5525 "ctex.w"
;
goto found;
}
p= next(p);
}
found:return p;
}

	/*:258*/	/*263:*/
	#line 5615 "ctex.w"

#ifdef INIT
static void primitive(char*str,quarterword c,halfword o)
{str_number s= s_no(str);
int k;
int j;
small_number l;
if(s<256)cur_val= s+single_base;
else{k= str_start[s];l= str_start[s+1]-k;

for(j= 0;j<=l-1;j++)buffer[j]= so(str_pool[k+j]);
cur_val= id_lookup(0,l);
flush_string;text(cur_val)= s;
}
eq_level(cur_val)= level_one;eq_type(cur_val)= c;equiv(cur_val)= o;
}
#endif

	/*:263*/	/*273:*/
	#line 5923 "ctex.w"
static void new_save_level(group_code c)
{check_full_save_stack;
save_type(save_ptr)= level_boundary;save_level(save_ptr)= cur_group;
save_index(save_ptr)= cur_boundary;
if(cur_level==max_quarterword)overflow("grouping levels",

max_quarterword-min_quarterword);

cur_boundary= save_ptr;incr(cur_level);incr(save_ptr);cur_group= c;
}

	/*:273*/	/*274:*/
	#line 5940 "ctex.w"
static void eq_destroy(memory_word w)
{pointer q;
switch(eq_type_field(w)){
case call:case long_call:case outer_call:case long_outer_call:delete_token_ref(equiv_field(w));break;
case glue_ref:delete_glue_ref(equiv_field(w));break;
case shape_ref:{q= equiv_field(w);
if(q!=null)free_node(q,info(q)+info(q)+1);
}break;
case box_ref:flush_node_list(equiv_field(w));break;
default:do_nothing;
}
}

	/*:274*/	/*275:*/
	#line 5956 "ctex.w"
static void eq_save(pointer p,quarterword l)
{check_full_save_stack;
if(l==level_zero)save_type(save_ptr)= restore_zero;
else{save_stack[save_ptr]= eqtb[p];incr(save_ptr);
save_type(save_ptr)= restore_old_value;
}
save_level(save_ptr)= l;save_index(save_ptr)= p;incr(save_ptr);
}

	/*:275*/	/*276:*/
	#line 5973 "ctex.w"
static void eq_define(pointer p,quarterword t,halfword e)

{if(eq_level(p)==cur_level)eq_destroy(eqtb[p]);
else if(cur_level>level_one)eq_save(p,eq_level(p));
eq_level(p)= cur_level;eq_type(p)= t;equiv(p)= e;
}

	/*:276*/	/*277:*/
	#line 5984 "ctex.w"
static void eq_word_define(pointer p,int w)
{if(xeq_level[p]!=cur_level)
{eq_save(p,xeq_level[p]);xeq_level[p]= cur_level;
}
eqtb[p].i= w;
}

	/*:277*/	/*278:*/
	#line 5996 "ctex.w"
static void geq_define(pointer p,quarterword t,halfword e)

{eq_destroy(eqtb[p]);
eq_level(p)= level_one;eq_type(p)= t;equiv(p)= e;
}

static void geq_word_define(pointer p,int w)
{eqtb[p].i= w;xeq_level[p]= level_one;
}

	/*:278*/	/*279:*/
	#line 6008 "ctex.w"
static void save_for_after(halfword t)
{if(cur_level>level_one)
{check_full_save_stack;
save_type(save_ptr)= insert_token;save_level(save_ptr)= level_zero;
save_index(save_ptr)= t;incr(save_ptr);
}
}

	/*:279*/	/*280:*/
	#line 6020 "ctex.w"
	/*283:*/
	#line 6087 "ctex.w"

#ifdef STAT
static void restore_trace(pointer p,char*s)

{begin_diagnostic();print_char('{');print(s);print_char(' ');
show_eqtb(p);print_char('}');
end_diagnostic(false);
}
#endif

	/*:283*/
	#line 6020 "ctex.w"

static void back_input(void);
static void unsave(void)
{
pointer p;
quarterword l;
halfword t;
if(cur_level>level_one)
{decr(cur_level);
	/*281:*/
	#line 6035 "ctex.w"

loop{decr(save_ptr);
if(save_type(save_ptr)==level_boundary)goto done;
p= save_index(save_ptr);
if(save_type(save_ptr)==insert_token)
	/*325:*/
	#line 7029 "ctex.w"

{t= cur_tok;cur_tok= p;back_input();cur_tok= t;
}

	/*:325*/
	#line 6040 "ctex.w"

else{if(save_type(save_ptr)==restore_old_value)
{l= save_level(save_ptr);decr(save_ptr);
}
else save_stack[save_ptr]= eqtb[undefined_control_sequence];
	/*282:*/
	#line 6057 "ctex.w"

if(p<int_base)
if(eq_level(p)==level_one)
{eq_destroy(save_stack[save_ptr]);
#ifdef STAT
if(tracing_restores>0)restore_trace(p,"retaining");
#endif

}
else{eq_destroy(eqtb[p]);
eqtb[p]= save_stack[save_ptr];
#ifdef STAT
if(tracing_restores>0)restore_trace(p,"restoring");
#endif

}
else if(xeq_level[p]!=level_one)
{eqtb[p]= save_stack[save_ptr];xeq_level[p]= l;
#ifdef STAT
if(tracing_restores>0)restore_trace(p,"restoring");
#endif

}
else{
#ifdef STAT
if(tracing_restores>0)restore_trace(p,"retaining");
#endif

}

	/*:282*/
	#line 6046 "ctex.w"
;
}
}
done:cur_group= save_level(save_ptr);cur_boundary= save_index(save_ptr)

	/*:281*/
	#line 6029 "ctex.w"
;
}
else confusion("curlevel");

}

	/*:280*/	/*287:*/
	#line 6126 "ctex.w"
static void prepare_mag(void)
{if((mag_set>0)&&(mag!=mag_set))
{print_err("Incompatible magnification (");print_int(mag);

print(");");print_nl(" the previous value will be retained");
help2("I can handle only one magnification ratio per job. So I've",
"reverted to the magnification you used earlier on this run.");
int_error(mag_set);
geq_word_define(int_base+mag_code,mag_set);
}
if((mag<=0)||(mag>32768))
{print_err("Illegal magnification has been changed to 1000");

help1("The magnification ratio must be between 1 and 32768.");
int_error(mag);geq_word_define(int_base+mag_code,1000);
}
mag_set= mag;
}

	/*:287*/	/*294:*/
	#line 6310 "ctex.w"
static void token_show(pointer p)
{if(p!=null)show_token_list(link(p),null,10000000);
}

	/*:294*/	/*295:*/
	#line 6317 "ctex.w"
static void print_meaning(void)
{print_cmd_chr(cur_cmd,cur_chr);
if(cur_cmd>=call)
{print_char(':');print_ln();token_show(cur_chr);
}
else if(cur_cmd==top_bot_mark)
{print_char(':');print_ln();
token_show(cur_mark[cur_chr]);
}
}

	/*:295*/	/*298:*/
	#line 6415 "ctex.w"
static void show_cur_cmd_chr(void)
{begin_diagnostic();print_nl("{");
if(mode!=shown_mode)
{print_mode(mode);print(": ");shown_mode= mode;
}
print_cmd_chr(cur_cmd,cur_chr);print_char('}');
end_diagnostic(false);
}

	/*:298*/	/*310:*/
	#line 6759 "ctex.w"
static void show_context(void)
{
int old_setting;
int nn;
bool bottom_line;
	/*314:*/
	#line 6871 "ctex.w"

int i;
int j;
int l;
int m;
int n;
int p;
int q;

	/*:314*/
	#line 6764 "ctex.w"

base_ptr= input_ptr;input_stack[base_ptr]= cur_input;

nn= -1;bottom_line= false;
loop{cur_input= input_stack[base_ptr];
if((state!=token_list))
if((name>17)||(base_ptr==0))bottom_line= true;
if((base_ptr==input_ptr)||bottom_line||(nn<error_context_lines))
	/*311:*/
	#line 6782 "ctex.w"

{if((base_ptr==input_ptr)||(state!=token_list)||
(token_type!=backed_up)||(loc!=null))

{tally= 0;
old_setting= selector;
if(state!=token_list)
{	/*312:*/
	#line 6806 "ctex.w"

if(name<=17)
if(terminal_input)
if(base_ptr==0)print_nl("<*>");else print_nl("<insert> ");
else{print_nl("<read ");
if(name==17)print_char('*');else print_int(name-1);

print_char('>');
}
else{print_nl("l.");print_int(line);
}
print_char(' ')

	/*:312*/
	#line 6789 "ctex.w"
;
	/*317:*/
	#line 6917 "ctex.w"

begin_pseudoprint;
if(buffer[limit]==end_line_char)j= limit;
else j= limit+1;
if(j>0)for(i= start;i<=j-1;i++)
{if(i==loc)set_trick_count;
printn(buffer[i]);
}

	/*:317*/
	#line 6790 "ctex.w"
;
}
else{	/*313:*/
	#line 6819 "ctex.w"

switch(token_type){
case parameter:print_nl("<argument> ");break;
case u_template:case v_template:print_nl("<template> ");break;
case backed_up:if(loc==null)print_nl("<recently read> ");
else print_nl("<to be read again> ");break;
case inserted:print_nl("<inserted text> ");break;
case macro:{print_ln();print_cs(name);
}break;
case output_text:print_nl("<output> ");break;
case every_par_text:print_nl("<everypar> ");break;
case every_math_text:print_nl("<everymath> ");break;
case every_display_text:print_nl("<everydisplay> ");break;
case every_hbox_text:print_nl("<everyhbox> ");break;
case every_vbox_text:print_nl("<everyvbox> ");break;
case every_job_text:print_nl("<everyjob> ");break;
case every_cr_text:print_nl("<everycr> ");break;
case mark_text:print_nl("<mark> ");break;
case write_text:print_nl("<write> ");break;
default:print_nl("?");
}

	/*:313*/
	#line 6792 "ctex.w"
;
	/*318:*/
	#line 6926 "ctex.w"

begin_pseudoprint;
if(token_type<macro)show_token_list(start,loc,100000);
else show_token_list(link(start),loc,100000)

	/*:318*/
	#line 6793 "ctex.w"
;
}
selector= old_setting;
	/*316:*/
	#line 6895 "ctex.w"

if(trick_count==1000000)set_trick_count;

if(tally<trick_count)m= tally-first_count;
else m= trick_count-first_count;
if(l+first_count<=half_error_line)
{p= 0;n= l+first_count;
}
else{print("...");p= l+first_count-half_error_line+3;
n= half_error_line;
}
for(q= p;q<=first_count-1;q++)print_char(trick_buf[q%error_line]);
print_ln();
for(q= 1;q<=n;q++)print_char(' ');
if(m+n<=error_line)p= first_count+m;else p= first_count+(error_line-n-3);
for(q= first_count;q<=p-1;q++)print_char(trick_buf[q%error_line]);
if(m+n>error_line)print("...")

	/*:316*/
	#line 6796 "ctex.w"
;
incr(nn);
}
}

	/*:311*/
	#line 6772 "ctex.w"

else if(nn==error_context_lines)
{print_nl("...");incr(nn);
}
if(bottom_line)goto done;
decr(base_ptr);
}
done:cur_input= input_stack[input_ptr];
}

	/*:310*/	/*322:*/
	#line 6965 "ctex.w"
static void begin_token_list(pointer p,quarterword t)
{push_input;state= token_list;start= p;token_type= t;
if(t>=macro)
{add_token_ref(p);
if(t==macro)param_start= param_ptr;
else{loc= link(p);
if(tracing_macros>1)
{begin_diagnostic();print_nl("");
switch(t){
case mark_text:print_esc("mark");break;
case write_text:print_esc("write");break;
default:print_cmd_chr(assign_toks,t-output_text+output_routine_loc);
}
print("->");token_show(p);end_diagnostic(false);
}
}
}
else loc= p;
}

	/*:322*/	/*323:*/
	#line 6990 "ctex.w"
static void end_token_list(void)
{if(token_type>=backed_up)
{if(token_type<=inserted)flush_list(start);
else{delete_token_ref(start);
if(token_type==macro)
while(param_ptr>param_start)
{decr(param_ptr);
flush_list(param_stack[param_ptr]);
}
}
}
else if(token_type==u_template)
if(align_state>500000)align_state= 0;
else fatal_error("(interwoven alignment preambles are not allowed)");

pop_input;
check_interrupt;
}

	/*:323*/	/*324:*/
	#line 7017 "ctex.w"
static void back_input(void)
{pointer p;
while((state==token_list)&&(loc==null)&&(token_type!=v_template))
end_token_list();
p= get_avail();info(p)= cur_tok;
if(cur_tok<right_brace_limit)
if(cur_tok<left_brace_limit)decr(align_state);
else incr(align_state);
push_input;state= token_list;start= p;token_type= backed_up;
loc= p;
}

	/*:324*/	/*326:*/
	#line 7038 "ctex.w"
static void back_error(void)
{OK_to_interrupt= false;back_input();OK_to_interrupt= true;error();
}

static void ins_error(void)
{OK_to_interrupt= false;back_input();token_type= inserted;
OK_to_interrupt= true;error();
}

	/*:326*/	/*327:*/
	#line 7053 "ctex.w"
static void begin_file_reading(void)
{if(in_open==max_in_open)overflow("text input levels",max_in_open);

if(first==buf_size)overflow("buffer size",buf_size);

incr(in_open);push_input;index= in_open;
line_stack[index]= line;start= first;state= mid_line;
name= 0;
}

	/*:327*/	/*328:*/
	#line 7066 "ctex.w"
static void end_file_reading(void)
{first= start;line= line_stack[index];
if(name>17)a_close(&cur_file);
pop_input;decr(in_open);
}

	/*:328*/	/*329:*/
	#line 7076 "ctex.w"
static void clear_for_error_prompt(void)
{while((state!=token_list)&&terminal_input&&
(input_ptr>0)&&(loc>limit))end_file_reading();
print_ln();clear_terminal;
}

	/*:329*/	/*335:*/
	#line 7143 "ctex.w"
static void check_outer_validity(void)
{pointer p;
pointer q;
if(scanner_status!=normal)
{deletions_allowed= false;
	/*336:*/
	#line 7169 "ctex.w"

if(cur_cs!=0)
{if((state==token_list)||(name<1)||(name>17))
{p= get_avail();info(p)= cs_token_flag+cur_cs;
back_list(p);
}
cur_cmd= spacer;cur_chr= ' ';
}

	/*:336*/
	#line 7148 "ctex.w"
;
if(scanner_status>skipping)
	/*337:*/
	#line 7178 "ctex.w"

{runaway();
if(cur_cs==0)print_err("File ended");

else{cur_cs= 0;print_err("Forbidden control sequence found");

}
print(" while scanning ");
	/*338:*/
	#line 7203 "ctex.w"

p= get_avail();
switch(scanner_status){
case defining:{print("definition");info(p)= right_brace_token+'}';
}break;
case matching:{print("use");info(p)= par_token;long_state= outer_call;
}break;
case aligning:{print("preamble");info(p)= right_brace_token+'}';q= p;
p= get_avail();link(p)= q;info(p)= cs_token_flag+frozen_cr;
align_state= -1000000;
}break;
case absorbing:{print("text");info(p)= right_brace_token+'}';
}
}
ins_list(p)

	/*:338*/
	#line 7187 "ctex.w"
;
print(" of ");sprint_cs(warning_index);
help4("I suspect you have forgotten a `}', causing me",
"to read past where you wanted me to stop.",
"I'll try to recover; but if the error is serious,",
"you'd better type `E' or `X' now and fix your file.");
error();
}

	/*:337*/
	#line 7150 "ctex.w"

else{print_err("Incomplete ");print_cmd_chr(if_test,cur_if);

print("; all text was ignored after line ");print_int(skip_line);
help3("A forbidden control sequence occurred in skipped text.",
"This kind of error happens when you say `\\if...' and forget",
"the matching `\\fi'. I've inserted a `\\fi'; this might work.");
if(cur_cs!=0)cur_cs= 0;
else help_line[2]= 
"The file ended while I was skipping conditional text.";
cur_tok= cs_token_flag+frozen_fi;ins_error();
}
deletions_allowed= true;
}
}

	/*:335*/	/*339:*/
	#line 7221 "ctex.w"
static void firm_up_the_line(void);

	/*:339*/	/*340:*/
	#line 7227 "ctex.w"
static void get_next(void)
{





int k;
halfword t;
int cat;
ASCII_code c,cc;
int d;
restart:cur_cs= 0;
if(state!=token_list)
	/*342:*/
	#line 7257 "ctex.w"


{get_cur_chr:if(loc<=limit)
{cur_chr= buffer[loc];incr(loc);
reswitch:cur_cmd= cat_code(cur_chr);
	/*343:*/
	#line 7281 "ctex.w"

switch(state+cur_cmd){
	/*344:*/
	#line 7295 "ctex.w"

any_state_plus(ignore):case skip_blanks+spacer:case new_line+spacer

	/*:344*/
	#line 7283 "ctex.w"
:goto get_cur_chr;
any_state_plus(escape):	/*353:*/
	#line 7401 "ctex.w"

{if(loc>limit)cur_cs= null_cs;
else{start_cs:k= loc;cur_chr= buffer[k];cat= cat_code(cur_chr);
incr(k);
if(cat==letter)state= skip_blanks;
else if(cat==spacer)state= skip_blanks;
else state= mid_line;
if((cat==letter)&&(k<=limit))
	/*355:*/
	#line 7447 "ctex.w"

{do{cur_chr= buffer[k];cat= cat_code(cur_chr);incr(k);
}while(!((cat!=letter)||(k>limit)));
	/*354:*/
	#line 7426 "ctex.w"

{if(buffer[k]==cur_chr)if(cat==sup_mark)if(k<limit)
{c= buffer[k+1];if(c<0200)
{d= 2;
if(is_hex(c))if(k+2<=limit)
{cc= buffer[k+2];if(is_hex(cc))incr(d);
}
if(d>2)
{hex_to_cur_chr;buffer[k-1]= cur_chr;
}
else if(c<0100)buffer[k-1]= c+0100;
else buffer[k-1]= c-0100;
limit= limit-d;first= first-d;
while(k<=limit)
{buffer[k]= buffer[k+d];incr(k);
}
goto start_cs;
}
}
}

	/*:354*/
	#line 7450 "ctex.w"
;
if(cat!=letter)decr(k);

if(k>loc+1)
{cur_cs= id_lookup(loc,k-loc);loc= k;goto found;
}
}

	/*:355*/
	#line 7411 "ctex.w"

else	/*354:*/
	#line 7426 "ctex.w"

{if(buffer[k]==cur_chr)if(cat==sup_mark)if(k<limit)
{c= buffer[k+1];if(c<0200)
{d= 2;
if(is_hex(c))if(k+2<=limit)
{cc= buffer[k+2];if(is_hex(cc))incr(d);
}
if(d>2)
{hex_to_cur_chr;buffer[k-1]= cur_chr;
}
else if(c<0100)buffer[k-1]= c+0100;
else buffer[k-1]= c-0100;
limit= limit-d;first= first-d;
while(k<=limit)
{buffer[k]= buffer[k+d];incr(k);
}
goto start_cs;
}
}
}

	/*:354*/
	#line 7412 "ctex.w"
;
cur_cs= single_base+buffer[loc];incr(loc);
}
found:cur_cmd= eq_type(cur_cs);cur_chr= equiv(cur_cs);
if(cur_cmd>=outer_call)check_outer_validity();
}

	/*:353*/
	#line 7285 "ctex.w"
break;
any_state_plus(active_char):	/*352:*/
	#line 7380 "ctex.w"

{cur_cs= cur_chr+active_base;
cur_cmd= eq_type(cur_cs);cur_chr= equiv(cur_cs);state= mid_line;
if(cur_cmd>=outer_call)check_outer_validity();
}

	/*:352*/
	#line 7287 "ctex.w"
break;
any_state_plus(sup_mark):	/*351:*/
	#line 7364 "ctex.w"

{if(cur_chr==buffer[loc])if(loc<limit)
{c= buffer[loc+1];if(c<0200)
{loc= loc+2;
if(is_hex(c))if(loc<=limit)
{cc= buffer[loc];if(is_hex(cc))
{incr(loc);hex_to_cur_chr;goto reswitch;
}
}
if(c<0100)cur_chr= c+0100;else cur_chr= c-0100;
goto reswitch;
}
}
state= mid_line;
}

	/*:351*/
	#line 7289 "ctex.w"
break;
any_state_plus(invalid_char):	/*345:*/
	#line 7302 "ctex.w"

{print_err("Text line contains an invalid character");

help2("A funny symbol that I can't read has just been input.",
"Continue, and I'll forget that it ever happened.");
deletions_allowed= false;error();deletions_allowed= true;
goto restart;
}

	/*:345*/
	#line 7290 "ctex.w"

	/*346:*/
	#line 7314 "ctex.w"

case mid_line+spacer:	/*348:*/
	#line 7342 "ctex.w"

{state= skip_blanks;cur_chr= ' ';
}

	/*:348*/
	#line 7315 "ctex.w"
break;
case mid_line+car_ret:	/*347:*/
	#line 7336 "ctex.w"

{loc= limit+1;cur_cmd= spacer;cur_chr= ' ';
}

	/*:347*/
	#line 7316 "ctex.w"
break;
case skip_blanks+car_ret:any_state_plus(comment):
	/*349:*/
	#line 7346 "ctex.w"

{loc= limit+1;goto get_cur_chr;
}

	/*:349*/
	#line 7318 "ctex.w"

case new_line+car_ret:	/*350:*/
	#line 7350 "ctex.w"

{loc= limit+1;cur_cs= par_loc;cur_cmd= eq_type(cur_cs);
cur_chr= equiv(cur_cs);
if(cur_cmd>=outer_call)check_outer_validity();
}

	/*:350*/
	#line 7319 "ctex.w"
break;
case mid_line+left_brace:incr(align_state);break;
case skip_blanks+left_brace:case new_line+left_brace:{
state= mid_line;incr(align_state);
}break;
case mid_line+right_brace:decr(align_state);break;
case skip_blanks+right_brace:case new_line+right_brace:{
state= mid_line;decr(align_state);
}break;
add_delims_to(case skip_blanks):add_delims_to(case new_line):state= mid_line;break;

	/*:346*/
	#line 7291 "ctex.w"

default:do_nothing;
}

	/*:343*/
	#line 7263 "ctex.w"
;
}
else{state= new_line;
	/*359:*/
	#line 7510 "ctex.w"

if(name>17)	/*361:*/
	#line 7546 "ctex.w"

{incr(line);first= start;
if(!force_eof)
{if(input_ln(&cur_file,true))
firm_up_the_line();
else force_eof= true;
}
if(force_eof)
{print_char(')');decr(open_parens);
update_terminal;
force_eof= false;
end_file_reading();
check_outer_validity();goto restart;
}
if(end_line_char_inactive)decr(limit);
else buffer[limit]= end_line_char;
first= limit+1;loc= start;
}

	/*:361*/
	#line 7512 "ctex.w"

else{if(!terminal_input)
{cur_cmd= 0;cur_chr= 0;return;
}
if(input_ptr>0)
{end_file_reading();goto restart;
}
if(selector<log_only)open_log_file();
if(interaction>nonstop_mode)
{if(end_line_char_inactive)incr(limit);
if(limit==start)
print_nl("(Please type a command or say `\\end')");

print_ln();first= start;
prompt_input("*");

limit= last;
if(end_line_char_inactive)decr(limit);
else buffer[limit]= end_line_char;
first= limit+1;
loc= start;
}
else fatal_error("*** (job aborted, no legal \\end found)");



}

	/*:359*/
	#line 7267 "ctex.w"
;
check_interrupt;
goto get_cur_chr;
}
}

	/*:342*/
	#line 7241 "ctex.w"

else	/*356:*/
	#line 7461 "ctex.w"

if(loc!=null)

{t= info(loc);loc= link(loc);
if(t>=cs_token_flag)
{cur_cs= t-cs_token_flag;
cur_cmd= eq_type(cur_cs);cur_chr= equiv(cur_cs);
if(cur_cmd>=outer_call)
if(cur_cmd==dont_expand)
	/*357:*/
	#line 7492 "ctex.w"

{cur_cs= info(loc)-cs_token_flag;loc= null;
cur_cmd= eq_type(cur_cs);cur_chr= equiv(cur_cs);
if(cur_cmd>max_command)
{cur_cmd= relax;cur_chr= no_expand_flag;
}
}

	/*:357*/
	#line 7470 "ctex.w"

else check_outer_validity();
}
else{cur_cmd= t/0400;cur_chr= t%0400;
switch(cur_cmd){
case left_brace:incr(align_state);break;
case right_brace:decr(align_state);break;
case out_param:	/*358:*/
	#line 7500 "ctex.w"

{begin_token_list(param_stack[param_start+cur_chr-1],parameter);
goto restart;
}

	/*:358*/
	#line 7477 "ctex.w"

default:do_nothing;
}
}
}
else{
end_token_list();goto restart;
}

	/*:356*/
	#line 7243 "ctex.w"
;
	/*341:*/
	#line 7253 "ctex.w"

if(cur_cmd<=car_ret)if(cur_cmd>=tab_mark)if(align_state==0)
	/*788:*/
	#line 15539 "ctex.w"

{if((scanner_status==aligning)||(cur_align==null))
fatal_error("(interwoven alignment preambles are not allowed)");

cur_cmd= extra_info(cur_align);extra_info(cur_align)= cur_chr;
if(cur_cmd==omit)begin_token_list(omit_template,v_template);
else begin_token_list(v_part(cur_align),v_template);
align_state= 1000000;goto restart;
}

	/*:788*/
	#line 7255 "ctex.w"


	/*:341*/
	#line 7244 "ctex.w"
;
}

	/*:340*/	/*362:*/
	#line 7572 "ctex.w"
static void firm_up_the_line(void)
{int k;
limit= last;
if(pausing>0)if(interaction>nonstop_mode)
{wake_up_terminal;print_ln();
if(start<limit)for(k= start;k<=limit-1;k++)printn(buffer[k]);
first= limit;prompt_input("=>");

if(last>first)
{for(k= first;k<=last-1;k++)
buffer[k+start-first]= buffer[k];
limit= start+last-first;
}
}
}

	/*:362*/	/*364:*/
	#line 7611 "ctex.w"
static void get_token(void)
{no_new_control_sequence= false;get_next();no_new_control_sequence= true;

if(cur_cs==0)cur_tok= (cur_cmd*0400)+cur_chr;
else cur_tok= cs_token_flag+cur_cs;
}

	/*:364*/	/*365:*/
	#line 7637 "ctex.w"
	/*388:*/
	#line 7933 "ctex.w"

static void macro_call(void)
{
pointer r;
pointer p;
pointer q;
pointer s;
pointer t;
pointer u,v;
pointer rbrace_ptr;
small_number n;
halfword unbalance;
int m;
pointer ref_count;
small_number save_scanner_status;
pointer save_warning_index;
ASCII_code match_chr;
save_scanner_status= scanner_status;save_warning_index= warning_index;
warning_index= cur_cs;ref_count= cur_chr;r= link(ref_count);n= 0;
if(tracing_macros>0)	/*400:*/
	#line 8157 "ctex.w"

{begin_diagnostic();print_ln();print_cs(warning_index);
token_show(ref_count);end_diagnostic(false);
}

	/*:400*/
	#line 7952 "ctex.w"
;
if(info(r)!=end_match_token)
	/*390:*/
	#line 7989 "ctex.w"

{scanner_status= matching;unbalance= 0;
long_state= eq_type(cur_cs);
if(long_state>=outer_call)long_state= long_state-2;
do{link(temp_head)= null;
if((info(r)>match_token+255)||(info(r)<match_token))s= null;
else{match_chr= info(r)-match_token;s= link(r);r= s;
p= temp_head;m= 0;
}
	/*391:*/
	#line 8009 "ctex.w"

resume:get_token();
if(cur_tok==info(r))
	/*393:*/
	#line 8041 "ctex.w"

{r= link(r);
if((info(r)>=match_token)&&(info(r)<=end_match_token))
{if(cur_tok<left_brace_limit)decr(align_state);
goto found;
}
else goto resume;
}

	/*:393*/
	#line 8013 "ctex.w"
;
	/*396:*/
	#line 8097 "ctex.w"

if(s!=r)
if(s==null)	/*397:*/
	#line 8114 "ctex.w"

{print_err("Use of ");sprint_cs(warning_index);

print(" doesn't match its definition");
help4("If you say, e.g., `\\def\\a1{...}', then you must always",
"put `1' after `\\a', since control sequence names are",
"made up of letters only. The macro here has not been",
"followed by the required stuff, so I'm ignoring it.");
error();goto end;
}

	/*:397*/
	#line 8099 "ctex.w"

else{t= s;
do{store_new_token(info(t));incr(m);u= link(t);v= s;
loop{if(u==r)
if(cur_tok!=info(v))goto done;
else{r= link(v);goto resume;
}
if(info(u)!=info(v))goto done;
u= link(u);v= link(v);
}
done:t= link(t);
}while(!(t==r));
r= s;
}

	/*:396*/
	#line 8015 "ctex.w"
;
if(cur_tok==par_token)if(long_state!=long_call)
	/*395:*/
	#line 8066 "ctex.w"

{if(long_state==call)
{runaway();print_err("Paragraph ended before ");

sprint_cs(warning_index);print(" was complete");
help3("I suspect you've forgotten a `}', causing me to apply this",
"control sequence to too much text. How can we recover?",
"My plan is to forget the whole thing and hope for the best.");
back_error();
}
pstack[n]= link(temp_head);align_state= align_state-unbalance;
for(m= 0;m<=n;m++)flush_list(pstack[m]);
goto end;
}

	/*:395*/
	#line 8017 "ctex.w"
;
if(cur_tok<right_brace_limit)
if(cur_tok<left_brace_limit)
	/*398:*/
	#line 8125 "ctex.w"

{unbalance= 1;

loop{fast_store_new_token(cur_tok);get_token();
if(cur_tok==par_token)if(long_state!=long_call)
	/*395:*/
	#line 8066 "ctex.w"

{if(long_state==call)
{runaway();print_err("Paragraph ended before ");

sprint_cs(warning_index);print(" was complete");
help3("I suspect you've forgotten a `}', causing me to apply this",
"control sequence to too much text. How can we recover?",
"My plan is to forget the whole thing and hope for the best.");
back_error();
}
pstack[n]= link(temp_head);align_state= align_state-unbalance;
for(m= 0;m<=n;m++)flush_list(pstack[m]);
goto end;
}

	/*:395*/
	#line 8130 "ctex.w"
;
if(cur_tok<right_brace_limit)
if(cur_tok<left_brace_limit)incr(unbalance);
else{decr(unbalance);
if(unbalance==0)goto done1;
}
}
done1:rbrace_ptr= p;store_new_token(cur_tok);
}

	/*:398*/
	#line 8020 "ctex.w"

else	/*394:*/
	#line 8050 "ctex.w"

{back_input();print_err("Argument of ");sprint_cs(warning_index);

print(" has an extra }");
help6("I've run across a `}' that doesn't seem to match anything.",
"For example, `\\def\\a#1{...}' and `\\a}' would produce",
"this error. If you simply proceed now, the `\\par' that",
"I've just inserted will cause me to report a runaway",
"argument that might be the root of the problem. But if",
"your `}' was spurious, just type `2' and it will go away.");
incr(align_state);long_state= call;cur_tok= par_token;ins_error();
goto resume;
}

	/*:394*/
	#line 8021 "ctex.w"

else	/*392:*/
	#line 8029 "ctex.w"

{if(cur_tok==space_token)
if(info(r)<=end_match_token)
if(info(r)>=match_token)goto resume;
store_new_token(cur_tok);
}

	/*:392*/
	#line 8023 "ctex.w"
;
incr(m);
if(info(r)>end_match_token)goto resume;
if(info(r)<match_token)goto resume;
found:if(s!=null)	/*399:*/
	#line 8143 "ctex.w"

{if((m==1)&&(info(p)<right_brace_limit)&&(p!=temp_head))
{link(rbrace_ptr)= null;free_avail(p);
p= link(temp_head);pstack[n]= link(p);free_avail(p);
}
else pstack[n]= link(temp_head);
incr(n);
if(tracing_macros>0)
{begin_diagnostic();print_nl("");printn(match_chr);print_int(n);
print("<-");show_token_list(pstack[n-1],null,1000);
end_diagnostic(false);
}
}

	/*:399*/
	#line 8027 "ctex.w"


	/*:391*/
	#line 7999 "ctex.w"
;

}while(!(info(r)==end_match_token));
}

	/*:390*/
	#line 7955 "ctex.w"
;
	/*389:*/
	#line 7964 "ctex.w"

while((state==token_list)&&(loc==null)&&(token_type!=v_template))
end_token_list();
begin_token_list(ref_count,macro);name= warning_index;loc= link(r);
if(n>0)
{if(param_ptr+n>max_param_stack)
{max_param_stack= param_ptr+n;
if(max_param_stack>param_size)
overflow("parameter stack size",param_size);

}
for(m= 0;m<=n-1;m++)param_stack[param_ptr+m]= pstack[m];
param_ptr= param_ptr+n;
}

	/*:389*/
	#line 7956 "ctex.w"
;
end:scanner_status= save_scanner_status;warning_index= save_warning_index;
}

	/*:388*/
	#line 7637 "ctex.w"

	/*378:*/
	#line 7797 "ctex.w"

static void insert_relax(void)
{cur_tok= cs_token_flag+cur_cs;back_input();
cur_tok= cs_token_flag+frozen_relax;back_input();token_type= inserted;
}

	/*:378*/
	#line 7638 "ctex.w"

static void pass_text(void);
static void start_input(void);
static void conditional(void);
static void get_x_token(void);
static void conv_toks(void);
static void ins_the_toks(void);
static void expand(void)
{halfword t;
pointer p,q,r;
int j;
int cv_backup;
small_number cvl_backup,radix_backup,co_backup;

pointer backup_backup;
small_number save_scanner_status;
cv_backup= cur_val;cvl_backup= cur_val_level;radix_backup= radix;
co_backup= cur_order;backup_backup= link(backup_head);
if(cur_cmd<call)	/*366:*/
	#line 7663 "ctex.w"

{if(tracing_commands>1)show_cur_cmd_chr();
switch(cur_cmd){
case top_bot_mark:	/*385:*/
	#line 7889 "ctex.w"

{if(cur_mark[cur_chr]!=null)
begin_token_list(cur_mark[cur_chr],mark_text);
}

	/*:385*/
	#line 7666 "ctex.w"
break;
case expand_after:	/*367:*/
	#line 7681 "ctex.w"

{get_token();t= cur_tok;get_token();
if(cur_cmd>max_command)expand();else back_input();
cur_tok= t;back_input();
}

	/*:367*/
	#line 7667 "ctex.w"
break;
case no_expand:	/*368:*/
	#line 7695 "ctex.w"

{save_scanner_status= scanner_status;scanner_status= normal;
get_token();scanner_status= save_scanner_status;t= cur_tok;
back_input();
if(t>=cs_token_flag)
{p= get_avail();info(p)= cs_token_flag+frozen_dont_expand;
link(p)= loc;start= p;loc= p;
}
}

	/*:368*/
	#line 7668 "ctex.w"
break;
case cs_name:	/*371:*/
	#line 7727 "ctex.w"

{r= get_avail();p= r;
do{get_x_token();
if(cur_cs==0)store_new_token(cur_tok);
}while(!(cur_cs!=0));
if(cur_cmd!=end_cs_name)	/*372:*/
	#line 7741 "ctex.w"

{print_err("Missing ");print_esc("endcsname");print(" inserted");

help2("The control sequence marked <to be read again> should",
"not appear between \\csname and \\endcsname.");
back_error();
}

	/*:372*/
	#line 7732 "ctex.w"
;
	/*373:*/
	#line 7749 "ctex.w"

j= first;p= link(r);
while(p!=null)
{if(j>=max_buf_stack)
{max_buf_stack= j+1;
if(max_buf_stack==buf_size)
overflow("buffer size",buf_size);

}
buffer[j]= info(p)%0400;incr(j);p= link(p);
}
if(j>first+1)
{no_new_control_sequence= false;cur_cs= id_lookup(first,j-first);
no_new_control_sequence= true;
}
else if(j==first)cur_cs= null_cs;
else cur_cs= single_base+buffer[first]

	/*:373*/
	#line 7733 "ctex.w"
;
flush_list(r);
if(eq_type(cur_cs)==undefined_cs)
{eq_define(cur_cs,relax,256);
}
cur_tok= cur_cs+cs_token_flag;back_input();
}

	/*:371*/
	#line 7669 "ctex.w"
break;
case convert:conv_toks();break;
case the:ins_the_toks();break;
case if_test:conditional();break;
case fi_or_else:	/*509:*/
	#line 9869 "ctex.w"

if(cur_chr>if_limit)
if(if_limit==if_code)insert_relax();
else{print_err("Extra ");print_cmd_chr(fi_or_else,cur_chr);



help1("I'm ignoring this; it doesn't match any \\if.");
error();
}
else{while(cur_chr!=fi_code)pass_text();
	/*495:*/
	#line 9661 "ctex.w"

{p= cond_ptr;if_line= if_line_field(p);
cur_if= subtype(p);if_limit= type(p);cond_ptr= link(p);
free_node(p,if_node_size);
}

	/*:495*/
	#line 9880 "ctex.w"
;
}

	/*:509*/
	#line 7673 "ctex.w"
break;
case input:	/*377:*/
	#line 7789 "ctex.w"

if(cur_chr>0)force_eof= true;
else if(name_in_progress)insert_relax();
else start_input()

	/*:377*/
	#line 7674 "ctex.w"
;break;
default:	/*369:*/
	#line 7705 "ctex.w"

{print_err("Undefined control sequence");

help5("The control sequence at the end of the top line",
"of your error message was never \\def'ed. If you have",
"misspelled it (e.g., `\\hobx'), type `I' and the correct",
"spelling (e.g., `I\\hbox'). Otherwise just continue,",
"and I'll forget about whatever was undefined.");
error();
}

	/*:369*/
	#line 7675 "ctex.w"

}
}

	/*:366*/
	#line 7656 "ctex.w"

else if(cur_cmd<end_template)macro_call();
else	/*374:*/
	#line 7773 "ctex.w"

{cur_tok= cs_token_flag+frozen_endv;back_input();
}

	/*:374*/
	#line 7658 "ctex.w"
;
cur_val= cv_backup;cur_val_level= cvl_backup;radix= radix_backup;
cur_order= co_backup;link(backup_head)= backup_backup;
}

	/*:365*/	/*379:*/
	#line 7807 "ctex.w"
static void get_x_token(void)

{
restart:get_next();

if(cur_cmd<=max_command)goto done;
if(cur_cmd>=call)
if(cur_cmd<end_template)macro_call();
else{cur_cs= frozen_endv;cur_cmd= endv;
goto done;
}
else expand();
goto restart;
done:if(cur_cs==0)cur_tok= (cur_cmd*0400)+cur_chr;
else cur_tok= cs_token_flag+cur_cs;
}

	/*:379*/	/*380:*/
	#line 7827 "ctex.w"
static void x_token(void)
{while(cur_cmd>max_command)
{expand();
get_next();
}
if(cur_cs==0)cur_tok= (cur_cmd*0400)+cur_chr;
else cur_tok= cs_token_flag+cur_cs;
}

	/*:380*/	/*402:*/
	#line 8175 "ctex.w"
static void scan_left_brace(void)
{	/*403:*/
	#line 8189 "ctex.w"

do{get_x_token();
}while(!((cur_cmd!=spacer)&&(cur_cmd!=relax)))

	/*:403*/
	#line 8176 "ctex.w"
;
if(cur_cmd!=left_brace)
{print_err("Missing { inserted");

help4("A left brace was mandatory here, so I've put one in.",
"You might want to delete and/or insert some corrections",
"so that I will find a matching right brace soon.",
"(If you're confused by all this, try typing `I}' now.)");
back_error();cur_tok= left_brace_token+'{';cur_cmd= left_brace;
cur_chr= '{';incr(align_state);
}
}

	/*:402*/	/*404:*/
	#line 8196 "ctex.w"
static void scan_optional_equals(void)
{	/*405:*/
	#line 8201 "ctex.w"

do{get_x_token();
}while(!(cur_cmd!=spacer))

	/*:405*/
	#line 8197 "ctex.w"
;
if(cur_tok!=other_token+'=')back_input();
}

	/*:404*/	/*406:*/
	#line 8220 "ctex.w"
static bool scan_keyword(char*s)
{
pointer p;
pointer q;
p= backup_head;link(p)= null;
while(*s!=0)
{get_x_token();

if((cur_cs==0)&&
((cur_chr==so(*s))||(cur_chr==so(*s)-'a'+'A')))
{store_new_token(cur_tok);incr(s);
}
else if((cur_cmd!=spacer)||(p!=backup_head))
{back_input();
if(p!=backup_head)back_list(link(backup_head));
return false;
}
}
flush_list(link(backup_head));return true;
}

	/*:406*/	/*407:*/
	#line 8244 "ctex.w"
static void mu_error(void)
{print_err("Incompatible glue units");

help1("I'm going to assume that 1mu=1pt when they're mixed.");
error();
}

	/*:407*/	/*408:*/
	#line 8261 "ctex.w"
static void scan_int(void);
	/*432:*/
	#line 8596 "ctex.w"

static void scan_eight_bit_int(void)
{scan_int();
if((cur_val<0)||(cur_val>255))
{print_err("Bad register code");

help2("A register number must be between 0 and 255.",
"I changed this one to zero.");int_error(cur_val);cur_val= 0;
}
}

	/*:432*/	/*433:*/
	#line 8607 "ctex.w"

static void scan_char_num(void)
{scan_int();
if((cur_val<0)||(cur_val>255))
{print_err("Bad character code");

help2("A character number must be between 0 and 255.",
"I changed this one to zero.");int_error(cur_val);cur_val= 0;
}
}

	/*:433*/	/*434:*/
	#line 8621 "ctex.w"

static void scan_four_bit_int(void)
{scan_int();
if((cur_val<0)||(cur_val>15))
{print_err("Bad number");

help2("Since I expected to read a number between 0 and 15,",
"I changed this one to zero.");int_error(cur_val);cur_val= 0;
}
}

	/*:434*/	/*435:*/
	#line 8632 "ctex.w"

static void scan_fifteen_bit_int(void)
{scan_int();
if((cur_val<0)||(cur_val>077777))
{print_err("Bad mathchar");

help2("A mathchar number must be between 0 and 32767.",
"I changed this one to zero.");int_error(cur_val);cur_val= 0;
}
}

	/*:435*/	/*436:*/
	#line 8643 "ctex.w"

static void scan_twenty_seven_bit_int(void)
{scan_int();
if((cur_val<0)||(cur_val>0777777777))
{print_err("Bad delimiter code");

help2("A numeric delimiter code must be between 0 and 2^{27}-1.",
"I changed this one to zero.");int_error(cur_val);cur_val= 0;
}
}

	/*:436*/
	#line 8262 "ctex.w"

	/*576:*/
	#line 11226 "ctex.w"

static void scan_font_ident(void)
{internal_font_number f;
halfword m;
	/*405:*/
	#line 8201 "ctex.w"

do{get_x_token();
}while(!(cur_cmd!=spacer))

	/*:405*/
	#line 11230 "ctex.w"
;
if(cur_cmd==def_font)f= cur_font;
else if(cur_cmd==set_font)f= cur_chr;
else if(cur_cmd==def_family)
{m= cur_chr;scan_four_bit_int();f= equiv(m+cur_val);
}
else{print_err("Missing font identifier");

help2("I was looking for a control sequence whose",
"current meaning has been defined by \\font.");
back_error();f= null_font;
}
cur_val= f;
}

	/*:576*/	/*577:*/
	#line 11249 "ctex.w"

static void find_font_dimen(bool writing)

{internal_font_number f;
int n;
scan_int();n= cur_val;scan_font_ident();f= cur_val;
if(n<=0)cur_val= fmem_ptr;
else{if(writing&&(n<=space_shrink_code)&&
(n>=space_code)&&(font_glue[f]!=null))
{delete_glue_ref(font_glue[f]);
font_glue[f]= null;
}
if(n>font_params[f])
if(f<font_ptr)cur_val= fmem_ptr;
else	/*579:*/
	#line 11280 "ctex.w"

{do{if(fmem_ptr==font_mem_size)
overflow("font memory",font_mem_size);

font_info[fmem_ptr].sc= 0;incr(fmem_ptr);incr(font_params[f]);
}while(!(n==font_params[f]));
cur_val= fmem_ptr-1;
}

	/*:579*/
	#line 11263 "ctex.w"

else cur_val= n+param_base[f];
}
	/*578:*/
	#line 11269 "ctex.w"

if(cur_val==fmem_ptr)
{print_err("Font ");printn_esc(font_id_text(f));
print(" has only ");print_int(font_params[f]);
print(" fontdimen parameters");

help2("To increase the number of font parameters, you must",
"use \\fontdimen immediately after the \\font is loaded.");
error();
}

	/*:578*/
	#line 11266 "ctex.w"
;
}

	/*:577*/
	#line 8263 "ctex.w"


	/*:408*/	/*412:*/
	#line 8333 "ctex.w"
static void scan_something_internal(small_number level,bool negative)

{halfword m;
int p;
m= cur_chr;
switch(cur_cmd){
case def_code:	/*413:*/
	#line 8363 "ctex.w"

{scan_char_num();
if(m==math_code_base)scanned_result(ho(math_code(cur_val)),int_val)
else if(m<math_code_base)scanned_result(equiv(m+cur_val),int_val)
else scanned_result(eqtb[m+cur_val].i,int_val);
}

	/*:413*/
	#line 8339 "ctex.w"
break;
case toks_register:case assign_toks:case def_family:case set_font:case def_font:	/*414:*/
	#line 8370 "ctex.w"

if(level!=tok_val)
{print_err("Missing number, treated as zero");

help3("A number should have been here; I inserted `0'.",
"(If you can't figure out why I needed to see a number,",
"look up `weird error' in the index to The TeXbook.)");

back_error();scanned_result(0,dimen_val);
}
else if(cur_cmd<=assign_toks)
{if(cur_cmd<assign_toks)
{scan_eight_bit_int();m= toks_base+cur_val;
}
scanned_result(equiv(m),tok_val);
}
else{back_input();scan_font_ident();
scanned_result(font_id_base+cur_val,ident_val);
}

	/*:414*/
	#line 8341 "ctex.w"
break;
case assign_int:scanned_result(eqtb[m].i,int_val)break;
case assign_dimen:scanned_result(eqtb[m].sc,dimen_val)break;
case assign_glue:scanned_result(equiv(m),glue_val)break;
case assign_mu_glue:scanned_result(equiv(m),mu_val)break;
case set_aux:	/*417:*/
	#line 8444 "ctex.w"

if(abs(mode)!=m)
{print_err("Improper ");print_cmd_chr(set_aux,m);


help4("You can refer to \\spacefactor only in horizontal mode;",
"you can refer to \\prevdepth only in vertical mode; and",
"neither of these is meaningful inside \\write. So",
"I'm forgetting what you said and using zero instead.");
error();
if(level!=tok_val)scanned_result(0,dimen_val)
else scanned_result(0,int_val);
}
else if(m==vmode)scanned_result(prev_depth,dimen_val)
else scanned_result(space_factor,int_val)

	/*:417*/
	#line 8346 "ctex.w"
break;
case set_prev_graf:	/*421:*/
	#line 8483 "ctex.w"

if(mode==0)scanned_result(0,int_val)
else{nest[nest_ptr]= cur_list;p= nest_ptr;
while(abs(nest[p].mode_field)!=vmode)decr(p);
scanned_result(nest[p].pg_field,int_val);
}

	/*:421*/
	#line 8347 "ctex.w"
break;
case set_page_int:	/*418:*/
	#line 8460 "ctex.w"

{if(m==0)cur_val= dead_cycles;else cur_val= insert_penalties;
cur_val_level= int_val;
}

	/*:418*/
	#line 8348 "ctex.w"
break;
case set_page_dimen:	/*420:*/
	#line 8476 "ctex.w"

{if((page_contents==empty)&&(!output_active))
if(m==0)cur_val= max_dimen;else cur_val= 0;
else cur_val= page_so_far[m];
cur_val_level= dimen_val;
}

	/*:420*/
	#line 8349 "ctex.w"
break;
case set_shape:	/*422:*/
	#line 8490 "ctex.w"

{if(par_shape_ptr==null)cur_val= 0;
else cur_val= info(par_shape_ptr);
cur_val_level= int_val;
}

	/*:422*/
	#line 8350 "ctex.w"
break;
case set_box_dimen:	/*419:*/
	#line 8465 "ctex.w"

{scan_eight_bit_int();
if(box(cur_val)==null)cur_val= 0;else cur_val= mem[box(cur_val)+m].sc;
cur_val_level= dimen_val;
}

	/*:419*/
	#line 8351 "ctex.w"
break;
case char_given:case math_given:scanned_result(cur_chr,int_val)break;
case assign_font_dimen:	/*424:*/
	#line 8527 "ctex.w"

{find_font_dimen(false);font_info[fmem_ptr].sc= 0;
scanned_result(font_info[cur_val].sc,dimen_val);
}

	/*:424*/
	#line 8353 "ctex.w"
break;
case assign_font_int:	/*425:*/
	#line 8532 "ctex.w"

{scan_font_ident();
if(m==0)scanned_result(hyphen_char[cur_val],int_val)
else scanned_result(skew_char[cur_val],int_val);
}

	/*:425*/
	#line 8354 "ctex.w"
break;
case internal_register:	/*426:*/
	#line 8538 "ctex.w"

{scan_eight_bit_int();
switch(m){
case int_val:cur_val= count(cur_val);break;
case dimen_val:cur_val= dimen(cur_val);break;
case glue_val:cur_val= skip(cur_val);break;
case mu_val:cur_val= mu_skip(cur_val);
}
cur_val_level= m;
}

	/*:426*/
	#line 8355 "ctex.w"
break;
case last_item:	/*423:*/
	#line 8502 "ctex.w"

if(cur_chr>glue_val)
{if(cur_chr==input_line_no_code)cur_val= line;
else cur_val= last_badness;
cur_val_level= int_val;
}
else{if(cur_chr==glue_val)cur_val= zero_glue;else cur_val= 0;
cur_val_level= cur_chr;
if(!is_char_node(tail)&&(mode!=0))
switch(cur_chr){
case int_val:if(type(tail)==penalty_node)cur_val= penalty(tail);break;
case dimen_val:if(type(tail)==kern_node)cur_val= width(tail);break;
case glue_val:if(type(tail)==glue_node)
{cur_val= glue_ptr(tail);
if(subtype(tail)==mu_glue)cur_val_level= mu_val;
}
}
else if((mode==vmode)&&(tail==head))
switch(cur_chr){
case int_val:cur_val= last_penalty;break;
case dimen_val:cur_val= last_kern;break;
case glue_val:if(last_glue!=max_halfword)cur_val= last_glue;
}
}

	/*:423*/
	#line 8356 "ctex.w"
break;
default:	/*427:*/
	#line 8549 "ctex.w"

{print_err("You can't use `");print_cmd_chr(cur_cmd,cur_chr);

print("' after ");print_esc("the");
help1("I'm forgetting what you said and using zero instead.");
error();
if(level!=tok_val)scanned_result(0,dimen_val)
else scanned_result(0,int_val);
}

	/*:427*/
	#line 8357 "ctex.w"

}
while(cur_val_level>level)	/*428:*/
	#line 8565 "ctex.w"

{if(cur_val_level==glue_val)cur_val= width(cur_val);
else if(cur_val_level==mu_val)mu_error();
decr(cur_val_level);
}

	/*:428*/
	#line 8359 "ctex.w"
;
	/*429:*/
	#line 8575 "ctex.w"

if(negative)
if(cur_val_level>=glue_val)
{cur_val= new_spec(cur_val);
	/*430:*/
	#line 8585 "ctex.w"

{negate(width(cur_val));
negate(stretch(cur_val));
negate(shrink(cur_val));
}

	/*:430*/
	#line 8579 "ctex.w"
;
}
else negate(cur_val);
else if((cur_val_level>=glue_val)&&(cur_val_level<=mu_val))
add_glue_ref(cur_val)

	/*:429*/
	#line 8360 "ctex.w"
;
}

	/*:412*/	/*439:*/
	#line 8686 "ctex.w"
static void scan_int(void)
{
bool negative;
int m;
small_number d;
bool vacuous;
bool OK_so_far;
radix= 0;OK_so_far= true;
	/*440:*/
	#line 8702 "ctex.w"

negative= false;
do{	/*405:*/
	#line 8201 "ctex.w"

do{get_x_token();
}while(!(cur_cmd!=spacer))

	/*:405*/
	#line 8704 "ctex.w"
;
if(cur_tok==other_token+'-')
{negative= !negative;cur_tok= other_token+'+';
}
}while(!(cur_tok!=other_token+'+'))

	/*:440*/
	#line 8694 "ctex.w"
;
if(cur_tok==alpha_token)	/*441:*/
	#line 8713 "ctex.w"

{get_token();
if(cur_tok<cs_token_flag)
{cur_val= cur_chr;
if(cur_cmd<=right_brace)
if(cur_cmd==right_brace)incr(align_state);
else decr(align_state);
}
else if(cur_tok<cs_token_flag+single_base)
cur_val= cur_tok-cs_token_flag-active_base;
else cur_val= cur_tok-cs_token_flag-single_base;
if(cur_val>255)
{print_err("Improper alphabetic constant");

help2("A one-character control sequence belongs after a ` mark.",
"So I'm essentially inserting \\0 here.");
cur_val= '0';back_error();
}
else	/*442:*/
	#line 8734 "ctex.w"

{get_x_token();if(cur_cmd!=spacer)back_input();
}

	/*:442*/
	#line 8731 "ctex.w"
;
}

	/*:441*/
	#line 8695 "ctex.w"

else if((cur_cmd>=min_internal)&&(cur_cmd<=max_internal))
scan_something_internal(int_val,false);
else	/*443:*/
	#line 8738 "ctex.w"

{radix= 10;m= 214748364;
if(cur_tok==octal_token)
{radix= 8;m= 02000000000;get_x_token();
}
else if(cur_tok==hex_token)
{radix= 16;m= 01000000000;get_x_token();
}
vacuous= true;cur_val= 0;
	/*444:*/
	#line 8757 "ctex.w"

loop{if((cur_tok<zero_token+radix)&&(cur_tok>=zero_token)&&
(cur_tok<=zero_token+9))d= cur_tok-zero_token;
else if(radix==16)
if((cur_tok<=A_token+5)&&(cur_tok>=A_token))d= cur_tok-A_token+10;
else if((cur_tok<=other_A_token+5)&&(cur_tok>=other_A_token))
d= cur_tok-other_A_token+10;
else goto done;
else goto done;
vacuous= false;
if((cur_val>=m)&&((cur_val>m)||(d>7)||(radix!=10)))
{if(OK_so_far)
{print_err("Number too big");

help2("I can only go up to 2147483647='17777777777=\"7FFFFFFF,",
"so I'm using that number instead of yours.");
error();cur_val= infinity;OK_so_far= false;
}
}
else cur_val= cur_val*radix+d;
get_x_token();
}
done:

	/*:444*/
	#line 8747 "ctex.w"
;
if(vacuous)	/*445:*/
	#line 8781 "ctex.w"

{print_err("Missing number, treated as zero");

help3("A number should have been here; I inserted `0'.",
"(If you can't figure out why I needed to see a number,",
"look up `weird error' in the index to The TeXbook.)");

back_error();
}

	/*:445*/
	#line 8748 "ctex.w"

else if(cur_cmd!=spacer)back_input();
}

	/*:443*/
	#line 8698 "ctex.w"
;
if(negative)negate(cur_val);
}

	/*:439*/	/*447:*/
	#line 8820 "ctex.w"
static void scan_dimen(bool mu,bool inf,bool shortcut)

{
bool negative;
int f;
	/*449:*/
	#line 8862 "ctex.w"

int num,denom;
int k,kk;
pointer p,q;
scaled v;
int save_cur_val;

	/*:449*/
	#line 8825 "ctex.w"

f= 0;arith_error= false;cur_order= normal;negative= false;
if(!shortcut)
{	/*440:*/
	#line 8702 "ctex.w"

negative= false;
do{	/*405:*/
	#line 8201 "ctex.w"

do{get_x_token();
}while(!(cur_cmd!=spacer))

	/*:405*/
	#line 8704 "ctex.w"
;
if(cur_tok==other_token+'-')
{negative= !negative;cur_tok= other_token+'+';
}
}while(!(cur_tok!=other_token+'+'))

	/*:440*/
	#line 8828 "ctex.w"
;
if((cur_cmd>=min_internal)&&(cur_cmd<=max_internal))
	/*448:*/
	#line 8851 "ctex.w"

if(mu)
{scan_something_internal(mu_val,false);
	/*450:*/
	#line 8873 "ctex.w"

if(cur_val_level>=glue_val)
{v= width(cur_val);delete_glue_ref(cur_val);cur_val= v;
}

	/*:450*/
	#line 8854 "ctex.w"
;
if(cur_val_level==mu_val)goto attach_sign;
if(cur_val_level!=int_val)mu_error();
}
else{scan_something_internal(dimen_val,false);
if(cur_val_level==dimen_val)goto attach_sign;
}

	/*:448*/
	#line 8830 "ctex.w"

else{back_input();
if(cur_tok==continental_point_token)cur_tok= point_token;
if(cur_tok!=point_token)scan_int();
else{radix= 10;cur_val= 0;
}
if(cur_tok==continental_point_token)cur_tok= point_token;
if((radix==10)&&(cur_tok==point_token))	/*451:*/
	#line 8884 "ctex.w"

{k= 0;p= null;get_token();
loop{get_x_token();
if((cur_tok>zero_token+9)||(cur_tok<zero_token))goto done1;
if(k<17)
{q= get_avail();link(q)= p;info(q)= cur_tok-zero_token;
p= q;incr(k);
}
}
done1:for(kk= k;kk>=1;kk--)
{dig[kk-1]= info(p);q= p;p= link(p);free_avail(q);
}
f= round_decimals(k);
if(cur_cmd!=spacer)back_input();
}

	/*:451*/
	#line 8837 "ctex.w"
;
}
}
if(cur_val<0)
{negative= !negative;negate(cur_val);
}
	/*452:*/
	#line 8907 "ctex.w"

if(inf)	/*453:*/
	#line 8925 "ctex.w"

if(scan_keyword("fil"))

{cur_order= fil;
while(scan_keyword("l"))
{if(cur_order==filll)
{print_err("Illegal unit of measure (");

print("replaced by filll)");
help1("I dddon't go any higher than filll.");error();
}
else incr(cur_order);
}
goto attach_fraction;
}

	/*:453*/
	#line 8908 "ctex.w"
;
	/*454:*/
	#line 8941 "ctex.w"

save_cur_val= cur_val;
	/*405:*/
	#line 8201 "ctex.w"

do{get_x_token();
}while(!(cur_cmd!=spacer))

	/*:405*/
	#line 8943 "ctex.w"
;
if((cur_cmd<min_internal)||(cur_cmd>max_internal))back_input();
else{if(mu)
{scan_something_internal(mu_val,false);	/*450:*/
	#line 8873 "ctex.w"

if(cur_val_level>=glue_val)
{v= width(cur_val);delete_glue_ref(cur_val);cur_val= v;
}

	/*:450*/
	#line 8946 "ctex.w"
;
if(cur_val_level!=mu_val)mu_error();
}
else scan_something_internal(dimen_val,false);
v= cur_val;goto found;
}
if(mu)goto not_found;
if(scan_keyword("em"))v= (	/*557:*/
	#line 10885 "ctex.w"
quad(cur_font)

	/*:557*/
	#line 8953 "ctex.w"
);

else if(scan_keyword("ex"))v= (	/*558:*/
	#line 10887 "ctex.w"
x_height(cur_font)

	/*:558*/
	#line 8955 "ctex.w"
);

else goto not_found;
	/*442:*/
	#line 8734 "ctex.w"

{get_x_token();if(cur_cmd!=spacer)back_input();
}

	/*:442*/
	#line 8958 "ctex.w"
;
found:cur_val= nx_plus_y(save_cur_val,v,xn_over_d(v,f,0200000));
goto attach_sign;
not_found:

	/*:454*/
	#line 8910 "ctex.w"
;
if(mu)	/*455:*/
	#line 8963 "ctex.w"

if(scan_keyword("mu"))goto attach_fraction;

else{print_err("Illegal unit of measure (");print("mu inserted)");

help4("The unit of measurement in math glue must be mu.",
"To recover gracefully from this error, it's best to",
"delete the erroneous units; e.g., type `2' to delete",
"two letters. (See Chapter 27 of The TeXbook.)");

error();goto attach_fraction;
}

	/*:455*/
	#line 8911 "ctex.w"
;
if(scan_keyword("true"))	/*456:*/
	#line 8976 "ctex.w"

{prepare_mag();
if(mag!=1000)
{cur_val= xn_over_d(cur_val,1000,mag);
f= (1000*f+0200000*rem)/mag;
cur_val= cur_val+(f/0200000);f= f%0200000;
}
}

	/*:456*/
	#line 8912 "ctex.w"
;

if(scan_keyword("pt"))goto attach_fraction;

	/*457:*/
	#line 8994 "ctex.w"

if(scan_keyword("in"))set_conversion(7227,100)

else if(scan_keyword("pc"))set_conversion(12,1)

else if(scan_keyword("cm"))set_conversion(7227,254)

else if(scan_keyword("mm"))set_conversion(7227,2540)

else if(scan_keyword("bp"))set_conversion(7227,7200)

else if(scan_keyword("dd"))set_conversion(1238,1157)

else if(scan_keyword("cc"))set_conversion(14856,1157)

else if(scan_keyword("sp"))goto done;

else	/*458:*/
	#line 9017 "ctex.w"

{print_err("Illegal unit of measure (");print("pt inserted)");

help6("Dimensions can be in units of em, ex, in, pt, pc,",
"cm, mm, dd, cc, bp, or sp; but yours is a new one!",
"I'll assume that you meant to say pt, for printer's points.",
"To recover gracefully from this error, it's best to",
"delete the erroneous units; e.g., type `2' to delete",
"two letters. (See Chapter 27 of The TeXbook.)");

error();goto done2;
}


	/*:458*/
	#line 9011 "ctex.w"
;
cur_val= xn_over_d(cur_val,num,denom);
f= (num*f+0200000*rem)/denom;
cur_val= cur_val+(f/0200000);f= f%0200000;
done2:

	/*:457*/
	#line 8917 "ctex.w"
;
attach_fraction:if(cur_val>=040000)arith_error= true;
else cur_val= cur_val*unity+f;
done:

	/*:452*/
	#line 8844 "ctex.w"
;
	/*442:*/
	#line 8734 "ctex.w"

{get_x_token();if(cur_cmd!=spacer)back_input();
}

	/*:442*/
	#line 8845 "ctex.w"
;
attach_sign:if(arith_error||(abs(cur_val)>=010000000000))
	/*459:*/
	#line 9031 "ctex.w"

{print_err("Dimension too large");

help2("I can't work with sizes bigger than about 19 feet.",
"Continue and I'll use the largest value I can.");
error();cur_val= max_dimen;arith_error= false;
}

	/*:459*/
	#line 8847 "ctex.w"
;
if(negative)negate(cur_val);
}

	/*:447*/	/*460:*/
	#line 9049 "ctex.w"
static void scan_glue(small_number level)

{
bool negative;
pointer q;
bool mu;
mu= (level==mu_val);	/*440:*/
	#line 8702 "ctex.w"

negative= false;
do{	/*405:*/
	#line 8201 "ctex.w"

do{get_x_token();
}while(!(cur_cmd!=spacer))

	/*:405*/
	#line 8704 "ctex.w"
;
if(cur_tok==other_token+'-')
{negative= !negative;cur_tok= other_token+'+';
}
}while(!(cur_tok!=other_token+'+'))

	/*:440*/
	#line 9055 "ctex.w"
;
if((cur_cmd>=min_internal)&&(cur_cmd<=max_internal))
{scan_something_internal(level,negative);
if(cur_val_level>=glue_val)
{if(cur_val_level!=level)mu_error();
return;
}
if(cur_val_level==int_val)scan_dimen(mu,false,true);
else if(level==mu_val)mu_error();
}
else{back_input();scan_dimen(mu,false,false);
if(negative)negate(cur_val);
}
	/*461:*/
	#line 9072 "ctex.w"

q= new_spec(zero_glue);width(q)= cur_val;
if(scan_keyword("plus"))

{scan_dimen(mu,true,false);
stretch(q)= cur_val;stretch_order(q)= cur_order;
}
if(scan_keyword("minus"))

{scan_dimen(mu,true,false);
shrink(q)= cur_val;shrink_order(q)= cur_order;
}
cur_val= q

	/*:461*/
	#line 9069 "ctex.w"
;
}

	/*:460*/	/*462:*/
	#line 9095 "ctex.w"
static pointer scan_rule_spec(void)
{
pointer q;
q= new_rule();
if(cur_cmd==vrule)width(q)= default_rule;
else{height(q)= default_rule;depth(q)= 0;
}
reswitch:if(scan_keyword("width"))

{scan_normal_dimen;width(q)= cur_val;goto reswitch;
}
if(scan_keyword("height"))

{scan_normal_dimen;height(q)= cur_val;goto reswitch;
}
if(scan_keyword("depth"))

{scan_normal_dimen;depth(q)= cur_val;goto reswitch;
}
return q;
}

	/*:462*/	/*463:*/
	#line 9129 "ctex.w"
static pointer str_toks(pool_pointer b)

{pointer p;
pointer q;
halfword t;
pool_pointer k;
str_room(1);
p= temp_head;link(p)= null;k= b;
while(k<pool_ptr)
{t= so(str_pool[k]);
if(t==' ')t= space_token;
else t= other_token+t;
fast_store_new_token(t);
incr(k);
}
pool_ptr= b;return p;
}

	/*:463*/	/*464:*/
	#line 9154 "ctex.w"
static pointer the_toks(void)
{int old_setting;
pointer p,q,r;
pool_pointer b;
get_x_token();scan_something_internal(tok_val,false);
if(cur_val_level>=ident_val)	/*465:*/
	#line 9174 "ctex.w"

{p= temp_head;link(p)= null;
if(cur_val_level==ident_val)store_new_token(cs_token_flag+cur_val)
else if(cur_val!=null)
{r= link(cur_val);
while(r!=null)
{fast_store_new_token(info(r));r= link(r);
}
}
return p;
}

	/*:465*/
	#line 9159 "ctex.w"

else{old_setting= selector;selector= new_string;b= pool_ptr;
switch(cur_val_level){
case int_val:print_int(cur_val);break;
case dimen_val:{print_scaled(cur_val);print("pt");
}break;
case glue_val:{print_spec(cur_val,"pt");delete_glue_ref(cur_val);
}break;
case mu_val:{print_spec(cur_val,"mu");delete_glue_ref(cur_val);
}
}
selector= old_setting;return str_toks(b);
}
}

	/*:464*/	/*466:*/
	#line 9188 "ctex.w"
static void ins_the_toks(void)
{link(garbage)= the_toks();ins_list(link(temp_head));
}

	/*:466*/	/*469:*/
	#line 9230 "ctex.w"
static void conv_toks(void)
{int old_setting;
int c;
small_number save_scanner_status;
pool_pointer b;
c= cur_chr;	/*470:*/
	#line 9241 "ctex.w"

switch(c){
case number_code:case roman_numeral_code:scan_int();break;
case string_code:case meaning_code:{save_scanner_status= scanner_status;
scanner_status= normal;get_token();scanner_status= save_scanner_status;
}break;
case font_name_code:scan_font_ident();break;
case job_name_code:if(job_name==0)open_log_file();
}

	/*:470*/
	#line 9235 "ctex.w"
;
old_setting= selector;selector= new_string;b= pool_ptr;
	/*471:*/
	#line 9251 "ctex.w"

switch(c){
case number_code:print_int(cur_val);break;
case roman_numeral_code:print_roman_int(cur_val);break;
case string_code:if(cur_cs!=0)sprint_cs(cur_cs);
else print_char(cur_chr);break;
case meaning_code:print_meaning();break;
case font_name_code:{printn(font_name[cur_val]);
if(font_size[cur_val]!=font_dsize[cur_val])
{print(" at ");print_scaled(font_size[cur_val]);
print("pt");
}
}break;
case job_name_code:printn(job_name);
}

	/*:471*/
	#line 9237 "ctex.w"
;
selector= old_setting;link(garbage)= str_toks(b);ins_list(link(temp_head));
}

	/*:469*/	/*472:*/
	#line 9291 "ctex.w"
static pointer scan_toks(bool macro_def,bool xpand)
{
halfword t;
halfword s;
pointer p;
pointer q;
halfword unbalance;
halfword hash_brace;
if(macro_def)scanner_status= defining;
else scanner_status= absorbing;
warning_index= cur_cs;def_ref= get_avail();token_ref_count(def_ref)= null;
p= def_ref;hash_brace= 0;t= zero_token;
if(macro_def)	/*473:*/
	#line 9311 "ctex.w"

{loop{get_token();
if(cur_tok<right_brace_limit)goto done1;
if(cur_cmd==mac_param)
	/*475:*/
	#line 9332 "ctex.w"

{s= match_token+cur_chr;get_token();
if(cur_cmd==left_brace)
{hash_brace= cur_tok;
store_new_token(cur_tok);store_new_token(end_match_token);
goto done;
}
if(t==zero_token+9)
{print_err("You already have nine parameters");

help1("I'm going to ignore the # sign you just used.");error();
}
else{incr(t);
if(cur_tok!=t)
{print_err("Parameters must be numbered consecutively");

help2("I've inserted the digit you should have used after the #.",
"Type `1' to delete what you did use.");back_error();
}
cur_tok= s;
}
}

	/*:475*/
	#line 9317 "ctex.w"
;
store_new_token(cur_tok);
}
done1:store_new_token(end_match_token);
if(cur_cmd==right_brace)
	/*474:*/
	#line 9325 "ctex.w"

{print_err("Missing { inserted");incr(align_state);

help2("Where was the left brace? You said something like `\\def\\a}',",
"which I'm going to interpret as `\\def\\a{}'.");error();goto found;
}

	/*:474*/
	#line 9322 "ctex.w"
;
done:;}

	/*:473*/
	#line 9303 "ctex.w"

else scan_left_brace();
	/*476:*/
	#line 9355 "ctex.w"

unbalance= 1;
loop{if(xpand)	/*477:*/
	#line 9372 "ctex.w"

{loop{get_next();
if(cur_cmd<=max_command)goto done2;
if(cur_cmd!=the)expand();
else{q= the_toks();
if(link(temp_head)!=null)
{link(p)= link(temp_head);p= q;
}
}
}
done2:x_token();
}

	/*:477*/
	#line 9357 "ctex.w"

else get_token();
if(cur_tok<right_brace_limit)
if(cur_cmd<right_brace)incr(unbalance);
else{decr(unbalance);
if(unbalance==0)goto found;
}
else if(cur_cmd==mac_param)
if(macro_def)	/*478:*/
	#line 9385 "ctex.w"

{s= cur_tok;
if(xpand)get_x_token();else get_token();
if(cur_cmd!=mac_param)
if((cur_tok<=zero_token)||(cur_tok>t))
{print_err("Illegal parameter number in definition of ");

sprint_cs(warning_index);
help3("You meant to type ## instead of #, right?",
"Or maybe a } was forgotten somewhere earlier, and things",
"are all screwed up? I'm going to assume that you meant ##.");
back_error();cur_tok= s;
}
else cur_tok= out_param_token-'0'+cur_chr;
}

	/*:478*/
	#line 9365 "ctex.w"
;
store_new_token(cur_tok);
}

	/*:476*/
	#line 9305 "ctex.w"
;
found:scanner_status= normal;
if(hash_brace!=0)store_new_token(hash_brace);
return p;
}

	/*:472*/	/*481:*/
	#line 9422 "ctex.w"
static void read_toks(int n,pointer r)
{
pointer p;
pointer q;
int s;
small_number m;
scanner_status= defining;warning_index= r;
def_ref= get_avail();token_ref_count(def_ref)= null;
p= def_ref;
store_new_token(end_match_token);
if((n<0)||(n>15))m= 16;else m= n;
s= align_state;align_state= 1000000;
do{	/*482:*/
	#line 9439 "ctex.w"

begin_file_reading();name= m+1;
if(read_open[m]==closed)	/*483:*/
	#line 9463 "ctex.w"

if(interaction>nonstop_mode)
if(n<0)prompt_input("")
else{wake_up_terminal;
print_ln();sprint_cs(r);prompt_input("=");n= -1;
}
else fatal_error("*** (cannot \\read from terminal in nonstop modes)")


	/*:483*/
	#line 9441 "ctex.w"
;
else if(read_open[m]==just_open)	/*484:*/
	#line 9476 "ctex.w"

if(input_ln(&read_file[m],false))read_open[m]= normal;
else{a_close(&read_file[m]);read_open[m]= closed;
}

	/*:484*/
	#line 9442 "ctex.w"

else	/*485:*/
	#line 9484 "ctex.w"

{if(!input_ln(&read_file[m],true))
{a_close(&read_file[m]);read_open[m]= closed;
if(align_state!=1000000)
{runaway();
print_err("File ended within ");print_esc("read");

help1("This \\read has unbalanced braces.");
align_state= 1000000;error();
}
}
}

	/*:485*/
	#line 9443 "ctex.w"
;
limit= last;
if(end_line_char_inactive)decr(limit);
else buffer[limit]= end_line_char;
first= limit+1;loc= start;state= new_line;
loop{get_token();
if(cur_tok==0)goto done;

if(align_state<1000000)
{do{get_token();}while(!(cur_tok==0));
align_state= 1000000;goto done;
}
store_new_token(cur_tok);
}
done:end_file_reading()

	/*:482*/
	#line 9434 "ctex.w"
;
}while(!(align_state==1000000));
cur_val= def_ref;scanner_status= normal;align_state= s;
}

	/*:481*/	/*493:*/
	#line 9633 "ctex.w"
static void pass_text(void)
{
int l;
small_number save_scanner_status;
save_scanner_status= scanner_status;scanner_status= skipping;l= 0;
skip_line= line;
loop{get_next();
if(cur_cmd==fi_or_else)
{if(l==0)goto done;
if(cur_chr==fi_code)decr(l);
}
else if(cur_cmd==if_test)incr(l);
}
done:scanner_status= save_scanner_status;
}

	/*:493*/	/*496:*/
	#line 9670 "ctex.w"
static void change_if_limit(small_number l,pointer p)
{
pointer q;
if(p==cond_ptr)if_limit= l;
else{q= cond_ptr;
loop{if(q==null)confusion("if");

if(link(q)==p)
{type(q)= l;return;
}
q= link(q);
}
}
}

	/*:496*/	/*497:*/
	#line 9690 "ctex.w"
static void conditional(void)
{
bool b;
int r;
int m,n;
pointer p,q;
small_number save_scanner_status;
pointer save_cond_ptr;
small_number this_if;
	/*494:*/
	#line 9655 "ctex.w"

{p= get_node(if_node_size);link(p)= cond_ptr;type(p)= if_limit;
subtype(p)= cur_if;if_line_field(p)= if_line;
cond_ptr= p;cur_if= cur_chr;if_limit= if_code;if_line= line;
}

	/*:494*/
	#line 9699 "ctex.w"
;save_cond_ptr= cond_ptr;this_if= cur_chr;
	/*500:*/
	#line 9728 "ctex.w"

switch(this_if){
case if_char_code:case if_cat_code:	/*505:*/
	#line 9799 "ctex.w"

{get_x_token_or_active_char;
if((cur_cmd>active_char)||(cur_chr>255))
{m= relax;n= 256;
}
else{m= cur_cmd;n= cur_chr;
}
get_x_token_or_active_char;
if((cur_cmd>active_char)||(cur_chr>255))
{cur_cmd= relax;cur_chr= 256;
}
if(this_if==if_char_code)b= (n==cur_chr);else b= (m==cur_cmd);
}

	/*:505*/
	#line 9730 "ctex.w"
break;
case if_int_code:case if_dim_code:	/*502:*/
	#line 9756 "ctex.w"

{if(this_if==if_int_code)scan_int();else scan_normal_dimen;
n= cur_val;	/*405:*/
	#line 8201 "ctex.w"

do{get_x_token();
}while(!(cur_cmd!=spacer))

	/*:405*/
	#line 9758 "ctex.w"
;
if((cur_tok>=other_token+'<')&&(cur_tok<=other_token+'>'))
r= cur_tok-other_token;
else{print_err("Missing = inserted for ");

print_cmd_chr(if_test,this_if);
help1("I was expecting to see `<', `=', or `>'. Didn't.");
back_error();r= '=';
}
if(this_if==if_int_code)scan_int();else scan_normal_dimen;
switch(r){
case'<':b= (n<cur_val);break;
case'=':b= (n==cur_val);break;
case'>':b= (n>cur_val);
}
}

	/*:502*/
	#line 9731 "ctex.w"
break;
case if_odd_code:	/*503:*/
	#line 9775 "ctex.w"

{scan_int();b= odd(cur_val);
}

	/*:503*/
	#line 9732 "ctex.w"
break;
case if_vmode_code:b= (abs(mode)==vmode);break;
case if_hmode_code:b= (abs(mode)==hmode);break;
case if_mmode_code:b= (abs(mode)==mmode);break;
case if_inner_code:b= (mode<0);break;
case if_void_code:case if_hbox_code:case if_vbox_code:	/*504:*/
	#line 9779 "ctex.w"

{scan_eight_bit_int();p= box(cur_val);
if(this_if==if_void_code)b= (p==null);
else if(p==null)b= false;
else if(this_if==if_hbox_code)b= (type(p)==hlist_node);
else b= (type(p)==vlist_node);
}

	/*:504*/
	#line 9737 "ctex.w"
break;
case ifx_code:	/*506:*/
	#line 9820 "ctex.w"

{save_scanner_status= scanner_status;scanner_status= normal;
get_next();n= cur_cs;p= cur_cmd;q= cur_chr;
get_next();if(cur_cmd!=p)b= false;
else if(cur_cmd<call)b= (cur_chr==q);
else	/*507:*/
	#line 9837 "ctex.w"

{p= link(cur_chr);q= link(equiv(n));
if(p==q)b= true;
else{while((p!=null)&&(q!=null))
if(info(p)!=info(q))p= null;
else{p= link(p);q= link(q);
}
b= ((p==null)&&(q==null));
}
}

	/*:507*/
	#line 9825 "ctex.w"
;
scanner_status= save_scanner_status;
}

	/*:506*/
	#line 9738 "ctex.w"
break;
case if_eof_code:{scan_four_bit_int();b= (read_open[cur_val]==closed);
}break;
case if_true_code:b= true;break;
case if_false_code:b= false;break;
case if_case_code:	/*508:*/
	#line 9848 "ctex.w"

{scan_int();n= cur_val;
if(tracing_commands>1)
{begin_diagnostic();print("{case ");print_int(n);print_char('}');
end_diagnostic(false);
}
while(n!=0)
{pass_text();
if(cond_ptr==save_cond_ptr)
if(cur_chr==or_code)decr(n);
else goto common_ending;
else if(cur_chr==fi_code)	/*495:*/
	#line 9661 "ctex.w"

{p= cond_ptr;if_line= if_line_field(p);
cur_if= subtype(p);if_limit= type(p);cond_ptr= link(p);
free_node(p,if_node_size);
}

	/*:495*/
	#line 9859 "ctex.w"
;
}
change_if_limit(or_code,save_cond_ptr);
return;
}

	/*:508*/
	#line 9743 "ctex.w"
;
}

	/*:500*/
	#line 9700 "ctex.w"
;
if(tracing_commands>1)	/*501:*/
	#line 9746 "ctex.w"

{begin_diagnostic();
if(b)print("{true}");else print("{false}");
end_diagnostic(false);
}

	/*:501*/
	#line 9701 "ctex.w"
;
if(b)
{change_if_limit(else_code,save_cond_ptr);
return;
}
	/*499:*/
	#line 9716 "ctex.w"

loop{pass_text();
if(cond_ptr==save_cond_ptr)
{if(cur_chr!=or_code)goto common_ending;
print_err("Extra ");print_esc("or");

help1("I'm ignoring this; it doesn't match any \\if.");
error();
}
else if(cur_chr==fi_code)	/*495:*/
	#line 9661 "ctex.w"

{p= cond_ptr;if_line= if_line_field(p);
cur_if= subtype(p);if_limit= type(p);cond_ptr= link(p);
free_node(p,if_node_size);
}

	/*:495*/
	#line 9725 "ctex.w"
;
}

	/*:499*/
	#line 9706 "ctex.w"
;
common_ending:if(cur_chr==fi_code)	/*495:*/
	#line 9661 "ctex.w"

{p= cond_ptr;if_line= if_line_field(p);
cur_if= subtype(p);if_limit= type(p);cond_ptr= link(p);
free_node(p,if_node_size);
}

	/*:495*/
	#line 9707 "ctex.w"

else if_limit= fi_code;
}

	/*:497*/	/*514:*/
	#line 9992 "ctex.w"
static char cur_file_name[MAX_CUR_FILE_NAME+1];
static void begin_name(void)
{area_delimiter= ext_delimiter= cur_file_name_length= 0;
}

	/*:514*/	/*515:*/
	#line 10003 "ctex.w"
static bool more_name(ASCII_code c)
{if(c==' ')return false;
if(cur_file_name_length>=MAX_CUR_FILE_NAME)
{overflow("file name length",MAX_CUR_FILE_NAME);
return false;
}
else
{
cur_file_name[cur_file_name_length]= c;
if(c=='/')
{area_delimiter= cur_file_name_length;ext_delimiter= 0;
}
else if(c=='.')ext_delimiter= cur_file_name_length;
cur_file_name_length++;
return true;
}
}

	/*:515*/	/*516:*/
	#line 10024 "ctex.w"
static void end_name(void)
{int i= 0;
if(str_ptr+1>max_strings)
overflow("number of strings",max_strings-init_str_ptr);

cur_file_name[cur_file_name_length]= 0;
if(area_delimiter==0)cur_area= cur_file_name+cur_file_name_length;
else cur_area= cur_file_name,i= area_delimiter+1;
if(ext_delimiter==0)ext_delimiter= cur_file_name_length;
cur_ext= cur_file_name+ext_delimiter;
for(;i<ext_delimiter;i++)append_char(cur_file_name[i]);
if(area_delimiter!=0)cur_file_name[area_delimiter+1]= 0;
cur_name= make_string();
}

static void set_cur_area_ext(str_number a,str_number e)
{int i;
if(length(a)+length(e)+2>=MAX_CUR_FILE_NAME)
{overflow("file name length",MAX_CUR_FILE_NAME);
return;
}
cur_file_name_length= 0;
area_delimiter= 0;
for(i= str_start[a];i<str_start[a+1];i++)cur_file_name[cur_file_name_length++]= str_pool[i];
cur_file_name[cur_file_name_length++]= 0;
cur_area= cur_file_name;
cur_ext= cur_file_name+cur_file_name_length;
for(i= str_start[e];i<str_start[e+1];i++)cur_file_name[cur_file_name_length++]= str_pool[i];
cur_file_name[cur_file_name_length++]= 0;
}

	/*:516*/	/*518:*/
	#line 10079 "ctex.w"
static void pack_file_name(str_number n,char*a,char*e)
{int k;
ASCII_code c;
int j;
k= 0;
while(*a!=0)append_to_name(so(*a++));
for(j= str_start[n];j<=str_start[n+1]-1;j++)append_to_name(so(str_pool[j]));
while(*e!=0)append_to_name(so(*e++));
if(k<=file_name_size)name_length= k;else name_length= file_name_size;
name_of_file[name_length+1]= 0;
}

	/*:518*/	/*522:*/
	#line 10125 "ctex.w"
static void pack_buffered_name(small_number n,int a,int b)
{int k;
ASCII_code c;
int j;
if(n+b-a+1+format_ext_length>file_name_size)
b= a+file_name_size-n-1-format_ext_length;
k= 0;
for(j= 1;j<=n;j++)append_to_name(xord[TEX_format_default[j]]);
for(j= a;j<=b;j++)append_to_name(buffer[j]);
for(j= format_default_length-format_ext_length+1;j<=format_default_length;j++)
append_to_name(xord[TEX_format_default[j]]);
if(k<=file_name_size)name_length= k;else name_length= file_name_size;
name_of_file[name_length+1]= 0;
}

	/*:522*/	/*524:*/
	#line 10187 "ctex.w"
static str_number make_name_string(void)
{int k;
if((pool_ptr+name_length>pool_size)||(str_ptr==max_strings)||
(cur_length>0))
return'?';
else{for(k= 1;k<=name_length;k++)append_char(xord[name_of_file[k]]);
return make_string();
}
}
static str_number a_make_name_string(alpha_file*f)
{return make_name_string();
}
static str_number b_make_name_string(byte_file*f)
{return make_name_string();
}
#ifdef INIT
static str_number w_make_name_string(word_file*f)
{return make_name_string();
}
#endif

	/*:524*/	/*525:*/
	#line 10213 "ctex.w"
static void scan_file_name(void)
{
name_in_progress= true;begin_name();
	/*405:*/
	#line 8201 "ctex.w"

do{get_x_token();
}while(!(cur_cmd!=spacer))

	/*:405*/
	#line 10216 "ctex.w"
;
loop{if((cur_cmd>other_char)||(cur_chr>255))
{back_input();goto done;
}
if(!more_name(cur_chr))goto done;
get_x_token();
}
done:end_name();name_in_progress= false;
}

	/*:525*/	/*528:*/
	#line 10256 "ctex.w"
static void pack_job_name(char*s)

{cur_area= "";cur_ext= s;
cur_name= job_name;pack_cur_name;
}

	/*:528*/	/*529:*/
	#line 10269 "ctex.w"
static void prompt_file_name(char*s,char*e)
{
int k;
if(interaction==scroll_mode)wake_up_terminal;
if(strcmp(s,"input file name")==0)print_err("I can't find file `");

else print_err("I can't write on file `");

print_file_name(cur_name,cur_area,cur_ext);print("'.");
if(strcmp(e,".tex")==0)show_context();
print_nl("Please type another ");print(s);

if(interaction<scroll_mode)
fatal_error("*** (job aborted, file error in nonstop mode)");

clear_terminal;prompt_input(": ");	/*530:*/
	#line 10289 "ctex.w"

{begin_name();k= first;
while((buffer[k]==' ')&&(k<last))incr(k);
loop{if(k==last)goto done;
if(!more_name(buffer[k]))goto done;
incr(k);
}
done:end_name();
}

	/*:530*/
	#line 10284 "ctex.w"
;
if(cur_ext[0]==0)cur_ext= e;
pack_cur_name;
}

	/*:529*/	/*533:*/
	#line 10320 "ctex.w"
static void open_log_file(void)
{int old_setting;
int k;
int l;
char months[]= " JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";
old_setting= selector;
if(job_name==0)job_name= s_no("texput");

pack_job_name(".log");
while(!a_open_out(&log_file))	/*534:*/
	#line 10357 "ctex.w"

{selector= term_only;
prompt_file_name("transcript file name",".log");
}

	/*:534*/
	#line 10329 "ctex.w"
;
log_name= a_make_name_string(&log_file);
selector= log_only;log_opened= true;
	/*535:*/
	#line 10362 "ctex.w"

{wlog("%s",banner);
slow_print(format_ident);print("  ");
print_int(day);print_char(' ');
for(k= 3*month-2;k<=3*month;k++)wlog("%c",months[k]);
print_char(' ');print_int(year);print_char(' ');
print_two(time/60);print_char(':');print_two(time%60);
}

	/*:535*/
	#line 10332 "ctex.w"
;
input_stack[input_ptr]= cur_input;
print_nl("**");

l= input_stack[0].limit_field;
if(buffer[l]==end_line_char)decr(l);
for(k= 1;k<=l;k++)printn(buffer[k]);
print_ln();
selector= old_setting+2;
}

	/*:533*/	/*536:*/
	#line 10374 "ctex.w"
static void start_input(void)
{
scan_file_name();
if(cur_ext[0]==0)cur_ext= ".tex";
pack_cur_name;
loop{begin_file_reading();
if(a_open_in(&cur_file))goto done;
if(cur_area==0||cur_area[0]==0)
{pack_file_name(cur_name,TEX_area,cur_ext);
if(a_open_in(&cur_file))goto done;
}
end_file_reading();
prompt_file_name("input file name",".tex");
}
done:name= a_make_name_string(&cur_file);
if(job_name==0)
{job_name= cur_name;open_log_file();
}

if(term_offset+length(name)>max_print_line-2)print_ln();
else if((term_offset>0)||(file_offset>0))print_char(' ');
print_char('(');incr(open_parens);slow_print(name);update_terminal;
state= new_line;
if(name==str_ptr-1)
{flush_string;name= cur_name;
}
	/*537:*/
	#line 10409 "ctex.w"

{line= 1;
if(input_ln(&cur_file,false))do_nothing;
firm_up_the_line();
if(end_line_char_inactive)decr(limit);
else buffer[limit]= end_line_char;
first= limit+1;loc= start;
}

	/*:537*/
	#line 10400 "ctex.w"
;
}

	/*:536*/	/*559:*/
	#line 10907 "ctex.w"
static internal_font_number read_font_info(pointer u,str_number nom,char*aire,
scaled s)
{
int k;
bool file_opened;
halfword lf,lh,bc,ec,nw,nh,nd,ni,nl,nk,ne,np;

internal_font_number f;
internal_font_number g;
eight_bits a,b,c,d;
four_quarters qw;scaled sw;
int bch_label;
int bchar;
scaled z;
int alpha;int beta;

g= null_font;
	/*561:*/
	#line 10960 "ctex.w"

	/*562:*/
	#line 10972 "ctex.w"

file_opened= false;
if(aire[0]==0)pack_file_name(nom,TEX_font_area,".tfm");
else pack_file_name(nom,aire,".tfm");
if(!b_open_in(&tfm_file))abort;
file_opened= true

	/*:562*/
	#line 10961 "ctex.w"
;
	/*564:*/
	#line 11000 "ctex.w"

{read_sixteen(lf);
fget;read_sixteen(lh);
fget;read_sixteen(bc);
fget;read_sixteen(ec);
if((bc>ec+1)||(ec>255))abort;
if(bc>255)
{bc= 1;ec= 0;
}
fget;read_sixteen(nw);
fget;read_sixteen(nh);
fget;read_sixteen(nd);
fget;read_sixteen(ni);
fget;read_sixteen(nl);
fget;read_sixteen(nk);
fget;read_sixteen(ne);
fget;read_sixteen(np);
if(lf!=6+lh+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np)abort;
if((nw==0)||(nh==0)||(nd==0)||(ni==0))abort;
}

	/*:564*/
	#line 10962 "ctex.w"
;
	/*565:*/
	#line 11027 "ctex.w"

lf= lf-6-lh;
if(np<7)lf= lf+7-np;
if((font_ptr==font_max)||(fmem_ptr+lf>font_mem_size))
	/*566:*/
	#line 11043 "ctex.w"

{start_font_error_message;
print(" not loaded: Not enough room left");

help4("I'm afraid I won't be able to make use of this font,",
"because my memory for character-size data is too small.",
"If you're really stuck, ask a wizard to enlarge me.",
"Or maybe try `I\\font<same font id>=<name of loaded font>'.");
error();goto done;
}

	/*:566*/
	#line 11031 "ctex.w"
;
f= font_ptr+1;
char_base[f]= fmem_ptr-bc;
width_base[f]= char_base[f]+ec+1;
height_base[f]= width_base[f]+nw;
depth_base[f]= height_base[f]+nh;
italic_base[f]= depth_base[f]+nd;
lig_kern_base[f]= italic_base[f]+ni;
kern_base[f]= lig_kern_base[f]+nl-kern_base_offset;
exten_base[f]= kern_base[f]+kern_base_offset+nk;
param_base[f]= exten_base[f]+ne

	/*:565*/
	#line 10963 "ctex.w"
;
	/*567:*/
	#line 11056 "ctex.w"

{if(lh<2)abort;
store_four_quarters(font_check[f]);
fget;read_sixteen(z);
fget;z= z*0400+fbyte;fget;z= (z*020)+(fbyte/020);
if(z<unity)abort;
while(lh>2)
{fget;fget;fget;fget;decr(lh);
}
font_dsize[f]= z;
if(s!=-1000)
if(s>=0)z= s;
else z= xn_over_d(z,-s,1000);
font_size[f]= z;
}

	/*:567*/
	#line 10964 "ctex.w"
;
	/*568:*/
	#line 11072 "ctex.w"

for(k= fmem_ptr;k<=width_base[f]-1;k++)
{store_four_quarters(font_info[k].qqqq);
if((a>=nw)||(b/020>=nh)||(b%020>=nd)||
(c/4>=ni))abort;
switch(c%4){
case lig_tag:if(d>=nl)abort;break;
case ext_tag:if(d>=ne)abort;break;
case list_tag:	/*569:*/
	#line 11093 "ctex.w"

{check_byte_range(d);
while(d<current_character_being_worked_on)
{qw= char_info(f,d);

if(char_tag(qw)!=list_tag)goto not_found;
d= qo(rem_byte(qw));
}
if(d==current_character_being_worked_on)abort;
not_found:;}

	/*:569*/
	#line 11080 "ctex.w"
break;
default:do_nothing;
}
}

	/*:568*/
	#line 10965 "ctex.w"
;
	/*570:*/
	#line 11128 "ctex.w"

{	/*571:*/
	#line 11138 "ctex.w"

{alpha= 16;
while(z>=040000000)
{z= z/2;alpha= alpha+alpha;
}
beta= 256/alpha;alpha= alpha*z;
}

	/*:571*/
	#line 11129 "ctex.w"
;
for(k= width_base[f];k<=lig_kern_base[f]-1;k++)
store_scaled(font_info[k].sc);
if(font_info[width_base[f]].sc!=0)abort;
if(font_info[height_base[f]].sc!=0)abort;
if(font_info[depth_base[f]].sc!=0)abort;
if(font_info[italic_base[f]].sc!=0)abort;
}

	/*:570*/
	#line 10966 "ctex.w"
;
	/*572:*/
	#line 11152 "ctex.w"

bch_label= 077777;bchar= 256;
if(nl>0)
{for(k= lig_kern_base[f];k<=kern_base[f]+kern_base_offset-1;k++)
{store_four_quarters(font_info[k].qqqq);
if(a>128)
{if(256*c+d>=nl)abort;
if(a==255)if(k==lig_kern_base[f])bchar= b;
}
else{if(b!=bchar)check_existence(b);
if(c<128)check_existence(d)
else if(256*(c-128)+d>=nk)abort;
if(a<128)if(k-lig_kern_base[f]+a+1>=nl)abort;
}
}
if(a==255)bch_label= 256*c+d;
}
for(k= kern_base[f]+kern_base_offset;k<=exten_base[f]-1;k++)
store_scaled(font_info[k].sc);

	/*:572*/
	#line 10967 "ctex.w"
;
	/*573:*/
	#line 11172 "ctex.w"

for(k= exten_base[f];k<=param_base[f]-1;k++)
{store_four_quarters(font_info[k].qqqq);
if(a!=0)check_existence(a);
if(b!=0)check_existence(b);
if(c!=0)check_existence(c);
check_existence(d);
}

	/*:573*/
	#line 10968 "ctex.w"
;
	/*574:*/
	#line 11184 "ctex.w"

{for(k= 1;k<=np;k++)
if(k==1)
{fget;sw= fbyte;if(sw>127)sw= sw-256;
fget;sw= sw*0400+fbyte;fget;sw= sw*0400+fbyte;
fget;font_info[param_base[f]].sc= 
(sw*020)+(fbyte/020);
}
else store_scaled(font_info[param_base[f]+k-1].sc);
if(eof(tfm_file))abort;
for(k= np+1;k<=7;k++)font_info[param_base[f]+k-1].sc= 0;
}

	/*:574*/
	#line 10969 "ctex.w"
;
	/*575:*/
	#line 11204 "ctex.w"

if(np>=7)font_params[f]= np;else font_params[f]= 7;
hyphen_char[f]= default_hyphen_char;skew_char[f]= default_skew_char;
if(bch_label<nl)bchar_label[f]= bch_label+lig_kern_base[f];
else bchar_label[f]= non_address;
font_bchar[f]= qi(bchar);
font_false_bchar[f]= qi(bchar);
if(bchar<=ec)if(bchar>=bc)
{qw= char_info(f,bchar);
if(char_exists(qw))font_false_bchar[f]= non_char;
}
font_name[f]= nom;
font_area[f]= s_no(aire);
font_bc[f]= bc;font_ec[f]= ec;font_glue[f]= null;
adjust(char_base);adjust(width_base);adjust(lig_kern_base);
adjust(kern_base);adjust(exten_base);
decr(param_base[f]);
fmem_ptr= fmem_ptr+lf;font_ptr= f;g= f;goto done

	/*:575*/
	#line 10970 "ctex.w"


	/*:561*/
	#line 10926 "ctex.w"
;
bad_tfm:	/*560:*/
	#line 10948 "ctex.w"

start_font_error_message;

if(file_opened)print(" not loadable: Bad metric (TFM) file");
else print(" not loadable: Metric (TFM) file not found");
help5("I wasn't able to read the size data for this font,",
"so I will ignore the font specification.",
"[Wizards can fix TFM files using TFtoPL/PLtoTF.]",
"You might try inserting a different font spec;",
"e.g., type `I\\font<same font id>=<substitute font name>'.");
error()

	/*:560*/
	#line 10927 "ctex.w"
;
done:if(file_opened)b_close(&tfm_file);
return g;
}

	/*:559*/	/*580:*/
	#line 11294 "ctex.w"
static void char_warning(internal_font_number f,eight_bits c)
{if(tracing_lost_chars>0)
{begin_diagnostic();
print_nl("Missing character: There is no ");

print_ASCII(c);print(" in font ");
slow_print(font_name[f]);print_char('!');end_diagnostic(false);
}
}

	/*:580*/	/*581:*/
	#line 11308 "ctex.w"
static pointer new_character(internal_font_number f,eight_bits c)
{
pointer p;
if(font_bc[f]<=c)if(font_ec[f]>=c)
if(char_exists(char_info(f,qi(c))))
{p= get_avail();font(p)= f;character(p)= qi(c);
return p;
}
char_warning(f,c);
return null;
}

	/*:581*/	/*596:*/
	#line 11918 "ctex.w"
static void write_dvi(dvi_index a,dvi_index b)
{int k;
for(k= a;k<=b;k++)pascal_write(dvi_file,"%c",dvi_buf[k]);
}

	/*:596*/	/*597:*/
	#line 11930 "ctex.w"
static void dvi_swap(void)
{if(dvi_limit==dvi_buf_size)
{write_dvi(0,half_buf-1);dvi_limit= half_buf;
dvi_offset= dvi_offset+dvi_buf_size;dvi_ptr= 0;
}
else{write_dvi(half_buf,dvi_buf_size-1);dvi_limit= dvi_buf_size;
}
dvi_gone= dvi_gone+half_buf;
}

	/*:597*/	/*599:*/
	#line 11950 "ctex.w"
static void dvi_four(int x)
{if(x>=0)dvi_out(x/0100000000)
else{x= x+010000000000;
x= x+010000000000;
dvi_out((x/0100000000)+128);
}
x= x%0100000000;dvi_out(x/0200000);
x= x%0200000;dvi_out(x/0400);
dvi_out(x%0400);
}

	/*:599*/	/*600:*/
	#line 11966 "ctex.w"
static void dvi_pop(int l)
{if((l==dvi_offset+dvi_ptr)&&(dvi_ptr>0))decr(dvi_ptr);
else dvi_out(pop);
}

	/*:600*/	/*601:*/
	#line 11974 "ctex.w"
static void dvi_font_def(internal_font_number f)
{int k;
dvi_out(fnt_def1);
dvi_out(f-font_base-1);
dvi_out(qo(font_check[f].b0));
dvi_out(qo(font_check[f].b1));
dvi_out(qo(font_check[f].b2));
dvi_out(qo(font_check[f].b3));
dvi_four(font_size[f]);
dvi_four(font_dsize[f]);
dvi_out(length(font_area[f]));
dvi_out(length(font_name[f]));
	/*602:*/
	#line 11989 "ctex.w"

for(k= str_start[font_area[f]];k<=str_start[font_area[f]+1]-1;k++)
dvi_out(so(str_pool[k]));
for(k= str_start[font_name[f]];k<=str_start[font_name[f]+1]-1;k++)
dvi_out(so(str_pool[k]))

	/*:602*/
	#line 11986 "ctex.w"
;
}

	/*:601*/	/*606:*/
	#line 12068 "ctex.w"
static void movement(scaled w,eight_bits o)
{
small_number mstate;
pointer p,q;
int k;
q= get_node(movement_node_size);
width(q)= w;location(q)= dvi_offset+dvi_ptr;
if(o==down1)
{link(q)= down_ptr;down_ptr= q;
}
else{link(q)= right_ptr;right_ptr= q;
}
	/*610:*/
	#line 12183 "ctex.w"

p= link(q);mstate= none_seen;
while(p!=null)
{if(width(p)==w)	/*611:*/
	#line 12202 "ctex.w"

switch(mstate+info(p)){
case none_seen+yz_OK:case none_seen+y_OK:case z_seen+yz_OK:case z_seen+y_OK:
if(location(p)<dvi_gone)goto not_found;
else	/*612:*/
	#line 12214 "ctex.w"

{k= location(p)-dvi_offset;
if(k<0)k= k+dvi_buf_size;
dvi_buf[k]= dvi_buf[k]+y1-down1;
info(p)= y_here;goto found;
}

	/*:612*/
	#line 12206 "ctex.w"
break;
case none_seen+z_OK:case y_seen+yz_OK:case y_seen+z_OK:
if(location(p)<dvi_gone)goto not_found;
else	/*613:*/
	#line 12221 "ctex.w"

{k= location(p)-dvi_offset;
if(k<0)k= k+dvi_buf_size;
dvi_buf[k]= dvi_buf[k]+z1-down1;
info(p)= z_here;goto found;
}

	/*:613*/
	#line 12209 "ctex.w"
break;
case none_seen+y_here:case none_seen+z_here:case y_seen+z_here:case z_seen+y_here:goto found;
default:do_nothing;
}

	/*:611*/
	#line 12187 "ctex.w"

else switch(mstate+info(p)){
case none_seen+y_here:mstate= y_seen;break;
case none_seen+z_here:mstate= z_seen;break;
case y_seen+z_here:case z_seen+y_here:goto not_found;
default:do_nothing;
}
p= link(p);
}
not_found:

	/*:610*/
	#line 12081 "ctex.w"
;
	/*609:*/
	#line 12150 "ctex.w"

info(q)= yz_OK;
if(abs(w)>=040000000)
{dvi_out(o+3);
dvi_four(w);return;
}
if(abs(w)>=0100000)
{dvi_out(o+2);
if(w<0)w= w+0100000000;
dvi_out(w/0200000);w= w%0200000;goto label2;
}
if(abs(w)>=0200)
{dvi_out(o+1);
if(w<0)w= w+0200000;
goto label2;
}
dvi_out(o);
if(w<0)w= w+0400;
goto label1;
label2:dvi_out(w/0400);
label1:dvi_out(w%0400);return

	/*:609*/
	#line 12082 "ctex.w"
;
found:	/*608:*/
	#line 12126 "ctex.w"

info(q)= info(p);
if(info(q)==y_here)
{dvi_out(o+y0-down1);
while(link(q)!=p)
{q= link(q);
switch(info(q)){
case yz_OK:info(q)= z_OK;break;
case y_OK:info(q)= d_fixed;break;
default:do_nothing;
}
}
}
else{dvi_out(o+z0-down1);
while(link(q)!=p)
{q= link(q);
switch(info(q)){
case yz_OK:info(q)= y_OK;break;
case z_OK:info(q)= d_fixed;break;
default:do_nothing;
}
}
}

	/*:608*/
	#line 12083 "ctex.w"
;
}

	/*:606*/	/*614:*/
	#line 12234 "ctex.w"
static void prune_movements(int l)

{
pointer p;
while(down_ptr!=null)
{if(location(down_ptr)<l)goto done;
p= down_ptr;down_ptr= link(p);free_node(p,movement_node_size);
}
done:while(right_ptr!=null)
{if(location(right_ptr)<l)return;
p= right_ptr;right_ptr= link(p);free_node(p,movement_node_size);
}
}

	/*:614*/	/*617:*/
	#line 12311 "ctex.w"
static void vlist_out(void);


	/*:617*/	/*618:*/
	#line 12320 "ctex.w"
	/*1367:*/
	#line 24774 "ctex.w"

static void special_out(pointer p)
{int old_setting;
int k;
synch_h;synch_v;
old_setting= selector;selector= new_string;
show_token_list(link(write_tokens(p)),null,pool_size-pool_ptr);
selector= old_setting;
str_room(1);
if(cur_length<256)
{dvi_out(xxx1);dvi_out(cur_length);
}
else{dvi_out(xxx4);dvi_four(cur_length);
}
for(k= str_start[str_ptr];k<=pool_ptr-1;k++)dvi_out(so(str_pool[k]));
pool_ptr= str_start[str_ptr];
}

	/*:1367*/	/*1369:*/
	#line 24805 "ctex.w"

static void write_out(pointer p)
{int old_setting;
int old_mode;
small_number j;
pointer q,r;
	/*1370:*/
	#line 24832 "ctex.w"

q= get_avail();info(q)= right_brace_token+'}';
r= get_avail();link(q)= r;info(r)= end_write_token;ins_list(q);
begin_token_list(write_tokens(p),write_text);
q= get_avail();info(q)= left_brace_token+'{';ins_list(q);


old_mode= mode;mode= 0;

cur_cs= write_loc;q= scan_toks(false,true);
get_token();if(cur_tok!=end_write_token)
	/*1371:*/
	#line 24847 "ctex.w"

{print_err("Unbalanced write command");

help2("On this page there's a \\write with fewer real {'s than }'s.",
"I can't handle that very well; good luck.");error();
do{get_token();
}while(!(cur_tok==end_write_token));
}

	/*:1371*/
	#line 24843 "ctex.w"
;
mode= old_mode;
end_token_list()

	/*:1370*/
	#line 24811 "ctex.w"
;
old_setting= selector;j= write_stream(p);
if(write_open[j])selector= j;
else{
if((j==17)&&(selector==term_and_log))selector= log_only;
print_nl("");
}
token_show(def_ref);print_ln();
flush_list(def_ref);selector= old_setting;
}

	/*:1369*/	/*1372:*/
	#line 24859 "ctex.w"

static void out_what(pointer p)
{small_number j;
switch(subtype(p)){
case open_node:case write_node:case close_node:	/*1373:*/
	#line 24877 "ctex.w"

if(!doing_leaders)
{j= write_stream(p);
if(subtype(p)==write_node)write_out(p);
else{if(write_open[j])a_close(&write_file[j]);
if(subtype(p)==close_node)write_open[j]= false;
else if(j<16)
{cur_name= open_name(p);
set_cur_area_ext(open_area(p),open_ext(p));
if(cur_ext[0]==0)cur_ext= ".tex";
pack_cur_name;
while(!a_open_out(&write_file[j]))
prompt_file_name("output file name",".tex");
write_open[j]= true;
}
}
}

	/*:1373*/
	#line 24864 "ctex.w"
break;
case special_node:special_out(p);break;
case language_node:do_nothing;break;
default:confusion("ext4");

}
}

	/*:1372*/
	#line 12320 "ctex.w"

static void hlist_out(void)
{
scaled base_line;
scaled left_edge;
scaled save_h,save_v;
pointer this_box;
glue_ord g_order;
int g_sign;
pointer p;
int save_loc;
pointer leader_box;
scaled leader_wd;
scaled lx;
bool outer_doing_leaders;
scaled edge;
double glue_temp;
double cur_glue;
scaled cur_g;
cur_g= 0;cur_glue= float_constant(0);
this_box= temp_ptr;g_order= glue_order(this_box);
g_sign= glue_sign(this_box);p= list_ptr(this_box);
incr(cur_s);
if(cur_s>0)dvi_out(push);
if(cur_s>max_push)max_push= cur_s;
save_loc= dvi_offset+dvi_ptr;base_line= cur_v;left_edge= cur_h;
while(p!=null)	/*619:*/
	#line 12359 "ctex.w"

reswitch:if(is_char_node(p))
{synch_h;synch_v;
do{f= font(p);c= character(p);
if(f!=dvi_f)	/*620:*/
	#line 12373 "ctex.w"

{if(!font_used[f])
{dvi_font_def(f);font_used[f]= true;
}
if(f<=64+font_base)dvi_out(f-font_base-1+fnt_num_0)
else{dvi_out(fnt1);dvi_out(f-font_base-1);
}
dvi_f= f;
}

	/*:620*/
	#line 12363 "ctex.w"
;
if(c>=qi(128))dvi_out(set1);
dvi_out(qo(c));
cur_h= cur_h+char_width(f,char_info(f,c));
p= link(p);
}while(!(!is_char_node(p)));
dvi_h= cur_h;
}
else	/*621:*/
	#line 12383 "ctex.w"

{switch(type(p)){
case hlist_node:case vlist_node:	/*622:*/
	#line 12401 "ctex.w"

if(list_ptr(p)==null)cur_h= cur_h+width(p);
else{save_h= dvi_h;save_v= dvi_v;
cur_v= base_line+shift_amount(p);
temp_ptr= p;edge= cur_h;
if(type(p)==vlist_node)vlist_out();else hlist_out();
dvi_h= save_h;dvi_v= save_v;
cur_h= edge+width(p);cur_v= base_line;
}

	/*:622*/
	#line 12385 "ctex.w"
break;
case rule_node:{rule_ht= height(p);rule_dp= depth(p);rule_wd= width(p);
goto fin_rule;
}
case whatsit_node:	/*1366:*/
	#line 24767 "ctex.w"

out_what(p)

	/*:1366*/
	#line 12389 "ctex.w"
;break;
case glue_node:	/*624:*/
	#line 12428 "ctex.w"

{g= glue_ptr(p);rule_wd= width(g)-cur_g;
if(g_sign!=normal)
{if(g_sign==stretching)
{if(stretch_order(g)==g_order)
{cur_glue= cur_glue+stretch(g);
vet_glue(float(glue_set(this_box))*cur_glue);

cur_g= round(glue_temp);
}
}
else if(shrink_order(g)==g_order)
{cur_glue= cur_glue-shrink(g);
vet_glue(float(glue_set(this_box))*cur_glue);
cur_g= round(glue_temp);
}
}
rule_wd= rule_wd+cur_g;
if(subtype(p)>=a_leaders)
	/*625:*/
	#line 12451 "ctex.w"

{leader_box= leader_ptr(p);
if(type(leader_box)==rule_node)
{rule_ht= height(leader_box);rule_dp= depth(leader_box);
goto fin_rule;
}
leader_wd= width(leader_box);
if((leader_wd>0)&&(rule_wd>0))
{rule_wd= rule_wd+10;
edge= cur_h+rule_wd;lx= 0;
	/*626:*/
	#line 12485 "ctex.w"

if(subtype(p)==a_leaders)
{save_h= cur_h;
cur_h= left_edge+leader_wd*((cur_h-left_edge)/leader_wd);
if(cur_h<save_h)cur_h= cur_h+leader_wd;
}
else{lq= rule_wd/leader_wd;
lr= rule_wd%leader_wd;
if(subtype(p)==c_leaders)cur_h= cur_h+(lr/2);
else{lx= lr/(lq+1);
cur_h= cur_h+((lr-(lq-1)*lx)/2);
}
}

	/*:626*/
	#line 12462 "ctex.w"
;
while(cur_h+leader_wd<=edge)
	/*627:*/
	#line 12502 "ctex.w"

{cur_v= base_line+shift_amount(leader_box);synch_v;save_v= dvi_v;
synch_h;save_h= dvi_h;temp_ptr= leader_box;
outer_doing_leaders= doing_leaders;doing_leaders= true;
if(type(leader_box)==vlist_node)vlist_out();else hlist_out();
doing_leaders= outer_doing_leaders;
dvi_v= save_v;dvi_h= save_h;cur_v= base_line;
cur_h= save_h+leader_wd+lx;
}

	/*:627*/
	#line 12464 "ctex.w"
;
cur_h= edge-10;goto next_p;
}
}

	/*:625*/
	#line 12447 "ctex.w"
;
goto move_past;
}

	/*:624*/
	#line 12390 "ctex.w"

case kern_node:case math_node:cur_h= cur_h+width(p);break;
case ligature_node:	/*651:*/
	#line 12955 "ctex.w"

{mem[lig_trick]= mem[lig_char(p)];link(lig_trick)= link(p);
p= lig_trick;goto reswitch;
}

	/*:651*/
	#line 12392 "ctex.w"

default:do_nothing;
}
goto next_p;
fin_rule:	/*623:*/
	#line 12411 "ctex.w"

if(is_running(rule_ht))rule_ht= height(this_box);
if(is_running(rule_dp))rule_dp= depth(this_box);
rule_ht= rule_ht+rule_dp;
if((rule_ht>0)&&(rule_wd>0))
{synch_h;cur_v= base_line+rule_dp;synch_v;
dvi_out(set_rule);dvi_four(rule_ht);dvi_four(rule_wd);
cur_v= base_line;dvi_h= dvi_h+rule_wd;
}

	/*:623*/
	#line 12396 "ctex.w"
;
move_past:cur_h= cur_h+rule_wd;
next_p:p= link(p);
}

	/*:621*/
	#line 12371 "ctex.w"


	/*:619*/
	#line 12347 "ctex.w"
;
prune_movements(save_loc);
if(cur_s>0)dvi_pop(save_loc);
decr(cur_s);
}

	/*:618*/	/*628:*/
	#line 12514 "ctex.w"
static void vlist_out(void)
{
scaled left_edge;
scaled top_edge;
scaled save_h,save_v;
pointer this_box;
glue_ord g_order;
int g_sign;
pointer p;
int save_loc;
pointer leader_box;
scaled leader_ht;
scaled lx;
bool outer_doing_leaders;
scaled edge;
double glue_temp;
double cur_glue;
scaled cur_g;
cur_g= 0;cur_glue= float_constant(0);
this_box= temp_ptr;g_order= glue_order(this_box);
g_sign= glue_sign(this_box);p= list_ptr(this_box);
incr(cur_s);
if(cur_s>0)dvi_out(push);
if(cur_s>max_push)max_push= cur_s;
save_loc= dvi_offset+dvi_ptr;left_edge= cur_h;cur_v= cur_v-height(this_box);
top_edge= cur_v;
while(p!=null)	/*629:*/
	#line 12547 "ctex.w"

{if(is_char_node(p))confusion("vlistout");

else	/*630:*/
	#line 12554 "ctex.w"

{switch(type(p)){
case hlist_node:case vlist_node:	/*631:*/
	#line 12574 "ctex.w"

if(list_ptr(p)==null)cur_v= cur_v+height(p)+depth(p);
else{cur_v= cur_v+height(p);synch_v;
save_h= dvi_h;save_v= dvi_v;
cur_h= left_edge+shift_amount(p);
temp_ptr= p;
if(type(p)==vlist_node)vlist_out();else hlist_out();
dvi_h= save_h;dvi_v= save_v;
cur_v= save_v+depth(p);cur_h= left_edge;
}

	/*:631*/
	#line 12556 "ctex.w"
break;
case rule_node:{rule_ht= height(p);rule_dp= depth(p);rule_wd= width(p);
goto fin_rule;
}
case whatsit_node:	/*1365:*/
	#line 24764 "ctex.w"

out_what(p)

	/*:1365*/
	#line 12560 "ctex.w"
;break;
case glue_node:	/*633:*/
	#line 12595 "ctex.w"

{g= glue_ptr(p);rule_ht= width(g)-cur_g;
if(g_sign!=normal)
{if(g_sign==stretching)
{if(stretch_order(g)==g_order)
{cur_glue= cur_glue+stretch(g);
vet_glue(float(glue_set(this_box))*cur_glue);

cur_g= round(glue_temp);
}
}
else if(shrink_order(g)==g_order)
{cur_glue= cur_glue-shrink(g);
vet_glue(float(glue_set(this_box))*cur_glue);
cur_g= round(glue_temp);
}
}
rule_ht= rule_ht+cur_g;
if(subtype(p)>=a_leaders)
	/*634:*/
	#line 12618 "ctex.w"

{leader_box= leader_ptr(p);
if(type(leader_box)==rule_node)
{rule_wd= width(leader_box);rule_dp= 0;
goto fin_rule;
}
leader_ht= height(leader_box)+depth(leader_box);
if((leader_ht>0)&&(rule_ht>0))
{rule_ht= rule_ht+10;
edge= cur_v+rule_ht;lx= 0;
	/*635:*/
	#line 12636 "ctex.w"

if(subtype(p)==a_leaders)
{save_v= cur_v;
cur_v= top_edge+leader_ht*((cur_v-top_edge)/leader_ht);
if(cur_v<save_v)cur_v= cur_v+leader_ht;
}
else{lq= rule_ht/leader_ht;
lr= rule_ht%leader_ht;
if(subtype(p)==c_leaders)cur_v= cur_v+(lr/2);
else{lx= lr/(lq+1);
cur_v= cur_v+((lr-(lq-1)*lx)/2);
}
}

	/*:635*/
	#line 12629 "ctex.w"
;
while(cur_v+leader_ht<=edge)
	/*636:*/
	#line 12653 "ctex.w"

{cur_h= left_edge+shift_amount(leader_box);synch_h;save_h= dvi_h;
cur_v= cur_v+height(leader_box);synch_v;save_v= dvi_v;
temp_ptr= leader_box;
outer_doing_leaders= doing_leaders;doing_leaders= true;
if(type(leader_box)==vlist_node)vlist_out();else hlist_out();
doing_leaders= outer_doing_leaders;
dvi_v= save_v;dvi_h= save_h;cur_h= left_edge;
cur_v= save_v-height(leader_box)+leader_ht+lx;
}

	/*:636*/
	#line 12631 "ctex.w"
;
cur_v= edge-10;goto next_p;
}
}

	/*:634*/
	#line 12614 "ctex.w"
;
goto move_past;
}

	/*:633*/
	#line 12561 "ctex.w"

case kern_node:cur_v= cur_v+width(p);break;
default:do_nothing;
}
goto next_p;
fin_rule:	/*632:*/
	#line 12585 "ctex.w"

if(is_running(rule_wd))rule_wd= width(this_box);
rule_ht= rule_ht+rule_dp;
cur_v= cur_v+rule_ht;
if((rule_ht>0)&&(rule_wd>0))
{synch_h;synch_v;
dvi_out(put_rule);dvi_four(rule_ht);dvi_four(rule_wd);
}
goto next_p

	/*:632*/
	#line 12566 "ctex.w"
;
move_past:cur_v= cur_v+rule_ht;
}

	/*:630*/
	#line 12550 "ctex.w"
;
next_p:p= link(p);
}

	/*:629*/
	#line 12541 "ctex.w"
;
prune_movements(save_loc);
if(cur_s>0)dvi_pop(save_loc);
decr(cur_s);
}

	/*:628*/	/*637:*/
	#line 12667 "ctex.w"
static void ship_out(pointer p)
{
int page_loc;
int j,k;
int s;
int old_setting;
if(tracing_output>0)
{print_nl("");print_ln();
print("Completed box being shipped out");

}
if(term_offset>max_print_line-9)print_ln();
else if((term_offset>0)||(file_offset>0))print_char(' ');
print_char('[');j= 9;
while((count(j)==0)&&(j>0))decr(j);
for(k= 0;k<=j;k++)
{print_int(count(k));
if(k<j)print_char('.');
}
update_terminal;
if(tracing_output>0)
{print_char(']');
begin_diagnostic();show_box(p);end_diagnostic(true);
}
	/*639:*/
	#line 12717 "ctex.w"

	/*640:*/
	#line 12733 "ctex.w"

if((height(p)>max_dimen)||(depth(p)>max_dimen)||
(height(p)+depth(p)+v_offset>max_dimen)||
(width(p)+h_offset>max_dimen))
{print_err("Huge page cannot be shipped out");

help2("The page just created is more than 18 feet tall or",
"more than 18 feet wide, so I suspect something went wrong.");
error();
if(tracing_output<=0)
{begin_diagnostic();
print_nl("The following box has been deleted:");

show_box(p);
end_diagnostic(true);
}
goto done;
}
if(height(p)+depth(p)+v_offset>max_v)max_v= height(p)+depth(p)+v_offset;
if(width(p)+h_offset>max_h)max_h= width(p)+h_offset

	/*:640*/
	#line 12718 "ctex.w"
;
	/*616:*/
	#line 12284 "ctex.w"

dvi_h= 0;dvi_v= 0;cur_h= h_offset;dvi_f= null_font;
ensure_dvi_open;
if(total_pages==0)
{dvi_out(pre);dvi_out(id_byte);

dvi_four(25400000);dvi_four(473628672);
prepare_mag();dvi_four(mag);
old_setting= selector;selector= new_string;
print(" TeX output ");print_int(year);print_char('.');
print_two(month);print_char('.');print_two(day);
print_char(':');print_two(time/60);
print_two(time%60);
selector= old_setting;dvi_out(cur_length);
for(s= str_start[str_ptr];s<=pool_ptr-1;s++)dvi_out(so(str_pool[s]));
pool_ptr= str_start[str_ptr];
}

	/*:616*/
	#line 12719 "ctex.w"
;
page_loc= dvi_offset+dvi_ptr;
dvi_out(bop);
for(k= 0;k<=9;k++)dvi_four(count(k));
dvi_four(last_bop);last_bop= page_loc;
cur_v= height(p)+v_offset;temp_ptr= p;
if(type(p)==vlist_node)vlist_out();else hlist_out();
dvi_out(eop);incr(total_pages);cur_s= -1;
done:

	/*:639*/
	#line 12691 "ctex.w"
;
if(tracing_output<=0)print_char(']');
dead_cycles= 0;
update_terminal;
	/*638:*/
	#line 12698 "ctex.w"

#ifdef STAT
if(tracing_stats>1)
{print_nl("Memory usage before: ");

print_int(var_used);print_char('&');
print_int(dyn_used);print_char(';');
}
#endif
flush_node_list(p);
#ifdef STAT
if(tracing_stats>1)
{print(" after: ");
print_int(var_used);print_char('&');
print_int(dyn_used);print("; still untouched: ");
print_int(hi_mem_min-lo_mem_max-1);print_ln();
}
#endif

	/*:638*/
	#line 12695 "ctex.w"
;
}

	/*:637*/	/*644:*/
	#line 12844 "ctex.w"
static void scan_spec(group_code c,bool three_codes)

{
int s;
int spec_code;
if(three_codes)s= saved(0);
if(scan_keyword("to"))spec_code= exactly;

else if(scan_keyword("spread"))spec_code= additional;

else{spec_code= additional;cur_val= 0;
goto found;
}
scan_normal_dimen;
found:if(three_codes)
{saved(0)= s;incr(save_ptr);
}
saved(0)= spec_code;saved(1)= cur_val;save_ptr= save_ptr+2;
new_save_level(c);scan_left_brace();
}

	/*:644*/	/*648:*/
	#line 12899 "ctex.w"
static pointer hpack(pointer p,scaled w,small_number m)
{
pointer r;
pointer q;
scaled h,d,x;
scaled s;
pointer g;
glue_ord o;
internal_font_number f;
four_quarters i;
eight_bits hd;
last_badness= 0;r= get_node(box_node_size);type(r)= hlist_node;
subtype(r)= min_quarterword;shift_amount(r)= 0;
q= r+list_offset;link(q)= p;
h= 0;	/*649:*/
	#line 12926 "ctex.w"

d= 0;x= 0;
total_stretch[normal]= 0;total_shrink[normal]= 0;
total_stretch[fil]= 0;total_shrink[fil]= 0;
total_stretch[fill]= 0;total_shrink[fill]= 0;
total_stretch[filll]= 0;total_shrink[filll]= 0

	/*:649*/
	#line 12913 "ctex.w"
;
while(p!=null)	/*650:*/
	#line 12933 "ctex.w"


{reswitch:while(is_char_node(p))
	/*653:*/
	#line 12976 "ctex.w"

{f= font(p);i= char_info(f,character(p));hd= height_depth(i);
x= x+char_width(f,i);
s= char_height(f,hd);if(s>h)h= s;
s= char_depth(f,hd);if(s>d)d= s;
p= link(p);
}

	/*:653*/
	#line 12937 "ctex.w"
;
if(p!=null)
{switch(type(p)){
case hlist_node:case vlist_node:case rule_node:case unset_node:
	/*652:*/
	#line 12964 "ctex.w"

{x= x+width(p);
if(type(p)>=rule_node)s= 0;else s= shift_amount(p);
if(height(p)-s>h)h= height(p)-s;
if(depth(p)+s>d)d= depth(p)+s;
}

	/*:652*/
	#line 12941 "ctex.w"
break;
case ins_node:case mark_node:case adjust_node:if(adjust_tail!=null)
	/*654:*/
	#line 12991 "ctex.w"

{while(link(q)!=p)q= link(q);
if(type(p)==adjust_node)
{link(adjust_tail)= adjust_ptr(p);
while(link(adjust_tail)!=null)adjust_tail= link(adjust_tail);
p= link(p);free_node(link(q),small_node_size);
}
else{link(adjust_tail)= p;adjust_tail= p;p= link(p);
}
link(q)= p;p= q;
}

	/*:654*/
	#line 12943 "ctex.w"
break;
case whatsit_node:	/*1359:*/
	#line 24745 "ctex.w"
do_nothing

	/*:1359*/
	#line 12944 "ctex.w"
;break;
case glue_node:	/*655:*/
	#line 13003 "ctex.w"

{g= glue_ptr(p);x= x+width(g);
o= stretch_order(g);total_stretch[o]= total_stretch[o]+stretch(g);
o= shrink_order(g);total_shrink[o]= total_shrink[o]+shrink(g);
if(subtype(p)>=a_leaders)
{g= leader_ptr(p);
if(height(g)>h)h= height(g);
if(depth(g)>d)d= depth(g);
}
}

	/*:655*/
	#line 12945 "ctex.w"
break;
case kern_node:case math_node:x= x+width(p);break;
case ligature_node:	/*651:*/
	#line 12955 "ctex.w"

{mem[lig_trick]= mem[lig_char(p)];link(lig_trick)= link(p);
p= lig_trick;goto reswitch;
}

	/*:651*/
	#line 12947 "ctex.w"

default:do_nothing;
}
p= link(p);
}
}


	/*:650*/
	#line 12916 "ctex.w"
;
if(adjust_tail!=null)link(adjust_tail)= null;
height(r)= h;depth(r)= d;
	/*656:*/
	#line 13017 "ctex.w"

if(m==additional)w= x+w;
width(r)= w;x= w-x;
if(x==0)
{glue_sign(r)= normal;glue_order(r)= normal;
set_glue_ratio_zero(glue_set(r));
goto end;
}
else if(x>0)	/*657:*/
	#line 13029 "ctex.w"

{	/*658:*/
	#line 13043 "ctex.w"

if(total_stretch[filll]!=0)o= filll;
else if(total_stretch[fill]!=0)o= fill;
else if(total_stretch[fil]!=0)o= fil;
else o= normal

	/*:658*/
	#line 13030 "ctex.w"
;
glue_order(r)= o;glue_sign(r)= stretching;
if(total_stretch[o]!=0)glue_set(r)= unfloat(x/(double)total_stretch[o]);

else{glue_sign(r)= normal;
set_glue_ratio_zero(glue_set(r));
}
if(o==normal)if(list_ptr(r)!=null)
	/*659:*/
	#line 13049 "ctex.w"

{last_badness= badness(x,total_stretch[normal]);
if(last_badness>hbadness)
{print_ln();
if(last_badness>100)print_nl("Underfull");else print_nl("Loose");
print(" \\hbox (badness ");print_int(last_badness);


goto common_ending;
}
}

	/*:659*/
	#line 13039 "ctex.w"
;
goto end;
}

	/*:657*/
	#line 13026 "ctex.w"

else	/*663:*/
	#line 13088 "ctex.w"

{	/*664:*/
	#line 13107 "ctex.w"

if(total_shrink[filll]!=0)o= filll;
else if(total_shrink[fill]!=0)o= fill;
else if(total_shrink[fil]!=0)o= fil;
else o= normal

	/*:664*/
	#line 13089 "ctex.w"
;
glue_order(r)= o;glue_sign(r)= shrinking;
if(total_shrink[o]!=0)glue_set(r)= unfloat((-x)/(double)total_shrink[o]);

else{glue_sign(r)= normal;
set_glue_ratio_zero(glue_set(r));
}
if((total_shrink[o]<-x)&&(o==normal)&&(list_ptr(r)!=null))
{last_badness= 1000000;
set_glue_ratio_one(glue_set(r));
	/*665:*/
	#line 13113 "ctex.w"

if((-x-total_shrink[normal]>hfuzz)||(hbadness<100))
{if((overfull_rule>0)&&(-x-total_shrink[normal]>hfuzz))
{while(link(q)!=null)q= link(q);
link(q)= new_rule();
width(link(q))= overfull_rule;
}
print_ln();print_nl("Overfull \\hbox (");

print_scaled(-x-total_shrink[normal]);print("pt too wide");
goto common_ending;
}

	/*:665*/
	#line 13100 "ctex.w"
;
}
else if(o==normal)if(list_ptr(r)!=null)
	/*666:*/
	#line 13126 "ctex.w"

{last_badness= badness(-x,total_shrink[normal]);
if(last_badness>hbadness)
{print_ln();print_nl("Tight \\hbox (badness ");print_int(last_badness);

goto common_ending;
}
}

	/*:666*/
	#line 13103 "ctex.w"
;
goto end;
}

	/*:663*/
	#line 13027 "ctex.w"


	/*:656*/
	#line 12920 "ctex.w"
;
common_ending:	/*662:*/
	#line 13073 "ctex.w"

if(output_active)print(") has occurred while \\output is active");
else{if(pack_begin_line!=0)
{if(pack_begin_line>0)print(") in paragraph at lines ");
else print(") in alignment at lines ");
print_int(abs(pack_begin_line));
print("--");
}
else print(") detected at line ");
print_int(line);
}
print_ln();
font_in_short_display= null_font;short_display(list_ptr(r));print_ln();
begin_diagnostic();show_box(r);end_diagnostic(true)

	/*:662*/
	#line 12922 "ctex.w"
;
end:return r;
}

	/*:648*/	/*667:*/
	#line 13143 "ctex.w"

#define vpack(...) vpackage(__VA_ARGS__, max_dimen) 
static pointer vpackage(pointer p,scaled h,small_number m,scaled l)
{
pointer r;
scaled w,d,x;
scaled s;
pointer g;
glue_ord o;
last_badness= 0;r= get_node(box_node_size);type(r)= vlist_node;
subtype(r)= min_quarterword;shift_amount(r)= 0;
list_ptr(r)= p;
w= 0;	/*649:*/
	#line 12926 "ctex.w"

d= 0;x= 0;
total_stretch[normal]= 0;total_shrink[normal]= 0;
total_stretch[fil]= 0;total_shrink[fil]= 0;
total_stretch[fill]= 0;total_shrink[fill]= 0;
total_stretch[filll]= 0;total_shrink[filll]= 0

	/*:649*/
	#line 13155 "ctex.w"
;
while(p!=null)	/*668:*/
	#line 13170 "ctex.w"

{if(is_char_node(p))confusion("vpack");

else switch(type(p)){
case hlist_node:case vlist_node:case rule_node:case unset_node:
	/*669:*/
	#line 13185 "ctex.w"

{x= x+d+height(p);d= depth(p);
if(type(p)>=rule_node)s= 0;else s= shift_amount(p);
if(width(p)+s>w)w= width(p)+s;
}

	/*:669*/
	#line 13175 "ctex.w"
break;
case whatsit_node:	/*1358:*/
	#line 24743 "ctex.w"
do_nothing

	/*:1358*/
	#line 13176 "ctex.w"
;break;
case glue_node:	/*670:*/
	#line 13191 "ctex.w"

{x= x+d;d= 0;
g= glue_ptr(p);x= x+width(g);
o= stretch_order(g);total_stretch[o]= total_stretch[o]+stretch(g);
o= shrink_order(g);total_shrink[o]= total_shrink[o]+shrink(g);
if(subtype(p)>=a_leaders)
{g= leader_ptr(p);
if(width(g)>w)w= width(g);
}
}

	/*:670*/
	#line 13177 "ctex.w"
break;
case kern_node:{x= x+d+width(p);d= 0;
}break;
default:do_nothing;
}
p= link(p);
}

	/*:668*/
	#line 13157 "ctex.w"
;
width(r)= w;
if(d>l)
{x= x+d-l;depth(r)= l;
}
else depth(r)= d;
	/*671:*/
	#line 13205 "ctex.w"

if(m==additional)h= x+h;
height(r)= h;x= h-x;
if(x==0)
{glue_sign(r)= normal;glue_order(r)= normal;
set_glue_ratio_zero(glue_set(r));
goto end;
}
else if(x>0)	/*672:*/
	#line 13217 "ctex.w"

{	/*658:*/
	#line 13043 "ctex.w"

if(total_stretch[filll]!=0)o= filll;
else if(total_stretch[fill]!=0)o= fill;
else if(total_stretch[fil]!=0)o= fil;
else o= normal

	/*:658*/
	#line 13218 "ctex.w"
;
glue_order(r)= o;glue_sign(r)= stretching;
if(total_stretch[o]!=0)glue_set(r)= unfloat(x/(double)total_stretch[o]);

else{glue_sign(r)= normal;
set_glue_ratio_zero(glue_set(r));
}
if(o==normal)if(list_ptr(r)!=null)
	/*673:*/
	#line 13231 "ctex.w"

{last_badness= badness(x,total_stretch[normal]);
if(last_badness>vbadness)
{print_ln();
if(last_badness>100)print_nl("Underfull");else print_nl("Loose");
print(" \\vbox (badness ");print_int(last_badness);


goto common_ending;
}
}

	/*:673*/
	#line 13227 "ctex.w"
;
goto end;
}

	/*:672*/
	#line 13214 "ctex.w"

else	/*675:*/
	#line 13256 "ctex.w"

{	/*664:*/
	#line 13107 "ctex.w"

if(total_shrink[filll]!=0)o= filll;
else if(total_shrink[fill]!=0)o= fill;
else if(total_shrink[fil]!=0)o= fil;
else o= normal

	/*:664*/
	#line 13257 "ctex.w"
;
glue_order(r)= o;glue_sign(r)= shrinking;
if(total_shrink[o]!=0)glue_set(r)= unfloat((-x)/(double)total_shrink[o]);

else{glue_sign(r)= normal;
set_glue_ratio_zero(glue_set(r));
}
if((total_shrink[o]<-x)&&(o==normal)&&(list_ptr(r)!=null))
{last_badness= 1000000;
set_glue_ratio_one(glue_set(r));
	/*676:*/
	#line 13275 "ctex.w"

if((-x-total_shrink[normal]>vfuzz)||(vbadness<100))
{print_ln();print_nl("Overfull \\vbox (");

print_scaled(-x-total_shrink[normal]);print("pt too high");
goto common_ending;
}

	/*:676*/
	#line 13268 "ctex.w"
;
}
else if(o==normal)if(list_ptr(r)!=null)
	/*677:*/
	#line 13283 "ctex.w"

{last_badness= badness(-x,total_shrink[normal]);
if(last_badness>vbadness)
{print_ln();print_nl("Tight \\vbox (badness ");print_int(last_badness);

goto common_ending;
}
}

	/*:677*/
	#line 13271 "ctex.w"
;
goto end;
}

	/*:675*/
	#line 13215 "ctex.w"


	/*:671*/
	#line 13164 "ctex.w"
;
common_ending:	/*674:*/
	#line 13243 "ctex.w"

if(output_active)print(") has occurred while \\output is active");
else{if(pack_begin_line!=0)
{print(") in alignment at lines ");
print_int(abs(pack_begin_line));
print("--");
}
else print(") detected at line ");
print_int(line);
print_ln();
}
begin_diagnostic();show_box(r);end_diagnostic(true)

	/*:674*/
	#line 13166 "ctex.w"
;
end:return r;
}

	/*:667*/	/*678:*/
	#line 13295 "ctex.w"
static void append_to_vlist(pointer b)
{scaled d;
pointer p;
if(prev_depth>ignore_depth)
{d= width(baseline_skip)-prev_depth-height(b);
if(d<line_skip_limit)p= new_param_glue(line_skip_code);
else{p= new_skip_param(baseline_skip_code);
width(temp_ptr)= d;
}
link(tail)= p;tail= p;
}
link(tail)= b;tail= b;prev_depth= depth(b);
}

	/*:678*/	/*685:*/
	#line 13493 "ctex.w"
static pointer new_noad(void)
{pointer p;
p= get_node(noad_size);
type(p)= ord_noad;subtype(p)= normal;
mem[nucleus(p)].hh= empty_field;
mem[subscr(p)].hh= empty_field;
mem[supscr(p)].hh= empty_field;
return p;
}

	/*:685*/	/*687:*/
	#line 13554 "ctex.w"
static pointer new_style(small_number s)
{pointer p;
p= get_node(style_node_size);type(p)= style_node;
subtype(p)= s;width(p)= 0;depth(p)= 0;
return p;
}

	/*:687*/	/*688:*/
	#line 13571 "ctex.w"
static pointer new_choice(void)
{pointer p;
p= get_node(style_node_size);type(p)= choice_node;
subtype(p)= 0;
display_mlist(p)= null;text_mlist(p)= null;script_mlist(p)= null;
script_script_mlist(p)= null;
return p;
}

	/*:688*/	/*692:*/
	#line 13659 "ctex.w"
static void show_info(void)
{show_node_list(info(temp_ptr));
}

	/*:692*/	/*703:*/
	#line 13854 "ctex.w"
static pointer fraction_rule(scaled t)

{pointer p;
p= new_rule();height(p)= t;depth(p)= 0;return p;
}

	/*:703*/	/*704:*/
	#line 13864 "ctex.w"
static pointer overbar(pointer b,scaled k,scaled t)
{pointer p,q;
p= new_kern(k);link(p)= b;q= fraction_rule(t);link(q)= p;
p= new_kern(t);link(p)= q;return vpack(p,natural);
}

	/*:704*/	/*705:*/
	#line 13885 "ctex.w"
	/*708:*/
	#line 13957 "ctex.w"

static pointer char_box(internal_font_number f,quarterword c)
{four_quarters q;
eight_bits hd;
pointer b,p;
q= char_info(f,c);hd= height_depth(q);
b= new_null_box();width(b)= char_width(f,q)+char_italic(f,q);
height(b)= char_height(f,hd);depth(b)= char_depth(f,hd);
p= get_avail();character(p)= c;font(p)= f;list_ptr(b)= p;return b;
}

	/*:708*/	/*710:*/
	#line 13981 "ctex.w"

static void stack_into_box(pointer b,internal_font_number f,
quarterword c)
{pointer p;
p= char_box(f,c);link(p)= list_ptr(b);list_ptr(b)= p;
height(b)= height(p);
}

	/*:710*/	/*711:*/
	#line 13992 "ctex.w"

static scaled height_plus_depth(internal_font_number f,quarterword c)
{four_quarters q;
eight_bits hd;
q= char_info(f,c);hd= height_depth(q);
return char_height(f,hd)+char_depth(f,hd);
}

	/*:711*/
	#line 13885 "ctex.w"

static pointer var_delimiter(pointer d,small_number s,scaled v)
{
pointer b;
internal_font_number f,g;
quarterword c,x,y;
int m,n;
scaled u;
scaled w;
four_quarters q;
eight_bits hd;
four_quarters r;
small_number z;
bool large_attempt;
f= null_font;w= 0;large_attempt= false;
z= small_fam(d);x= small_char(d);
loop{	/*706:*/
	#line 13919 "ctex.w"

if((z!=0)||(x!=min_quarterword))
{z= z+s+16;
do{z= z-16;g= fam_fnt(z);
if(g!=null_font)
	/*707:*/
	#line 13930 "ctex.w"

{y= x;
if((qo(y)>=font_bc[g])&&(qo(y)<=font_ec[g]))
{resume:q= char_info(g,y);
if(char_exists(q))
{if(char_tag(q)==ext_tag)
{f= g;c= y;goto found;
}
hd= height_depth(q);
u= char_height(g,hd)+char_depth(g,hd);
if(u>w)
{f= g;c= y;w= u;
if(u>=v)goto found;
}
if(char_tag(q)==list_tag)
{y= rem_byte(q);goto resume;
}
}
}
}

	/*:707*/
	#line 13926 "ctex.w"
;
}while(!(z<16));
}

	/*:706*/
	#line 13902 "ctex.w"
;
if(large_attempt)goto found;
large_attempt= true;z= large_fam(d);x= large_char(d);
}
found:if(f!=null_font)
	/*709:*/
	#line 13971 "ctex.w"

if(char_tag(q)==ext_tag)
	/*712:*/
	#line 14000 "ctex.w"

{b= new_null_box();
type(b)= vlist_node;
r= font_info[exten_base[f]+rem_byte(q)].qqqq;
	/*713:*/
	#line 14025 "ctex.w"

c= ext_rep(r);u= height_plus_depth(f,c);
w= 0;q= char_info(f,c);width(b)= char_width(f,q)+char_italic(f,q);
c= ext_bot(r);if(c!=min_quarterword)w= w+height_plus_depth(f,c);
c= ext_mid(r);if(c!=min_quarterword)w= w+height_plus_depth(f,c);
c= ext_top(r);if(c!=min_quarterword)w= w+height_plus_depth(f,c);
n= 0;
if(u>0)while(w<v)
{w= w+u;incr(n);
if(ext_mid(r)!=min_quarterword)w= w+u;
}

	/*:713*/
	#line 14005 "ctex.w"
;
c= ext_bot(r);
if(c!=min_quarterword)stack_into_box(b,f,c);
c= ext_rep(r);
for(m= 1;m<=n;m++)stack_into_box(b,f,c);
c= ext_mid(r);
if(c!=min_quarterword)
{stack_into_box(b,f,c);c= ext_rep(r);
for(m= 1;m<=n;m++)stack_into_box(b,f,c);
}
c= ext_top(r);
if(c!=min_quarterword)stack_into_box(b,f,c);
depth(b)= w-height(b);
}

	/*:712*/
	#line 13974 "ctex.w"

else b= char_box(f,c)

	/*:709*/
	#line 13907 "ctex.w"
;
else{b= new_null_box();
width(b)= null_delimiter_space;
}
shift_amount(b)= half(height(b)-depth(b))-axis_height(s);
return b;
}

	/*:705*/	/*714:*/
	#line 14050 "ctex.w"
static pointer rebox(pointer b,scaled w)
{pointer p;
internal_font_number f;
scaled v;
if((width(b)!=w)&&(list_ptr(b)!=null))
{if(type(b)==vlist_node)b= hpack(b,natural);
p= list_ptr(b);
if((is_char_node(p))&&(link(p)==null))
{f= font(p);v= char_width(f,char_info(f,character(p)));
if(v!=width(b))link(p)= new_kern(width(b)-v);
}
free_node(b,box_node_size);
b= new_glue(ss_glue);link(b)= p;
while(link(p)!=null)p= link(p);
link(p)= new_glue(ss_glue);
return hpack(b,w,exactly);
}
else{width(b)= w;return b;
}
}

	/*:714*/	/*715:*/
	#line 14076 "ctex.w"
static pointer math_glue(pointer g,scaled m)
{pointer p;
int n;
scaled f;
n= x_over_n(m,0200000);f= rem;
if(f<0)
{decr(n);f= f+0200000;
}
p= get_node(glue_spec_size);
width(p)= mu_mult(width(g));
stretch_order(p)= stretch_order(g);
if(stretch_order(p)==normal)stretch(p)= mu_mult(stretch(g));
else stretch(p)= stretch(g);
shrink_order(p)= shrink_order(g);
if(shrink_order(p)==normal)shrink(p)= mu_mult(shrink(g));
else shrink(p)= shrink(g);
return p;
}

	/*:715*/	/*716:*/
	#line 14098 "ctex.w"
static void math_kern(pointer p,scaled m)
{int n;
scaled f;
if(subtype(p)==mu_glue)
{n= x_over_n(m,0200000);f= rem;
if(f<0)
{decr(n);f= f+0200000;
}
width(p)= mu_mult(width(p));subtype(p)= explicit;
}
}

	/*:716*/	/*717:*/
	#line 14113 "ctex.w"
static void flush_math(void)
{flush_node_list(link(head));flush_node_list(incompleat_noad);
link(head)= null;tail= head;incompleat_noad= null;
}

	/*:717*/	/*719:*/
	#line 14150 "ctex.w"
static void mlist_to_hlist(void);
static pointer clean_box(pointer p,small_number s)
{
pointer q;
small_number save_style;
pointer x;
pointer r;
switch(math_type(p)){
case math_char:{cur_mlist= new_noad();mem[nucleus(cur_mlist)]= mem[p];
}break;
case sub_box:{q= info(p);goto found;
}
case sub_mlist:cur_mlist= info(p);break;
default:{q= new_null_box();goto found;
}
}
save_style= cur_style;cur_style= s;mlist_penalties= false;
mlist_to_hlist();q= link(temp_head);
cur_style= save_style;
	/*702:*/
	#line 13844 "ctex.w"

{if(cur_style<script_style)cur_size= text_size;
else cur_size= 16*((cur_style-text_style)/2);
cur_mu= x_over_n(math_quad(cur_size),18);
}

	/*:702*/
	#line 14169 "ctex.w"
;
found:if(is_char_node(q)||(q==null))x= hpack(q,natural);
else if((link(q)==null)&&(type(q)<=vlist_node)&&(shift_amount(q)==0))
x= q;
else x= hpack(q,natural);
	/*720:*/
	#line 14180 "ctex.w"

q= list_ptr(x);
if(is_char_node(q))
{r= link(q);
if(r!=null)if(link(r)==null)if(!is_char_node(r))
if(type(r)==kern_node)
{free_node(r,small_node_size);link(q)= null;
}
}

	/*:720*/
	#line 14174 "ctex.w"
;
return x;
}

	/*:719*/	/*721:*/
	#line 14197 "ctex.w"
static void fetch(pointer a)
{cur_c= character(a);cur_f= fam_fnt(fam(a)+cur_size);
if(cur_f==null_font)
	/*722:*/
	#line 14211 "ctex.w"

{print_err("");print_size(cur_size);print_char(' ');
print_int(fam(a));print(" is undefined (character ");
print_ASCII(qo(cur_c));print_char(')');
help4("Somewhere in the math formula just ended, you used the",
"stated character from an undefined font family. For example,",
"plain TeX doesn't allow \\it or \\sl in subscripts. Proceed,",
"and I'll try to forget that I needed that character.");
error();cur_i= null_character;math_type(a)= empty;
}

	/*:722*/
	#line 14200 "ctex.w"

else{if((qo(cur_c)>=font_bc[cur_f])&&(qo(cur_c)<=font_ec[cur_f]))
cur_i= char_info(cur_f,cur_c);
else cur_i= null_character;
if(!(char_exists(cur_i)))
{char_warning(cur_f,qo(cur_c));
math_type(a)= empty;
}
}
}

	/*:721*/	/*725:*/
	#line 14251 "ctex.w"
	/*733:*/
	#line 14403 "ctex.w"

static void make_over(pointer q)
{info(nucleus(q))= 
overbar(clean_box(nucleus(q),cramped_style(cur_style)),
3*default_rule_thickness,default_rule_thickness);
math_type(nucleus(q))= sub_box;
}

	/*:733*/	/*734:*/
	#line 14411 "ctex.w"

static void make_under(pointer q)
{pointer p,x,y;
scaled delta;
x= clean_box(nucleus(q),cur_style);
p= new_kern(3*default_rule_thickness);link(x)= p;
link(p)= fraction_rule(default_rule_thickness);
y= vpack(x,natural);
delta= height(y)+depth(y)+default_rule_thickness;
height(y)= height(x);depth(y)= delta-height(y);
info(nucleus(q))= y;math_type(nucleus(q))= sub_box;
}

	/*:734*/	/*735:*/
	#line 14424 "ctex.w"

static void make_vcenter(pointer q)
{pointer v;
scaled delta;
v= info(nucleus(q));
if(type(v)!=vlist_node)confusion("vcenter");

delta= height(v)+depth(v);
height(v)= axis_height(cur_size)+half(delta);
depth(v)= delta-height(v);
}

	/*:735*/	/*736:*/
	#line 14445 "ctex.w"

static void make_radical(pointer q)
{pointer x,y;
scaled delta,clr;
x= clean_box(nucleus(q),cramped_style(cur_style));
if(cur_style<text_style)
clr= default_rule_thickness+(abs(math_x_height(cur_size))/4);
else{clr= default_rule_thickness;clr= clr+(abs(clr)/4);
}
y= var_delimiter(left_delimiter(q),cur_size,height(x)+depth(x)+clr+
default_rule_thickness);
delta= depth(y)-(height(x)+depth(x)+clr);
if(delta>0)clr= clr+half(delta);
shift_amount(y)= -(height(x)+clr);
link(y)= overbar(x,clr,height(y));
info(nucleus(q))= hpack(y,natural);math_type(nucleus(q))= sub_box;
}

	/*:736*/	/*737:*/
	#line 14467 "ctex.w"

static void make_math_accent(pointer q)
{
pointer p,x,y;
int a;
quarterword c;
internal_font_number f;
four_quarters i;
scaled s;
scaled h;
scaled delta;
scaled w;
fetch(accent_chr(q));
if(char_exists(cur_i))
{i= cur_i;c= cur_c;f= cur_f;
	/*740:*/
	#line 14514 "ctex.w"

s= 0;
if(math_type(nucleus(q))==math_char)
{fetch(nucleus(q));
if(char_tag(cur_i)==lig_tag)
{a= lig_kern_start(cur_f,cur_i);
cur_i= font_info[a].qqqq;
if(skip_byte(cur_i)>stop_flag)
{a= lig_kern_restart(cur_f,cur_i);
cur_i= font_info[a].qqqq;
}
loop{if(qo(next_char(cur_i))==skew_char[cur_f])
{if(op_byte(cur_i)>=kern_flag)
if(skip_byte(cur_i)<=stop_flag)s= char_kern(cur_f,cur_i);
goto done1;
}
if(skip_byte(cur_i)>=stop_flag)goto done1;
a= a+qo(skip_byte(cur_i))+1;
cur_i= font_info[a].qqqq;
}
}
}
done1:

	/*:740*/
	#line 14482 "ctex.w"
;
x= clean_box(nucleus(q),cramped_style(cur_style));w= width(x);h= height(x);
	/*739:*/
	#line 14504 "ctex.w"

loop{if(char_tag(i)!=list_tag)goto done;
y= rem_byte(i);
i= char_info(f,y);
if(!char_exists(i))goto done;
if(char_width(f,i)>w)goto done;
c= y;
}
done:

	/*:739*/
	#line 14484 "ctex.w"
;
if(h<x_height(f))delta= h;else delta= x_height(f);
if((math_type(supscr(q))!=empty)||(math_type(subscr(q))!=empty))
if(math_type(nucleus(q))==math_char)
	/*741:*/
	#line 14538 "ctex.w"

{flush_node_list(x);x= new_noad();
mem[nucleus(x)]= mem[nucleus(q)];
mem[supscr(x)]= mem[supscr(q)];
mem[subscr(x)]= mem[subscr(q)];
mem[supscr(q)].hh= empty_field;
mem[subscr(q)].hh= empty_field;
math_type(nucleus(q))= sub_mlist;info(nucleus(q))= x;
x= clean_box(nucleus(q),cur_style);delta= delta+height(x)-h;h= height(x);
}

	/*:741*/
	#line 14488 "ctex.w"
;
y= char_box(f,c);
shift_amount(y)= s+half(w-width(y));
width(y)= 0;p= new_kern(-delta);link(p)= x;link(y)= p;
y= vpack(y,natural);width(y)= width(x);
if(height(y)<h)	/*738:*/
	#line 14499 "ctex.w"

{p= new_kern(h-height(y));link(p)= list_ptr(y);list_ptr(y)= p;
height(y)= h;
}

	/*:738*/
	#line 14493 "ctex.w"
;
info(nucleus(q))= y;
math_type(nucleus(q))= sub_box;
}
}

	/*:737*/	/*742:*/
	#line 14552 "ctex.w"

static void make_fraction(pointer q)
{pointer p,v,x,y,z;
scaled delta,delta1,delta2,shift_up,shift_down,clr;

if(thickness(q)==default_code)thickness(q)= default_rule_thickness;
	/*743:*/
	#line 14569 "ctex.w"

x= clean_box(numerator(q),num_style(cur_style));
z= clean_box(denominator(q),denom_style(cur_style));
if(width(x)<width(z))x= rebox(x,width(z));
else z= rebox(z,width(x));
if(cur_style<text_style)
{shift_up= num1(cur_size);shift_down= denom1(cur_size);
}
else{shift_down= denom2(cur_size);
if(thickness(q)!=0)shift_up= num2(cur_size);
else shift_up= num3(cur_size);
}

	/*:743*/
	#line 14560 "ctex.w"
;
if(thickness(q)==0)	/*744:*/
	#line 14586 "ctex.w"

{if(cur_style<text_style)clr= 7*default_rule_thickness;
else clr= 3*default_rule_thickness;
delta= half(clr-((shift_up-depth(x))-(height(z)-shift_down)));
if(delta>0)
{shift_up= shift_up+delta;
shift_down= shift_down+delta;
}
}

	/*:744*/
	#line 14562 "ctex.w"

else	/*745:*/
	#line 14599 "ctex.w"

{if(cur_style<text_style)clr= 3*thickness(q);
else clr= thickness(q);
delta= half(thickness(q));
delta1= clr-((shift_up-depth(x))-(axis_height(cur_size)+delta));
delta2= clr-((axis_height(cur_size)-delta)-(height(z)-shift_down));
if(delta1>0)shift_up= shift_up+delta1;
if(delta2>0)shift_down= shift_down+delta2;
}

	/*:745*/
	#line 14563 "ctex.w"
;
	/*746:*/
	#line 14609 "ctex.w"

v= new_null_box();type(v)= vlist_node;
height(v)= shift_up+height(x);depth(v)= depth(z)+shift_down;
width(v)= width(x);
if(thickness(q)==0)
{p= new_kern((shift_up-depth(x))-(height(z)-shift_down));
link(p)= z;
}
else{y= fraction_rule(thickness(q));
p= new_kern((axis_height(cur_size)-delta)-(height(z)-shift_down));
link(y)= p;link(p)= z;
p= new_kern((shift_up-depth(x))-(axis_height(cur_size)+delta));
link(p)= y;
}
link(x)= p;list_ptr(v)= x

	/*:746*/
	#line 14564 "ctex.w"
;
	/*747:*/
	#line 14625 "ctex.w"

if(cur_style<text_style)delta= delim1(cur_size);
else delta= delim2(cur_size);
x= var_delimiter(left_delimiter(q),cur_size,delta);link(x)= v;
z= var_delimiter(right_delimiter(q),cur_size,delta);link(v)= z;
new_hlist(q)= hpack(x,natural)

	/*:747*/
	#line 14566 "ctex.w"
;
}

	/*:742*/	/*748:*/
	#line 14647 "ctex.w"

static scaled make_op(pointer q)
{scaled delta;
pointer p,v,x,y,z;
quarterword c;four_quarters i;
scaled shift_up,shift_down;
if((subtype(q)==normal)&&(cur_style<text_style))
subtype(q)= limits;
if(math_type(nucleus(q))==math_char)
{fetch(nucleus(q));
if((cur_style<text_style)&&(char_tag(cur_i)==list_tag))
{c= rem_byte(cur_i);i= char_info(cur_f,c);
if(char_exists(i))
{cur_c= c;cur_i= i;character(nucleus(q))= c;
}
}
delta= char_italic(cur_f,cur_i);x= clean_box(nucleus(q),cur_style);
if((math_type(subscr(q))!=empty)&&(subtype(q)!=limits))
width(x)= width(x)-delta;
shift_amount(x)= half(height(x)-depth(x))-axis_height(cur_size);

math_type(nucleus(q))= sub_box;info(nucleus(q))= x;
}
else delta= 0;
if(subtype(q)==limits)
	/*749:*/
	#line 14679 "ctex.w"

{x= clean_box(supscr(q),sup_style(cur_style));
y= clean_box(nucleus(q),cur_style);
z= clean_box(subscr(q),sub_style(cur_style));
v= new_null_box();type(v)= vlist_node;width(v)= width(y);
if(width(x)>width(v))width(v)= width(x);
if(width(z)>width(v))width(v)= width(z);
x= rebox(x,width(v));y= rebox(y,width(v));z= rebox(z,width(v));
shift_amount(x)= half(delta);shift_amount(z)= -shift_amount(x);
height(v)= height(y);depth(v)= depth(y);
	/*750:*/
	#line 14699 "ctex.w"

if(math_type(supscr(q))==empty)
{free_node(x,box_node_size);list_ptr(v)= y;
}
else{shift_up= big_op_spacing3-depth(x);
if(shift_up<big_op_spacing1)shift_up= big_op_spacing1;
p= new_kern(shift_up);link(p)= y;link(x)= p;
p= new_kern(big_op_spacing5);link(p)= x;list_ptr(v)= p;
height(v)= height(v)+big_op_spacing5+height(x)+depth(x)+shift_up;
}
if(math_type(subscr(q))==empty)free_node(z,box_node_size);
else{shift_down= big_op_spacing4-height(z);
if(shift_down<big_op_spacing2)shift_down= big_op_spacing2;
p= new_kern(shift_down);link(y)= p;link(p)= z;
p= new_kern(big_op_spacing5);link(z)= p;
depth(v)= depth(v)+big_op_spacing5+height(z)+depth(z)+shift_down;
}

	/*:750*/
	#line 14690 "ctex.w"
;
new_hlist(q)= v;
}

	/*:749*/
	#line 14672 "ctex.w"
;
return delta;
}

	/*:748*/	/*751:*/
	#line 14727 "ctex.w"

static void make_ord(pointer q)
{
int a;
pointer p,r;
restart:
if(math_type(subscr(q))==empty)if(math_type(supscr(q))==empty)
if(math_type(nucleus(q))==math_char)
{p= link(q);
if(p!=null)if((type(p)>=ord_noad)&&(type(p)<=punct_noad))
if(math_type(nucleus(p))==math_char)
if(fam(nucleus(p))==fam(nucleus(q)))
{math_type(nucleus(q))= math_text_char;
fetch(nucleus(q));
if(char_tag(cur_i)==lig_tag)
{a= lig_kern_start(cur_f,cur_i);
cur_c= character(nucleus(p));
cur_i= font_info[a].qqqq;
if(skip_byte(cur_i)>stop_flag)
{a= lig_kern_restart(cur_f,cur_i);
cur_i= font_info[a].qqqq;
}
loop{	/*752:*/
	#line 14769 "ctex.w"

if(next_char(cur_i)==cur_c)if(skip_byte(cur_i)<=stop_flag)
if(op_byte(cur_i)>=kern_flag)
{p= new_kern(char_kern(cur_f,cur_i));
link(p)= link(q);link(q)= p;return;
}
else{check_interrupt;
switch(op_byte(cur_i)){
case qi(1):case qi(5):character(nucleus(q))= rem_byte(cur_i);break;
case qi(2):case qi(6):character(nucleus(p))= rem_byte(cur_i);break;
case qi(3):case qi(7):case qi(11):{r= new_noad();
character(nucleus(r))= rem_byte(cur_i);
fam(nucleus(r))= fam(nucleus(q));
link(q)= r;link(r)= p;
if(op_byte(cur_i)<qi(11))math_type(nucleus(r))= math_char;
else math_type(nucleus(r))= math_text_char;
}break;
default:{link(q)= link(p);
character(nucleus(q))= rem_byte(cur_i);
mem[subscr(q)]= mem[subscr(p)];mem[supscr(q)]= mem[supscr(p)];
free_node(p,noad_size);
}
}
if(op_byte(cur_i)>qi(3))return;
math_type(nucleus(q))= math_char;goto restart;
}

	/*:752*/
	#line 14751 "ctex.w"
;
if(skip_byte(cur_i)>=stop_flag)return;
a= a+qo(skip_byte(cur_i))+1;
cur_i= font_info[a].qqqq;
}
}
}
}
}

	/*:751*/	/*755:*/
	#line 14851 "ctex.w"

static void make_scripts(pointer q,scaled delta)
{pointer p,x,y,z;
scaled shift_up,shift_down,clr;
small_number t;
p= new_hlist(q);
if(is_char_node(p))
{shift_up= 0;shift_down= 0;
}
else{z= hpack(p,natural);
if(cur_style<script_style)t= script_size;else t= script_script_size;
shift_up= height(z)-sup_drop(t);
shift_down= depth(z)+sub_drop(t);
free_node(z,box_node_size);
}
if(math_type(supscr(q))==empty)
	/*756:*/
	#line 14883 "ctex.w"

{x= clean_box(subscr(q),sub_style(cur_style));
width(x)= width(x)+script_space;
if(shift_down<sub1(cur_size))shift_down= sub1(cur_size);
clr= height(x)-(abs(math_x_height(cur_size)*4)/5);
if(shift_down<clr)shift_down= clr;
shift_amount(x)= shift_down;
}

	/*:756*/
	#line 14867 "ctex.w"

else{	/*757:*/
	#line 14895 "ctex.w"

{x= clean_box(supscr(q),sup_style(cur_style));
width(x)= width(x)+script_space;
if(odd(cur_style))clr= sup3(cur_size);
else if(cur_style<text_style)clr= sup1(cur_size);
else clr= sup2(cur_size);
if(shift_up<clr)shift_up= clr;
clr= depth(x)+(abs(math_x_height(cur_size))/4);
if(shift_up<clr)shift_up= clr;
}

	/*:757*/
	#line 14868 "ctex.w"
;
if(math_type(subscr(q))==empty)shift_amount(x)= -shift_up;
else	/*758:*/
	#line 14912 "ctex.w"

{y= clean_box(subscr(q),sub_style(cur_style));
width(y)= width(y)+script_space;
if(shift_down<sub2(cur_size))shift_down= sub2(cur_size);
clr= 4*default_rule_thickness-
((shift_up-depth(x))-(height(y)-shift_down));
if(clr>0)
{shift_down= shift_down+clr;
clr= (abs(math_x_height(cur_size)*4)/5)-(shift_up-depth(x));
if(clr>0)
{shift_up= shift_up+clr;
shift_down= shift_down-clr;
}
}
shift_amount(x)= delta;
p= new_kern((shift_up-depth(x))-(height(y)-shift_down));link(x)= p;link(p)= y;
x= vpack(x,natural);shift_amount(x)= shift_down;
}

	/*:758*/
	#line 14871 "ctex.w"
;
}
if(new_hlist(q)==null)new_hlist(q)= x;
else{p= new_hlist(q);
while(link(p)!=null)p= link(p);
link(p)= x;
}
}

	/*:755*/	/*761:*/
	#line 14984 "ctex.w"

static small_number make_left_right(pointer q,small_number style,
scaled max_d,scaled max_h)
{scaled delta,delta1,delta2;
if(style<script_style)cur_size= text_size;
else cur_size= 16*((style-text_style)/2);
delta2= max_d+axis_height(cur_size);
delta1= max_h+max_d-delta2;
if(delta2>delta1)delta1= delta2;
delta= (delta1/500)*delimiter_factor;
delta2= delta1+delta1-delimiter_shortfall;
if(delta<delta2)delta= delta2;
new_hlist(q)= var_delimiter(delimiter(q),cur_size,delta);
return type(q)-(left_noad-open_noad);
}

	/*:761*/
	#line 14251 "ctex.w"

static void mlist_to_hlist(void)
{

pointer mlist;
bool penalties;
small_number style;
small_number save_style;
pointer q;
pointer r;
small_number r_type;
small_number t;
pointer p,x,y,z;
int pen;
small_number s;
scaled max_h,max_d;
scaled delta;
mlist= cur_mlist;penalties= mlist_penalties;
style= cur_style;
q= mlist;r= null;r_type= op_noad;max_h= 0;max_d= 0;
	/*702:*/
	#line 13844 "ctex.w"

{if(cur_style<script_style)cur_size= text_size;
else cur_size= 16*((cur_style-text_style)/2);
cur_mu= x_over_n(math_quad(cur_size),18);
}

	/*:702*/
	#line 14271 "ctex.w"
;
while(q!=null)	/*726:*/
	#line 14282 "ctex.w"

{	/*727:*/
	#line 14298 "ctex.w"

reswitch:delta= 0;
switch(type(q)){
case bin_noad:switch(r_type){
case bin_noad:case op_noad:case rel_noad:case open_noad:case punct_noad:case left_noad:
{type(q)= ord_noad;goto reswitch;
}
default:do_nothing;
}break;
case rel_noad:case close_noad:case punct_noad:case right_noad:{
	/*728:*/
	#line 14318 "ctex.w"

if(r_type==bin_noad)type(r)= ord_noad

	/*:728*/
	#line 14308 "ctex.w"
;
if(type(q)==right_noad)goto done_with_noad;
}break;
	/*732:*/
	#line 14382 "ctex.w"

case left_noad:goto done_with_noad;
case fraction_noad:{make_fraction(q);goto check_dimensions;
}
case op_noad:{delta= make_op(q);
if(subtype(q)==limits)goto check_dimensions;
}break;
case ord_noad:make_ord(q);break;
case open_noad:case inner_noad:do_nothing;break;
case radical_noad:make_radical(q);break;
case over_noad:make_over(q);break;
case under_noad:make_under(q);break;
case accent_noad:make_math_accent(q);break;
case vcenter_noad:make_vcenter(q);break;

	/*:732*/
	#line 14311 "ctex.w"

	/*729:*/
	#line 14321 "ctex.w"

case style_node:{cur_style= subtype(q);
	/*702:*/
	#line 13844 "ctex.w"

{if(cur_style<script_style)cur_size= text_size;
else cur_size= 16*((cur_style-text_style)/2);
cur_mu= x_over_n(math_quad(cur_size),18);
}

	/*:702*/
	#line 14323 "ctex.w"
;
goto done_with_node;
}
case choice_node:	/*730:*/
	#line 14341 "ctex.w"

{switch(cur_style/2){
case 0:choose_mlist(display_mlist)break;
case 1:choose_mlist(text_mlist)break;
case 2:choose_mlist(script_mlist)break;
case 3:choose_mlist(script_script_mlist);
}
flush_node_list(display_mlist(q));
flush_node_list(text_mlist(q));
flush_node_list(script_mlist(q));
flush_node_list(script_script_mlist(q));
type(q)= style_node;subtype(q)= cur_style;width(q)= 0;depth(q)= 0;
if(p!=null)
{z= link(q);link(q)= p;
while(link(p)!=null)p= link(p);
link(p)= z;
}
goto done_with_node;
}

	/*:730*/
	#line 14327 "ctex.w"

case ins_node:case mark_node:case adjust_node:
case whatsit_node:case penalty_node:case disc_node:goto done_with_node;
case rule_node:{if(height(q)>max_h)max_h= height(q);
if(depth(q)>max_d)max_d= depth(q);goto done_with_node;
}
case glue_node:{	/*731:*/
	#line 14369 "ctex.w"

if(subtype(q)==mu_glue)
{x= glue_ptr(q);
y= math_glue(x,cur_mu);delete_glue_ref(x);glue_ptr(q)= y;
subtype(q)= normal;
}
else if((cur_size!=text_size)&&(subtype(q)==cond_math_glue))
{p= link(q);
if(p!=null)if((type(p)==glue_node)||(type(p)==kern_node))
{link(q)= link(p);link(p)= null;flush_node_list(p);
}
}

	/*:731*/
	#line 14333 "ctex.w"
;
goto done_with_node;
}
case kern_node:{math_kern(q,cur_mu);goto done_with_node;
}

	/*:729*/
	#line 14312 "ctex.w"

default:confusion("mlist1");

}
	/*753:*/
	#line 14808 "ctex.w"

switch(math_type(nucleus(q))){
case math_char:case math_text_char:
	/*754:*/
	#line 14830 "ctex.w"

{fetch(nucleus(q));
if(char_exists(cur_i))
{delta= char_italic(cur_f,cur_i);p= new_character(cur_f,qo(cur_c));
if((math_type(nucleus(q))==math_text_char)&&(space(cur_f)!=0))
delta= 0;
if((math_type(subscr(q))==empty)&&(delta!=0))
{link(p)= new_kern(delta);delta= 0;
}
}
else p= null;
}

	/*:754*/
	#line 14813 "ctex.w"
break;
case empty:p= null;break;
case sub_box:p= info(nucleus(q));break;
case sub_mlist:{cur_mlist= info(nucleus(q));save_style= cur_style;
mlist_penalties= false;mlist_to_hlist();

cur_style= save_style;	/*702:*/
	#line 13844 "ctex.w"

{if(cur_style<script_style)cur_size= text_size;
else cur_size= 16*((cur_style-text_style)/2);
cur_mu= x_over_n(math_quad(cur_size),18);
}

	/*:702*/
	#line 14819 "ctex.w"
;
p= hpack(link(temp_head),natural);
}break;
default:confusion("mlist2");

}
new_hlist(q)= p;
if((math_type(subscr(q))==empty)&&(math_type(supscr(q))==empty))
goto check_dimensions;
make_scripts(q,delta)

	/*:753*/
	#line 14316 "ctex.w"


	/*:727*/
	#line 14285 "ctex.w"
;
check_dimensions:z= hpack(new_hlist(q),natural);
if(height(z)>max_h)max_h= height(z);
if(depth(z)>max_d)max_d= depth(z);
free_node(z,box_node_size);
done_with_noad:r= q;r_type= type(r);
done_with_node:q= link(q);
}

	/*:726*/
	#line 14273 "ctex.w"
;
	/*728:*/
	#line 14318 "ctex.w"

if(r_type==bin_noad)type(r)= ord_noad

	/*:728*/
	#line 14274 "ctex.w"
;
	/*759:*/
	#line 14937 "ctex.w"

p= temp_head;link(p)= null;q= mlist;r_type= 0;cur_style= style;
	/*702:*/
	#line 13844 "ctex.w"

{if(cur_style<script_style)cur_size= text_size;
else cur_size= 16*((cur_style-text_style)/2);
cur_mu= x_over_n(math_quad(cur_size),18);
}

	/*:702*/
	#line 14939 "ctex.w"
;
while(q!=null)
{	/*760:*/
	#line 14954 "ctex.w"

t= ord_noad;s= noad_size;pen= inf_penalty;
switch(type(q)){
case op_noad:case open_noad:case close_noad:case punct_noad:case inner_noad:t= type(q);break;
case bin_noad:{t= bin_noad;pen= bin_op_penalty;
}break;
case rel_noad:{t= rel_noad;pen= rel_penalty;
}break;
case ord_noad:case vcenter_noad:case over_noad:case under_noad:do_nothing;break;
case radical_noad:s= radical_noad_size;break;
case accent_noad:s= accent_noad_size;break;
case fraction_noad:{t= inner_noad;s= fraction_noad_size;
}break;
case left_noad:case right_noad:t= make_left_right(q,style,max_d,max_h);break;
case style_node:	/*762:*/
	#line 15000 "ctex.w"

{cur_style= subtype(q);s= style_node_size;
	/*702:*/
	#line 13844 "ctex.w"

{if(cur_style<script_style)cur_size= text_size;
else cur_size= 16*((cur_style-text_style)/2);
cur_mu= x_over_n(math_quad(cur_size),18);
}

	/*:702*/
	#line 15002 "ctex.w"
;
goto delete_q;
}

	/*:762*/
	#line 14968 "ctex.w"

case whatsit_node:case penalty_node:case rule_node:case disc_node:case adjust_node:case ins_node:case mark_node:
case glue_node:case kern_node:
{link(p)= q;p= q;q= link(q);link(p)= null;goto done;
}
default:confusion("mlist3");

}

	/*:760*/
	#line 14944 "ctex.w"
;
	/*765:*/
	#line 15038 "ctex.w"

if(r_type>0)
{switch(so(math_spacing[r_type*8+t+magic_offset])){
case'0':x= 0;break;
case'1':if(cur_style<script_style)x= thin_mu_skip_code;else x= 0;break;
case'2':x= thin_mu_skip_code;break;
case'3':if(cur_style<script_style)x= med_mu_skip_code;else x= 0;break;
case'4':if(cur_style<script_style)x= thick_mu_skip_code;else x= 0;break;
default:confusion("mlist4");

}
if(x!=0)
{y= math_glue(glue_par(x),cur_mu);
z= new_glue(y);glue_ref_count(y)= null;link(p)= z;p= z;
subtype(z)= x+1;
}
}

	/*:765*/
	#line 14945 "ctex.w"
;
	/*766:*/
	#line 15060 "ctex.w"

if(new_hlist(q)!=null)
{link(p)= new_hlist(q);
do{p= link(p);
}while(!(link(p)==null));
}
if(penalties)if(link(q)!=null)if(pen<inf_penalty)
{r_type= type(link(q));
if(r_type!=penalty_node)if(r_type!=rel_noad)
{z= new_penalty(pen);link(p)= z;p= z;
}
}

	/*:766*/
	#line 14946 "ctex.w"
;
r_type= t;
delete_q:r= q;q= link(q);free_node(r,s);
done:;}

	/*:759*/
	#line 14276 "ctex.w"
;
}

	/*:725*/	/*771:*/
	#line 15249 "ctex.w"
static void push_alignment(void)
{pointer p;
p= get_node(align_stack_node_size);
link(p)= align_ptr;info(p)= cur_align;
llink(p)= preamble;rlink(p)= cur_span;
mem[p+2].i= cur_loop;mem[p+3].i= align_state;
info(p+4)= cur_head;link(p+4)= cur_tail;
align_ptr= p;
cur_head= get_avail();
}

static void pop_alignment(void)
{pointer p;
free_avail(cur_head);
p= align_ptr;
cur_tail= link(p+4);cur_head= info(p+4);
align_state= mem[p+3].i;cur_loop= mem[p+2].i;
cur_span= rlink(p);preamble= llink(p);
cur_align= info(p);align_ptr= link(p);
free_node(p,align_stack_node_size);
}

	/*:771*/	/*773:*/
	#line 15289 "ctex.w"
	/*781:*/
	#line 15401 "ctex.w"

static void get_preamble_token(void)
{
restart:get_token();
while((cur_chr==span_code)&&(cur_cmd==tab_mark))
{get_token();
if(cur_cmd>max_command)
{expand();get_token();
}
}
if(cur_cmd==endv)
fatal_error("(interwoven alignment preambles are not allowed)");

if((cur_cmd==assign_glue)&&(cur_chr==glue_base+tab_skip_code))
{scan_optional_equals();scan_glue(glue_val);
if(global_defs>0)geq_define(glue_base+tab_skip_code,glue_ref,cur_val);
else eq_define(glue_base+tab_skip_code,glue_ref,cur_val);
goto restart;
}
}

	/*:781*/
	#line 15289 "ctex.w"

static void align_peek(void);
static void normal_paragraph(void);
static void init_align(void)
{
pointer save_cs_ptr;
pointer p;
save_cs_ptr= cur_cs;
push_alignment();align_state= -1000000;
	/*775:*/
	#line 15322 "ctex.w"

if((mode==mmode)&&((tail!=head)||(incompleat_noad!=null)))
{print_err("Improper ");print_esc("halign");print(" inside $$'s");

help3("Displays can use special alignments (like \\eqalignno)",
"only if nothing but the alignment itself is between $$'s.",
"So I've deleted the formulas that preceded this alignment.");
error();flush_math();
}

	/*:775*/
	#line 15298 "ctex.w"
;
push_nest();
	/*774:*/
	#line 15313 "ctex.w"

if(mode==mmode)
{mode= -vmode;prev_depth= nest[nest_ptr-2].aux_field.sc;
}
else if(mode>0)negate(mode)

	/*:774*/
	#line 15300 "ctex.w"
;
scan_spec(align_group,false);
	/*776:*/
	#line 15332 "ctex.w"

preamble= null;cur_align= align_head;cur_loop= null;scanner_status= aligning;
warning_index= save_cs_ptr;align_state= -1000000;

loop{	/*777:*/
	#line 15343 "ctex.w"

link(cur_align)= new_param_glue(tab_skip_code);
cur_align= link(cur_align)

	/*:777*/
	#line 15336 "ctex.w"
;
if(cur_cmd==car_ret)goto done;
	/*778:*/
	#line 15347 "ctex.w"

	/*782:*/
	#line 15424 "ctex.w"

p= hold_head;link(p)= null;
loop{get_preamble_token();
if(cur_cmd==mac_param)goto done1;
if((cur_cmd<=car_ret)&&(cur_cmd>=tab_mark)&&(align_state==-1000000))
if((p==hold_head)&&(cur_loop==null)&&(cur_cmd==tab_mark)
)cur_loop= cur_align;
else{print_err("Missing # inserted in alignment preamble");

help3("There should be exactly one # between &'s, when an",
"\\halign or \\valign is being set up. In this case you had",
"none, so I've put one in; maybe that will work.");
back_error();goto done1;
}
else if((cur_cmd!=spacer)||(p!=hold_head))
{link(p)= get_avail();p= link(p);info(p)= cur_tok;
}
}
done1:

	/*:782*/
	#line 15348 "ctex.w"
;
link(cur_align)= new_null_box();cur_align= link(cur_align);
info(cur_align)= end_span;width(cur_align)= null_flag;
u_part(cur_align)= link(hold_head);
	/*783:*/
	#line 15444 "ctex.w"

p= hold_head;link(p)= null;
loop{resume:get_preamble_token();
if((cur_cmd<=car_ret)&&(cur_cmd>=tab_mark)&&(align_state==-1000000))
goto done2;
if(cur_cmd==mac_param)
{print_err("Only one # is allowed per tab");

help3("There should be exactly one # between &'s, when an",
"\\halign or \\valign is being set up. In this case you had",
"more than one, so I'm ignoring all but the first.");
error();goto resume;
}
link(p)= get_avail();p= link(p);info(p)= cur_tok;
}
done2:link(p)= get_avail();p= link(p);
info(p)= end_template_token

	/*:783*/
	#line 15352 "ctex.w"
;
v_part(cur_align)= link(hold_head)

	/*:778*/
	#line 15339 "ctex.w"
;
}
done:scanner_status= normal

	/*:776*/
	#line 15302 "ctex.w"
;
new_save_level(align_group);
if(every_cr!=null)begin_token_list(every_cr,every_cr_text);
align_peek();
}

	/*:773*/	/*785:*/
	#line 15494 "ctex.w"
	/*786:*/
	#line 15507 "ctex.w"

static void init_span(pointer p)
{push_nest();
if(mode==-hmode)space_factor= 1000;
else{prev_depth= ignore_depth;normal_paragraph();
}
cur_span= p;
}

	/*:786*/
	#line 15494 "ctex.w"

static void init_row(void)
{push_nest();mode= (-hmode-vmode)-mode;
if(mode==-hmode)space_factor= 0;else prev_depth= 0;
tail_append(new_glue(glue_ptr(preamble)));
subtype(tail)= tab_skip_code+1;
cur_align= link(preamble);cur_tail= cur_head;init_span(cur_align);
}

	/*:785*/	/*787:*/
	#line 15523 "ctex.w"
static void init_col(void)
{extra_info(cur_align)= cur_cmd;
if(cur_cmd==omit)align_state= 0;
else{back_input();begin_token_list(u_part(cur_align),u_template);
}
}

	/*:787*/	/*790:*/
	#line 15560 "ctex.w"
static bool fin_col(void)
{
pointer p;
pointer q,r;
pointer s;
pointer u;
scaled w;
glue_ord o;
halfword n;
if(cur_align==null)confusion("endv");
q= link(cur_align);if(q==null)confusion("endv");

if(align_state<500000)
fatal_error("(interwoven alignment preambles are not allowed)");

p= link(q);
	/*791:*/
	#line 15591 "ctex.w"

if((p==null)&&(extra_info(cur_align)<cr_code))
if(cur_loop!=null)	/*792:*/
	#line 15603 "ctex.w"

{link(q)= new_null_box();p= link(q);
info(p)= end_span;width(p)= null_flag;cur_loop= link(cur_loop);
	/*793:*/
	#line 15611 "ctex.w"

q= hold_head;r= u_part(cur_loop);
while(r!=null)
{link(q)= get_avail();q= link(q);info(q)= info(r);r= link(r);
}
link(q)= null;u_part(p)= link(hold_head);
q= hold_head;r= v_part(cur_loop);
while(r!=null)
{link(q)= get_avail();q= link(q);info(q)= info(r);r= link(r);
}
link(q)= null;v_part(p)= link(hold_head)

	/*:793*/
	#line 15606 "ctex.w"
;
cur_loop= link(cur_loop);
link(p)= new_glue(glue_ptr(cur_loop));
}

	/*:792*/
	#line 15593 "ctex.w"

else{print_err("Extra alignment tab has been changed to ");

print_esc("cr");
help3("You have given more \\span or & marks than there were",
"in the preamble to the \\halign or \\valign now in progress.",
"So I'll assume that you meant to type \\cr instead.");
extra_info(cur_align)= cr_code;error();
}

	/*:791*/
	#line 15576 "ctex.w"
;
if(extra_info(cur_align)!=span_code)
{unsave();new_save_level(align_group);
	/*795:*/
	#line 15627 "ctex.w"

{if(mode==-hmode)
{adjust_tail= cur_tail;u= hpack(link(head),natural);w= width(u);
cur_tail= adjust_tail;adjust_tail= null;
}
else{u= vpackage(link(head),natural,0);w= height(u);
}
n= min_quarterword;
if(cur_span!=cur_align)	/*797:*/
	#line 15661 "ctex.w"

{q= cur_span;
do{incr(n);q= link(link(q));
}while(!(q==cur_align));
if(n>max_quarterword)confusion("256 spans");


q= cur_span;while(link(info(q))<n)q= info(q);
if(link(info(q))>n)
{s= get_node(span_node_size);info(s)= info(q);link(s)= n;
info(q)= s;width(s)= w;
}
else if(width(info(q))<w)width(info(q))= w;
}

	/*:797*/
	#line 15635 "ctex.w"

else if(w>width(cur_align))width(cur_align)= w;
type(u)= unset_node;span_count(u)= n;
	/*658:*/
	#line 13043 "ctex.w"

if(total_stretch[filll]!=0)o= filll;
else if(total_stretch[fill]!=0)o= fill;
else if(total_stretch[fil]!=0)o= fil;
else o= normal

	/*:658*/
	#line 15638 "ctex.w"
;
glue_order(u)= o;glue_stretch(u)= total_stretch[o];
	/*664:*/
	#line 13107 "ctex.w"

if(total_shrink[filll]!=0)o= filll;
else if(total_shrink[fill]!=0)o= fill;
else if(total_shrink[fil]!=0)o= fil;
else o= normal

	/*:664*/
	#line 15640 "ctex.w"
;
glue_sign(u)= o;glue_shrink(u)= total_shrink[o];
pop_nest();link(tail)= u;tail= u;
}

	/*:795*/
	#line 15579 "ctex.w"
;
	/*794:*/
	#line 15623 "ctex.w"

tail_append(new_glue(glue_ptr(link(cur_align))));
subtype(tail)= tab_skip_code+1

	/*:794*/
	#line 15580 "ctex.w"
;
if(extra_info(cur_align)>=cr_code)
{return true;
}
init_span(p);
}
align_state= 1000000;	/*405:*/
	#line 8201 "ctex.w"

do{get_x_token();
}while(!(cur_cmd!=spacer))

	/*:405*/
	#line 15586 "ctex.w"
;
cur_align= p;
init_col();return false;
}

	/*:790*/	/*798:*/
	#line 15681 "ctex.w"
static void fin_row(void)
{pointer p;
if(mode==-hmode)
{p= hpack(link(head),natural);
pop_nest();append_to_vlist(p);
if(cur_head!=cur_tail)
{link(tail)= link(cur_head);tail= cur_tail;
}
}
else{p= vpack(link(head),natural);pop_nest();
link(tail)= p;tail= p;space_factor= 1000;
}
type(p)= unset_node;glue_stretch(p)= 0;
if(every_cr!=null)begin_token_list(every_cr,every_cr_text);
align_peek();
}

	/*:798*/	/*799:*/
	#line 15702 "ctex.w"
static void do_assignments(void);
static void resume_after_display(void);
static void build_page(void);
static void fin_align(void)
{pointer p,q,r,s,u,v;
scaled t,w;
scaled o;
halfword n;
scaled rule_save;
memory_word aux_save;
if(cur_group!=align_group)confusion("align1");

unsave();
if(cur_group!=align_group)confusion("align0");
unsave();
if(nest[nest_ptr-1].mode_field==mmode)o= display_indent;
else o= 0;
	/*800:*/
	#line 15752 "ctex.w"

q= link(preamble);
do{flush_list(u_part(q));flush_list(v_part(q));
p= link(link(q));
if(width(q)==null_flag)
	/*801:*/
	#line 15766 "ctex.w"

{width(q)= 0;r= link(q);s= glue_ptr(r);
if(s!=zero_glue)
{add_glue_ref(zero_glue);delete_glue_ref(s);
glue_ptr(r)= zero_glue;
}
}

	/*:801*/
	#line 15757 "ctex.w"
;
if(info(q)!=end_span)
	/*802:*/
	#line 15781 "ctex.w"

{t= width(q)+width(glue_ptr(link(q)));
r= info(q);s= end_span;info(s)= p;n= min_quarterword+1;
do{width(r)= width(r)-t;u= info(r);
while(link(r)>n)
{s= info(s);n= link(info(s))+1;
}
if(link(r)<n)
{info(r)= info(s);info(s)= r;decr(link(r));s= r;
}
else{if(width(r)>width(info(s)))width(info(s))= width(r);
free_node(r,span_node_size);
}
r= u;
}while(!(r==end_span));
}

	/*:802*/
	#line 15760 "ctex.w"
;
type(q)= unset_node;span_count(q)= min_quarterword;height(q)= 0;
depth(q)= 0;glue_order(q)= normal;glue_sign(q)= normal;
glue_stretch(q)= 0;glue_shrink(q)= 0;q= p;
}while(!(q==null))

	/*:800*/
	#line 15720 "ctex.w"
;
	/*803:*/
	#line 15804 "ctex.w"

save_ptr= save_ptr-2;pack_begin_line= -mode_line;
if(mode==-vmode)
{rule_save= overfull_rule;
overfull_rule= 0;
p= hpack(preamble,saved(1),saved(0));overfull_rule= rule_save;
}
else{q= link(preamble);
do{height(q)= width(q);width(q)= 0;q= link(link(q));
}while(!(q==null));
p= vpack(preamble,saved(1),saved(0));
q= link(preamble);
do{width(q)= height(q);height(q)= 0;q= link(link(q));
}while(!(q==null));
}
pack_begin_line= 0

	/*:803*/
	#line 15722 "ctex.w"
;
	/*804:*/
	#line 15821 "ctex.w"

q= link(head);s= head;
while(q!=null)
{if(!is_char_node(q))
if(type(q)==unset_node)
	/*806:*/
	#line 15845 "ctex.w"

{if(mode==-vmode)
{type(q)= hlist_node;width(q)= width(p);
}
else{type(q)= vlist_node;height(q)= height(p);
}
glue_order(q)= glue_order(p);glue_sign(q)= glue_sign(p);
glue_set(q)= glue_set(p);shift_amount(q)= o;
r= link(list_ptr(q));s= link(list_ptr(p));
do{	/*807:*/
	#line 15864 "ctex.w"

n= span_count(r);t= width(s);w= t;u= hold_head;
while(n>min_quarterword)
{decr(n);
	/*808:*/
	#line 15881 "ctex.w"

s= link(s);v= glue_ptr(s);link(u)= new_glue(v);u= link(u);
subtype(u)= tab_skip_code+1;t= t+width(v);
if(glue_sign(p)==stretching)
{if(stretch_order(v)==glue_order(p))
t= t+round(float(glue_set(p))*stretch(v));

}
else if(glue_sign(p)==shrinking)
{if(shrink_order(v)==glue_order(p))
t= t-round(float(glue_set(p))*shrink(v));
}
s= link(s);link(u)= new_null_box();u= link(u);t= t+width(s);
if(mode==-vmode)width(u)= width(s);else
{type(u)= vlist_node;height(u)= width(s);
}

	/*:808*/
	#line 15869 "ctex.w"
;
}
if(mode==-vmode)
	/*809:*/
	#line 15898 "ctex.w"

{height(r)= height(q);depth(r)= depth(q);
if(t==width(r))
{glue_sign(r)= normal;glue_order(r)= normal;
set_glue_ratio_zero(glue_set(r));
}
else if(t>width(r))
{glue_sign(r)= stretching;
if(glue_stretch(r)==0)set_glue_ratio_zero(glue_set(r));
else glue_set(r)= unfloat((t-width(r))/(double)glue_stretch(r));

}
else{glue_order(r)= glue_sign(r);glue_sign(r)= shrinking;
if(glue_shrink(r)==0)set_glue_ratio_zero(glue_set(r));
else if((glue_order(r)==normal)&&(width(r)-t>glue_shrink(r)))
set_glue_ratio_one(glue_set(r));
else glue_set(r)= unfloat((width(r)-t)/(double)glue_shrink(r));
}
width(r)= w;type(r)= hlist_node;
}

	/*:809*/
	#line 15873 "ctex.w"

else	/*810:*/
	#line 15919 "ctex.w"

{width(r)= width(q);
if(t==height(r))
{glue_sign(r)= normal;glue_order(r)= normal;
set_glue_ratio_zero(glue_set(r));
}
else if(t>height(r))
{glue_sign(r)= stretching;
if(glue_stretch(r)==0)set_glue_ratio_zero(glue_set(r));
else glue_set(r)= unfloat((t-height(r))/(double)glue_stretch(r));

}
else{glue_order(r)= glue_sign(r);glue_sign(r)= shrinking;
if(glue_shrink(r)==0)set_glue_ratio_zero(glue_set(r));
else if((glue_order(r)==normal)&&(height(r)-t>glue_shrink(r)))
set_glue_ratio_one(glue_set(r));
else glue_set(r)= unfloat((height(r)-t)/(double)glue_shrink(r));
}
height(r)= w;type(r)= vlist_node;
}

	/*:810*/
	#line 15875 "ctex.w"
;
shift_amount(r)= 0;
if(u!=hold_head)
{link(u)= link(r);link(r)= link(hold_head);r= u;
}

	/*:807*/
	#line 15854 "ctex.w"
;
r= link(link(r));s= link(link(s));
}while(!(r==null));
}

	/*:806*/
	#line 15826 "ctex.w"

else if(type(q)==rule_node)
	/*805:*/
	#line 15832 "ctex.w"

{if(is_running(width(q)))width(q)= width(p);
if(is_running(height(q)))height(q)= height(p);
if(is_running(depth(q)))depth(q)= depth(p);
if(o!=0)
{r= link(q);link(q)= null;q= hpack(q,natural);
shift_amount(q)= o;link(q)= r;link(s)= q;
}
}

	/*:805*/
	#line 15828 "ctex.w"
;
s= q;q= link(q);
}

	/*:804*/
	#line 15723 "ctex.w"
;
flush_node_list(p);pop_alignment();
	/*811:*/
	#line 15950 "ctex.w"

aux_save= aux;p= link(head);q= tail;pop_nest();
if(mode==mmode)	/*1205:*/
	#line 22569 "ctex.w"

{do_assignments();
if(cur_cmd!=math_shift)	/*1206:*/
	#line 22583 "ctex.w"

{print_err("Missing $$ inserted");

help2("Displays can use special alignments (like \\eqalignno)",
"only if nothing but the alignment itself is between $$'s.");
back_error();
}

	/*:1206*/
	#line 22571 "ctex.w"

else	/*1196:*/
	#line 22421 "ctex.w"

{get_x_token();
if(cur_cmd!=math_shift)
{print_err("Display math should end with $$");

help2("The `$' that I just saw supposedly matches a previous `$$'.",
"So I shall assume that you typed `$$' both times.");
back_error();
}
}

	/*:1196*/
	#line 22572 "ctex.w"
;
pop_nest();
tail_append(new_penalty(pre_display_penalty));
tail_append(new_param_glue(above_display_skip_code));
link(tail)= p;
if(p!=null)tail= q;
tail_append(new_penalty(post_display_penalty));
tail_append(new_param_glue(below_display_skip_code));
prev_depth= aux_save.sc;resume_after_display();
}

	/*:1205*/
	#line 15952 "ctex.w"

else{aux= aux_save;link(tail)= p;
if(p!=null)tail= q;
if(mode==vmode)build_page();
}

	/*:811*/
	#line 15725 "ctex.w"
;
}
	/*784:*/
	#line 15472 "ctex.w"

static void align_peek(void)
{
restart:align_state= 1000000;	/*405:*/
	#line 8201 "ctex.w"

do{get_x_token();
}while(!(cur_cmd!=spacer))

	/*:405*/
	#line 15475 "ctex.w"
;
if(cur_cmd==no_align)
{scan_left_brace();new_save_level(no_align_group);
if(mode==-vmode)normal_paragraph();
}
else if(cur_cmd==right_brace)fin_align();
else if((cur_cmd==car_ret)&&(cur_chr==cr_cr_code))
goto restart;
else{init_row();
init_col();
}
}

	/*:784*/
	#line 15727 "ctex.w"


	/*:799*/	/*814:*/
	#line 16014 "ctex.w"
	/*825:*/
	#line 16248 "ctex.w"

static pointer finite_shrink(pointer p)
{pointer q;
if(no_shrink_error_yet)
{no_shrink_error_yet= false;
print_err("Infinite glue shrinkage found in a paragraph");

help5("The paragraph just ended includes some glue that has",
"infinite shrinkability, e.g., `\\hskip 0pt minus 1fil'.",
"Such glue doesn't belong there---it allows a paragraph",
"of any length to fit on one line. But it's safe to proceed,",
"since the offensive shrinkability has been made finite.");
error();
}
q= new_spec(p);shrink_order(q)= normal;
delete_glue_ref(p);return q;
}

	/*:825*/	/*828:*/
	#line 16320 "ctex.w"

static void try_break(int pi,small_number break_type)
{
pointer r;
pointer prev_r;
halfword old_l;
bool no_break_yet;
	/*829:*/
	#line 16348 "ctex.w"

pointer prev_prev_r;
pointer s;
pointer q;
pointer v;
int t;
internal_font_number f;
halfword l;
bool node_r_stays_active;
scaled line_width;
int fit_class;
halfword b;
int d;
bool artificial_demerits;
#ifdef STAT
pointer save_link;
#endif
scaled shortfall;

	/*:829*/
	#line 16327 "ctex.w"

	/*830:*/
	#line 16367 "ctex.w"

if(abs(pi)>=inf_penalty)
if(pi>0)goto end;
else pi= eject_penalty

	/*:830*/
	#line 16328 "ctex.w"
;
no_break_yet= true;prev_r= active;old_l= 0;
do_all_six(copy_to_cur_active);
loop{resume:r= link(prev_r);
	/*831:*/
	#line 16377 "ctex.w"


if(type(r)==delta_node)
{do_all_six(update_width);
prev_prev_r= prev_r;prev_r= r;goto resume;
}

	/*:831*/
	#line 16333 "ctex.w"
;
	/*834:*/
	#line 16422 "ctex.w"

{l= line_number(r);
if(l>old_l)
{
if((minimum_demerits<awful_bad)&&
((old_l!=easy_line)||(r==last_active)))
	/*835:*/
	#line 16440 "ctex.w"

{if(no_break_yet)	/*836:*/
	#line 16476 "ctex.w"

{no_break_yet= false;do_all_six(set_break_width_to_background);
s= cur_p;
if(break_type>unhyphenated)if(cur_p!=null)
	/*839:*/
	#line 16519 "ctex.w"

{t= replace_count(cur_p);v= cur_p;s= post_break(cur_p);
while(t>0)
{decr(t);v= link(v);
	/*840:*/
	#line 16537 "ctex.w"

if(is_char_node(v))
{f= font(v);
break_width[1]= break_width[1]-char_width(f,char_info(f,character(v)));
}
else switch(type(v)){
case ligature_node:{f= font(lig_char(v));
break_width[1]= break_width[1]-
char_width(f,char_info(f,character(lig_char(v))));
}break;
case hlist_node:case vlist_node:case rule_node:case kern_node:
break_width[1]= break_width[1]-width(v);break;
default:confusion("disc1");

}

	/*:840*/
	#line 16523 "ctex.w"
;
}
while(s!=null)
{	/*841:*/
	#line 16553 "ctex.w"

if(is_char_node(s))
{f= font(s);
break_width[1]= break_width[1]+char_width(f,char_info(f,character(s)));
}
else switch(type(s)){
case ligature_node:{f= font(lig_char(s));
break_width[1]= break_width[1]+
char_width(f,char_info(f,character(lig_char(s))));
}break;
case hlist_node:case vlist_node:case rule_node:case kern_node:
break_width[1]= break_width[1]+width(s);break;
default:confusion("disc2");

}

	/*:841*/
	#line 16526 "ctex.w"
;
s= link(s);
}
break_width[1]= break_width[1]+disc_width;
if(post_break(cur_p)==null)s= link(v);

}

	/*:839*/
	#line 16480 "ctex.w"
;
while(s!=null)
{if(is_char_node(s))goto done;
switch(type(s)){
case glue_node:	/*837:*/
	#line 16495 "ctex.w"

{v= glue_ptr(s);break_width[1]= break_width[1]-width(v);
break_width[2+stretch_order(v)]= break_width[2+stretch_order(v)]-stretch(v);
break_width[6]= break_width[6]-shrink(v);
}

	/*:837*/
	#line 16484 "ctex.w"
break;
case penalty_node:do_nothing;break;
case math_node:break_width[1]= break_width[1]-width(s);break;
case kern_node:if(subtype(s)!=explicit)goto done;
else break_width[1]= break_width[1]-width(s);break;
default:goto done;
}
s= link(s);
}
done:;}

	/*:836*/
	#line 16441 "ctex.w"
;
	/*842:*/
	#line 16578 "ctex.w"

if(type(prev_r)==delta_node)
{do_all_six(convert_to_break_width);
}
else if(prev_r==active)
{do_all_six(store_break_width);
}
else{q= get_node(delta_node_size);link(q)= r;type(q)= delta_node;
subtype(q)= 0;
do_all_six(new_delta_to_break_width);
link(prev_r)= q;prev_prev_r= prev_r;prev_r= q;
}

	/*:842*/
	#line 16442 "ctex.w"
;
if(abs(adj_demerits)>=awful_bad-minimum_demerits)
minimum_demerits= awful_bad-1;
else minimum_demerits= minimum_demerits+abs(adj_demerits);
for(fit_class= very_loose_fit;fit_class<=tight_fit;fit_class++)
{if(minimal_demerits[fit_class]<=minimum_demerits)
	/*844:*/
	#line 16608 "ctex.w"

{q= get_node(passive_node_size);
link(q)= passive;passive= q;cur_break(q)= cur_p;
#ifdef STAT
incr(pass_number);serial(q)= pass_number;
#endif

prev_break(q)= best_place[fit_class];
q= get_node(active_node_size);break_node(q)= passive;
line_number(q)= best_pl_line[fit_class]+1;
fitness(q)= fit_class;type(q)= break_type;
total_demerits(q)= minimal_demerits[fit_class];
link(q)= r;link(prev_r)= q;prev_r= q;
#ifdef STAT
if(tracing_paragraphs>0)
	/*845:*/
	#line 16628 "ctex.w"

{print_nl("@@");print_int(serial(passive));

print(": line ");print_int(line_number(q)-1);
print_char('.');print_int(fit_class);
if(break_type==hyphenated)print_char('-');
print(" t=");print_int(total_demerits(q));
print(" -> @@");
if(prev_break(passive)==null)print_char('0');
else print_int(serial(prev_break(passive)));
}

	/*:845*/
	#line 16623 "ctex.w"
;
#endif

}

	/*:844*/
	#line 16448 "ctex.w"
;
minimal_demerits[fit_class]= awful_bad;
}
minimum_demerits= awful_bad;
	/*843:*/
	#line 16597 "ctex.w"

if(r!=last_active)
{q= get_node(delta_node_size);link(q)= r;type(q)= delta_node;
subtype(q)= 0;
do_all_six(new_delta_from_break_width);
link(prev_r)= q;prev_prev_r= prev_r;prev_r= q;
}

	/*:843*/
	#line 16452 "ctex.w"
;
}

	/*:835*/
	#line 16428 "ctex.w"
;
if(r==last_active)goto end;
	/*849:*/
	#line 16704 "ctex.w"

if(l>easy_line)
{line_width= second_width;old_l= max_halfword-1;
}
else{old_l= l;
if(l>last_special_line)line_width= second_width;
else if(par_shape_ptr==null)line_width= first_width;
else line_width= mem[par_shape_ptr+2*l].sc;
}

	/*:849*/
	#line 16430 "ctex.w"
;
}
}

	/*:834*/
	#line 16336 "ctex.w"
;
	/*850:*/
	#line 16724 "ctex.w"

{artificial_demerits= false;

shortfall= line_width-cur_active_width[1];
if(shortfall>0)
	/*851:*/
	#line 16754 "ctex.w"

if((cur_active_width[3]!=0)||(cur_active_width[4]!=0)||
(cur_active_width[5]!=0))
{b= 0;fit_class= decent_fit;
}
else{if(shortfall>7230584)if(cur_active_width[2]<1663497)
{b= inf_bad;fit_class= very_loose_fit;goto done1;
}
b= badness(shortfall,cur_active_width[2]);
if(b>12)
if(b>99)fit_class= very_loose_fit;
else fit_class= loose_fit;
else fit_class= decent_fit;
done1:;
}

	/*:851*/
	#line 16730 "ctex.w"

else	/*852:*/
	#line 16773 "ctex.w"

{if(-shortfall>cur_active_width[6])b= inf_bad+1;
else b= badness(-shortfall,cur_active_width[6]);
if(b>12)fit_class= tight_fit;else fit_class= decent_fit;
}

	/*:852*/
	#line 16732 "ctex.w"
;
if((b>inf_bad)||(pi==eject_penalty))
	/*853:*/
	#line 16788 "ctex.w"

{if(final_pass&&(minimum_demerits==awful_bad)&&
(link(r)==last_active)&&
(prev_r==active))
artificial_demerits= true;
else if(b>threshold)goto deactivate;
node_r_stays_active= false;
}

	/*:853*/
	#line 16735 "ctex.w"

else{prev_r= r;
if(b>threshold)goto resume;
node_r_stays_active= true;
}
	/*854:*/
	#line 16804 "ctex.w"

if(artificial_demerits)d= 0;
else	/*858:*/
	#line 16865 "ctex.w"

{d= line_penalty+b;
if(abs(d)>=10000)d= 100000000;else d= d*d;
if(pi!=0)
if(pi>0)d= d+pi*pi;
else if(pi>eject_penalty)d= d-pi*pi;
if((break_type==hyphenated)&&(type(r)==hyphenated))
if(cur_p!=null)d= d+double_hyphen_demerits;
else d= d+final_hyphen_demerits;
if(abs(fit_class-fitness(r))>1)d= d+adj_demerits;
}

	/*:858*/
	#line 16806 "ctex.w"
;
#ifdef STAT
if(tracing_paragraphs>0)
	/*855:*/
	#line 16820 "ctex.w"

{if(printed_node!=cur_p)
	/*856:*/
	#line 16842 "ctex.w"

{print_nl("");
if(cur_p==null)short_display(link(printed_node));
else{save_link= link(cur_p);
link(cur_p)= null;print_nl("");short_display(link(printed_node));
link(cur_p)= save_link;
}
printed_node= cur_p;
}

	/*:856*/
	#line 16822 "ctex.w"
;
print_nl("@");

if(cur_p==null)print_esc("par");
else if(type(cur_p)!=glue_node)
{if(type(cur_p)==penalty_node)print_esc("penalty");
else if(type(cur_p)==disc_node)print_esc("discretionary");
else if(type(cur_p)==kern_node)print_esc("kern");
else print_esc("math");
}
print(" via @@");
if(break_node(r)==null)print_char('0');
else print_int(serial(break_node(r)));
print(" b=");
if(b>inf_bad)print_char('*');else print_int(b);

print(" p=");print_int(pi);print(" d=");
if(artificial_demerits)print_char('*');else print_int(d);
}

	/*:855*/
	#line 16809 "ctex.w"
;
#endif

d= d+total_demerits(r);

if(d<=minimal_demerits[fit_class])
{minimal_demerits[fit_class]= d;
best_place[fit_class]= break_node(r);best_pl_line[fit_class]= l;
if(d<minimum_demerits)minimum_demerits= d;
}

	/*:854*/
	#line 16740 "ctex.w"
;
if(node_r_stays_active)goto resume;
deactivate:	/*859:*/
	#line 16887 "ctex.w"

link(prev_r)= link(r);free_node(r,active_node_size);
if(prev_r==active)	/*860:*/
	#line 16912 "ctex.w"

{r= link(active);
if(type(r)==delta_node)
{do_all_six(update_active);
do_all_six(copy_to_cur_active);
link(active)= link(r);free_node(r,delta_node_size);
}
}

	/*:860*/
	#line 16890 "ctex.w"

else if(type(prev_r)==delta_node)
{r= link(prev_r);
if(r==last_active)
{do_all_six(downdate_width);
link(prev_prev_r)= last_active;
free_node(prev_r,delta_node_size);prev_r= prev_prev_r;
}
else if(type(r)==delta_node)
{do_all_six(update_width);
do_all_six(combine_two_deltas);
link(prev_r)= link(r);free_node(r,delta_node_size);
}
}

	/*:859*/
	#line 16742 "ctex.w"
;
}

	/*:850*/
	#line 16339 "ctex.w"
;
}
end:;
#ifdef STAT
	/*857:*/
	#line 16857 "ctex.w"

if(cur_p==printed_node)if(cur_p!=null)if(type(cur_p)==disc_node)
{t= replace_count(cur_p);
while(t>0)
{decr(t);printed_node= link(printed_node);
}
}

	/*:857*/
	#line 16343 "ctex.w"
;
#endif

}

	/*:828*/	/*876:*/
	#line 17237 "ctex.w"

static void post_line_break(int final_widow_penalty)
{
pointer q,r,s;
bool disc_break;
bool post_disc_break;
scaled cur_width;
scaled cur_indent;
quarterword t;
int pen;
halfword cur_line;
	/*877:*/
	#line 17268 "ctex.w"

q= break_node(best_bet);cur_p= null;
do{r= q;q= prev_break(q);next_break(r)= cur_p;cur_p= r;
}while(!(q==null))

	/*:877*/
	#line 17248 "ctex.w"
;
cur_line= prev_graf+1;
do{	/*879:*/
	#line 17305 "ctex.w"

	/*880:*/
	#line 17317 "ctex.w"

q= cur_break(cur_p);disc_break= false;post_disc_break= false;
if(q!=null)
if(type(q)==glue_node)
{delete_glue_ref(glue_ptr(q));
glue_ptr(q)= right_skip;
subtype(q)= right_skip_code+1;add_glue_ref(right_skip);
goto done;
}
else{if(type(q)==disc_node)
	/*881:*/
	#line 17336 "ctex.w"

{t= replace_count(q);
	/*882:*/
	#line 17344 "ctex.w"

if(t==0)r= link(q);
else{r= q;
while(t>1)
{r= link(r);decr(t);
}
s= link(r);
r= link(s);link(s)= null;
flush_node_list(link(q));replace_count(q)= 0;
}

	/*:882*/
	#line 17338 "ctex.w"
;
if(post_break(q)!=null)	/*883:*/
	#line 17358 "ctex.w"

{s= post_break(q);
while(link(s)!=null)s= link(s);
link(s)= r;r= post_break(q);post_break(q)= null;post_disc_break= true;
}

	/*:883*/
	#line 17339 "ctex.w"
;
if(pre_break(q)!=null)	/*884:*/
	#line 17367 "ctex.w"

{s= pre_break(q);link(q)= s;
while(link(s)!=null)s= link(s);
pre_break(q)= null;q= s;
}

	/*:884*/
	#line 17340 "ctex.w"
;
link(q)= r;disc_break= true;
}

	/*:881*/
	#line 17327 "ctex.w"

else if((type(q)==math_node)||(type(q)==kern_node))width(q)= 0;
}
else{q= temp_head;
while(link(q)!=null)q= link(q);
}
	/*885:*/
	#line 17373 "ctex.w"

r= new_param_glue(right_skip_code);link(r)= link(q);link(q)= r;q= r

	/*:885*/
	#line 17333 "ctex.w"
;
done:

	/*:880*/
	#line 17307 "ctex.w"
;
	/*886:*/
	#line 17380 "ctex.w"

r= link(q);link(q)= null;q= link(temp_head);link(temp_head)= r;
if(left_skip!=zero_glue)
{r= new_param_glue(left_skip_code);
link(r)= q;q= r;
}

	/*:886*/
	#line 17308 "ctex.w"
;
	/*888:*/
	#line 17399 "ctex.w"

if(cur_line>last_special_line)
{cur_width= second_width;cur_indent= second_indent;
}
else if(par_shape_ptr==null)
{cur_width= first_width;cur_indent= first_indent;
}
else{cur_width= mem[par_shape_ptr+2*cur_line].sc;
cur_indent= mem[par_shape_ptr+2*cur_line-1].sc;
}
adjust_tail= adjust_head;just_box= hpack(q,cur_width,exactly);
shift_amount(just_box)= cur_indent

	/*:888*/
	#line 17309 "ctex.w"
;
	/*887:*/
	#line 17387 "ctex.w"

append_to_vlist(just_box);
if(adjust_head!=adjust_tail)
{link(tail)= link(adjust_head);tail= adjust_tail;
}
adjust_tail= null

	/*:887*/
	#line 17311 "ctex.w"
;
	/*889:*/
	#line 17419 "ctex.w"

if(cur_line+1!=best_line)
{pen= inter_line_penalty;
if(cur_line==prev_graf+1)pen= pen+club_penalty;
if(cur_line+2==best_line)pen= pen+final_widow_penalty;
if(disc_break)pen= pen+broken_penalty;
if(pen!=0)
{r= new_penalty(pen);
link(tail)= r;tail= r;
}
}

	/*:889*/
	#line 17312 "ctex.w"


	/*:879*/
	#line 17251 "ctex.w"
;
incr(cur_line);cur_p= next_break(cur_p);
if(cur_p!=null)if(!post_disc_break)
	/*878:*/
	#line 17280 "ctex.w"

{r= temp_head;
loop{q= link(r);
if(q==cur_break(cur_p))goto done1;


if(is_char_node(q))goto done1;
if(non_discardable(q))goto done1;
if(type(q)==kern_node)if(subtype(q)!=explicit)goto done1;
r= q;
}
done1:if(r!=temp_head)
{link(r)= null;flush_node_list(link(temp_head));
link(temp_head)= q;
}
}

	/*:878*/
	#line 17254 "ctex.w"
;
}while(!(cur_p==null));
if((cur_line!=best_line)||(link(temp_head)!=null))
confusion("line breaking");

prev_graf= best_line-1;
}

	/*:876*/	/*894:*/
	#line 17532 "ctex.w"

	/*905:*/
	#line 17760 "ctex.w"

static
small_number reconstitute(small_number j,small_number n,halfword bchar,halfword hchar)
{
pointer p;
pointer t;
four_quarters q;
halfword cur_rh;
halfword test_char;
scaled w;
font_index k;
hyphen_passed= 0;t= hold_head;w= 0;link(hold_head)= null;

	/*907:*/
	#line 17812 "ctex.w"

cur_l= qi(hu[j]);cur_q= t;
if(j==0)
{ligature_present= init_lig;p= init_list;
if(ligature_present)lft_hit= init_lft;
while(p>null)
{append_charnode_to_t(character(p));p= link(p);
}
}
else if(cur_l<non_char)append_charnode_to_t(cur_l);
lig_stack= null;set_cur_r

	/*:907*/
	#line 17773 "ctex.w"
;
resume:	/*908:*/
	#line 17828 "ctex.w"

if(cur_l==non_char)
{k= bchar_label[hf];
if(k==non_address)goto done;else q= font_info[k].qqqq;
}
else{q= char_info(hf,cur_l);
if(char_tag(q)!=lig_tag)goto done;
k= lig_kern_start(hf,q);q= font_info[k].qqqq;
if(skip_byte(q)>stop_flag)
{k= lig_kern_restart(hf,q);q= font_info[k].qqqq;
}
}
if(cur_rh<non_char)test_char= cur_rh;else test_char= cur_r;
loop{if(next_char(q)==test_char)if(skip_byte(q)<=stop_flag)
if(cur_rh<non_char)
{hyphen_passed= j;hchar= non_char;cur_rh= non_char;
goto resume;
}
else{if(hchar<non_char)if(odd(hyf[j]))
{hyphen_passed= j;hchar= non_char;
}
if(op_byte(q)<kern_flag)
	/*910:*/
	#line 17890 "ctex.w"

{if(cur_l==non_char)lft_hit= true;
if(j==n)if(lig_stack==null)rt_hit= true;
check_interrupt;
switch(op_byte(q)){
case qi(1):case qi(5):{cur_l= rem_byte(q);
ligature_present= true;
}break;
case qi(2):case qi(6):{cur_r= rem_byte(q);
if(lig_stack>null)character(lig_stack)= cur_r;
else{lig_stack= new_lig_item(cur_r);
if(j==n)bchar= non_char;
else{p= get_avail();lig_ptr(lig_stack)= p;
character(p)= qi(hu[j+1]);font(p)= hf;
}
}
}break;
case qi(3):{cur_r= rem_byte(q);
p= lig_stack;lig_stack= new_lig_item(cur_r);link(lig_stack)= p;
}break;
case qi(7):case qi(11):{wrap_lig(false);
cur_q= t;cur_l= rem_byte(q);ligature_present= true;
}break;
default:{cur_l= rem_byte(q);ligature_present= true;
if(lig_stack>null)pop_lig_stack
else if(j==n)goto done;
else{append_charnode_to_t(cur_r);incr(j);set_cur_r;
}
}
}
if(op_byte(q)>qi(4))if(op_byte(q)!=qi(7))goto done;
goto resume;
}

	/*:910*/
	#line 17851 "ctex.w"
;
w= char_kern(hf,q);goto done;
}
if(skip_byte(q)>=stop_flag)
if(cur_rh==non_char)goto done;
else{cur_rh= non_char;goto resume;
}
k= k+qo(skip_byte(q))+1;q= font_info[k].qqqq;
}
done:

	/*:908*/
	#line 17775 "ctex.w"
;
	/*909:*/
	#line 17880 "ctex.w"

wrap_lig(rt_hit);
if(w!=0)
{link(t)= new_kern(w);t= link(t);w= 0;
}
if(lig_stack>null)
{cur_q= t;cur_l= character(lig_stack);ligature_present= true;
pop_lig_stack;goto resume;
}

	/*:909*/
	#line 17777 "ctex.w"
;
return j;
}

	/*:905*/
	#line 17533 "ctex.w"

static void hyphenate(void)
{
	/*900:*/
	#line 17639 "ctex.w"

int i,j,l;
pointer q,r,s;
halfword bchar;

	/*:900*/	/*911:*/
	#line 17933 "ctex.w"

pointer major_tail,minor_tail;

ASCII_code c;
int c_loc;
int r_count;
pointer hyf_node;

	/*:911*/	/*921:*/
	#line 18108 "ctex.w"

trie_pointer z;
int v;

	/*:921*/	/*928:*/
	#line 18180 "ctex.w"

hyph_pointer h;
str_number k;
pool_pointer u;

	/*:928*/
	#line 17536 "ctex.w"

	/*922:*/
	#line 18117 "ctex.w"

for(j= 0;j<=hn;j++)hyf[j]= 0;
	/*929:*/
	#line 18189 "ctex.w"

h= hc[1];incr(hn);hc[hn]= cur_lang;
for(j= 2;j<=hn;j++)h= (h+h+hc[j])%hyph_size;
loop{	/*930:*/
	#line 18198 "ctex.w"

k= hyph_word[h];if(k==0)goto not_found;
if(length(k)<hn)goto not_found;
if(length(k)==hn)
{j= 1;u= str_start[k];
do{if(so(str_pool[u])<hc[j])goto not_found;
if(so(str_pool[u])>hc[j])goto done;
incr(j);incr(u);
}while(!(j>hn));
	/*931:*/
	#line 18212 "ctex.w"

s= hyph_list[h];
while(s!=null)
{hyf[info(s)]= 1;s= link(s);
}

	/*:931*/
	#line 18207 "ctex.w"
;
decr(hn);goto found;
}
done:

	/*:930*/
	#line 18193 "ctex.w"
;
if(h>0)decr(h);else h= hyph_size;
}
not_found:decr(hn)

	/*:929*/
	#line 18120 "ctex.w"
;
if(trie_char(cur_lang+1)!=qi(cur_lang))return;
hc[0]= 0;hc[hn+1]= 0;hc[hn+2]= 256;
for(j= 0;j<=hn-r_hyf+1;j++)
{z= trie_link(cur_lang+1)+hc[j];l= j;
while(hc[l]==qo(trie_char(z)))
{if(trie_op(z)!=min_quarterword)
	/*923:*/
	#line 18134 "ctex.w"

{v= trie_op(z);
do{v= v+op_start[cur_lang];i= l-hyf_distance[v];
if(hyf_num[v]>hyf[i])hyf[i]= hyf_num[v];
v= hyf_next[v];
}while(!(v==min_quarterword));
}

	/*:923*/
	#line 18127 "ctex.w"
;
incr(l);z= trie_link(z)+hc[l];
}
}
found:for(j= 0;j<=l_hyf-1;j++)hyf[j]= 0;
for(j= 0;j<=r_hyf-1;j++)hyf[hn-j]= 0

	/*:922*/
	#line 17537 "ctex.w"
;
	/*901:*/
	#line 17651 "ctex.w"

for(j= l_hyf;j<=hn-r_hyf;j++)if(odd(hyf[j]))goto found1;
return;
found1:

	/*:901*/
	#line 17538 "ctex.w"
;
	/*902:*/
	#line 17667 "ctex.w"

q= link(hb);link(hb)= null;r= link(ha);link(ha)= null;bchar= hyf_bchar;
if(is_char_node(ha))
if(font(ha)!=hf)goto found2;
else{init_list= ha;init_lig= false;hu[0]= qo(character(ha));
}
else if(type(ha)==ligature_node)
if(font(lig_char(ha))!=hf)goto found2;
else{init_list= lig_ptr(ha);init_lig= true;init_lft= (subtype(ha)>1);
hu[0]= qo(character(lig_char(ha)));
if(init_list==null)if(init_lft)
{hu[0]= 256;init_lig= false;
}
free_node(ha,small_node_size);
}
else{
if(!is_char_node(r))if(type(r)==ligature_node)
if(subtype(r)>1)goto found2;
j= 1;s= ha;init_list= null;goto common_ending;
}
s= cur_p;
while(link(s)!=ha)s= link(s);
j= 0;goto common_ending;
found2:s= ha;j= 0;hu[0]= 256;init_lig= false;init_list= null;
common_ending:flush_node_list(r);
	/*912:*/
	#line 17943 "ctex.w"

do{l= j;j= reconstitute(j,hn,bchar,qi(hyf_char))+1;
if(hyphen_passed==0)
{link(s)= link(hold_head);
while(link(s)>null)s= link(s);
if(odd(hyf[j-1]))
{l= j;hyphen_passed= j-1;link(hold_head)= null;
}
}
if(hyphen_passed>0)
	/*913:*/
	#line 17968 "ctex.w"

do{r= get_node(small_node_size);
link(r)= link(hold_head);type(r)= disc_node;
major_tail= r;r_count= 0;
while(link(major_tail)>null)advance_major_tail;
i= hyphen_passed;hyf[i]= 0;
	/*914:*/
	#line 17984 "ctex.w"

minor_tail= null;pre_break(r)= null;hyf_node= new_character(hf,hyf_char);
if(hyf_node!=null)
{incr(i);c= hu[i];hu[i]= hyf_char;free_avail(hyf_node);
}
while(l<=i)
{l= reconstitute(l,i,font_bchar[hf],non_char)+1;
if(link(hold_head)>null)
{if(minor_tail==null)pre_break(r)= link(hold_head);
else link(minor_tail)= link(hold_head);
minor_tail= link(hold_head);
while(link(minor_tail)>null)minor_tail= link(minor_tail);
}
}
if(hyf_node!=null)
{hu[i]= c;
l= i;decr(i);
}

	/*:914*/
	#line 17974 "ctex.w"
;
	/*915:*/
	#line 18005 "ctex.w"

minor_tail= null;post_break(r)= null;c_loc= 0;
if(bchar_label[hf]!=non_address)
{decr(l);c= hu[l];c_loc= l;hu[l]= 256;
}
while(l<j)
{do{l= reconstitute(l,hn,bchar,non_char)+1;
if(c_loc>0)
{hu[c_loc]= c;c_loc= 0;
}
if(link(hold_head)>null)
{if(minor_tail==null)post_break(r)= link(hold_head);
else link(minor_tail)= link(hold_head);
minor_tail= link(hold_head);
while(link(minor_tail)>null)minor_tail= link(minor_tail);
}
}while(!(l>=j));
while(l>j)
	/*916:*/
	#line 18026 "ctex.w"

{j= reconstitute(j,hn,bchar,non_char)+1;
link(major_tail)= link(hold_head);
while(link(major_tail)>null)advance_major_tail;
}

	/*:916*/
	#line 18023 "ctex.w"
;
}

	/*:915*/
	#line 17976 "ctex.w"
;
	/*917:*/
	#line 18036 "ctex.w"

if(r_count>127)
{link(s)= link(r);link(r)= null;flush_node_list(r);
}
else{link(s)= r;replace_count(r)= r_count;
}
s= major_tail

	/*:917*/
	#line 17977 "ctex.w"
;
hyphen_passed= j-1;link(hold_head)= null;
}while(!(!odd(hyf[j-1])))

	/*:913*/
	#line 17954 "ctex.w"
;
}while(!(j>hn));
link(s)= q

	/*:912*/
	#line 17692 "ctex.w"
;
flush_list(init_list)

	/*:902*/
	#line 17539 "ctex.w"
;
}

	/*:894*/	/*941:*/
	#line 18345 "ctex.w"

#ifdef INIT
	/*943:*/
	#line 18392 "ctex.w"

static quarterword new_trie_op(small_number d,small_number n,quarterword v)
{
int h;
quarterword u;
int l;
h= abs(n+313*d+361*v+1009*cur_lang)%(trie_op_size+trie_op_size)
-trie_op_size;
loop{l= trie_op_hash[h];
if(l==0)
{if(trie_op_ptr==trie_op_size)
overflow("pattern memory ops",trie_op_size);
u= trie_used[cur_lang];
if(u==max_quarterword)
overflow("pattern memory ops per language",
max_quarterword-min_quarterword);
incr(trie_op_ptr);incr(u);trie_used[cur_lang]= u;
hyf_distance[trie_op_ptr]= d;
hyf_num[trie_op_ptr]= n;hyf_next[trie_op_ptr]= v;
trie_op_lang[trie_op_ptr]= cur_lang;trie_op_hash[h]= trie_op_ptr;
trie_op_val[trie_op_ptr]= u;return u;
}
if((hyf_distance[l]==d)&&(hyf_num[l]==n)&&(hyf_next[l]==v)
&&(trie_op_lang[l]==cur_lang))
{return trie_op_val[l];
}
if(h>-trie_op_size)decr(h);else h= trie_op_size;
}
}

	/*:943*/	/*947:*/
	#line 18494 "ctex.w"

static trie_pointer trie_node(trie_pointer p)

{
trie_pointer h;
trie_pointer q;
h= abs(trie_c[p]+1009*trie_o[p]+
2718*trie_l[p]+3142*trie_r[p])%trie_size;
loop{q= trie_hash[h];
if(q==0)
{trie_hash[h]= p;return p;
}
if((trie_c[q]==trie_c[p])&&(trie_o[q]==trie_o[p])&&
(trie_l[q]==trie_l[p])&&(trie_r[q]==trie_r[p]))
{return q;
}
if(h>0)decr(h);else h= trie_size;
}
}

	/*:947*/	/*948:*/
	#line 18520 "ctex.w"

static trie_pointer compress_trie(trie_pointer p)
{if(p==0)return 0;
else{trie_l[p]= compress_trie(trie_l[p]);
trie_r[p]= compress_trie(trie_r[p]);
return trie_node(p);
}
}

	/*:948*/	/*952:*/
	#line 18591 "ctex.w"

static void first_fit(trie_pointer p)
{
trie_pointer h;
trie_pointer z;
trie_pointer q;
ASCII_code c;
trie_pointer l,r;
int ll;
c= so(trie_c[p]);
z= trie_min[c];
loop{h= z-c;
	/*953:*/
	#line 18616 "ctex.w"

if(trie_max<h+256)
{if(trie_size<=h+256)overflow("pattern memory",trie_size);

do{incr(trie_max);trie_taken[trie_max]= false;
trie_link(trie_max)= trie_max+1;trie_back(trie_max)= trie_max-1;
}while(!(trie_max==h+256));
}

	/*:953*/
	#line 18603 "ctex.w"
;
if(trie_taken[h])goto not_found;
	/*954:*/
	#line 18625 "ctex.w"

q= trie_r[p];
while(q>0)
{if(trie_link(h+so(trie_c[q]))==0)goto not_found;
q= trie_r[q];
}
goto found

	/*:954*/
	#line 18606 "ctex.w"
;
not_found:z= trie_link(z);
}
found:	/*955:*/
	#line 18633 "ctex.w"

trie_taken[h]= true;trie_ref[p]= h;q= p;
do{z= h+so(trie_c[q]);l= trie_back(z);r= trie_link(z);
trie_back(r)= l;trie_link(l)= r;trie_link(z)= 0;
if(l<256)
{if(z<256)ll= z;else ll= 256;
do{trie_min[l]= r;incr(l);
}while(!(l==ll));
}
q= trie_r[q];
}while(!(q==0))

	/*:955*/
	#line 18609 "ctex.w"
;
}

	/*:952*/	/*956:*/
	#line 18648 "ctex.w"

static void trie_pack(trie_pointer p)
{trie_pointer q;
do{q= trie_l[p];
if((q>0)&&(trie_ref[q]==0))
{first_fit(q);trie_pack(q);
}
p= trie_r[p];
}while(!(p==0));
}

	/*:956*/	/*958:*/
	#line 18684 "ctex.w"

static void trie_fix(trie_pointer p)
{trie_pointer q;
ASCII_code c;
trie_pointer z;
z= trie_ref[p];
do{q= trie_l[p];c= so(trie_c[p]);
trie_link(z+c)= trie_ref[q];trie_char(z+c)= qi(c);trie_op(z+c)= trie_o[p];
if(q>0)trie_fix(q);
p= trie_r[p];
}while(!(p==0));
}

	/*:958*/	/*959:*/
	#line 18701 "ctex.w"

static void new_patterns(void)
{
int k,l;

bool digit_sensed;
quarterword v;
trie_pointer p,q;
bool first_child;
ASCII_code c;
if(trie_not_ready)
{set_cur_lang;scan_left_brace();
	/*960:*/
	#line 18725 "ctex.w"

k= 0;hyf[0]= 0;digit_sensed= false;
loop{get_x_token();
switch(cur_cmd){
case letter:case other_char:	/*961:*/
	#line 18743 "ctex.w"

if(digit_sensed||(cur_chr<'0')||(cur_chr>'9'))
{if(cur_chr=='.')cur_chr= 0;
else{cur_chr= lc_code(cur_chr);
if(cur_chr==0)
{print_err("Nonletter");

help1("(See Appendix H.)");error();
}
}
if(k<63)
{incr(k);hc[k]= cur_chr;hyf[k]= 0;digit_sensed= false;
}
}
else if(k<63)
{hyf[k]= cur_chr-'0';digit_sensed= true;
}

	/*:961*/
	#line 18729 "ctex.w"
break;
case spacer:case right_brace:{if(k>0)
	/*962:*/
	#line 18765 "ctex.w"

{	/*964:*/
	#line 18793 "ctex.w"

if(hc[1]==0)hyf[0]= 0;
if(hc[k]==0)hyf[k]= 0;
l= k;v= min_quarterword;
loop{if(hyf[l]!=0)v= new_trie_op(k-l,hyf[l],v);
if(l>0)decr(l);else goto done1;
}
done1:

	/*:964*/
	#line 18766 "ctex.w"
;
q= 0;hc[0]= cur_lang;
while(l<=k)
{c= hc[l];incr(l);p= trie_l[q];first_child= true;
while((p>0)&&(c>so(trie_c[p])))
{q= p;p= trie_r[q];first_child= false;
}
if((p==0)||(c<so(trie_c[p])))
	/*963:*/
	#line 18785 "ctex.w"

{if(trie_ptr==trie_size)overflow("pattern memory",trie_size);

incr(trie_ptr);trie_r[trie_ptr]= p;p= trie_ptr;trie_l[p]= 0;
if(first_child)trie_l[q]= p;else trie_r[q]= p;
trie_c[p]= si(c);trie_o[p]= min_quarterword;
}

	/*:963*/
	#line 18774 "ctex.w"
;
q= p;
}
if(trie_o[q]!=min_quarterword)
{print_err("Duplicate pattern");

help1("(See Appendix H.)");error();
}
trie_o[q]= v;
}

	/*:962*/
	#line 18731 "ctex.w"
;
if(cur_cmd==right_brace)goto done;
k= 0;hyf[0]= 0;digit_sensed= false;
}break;
default:{print_err("Bad ");print_esc("patterns");

help1("(See Appendix H.)");error();
}
}
}
done:

	/*:960*/
	#line 18713 "ctex.w"
;
}
else{print_err("Too late for ");print_esc("patterns");
help1("All patterns must be given before typesetting begins.");
error();link(garbage)= scan_toks(false,false);flush_list(def_ref);
}
}

	/*:959*/	/*965:*/
	#line 18809 "ctex.w"

static void init_trie(void)
{int p;
int j,k,t;
int r,s;
two_halves h;
	/*951:*/
	#line 18576 "ctex.w"

	/*944:*/
	#line 18426 "ctex.w"

op_start[0]= -min_quarterword;
for(j= 1;j<=255;j++)op_start[j]= op_start[j-1]+qo(trie_used[j-1]);
for(j= 1;j<=trie_op_ptr;j++)
trie_op_hash[j]= op_start[trie_op_lang[j]]+trie_op_val[j];
for(j= 1;j<=trie_op_ptr;j++)while(trie_op_hash[j]>j)
{k= trie_op_hash[j];
t= hyf_distance[k];hyf_distance[k]= hyf_distance[j];hyf_distance[j]= t;
t= hyf_num[k];hyf_num[k]= hyf_num[j];hyf_num[j]= t;
t= hyf_next[k];hyf_next[k]= hyf_next[j];hyf_next[j]= t;
trie_op_hash[j]= trie_op_hash[k];trie_op_hash[k]= k;
}

	/*:944*/
	#line 18577 "ctex.w"
;
for(p= 0;p<=trie_size;p++)trie_hash[p]= 0;
trie_root= compress_trie(trie_root);
for(p= 0;p<=trie_ptr;p++)trie_ref[p]= 0;
for(p= 0;p<=255;p++)trie_min[p]= p+1;
trie_link(0)= 1;trie_max= 0

	/*:951*/
	#line 18815 "ctex.w"
;
if(trie_root!=0)
{first_fit(trie_root);trie_pack(trie_root);
}
	/*957:*/
	#line 18664 "ctex.w"

h.rh= 0;h.b0= min_quarterword;h.b1= min_quarterword;

if(trie_root==0)
{for(r= 0;r<=256;r++)trie[r]= h;
trie_max= 256;
}
else{trie_fix(trie_root);
r= 0;
do{s= trie_link(r);trie[r]= h;r= s;
}while(!(r>trie_max));
}
trie_char(0)= qi('?');

	/*:957*/
	#line 18819 "ctex.w"
;
trie_not_ready= false;
}

	/*:965*/
	#line 18347 "ctex.w"

#endif

	/*:941*/
	#line 16014 "ctex.w"

static void line_break(int final_widow_penalty)
{
	/*861:*/
	#line 16941 "ctex.w"

bool auto_breaking;
pointer prev_p;
pointer q,r,s,prev_s;
internal_font_number f;

	/*:861*/	/*892:*/
	#line 17513 "ctex.w"

small_number j;
int c;

	/*:892*/
	#line 16017 "ctex.w"

pack_begin_line= mode_line;
	/*815:*/
	#line 16038 "ctex.w"

link(temp_head)= link(head);
if(is_char_node(tail))tail_append(new_penalty(inf_penalty))
else if(type(tail)!=glue_node)tail_append(new_penalty(inf_penalty))
else{type(tail)= penalty_node;delete_glue_ref(glue_ptr(tail));
flush_node_list(leader_ptr(tail));penalty(tail)= inf_penalty;
}
link(tail)= new_param_glue(par_fill_skip_code);
init_cur_lang= prev_graf%0200000;
init_l_hyf= prev_graf/020000000;
init_r_hyf= (prev_graf/0200000)%0100;
pop_nest();

	/*:815*/	/*826:*/
	#line 16266 "ctex.w"

no_shrink_error_yet= true;
check_shrinkage(left_skip);check_shrinkage(right_skip);
q= left_skip;r= right_skip;background[1]= width(q)+width(r);
background[2]= 0;background[3]= 0;background[4]= 0;background[5]= 0;
background[2+stretch_order(q)]= stretch(q);
background[2+stretch_order(r)]= background[2+stretch_order(r)]+stretch(r);
background[6]= shrink(q)+shrink(r);

	/*:826*/	/*833:*/
	#line 16408 "ctex.w"

minimum_demerits= awful_bad;
minimal_demerits[tight_fit]= awful_bad;
minimal_demerits[decent_fit]= awful_bad;
minimal_demerits[loose_fit]= awful_bad;
minimal_demerits[very_loose_fit]= awful_bad;

	/*:833*/	/*847:*/
	#line 16669 "ctex.w"

if(par_shape_ptr==null)
if(hang_indent==0)
{last_special_line= 0;second_width= hsize;
second_indent= 0;
}
else	/*848:*/
	#line 16683 "ctex.w"

{last_special_line= abs(hang_after);
if(hang_after<0)
{first_width= hsize-abs(hang_indent);
if(hang_indent>=0)first_indent= hang_indent;
else first_indent= 0;
second_width= hsize;second_indent= 0;
}
else{first_width= hsize;first_indent= 0;
second_width= hsize-abs(hang_indent);
if(hang_indent>=0)second_indent= hang_indent;
else second_indent= 0;
}
}

	/*:848*/
	#line 16675 "ctex.w"

else{last_special_line= info(par_shape_ptr)-1;
second_width= mem[par_shape_ptr+2*(last_special_line+1)].sc;
second_indent= mem[par_shape_ptr+2*last_special_line+1].sc;
}
if(looseness==0)easy_line= last_special_line;
else easy_line= max_halfword

	/*:847*/
	#line 16019 "ctex.w"
;
	/*862:*/
	#line 16951 "ctex.w"

threshold= pretolerance;
if(threshold>=0)
{
#ifdef STAT
if(tracing_paragraphs>0)
{begin_diagnostic();print_nl("@firstpass");}
#endif

second_pass= false;final_pass= false;
}
else{threshold= tolerance;second_pass= true;
final_pass= (emergency_stretch<=0);
#ifdef STAT
if(tracing_paragraphs>0)begin_diagnostic();
#endif

}
loop{if(threshold>inf_bad)threshold= inf_bad;
if(second_pass)	/*890:*/
	#line 17486 "ctex.w"

{
#ifdef INIT
if(trie_not_ready)init_trie();
#endif

cur_lang= init_cur_lang;l_hyf= init_l_hyf;r_hyf= init_r_hyf;
}

	/*:890*/
	#line 16970 "ctex.w"
;
	/*863:*/
	#line 17009 "ctex.w"

q= get_node(active_node_size);
type(q)= unhyphenated;fitness(q)= decent_fit;
link(q)= last_active;break_node(q)= null;
line_number(q)= prev_graf+1;total_demerits(q)= 0;link(active)= q;
do_all_six(store_background);
passive= null;printed_node= temp_head;pass_number= 0;
font_in_short_display= null_font

	/*:863*/
	#line 16971 "ctex.w"
;
cur_p= link(temp_head);auto_breaking= true;
prev_p= cur_p;
while((cur_p!=null)&&(link(active)!=last_active))
	/*865:*/
	#line 17045 "ctex.w"

{if(is_char_node(cur_p))
	/*866:*/
	#line 17079 "ctex.w"

{prev_p= cur_p;
do{f= font(cur_p);
act_width= act_width+char_width(f,char_info(f,character(cur_p)));
cur_p= link(cur_p);
}while(!(!is_char_node(cur_p)));
}

	/*:866*/
	#line 17047 "ctex.w"
;
switch(type(cur_p)){
case hlist_node:case vlist_node:case rule_node:act_width= act_width+width(cur_p);break;
case whatsit_node:	/*1361:*/
	#line 24752 "ctex.w"

adv_past(cur_p)

	/*:1361*/
	#line 17050 "ctex.w"
break;
case glue_node:{	/*867:*/
	#line 17090 "ctex.w"

if(auto_breaking)
{if(is_char_node(prev_p))try_break(0,unhyphenated);
else if(precedes_break(prev_p))try_break(0,unhyphenated);
else if((type(prev_p)==kern_node)&&(subtype(prev_p)!=explicit))
try_break(0,unhyphenated);
}
check_shrinkage(glue_ptr(cur_p));q= glue_ptr(cur_p);
act_width= act_width+width(q);
active_width[2+stretch_order(q)]= 
active_width[2+stretch_order(q)]+stretch(q);
active_width[6]= active_width[6]+shrink(q)

	/*:867*/
	#line 17052 "ctex.w"
;
if(second_pass&&auto_breaking)
	/*893:*/
	#line 17520 "ctex.w"

{prev_s= cur_p;s= link(prev_s);
if(s!=null)
{	/*895:*/
	#line 17545 "ctex.w"

loop{if(is_char_node(s))
{c= qo(character(s));hf= font(s);
}
else if(type(s)==ligature_node)
if(lig_ptr(s)==null)goto resume;
else{q= lig_ptr(s);c= qo(character(q));hf= font(q);
}
else if((type(s)==kern_node)&&(subtype(s)==normal))goto resume;
else if(type(s)==whatsit_node)
{	/*1362:*/
	#line 24755 "ctex.w"

adv_past(s)

	/*:1362*/
	#line 17555 "ctex.w"
;
goto resume;
}
else goto done1;
if(lc_code(c)!=0)
if((lc_code(c)==c)||(uc_hyph>0))goto done2;
else goto done1;
resume:prev_s= s;s= link(prev_s);
}
done2:hyf_char= hyphen_char[hf];
if(hyf_char<0)goto done1;
if(hyf_char>255)goto done1;
ha= prev_s

	/*:895*/
	#line 17523 "ctex.w"
;
if(l_hyf+r_hyf>63)goto done1;
	/*896:*/
	#line 17571 "ctex.w"

hn= 0;
loop{if(is_char_node(s))
{if(font(s)!=hf)goto done3;
hyf_bchar= character(s);c= qo(hyf_bchar);
if(lc_code(c)==0)goto done3;
if(hn==63)goto done3;
hb= s;incr(hn);hu[hn]= c;hc[hn]= lc_code(c);hyf_bchar= non_char;
}
else if(type(s)==ligature_node)
	/*897:*/
	#line 17597 "ctex.w"

{if(font(lig_char(s))!=hf)goto done3;
j= hn;q= lig_ptr(s);if(q>null)hyf_bchar= character(q);
while(q>null)
{c= qo(character(q));
if(lc_code(c)==0)goto done3;
if(j==63)goto done3;
incr(j);hu[j]= c;hc[j]= lc_code(c);
q= link(q);
}
hb= s;hn= j;
if(odd(subtype(s)))hyf_bchar= font_bchar[hf];else hyf_bchar= non_char;
}

	/*:897*/
	#line 17582 "ctex.w"

else if((type(s)==kern_node)&&(subtype(s)==normal))
{hb= s;
hyf_bchar= font_bchar[hf];
}
else goto done3;
s= link(s);
}
done3:

	/*:896*/
	#line 17525 "ctex.w"
;
	/*898:*/
	#line 17611 "ctex.w"

if(hn<l_hyf+r_hyf)goto done1;
loop{if(!(is_char_node(s)))
switch(type(s)){
case ligature_node:do_nothing;break;
case kern_node:if(subtype(s)!=normal)goto done4;break;
case whatsit_node:case glue_node:case penalty_node:case ins_node:case adjust_node:case mark_node:
goto done4;
default:goto done1;
}
s= link(s);
}
done4:

	/*:898*/
	#line 17527 "ctex.w"
;
hyphenate();
}
done1:;}

	/*:893*/
	#line 17054 "ctex.w"
;
}break;
case kern_node:if(subtype(cur_p)==explicit)kern_break
else act_width= act_width+width(cur_p);break;
case ligature_node:{f= font(lig_char(cur_p));
act_width= act_width+char_width(f,char_info(f,character(lig_char(cur_p))));
}break;
case disc_node:	/*868:*/
	#line 17106 "ctex.w"

{s= pre_break(cur_p);disc_width= 0;
if(s==null)try_break(ex_hyphen_penalty,hyphenated);
else{do{	/*869:*/
	#line 17124 "ctex.w"

if(is_char_node(s))
{f= font(s);
disc_width= disc_width+char_width(f,char_info(f,character(s)));
}
else switch(type(s)){
case ligature_node:{f= font(lig_char(s));
disc_width= disc_width+
char_width(f,char_info(f,character(lig_char(s))));
}break;
case hlist_node:case vlist_node:case rule_node:case kern_node:
disc_width= disc_width+width(s);break;
default:confusion("disc3");

}

	/*:869*/
	#line 17109 "ctex.w"
;
s= link(s);
}while(!(s==null));
act_width= act_width+disc_width;
try_break(hyphen_penalty,hyphenated);
act_width= act_width-disc_width;
}
r= replace_count(cur_p);s= link(cur_p);
while(r>0)
{	/*870:*/
	#line 17140 "ctex.w"

if(is_char_node(s))
{f= font(s);
act_width= act_width+char_width(f,char_info(f,character(s)));
}
else switch(type(s)){
case ligature_node:{f= font(lig_char(s));
act_width= act_width+
char_width(f,char_info(f,character(lig_char(s))));
}break;
case hlist_node:case vlist_node:case rule_node:case kern_node:
act_width= act_width+width(s);break;
default:confusion("disc4");

}

	/*:870*/
	#line 17118 "ctex.w"
;
decr(r);s= link(s);
}
prev_p= cur_p;cur_p= s;goto done5;
}

	/*:868*/
	#line 17061 "ctex.w"

case math_node:{auto_breaking= (subtype(cur_p)==after);kern_break;
}break;
case penalty_node:try_break(penalty(cur_p),unhyphenated);break;
case mark_node:case ins_node:case adjust_node:do_nothing;break;
default:confusion("paragraph");

}
prev_p= cur_p;cur_p= link(cur_p);
done5:;}

	/*:865*/
	#line 16977 "ctex.w"
;
if(cur_p==null)
	/*872:*/
	#line 17175 "ctex.w"

{try_break(eject_penalty,hyphenated);
if(link(active)!=last_active)
{	/*873:*/
	#line 17185 "ctex.w"

r= link(active);fewest_demerits= awful_bad;
do{if(type(r)!=delta_node)if(total_demerits(r)<fewest_demerits)
{fewest_demerits= total_demerits(r);best_bet= r;
}
r= link(r);
}while(!(r==last_active));
best_line= line_number(best_bet)

	/*:873*/
	#line 17178 "ctex.w"
;
if(looseness==0)goto done;
	/*874:*/
	#line 17199 "ctex.w"

{r= link(active);actual_looseness= 0;
do{if(type(r)!=delta_node)
{line_diff= line_number(r)-best_line;
if(((line_diff<actual_looseness)&&(looseness<=line_diff))||
((line_diff>actual_looseness)&&(looseness>=line_diff)))
{best_bet= r;actual_looseness= line_diff;
fewest_demerits= total_demerits(r);
}
else if((line_diff==actual_looseness)&&
(total_demerits(r)<fewest_demerits))
{best_bet= r;fewest_demerits= total_demerits(r);
}
}
r= link(r);
}while(!(r==last_active));
best_line= line_number(best_bet);
}

	/*:874*/
	#line 17180 "ctex.w"
;
if((actual_looseness==looseness)||final_pass)goto done;
}
}

	/*:872*/
	#line 16980 "ctex.w"
;
	/*864:*/
	#line 17018 "ctex.w"

q= link(active);
while(q!=last_active)
{cur_p= link(q);
if(type(q)==delta_node)free_node(q,delta_node_size);
else free_node(q,active_node_size);
q= cur_p;
}
q= passive;
while(q!=null)
{cur_p= link(q);
free_node(q,passive_node_size);
q= cur_p;
}

	/*:864*/
	#line 16981 "ctex.w"
;
if(!second_pass)
{
#ifdef STAT
if(tracing_paragraphs>0)print_nl("@secondpass");
#endif
threshold= tolerance;second_pass= true;final_pass= (emergency_stretch<=0);
}
else{
#ifdef STAT
if(tracing_paragraphs>0)
print_nl("@emergencypass");
#endif
background[2]= background[2]+emergency_stretch;final_pass= true;
}
}
done:
#ifdef STAT
if(tracing_paragraphs>0)
{end_diagnostic(true);normalize_selector();
}
#endif

	/*:862*/
	#line 16020 "ctex.w"
;
	/*875:*/
	#line 17223 "ctex.w"

post_line_break(final_widow_penalty)

	/*:875*/
	#line 16022 "ctex.w"
;
	/*864:*/
	#line 17018 "ctex.w"

q= link(active);
while(q!=last_active)
{cur_p= link(q);
if(type(q)==delta_node)free_node(q,delta_node_size);
else free_node(q,active_node_size);
q= cur_p;
}
q= passive;
while(q!=null)
{cur_p= link(q);
free_node(q,passive_node_size);
q= cur_p;
}

	/*:864*/
	#line 16023 "ctex.w"
;
pack_begin_line= 0;
}

	/*:814*/	/*933:*/
	#line 18236 "ctex.w"
static void new_hyph_exceptions(void)
{
int n;
int j;
hyph_pointer h;
str_number k;
pointer p;
pointer q;
str_number s,t;
pool_pointer u,v;
scan_left_brace();
set_cur_lang;
	/*934:*/
	#line 18252 "ctex.w"

n= 0;p= null;
loop{get_x_token();
reswitch:switch(cur_cmd){
case letter:case other_char:case char_given:	/*936:*/
	#line 18277 "ctex.w"

if(cur_chr=='-')	/*937:*/
	#line 18291 "ctex.w"

{if(n<63)
{q= get_avail();link(q)= p;info(q)= n;p= q;
}
}

	/*:937*/
	#line 18278 "ctex.w"

else{if(lc_code(cur_chr)==0)
{print_err("Not a letter");

help2("Letters in \\hyphenation words must have \\lccode>0.",
"Proceed; I'll ignore the character I just read.");
error();
}
else if(n<63)
{incr(n);hc[n]= lc_code(cur_chr);
}
}

	/*:936*/
	#line 18256 "ctex.w"
break;
case char_num:{scan_char_num();cur_chr= cur_val;cur_cmd= char_given;
goto reswitch;
}
case spacer:case right_brace:{if(n>1)	/*938:*/
	#line 18297 "ctex.w"

{incr(n);hc[n]= cur_lang;str_room(n);h= 0;
for(j= 1;j<=n;j++)
{h= (h+h+hc[j])%hyph_size;
append_char(hc[j]);
}
s= make_string();
	/*939:*/
	#line 18307 "ctex.w"

if(hyph_count==hyph_size)overflow("exception dictionary",hyph_size);

incr(hyph_count);
while(hyph_word[h]!=0)
{	/*940:*/
	#line 18318 "ctex.w"

k= hyph_word[h];
if(length(k)<length(s))goto found;
if(length(k)>length(s))goto not_found;
u= str_start[k];v= str_start[s];
do{if(str_pool[u]<str_pool[v])goto found;
if(str_pool[u]>str_pool[v])goto not_found;
incr(u);incr(v);
}while(!(u==str_start[k+1]));
found:q= hyph_list[h];hyph_list[h]= p;p= q;
t= hyph_word[h];hyph_word[h]= s;s= t;
not_found:

	/*:940*/
	#line 18313 "ctex.w"
;
if(h>0)decr(h);else h= hyph_size;
}
hyph_word[h]= s;hyph_list[h]= p

	/*:939*/
	#line 18304 "ctex.w"
;
}

	/*:938*/
	#line 18260 "ctex.w"
;
if(cur_cmd==right_brace)return;
n= 0;p= null;
}break;
default:	/*935:*/
	#line 18268 "ctex.w"

{print_err("Improper ");print_esc("hyphenation");

print(" will be flushed");
help2("Hyphenation exceptions must contain only letters",
"and hyphens. But continue; I'll forgive and forget.");
error();
}

	/*:935*/
	#line 18264 "ctex.w"

}
}

	/*:934*/
	#line 18249 "ctex.w"
;
}

	/*:933*/	/*967:*/
	#line 18842 "ctex.w"
static pointer prune_page_top(pointer p)
{pointer prev_p;
pointer q;
prev_p= temp_head;link(temp_head)= p;
while(p!=null)
switch(type(p)){
case hlist_node:case vlist_node:case rule_node:	/*968:*/
	#line 18861 "ctex.w"

{q= new_skip_param(split_top_skip_code);link(prev_p)= q;link(q)= p;

if(width(temp_ptr)>height(p))width(temp_ptr)= width(temp_ptr)-height(p);
else width(temp_ptr)= 0;
p= null;
}

	/*:968*/
	#line 18849 "ctex.w"
break;
case whatsit_node:case mark_node:case ins_node:{prev_p= p;p= link(prev_p);
}break;
case glue_node:case kern_node:case penalty_node:{q= p;p= link(q);link(q)= null;
link(prev_p)= p;flush_node_list(q);
}break;
default:confusion("pruning");

}
return link(temp_head);
}

	/*:967*/	/*969:*/
	#line 18885 "ctex.w"
static pointer vert_break(pointer p,scaled h,scaled d)

{
pointer prev_p;

pointer q,r;
int pi;
int b;
int least_cost;
pointer best_place;
scaled prev_dp;
small_number t;
prev_p= p;
least_cost= awful_bad;do_all_six(set_height_zero);prev_dp= 0;
loop{	/*971:*/
	#line 18919 "ctex.w"

if(p==null)pi= eject_penalty;
else	/*972:*/
	#line 18934 "ctex.w"

switch(type(p)){
case hlist_node:case vlist_node:case rule_node:{
cur_height= cur_height+prev_dp+height(p);prev_dp= depth(p);
goto not_found;
}
case whatsit_node:	/*1364:*/
	#line 24761 "ctex.w"

goto not_found

	/*:1364*/
	#line 18940 "ctex.w"
;
case glue_node:if(precedes_break(prev_p))pi= 0;
else goto update_heights;break;
case kern_node:{if(link(p)==null)t= penalty_node;
else t= type(link(p));
if(t==glue_node)pi= 0;else goto update_heights;
}break;
case penalty_node:pi= penalty(p);break;
case mark_node:case ins_node:goto not_found;
default:confusion("vertbreak");

}

	/*:972*/
	#line 18923 "ctex.w"
;
	/*973:*/
	#line 18955 "ctex.w"

if(pi<inf_penalty)
{	/*974:*/
	#line 18969 "ctex.w"

if(cur_height<h)
if((active_height[3]!=0)||(active_height[4]!=0)||
(active_height[5]!=0))b= 0;
else b= badness(h-cur_height,active_height[2]);
else if(cur_height-h>active_height[6])b= awful_bad;
else b= badness(cur_height-h,active_height[6])

	/*:974*/
	#line 18957 "ctex.w"
;
if(b<awful_bad)
if(pi<=eject_penalty)b= pi;
else if(b<inf_bad)b= b+pi;
else b= deplorable;
if(b<=least_cost)
{best_place= p;least_cost= b;
best_height_plus_depth= cur_height+prev_dp;
}
if((b==awful_bad)||(pi<=eject_penalty))goto done;
}

	/*:973*/
	#line 18925 "ctex.w"
;
if((type(p)<glue_node)||(type(p)>kern_node))goto not_found;
update_heights:	/*975:*/
	#line 18981 "ctex.w"

if(type(p)==kern_node)q= p;
else{q= glue_ptr(p);
active_height[2+stretch_order(q)]= 
active_height[2+stretch_order(q)]+stretch(q);
active_height[6]= active_height[6]+shrink(q);
if((shrink_order(q)!=normal)&&(shrink(q)!=0))
{
print_err("Infinite glue shrinkage found in box being split");

help4("The box you are \\vsplitting contains some infinitely",
"shrinkable glue, e.g., `\\vss' or `\\vskip 0pt minus 1fil'.",
"Such glue doesn't belong there; but you can safely proceed,",
"since the offensive shrinkability has been made finite.");
error();r= new_spec(q);shrink_order(r)= normal;delete_glue_ref(q);
glue_ptr(p)= r;q= r;
}
}
cur_height= cur_height+prev_dp+width(q);prev_dp= 0

	/*:975*/
	#line 18928 "ctex.w"
;
not_found:if(prev_dp>d)
{cur_height= cur_height+prev_dp-d;
prev_dp= d;
}

	/*:971*/
	#line 18901 "ctex.w"
;
prev_p= p;p= link(prev_p);
}
done:return best_place;
}

	/*:969*/	/*976:*/
	#line 19016 "ctex.w"
static pointer vsplit(eight_bits n,scaled h)

{
pointer v;
pointer p;
pointer q;
v= box(n);
if(split_first_mark!=null)
{delete_token_ref(split_first_mark);split_first_mark= null;
delete_token_ref(split_bot_mark);split_bot_mark= null;
}
	/*977:*/
	#line 19037 "ctex.w"

if(v==null)
{return null;
}
if(type(v)!=vlist_node)
{print_err("");print_esc("vsplit");print(" needs a ");
print_esc("vbox");

help2("The box you are trying to split is an \\hbox.",
"I can't split such a box, so I'll leave it alone.");
error();return null;
}

	/*:977*/
	#line 19027 "ctex.w"
;
q= vert_break(list_ptr(v),h,split_max_depth);
	/*978:*/
	#line 19053 "ctex.w"

p= list_ptr(v);
if(p==q)list_ptr(v)= null;
else loop{if(type(p)==mark_node)
if(split_first_mark==null)
{split_first_mark= mark_ptr(p);
split_bot_mark= split_first_mark;
token_ref_count(split_first_mark)= 
token_ref_count(split_first_mark)+2;
}
else{delete_token_ref(split_bot_mark);
split_bot_mark= mark_ptr(p);
add_token_ref(split_bot_mark);
}
if(link(p)==q)
{link(p)= null;goto done;
}
p= link(p);
}
done:

	/*:978*/
	#line 19030 "ctex.w"
;
q= prune_page_top(q);p= list_ptr(v);free_node(v,box_node_size);
if(q==null)box(n)= null;
else box(n)= vpack(q,natural);
return vpackage(p,h,exactly,split_max_depth);
}

	/*:976*/	/*984:*/
	#line 19240 "ctex.w"
static void print_totals(void)
{print_scaled(page_total);
print_plus(2,"");
print_plus(3,"fil");
print_plus(4,"fill");
print_plus(5,"filll");
if(page_shrink!=0)
{print(" minus ");print_scaled(page_shrink);
}
}

	/*:984*/	/*986:*/
	#line 19286 "ctex.w"
static void freeze_page_specs(small_number s)
{page_contents= s;
page_goal= vsize;page_max_depth= max_depth;
page_depth= 0;do_all_six(set_page_so_far_zero);
least_page_cost= awful_bad;
#ifdef STAT
if(tracing_pages>0)
{begin_diagnostic();
print_nl("%% goal height=");print_scaled(page_goal);

print(", max depth=");print_scaled(page_max_depth);
end_diagnostic(false);
}
#endif

}

	/*:986*/	/*991:*/
	#line 19353 "ctex.w"
static void box_error(eight_bits n)
{error();begin_diagnostic();
print_nl("The following box has been deleted:");

show_box(box(n));end_diagnostic(true);
flush_node_list(box(n));box(n)= null;
}

	/*:991*/	/*992:*/
	#line 19364 "ctex.w"
static void ensure_vbox(eight_bits n)
{pointer p;
p= box(n);
if(p!=null)if(type(p)==hlist_node)
{print_err("Insertions can only be added to a vbox");

help3("Tut tut: You're trying to \\insert into a",
"\\box register that now contains an \\hbox.",
"Proceed, and I'll discard its present contents.");
box_error(n);
}
}

	/*:992*/	/*993:*/
	#line 19383 "ctex.w"
	/*1011:*/
	#line 19677 "ctex.w"

static void fire_up(pointer c)
{
pointer p,q,r,s;
pointer prev_p;
int n;
bool wait;
int save_vbadness;
scaled save_vfuzz;
pointer save_split_top_skip;
	/*1012:*/
	#line 19706 "ctex.w"

if(type(best_page_break)==penalty_node)
{geq_word_define(int_base+output_penalty_code,penalty(best_page_break));
penalty(best_page_break)= inf_penalty;
}
else geq_word_define(int_base+output_penalty_code,inf_penalty)

	/*:1012*/
	#line 19687 "ctex.w"
;
if(bot_mark!=null)
{if(top_mark!=null)delete_token_ref(top_mark);
top_mark= bot_mark;add_token_ref(top_mark);
delete_token_ref(first_mark);first_mark= null;
}
	/*1013:*/
	#line 19718 "ctex.w"

if(c==best_page_break)best_page_break= null;
	/*1014:*/
	#line 19740 "ctex.w"

if(box(255)!=null)
{print_err("");print_esc("box");print("255 is not void");

help2("You shouldn't use \\box255 except in \\output routines.",
"Proceed, and I'll discard its present contents.");
box_error(255);
}

	/*:1014*/
	#line 19720 "ctex.w"
;
insert_penalties= 0;
save_split_top_skip= split_top_skip;
if(holding_inserts<=0)
	/*1017:*/
	#line 19794 "ctex.w"

{r= link(page_ins_head);
while(r!=page_ins_head)
{if(best_ins_ptr(r)!=null)
{n= qo(subtype(r));ensure_vbox(n);
if(box(n)==null)box(n)= new_null_box();
p= box(n)+list_offset;
while(link(p)!=null)p= link(p);
last_ins_ptr(r)= p;
}
r= link(r);
}
}

	/*:1017*/
	#line 19724 "ctex.w"
;
q= hold_head;link(q)= null;prev_p= page_head;p= link(prev_p);
while(p!=best_page_break)
{if(type(p)==ins_node)
{if(holding_inserts<=0)
	/*1019:*/
	#line 19820 "ctex.w"

{r= link(page_ins_head);
while(subtype(r)!=subtype(p))r= link(r);
if(best_ins_ptr(r)==null)wait= true;
else{wait= false;s= last_ins_ptr(r);link(s)= ins_ptr(p);
if(best_ins_ptr(r)==p)
	/*1020:*/
	#line 19836 "ctex.w"

{if(type(r)==split_up)
if((broken_ins(r)==p)&&(broken_ptr(r)!=null))
{while(link(s)!=broken_ptr(r))s= link(s);
link(s)= null;
split_top_skip= split_top_ptr(p);
ins_ptr(p)= prune_page_top(broken_ptr(r));
if(ins_ptr(p)!=null)
{temp_ptr= vpack(ins_ptr(p),natural);
height(p)= height(temp_ptr)+depth(temp_ptr);
free_node(temp_ptr,box_node_size);wait= true;
}
}
best_ins_ptr(r)= null;
n= qo(subtype(r));
temp_ptr= list_ptr(box(n));
free_node(box(n),box_node_size);
box(n)= vpack(temp_ptr,natural);
}

	/*:1020*/
	#line 19827 "ctex.w"

else{while(link(s)!=null)s= link(s);
last_ins_ptr(r)= s;
}
}
	/*1021:*/
	#line 19856 "ctex.w"

link(prev_p)= link(p);link(p)= null;
if(wait)
{link(q)= p;q= p;incr(insert_penalties);
}
else{delete_glue_ref(split_top_ptr(p));
free_node(p,ins_node_size);
}
p= prev_p

	/*:1021*/
	#line 19833 "ctex.w"
;
}

	/*:1019*/
	#line 19730 "ctex.w"
;
}
else if(type(p)==mark_node)	/*1015:*/
	#line 19749 "ctex.w"

{if(first_mark==null)
{first_mark= mark_ptr(p);
add_token_ref(first_mark);
}
if(bot_mark!=null)delete_token_ref(bot_mark);
bot_mark= mark_ptr(p);add_token_ref(bot_mark);
}

	/*:1015*/
	#line 19732 "ctex.w"
;
prev_p= p;p= link(prev_p);
}
split_top_skip= save_split_top_skip;
	/*1016:*/
	#line 19769 "ctex.w"

if(p!=null)
{if(link(contrib_head)==null)
if(nest_ptr==0)tail= page_tail;
else contrib_tail= page_tail;
link(page_tail)= link(contrib_head);
link(contrib_head)= p;
link(prev_p)= null;
}
save_vbadness= vbadness;vbadness= inf_bad;
save_vfuzz= vfuzz;vfuzz= max_dimen;
box(255)= vpackage(link(page_head),best_size,exactly,page_max_depth);
vbadness= save_vbadness;vfuzz= save_vfuzz;
if(last_glue!=max_halfword)delete_glue_ref(last_glue);
	/*990:*/
	#line 19343 "ctex.w"

page_contents= empty;page_tail= page_head;link(page_head)= null;
last_glue= max_halfword;last_penalty= 0;last_kern= 0;
page_depth= 0;page_max_depth= 0

	/*:990*/
	#line 19783 "ctex.w"
;
if(q!=hold_head)
{link(page_head)= link(hold_head);page_tail= q;
}

	/*:1016*/
	#line 19737 "ctex.w"
;
	/*1018:*/
	#line 19808 "ctex.w"

r= link(page_ins_head);
while(r!=page_ins_head)
{q= link(r);free_node(r,page_ins_node_size);r= q;
}
link(page_ins_head)= page_ins_head

	/*:1018*/
	#line 19738 "ctex.w"


	/*:1013*/
	#line 19695 "ctex.w"
;
if((top_mark!=null)&&(first_mark==null))
{first_mark= top_mark;add_token_ref(top_mark);
}
if(output_routine!=null)
if(dead_cycles>=max_dead_cycles)
	/*1023:*/
	#line 19881 "ctex.w"

{print_err("Output loop---");print_int(dead_cycles);

print(" consecutive dead cycles");
help3("I've concluded that your \\output is awry; it never does a",
"\\shipout, so I'm shipping \\box255 out myself. Next time",
"increase \\maxdeadcycles if you want me to be more patient!");error();
}

	/*:1023*/
	#line 19701 "ctex.w"

else	/*1024:*/
	#line 19890 "ctex.w"

{output_active= true;
incr(dead_cycles);
push_nest();mode= -vmode;prev_depth= ignore_depth;mode_line= -line;
begin_token_list(output_routine,output_text);
new_save_level(output_group);normal_paragraph();
scan_left_brace();
return;
}

	/*:1024*/
	#line 19702 "ctex.w"
;
	/*1022:*/
	#line 19870 "ctex.w"

{if(link(page_head)!=null)
{if(link(contrib_head)==null)
if(nest_ptr==0)tail= page_tail;else contrib_tail= page_tail;
else link(page_tail)= link(contrib_head);
link(contrib_head)= link(page_head);
link(page_head)= null;page_tail= page_head;
}
ship_out(box(255));box(255)= null;
}

	/*:1022*/
	#line 19703 "ctex.w"
;
}

	/*:1011*/
	#line 19383 "ctex.w"

static void build_page(void)
{
pointer p;
pointer q,r;
int b,c;
int pi;
int n;
scaled delta,h,w;
if((link(contrib_head)==null)||output_active)return;
do{resume:p= link(contrib_head);
	/*995:*/
	#line 19408 "ctex.w"

if(last_glue!=max_halfword)delete_glue_ref(last_glue);
last_penalty= 0;last_kern= 0;
if(type(p)==glue_node)
{last_glue= glue_ptr(p);add_glue_ref(last_glue);
}
else{last_glue= max_halfword;
if(type(p)==penalty_node)last_penalty= penalty(p);
else if(type(p)==kern_node)last_kern= width(p);
}

	/*:995*/
	#line 19394 "ctex.w"
;
	/*996:*/
	#line 19425 "ctex.w"

	/*999:*/
	#line 19453 "ctex.w"

switch(type(p)){
case hlist_node:case vlist_node:case rule_node:if(page_contents<box_there)
	/*1000:*/
	#line 19474 "ctex.w"

{if(page_contents==empty)freeze_page_specs(box_there);
else page_contents= box_there;
q= new_skip_param(top_skip_code);
if(width(temp_ptr)>height(p))width(temp_ptr)= width(temp_ptr)-height(p);
else width(temp_ptr)= 0;
link(q)= p;link(contrib_head)= q;goto resume;
}

	/*:1000*/
	#line 19457 "ctex.w"

else	/*1001:*/
	#line 19483 "ctex.w"

{page_total= page_total+page_depth+height(p);
page_depth= depth(p);
goto contribute;
}

	/*:1001*/
	#line 19458 "ctex.w"
break;
case whatsit_node:	/*1363:*/
	#line 24758 "ctex.w"

goto contribute

	/*:1363*/
	#line 19459 "ctex.w"
;
case glue_node:if(page_contents<box_there)goto done1;
else if(precedes_break(page_tail))pi= 0;
else goto update_heights;break;
case kern_node:if(page_contents<box_there)goto done1;
else if(link(p)==null)return;
else if(type(link(p))==glue_node)pi= 0;
else goto update_heights;break;
case penalty_node:if(page_contents<box_there)goto done1;else pi= penalty(p);break;
case mark_node:goto contribute;
case ins_node:	/*1007:*/
	#line 19569 "ctex.w"

{if(page_contents==empty)freeze_page_specs(inserts_only);
n= subtype(p);r= page_ins_head;
while(n>=subtype(link(r)))r= link(r);
n= qo(n);
if(subtype(r)!=qi(n))
	/*1008:*/
	#line 19597 "ctex.w"

{q= get_node(page_ins_node_size);link(q)= link(r);link(r)= q;r= q;
subtype(r)= qi(n);type(r)= inserting;ensure_vbox(n);
if(box(n)==null)height(r)= 0;
else height(r)= height(box(n))+depth(box(n));
best_ins_ptr(r)= null;
q= skip(n);
if(count(n)==1000)h= height(r);
else h= x_over_n(height(r),1000)*count(n);
page_goal= page_goal-h-width(q);
page_so_far[2+stretch_order(q)]= page_so_far[2+stretch_order(q)]+stretch(q);
page_shrink= page_shrink+shrink(q);
if((shrink_order(q)!=normal)&&(shrink(q)!=0))
{print_err("Infinite glue shrinkage inserted from ");print_esc("skip");

print_int(n);
help3("The correction glue for page breaking with insertions",
"must have finite shrinkability. But you may proceed,",
"since the offensive shrinkability has been made finite.");
error();
}
}

	/*:1008*/
	#line 19576 "ctex.w"
;
if(type(r)==split_up)insert_penalties= insert_penalties+float_cost(p);
else{last_ins_ptr(r)= p;
delta= page_goal-page_total-page_depth+page_shrink;

if(count(n)==1000)h= height(p);
else h= x_over_n(height(p),1000)*count(n);
if(((h<=0)||(h<=delta))&&(height(p)+height(r)<=dimen(n)))
{page_goal= page_goal-h;height(r)= height(r)+height(p);
}
else	/*1009:*/
	#line 19630 "ctex.w"

{if(count(n)<=0)w= max_dimen;
else{w= page_goal-page_total-page_depth;
if(count(n)!=1000)w= x_over_n(w,count(n))*1000;
}
if(w>dimen(n)-height(r))w= dimen(n)-height(r);
q= vert_break(ins_ptr(p),w,depth(p));
height(r)= height(r)+best_height_plus_depth;
#ifdef STAT
if(tracing_pages>0)	/*1010:*/
	#line 19650 "ctex.w"

{begin_diagnostic();print_nl("% split");print_int(n);

print(" to ");print_scaled(w);
print_char(',');print_scaled(best_height_plus_depth);
print(" p=");
if(q==null)print_int(eject_penalty);
else if(type(q)==penalty_node)print_int(penalty(q));
else print_char('0');
end_diagnostic(false);
}

	/*:1010*/
	#line 19639 "ctex.w"
;
#endif

if(count(n)!=1000)
best_height_plus_depth= x_over_n(best_height_plus_depth,1000)*count(n);
page_goal= page_goal-best_height_plus_depth;
type(r)= split_up;broken_ptr(r)= q;broken_ins(r)= p;
if(q==null)insert_penalties= insert_penalties+eject_penalty;
else if(type(q)==penalty_node)insert_penalties= insert_penalties+penalty(q);
}

	/*:1009*/
	#line 19586 "ctex.w"
;
}
goto contribute;
}

	/*:1007*/
	#line 19469 "ctex.w"

default:confusion("page");

}

	/*:999*/
	#line 19429 "ctex.w"
;
	/*1004:*/
	#line 19517 "ctex.w"

if(pi<inf_penalty)
{	/*1006:*/
	#line 19561 "ctex.w"

if(page_total<page_goal)
if((page_so_far[3]!=0)||(page_so_far[4]!=0)||
(page_so_far[5]!=0))b= 0;
else b= badness(page_goal-page_total,page_so_far[2]);
else if(page_total-page_goal>page_shrink)b= awful_bad;
else b= badness(page_total-page_goal,page_shrink)

	/*:1006*/
	#line 19520 "ctex.w"
;
if(b<awful_bad)
if(pi<=eject_penalty)c= pi;
else if(b<inf_bad)c= b+pi+insert_penalties;
else c= deplorable;
else c= b;
if(insert_penalties>=10000)c= awful_bad;
#ifdef STAT
if(tracing_pages>0)	/*1005:*/
	#line 19547 "ctex.w"

{begin_diagnostic();print_nl("%");
print(" t=");print_totals();
print(" g=");print_scaled(page_goal);
print(" b=");
if(b==awful_bad)print_char('*');else print_int(b);

print(" p=");print_int(pi);
print(" c=");
if(c==awful_bad)print_char('*');else print_int(c);
if(c<=least_page_cost)print_char('#');
end_diagnostic(false);
}

	/*:1005*/
	#line 19528 "ctex.w"
;
#endif

if(c<=least_page_cost)
{best_page_break= p;best_size= page_goal;
least_page_cost= c;
r= link(page_ins_head);
while(r!=page_ins_head)
{best_ins_ptr(r)= last_ins_ptr(r);
r= link(r);
}
}
if((c==awful_bad)||(pi<=eject_penalty))
{fire_up(p);
if(output_active)return;
goto done;
}
}

	/*:1004*/
	#line 19432 "ctex.w"
;
if((type(p)<glue_node)||(type(p)>kern_node))goto contribute;
update_heights:	/*1003:*/
	#line 19496 "ctex.w"

if(type(p)==kern_node)q= p;
else{q= glue_ptr(p);
page_so_far[2+stretch_order(q)]= 
page_so_far[2+stretch_order(q)]+stretch(q);
page_shrink= page_shrink+shrink(q);
if((shrink_order(q)!=normal)&&(shrink(q)!=0))
{
print_err("Infinite glue shrinkage found on current page");

help4("The page about to be output contains some infinitely",
"shrinkable glue, e.g., `\\vss' or `\\vskip 0pt minus 1fil'.",
"Such glue doesn't belong there; but you can safely proceed,",
"since the offensive shrinkability has been made finite.");
error();
r= new_spec(q);shrink_order(r)= normal;delete_glue_ref(q);
glue_ptr(p)= r;q= r;
}
}
page_total= page_total+page_depth+width(q);page_depth= 0

	/*:1003*/
	#line 19435 "ctex.w"
;
contribute:	/*1002:*/
	#line 19489 "ctex.w"

if(page_depth>page_max_depth)
{page_total= 
page_total+page_depth-page_max_depth;
page_depth= page_max_depth;
}

	/*:1002*/
	#line 19436 "ctex.w"
;
	/*997:*/
	#line 19441 "ctex.w"

link(page_tail)= p;page_tail= p;
link(contrib_head)= link(p);link(p)= null;goto done

	/*:997*/
	#line 19437 "ctex.w"
;
done1:	/*998:*/
	#line 19445 "ctex.w"

link(contrib_head)= link(p);link(p)= null;flush_node_list(p)

	/*:998*/
	#line 19438 "ctex.w"
;
done:

	/*:996*/
	#line 19397 "ctex.w"
;
}while(!(link(contrib_head)==null));
	/*994:*/
	#line 19404 "ctex.w"

if(nest_ptr==0)tail= contrib_head;
else contrib_tail= contrib_head

	/*:994*/
	#line 19399 "ctex.w"
;
}

	/*:993*/	/*1029:*/
	#line 19989 "ctex.w"
	/*1042:*/
	#line 20315 "ctex.w"

static void app_space(void)
{pointer q;
if((space_factor>=2000)&&(xspace_skip!=zero_glue))
q= new_param_glue(xspace_skip_code);
else{if(space_skip!=zero_glue)main_p= space_skip;
else	/*1041:*/
	#line 20304 "ctex.w"

{main_p= font_glue[cur_font];
if(main_p==null)
{main_p= new_spec(zero_glue);main_k= param_base[cur_font]+space_code;
width(main_p)= font_info[main_k].sc;
stretch(main_p)= font_info[main_k+1].sc;
shrink(main_p)= font_info[main_k+2].sc;
font_glue[cur_font]= main_p;
}
}

	/*:1041*/
	#line 20321 "ctex.w"
;
main_p= new_spec(main_p);
	/*1043:*/
	#line 20329 "ctex.w"

if(space_factor>=2000)width(main_p)= width(main_p)+extra_space(cur_font);
stretch(main_p)= xn_over_d(stretch(main_p),space_factor,1000);
shrink(main_p)= xn_over_d(shrink(main_p),1000,space_factor)

	/*:1043*/
	#line 20323 "ctex.w"
;
q= new_glue(main_p);glue_ref_count(main_p)= null;
}
link(tail)= q;tail= q;
}

	/*:1042*/	/*1046:*/
	#line 20367 "ctex.w"

static void insert_dollar_sign(void)
{back_input();cur_tok= math_shift_token+'$';
print_err("Missing $ inserted");

help2("I've inserted a begin-math/end-math symbol since I think",
"you left one out. Proceed, with fingers crossed.");ins_error();
}

	/*:1046*/	/*1048:*/
	#line 20392 "ctex.w"

static void you_cant(void)
{print_err("You can't use `");

print_cmd_chr(cur_cmd,cur_chr);
print("' in ");print_mode(mode);
}

	/*:1048*/	/*1049:*/
	#line 20400 "ctex.w"

static void report_illegal_case(void)
{you_cant();
help4("Sorry, but I'm not programmed to handle this case;",
"I'll just pretend that you didn't ask for it.",
"If you're in the wrong mode, you might be able to",
"return to the right one by typing `I}' or `I$' or `I\\par'.");
error();
}

	/*:1049*/	/*1050:*/
	#line 20415 "ctex.w"

static bool privileged(void)
{if(mode>0)return true;
else{report_illegal_case();return false;
}
}

	/*:1050*/	/*1053:*/
	#line 20442 "ctex.w"

static bool its_all_over(void)
{
if(privileged())
{if((page_head==page_tail)&&(head==tail)&&(dead_cycles==0))
{return true;
}
back_input();
tail_append(new_null_box());
width(tail)= hsize;
tail_append(new_glue(fill_glue));
tail_append(new_penalty(-010000000000));
build_page();
}
return false;
}

	/*:1053*/	/*1059:*/
	#line 20552 "ctex.w"

static void append_glue(void)
{small_number s;
s= cur_chr;
switch(s){
case fil_code:cur_val= fil_glue;break;
case fill_code:cur_val= fill_glue;break;
case ss_code:cur_val= ss_glue;break;
case fil_neg_code:cur_val= fil_neg_glue;break;
case skip_code:scan_glue(glue_val);break;
case mskip_code:scan_glue(mu_val);
}
tail_append(new_glue(cur_val));
if(s>=skip_code)
{decr(glue_ref_count(cur_val));
if(s>skip_code)subtype(tail)= mu_glue;
}
}

	/*:1059*/	/*1060:*/
	#line 20571 "ctex.w"

static void append_kern(void)
{quarterword s;
s= cur_chr;scan_dimen(s==mu_glue,false,false);
tail_append(new_kern(cur_val));subtype(tail)= s;
}

	/*:1060*/	/*1063:*/
	#line 20615 "ctex.w"

static void off_save(void)
{pointer p;
if(cur_group==bottom_level)
	/*1065:*/
	#line 20654 "ctex.w"

{print_err("Extra ");print_cmd_chr(cur_cmd,cur_chr);

help1("Things are pretty mixed up, but I think the worst is over.");
error();
}

	/*:1065*/
	#line 20619 "ctex.w"

else{back_input();p= get_avail();link(temp_head)= p;
print_err("Missing ");
	/*1064:*/
	#line 20635 "ctex.w"

switch(cur_group){
case semi_simple_group:{info(p)= cs_token_flag+frozen_end_group;
print_esc("endgroup");

}break;
case math_shift_group:{info(p)= math_shift_token+'$';print_char('$');

}break;
case math_left_group:{info(p)= cs_token_flag+frozen_right;link(p)= get_avail();
p= link(p);info(p)= other_token+'.';print_esc("right.");


}break;
default:{info(p)= right_brace_token+'}';print_char('}');

}
}

	/*:1064*/
	#line 20622 "ctex.w"
;
print(" inserted");ins_list(link(temp_head));
help5("I've inserted something that you may have forgotten.",
"(See the <inserted text> above.)",
"With luck, this will get me unwedged. But if you",
"really didn't forget anything, try typing `2' now; then",
"my insertion and my current dilemma will both disappear.");
error();
}
}

	/*:1063*/	/*1068:*/
	#line 20690 "ctex.w"

static void extra_right_brace(void)
{print_err("Extra }, or forgotten ");

switch(cur_group){
case semi_simple_group:print_esc("endgroup");break;
case math_shift_group:print_char('$');break;
case math_left_group:print_esc("right");
}
help5("I've deleted a group-closing symbol because it seems to be",
"spurious, as in `$x}$'. But perhaps the } is legitimate and",
"you forgot something else, as in `\\hbox{$x}'. In such cases",
"the way to recover is to insert both the forgotten and the",
"deleted material, e.g., by typing `I$}'.");error();
incr(align_state);
}

	/*:1068*/	/*1069:*/
	#line 20710 "ctex.w"

static void normal_paragraph(void)
{if(looseness!=0)eq_word_define(int_base+looseness_code,0);
if(hang_indent!=0)eq_word_define(dimen_base+hang_indent_code,0);
if(hang_after!=1)eq_word_define(int_base+hang_after_code,1);
if(par_shape_ptr!=null)eq_define(par_shape_loc,shape_ref,null);
}

	/*:1069*/	/*1074:*/
	#line 20831 "ctex.w"

static void box_end(int box_context)
{pointer p;
if(box_context<box_flag)	/*1075:*/
	#line 20846 "ctex.w"

{if(cur_box!=null)
{shift_amount(cur_box)= box_context;
if(abs(mode)==vmode)
{append_to_vlist(cur_box);
if(adjust_tail!=null)
{if(adjust_head!=adjust_tail)
{link(tail)= link(adjust_head);tail= adjust_tail;
}
adjust_tail= null;
}
if(mode>0)build_page();
}
else{if(abs(mode)==hmode)space_factor= 1000;
else{p= new_noad();
math_type(nucleus(p))= sub_box;
info(nucleus(p))= cur_box;cur_box= p;
}
link(tail)= cur_box;tail= cur_box;
}
}
}

	/*:1075*/
	#line 20835 "ctex.w"

else if(box_context<ship_out_flag)	/*1076:*/
	#line 20869 "ctex.w"

if(box_context<box_flag+256)
eq_define(box_base-box_flag+box_context,box_ref,cur_box);
else geq_define(box_base-box_flag-256+box_context,box_ref,cur_box)

	/*:1076*/
	#line 20836 "ctex.w"
;
else if(cur_box!=null)
if(box_context>ship_out_flag)	/*1077:*/
	#line 20874 "ctex.w"

{	/*403:*/
	#line 8189 "ctex.w"

do{get_x_token();
}while(!((cur_cmd!=spacer)&&(cur_cmd!=relax)))

	/*:403*/
	#line 20875 "ctex.w"
;
if(((cur_cmd==hskip)&&(abs(mode)!=vmode))||
((cur_cmd==vskip)&&(abs(mode)==vmode)))
{append_glue();subtype(tail)= box_context-(leader_flag-a_leaders);
leader_ptr(tail)= cur_box;
}
else{print_err("Leaders not followed by proper glue");

help3("You should say `\\leaders <box or rule><hskip or vskip>'.",
"I found the <box or rule>, but there's no suitable",
"<hskip or vskip>, so I'm ignoring these leaders.");back_error();
flush_node_list(cur_box);
}
}

	/*:1077*/
	#line 20838 "ctex.w"

else ship_out(cur_box);
}

	/*:1074*/	/*1078:*/
	#line 20895 "ctex.w"

static void begin_box(int box_context)
{
pointer p,q;
int m;
halfword k;
eight_bits n;
switch(cur_chr){
case box_code:{scan_eight_bit_int();cur_box= box(cur_val);
box(cur_val)= null;
}break;
case copy_code:{scan_eight_bit_int();cur_box= copy_node_list(box(cur_val));
}break;
case last_box_code:	/*1079:*/
	#line 20919 "ctex.w"

{cur_box= null;
if(abs(mode)==mmode)
{you_cant();help1("Sorry; this \\lastbox will be void.");error();
}
else if((mode==vmode)&&(head==tail))
{you_cant();
help2("Sorry...I usually can't take things from the current page.",
"This \\lastbox will therefore be void.");error();
}
else{if(!is_char_node(tail))
if((type(tail)==hlist_node)||(type(tail)==vlist_node))
	/*1080:*/
	#line 20935 "ctex.w"

{q= head;
do{p= q;
if(!is_char_node(q))if(type(q)==disc_node)
{for(m= 1;m<=replace_count(q);m++)p= link(p);
if(p==tail)goto done;
}
q= link(p);
}while(!(q==tail));
cur_box= tail;shift_amount(cur_box)= 0;
tail= p;link(p)= null;
done:;}

	/*:1080*/
	#line 20931 "ctex.w"
;
}
}

	/*:1079*/
	#line 20909 "ctex.w"
break;
case vsplit_code:	/*1081:*/
	#line 20950 "ctex.w"

{scan_eight_bit_int();n= cur_val;
if(!scan_keyword("to"))

{print_err("Missing `to' inserted");

help2("I'm working on `\\vsplit<box number> to <dimen>';",
"will look for the <dimen> next.");error();
}
scan_normal_dimen;
cur_box= vsplit(n,cur_val);
}

	/*:1081*/
	#line 20910 "ctex.w"
break;
default:	/*1082:*/
	#line 20966 "ctex.w"

{k= cur_chr-vtop_code;saved(0)= box_context;
if(k==hmode)
if((box_context<box_flag)&&(abs(mode)==vmode))
scan_spec(adjusted_hbox_group,true);
else scan_spec(hbox_group,true);
else{if(k==vmode)scan_spec(vbox_group,true);
else{scan_spec(vtop_group,true);k= vmode;
}
normal_paragraph();
}
push_nest();mode= -k;
if(k==vmode)
{prev_depth= ignore_depth;
if(every_vbox!=null)begin_token_list(every_vbox,every_vbox_text);
}
else{space_factor= 1000;
if(every_hbox!=null)begin_token_list(every_hbox,every_hbox_text);
}
return;
}

	/*:1082*/
	#line 20911 "ctex.w"

}
box_end(box_context);
}

	/*:1078*/	/*1083:*/
	#line 20988 "ctex.w"

static void scan_box(int box_context)

{	/*403:*/
	#line 8189 "ctex.w"

do{get_x_token();
}while(!((cur_cmd!=spacer)&&(cur_cmd!=relax)))

	/*:403*/
	#line 20991 "ctex.w"
;
if(cur_cmd==make_box)begin_box(box_context);
else if((box_context>=leader_flag)&&((cur_cmd==hrule)||(cur_cmd==vrule)))
{cur_box= scan_rule_spec();box_end(box_context);
}
else{
print_err("A <box> was supposed to be here");

help3("I was expecting to see \\hbox or \\vbox or \\copy or \\box or",
"something like that. So you might find something missing in",
"your output. But keep trying; you can fix this later.");back_error();
}
}

	/*:1083*/	/*1085:*/
	#line 21018 "ctex.w"

static void package(small_number c)
{scaled h;
pointer p;
scaled d;
d= box_max_depth;unsave();save_ptr= save_ptr-3;
if(mode==-hmode)cur_box= hpack(link(head),saved(2),saved(1));
else{cur_box= vpackage(link(head),saved(2),saved(1),d);
if(c==vtop_code)	/*1086:*/
	#line 21036 "ctex.w"

{h= 0;p= list_ptr(cur_box);
if(p!=null)if(type(p)<=rule_node)h= height(p);
depth(cur_box)= depth(cur_box)-h+height(cur_box);height(cur_box)= h;
}

	/*:1086*/
	#line 21026 "ctex.w"
;
}
pop_nest();box_end(saved(0));
}

	/*:1085*/	/*1090:*/
	#line 21064 "ctex.w"

static small_number norm_min(int h)
{if(h<=0)return 1;else if(h>=63)return 63;
else return h;
}

static void new_graf(bool indented)
{prev_graf= 0;
if((mode==vmode)||(head!=tail))
tail_append(new_param_glue(par_skip_code));
push_nest();mode= hmode;space_factor= 1000;set_cur_lang;clang= cur_lang;
prev_graf= (norm_min(left_hyphen_min)*0100+norm_min(right_hyphen_min))
*0200000+cur_lang;
if(indented)
{tail= new_null_box();link(head)= tail;width(tail)= par_indent;
}
if(every_par!=null)begin_token_list(every_par,every_par_text);
if(nest_ptr==1)build_page();
}

	/*:1090*/	/*1092:*/
	#line 21087 "ctex.w"

static void indent_in_hmode(void)
{pointer p,q;
if(cur_chr>0)
{p= new_null_box();width(p)= par_indent;
if(abs(mode)==hmode)space_factor= 1000;
else{q= new_noad();math_type(nucleus(q))= sub_box;
info(nucleus(q))= p;p= q;
}
tail_append(p);
}
}

	/*:1092*/	/*1094:*/
	#line 21115 "ctex.w"

static void head_for_vmode(void)
{if(mode<0)
if(cur_cmd!=hrule)off_save();
else{print_err("You can't use `");
print_esc("hrule");print("' here except with leaders");

help2("To put a horizontal rule in an hbox or an alignment,",
"you should use \\leaders or \\hrulefill (see The TeXbook).");
error();
}
else{back_input();cur_tok= par_token;back_input();token_type= inserted;
}
}

	/*:1094*/	/*1095:*/
	#line 21130 "ctex.w"

static void end_graf(void)
{if(mode==hmode)
{if(head==tail)pop_nest();
else line_break(widow_penalty);
normal_paragraph();
error_count= 0;
}
}

	/*:1095*/	/*1098:*/
	#line 21150 "ctex.w"

static void begin_insert_or_adjust(void)
{if(cur_cmd==vadjust)cur_val= 255;
else{scan_eight_bit_int();
if(cur_val==255)
{print_err("You can't ");print_esc("insert");print_int(255);

help1("I'm changing to \\insert0; box 255 is special.");
error();cur_val= 0;
}
}
saved(0)= cur_val;incr(save_ptr);
new_save_level(insert_group);scan_left_brace();normal_paragraph();
push_nest();mode= -vmode;prev_depth= ignore_depth;
}

	/*:1098*/	/*1100:*/
	#line 21187 "ctex.w"

static void make_mark(void)
{pointer p;
p= scan_toks(false,true);p= get_node(small_node_size);
type(p)= mark_node;subtype(p)= 0;
mark_ptr(p)= def_ref;link(tail)= p;tail= p;
}

	/*:1100*/	/*1102:*/
	#line 21201 "ctex.w"

static void append_penalty(void)
{scan_int();tail_append(new_penalty(cur_val));
if(mode==vmode)build_page();
}

	/*:1102*/	/*1104:*/
	#line 21220 "ctex.w"

static void delete_last(void)
{
pointer p,q;
int m;
if((mode==vmode)&&(tail==head))
	/*1105:*/
	#line 21241 "ctex.w"

{if((cur_chr!=glue_node)||(last_glue!=max_halfword))
{you_cant();
help2("Sorry...I usually can't take things from the current page.",
"Try `I\\vskip-\\lastskip' instead.");
if(cur_chr==kern_node)help_line[0]= 
("Try `I\\kern-\\lastkern' instead.");
else if(cur_chr!=glue_node)help_line[0]= 
("Perhaps you can make the output routine do it.");
error();
}
}

	/*:1105*/
	#line 21226 "ctex.w"

else{if(!is_char_node(tail))if(type(tail)==cur_chr)
{q= head;
do{p= q;
if(!is_char_node(q))if(type(q)==disc_node)
{for(m= 1;m<=replace_count(q);m++)p= link(p);
if(p==tail)return;
}
q= link(p);
}while(!(q==tail));
link(p)= null;flush_node_list(tail);tail= p;
}
}
}

	/*:1104*/	/*1109:*/
	#line 21284 "ctex.w"

static void unpackage(void)
{
pointer p;
int c;
c= cur_chr;scan_eight_bit_int();p= box(cur_val);
if(p==null)return;
if((abs(mode)==mmode)||((abs(mode)==vmode)&&(type(p)!=vlist_node))||
((abs(mode)==hmode)&&(type(p)!=hlist_node)))
{print_err("Incompatible list can't be unboxed");

help3("Sorry, Pandora. (You sneaky devil.)",
"I refuse to unbox an \\hbox in vertical mode or vice versa.",
"And I can't open any boxes in math mode.");
error();return;
}
if(c==copy_code)link(tail)= copy_node_list(list_ptr(p));
else{link(tail)= list_ptr(p);box(cur_val)= null;
free_node(p,box_node_size);
}
while(link(tail)!=null)tail= link(tail);
}

	/*:1109*/	/*1112:*/
	#line 21317 "ctex.w"

static void append_italic_correction(void)
{
pointer p;
internal_font_number f;
if(tail!=head)
{if(is_char_node(tail))p= tail;
else if(type(tail)==ligature_node)p= lig_char(tail);
else return;
f= font(p);
tail_append(new_kern(char_italic(f,char_info(f,character(p)))));
subtype(tail)= explicit;
}
}

	/*:1112*/	/*1116:*/
	#line 21351 "ctex.w"

static void append_discretionary(void)
{int c;
tail_append(new_disc());
if(cur_chr==1)
{c= hyphen_char[cur_font];
if(c>=0)if(c<256)pre_break(tail)= new_character(cur_font,c);
}
else{incr(save_ptr);saved(-1)= 0;new_save_level(disc_group);
scan_left_brace();push_nest();mode= -hmode;space_factor= 1000;
}
}

	/*:1116*/	/*1118:*/
	#line 21371 "ctex.w"

static void build_discretionary(void)
{
pointer p,q;
int n;
unsave();
	/*1120:*/
	#line 21413 "ctex.w"

q= head;p= link(q);n= 0;
while(p!=null)
{if(!is_char_node(p))if(type(p)>rule_node)
if(type(p)!=kern_node)if(type(p)!=ligature_node)
{print_err("Improper discretionary list");

help1("Discretionary lists must contain only boxes and kerns.");
error();
begin_diagnostic();
print_nl("The following discretionary sublist has been deleted:");

show_box(p);
end_diagnostic(true);
flush_node_list(p);link(q)= null;goto done;
}
q= p;p= link(q);incr(n);
}
done:

	/*:1120*/
	#line 21379 "ctex.w"
;
p= link(head);pop_nest();
switch(saved(-1)){
case 0:pre_break(tail)= p;break;
case 1:post_break(tail)= p;break;
case 2:	/*1119:*/
	#line 21391 "ctex.w"

{if((n>0)&&(abs(mode)==mmode))
{print_err("Illegal math ");print_esc("discretionary");

help2("Sorry: The third part of a discretionary break must be",
"empty, in math formulas. I had to delete your third part.");
flush_node_list(p);n= 0;error();
}
else link(tail)= p;
if(n<=max_quarterword)replace_count(tail)= n;
else{print_err("Discretionary list is too long");

help2("Wow---I never thought anybody would tweak me here.",
"You can't seriously need such a huge discretionary list?");
error();
}
if(n>0)tail= q;
decr(save_ptr);return;
}

	/*:1119*/
	#line 21385 "ctex.w"
;
}
incr(saved(-1));new_save_level(disc_group);scan_left_brace();
push_nest();mode= -hmode;space_factor= 1000;
}

	/*:1118*/	/*1122:*/
	#line 21447 "ctex.w"

static void make_accent(void)
{double s,t;
pointer p,q,r;
internal_font_number f;
scaled a,h,x,w,delta;
four_quarters i;
scan_char_num();f= cur_font;p= new_character(f,cur_val);
if(p!=null)
{x= x_height(f);s= slant(f)/float_constant(65536);

a= char_width(f,char_info(f,character(p)));
do_assignments();
	/*1123:*/
	#line 21467 "ctex.w"

q= null;f= cur_font;
if((cur_cmd==letter)||(cur_cmd==other_char)||(cur_cmd==char_given))
q= new_character(f,cur_chr);
else if(cur_cmd==char_num)
{scan_char_num();q= new_character(f,cur_val);
}
else back_input()

	/*:1123*/
	#line 21461 "ctex.w"
;
if(q!=null)	/*1124:*/
	#line 21483 "ctex.w"

{t= slant(f)/float_constant(65536);

i= char_info(f,character(q));
w= char_width(f,i);h= char_height(f,height_depth(i));
if(h!=x)
{p= hpack(p,natural);shift_amount(p)= x-h;
}
delta= round((w-a)/float_constant(2)+h*t-x*s);


r= new_kern(delta);subtype(r)= acc_kern;link(tail)= r;link(r)= p;
tail= new_kern(-a-delta);subtype(tail)= acc_kern;link(p)= tail;p= q;
}

	/*:1124*/
	#line 21462 "ctex.w"
;
link(tail)= p;tail= p;space_factor= 1000;
}
}

	/*:1122*/	/*1126:*/
	#line 21511 "ctex.w"

static void align_error(void)
{if(abs(align_state)>2)
	/*1127:*/
	#line 21531 "ctex.w"

{print_err("Misplaced ");print_cmd_chr(cur_cmd,cur_chr);



if(cur_tok==tab_token+'&')
{help6("I can't figure out why you would want to use a tab mark",
"here. If you just want an ampersand, the remedy is",
"simple: Just type `I\\&' now. But if some right brace",
"up above has ended a previous alignment prematurely,",
"you're probably due for more error messages, and you",
"might try typing `S' now just to see what is salvageable.");
}
else{help5("I can't figure out why you would want to use a tab mark",
"or \\cr or \\span just now. If something like a right brace",
"up above has ended a previous alignment prematurely,",
"you're probably due for more error messages, and you",
"might try typing `S' now just to see what is salvageable.");
}
error();
}

	/*:1127*/
	#line 21514 "ctex.w"

else{back_input();
if(align_state<0)
{print_err("Missing { inserted");

incr(align_state);cur_tok= left_brace_token+'{';
}
else{print_err("Missing } inserted");

decr(align_state);cur_tok= right_brace_token+'}';
}
help3("I've put in what seems to be necessary to fix",
"the current column of the current alignment.",
"Try to go on, since this might almost work.");ins_error();
}
}

	/*:1126*/	/*1128:*/
	#line 21556 "ctex.w"

static void no_align_error(void)
{print_err("Misplaced ");print_esc("noalign");

help2("I expect to see \\noalign only after the \\cr of",
"an alignment. Proceed, and I'll ignore this case.");error();
}
static void omit_error(void)
{print_err("Misplaced ");print_esc("omit");

help2("I expect to see \\omit only after tab marks or the \\cr of",
"an alignment. Proceed, and I'll ignore this case.");error();
}

	/*:1128*/	/*1130:*/
	#line 21586 "ctex.w"

static void do_endv(void)
{base_ptr= input_ptr;input_stack[base_ptr]= cur_input;
while((input_stack[base_ptr].index_field!=v_template)&&
(input_stack[base_ptr].loc_field==null)&&
(input_stack[base_ptr].state_field==token_list))decr(base_ptr);
if((input_stack[base_ptr].index_field!=v_template)||
(input_stack[base_ptr].loc_field!=null)||
(input_stack[base_ptr].state_field!=token_list))
fatal_error("(interwoven alignment preambles are not allowed)");

if(cur_group==align_group)
{end_graf();
if(fin_col())fin_row();
}
else off_save();
}

	/*:1130*/	/*1134:*/
	#line 21621 "ctex.w"

static void cs_error(void)
{print_err("Extra ");print_esc("endcsname");

help1("I'm ignoring this, since I wasn't doing a \\csname.");
error();
}

	/*:1134*/	/*1135:*/
	#line 21639 "ctex.w"

static void push_math(group_code c)
{push_nest();mode= -mmode;incompleat_noad= null;new_save_level(c);
}

	/*:1135*/	/*1137:*/
	#line 21652 "ctex.w"

static void init_math(void)
{
scaled w;
scaled l;
scaled s;
pointer p;
pointer q;
internal_font_number f;
int n;
scaled v;
scaled d;
get_token();
if((cur_cmd==math_shift)&&(mode>0))	/*1144:*/
	#line 21710 "ctex.w"

{if(head==tail)
{pop_nest();w= -max_dimen;
}
else{line_break(display_widow_penalty);
	/*1145:*/
	#line 21730 "ctex.w"

v= shift_amount(just_box)+2*quad(cur_font);w= -max_dimen;
p= list_ptr(just_box);
while(p!=null)
{	/*1146:*/
	#line 21747 "ctex.w"

reswitch:if(is_char_node(p))
{f= font(p);d= char_width(f,char_info(f,character(p)));
goto found;
}
switch(type(p)){
case hlist_node:case vlist_node:case rule_node:{d= width(p);goto found;
}
case ligature_node:	/*651:*/
	#line 12955 "ctex.w"

{mem[lig_trick]= mem[lig_char(p)];link(lig_trick)= link(p);
p= lig_trick;goto reswitch;
}

	/*:651*/
	#line 21755 "ctex.w"

case kern_node:case math_node:d= width(p);break;
case glue_node:	/*1147:*/
	#line 21769 "ctex.w"

{q= glue_ptr(p);d= width(q);
if(glue_sign(just_box)==stretching)
{if((glue_order(just_box)==stretch_order(q))&&
(stretch(q)!=0))
v= max_dimen;
}
else if(glue_sign(just_box)==shrinking)
{if((glue_order(just_box)==shrink_order(q))&&
(shrink(q)!=0))
v= max_dimen;
}
if(subtype(p)>=a_leaders)goto found;
}

	/*:1147*/
	#line 21758 "ctex.w"
break;
case whatsit_node:	/*1360:*/
	#line 24747 "ctex.w"
d= 0

	/*:1360*/
	#line 21759 "ctex.w"
;break;
default:d= 0;
}

	/*:1146*/
	#line 21735 "ctex.w"
;
if(v<max_dimen)v= v+d;
goto not_found;
found:if(v<max_dimen)
{v= v+d;w= v;
}
else{w= max_dimen;goto done;
}
not_found:p= link(p);
}
done:

	/*:1145*/
	#line 21717 "ctex.w"
;
}

	/*1148:*/
	#line 21787 "ctex.w"

if(par_shape_ptr==null)
if((hang_indent!=0)&&
(((hang_after>=0)&&(prev_graf+2>hang_after))||
(prev_graf+1<-hang_after)))
{l= hsize-abs(hang_indent);
if(hang_indent>0)s= hang_indent;else s= 0;
}
else{l= hsize;s= 0;
}
else{n= info(par_shape_ptr);
if(prev_graf+2>=n)p= par_shape_ptr+2*n;
else p= par_shape_ptr+2*(prev_graf+2);
s= mem[p-1].sc;l= mem[p].sc;
}

	/*:1148*/
	#line 21720 "ctex.w"
;
push_math(math_shift_group);mode= mmode;
eq_word_define(int_base+cur_fam_code,-1);
eq_word_define(dimen_base+pre_display_size_code,w);
eq_word_define(dimen_base+display_width_code,l);
eq_word_define(dimen_base+display_indent_code,s);
if(every_display!=null)begin_token_list(every_display,every_display_text);
if(nest_ptr==1)build_page();
}

	/*:1144*/
	#line 21665 "ctex.w"

else{back_input();	/*1138:*/
	#line 21670 "ctex.w"

{push_math(math_shift_group);eq_word_define(int_base+cur_fam_code,-1);
if(every_math!=null)begin_token_list(every_math,every_math_text);
}

	/*:1138*/
	#line 21666 "ctex.w"
;
}
}

	/*:1137*/	/*1141:*/
	#line 21694 "ctex.w"

static void start_eq_no(void)
{saved(0)= cur_chr;incr(save_ptr);
	/*1138:*/
	#line 21670 "ctex.w"

{push_math(math_shift_group);eq_word_define(int_base+cur_fam_code,-1);
if(every_math!=null)begin_token_list(every_math,every_math_text);
}

	/*:1138*/
	#line 21697 "ctex.w"
;
}

	/*:1141*/	/*1150:*/
	#line 21831 "ctex.w"

static void scan_math(pointer p)
{
int c;
restart:	/*403:*/
	#line 8189 "ctex.w"

do{get_x_token();
}while(!((cur_cmd!=spacer)&&(cur_cmd!=relax)))

	/*:403*/
	#line 21835 "ctex.w"
;
reswitch:switch(cur_cmd){
case letter:case other_char:case char_given:{c= ho(math_code(cur_chr));
if(c==0100000)
{	/*1151:*/
	#line 21860 "ctex.w"

{cur_cs= cur_chr+active_base;
cur_cmd= eq_type(cur_cs);cur_chr= equiv(cur_cs);
x_token();back_input();
}

	/*:1151*/
	#line 21839 "ctex.w"
;
goto restart;
}
}break;
case char_num:{scan_char_num();cur_chr= cur_val;cur_cmd= char_given;
goto reswitch;
}
case math_char_num:{scan_fifteen_bit_int();c= cur_val;
}break;
case math_given:c= cur_chr;break;
case delim_num:{scan_twenty_seven_bit_int();c= cur_val/010000;
}break;
default:	/*1152:*/
	#line 21869 "ctex.w"

{back_input();scan_left_brace();
saved(0)= p;incr(save_ptr);push_math(math_group);return;
}

	/*:1152*/
	#line 21851 "ctex.w"

}
math_type(p)= math_char;character(p)= qi(c%256);
if((c>=var_code)&&fam_in_range)fam(p)= cur_fam;
else fam(p)= (c/256)%16;
}

	/*:1150*/	/*1154:*/
	#line 21899 "ctex.w"

static void set_math_char(int c)
{pointer p;
if(c>=0100000)
	/*1151:*/
	#line 21860 "ctex.w"

{cur_cs= cur_chr+active_base;
cur_cmd= eq_type(cur_cs);cur_chr= equiv(cur_cs);
x_token();back_input();
}

	/*:1151*/
	#line 21903 "ctex.w"

else{p= new_noad();math_type(nucleus(p))= math_char;
character(nucleus(p))= qi(c%256);
fam(nucleus(p))= (c/256)%16;
if(c>=var_code)
{if(fam_in_range)fam(nucleus(p))= cur_fam;
type(p)= ord_noad;
}
else type(p)= ord_noad+(c/010000);
link(tail)= p;tail= p;
}
}

	/*:1154*/	/*1158:*/
	#line 21971 "ctex.w"

static void math_limit_switch(void)
{
if(head!=tail)if(type(tail)==op_noad)
{subtype(tail)= cur_chr;return;
}
print_err("Limit controls must follow a math operator");

help1("I'm ignoring this misplaced \\limits or \\nolimits command.");error();
}

	/*:1158*/	/*1159:*/
	#line 21987 "ctex.w"

static void scan_delimiter(pointer p,bool r)
{if(r)scan_twenty_seven_bit_int();
else{	/*403:*/
	#line 8189 "ctex.w"

do{get_x_token();
}while(!((cur_cmd!=spacer)&&(cur_cmd!=relax)))

	/*:403*/
	#line 21990 "ctex.w"
;
switch(cur_cmd){
case letter:case other_char:cur_val= del_code(cur_chr);break;
case delim_num:scan_twenty_seven_bit_int();break;
default:cur_val= -1;
}
}
if(cur_val<0)	/*1160:*/
	#line 22005 "ctex.w"

{print_err("Missing delimiter (. inserted)");

help6("I was expecting to see something like `(' or `\\{' or",
"`\\}' here. If you typed, e.g., `{' instead of `\\{', you",
"should probably delete the `{' by typing `1' now, so that",
"braces don't get unbalanced. Otherwise just proceed.",
"Acceptable delimiters are characters whose \\delcode is",
"nonnegative, or you can use `\\delimiter <delimiter code>'.");
back_error();cur_val= 0;
}

	/*:1160*/
	#line 21998 "ctex.w"
;
small_fam(p)= (cur_val/04000000)%16;
small_char(p)= qi((cur_val/010000)%256);
large_fam(p)= (cur_val/256)%16;
large_char(p)= qi(cur_val%256);
}

	/*:1159*/	/*1162:*/
	#line 22020 "ctex.w"

static void math_radical(void)
{tail_append(get_node(radical_noad_size));
type(tail)= radical_noad;subtype(tail)= normal;
mem[nucleus(tail)].hh= empty_field;
mem[subscr(tail)].hh= empty_field;
mem[supscr(tail)].hh= empty_field;
scan_delimiter(left_delimiter(tail),true);scan_math(nucleus(tail));
}

	/*:1162*/	/*1164:*/
	#line 22033 "ctex.w"

static void math_ac(void)
{if(cur_cmd==accent)
	/*1165:*/
	#line 22050 "ctex.w"

{print_err("Please use ");print_esc("mathaccent");
print(" for accents in math mode");

help2("I'm changing \\accent to \\mathaccent here; wish me luck.",
"(Accents are not the same in formulas as they are in text.)");
error();
}

	/*:1165*/
	#line 22036 "ctex.w"
;
tail_append(get_node(accent_noad_size));
type(tail)= accent_noad;subtype(tail)= normal;
mem[nucleus(tail)].hh= empty_field;
mem[subscr(tail)].hh= empty_field;
mem[supscr(tail)].hh= empty_field;
math_type(accent_chr(tail))= math_char;
scan_fifteen_bit_int();
character(accent_chr(tail))= qi(cur_val%256);
if((cur_val>=var_code)&&fam_in_range)fam(accent_chr(tail))= cur_fam;
else fam(accent_chr(tail))= (cur_val/256)%16;
scan_math(nucleus(tail));
}

	/*:1164*/	/*1171:*/
	#line 22097 "ctex.w"

static void append_choices(void)
{tail_append(new_choice());incr(save_ptr);saved(-1)= 0;
push_math(math_choice_group);scan_left_brace();
}

	/*:1171*/	/*1173:*/
	#line 22106 "ctex.w"

	/*1183:*/
	#line 22251 "ctex.w"

static pointer fin_mlist(pointer p)
{pointer q;
if(incompleat_noad!=null)	/*1184:*/
	#line 22260 "ctex.w"

{math_type(denominator(incompleat_noad))= sub_mlist;
info(denominator(incompleat_noad))= link(head);
if(p==null)q= incompleat_noad;
else{q= info(numerator(incompleat_noad));
if(type(q)!=left_noad)confusion("right");

info(numerator(incompleat_noad))= link(q);
link(q)= incompleat_noad;link(incompleat_noad)= p;
}
}

	/*:1184*/
	#line 22254 "ctex.w"

else{link(tail)= p;q= link(head);
}
pop_nest();return q;
}

	/*:1183*/
	#line 22107 "ctex.w"

static void build_choices(void)
{
pointer p;
unsave();p= fin_mlist(null);
switch(saved(-1)){
case 0:display_mlist(tail)= p;break;
case 1:text_mlist(tail)= p;break;
case 2:script_mlist(tail)= p;break;
case 3:{script_script_mlist(tail)= p;decr(save_ptr);return;
}
}
incr(saved(-1));push_math(math_choice_group);scan_left_brace();
}

	/*:1173*/	/*1175:*/
	#line 22130 "ctex.w"

static void sub_sup(void)
{small_number t;
pointer p;
t= empty;p= null;
if(tail!=head)if(scripts_allowed(tail))
{p= supscr(tail)+cur_cmd-sup_mark;
t= math_type(p);
}
if((p==null)||(t!=empty))	/*1176:*/
	#line 22143 "ctex.w"

{tail_append(new_noad());
p= supscr(tail)+cur_cmd-sup_mark;
if(t!=empty)
{if(cur_cmd==sup_mark)
{print_err("Double superscript");

help1("I treat `x^1^2' essentially like `x^1{}^2'.");
}
else{print_err("Double subscript");

help1("I treat `x_1_2' essentially like `x_1{}_2'.");
}
error();
}
}

	/*:1176*/
	#line 22139 "ctex.w"
;
scan_math(p);
}

	/*:1175*/	/*1180:*/
	#line 22200 "ctex.w"

static void math_fraction(void)
{small_number c;
c= cur_chr;
if(incompleat_noad!=null)
	/*1182:*/
	#line 22232 "ctex.w"

{if(c>=delimited_code)
{scan_delimiter(garbage,false);scan_delimiter(garbage,false);
}
if(c%delimited_code==above_code)scan_normal_dimen;
print_err("Ambiguous; you need another { and }");

help3("I'm ignoring this fraction specification, since I don't",
"know whether a construction like `x \\over y \\over z'",
"means `{x \\over y} \\over z' or `x \\over {y \\over z}'.");
error();
}

	/*:1182*/
	#line 22205 "ctex.w"

else{incompleat_noad= get_node(fraction_noad_size);
type(incompleat_noad)= fraction_noad;
subtype(incompleat_noad)= normal;
math_type(numerator(incompleat_noad))= sub_mlist;
info(numerator(incompleat_noad))= link(head);
mem[denominator(incompleat_noad)].hh= empty_field;
mem[left_delimiter(incompleat_noad)].qqqq= null_delimiter;
mem[right_delimiter(incompleat_noad)].qqqq= null_delimiter;
link(head)= null;tail= head;
	/*1181:*/
	#line 22219 "ctex.w"

if(c>=delimited_code)
{scan_delimiter(left_delimiter(incompleat_noad),false);
scan_delimiter(right_delimiter(incompleat_noad),false);
}
switch(c%delimited_code){
case above_code:{scan_normal_dimen;
thickness(incompleat_noad)= cur_val;
}break;
case over_code:thickness(incompleat_noad)= default_code;break;
case atop_code:thickness(incompleat_noad)= 0;
}

	/*:1181*/
	#line 22215 "ctex.w"
;
}
}

	/*:1180*/	/*1190:*/
	#line 22315 "ctex.w"

static void math_left_right(void)
{small_number t;
pointer p;
t= cur_chr;
if((t==right_noad)&&(cur_group!=math_left_group))
	/*1191:*/
	#line 22335 "ctex.w"

{if(cur_group==math_shift_group)
{scan_delimiter(garbage,false);
print_err("Extra ");print_esc("right");

help1("I'm ignoring a \\right that had no matching \\left.");
error();
}
else off_save();
}

	/*:1191*/
	#line 22321 "ctex.w"

else{p= new_noad();type(p)= t;
scan_delimiter(delimiter(p),false);
if(t==left_noad)
{push_math(math_left_group);link(head)= p;tail= p;
}
else{p= fin_mlist(p);unsave();
tail_append(new_noad());type(tail)= inner_noad;
math_type(nucleus(tail))= sub_mlist;
info(nucleus(tail))= p;
}
}
}

	/*:1190*/	/*1193:*/
	#line 22352 "ctex.w"

static void after_math(void)
{bool l;
bool danger;
int m;
pointer p;
pointer a;
	/*1197:*/
	#line 22436 "ctex.w"

pointer b;
scaled w;
scaled z;
scaled e;
scaled q;
scaled d;
scaled s;
small_number g1,g2;
pointer r;
pointer t;

	/*:1197*/
	#line 22359 "ctex.w"

danger= false;
	/*1194:*/
	#line 22382 "ctex.w"

if((font_params[fam_fnt(2+text_size)]<total_mathsy_params)||
(font_params[fam_fnt(2+script_size)]<total_mathsy_params)||
(font_params[fam_fnt(2+script_script_size)]<total_mathsy_params))
{print_err("Math formula deleted: Insufficient symbol fonts");

help3("Sorry, but I can't typeset math unless \\textfont 2",
"and \\scriptfont 2 and \\scriptscriptfont 2 have all",
"the \\fontdimen values needed in math symbol fonts.");
error();flush_math();danger= true;
}
else if((font_params[fam_fnt(3+text_size)]<total_mathex_params)||
(font_params[fam_fnt(3+script_size)]<total_mathex_params)||
(font_params[fam_fnt(3+script_script_size)]<total_mathex_params))
{print_err("Math formula deleted: Insufficient extension fonts");
help3("Sorry, but I can't typeset math unless \\textfont 3",
"and \\scriptfont 3 and \\scriptscriptfont 3 have all",
"the \\fontdimen values needed in math extension fonts.");
error();flush_math();danger= true;
}

	/*:1194*/
	#line 22362 "ctex.w"
;
m= mode;l= false;p= fin_mlist(null);
if(mode==-m)
{	/*1196:*/
	#line 22421 "ctex.w"

{get_x_token();
if(cur_cmd!=math_shift)
{print_err("Display math should end with $$");

help2("The `$' that I just saw supposedly matches a previous `$$'.",
"So I shall assume that you typed `$$' both times.");
back_error();
}
}

	/*:1196*/
	#line 22365 "ctex.w"
;
cur_mlist= p;cur_style= text_style;mlist_penalties= false;
mlist_to_hlist();a= hpack(link(temp_head),natural);
unsave();decr(save_ptr);
if(saved(0)==1)l= true;
danger= false;
	/*1194:*/
	#line 22382 "ctex.w"

if((font_params[fam_fnt(2+text_size)]<total_mathsy_params)||
(font_params[fam_fnt(2+script_size)]<total_mathsy_params)||
(font_params[fam_fnt(2+script_script_size)]<total_mathsy_params))
{print_err("Math formula deleted: Insufficient symbol fonts");

help3("Sorry, but I can't typeset math unless \\textfont 2",
"and \\scriptfont 2 and \\scriptscriptfont 2 have all",
"the \\fontdimen values needed in math symbol fonts.");
error();flush_math();danger= true;
}
else if((font_params[fam_fnt(3+text_size)]<total_mathex_params)||
(font_params[fam_fnt(3+script_size)]<total_mathex_params)||
(font_params[fam_fnt(3+script_script_size)]<total_mathex_params))
{print_err("Math formula deleted: Insufficient extension fonts");
help3("Sorry, but I can't typeset math unless \\textfont 3",
"and \\scriptfont 3 and \\scriptscriptfont 3 have all",
"the \\fontdimen values needed in math extension fonts.");
error();flush_math();danger= true;
}

	/*:1194*/
	#line 22372 "ctex.w"
;
m= mode;p= fin_mlist(null);
}
else a= null;
if(m<0)	/*1195:*/
	#line 22409 "ctex.w"

{tail_append(new_math(math_surround,before));
cur_mlist= p;cur_style= text_style;mlist_penalties= (mode>0);mlist_to_hlist();
link(tail)= link(temp_head);
while(link(tail)!=null)tail= link(tail);
tail_append(new_math(math_surround,after));
space_factor= 1000;unsave();
}

	/*:1195*/
	#line 22376 "ctex.w"

else{if(a==null)	/*1196:*/
	#line 22421 "ctex.w"

{get_x_token();
if(cur_cmd!=math_shift)
{print_err("Display math should end with $$");

help2("The `$' that I just saw supposedly matches a previous `$$'.",
"So I shall assume that you typed `$$' both times.");
back_error();
}
}

	/*:1196*/
	#line 22377 "ctex.w"
;
	/*1198:*/
	#line 22452 "ctex.w"

cur_mlist= p;cur_style= display_style;mlist_penalties= false;
mlist_to_hlist();p= link(temp_head);
adjust_tail= adjust_head;b= hpack(p,natural);p= list_ptr(b);
t= adjust_tail;adjust_tail= null;
w= width(b);z= display_width;s= display_indent;
if((a==null)||danger)
{e= 0;q= 0;
}
else{e= width(a);q= e+math_quad(text_size);
}
if(w+q>z)
	/*1200:*/
	#line 22488 "ctex.w"

{if((e!=0)&&((w-total_shrink[normal]+q<=z)||
(total_shrink[fil]!=0)||(total_shrink[fill]!=0)||
(total_shrink[filll]!=0)))
{free_node(b,box_node_size);
b= hpack(p,z-q,exactly);
}
else{e= 0;
if(w>z)
{free_node(b,box_node_size);
b= hpack(p,z,exactly);
}
}
w= width(b);
}

	/*:1200*/
	#line 22465 "ctex.w"
;
	/*1201:*/
	#line 22512 "ctex.w"

d= half(z-w);
if((e>0)&&(d<2*e))
{d= half(z-w-e);
if(p!=null)if(!is_char_node(p))if(type(p)==glue_node)d= 0;
}

	/*:1201*/
	#line 22467 "ctex.w"
;
	/*1202:*/
	#line 22525 "ctex.w"

tail_append(new_penalty(pre_display_penalty));
if((d+s<=pre_display_size)||l)
{g1= above_display_skip_code;g2= below_display_skip_code;
}
else{g1= above_display_short_skip_code;
g2= below_display_short_skip_code;
}
if(l&&(e==0))
{shift_amount(a)= s;append_to_vlist(a);
tail_append(new_penalty(inf_penalty));
}
else tail_append(new_param_glue(g1))

	/*:1202*/
	#line 22468 "ctex.w"
;
	/*1203:*/
	#line 22539 "ctex.w"

if(e!=0)
{r= new_kern(z-w-e-d);
if(l)
{link(a)= r;link(r)= b;b= a;d= 0;
}
else{link(b)= r;link(r)= a;
}
b= hpack(b,natural);
}
shift_amount(b)= s+d;append_to_vlist(b)

	/*:1203*/
	#line 22469 "ctex.w"
;
	/*1204:*/
	#line 22551 "ctex.w"

if((a!=null)&&(e==0)&&!l)
{tail_append(new_penalty(inf_penalty));
shift_amount(a)= s+z-width(a);
append_to_vlist(a);
g2= 0;
}
if(t!=adjust_head)
{link(tail)= link(adjust_head);tail= t;
}
tail_append(new_penalty(post_display_penalty));
if(g2>0)tail_append(new_param_glue(g2))

	/*:1204*/
	#line 22470 "ctex.w"
;
resume_after_display()

	/*:1198*/
	#line 22378 "ctex.w"
;
}
}

	/*:1193*/	/*1199:*/
	#line 22473 "ctex.w"

static void resume_after_display(void)
{if(cur_group!=math_shift_group)confusion("display");

unsave();prev_graf= prev_graf+3;
push_nest();mode= hmode;space_factor= 1000;set_cur_lang;clang= cur_lang;
prev_graf= (norm_min(left_hyphen_min)*0100+norm_min(right_hyphen_min))
*0200000+cur_lang;
	/*442:*/
	#line 8734 "ctex.w"

{get_x_token();if(cur_cmd!=spacer)back_input();
}

	/*:442*/
	#line 22481 "ctex.w"
;
if(nest_ptr==1)build_page();
}

	/*:1199*/	/*1210:*/
	#line 22670 "ctex.w"

	/*1214:*/
	#line 22735 "ctex.w"

static void get_r_token(void)
{
restart:do{get_token();
}while(!(cur_tok!=space_token));
if((cur_cs==0)||(cur_cs>frozen_control_sequence))
{print_err("Missing control sequence inserted");

help5("Please don't say `\\def cs{...}', say `\\def\\cs{...}'.",
"I've inserted an inaccessible control sequence so that your",
"definition will be completed without mixing me up too badly.",
"You can recover graciously from this error, if you're",
"careful; see exercise 27.2 in The TeXbook.");

if(cur_cs==0)back_input();
cur_tok= cs_token_flag+frozen_protection;ins_error();goto restart;
}
}

	/*:1214*/	/*1228:*/
	#line 22946 "ctex.w"

static void trap_zero_glue(void)
{if((width(cur_val)==0)&&(stretch(cur_val)==0)&&(shrink(cur_val)==0))
{add_glue_ref(zero_glue);
delete_glue_ref(cur_val);cur_val= zero_glue;
}
}

	/*:1228*/	/*1235:*/
	#line 23026 "ctex.w"

static void do_register_command(small_number a)
{
pointer l,q,r,s;
int p;
q= cur_cmd;
	/*1236:*/
	#line 23055 "ctex.w"

{if(q!=internal_register)
{get_x_token();
if((cur_cmd>=assign_int)&&(cur_cmd<=assign_mu_glue))
{l= cur_chr;p= cur_cmd-assign_int;goto found;
}
if(cur_cmd!=internal_register)
{print_err("You can't use `");print_cmd_chr(cur_cmd,cur_chr);

print("' after ");print_cmd_chr(q,0);
help1("I'm forgetting what you said and not changing anything.");
error();return;
}
}
p= cur_chr;scan_eight_bit_int();
switch(p){
case int_val:l= cur_val+count_base;break;
case dimen_val:l= cur_val+scaled_base;break;
case glue_val:l= cur_val+skip_base;break;
case mu_val:l= cur_val+mu_skip_base;
}
}
found:

	/*:1236*/
	#line 23032 "ctex.w"
;
if(q==internal_register)scan_optional_equals();
else if(scan_keyword("by"))do_nothing;

arith_error= false;
if(q<multiply)	/*1237:*/
	#line 23079 "ctex.w"

if(p<glue_val)
{if(p==int_val)scan_int();else scan_normal_dimen;
if(q==advance)cur_val= cur_val+eqtb[l].i;
}
else{scan_glue(p);
if(q==advance)	/*1238:*/
	#line 23088 "ctex.w"

{q= new_spec(cur_val);r= equiv(l);
delete_glue_ref(cur_val);
width(q)= width(q)+width(r);
if(stretch(q)==0)stretch_order(q)= normal;
if(stretch_order(q)==stretch_order(r))stretch(q)= stretch(q)+stretch(r);
else if((stretch_order(q)<stretch_order(r))&&(stretch(r)!=0))
{stretch(q)= stretch(r);stretch_order(q)= stretch_order(r);
}
if(shrink(q)==0)shrink_order(q)= normal;
if(shrink_order(q)==shrink_order(r))shrink(q)= shrink(q)+shrink(r);
else if((shrink_order(q)<shrink_order(r))&&(shrink(r)!=0))
{shrink(q)= shrink(r);shrink_order(q)= shrink_order(r);
}
cur_val= q;
}

	/*:1238*/
	#line 23085 "ctex.w"
;
}

	/*:1237*/
	#line 23037 "ctex.w"

else	/*1239:*/
	#line 23105 "ctex.w"

{scan_int();
if(p<glue_val)
if(q==multiply)
if(p==int_val)cur_val= mult_integers(eqtb[l].i,cur_val);
else cur_val= nx_plus_y(eqtb[l].i,cur_val,0);
else cur_val= x_over_n(eqtb[l].i,cur_val);
else{s= equiv(l);r= new_spec(s);
if(q==multiply)
{width(r)= nx_plus_y(width(s),cur_val,0);
stretch(r)= nx_plus_y(stretch(s),cur_val,0);
shrink(r)= nx_plus_y(shrink(s),cur_val,0);
}
else{width(r)= x_over_n(width(s),cur_val);
stretch(r)= x_over_n(stretch(s),cur_val);
shrink(r)= x_over_n(shrink(s),cur_val);
}
cur_val= r;
}
}

	/*:1239*/
	#line 23038 "ctex.w"
;
if(arith_error)
{print_err("Arithmetic overflow");

help2("I can't carry out that multiplication or division,",
"since the result is out of range.");
if(p>=glue_val)delete_glue_ref(cur_val);
error();return;
}
if(p<glue_val)word_define(l,cur_val);
else{trap_zero_glue();define(l,glue_ref,cur_val);
}
}

	/*:1235*/	/*1242:*/
	#line 23157 "ctex.w"

static void alter_aux(void)
{halfword c;
if(cur_chr!=abs(mode))report_illegal_case();
else{c= cur_chr;scan_optional_equals();
if(c==vmode)
{scan_normal_dimen;prev_depth= cur_val;
}
else{scan_int();
if((cur_val<=0)||(cur_val>32767))
{print_err("Bad space factor");

help1("I allow only values in the range 1..32767 here.");
int_error(cur_val);
}
else space_factor= cur_val;
}
}
}

	/*:1242*/	/*1243:*/
	#line 23177 "ctex.w"

static void alter_prev_graf(void)
{int p;
nest[nest_ptr]= cur_list;p= nest_ptr;
while(abs(nest[p].mode_field)!=vmode)decr(p);
scan_optional_equals();scan_int();
if(cur_val<0)
{print_err("Bad ");print_esc("prevgraf");

help1("I allow only nonnegative values here.");
int_error(cur_val);
}
else{nest[p].pg_field= cur_val;cur_list= nest[nest_ptr];
}
}

	/*:1243*/	/*1244:*/
	#line 23193 "ctex.w"

static void alter_page_so_far(void)
{int c;
c= cur_chr;scan_optional_equals();scan_normal_dimen;
page_so_far[c]= cur_val;
}

	/*:1244*/	/*1245:*/
	#line 23200 "ctex.w"

static void alter_integer(void)
{int c;
c= cur_chr;scan_optional_equals();scan_int();
if(c==0)dead_cycles= cur_val;
else insert_penalties= cur_val;
}

	/*:1245*/	/*1246:*/
	#line 23208 "ctex.w"

static void alter_box_dimen(void)
{small_number c;
eight_bits b;
c= cur_chr;scan_eight_bit_int();b= cur_val;scan_optional_equals();
scan_normal_dimen;
if(box(b)!=null)mem[box(b)+c].sc= cur_val;
}

	/*:1246*/	/*1256:*/
	#line 23294 "ctex.w"

static void new_font(small_number a)
{
pointer u;
scaled s;
int f;
str_number t;
int old_setting;
str_number flushable_string;
if(job_name==0)open_log_file();


get_r_token();u= cur_cs;
if(u>=hash_base)t= text(u);
else if(u>=single_base)
if(u==null_cs)t= s_no("FONT");else t= u-single_base;
else{old_setting= selector;selector= new_string;
print("FONT");printn(u-active_base);selector= old_setting;

str_room(1);t= make_string();
}
define(u,set_font,null_font);scan_optional_equals();scan_file_name();
	/*1257:*/
	#line 23323 "ctex.w"

name_in_progress= true;
if(scan_keyword("at"))	/*1258:*/
	#line 23340 "ctex.w"

{scan_normal_dimen;s= cur_val;
if((s<=0)||(s>=01000000000))
{print_err("Improper `at' size (");
print_scaled(s);print("pt), replaced by 10pt");

help2("I can only handle fonts at positive sizes that are",
"less than 2048pt, so I've changed what you said to 10pt.");
error();s= 10*unity;
}
}

	/*:1258*/
	#line 23325 "ctex.w"


else if(scan_keyword("scaled"))

{scan_int();s= -cur_val;
if((cur_val<=0)||(cur_val>32768))
{print_err("Illegal magnification has been changed to 1000");

help1("The magnification ratio must be between 1 and 32768.");
int_error(cur_val);s= -1000;
}
}
else s= -1000;
name_in_progress= false

	/*:1257*/
	#line 23316 "ctex.w"
;
	/*1259:*/
	#line 23356 "ctex.w"

flushable_string= str_ptr-1;
for(f= font_base+1;f<=font_ptr;f++)
if(strn_eq_str(font_name[f],cur_name)&&str_eq_str(font_area[f],cur_area))
{if(cur_name==flushable_string)
{flush_string;cur_name= font_name[f];
}
if(s>0)
{if(s==font_size[f])goto common_ending;
}
else if(font_size[f]==xn_over_d(font_dsize[f],-s,1000))
goto common_ending;
}

	/*:1259*/
	#line 23318 "ctex.w"
;
f= read_font_info(u,cur_name,cur_area,s);
common_ending:equiv(u)= f;eqtb[font_id_base+f]= eqtb[u];font_id_text(f)= t;
}

	/*:1256*/	/*1264:*/
	#line 23399 "ctex.w"

static void new_interaction(void)
{print_ln();
interaction= cur_chr;
	/*74:*/
	#line 1711 "ctex.w"

if(interaction==batch_mode)selector= no_print;else selector= term_only

	/*:74*/
	#line 23403 "ctex.w"
;
if(log_opened)selector= selector+2;
}

	/*:1264*/
	#line 22671 "ctex.w"

static void prefixed_command(void)
{
small_number a;
internal_font_number f;
int j;
font_index k;
pointer p,q;
int n;
bool e;
a= 0;
while(cur_cmd==prefix)
{if(!odd(a/cur_chr))a= a+cur_chr;
	/*403:*/
	#line 8189 "ctex.w"

do{get_x_token();
}while(!((cur_cmd!=spacer)&&(cur_cmd!=relax)))

	/*:403*/
	#line 22684 "ctex.w"
;
if(cur_cmd<=max_non_prefixed_command)
	/*1211:*/
	#line 22698 "ctex.w"

{print_err("You can't use a prefix with `");

print_cmd_chr(cur_cmd,cur_chr);print_char('\'');
help1("I'll pretend you didn't say \\long or \\outer or \\global.");
back_error();return;
}

	/*:1211*/
	#line 22686 "ctex.w"
;
}
	/*1212:*/
	#line 22706 "ctex.w"

if((cur_cmd!=def)&&(a%4!=0))
{print_err("You can't use `");print_esc("long");print("' or `");
print_esc("outer");print("' with `");

print_cmd_chr(cur_cmd,cur_chr);print_char('\'');
help1("I'll pretend you didn't say \\long or \\outer here.");
error();
}

	/*:1212*/
	#line 22688 "ctex.w"
;
	/*1213:*/
	#line 22723 "ctex.w"

if(global_defs!=0)
if(global_defs<0)
{if(global)a= a-4;
}
else{if(!global)a= a+4;
}

	/*:1213*/
	#line 22689 "ctex.w"
;
switch(cur_cmd){
	/*1216:*/
	#line 22760 "ctex.w"

case set_font:define(cur_font_loc,data,cur_chr);break;

	/*:1216*/	/*1217:*/
	#line 22767 "ctex.w"

case def:{if(odd(cur_chr)&&!global&&(global_defs>=0))a= a+4;
e= (cur_chr>=2);get_r_token();p= cur_cs;
q= scan_toks(true,e);define(p,call+(a%4),def_ref);
}break;

	/*:1217*/	/*1220:*/
	#line 22784 "ctex.w"

case let:{n= cur_chr;
get_r_token();p= cur_cs;
if(n==normal)
{do{get_token();
}while(!(cur_cmd!=spacer));
if(cur_tok==other_token+'=')
{get_token();
if(cur_cmd==spacer)get_token();
}
}
else{get_token();q= cur_tok;get_token();back_input();
cur_tok= q;back_input();
}
if(cur_cmd>=call)add_token_ref(cur_chr);
define(p,cur_cmd,cur_chr);
}break;

	/*:1220*/	/*1223:*/
	#line 22853 "ctex.w"

case shorthand_def:{n= cur_chr;get_r_token();p= cur_cs;define(p,relax,256);
scan_optional_equals();
switch(n){
case char_def_code:{scan_char_num();define(p,char_given,cur_val);
}break;
case math_char_def_code:{scan_fifteen_bit_int();define(p,math_given,cur_val);
}break;
default:{scan_eight_bit_int();
switch(n){
case count_def_code:define(p,assign_int,count_base+cur_val);break;
case dimen_def_code:define(p,assign_dimen,scaled_base+cur_val);break;
case skip_def_code:define(p,assign_glue,skip_base+cur_val);break;
case mu_skip_def_code:define(p,assign_mu_glue,mu_skip_base+cur_val);break;
case toks_def_code:define(p,assign_toks,toks_base+cur_val);
}
}
}
}break;

	/*:1223*/	/*1224:*/
	#line 22873 "ctex.w"

case read_to_cs:{scan_int();n= cur_val;
if(!scan_keyword("to"))

{print_err("Missing `to' inserted");

help2("You should have said `\\read<number> to \\cs'.",
"I'm going to look for the \\cs now.");error();
}
get_r_token();
p= cur_cs;read_toks(n,p);define(p,call,cur_val);
}break;

	/*:1224*/	/*1225:*/
	#line 22890 "ctex.w"

case toks_register:case assign_toks:{q= cur_cs;
if(cur_cmd==toks_register)
{scan_eight_bit_int();p= toks_base+cur_val;
}
else p= cur_chr;
scan_optional_equals();
	/*403:*/
	#line 8189 "ctex.w"

do{get_x_token();
}while(!((cur_cmd!=spacer)&&(cur_cmd!=relax)))

	/*:403*/
	#line 22897 "ctex.w"
;
if(cur_cmd!=left_brace)	/*1226:*/
	#line 22914 "ctex.w"

{if(cur_cmd==toks_register)
{scan_eight_bit_int();cur_cmd= assign_toks;cur_chr= toks_base+cur_val;
}
if(cur_cmd==assign_toks)
{q= equiv(cur_chr);
if(q==null)define(p,undefined_cs,null);
else{add_token_ref(q);define(p,call,q);
}
goto done;
}
}

	/*:1226*/
	#line 22899 "ctex.w"
;
back_input();cur_cs= q;q= scan_toks(false,false);
if(link(def_ref)==null)
{define(p,undefined_cs,null);free_avail(def_ref);
}
else{if(p==output_routine_loc)
{link(q)= get_avail();q= link(q);
info(q)= right_brace_token+'}';
q= get_avail();info(q)= left_brace_token+'{';
link(q)= link(def_ref);link(def_ref)= q;
}
define(p,call,def_ref);
}
}break;

	/*:1225*/	/*1227:*/
	#line 22929 "ctex.w"

case assign_int:{p= cur_chr;scan_optional_equals();scan_int();
word_define(p,cur_val);
}break;
case assign_dimen:{p= cur_chr;scan_optional_equals();
scan_normal_dimen;word_define(p,cur_val);
}break;
case assign_glue:case assign_mu_glue:{p= cur_chr;n= cur_cmd;scan_optional_equals();
if(n==assign_mu_glue)scan_glue(mu_val);else scan_glue(glue_val);
trap_zero_glue();
define(p,glue_ref,cur_val);
}break;

	/*:1227*/	/*1231:*/
	#line 22989 "ctex.w"

case def_code:{	/*1232:*/
	#line 23007 "ctex.w"

if(cur_chr==cat_code_base)n= max_char_code;
else if(cur_chr==math_code_base)n= 0100000;
else if(cur_chr==sf_code_base)n= 077777;
else if(cur_chr==del_code_base)n= 077777777;
else n= 255

	/*:1232*/
	#line 22990 "ctex.w"
;
p= cur_chr;scan_char_num();p= p+cur_val;scan_optional_equals();
scan_int();
if(((cur_val<0)&&(p<del_code_base))||(cur_val>n))
{print_err("Invalid code (");print_int(cur_val);

if(p<del_code_base)print("), should be in the range 0..");
else print("), should be at most ");
print_int(n);
help1("I'm going to use 0 instead of that illegal code value.");
error();cur_val= 0;
}
if(p<math_code_base)define(p,data,cur_val);
else if(p<del_code_base)define(p,data,hi(cur_val));
else word_define(p,cur_val);
}break;

	/*:1231*/	/*1233:*/
	#line 23014 "ctex.w"

case def_family:{p= cur_chr;scan_four_bit_int();p= p+cur_val;
scan_optional_equals();scan_font_ident();define(p,data,cur_val);
}break;

	/*:1233*/	/*1234:*/
	#line 23021 "ctex.w"

case internal_register:case advance:case multiply:case divide:do_register_command(a);break;

	/*:1234*/	/*1240:*/
	#line 23130 "ctex.w"

case set_box:{scan_eight_bit_int();
if(global)n= 256+cur_val;else n= cur_val;
scan_optional_equals();
if(set_box_allowed)scan_box(box_flag+n);
else{print_err("Improper ");print_esc("setbox");

help2("Sorry, \\setbox is not allowed after \\halign in a display,",
"or between \\accent and an accented character.");error();
}
}break;

	/*:1240*/	/*1241:*/
	#line 23150 "ctex.w"

case set_aux:alter_aux();break;
case set_prev_graf:alter_prev_graf();break;
case set_page_dimen:alter_page_so_far();break;
case set_page_int:alter_integer();break;
case set_box_dimen:alter_box_dimen();break;

	/*:1241*/	/*1247:*/
	#line 23219 "ctex.w"

case set_shape:{scan_optional_equals();scan_int();n= cur_val;
if(n<=0)p= null;
else{p= get_node(2*n+1);info(p)= n;
for(j= 1;j<=n;j++)
{scan_normal_dimen;
mem[p+2*j-1].sc= cur_val;
scan_normal_dimen;
mem[p+2*j].sc= cur_val;
}
}
define(par_shape_loc,shape_ref,p);
}break;

	/*:1247*/	/*1251:*/
	#line 23252 "ctex.w"

case hyph_data:if(cur_chr==1)
{
#ifdef INIT
new_patterns();goto done;
#endif
print_err("Patterns can be loaded only by INITEX");

help0;error();
do{get_token();}while(!(cur_cmd==right_brace));
return;
}
else{new_hyph_exceptions();goto done;
}break;

	/*:1251*/	/*1252:*/
	#line 23270 "ctex.w"

case assign_font_dimen:{find_font_dimen(true);k= cur_val;
scan_optional_equals();scan_normal_dimen;font_info[k].sc= cur_val;
}break;
case assign_font_int:{n= cur_chr;scan_font_ident();f= cur_val;
scan_optional_equals();scan_int();
if(n==0)hyphen_char[f]= cur_val;else skew_char[f]= cur_val;
}break;

	/*:1252*/	/*1255:*/
	#line 23291 "ctex.w"

case def_font:new_font(a);break;

	/*:1255*/	/*1263:*/
	#line 23396 "ctex.w"

case set_interaction:new_interaction();break;

	/*:1263*/
	#line 22691 "ctex.w"

default:confusion("prefix");

}
done:	/*1268:*/
	#line 23421 "ctex.w"

if(after_token!=0)
{cur_tok= after_token;back_input();after_token= 0;
}

	/*:1268*/
	#line 22695 "ctex.w"
;
}

	/*:1210*/	/*1269:*/
	#line 23429 "ctex.w"

static void do_assignments(void)
{
loop{	/*403:*/
	#line 8189 "ctex.w"

do{get_x_token();
}while(!((cur_cmd!=spacer)&&(cur_cmd!=relax)))

	/*:403*/
	#line 23432 "ctex.w"
;
if(cur_cmd<=max_non_prefixed_command)return;
set_box_allowed= false;prefixed_command();set_box_allowed= true;
}
}

	/*:1269*/	/*1274:*/
	#line 23457 "ctex.w"

static void open_or_close_in(void)
{int c;
int n;
c= cur_chr;scan_four_bit_int();n= cur_val;
if(read_open[n]!=closed)
{a_close(&read_file[n]);read_open[n]= closed;
}
if(c!=0)
{scan_optional_equals();scan_file_name();
if(cur_ext[0]==0)cur_ext= ".tex";
pack_cur_name;
if(a_open_in(&read_file[n]))read_open[n]= just_open;
}
}

	/*:1274*/	/*1278:*/
	#line 23489 "ctex.w"

static void issue_message(void)
{int old_setting;
int c;
str_number s;
c= cur_chr;link(garbage)= scan_toks(false,true);
old_setting= selector;selector= new_string;
token_show(def_ref);selector= old_setting;
flush_list(def_ref);
str_room(1);s= make_string();
if(c==0)	/*1279:*/
	#line 23504 "ctex.w"

{if(term_offset+length(s)>max_print_line-2)print_ln();
else if((term_offset>0)||(file_offset>0))print_char(' ');
slow_print(s);update_terminal;
}

	/*:1279*/
	#line 23499 "ctex.w"

else	/*1282:*/
	#line 23519 "ctex.w"

{print_err("");slow_print(s);
if(err_help!=null)use_err_help= true;
else if(long_help_seen)help1("(That was another \\errmessage.)")
else{if(interaction<error_stop_mode)long_help_seen= true;
help4("This error message was generated by an \\errmessage",
"command, so I can't give any explicit help.",
"Pretend that you're Hercule Poirot: Examine all clues,",

"and deduce the truth by order and method.");
}
error();use_err_help= false;
}

	/*:1282*/
	#line 23500 "ctex.w"
;
flush_string;
}

	/*:1278*/	/*1287:*/
	#line 23556 "ctex.w"

static void shift_case(void)
{pointer b;
pointer p;
halfword t;
eight_bits c;
b= cur_chr;p= scan_toks(false,false);p= link(def_ref);
while(p!=null)
{	/*1288:*/
	#line 23575 "ctex.w"

t= info(p);
if(t<cs_token_flag+single_base)
{c= t%256;
if(equiv(b+c)!=0)info(p)= t-c+equiv(b+c);
}

	/*:1288*/
	#line 23564 "ctex.w"
;
p= link(p);
}
back_list(link(def_ref));free_avail(def_ref);
}

	/*:1287*/	/*1292:*/
	#line 23611 "ctex.w"

static void show_whatever(void)
{
pointer p;
switch(cur_chr){
case show_lists:{begin_diagnostic();show_activities();
}break;
case show_box_code:	/*1295:*/
	#line 23661 "ctex.w"

{scan_eight_bit_int();begin_diagnostic();
print_nl("> \\box");print_int(cur_val);print_char('=');
if(box(cur_val)==null)print("void");
else show_box(box(cur_val));
}

	/*:1295*/
	#line 23618 "ctex.w"
break;
case show_code:	/*1293:*/
	#line 23642 "ctex.w"

{get_token();
if(interaction==error_stop_mode)wake_up_terminal;
print_nl("> ");
if(cur_cs!=0)
{sprint_cs(cur_cs);print_char('=');
}
print_meaning();goto common_ending;
}

	/*:1293*/
	#line 23619 "ctex.w"

default:	/*1296:*/
	#line 23668 "ctex.w"

{p= the_toks();
if(interaction==error_stop_mode)wake_up_terminal;
print_nl("> ");token_show(temp_head);
flush_list(link(temp_head));goto common_ending;
}

	/*:1296*/
	#line 23620 "ctex.w"

}
	/*1297:*/
	#line 23675 "ctex.w"

end_diagnostic(true);print_err("OK");

if(selector==term_and_log)if(tracing_online<=0)
{selector= term_only;print(" (see the transcript file)");
selector= term_and_log;
}

	/*:1297*/
	#line 23622 "ctex.w"
;
common_ending:if(interaction<error_stop_mode)
{help0;decr(error_count);
}
else if(tracing_online>0)
{
help3("This isn't an error message; I'm just \\showing something.",
"Type `I\\show...' to show more (e.g., \\show\\cs,",
"\\showthe\\count10, \\showbox255, \\showlists).");
}
else{
help5("This isn't an error message; I'm just \\showing something.",
"Type `I\\show...' to show more (e.g., \\show\\cs,",
"\\showthe\\count10, \\showbox255, \\showlists).",
"And type `I\\tracingonline=1\\show...' to show boxes and",
"lists on your terminal as well as in the transcript file.");
}
error();
}

	/*:1292*/	/*1301:*/
	#line 23709 "ctex.w"

#ifdef INIT
static void store_fmt_file(void)
{
int j,k,l;
int p,q;
int x;
four_quarters w;
	/*1303:*/
	#line 23766 "ctex.w"

if(save_ptr!=0)
{print_err("You can't dump inside a group");

help1("`{...\\dump}' is a no-no.");succumb;
}

	/*:1303*/
	#line 23717 "ctex.w"
;
	/*1327:*/
	#line 24158 "ctex.w"

selector= new_string;
print(" (preloaded format=");printn(job_name);print_char(' ');
print_int(year);print_char('.');
print_int(month);print_char('.');print_int(day);print_char(')');
if(interaction==batch_mode)selector= log_only;
else selector= term_and_log;
str_room(1);
format_ident= make_string();
pack_job_name(format_extension);
while(!w_open_out(&fmt_file))
prompt_file_name("format file name",format_extension);
print_nl("Beginning to dump on file ");

slow_print(w_make_name_string(&fmt_file));flush_string;
print_nl("");slow_print(format_ident)

	/*:1327*/
	#line 23719 "ctex.w"
;
	/*1306:*/
	#line 23799 "ctex.w"

dump_int(0);
dump_int(mem_bot);
dump_int(mem_top);
dump_int(eqtb_size);
dump_int(hash_prime);
dump_int(hyph_size)

	/*:1306*/
	#line 23720 "ctex.w"
;
	/*1308:*/
	#line 23832 "ctex.w"

dump_int(pool_ptr);
dump_int(str_ptr);
for(k= 0;k<=str_ptr;k++)dump_int(str_start[k]);
k= 0;
while(k+4<pool_ptr)
{dump_four_ASCII;k= k+4;
}
k= pool_ptr-4;dump_four_ASCII;
print_ln();print_int(str_ptr);print(" strings of total length ");
print_int(pool_ptr)

	/*:1308*/
	#line 23721 "ctex.w"
;
	/*1310:*/
	#line 23867 "ctex.w"

sort_avail();var_used= 0;
dump_int(lo_mem_max);dump_int(rover);
p= mem_bot;q= rover;x= 0;
do{for(k= p;k<=q+1;k++)dump_wd(mem[k]);
x= x+q+2-p;var_used= var_used+q-p;
p= q+node_size(q);q= rlink(q);
}while(!(q==rover));
var_used= var_used+lo_mem_max-p;dyn_used= mem_end+1-hi_mem_min;
for(k= p;k<=lo_mem_max;k++)dump_wd(mem[k]);
x= x+lo_mem_max+1-p;
dump_int(hi_mem_min);dump_int(avail);
for(k= hi_mem_min;k<=mem_end;k++)dump_wd(mem[k]);
x= x+mem_end+1-hi_mem_min;
p= avail;
while(p!=null)
{decr(dyn_used);p= link(p);
}
dump_int(var_used);dump_int(dyn_used);
print_ln();print_int(x);
print(" memory locations dumped; current usage is ");
print_int(var_used);print_char('&');print_int(dyn_used)

	/*:1310*/
	#line 23722 "ctex.w"
;
	/*1312:*/
	#line 23912 "ctex.w"

	/*1314:*/
	#line 23930 "ctex.w"

k= active_base;
do{j= k;
while(j<int_base-1)
{if((equiv(j)==equiv(j+1))&&(eq_type(j)==eq_type(j+1))&&
(eq_level(j)==eq_level(j+1)))goto found1;
incr(j);
}
l= int_base;goto done1;
found1:incr(j);l= j;
while(j<int_base-1)
{if((equiv(j)!=equiv(j+1))||(eq_type(j)!=eq_type(j+1))||
(eq_level(j)!=eq_level(j+1)))goto done1;
incr(j);
}
done1:dump_int(l-k);
while(k<l)
{dump_wd(eqtb[k]);incr(k);
}
k= j+1;dump_int(k-l);
}while(!(k==int_base))

	/*:1314*/
	#line 23913 "ctex.w"
;
	/*1315:*/
	#line 23952 "ctex.w"

do{j= k;
while(j<eqtb_size)
{if(eqtb[j].i==eqtb[j+1].i)goto found2;
incr(j);
}
l= eqtb_size+1;goto done2;
found2:incr(j);l= j;
while(j<eqtb_size)
{if(eqtb[j].i!=eqtb[j+1].i)goto done2;
incr(j);
}
done2:dump_int(l-k);
while(k<l)
{dump_wd(eqtb[k]);incr(k);
}
k= j+1;dump_int(k-l);
}while(!(k>eqtb_size))

	/*:1315*/
	#line 23914 "ctex.w"
;
dump_int(par_loc);dump_int(write_loc);
	/*1317:*/
	#line 23988 "ctex.w"

dump_int(hash_used);cs_count= frozen_control_sequence-1-hash_used;
for(p= hash_base;p<=hash_used;p++)if(text(p)!=0)
{dump_int(p);dump_hh(hash[p]);incr(cs_count);
}
for(p= hash_used+1;p<=undefined_control_sequence-1;p++)dump_hh(hash[p]);
dump_int(cs_count);
print_ln();print_int(cs_count);print(" multiletter control sequences")

	/*:1317*/
	#line 23916 "ctex.w"


	/*:1312*/
	#line 23723 "ctex.w"
;
	/*1319:*/
	#line 24004 "ctex.w"

dump_int(fmem_ptr);
for(k= 0;k<=fmem_ptr-1;k++)dump_wd(font_info[k]);
dump_int(font_ptr);
for(k= null_font;k<=font_ptr;k++)
	/*1321:*/
	#line 24021 "ctex.w"

{dump_qqqq(font_check[k]);
dump_int(font_size[k]);
dump_int(font_dsize[k]);
dump_int(font_params[k]);
dump_int(hyphen_char[k]);
dump_int(skew_char[k]);
dump_int(font_name[k]);
dump_int(font_area[k]);
dump_int(font_bc[k]);
dump_int(font_ec[k]);
dump_int(char_base[k]);
dump_int(width_base[k]);
dump_int(height_base[k]);
dump_int(depth_base[k]);
dump_int(italic_base[k]);
dump_int(lig_kern_base[k]);
dump_int(kern_base[k]);
dump_int(exten_base[k]);
dump_int(param_base[k]);
dump_int(font_glue[k]);
dump_int(bchar_label[k]);
dump_int(font_bchar[k]);
dump_int(font_false_bchar[k]);
print_nl("\\font");printn_esc(font_id_text(k));print_char('=');
printn_file_name(font_name[k],font_area[k],empty_string);
if(font_size[k]!=font_dsize[k])
{print(" at ");print_scaled(font_size[k]);print("pt");
}
}

	/*:1321*/
	#line 24009 "ctex.w"
;
print_ln();print_int(fmem_ptr-7);print(" words of font info for ");
print_int(font_ptr-font_base);print(" preloaded font");
if(font_ptr!=font_base+1)print_char('s')

	/*:1319*/
	#line 23724 "ctex.w"
;
	/*1323:*/
	#line 24078 "ctex.w"

dump_int(hyph_count);
for(k= 0;k<=hyph_size;k++)if(hyph_word[k]!=0)
{dump_int(k);dump_int(hyph_word[k]);dump_int(hyph_list[k]);
}
print_ln();print_int(hyph_count);print(" hyphenation exception");
if(hyph_count!=1)print_char('s');
if(trie_not_ready)init_trie();
dump_int(trie_max);
for(k= 0;k<=trie_max;k++)dump_hh(trie[k]);
dump_int(trie_op_ptr);
for(k= 1;k<=trie_op_ptr;k++)
{dump_int(hyf_distance[k]);
dump_int(hyf_num[k]);
dump_int(hyf_next[k]);
}
print_nl("Hyphenation trie of length ");print_int(trie_max);

print(" has ");print_int(trie_op_ptr);print(" op");
if(trie_op_ptr!=1)print_char('s');
print(" out of ");print_int(trie_op_size);
for(k= 255;k>=0;k--)if(trie_used[k]>min_quarterword)
{print_nl("  ");print_int(qo(trie_used[k]));
print(" for language ");print_int(k);
dump_int(k);dump_int(qo(trie_used[k]));
}

	/*:1323*/
	#line 23725 "ctex.w"
;
	/*1325:*/
	#line 24148 "ctex.w"

dump_int(interaction);dump_int(format_ident);dump_int(69069);
tracing_stats= 0

	/*:1325*/
	#line 23726 "ctex.w"
;
	/*1328:*/
	#line 24175 "ctex.w"

w_close(&fmt_file)

	/*:1328*/
	#line 23727 "ctex.w"
;
}
#endif

	/*:1301*/	/*1347:*/
	#line 24613 "ctex.w"

	/*1348:*/
	#line 24634 "ctex.w"

static void new_whatsit(small_number s,small_number w)
{pointer p;
p= get_node(w);type(p)= whatsit_node;subtype(p)= s;
link(tail)= p;tail= p;
}

	/*:1348*/	/*1349:*/
	#line 24644 "ctex.w"

static void new_write_whatsit(small_number w)
{new_whatsit(cur_chr,w);
if(w!=write_node_size)scan_four_bit_int();
else{scan_int();
if(cur_val<0)cur_val= 17;
else if(cur_val>15)cur_val= 16;
}
write_stream(tail)= cur_val;
}

	/*:1349*/
	#line 24614 "ctex.w"

static void do_extension(void)
{int k;
pointer p;
switch(cur_chr){
case open_node:	/*1350:*/
	#line 24655 "ctex.w"

{new_write_whatsit(open_node_size);
scan_optional_equals();scan_file_name();
open_name(tail)= cur_name;open_area(tail)= s_no(cur_area);open_ext(tail)= s_no(cur_ext);
}

	/*:1350*/
	#line 24619 "ctex.w"
break;
case write_node:	/*1351:*/
	#line 24665 "ctex.w"

{k= cur_cs;new_write_whatsit(write_node_size);
cur_cs= k;p= scan_toks(false,false);write_tokens(tail)= def_ref;
}

	/*:1351*/
	#line 24620 "ctex.w"
break;
case close_node:	/*1352:*/
	#line 24670 "ctex.w"

{new_write_whatsit(write_node_size);write_tokens(tail)= null;
}

	/*:1352*/
	#line 24621 "ctex.w"
break;
case special_node:	/*1353:*/
	#line 24677 "ctex.w"

{new_whatsit(special_node,write_node_size);write_stream(tail)= null;
p= scan_toks(false,true);write_tokens(tail)= def_ref;
}

	/*:1353*/
	#line 24622 "ctex.w"
break;
case immediate_code:	/*1374:*/
	#line 24900 "ctex.w"

{get_x_token();
if((cur_cmd==extension)&&(cur_chr<=close_node))
{p= tail;do_extension();
out_what(tail);
flush_node_list(tail);tail= p;link(p)= null;
}
else back_input();
}

	/*:1374*/
	#line 24623 "ctex.w"
break;
case set_language_code:	/*1376:*/
	#line 24928 "ctex.w"

if(abs(mode)!=hmode)report_illegal_case();
else{new_whatsit(language_node,small_node_size);
scan_int();
if(cur_val<=0)clang= 0;
else if(cur_val>255)clang= 0;
else clang= cur_val;
what_lang(tail)= clang;
what_lhm(tail)= norm_min(left_hyphen_min);
what_rhm(tail)= norm_min(right_hyphen_min);
}

	/*:1376*/
	#line 24624 "ctex.w"
break;
default:confusion("ext1");

}
}

	/*:1347*/	/*1375:*/
	#line 24914 "ctex.w"

static void fix_language(void)
{ASCII_code l;
if(language<=0)l= 0;
else if(language>255)l= 0;
else l= language;
if(l!=clang)
{new_whatsit(language_node,small_node_size);
what_lang(tail)= l;clang= l;
what_lhm(tail)= norm_min(left_hyphen_min);
what_rhm(tail)= norm_min(right_hyphen_min);
}
}

	/*:1375*/
	#line 19989 "ctex.w"

	/*1067:*/
	#line 20671 "ctex.w"

static void handle_right_brace(void)
{pointer p,q;
scaled d;
int f;
switch(cur_group){
case simple_group:unsave();break;
case bottom_level:{print_err("Too many }'s");

help2("You've closed more groups than you opened.",
"Such booboos are generally harmless, so keep going.");error();
}break;
case semi_simple_group:case math_shift_group:case math_left_group:extra_right_brace();break;
	/*1084:*/
	#line 21009 "ctex.w"

case hbox_group:package(0);break;
case adjusted_hbox_group:{adjust_tail= adjust_head;package(0);
}break;
case vbox_group:{end_graf();package(0);
}break;
case vtop_group:{end_graf();package(vtop_code);
}break;

	/*:1084*/	/*1099:*/
	#line 21166 "ctex.w"

case insert_group:{end_graf();q= split_top_skip;add_glue_ref(q);
d= split_max_depth;f= floating_penalty;unsave();decr(save_ptr);

p= vpack(link(head),natural);pop_nest();
if(saved(0)<255)
{tail_append(get_node(ins_node_size));
type(tail)= ins_node;subtype(tail)= qi(saved(0));
height(tail)= height(p)+depth(p);ins_ptr(tail)= list_ptr(p);
split_top_ptr(tail)= q;depth(tail)= d;float_cost(tail)= f;
}
else{tail_append(get_node(small_node_size));
type(tail)= adjust_node;
subtype(tail)= 0;
adjust_ptr(tail)= list_ptr(p);delete_glue_ref(q);
}
free_node(p,box_node_size);
if(nest_ptr==0)build_page();
}break;
case output_group:	/*1025:*/
	#line 19903 "ctex.w"

{if((loc!=null)||
((token_type!=output_text)&&(token_type!=backed_up)))
	/*1026:*/
	#line 19923 "ctex.w"

{print_err("Unbalanced output routine");

help2("Your sneaky output routine has problematic {'s and/or }'s.",
"I can't handle that very well; good luck.");error();
do{get_token();
}while(!(loc==null));
}

	/*:1026*/
	#line 19906 "ctex.w"
;
end_token_list();
end_graf();unsave();output_active= false;insert_penalties= 0;
	/*1027:*/
	#line 19932 "ctex.w"

if(box(255)!=null)
{print_err("Output routine didn't use all of ");
print_esc("box");print_int(255);

help3("Your \\output commands should empty \\box255,",
"e.g., by saying `\\shipout\\box255'.",
"Proceed; I'll discard its present contents.");
box_error(255);
}

	/*:1027*/
	#line 19909 "ctex.w"
;
if(tail!=head)
{link(page_tail)= link(head);
page_tail= tail;
}
if(link(page_head)!=null)
{if(link(contrib_head)==null)contrib_tail= page_tail;
link(page_tail)= link(contrib_head);
link(contrib_head)= link(page_head);
link(page_head)= null;page_tail= page_head;
}
pop_nest();build_page();
}

	/*:1025*/
	#line 21185 "ctex.w"
break;

	/*:1099*/	/*1117:*/
	#line 21368 "ctex.w"

case disc_group:build_discretionary();break;

	/*:1117*/	/*1131:*/
	#line 21604 "ctex.w"

case align_group:{back_input();cur_tok= cs_token_flag+frozen_cr;
print_err("Missing ");print_esc("cr");print(" inserted");

help1("I'm guessing that you meant to end an alignment here.");
ins_error();
}break;

	/*:1131*/	/*1132:*/
	#line 21612 "ctex.w"

case no_align_group:{end_graf();unsave();align_peek();
}break;

	/*:1132*/	/*1167:*/
	#line 22065 "ctex.w"

case vcenter_group:{end_graf();unsave();save_ptr= save_ptr-2;
p= vpack(link(head),saved(1),saved(0));pop_nest();
tail_append(new_noad());type(tail)= vcenter_noad;
math_type(nucleus(tail))= sub_box;info(nucleus(tail))= p;
}break;

	/*:1167*/	/*1172:*/
	#line 22103 "ctex.w"

case math_choice_group:build_choices();break;

	/*:1172*/	/*1185:*/
	#line 22277 "ctex.w"

case math_group:{unsave();decr(save_ptr);
math_type(saved(0))= sub_mlist;p= fin_mlist(null);info(saved(0))= p;
if(p!=null)if(link(p)==null)
if(type(p)==ord_noad)
{if(math_type(subscr(p))==empty)
if(math_type(supscr(p))==empty)
{mem[saved(0)].hh= mem[nucleus(p)].hh;
free_node(p,noad_size);
}
}
else if(type(p)==accent_noad)if(saved(0)==nucleus(tail))
if(type(tail)==ord_noad)	/*1186:*/
	#line 22292 "ctex.w"

{q= head;while(link(q)!=tail)q= link(q);
link(q)= p;free_node(tail,noad_size);tail= p;
}

	/*:1186*/
	#line 22289 "ctex.w"
;
}break;

	/*:1185*/
	#line 20684 "ctex.w"

default:confusion("rightbrace");

}
}

	/*:1067*/
	#line 19990 "ctex.w"

static void main_control(void)
{




int t;
if(every_job!=null)begin_token_list(every_job,every_job_text);
big_switch:get_x_token();
reswitch:	/*1030:*/
	#line 20025 "ctex.w"

if(interrupt!=0)if(OK_to_interrupt)
{back_input();check_interrupt;goto big_switch;
}
#ifdef DEBUG
if(panicking)check_mem(false);
#endif
if(tracing_commands>0)show_cur_cmd_chr()

	/*:1030*/
	#line 20000 "ctex.w"
;
switch(abs(mode)+cur_cmd){
case hmode+letter:case hmode+other_char:case hmode+char_given:goto main_loop;
case hmode+char_num:{scan_char_num();cur_chr= cur_val;goto main_loop;}
case hmode+no_boundary:{get_x_token();
if((cur_cmd==letter)||(cur_cmd==other_char)||(cur_cmd==char_given)||
(cur_cmd==char_num))cancel_boundary= true;
goto reswitch;
}
case hmode+spacer:if(space_factor==1000)goto append_normal_space;
else app_space();break;
case hmode+ex_space:case mmode+ex_space:goto append_normal_space;
	/*1044:*/
	#line 20339 "ctex.w"

any_mode(relax):case vmode+spacer:case mmode+spacer:case mmode+no_boundary:do_nothing;
any_mode(ignore_spaces):{	/*405:*/
	#line 8201 "ctex.w"

do{get_x_token();
}while(!(cur_cmd!=spacer))

	/*:405*/
	#line 20341 "ctex.w"
;
goto reswitch;
}
case vmode+stop:if(its_all_over())return;break;
	/*1047:*/
	#line 20386 "ctex.w"

case vmode+vmove:case hmode+hmove:case mmode+hmove:any_mode(last_item):

	/*:1047*/	/*1097:*/
	#line 21147 "ctex.w"

case vmode+vadjust:

	/*:1097*/	/*1110:*/
	#line 21307 "ctex.w"
case vmode+ital_corr:

	/*:1110*/	/*1143:*/
	#line 21703 "ctex.w"
non_math(eq_no):

	/*:1143*/
	#line 20345 "ctex.w"
any_mode(mac_param):
report_illegal_case();break;
	/*1045:*/
	#line 20357 "ctex.w"

non_math(sup_mark):non_math(sub_mark):non_math(math_char_num):
non_math(math_given):non_math(math_comp):non_math(delim_num):
non_math(left_right):non_math(above):non_math(radical):
non_math(math_style):non_math(math_choice):non_math(vcenter):
non_math(non_script):non_math(mkern):non_math(limit_switch):
non_math(mskip):non_math(math_accent):
case mmode+endv:case mmode+par_end:case mmode+stop:case mmode+vskip:case mmode+un_vbox:
case mmode+valign:case mmode+hrule

	/*:1045*/
	#line 20347 "ctex.w"
:insert_dollar_sign();break;
	/*1055:*/
	#line 20475 "ctex.w"

case vmode+hrule:case hmode+vrule:case mmode+vrule:{tail_append(scan_rule_spec());
if(abs(mode)==vmode)prev_depth= ignore_depth;
else if(abs(mode)==hmode)space_factor= 1000;
}break;

	/*:1055*/	/*1056:*/
	#line 20486 "ctex.w"

case vmode+vskip:case hmode+hskip:case mmode+hskip:case mmode+mskip:append_glue();break;
any_mode(kern):case mmode+mkern:append_kern();break;

	/*:1056*/	/*1062:*/
	#line 20599 "ctex.w"

non_math(left_brace):new_save_level(simple_group);break;
any_mode(begin_group):new_save_level(semi_simple_group);break;
any_mode(end_group):if(cur_group==semi_simple_group)unsave();
else off_save();break;

	/*:1062*/	/*1066:*/
	#line 20668 "ctex.w"

any_mode(right_brace):handle_right_brace();break;

	/*:1066*/	/*1072:*/
	#line 20812 "ctex.w"

case vmode+hmove:case hmode+vmove:case mmode+vmove:{t= cur_chr;
scan_normal_dimen;
if(t==0)scan_box(cur_val);else scan_box(-cur_val);
}break;
any_mode(leader_ship):scan_box(leader_flag-a_leaders+cur_chr);break;
any_mode(make_box):begin_box(0);break;

	/*:1072*/	/*1089:*/
	#line 21055 "ctex.w"

case vmode+start_par:new_graf(cur_chr>0);break;
case vmode+letter:case vmode+other_char:case vmode+char_num:case vmode+char_given:
case vmode+math_shift:case vmode+un_hbox:case vmode+vrule:
case vmode+accent:case vmode+discretionary:case vmode+hskip:case vmode+valign:
case vmode+ex_space:case vmode+no_boundary:
{back_input();new_graf(true);
}break;

	/*:1089*/	/*1091:*/
	#line 21084 "ctex.w"

case hmode+start_par:case mmode+start_par:indent_in_hmode();break;

	/*:1091*/	/*1093:*/
	#line 21104 "ctex.w"

case vmode+par_end:{normal_paragraph();
if(mode>0)build_page();
}break;
case hmode+par_end:{if(align_state<0)off_save();

end_graf();
if(mode==vmode)build_page();
}break;
case hmode+stop:case hmode+vskip:case hmode+hrule:case hmode+un_vbox:case hmode+halign:head_for_vmode();break;

	/*:1093*/	/*1096:*/
	#line 21143 "ctex.w"

any_mode(insert):case hmode+vadjust:case mmode+vadjust:begin_insert_or_adjust();break;
any_mode(mark):make_mark();break;

	/*:1096*/	/*1101:*/
	#line 21198 "ctex.w"

any_mode(break_penalty):append_penalty();break;

	/*:1101*/	/*1103:*/
	#line 21214 "ctex.w"

any_mode(remove_item):delete_last();break;

	/*:1103*/	/*1108:*/
	#line 21281 "ctex.w"

case vmode+un_vbox:case hmode+un_hbox:case mmode+un_hbox:unpackage();break;

	/*:1108*/	/*1111:*/
	#line 21313 "ctex.w"

case hmode+ital_corr:append_italic_correction();break;
case mmode+ital_corr:tail_append(new_kern(0))break;

	/*:1111*/	/*1115:*/
	#line 21345 "ctex.w"

case hmode+discretionary:case mmode+discretionary:append_discretionary();break;

	/*:1115*/	/*1121:*/
	#line 21436 "ctex.w"

case hmode+accent:make_accent();break;

	/*:1121*/	/*1125:*/
	#line 21506 "ctex.w"

any_mode(car_ret):any_mode(tab_mark):align_error();break;
any_mode(no_align):no_align_error();break;
any_mode(omit):omit_error();break;

	/*:1125*/	/*1129:*/
	#line 21573 "ctex.w"

case vmode+halign:case hmode+valign:init_align();break;
case mmode+halign:if(privileged())
if(cur_group==math_shift_group)init_align();
else off_save();break;
case vmode+endv:case hmode+endv:do_endv();break;

	/*:1129*/	/*1133:*/
	#line 21618 "ctex.w"

any_mode(end_cs_name):cs_error();break;

	/*:1133*/	/*1136:*/
	#line 21649 "ctex.w"

case hmode+math_shift:init_math();break;

	/*:1136*/	/*1139:*/
	#line 21679 "ctex.w"

case mmode+eq_no:if(privileged())
if(cur_group==math_shift_group)start_eq_no();
else off_save();break;

	/*:1139*/	/*1149:*/
	#line 21817 "ctex.w"

case mmode+left_brace:{tail_append(new_noad());
back_input();scan_math(nucleus(tail));
}break;

	/*:1149*/	/*1153:*/
	#line 21881 "ctex.w"

case mmode+letter:case mmode+other_char:case mmode+char_given:
set_math_char(ho(math_code(cur_chr)));break;
case mmode+char_num:{scan_char_num();cur_chr= cur_val;
set_math_char(ho(math_code(cur_chr)));
}break;
case mmode+math_char_num:{scan_fifteen_bit_int();set_math_char(cur_val);
}break;
case mmode+math_given:set_math_char(cur_chr);break;
case mmode+delim_num:{scan_twenty_seven_bit_int();
set_math_char(cur_val/010000);
}break;

	/*:1153*/	/*1157:*/
	#line 21965 "ctex.w"

case mmode+math_comp:{tail_append(new_noad());
type(tail)= cur_chr;scan_math(nucleus(tail));
}break;
case mmode+limit_switch:math_limit_switch();break;

	/*:1157*/	/*1161:*/
	#line 22017 "ctex.w"

case mmode+radical:math_radical();break;

	/*:1161*/	/*1163:*/
	#line 22030 "ctex.w"

case mmode+accent:case mmode+math_accent:math_ac();break;

	/*:1163*/	/*1166:*/
	#line 22059 "ctex.w"

case mmode+vcenter:{scan_spec(vcenter_group,false);normal_paragraph();
push_nest();mode= -vmode;prev_depth= ignore_depth;
if(every_vbox!=null)begin_token_list(every_vbox,every_vbox_text);
}break;

	/*:1166*/	/*1170:*/
	#line 22087 "ctex.w"

case mmode+math_style:tail_append(new_style(cur_chr))break;
case mmode+non_script:{tail_append(new_glue(zero_glue));
subtype(tail)= cond_math_glue;
}break;
case mmode+math_choice:append_choices();break;

	/*:1170*/	/*1174:*/
	#line 22127 "ctex.w"

case mmode+sub_mark:case mmode+sup_mark:sub_sup();break;

	/*:1174*/	/*1179:*/
	#line 22197 "ctex.w"

case mmode+above:math_fraction();break;

	/*:1179*/	/*1189:*/
	#line 22312 "ctex.w"

case mmode+left_right:math_left_right();break;

	/*:1189*/	/*1192:*/
	#line 22348 "ctex.w"

case mmode+math_shift:if(cur_group==math_shift_group)after_math();
else off_save();break;

	/*:1192*/
	#line 20348 "ctex.w"

	/*1209:*/
	#line 22635 "ctex.w"

any_mode(toks_register):
any_mode(assign_toks):
any_mode(assign_int):
any_mode(assign_dimen):
any_mode(assign_glue):
any_mode(assign_mu_glue):
any_mode(assign_font_dimen):
any_mode(assign_font_int):
any_mode(set_aux):
any_mode(set_prev_graf):
any_mode(set_page_dimen):
any_mode(set_page_int):
any_mode(set_box_dimen):
any_mode(set_shape):
any_mode(def_code):
any_mode(def_family):
any_mode(set_font):
any_mode(def_font):
any_mode(internal_register):
any_mode(advance):
any_mode(multiply):
any_mode(divide):
any_mode(prefix):
any_mode(let):
any_mode(shorthand_def):
any_mode(read_to_cs):
any_mode(def):
any_mode(set_box):
any_mode(hyph_data):
any_mode(set_interaction):prefixed_command();break;

	/*:1209*/	/*1267:*/
	#line 23417 "ctex.w"

any_mode(after_assignment):{get_token();after_token= cur_tok;
}break;

	/*:1267*/	/*1270:*/
	#line 23438 "ctex.w"

any_mode(after_group):{get_token();save_for_after(cur_tok);
}break;

	/*:1270*/	/*1273:*/
	#line 23454 "ctex.w"

any_mode(in_stream):open_or_close_in();break;

	/*:1273*/	/*1275:*/
	#line 23476 "ctex.w"

any_mode(message):issue_message();break;

	/*:1275*/	/*1284:*/
	#line 23543 "ctex.w"

any_mode(case_shift):shift_case();break;

	/*:1284*/	/*1289:*/
	#line 23585 "ctex.w"

any_mode(xray):show_whatever();break;

	/*:1289*/
	#line 20349 "ctex.w"

	/*1346:*/
	#line 24610 "ctex.w"

any_mode(extension):do_extension();

	/*:1346*/
	#line 20350 "ctex.w"


	/*:1044*/
	#line 20012 "ctex.w"

}
goto big_switch;
main_loop:	/*1033:*/
	#line 20090 "ctex.w"

adjust_space_factor;
main_f= cur_font;
bchar= font_bchar[main_f];false_bchar= font_false_bchar[main_f];
if(mode>0)if(language!=clang)fix_language();
fast_get_avail(lig_stack);font(lig_stack)= main_f;cur_l= qi(cur_chr);
character(lig_stack)= cur_l;
cur_q= tail;
if(cancel_boundary)
{cancel_boundary= false;main_k= non_address;
}
else main_k= bchar_label[main_f];
if(main_k==non_address)goto main_loop_move2;
cur_r= cur_l;cur_l= non_char;
goto main_lig_loop1;

main_loop_wrapup:	/*1034:*/
	#line 20148 "ctex.w"

wrapup(rt_hit)

	/*:1034*/
	#line 20107 "ctex.w"
;
main_loop_move:	/*1035:*/
	#line 20151 "ctex.w"


if(lig_stack==null)goto reswitch;
cur_q= tail;cur_l= character(lig_stack);
main_loop_move1:if(!is_char_node(lig_stack))goto main_loop_move_lig;
main_loop_move2:if((cur_chr<font_bc[main_f])||(cur_chr>font_ec[main_f]))
{char_warning(main_f,cur_chr);free_avail(lig_stack);goto big_switch;
}
main_i= char_info(main_f,cur_l);
if(!char_exists(main_i))
{char_warning(main_f,cur_chr);free_avail(lig_stack);goto big_switch;
}
link(tail)= lig_stack;tail= lig_stack

	/*:1035*/
	#line 20110 "ctex.w"
;
main_loop_lookahead:	/*1037:*/
	#line 20183 "ctex.w"

get_next();
if(cur_cmd==letter)goto main_loop_lookahead1;
if(cur_cmd==other_char)goto main_loop_lookahead1;
if(cur_cmd==char_given)goto main_loop_lookahead1;
x_token();
if(cur_cmd==letter)goto main_loop_lookahead1;
if(cur_cmd==other_char)goto main_loop_lookahead1;
if(cur_cmd==char_given)goto main_loop_lookahead1;
if(cur_cmd==char_num)
{scan_char_num();cur_chr= cur_val;goto main_loop_lookahead1;
}
if(cur_cmd==no_boundary)bchar= non_char;
cur_r= bchar;lig_stack= null;goto main_lig_loop;
main_loop_lookahead1:adjust_space_factor;
fast_get_avail(lig_stack);font(lig_stack)= main_f;
cur_r= qi(cur_chr);character(lig_stack)= cur_r;
if(cur_r==false_bchar)cur_r= non_char

	/*:1037*/
	#line 20112 "ctex.w"
;
main_lig_loop:	/*1038:*/
	#line 20212 "ctex.w"

if(char_tag(main_i)!=lig_tag)goto main_loop_wrapup;
if(cur_r==non_char)goto main_loop_wrapup;
main_k= lig_kern_start(main_f,main_i);main_j= font_info[main_k].qqqq;
if(skip_byte(main_j)<=stop_flag)goto main_lig_loop2;
main_k= lig_kern_restart(main_f,main_j);
main_lig_loop1:main_j= font_info[main_k].qqqq;
main_lig_loop2:if(next_char(main_j)==cur_r)
if(skip_byte(main_j)<=stop_flag)
	/*1039:*/
	#line 20238 "ctex.w"

{if(op_byte(main_j)>=kern_flag)
{wrapup(rt_hit);
tail_append(new_kern(char_kern(main_f,main_j)));goto main_loop_move;
}
if(cur_l==non_char)lft_hit= true;
else if(lig_stack==null)rt_hit= true;
check_interrupt;
switch(op_byte(main_j)){
case qi(1):case qi(5):{cur_l= rem_byte(main_j);
main_i= char_info(main_f,cur_l);ligature_present= true;
}break;
case qi(2):case qi(6):{cur_r= rem_byte(main_j);
if(lig_stack==null)
{lig_stack= new_lig_item(cur_r);bchar= non_char;
}
else if(is_char_node(lig_stack))
{main_p= lig_stack;lig_stack= new_lig_item(cur_r);
lig_ptr(lig_stack)= main_p;
}
else character(lig_stack)= cur_r;
}break;
case qi(3):{cur_r= rem_byte(main_j);
main_p= lig_stack;lig_stack= new_lig_item(cur_r);
link(lig_stack)= main_p;
}break;
case qi(7):case qi(11):{wrapup(false);
cur_q= tail;cur_l= rem_byte(main_j);
main_i= char_info(main_f,cur_l);ligature_present= true;
}break;
default:{cur_l= rem_byte(main_j);ligature_present= true;
if(lig_stack==null)goto main_loop_wrapup;
else goto main_loop_move1;
}
}
if(op_byte(main_j)>qi(4))
if(op_byte(main_j)!=qi(7))goto main_loop_wrapup;
if(cur_l<non_char)goto main_lig_loop;
main_k= bchar_label[main_f];goto main_lig_loop1;
}

	/*:1039*/
	#line 20222 "ctex.w"
;
if(skip_byte(main_j)==qi(0))incr(main_k);
else{if(skip_byte(main_j)>=stop_flag)goto main_loop_wrapup;
main_k= main_k+qo(skip_byte(main_j))+1;
}
goto main_lig_loop1

	/*:1038*/
	#line 20114 "ctex.w"
;
main_loop_move_lig:	/*1036:*/
	#line 20168 "ctex.w"

main_p= lig_ptr(lig_stack);
if(main_p>null)tail_append(main_p);
temp_ptr= lig_stack;lig_stack= link(temp_ptr);
free_node(temp_ptr,small_node_size);
main_i= char_info(main_f,cur_l);ligature_present= true;
if(lig_stack==null)
if(main_p>null)goto main_loop_lookahead;
else cur_r= bchar;
else cur_r= character(lig_stack);
goto main_lig_loop

	/*:1036*/
	#line 20116 "ctex.w"


	/*:1033*/
	#line 20016 "ctex.w"
;
append_normal_space:	/*1040:*/
	#line 20290 "ctex.w"

if(space_skip==zero_glue)
{	/*1041:*/
	#line 20304 "ctex.w"

{main_p= font_glue[cur_font];
if(main_p==null)
{main_p= new_spec(zero_glue);main_k= param_base[cur_font]+space_code;
width(main_p)= font_info[main_k].sc;
stretch(main_p)= font_info[main_k+1].sc;
shrink(main_p)= font_info[main_k+2].sc;
font_glue[cur_font]= main_p;
}
}

	/*:1041*/
	#line 20292 "ctex.w"
;
temp_ptr= new_glue(main_p);
}
else temp_ptr= new_param_glue(space_skip_code);
link(tail)= temp_ptr;tail= temp_ptr;
goto big_switch

	/*:1040*/
	#line 20018 "ctex.w"
;
}

	/*:1029*/	/*1283:*/
	#line 23536 "ctex.w"
static void give_err_help(void)
{token_show(err_help);
}

	/*:1283*/	/*1302:*/
	#line 23741 "ctex.w"
	/*523:*/
	#line 10147 "ctex.w"

static bool open_fmt_file(void)
{
int j;
j= loc;
if(buffer[loc]=='&')
{incr(loc);j= loc;buffer[last]= ' ';
while(buffer[j]!=' ')incr(j);
pack_buffered_name(0,loc,j-1);
if(w_open_in(&fmt_file))goto found;
pack_buffered_name(format_area_length,loc,j-1);

if(w_open_in(&fmt_file))goto found;
wake_up_terminal;
wterm_ln("Sorry, I can't find that format; will try PLAIN.");

update_terminal;
}

pack_buffered_name(format_default_length-format_ext_length,1,0);
if(!w_open_in(&fmt_file))
{wake_up_terminal;
wterm_ln("I can't find the PLAIN format file!");


return false;
}
found:loc= j;return true;
}

	/*:523*/
	#line 23741 "ctex.w"

static bool load_fmt_file(void)
{
int j,k;
int p,q;
int x;
four_quarters w;
	/*1307:*/
	#line 23813 "ctex.w"

x= fmt_file.d.i;
if(x!=0)goto bad_fmt;
undump_int(x);
if(x!=mem_bot)goto bad_fmt;
undump_int(x);
if(x!=mem_top)goto bad_fmt;
undump_int(x);
if(x!=eqtb_size)goto bad_fmt;
undump_int(x);
if(x!=hash_prime)goto bad_fmt;
undump_int(x);
if(x!=hyph_size)goto bad_fmt

	/*:1307*/
	#line 23748 "ctex.w"
;
	/*1309:*/
	#line 23849 "ctex.w"

undump_size(0,pool_size,"string pool size",pool_ptr);
undump_size(0,max_strings,"max strings",str_ptr);
for(k= 0;k<=str_ptr;k++)undump(0,pool_ptr,str_start[k]);
k= 0;
while(k+4<pool_ptr)
{undump_four_ASCII;k= k+4;
}
k= pool_ptr-4;undump_four_ASCII;
init_str_ptr= str_ptr;init_pool_ptr= pool_ptr

	/*:1309*/
	#line 23749 "ctex.w"
;
	/*1311:*/
	#line 23890 "ctex.w"

undump(lo_mem_stat_max+1000,hi_mem_stat_min-1,lo_mem_max);
undump(lo_mem_stat_max+1,lo_mem_max,rover);
p= mem_bot;q= rover;
do{for(k= p;k<=q+1;k++)undump_wd(mem[k]);
p= q+node_size(q);
if((p>lo_mem_max)||((q>=rlink(q))&&(rlink(q)!=rover)))goto bad_fmt;
q= rlink(q);
}while(!(q==rover));
for(k= p;k<=lo_mem_max;k++)undump_wd(mem[k]);
if(mem_min<mem_bot-2)
{p= llink(rover);q= mem_min+1;
link(mem_min)= null;info(mem_min)= null;
rlink(p)= q;llink(rover)= q;
rlink(q)= rover;llink(q)= p;link(q)= empty_flag;
node_size(q)= mem_bot-q;
}
undump(lo_mem_max+1,hi_mem_stat_min,hi_mem_min);
undump(null,mem_top,avail);mem_end= mem_top;
for(k= hi_mem_min;k<=mem_end;k++)undump_wd(mem[k]);
undump_int(var_used);undump_int(dyn_used)

	/*:1311*/
	#line 23750 "ctex.w"
;
	/*1313:*/
	#line 23918 "ctex.w"

	/*1316:*/
	#line 23971 "ctex.w"

k= active_base;
do{undump_int(x);
if((x<1)||(k+x>eqtb_size+1))goto bad_fmt;
for(j= k;j<=k+x-1;j++)undump_wd(eqtb[j]);
k= k+x;
undump_int(x);
if((x<0)||(k+x>eqtb_size+1))goto bad_fmt;
for(j= k;j<=k+x-1;j++)eqtb[j]= eqtb[k-1];
k= k+x;
}while(!(k>eqtb_size))

	/*:1316*/
	#line 23919 "ctex.w"
;
undump(hash_base,frozen_control_sequence,par_loc);
par_token= cs_token_flag+par_loc;
undump(hash_base,frozen_control_sequence,write_loc);
	/*1318:*/
	#line 23997 "ctex.w"

undump(hash_base,frozen_control_sequence,hash_used);p= hash_base-1;
do{undump(p+1,hash_used,p);undump_hh(hash[p]);
}while(!(p==hash_used));
for(p= hash_used+1;p<=undefined_control_sequence-1;p++)undump_hh(hash[p]);
undump_int(cs_count)

	/*:1318*/
	#line 23923 "ctex.w"


	/*:1313*/
	#line 23751 "ctex.w"
;
	/*1320:*/
	#line 24014 "ctex.w"

undump_size(7,font_mem_size,"font mem size",fmem_ptr);
for(k= 0;k<=fmem_ptr-1;k++)undump_wd(font_info[k]);
undump_size(font_base,font_max,"font max",font_ptr);
for(k= null_font;k<=font_ptr;k++)
	/*1322:*/
	#line 24052 "ctex.w"

{undump_qqqq(font_check[k]);
undump_int(font_size[k]);
undump_int(font_dsize[k]);
undump(min_halfword,max_halfword,font_params[k]);
undump_int(hyphen_char[k]);
undump_int(skew_char[k]);
undump(0,str_ptr,font_name[k]);
undump(0,str_ptr,font_area[k]);
undump(0,255,font_bc[k]);
undump(0,255,font_ec[k]);
undump_int(char_base[k]);
undump_int(width_base[k]);
undump_int(height_base[k]);
undump_int(depth_base[k]);
undump_int(italic_base[k]);
undump_int(lig_kern_base[k]);
undump_int(kern_base[k]);
undump_int(exten_base[k]);
undump_int(param_base[k]);
undump(min_halfword,lo_mem_max,font_glue[k]);
undump(0,fmem_ptr-1,bchar_label[k]);
undump(min_quarterword,non_char,font_bchar[k]);
undump(min_quarterword,non_char,font_false_bchar[k]);
}

	/*:1322*/
	#line 24019 "ctex.w"


	/*:1320*/
	#line 23752 "ctex.w"
;
	/*1324:*/
	#line 24107 "ctex.w"

undump(0,hyph_size,hyph_count);
for(k= 1;k<=hyph_count;k++)
{undump(0,hyph_size,j);
undump(0,str_ptr,hyph_word[j]);
undump(min_halfword,max_halfword,hyph_list[j]);
}
undump_size(0,trie_size,"trie size",j);
#ifdef INIT
trie_max= j;
#endif
for(k= 0;k<=j;k++)undump_hh(trie[k]);
undump_size(0,trie_op_size,"trie op size",j);
#ifdef INIT
trie_op_ptr= j;
#endif
for(k= 1;k<=j;k++)
{undump(0,63,hyf_distance[k]);
undump(0,63,hyf_num[k]);
undump(min_quarterword,max_quarterword,hyf_next[k]);
}
#ifdef INIT
for(k= 0;k<=255;k++)trie_used[k]= min_quarterword;
#endif

k= 256;
while(j>0)
{undump(0,k-1,k);undump(1,j,x);
#ifdef INIT
trie_used[k]= qi(x);
#endif

j= j-x;op_start[k]= qo(j);
}
#ifdef INIT
trie_not_ready= false
#endif

	/*:1324*/
	#line 23753 "ctex.w"
;
	/*1326:*/
	#line 24152 "ctex.w"

undump(batch_mode,error_stop_mode,interaction);
undump(0,str_ptr,format_ident);
undump_int(x);
if((x!=69069)||eof(fmt_file))goto bad_fmt

	/*:1326*/
	#line 23754 "ctex.w"
;
return true;
bad_fmt:wake_up_terminal;
wterm_ln("(Fatal format file error; I'm stymied)");

return false;
}

	/*:1302*/	/*1329:*/
	#line 24185 "ctex.w"
	/*1332:*/
	#line 24280 "ctex.w"

static void close_files_and_terminate(void)
{int k;
	/*1377:*/
	#line 24940 "ctex.w"

for(k= 0;k<=15;k++)if(write_open[k])a_close(&write_file[k])

	/*:1377*/
	#line 24283 "ctex.w"
;
#ifdef STAT
if(tracing_stats>0)	/*1333:*/
	#line 24302 "ctex.w"

if(log_opened)
{wlog_ln(" ");
wlog_ln("Here is how much of TeX's memory you used:");

wlog(" %d string",str_ptr-init_str_ptr);
if(str_ptr!=init_str_ptr+1)wlog("s");
wlog_ln(" out of %d",max_strings-init_str_ptr);
wlog_ln(" %d string characters out of %d",pool_ptr-init_pool_ptr,
pool_size-init_pool_ptr);
wlog_ln(" %d words of memory out of %d",lo_mem_max-mem_min+mem_end-hi_mem_min+2,
mem_end+1-mem_min);
wlog_ln(" %d multiletter control sequences out of %d",cs_count,hash_size);
wlog(" %d words of font info for %d font",fmem_ptr,font_ptr-font_base);
if(font_ptr!=font_base+1)wlog("s");
wlog_ln(", out of %d for %d",font_mem_size,font_max-font_base);
wlog(" %d hyphenation exception",hyph_count);
if(hyph_count!=1)wlog("s");
wlog_ln(" out of %d",hyph_size);
wlog_ln(" %di,%dn,%dp,%db,%ds stack positions out of %di,%dn,%dp,%db,%ds",
max_in_stack,max_nest_stack,
max_param_stack,
max_buf_stack+1,
max_save_stack+6,
stack_size,
nest_size,
param_size,
buf_size,
save_size);
}

	/*:1333*/
	#line 24285 "ctex.w"
;
#endif
wake_up_terminal;	/*641:*/
	#line 12761 "ctex.w"

while(cur_s>-1)
{if(cur_s>0)dvi_out(pop)
else{dvi_out(eop);incr(total_pages);
}
decr(cur_s);
}
if(total_pages==0)print_nl("No pages of output.");

else{dvi_out(post);
dvi_four(last_bop);last_bop= dvi_offset+dvi_ptr-5;
dvi_four(25400000);dvi_four(473628672);
prepare_mag();dvi_four(mag);
dvi_four(max_v);dvi_four(max_h);
dvi_out(max_push/256);dvi_out(max_push%256);
dvi_out((total_pages/256)%256);dvi_out(total_pages%256);
	/*642:*/
	#line 12792 "ctex.w"

while(font_ptr>font_base)
{if(font_used[font_ptr])dvi_font_def(font_ptr);
decr(font_ptr);
}

	/*:642*/
	#line 12777 "ctex.w"
;
dvi_out(post_post);dvi_four(last_bop);dvi_out(id_byte);
k= 4+((dvi_buf_size-dvi_ptr)%4);
while(k>0)
{dvi_out(223);decr(k);
}
	/*598:*/
	#line 11943 "ctex.w"

if(dvi_limit==half_buf)write_dvi(half_buf,dvi_buf_size-1);
if(dvi_ptr>0)write_dvi(0,dvi_ptr-1)

	/*:598*/
	#line 12783 "ctex.w"
;
print_nl("Output written on ");slow_print(output_file_name);

print(" (");print_int(total_pages);print(" page");
if(total_pages!=1)print_char('s');
print(", ");print_int(dvi_offset+dvi_ptr);print(" bytes).");
b_close(&dvi_file);
}

	/*:641*/
	#line 24287 "ctex.w"
;
if(log_opened)
{wlog_cr;a_close(&log_file);selector= selector-2;
if(selector==term_only)
{print_nl("Transcript written on ");

slow_print(log_name);print_char('.');print_nl("");
}
}
}

	/*:1332*/	/*1334:*/
	#line 24336 "ctex.w"

static void final_cleanup(void)
{
int c;
c= cur_chr;
if(job_name==0)open_log_file();
while(input_ptr>0)
if(state==token_list)end_token_list();else end_file_reading();
while(open_parens>0)
{print(" )");decr(open_parens);
}
if(cur_level>level_one)
{print_nl("(");print_esc("end occurred ");
print("inside a group at level ");

print_int(cur_level-level_one);print_char(')');
}
while(cond_ptr!=null)
{print_nl("(");print_esc("end occurred ");
print("when ");print_cmd_chr(if_test,cur_if);
if(if_line!=0)
{print(" on line ");print_int(if_line);
}
print(" was incomplete)");
if_line= if_line_field(cond_ptr);
cur_if= subtype(cond_ptr);temp_ptr= cond_ptr;
cond_ptr= link(cond_ptr);free_node(temp_ptr,if_node_size);
}
if(history!=spotless)
if(((history==warning_issued)||(interaction<error_stop_mode)))
if(selector==term_and_log)
{selector= term_only;
print_nl("(see the transcript file for additional information)");

selector= term_and_log;
}
if(c==1)
{
#ifdef INIT
for(c= top_mark_code;c<=split_bot_mark_code;c++)
if(cur_mark[c]!=null)delete_token_ref(cur_mark[c]);
if(last_glue!=max_halfword)delete_glue_ref(last_glue);
store_fmt_file();return;
#endif
print_nl("(\\dump is performed only by INITEX)");return;

}
}

	/*:1334*/	/*1335:*/
	#line 24385 "ctex.w"

#ifdef INIT
static void init_prim(void)
{no_new_control_sequence= false;
	/*225:*/
	#line 4635 "ctex.w"

primitive("lineskip",assign_glue,glue_base+line_skip_code);

primitive("baselineskip",assign_glue,glue_base+baseline_skip_code);

primitive("parskip",assign_glue,glue_base+par_skip_code);

primitive("abovedisplayskip",assign_glue,glue_base+above_display_skip_code);

primitive("belowdisplayskip",assign_glue,glue_base+below_display_skip_code);

primitive("abovedisplayshortskip",
assign_glue,glue_base+above_display_short_skip_code);

primitive("belowdisplayshortskip",
assign_glue,glue_base+below_display_short_skip_code);

primitive("leftskip",assign_glue,glue_base+left_skip_code);

primitive("rightskip",assign_glue,glue_base+right_skip_code);

primitive("topskip",assign_glue,glue_base+top_skip_code);

primitive("splittopskip",assign_glue,glue_base+split_top_skip_code);

primitive("tabskip",assign_glue,glue_base+tab_skip_code);

primitive("spaceskip",assign_glue,glue_base+space_skip_code);

primitive("xspaceskip",assign_glue,glue_base+xspace_skip_code);

primitive("parfillskip",assign_glue,glue_base+par_fill_skip_code);

primitive("thinmuskip",assign_mu_glue,glue_base+thin_mu_skip_code);

primitive("medmuskip",assign_mu_glue,glue_base+med_mu_skip_code);

primitive("thickmuskip",assign_mu_glue,glue_base+thick_mu_skip_code);


	/*:225*/	/*229:*/
	#line 4756 "ctex.w"

primitive("output",assign_toks,output_routine_loc);

primitive("everypar",assign_toks,every_par_loc);

primitive("everymath",assign_toks,every_math_loc);

primitive("everydisplay",assign_toks,every_display_loc);

primitive("everyhbox",assign_toks,every_hbox_loc);

primitive("everyvbox",assign_toks,every_vbox_loc);

primitive("everyjob",assign_toks,every_job_loc);

primitive("everycr",assign_toks,every_cr_loc);

primitive("errhelp",assign_toks,err_help_loc);


	/*:229*/	/*237:*/
	#line 5089 "ctex.w"

primitive("pretolerance",assign_int,int_base+pretolerance_code);

primitive("tolerance",assign_int,int_base+tolerance_code);

primitive("linepenalty",assign_int,int_base+line_penalty_code);

primitive("hyphenpenalty",assign_int,int_base+hyphen_penalty_code);

primitive("exhyphenpenalty",assign_int,int_base+ex_hyphen_penalty_code);

primitive("clubpenalty",assign_int,int_base+club_penalty_code);

primitive("widowpenalty",assign_int,int_base+widow_penalty_code);

primitive("displaywidowpenalty",
assign_int,int_base+display_widow_penalty_code);

primitive("brokenpenalty",assign_int,int_base+broken_penalty_code);

primitive("binoppenalty",assign_int,int_base+bin_op_penalty_code);

primitive("relpenalty",assign_int,int_base+rel_penalty_code);

primitive("predisplaypenalty",assign_int,int_base+pre_display_penalty_code);

primitive("postdisplaypenalty",assign_int,int_base+post_display_penalty_code);

primitive("interlinepenalty",assign_int,int_base+inter_line_penalty_code);

primitive("doublehyphendemerits",
assign_int,int_base+double_hyphen_demerits_code);

primitive("finalhyphendemerits",
assign_int,int_base+final_hyphen_demerits_code);

primitive("adjdemerits",assign_int,int_base+adj_demerits_code);

primitive("mag",assign_int,int_base+mag_code);

primitive("delimiterfactor",assign_int,int_base+delimiter_factor_code);

primitive("looseness",assign_int,int_base+looseness_code);

primitive("time",assign_int,int_base+time_code);

primitive("day",assign_int,int_base+day_code);

primitive("month",assign_int,int_base+month_code);

primitive("year",assign_int,int_base+year_code);

primitive("showboxbreadth",assign_int,int_base+show_box_breadth_code);

primitive("showboxdepth",assign_int,int_base+show_box_depth_code);

primitive("hbadness",assign_int,int_base+hbadness_code);

primitive("vbadness",assign_int,int_base+vbadness_code);

primitive("pausing",assign_int,int_base+pausing_code);

primitive("tracingonline",assign_int,int_base+tracing_online_code);

primitive("tracingmacros",assign_int,int_base+tracing_macros_code);

primitive("tracingstats",assign_int,int_base+tracing_stats_code);

primitive("tracingparagraphs",assign_int,int_base+tracing_paragraphs_code);

primitive("tracingpages",assign_int,int_base+tracing_pages_code);

primitive("tracingoutput",assign_int,int_base+tracing_output_code);

primitive("tracinglostchars",assign_int,int_base+tracing_lost_chars_code);

primitive("tracingcommands",assign_int,int_base+tracing_commands_code);

primitive("tracingrestores",assign_int,int_base+tracing_restores_code);

primitive("uchyph",assign_int,int_base+uc_hyph_code);

primitive("outputpenalty",assign_int,int_base+output_penalty_code);

primitive("maxdeadcycles",assign_int,int_base+max_dead_cycles_code);

primitive("hangafter",assign_int,int_base+hang_after_code);

primitive("floatingpenalty",assign_int,int_base+floating_penalty_code);

primitive("globaldefs",assign_int,int_base+global_defs_code);

primitive("fam",assign_int,int_base+cur_fam_code);

primitive("escapechar",assign_int,int_base+escape_char_code);

primitive("defaulthyphenchar",assign_int,int_base+default_hyphen_char_code);

primitive("defaultskewchar",assign_int,int_base+default_skew_char_code);

primitive("endlinechar",assign_int,int_base+end_line_char_code);

primitive("newlinechar",assign_int,int_base+new_line_char_code);

primitive("language",assign_int,int_base+language_code);

primitive("lefthyphenmin",assign_int,int_base+left_hyphen_min_code);

primitive("righthyphenmin",assign_int,int_base+right_hyphen_min_code);

primitive("holdinginserts",assign_int,int_base+holding_inserts_code);

primitive("errorcontextlines",assign_int,int_base+error_context_lines_code);


	/*:237*/	/*247:*/
	#line 5354 "ctex.w"

primitive("parindent",assign_dimen,dimen_base+par_indent_code);

primitive("mathsurround",assign_dimen,dimen_base+math_surround_code);

primitive("lineskiplimit",assign_dimen,dimen_base+line_skip_limit_code);

primitive("hsize",assign_dimen,dimen_base+hsize_code);

primitive("vsize",assign_dimen,dimen_base+vsize_code);

primitive("maxdepth",assign_dimen,dimen_base+max_depth_code);

primitive("splitmaxdepth",assign_dimen,dimen_base+split_max_depth_code);

primitive("boxmaxdepth",assign_dimen,dimen_base+box_max_depth_code);

primitive("hfuzz",assign_dimen,dimen_base+hfuzz_code);

primitive("vfuzz",assign_dimen,dimen_base+vfuzz_code);

primitive("delimitershortfall",
assign_dimen,dimen_base+delimiter_shortfall_code);

primitive("nulldelimiterspace",
assign_dimen,dimen_base+null_delimiter_space_code);

primitive("scriptspace",assign_dimen,dimen_base+script_space_code);

primitive("predisplaysize",assign_dimen,dimen_base+pre_display_size_code);

primitive("displaywidth",assign_dimen,dimen_base+display_width_code);

primitive("displayindent",assign_dimen,dimen_base+display_indent_code);

primitive("overfullrule",assign_dimen,dimen_base+overfull_rule_code);

primitive("hangindent",assign_dimen,dimen_base+hang_indent_code);

primitive("hoffset",assign_dimen,dimen_base+h_offset_code);

primitive("voffset",assign_dimen,dimen_base+v_offset_code);

primitive("emergencystretch",assign_dimen,dimen_base+emergency_stretch_code);


	/*:247*/	/*264:*/
	#line 5637 "ctex.w"

primitive(" ",ex_space,0);

primitive("/",ital_corr,0);

primitive("accent",accent,0);

primitive("advance",advance,0);

primitive("afterassignment",after_assignment,0);

primitive("aftergroup",after_group,0);

primitive("begingroup",begin_group,0);

primitive("char",char_num,0);

primitive("csname",cs_name,0);

primitive("delimiter",delim_num,0);

primitive("divide",divide,0);

primitive("endcsname",end_cs_name,0);

primitive("endgroup",end_group,0);

text(frozen_end_group)= text(cur_val);eqtb[frozen_end_group]= eqtb[cur_val];
primitive("expandafter",expand_after,0);

primitive("font",def_font,0);

primitive("fontdimen",assign_font_dimen,0);

primitive("halign",halign,0);

primitive("hrule",hrule,0);

primitive("ignorespaces",ignore_spaces,0);

primitive("insert",insert,0);

primitive("mark",mark,0);

primitive("mathaccent",math_accent,0);

primitive("mathchar",math_char_num,0);

primitive("mathchoice",math_choice,0);

primitive("multiply",multiply,0);

primitive("noalign",no_align,0);

primitive("noboundary",no_boundary,0);

primitive("noexpand",no_expand,0);

primitive("nonscript",non_script,0);

primitive("omit",omit,0);

primitive("parshape",set_shape,0);

primitive("penalty",break_penalty,0);

primitive("prevgraf",set_prev_graf,0);

primitive("radical",radical,0);

primitive("read",read_to_cs,0);

primitive("relax",relax,256);

text(frozen_relax)= text(cur_val);eqtb[frozen_relax]= eqtb[cur_val];
primitive("setbox",set_box,0);

primitive("the",the,0);

primitive("toks",toks_register,0);

primitive("vadjust",vadjust,0);

primitive("valign",valign,0);

primitive("vcenter",vcenter,0);

primitive("vrule",vrule,0);


	/*:264*/	/*333:*/
	#line 7130 "ctex.w"

primitive("par",par_end,256);

par_loc= cur_val;par_token= cs_token_flag+par_loc;

	/*:333*/	/*375:*/
	#line 7780 "ctex.w"

primitive("input",input,0);

primitive("endinput",input,1);


	/*:375*/	/*383:*/
	#line 7865 "ctex.w"

primitive("topmark",top_bot_mark,top_mark_code);

primitive("firstmark",top_bot_mark,first_mark_code);

primitive("botmark",top_bot_mark,bot_mark_code);

primitive("splitfirstmark",top_bot_mark,split_first_mark_code);

primitive("splitbotmark",top_bot_mark,split_bot_mark_code);


	/*:383*/	/*410:*/
	#line 8309 "ctex.w"

primitive("count",internal_register,int_val);

primitive("dimen",internal_register,dimen_val);

primitive("skip",internal_register,glue_val);

primitive("muskip",internal_register,mu_val);


	/*:410*/	/*415:*/
	#line 8402 "ctex.w"

primitive("spacefactor",set_aux,hmode);

primitive("prevdepth",set_aux,vmode);

primitive("deadcycles",set_page_int,0);

primitive("insertpenalties",set_page_int,1);

primitive("wd",set_box_dimen,width_offset);

primitive("ht",set_box_dimen,height_offset);

primitive("dp",set_box_dimen,depth_offset);

primitive("lastpenalty",last_item,int_val);

primitive("lastkern",last_item,dimen_val);

primitive("lastskip",last_item,glue_val);

primitive("inputlineno",last_item,input_line_no_code);

primitive("badness",last_item,badness_code);


	/*:415*/	/*467:*/
	#line 9202 "ctex.w"

primitive("number",convert,number_code);

primitive("romannumeral",convert,roman_numeral_code);

primitive("string",convert,string_code);

primitive("meaning",convert,meaning_code);

primitive("fontname",convert,font_name_code);

primitive("jobname",convert,job_name_code);


	/*:467*/	/*486:*/
	#line 9518 "ctex.w"

primitive("if",if_test,if_char_code);

primitive("ifcat",if_test,if_cat_code);

primitive("ifnum",if_test,if_int_code);

primitive("ifdim",if_test,if_dim_code);

primitive("ifodd",if_test,if_odd_code);

primitive("ifvmode",if_test,if_vmode_code);

primitive("ifhmode",if_test,if_hmode_code);

primitive("ifmmode",if_test,if_mmode_code);

primitive("ifinner",if_test,if_inner_code);

primitive("ifvoid",if_test,if_void_code);

primitive("ifhbox",if_test,if_hbox_code);

primitive("ifvbox",if_test,if_vbox_code);

primitive("ifx",if_test,ifx_code);

primitive("ifeof",if_test,if_eof_code);

primitive("iftrue",if_test,if_true_code);

primitive("iffalse",if_test,if_false_code);

primitive("ifcase",if_test,if_case_code);


	/*:486*/	/*490:*/
	#line 9607 "ctex.w"

primitive("fi",fi_or_else,fi_code);

text(frozen_fi)= text(cur_val);eqtb[frozen_fi]= eqtb[cur_val];
primitive("or",fi_or_else,or_code);

primitive("else",fi_or_else,else_code);


	/*:490*/	/*552:*/
	#line 10803 "ctex.w"

primitive("nullfont",set_font,null_font);

text(frozen_null_font)= text(cur_val);eqtb[frozen_null_font]= eqtb[cur_val];

	/*:552*/	/*779:*/
	#line 15373 "ctex.w"

primitive("span",tab_mark,span_code);

primitive("cr",car_ret,cr_code);

text(frozen_cr)= text(cur_val);eqtb[frozen_cr]= eqtb[cur_val];
primitive("crcr",car_ret,cr_cr_code);

text(frozen_end_template)= text(frozen_endv)= s_no("endtemplate");
eq_type(frozen_endv)= endv;equiv(frozen_endv)= null_list;
eq_level(frozen_endv)= level_one;
eqtb[frozen_end_template]= eqtb[frozen_endv];
eq_type(frozen_end_template)= end_template;

	/*:779*/	/*982:*/
	#line 19207 "ctex.w"

primitive("pagegoal",set_page_dimen,0);

primitive("pagetotal",set_page_dimen,1);

primitive("pagestretch",set_page_dimen,2);

primitive("pagefilstretch",set_page_dimen,3);

primitive("pagefillstretch",set_page_dimen,4);

primitive("pagefilllstretch",set_page_dimen,5);

primitive("pageshrink",set_page_dimen,6);

primitive("pagedepth",set_page_dimen,7);


	/*:982*/	/*1051:*/
	#line 20425 "ctex.w"

primitive("end",stop,0);

primitive("dump",stop,1);


	/*:1051*/	/*1057:*/
	#line 20501 "ctex.w"

primitive("hskip",hskip,skip_code);

primitive("hfil",hskip,fil_code);

primitive("hfill",hskip,fill_code);

primitive("hss",hskip,ss_code);

primitive("hfilneg",hskip,fil_neg_code);

primitive("vskip",vskip,skip_code);

primitive("vfil",vskip,fil_code);

primitive("vfill",vskip,fill_code);

primitive("vss",vskip,ss_code);

primitive("vfilneg",vskip,fil_neg_code);

primitive("mskip",mskip,mskip_code);

primitive("kern",kern,explicit);

primitive("mkern",mkern,mu_glue);


	/*:1057*/	/*1070:*/
	#line 20758 "ctex.w"

primitive("moveleft",hmove,1);

primitive("moveright",hmove,0);

primitive("raise",vmove,1);

primitive("lower",vmove,0);


primitive("box",make_box,box_code);

primitive("copy",make_box,copy_code);

primitive("lastbox",make_box,last_box_code);

primitive("vsplit",make_box,vsplit_code);

primitive("vtop",make_box,vtop_code);

primitive("vbox",make_box,vtop_code+vmode);

primitive("hbox",make_box,vtop_code+hmode);

primitive("shipout",leader_ship,a_leaders-1);

primitive("leaders",leader_ship,a_leaders);

primitive("cleaders",leader_ship,c_leaders);

primitive("xleaders",leader_ship,x_leaders);


	/*:1070*/	/*1087:*/
	#line 21046 "ctex.w"

primitive("indent",start_par,1);

primitive("noindent",start_par,0);


	/*:1087*/	/*1106:*/
	#line 21254 "ctex.w"

primitive("unpenalty",remove_item,penalty_node);

primitive("unkern",remove_item,kern_node);

primitive("unskip",remove_item,glue_node);

primitive("unhbox",un_hbox,box_code);

primitive("unhcopy",un_hbox,copy_code);

primitive("unvbox",un_vbox,box_code);

primitive("unvcopy",un_vbox,copy_code);


	/*:1106*/	/*1113:*/
	#line 21335 "ctex.w"

primitive("-",discretionary,1);

primitive("discretionary",discretionary,0);


	/*:1113*/	/*1140:*/
	#line 21684 "ctex.w"

primitive("eqno",eq_no,0);

primitive("leqno",eq_no,1);


	/*:1140*/	/*1155:*/
	#line 21920 "ctex.w"

primitive("mathord",math_comp,ord_noad);

primitive("mathop",math_comp,op_noad);

primitive("mathbin",math_comp,bin_noad);

primitive("mathrel",math_comp,rel_noad);

primitive("mathopen",math_comp,open_noad);

primitive("mathclose",math_comp,close_noad);

primitive("mathpunct",math_comp,punct_noad);

primitive("mathinner",math_comp,inner_noad);

primitive("underline",math_comp,under_noad);

primitive("overline",math_comp,over_noad);

primitive("displaylimits",limit_switch,normal);

primitive("limits",limit_switch,limits);

primitive("nolimits",limit_switch,no_limits);


	/*:1155*/	/*1168:*/
	#line 22074 "ctex.w"

primitive("displaystyle",math_style,display_style);

primitive("textstyle",math_style,text_style);

primitive("scriptstyle",math_style,script_style);

primitive("scriptscriptstyle",math_style,script_script_style);


	/*:1168*/	/*1177:*/
	#line 22173 "ctex.w"

primitive("above",above,above_code);

primitive("over",above,over_code);

primitive("atop",above,atop_code);

primitive("abovewithdelims",above,delimited_code+above_code);

primitive("overwithdelims",above,delimited_code+over_code);

primitive("atopwithdelims",above,delimited_code+atop_code);


	/*:1177*/	/*1187:*/
	#line 22301 "ctex.w"

primitive("left",left_right,left_noad);

primitive("right",left_right,right_noad);

text(frozen_right)= text(cur_val);eqtb[frozen_right]= eqtb[cur_val];

	/*:1187*/	/*1207:*/
	#line 22605 "ctex.w"

primitive("long",prefix,1);

primitive("outer",prefix,2);

primitive("global",prefix,4);

primitive("def",def,0);

primitive("gdef",def,1);

primitive("edef",def,2);

primitive("xdef",def,3);


	/*:1207*/	/*1218:*/
	#line 22775 "ctex.w"

primitive("let",let,normal);

primitive("futurelet",let,normal+1);


	/*:1218*/	/*1221:*/
	#line 22817 "ctex.w"

primitive("chardef",shorthand_def,char_def_code);

primitive("mathchardef",shorthand_def,math_char_def_code);

primitive("countdef",shorthand_def,count_def_code);

primitive("dimendef",shorthand_def,dimen_def_code);

primitive("skipdef",shorthand_def,skip_def_code);

primitive("muskipdef",shorthand_def,mu_skip_def_code);

primitive("toksdef",shorthand_def,toks_def_code);


	/*:1221*/	/*1229:*/
	#line 22957 "ctex.w"

primitive("catcode",def_code,cat_code_base);

primitive("mathcode",def_code,math_code_base);

primitive("lccode",def_code,lc_code_base);

primitive("uccode",def_code,uc_code_base);

primitive("sfcode",def_code,sf_code_base);

primitive("delcode",def_code,del_code_base);

primitive("textfont",def_family,math_font_base);

primitive("scriptfont",def_family,math_font_base+script_size);

primitive("scriptscriptfont",def_family,math_font_base+script_script_size);


	/*:1229*/	/*1249:*/
	#line 23242 "ctex.w"

primitive("hyphenation",hyph_data,0);

primitive("patterns",hyph_data,1);


	/*:1249*/	/*1253:*/
	#line 23279 "ctex.w"

primitive("hyphenchar",assign_font_int,0);

primitive("skewchar",assign_font_int,1);


	/*:1253*/	/*1261:*/
	#line 23378 "ctex.w"

primitive("batchmode",set_interaction,batch_mode);

primitive("nonstopmode",set_interaction,nonstop_mode);

primitive("scrollmode",set_interaction,scroll_mode);

primitive("errorstopmode",set_interaction,error_stop_mode);


	/*:1261*/	/*1271:*/
	#line 23444 "ctex.w"

primitive("openin",in_stream,1);

primitive("closein",in_stream,0);


	/*:1271*/	/*1276:*/
	#line 23479 "ctex.w"

primitive("message",message,0);

primitive("errmessage",message,1);


	/*:1276*/	/*1285:*/
	#line 23546 "ctex.w"

primitive("lowercase",case_shift,lc_code_base);

primitive("uppercase",case_shift,uc_code_base);


	/*:1285*/	/*1290:*/
	#line 23593 "ctex.w"

primitive("show",xray,show_code);

primitive("showbox",xray,show_box_code);

primitive("showthe",xray,show_the_code);

primitive("showlists",xray,show_lists);


	/*:1290*/	/*1343:*/
	#line 24576 "ctex.w"

primitive("openout",extension,open_node);

primitive("write",extension,write_node);write_loc= cur_val;

primitive("closeout",extension,close_node);

primitive("special",extension,special_node);

primitive("immediate",extension,immediate_code);

primitive("setlanguage",extension,set_language_code);


	/*:1343*/
	#line 24389 "ctex.w"
;
no_new_control_sequence= true;
}
#endif

	/*:1335*/	/*1337:*/
	#line 24441 "ctex.w"

#ifdef DEBUG
static void debug_help(void)
{
int k,l,m,n;
loop{wake_up_terminal;
print_nl("debug # (-1 to exit):");update_terminal;

if(fscanf(term_in.f," %d",&m)<1||
m<0)return;
else if(m==0)
{goto breakpoint;
breakpoint:m= 0;
}
else{fscanf(term_in.f," %d",&n);
switch(m){
	/*1338:*/
	#line 24465 "ctex.w"

case 1:print_word(mem[n]);break;
case 2:print_int(info(n));break;
case 3:print_int(link(n));break;
case 4:print_word(eqtb[n]);break;
case 5:print_word(font_info[n]);break;
case 6:print_word(save_stack[n]);break;
case 7:show_box(n);break;

case 8:{breadth_max= 10000;depth_threshold= pool_size-pool_ptr-10;
show_node_list(n);
}break;
case 9:show_token_list(n,null,1000);break;
case 10:slow_print(n);break;
case 11:check_mem(n>0);break;
case 12:search_mem(n);break;
case 13:{fscanf(term_in.f," %d",&l);print_cmd_chr(n,l);
}break;
case 14:for(k= 0;k<=n;k++)printn(buffer[k]);break;
case 15:{font_in_short_display= null_font;short_display(n);
}break;
case 16:panicking= !panicking;break;

	/*:1338*/
	#line 24457 "ctex.w"

default:print("?");
}
}
}
}
#endif

	/*:1337*/
	#line 24185 "ctex.w"


	/*:1329*/	/*1331:*/
	#line 24239 "ctex.w"
int main(void){
history= fatal_error_stop;
t_open_out;
if(ready_already==314159)goto start_of_TEX;
	/*14:*/
	#line 428 "ctex.w"

bad= 0;
if((half_error_line<30)||(half_error_line>error_line-15))bad= 1;
if(max_print_line<60)bad= 2;
if(dvi_buf_size%8!=0)bad= 3;
if(mem_bot+1100>mem_top)bad= 4;
if(hash_prime>hash_size)bad= 5;
if(max_in_open>=128)bad= 6;
if(mem_top<256+11)bad= 7;

	/*:14*/	/*110:*/
	#line 2382 "ctex.w"

#ifdef INIT
if((mem_min!=mem_bot)||(mem_max!=mem_top))bad= 10;
#endif

if((mem_min>mem_bot)||(mem_max<mem_top))bad= 10;
if((min_quarterword>0)||(max_quarterword<127))bad= 11;
if((min_halfword>0)||(max_halfword<32767))bad= 12;
if((min_quarterword<min_halfword)||
(max_quarterword>max_halfword))bad= 13;
if((mem_min<min_halfword)||(mem_max>=max_halfword)||
(mem_bot-mem_min>max_halfword+1))bad= 14;
if((font_base<min_quarterword)||(font_max>max_quarterword))bad= 15;
if(font_max>font_base+256)bad= 16;
if((save_size>max_halfword)||(max_strings>max_halfword))bad= 17;
if(buf_size>max_halfword)bad= 18;
if(max_quarterword-min_quarterword<255)bad= 19;

	/*:110*/	/*289:*/
	#line 6178 "ctex.w"

if(cs_token_flag+undefined_control_sequence>max_halfword)bad= 21;

	/*:289*/	/*521:*/
	#line 10111 "ctex.w"

if(format_default_length>file_name_size)bad= 31;

	/*:521*/	/*1248:*/
	#line 23237 "ctex.w"

if(2*max_halfword<mem_top-mem_min)bad= 41;

	/*:1248*/
	#line 24243 "ctex.w"

if(bad>0)
{wterm_ln("Ouch---my internal constants have been clobbered!"
"---case %d",bad);

exit(0);
}
get_strings_started();
initialize();
#ifdef INIT
init_prim();
init_str_ptr= str_ptr;init_pool_ptr= pool_ptr;fix_date_and_time();
#endif
ready_already= 314159;
start_of_TEX:	/*54:*/
	#line 1350 "ctex.w"

selector= term_only;tally= 0;term_offset= 0;file_offset= 0;

	/*:54*/	/*60:*/
	#line 1500 "ctex.w"

wterm("%s",banner);
if(format_ident==0)wterm_ln(" (no format preloaded)");
else{slow_print(format_ident);print_ln();
}
update_terminal;

	/*:60*/	/*527:*/
	#line 10247 "ctex.w"

job_name= 0;name_in_progress= false;log_opened= false;

	/*:527*/	/*532:*/
	#line 10315 "ctex.w"
output_file_name= 0;

	/*:532*/
	#line 24257 "ctex.w"
;
	/*1336:*/
	#line 24401 "ctex.w"

{	/*330:*/
	#line 7085 "ctex.w"

{input_ptr= 0;max_in_stack= 0;
in_open= 0;open_parens= 0;max_buf_stack= 0;
param_ptr= 0;max_param_stack= 0;
first= buf_size;do{buffer[first]= 0;decr(first);}while(!(first==0));
scanner_status= normal;warning_index= null;first= 1;
state= new_line;start= 1;index= 0;line= 0;name= 0;
force_eof= false;
align_state= 1000000;
if(!init_terminal())exit(0);
limit= last;first= last+1;
}

	/*:330*/
	#line 24402 "ctex.w"
;
if((format_ident==0)||(buffer[loc]=='&'))
{if(format_ident!=0)initialize();
if(!open_fmt_file())exit(0);
if(!load_fmt_file())
{w_close(&fmt_file);exit(0);
}
w_close(&fmt_file);
while((loc<limit)&&(buffer[loc]==' '))incr(loc);
}
if(end_line_char_inactive)decr(limit);
else buffer[limit]= end_line_char;
fix_date_and_time();
	/*74:*/
	#line 1711 "ctex.w"

if(interaction==batch_mode)selector= no_print;else selector= term_only

	/*:74*/
	#line 24415 "ctex.w"
;
if((loc<limit)&&(cat_code(buffer[loc])!=escape))start_input();

}

	/*:1336*/
	#line 24258 "ctex.w"
;
history= spotless;
main_control();
final_cleanup();
close_files_and_terminate();
ready_already= 0;
return 0;}

	/*:1331*/
