omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / gpu / nvidia / tools / prof / prof.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note omega profiler: per-launch stamp words and a roofline report. |
| 3 | note Stamp word (src/omega_gpu_cmdlist.c emit_stamp, ordered after the preceding WAIT_FOR_IDLE): header bw_mthd(1, 0x0158, 5) then slot, 0, address low, address high, 0. A submission of n launches records n + 1 slots: slot 0 before launch 0, slot i + 1 after launch i. Kernel i duration is slot[i + 1] minus slot[i]. words mode prints those six words for one slot. It does not edit the command-list generator; Streams owns that file. |
| 4 | note Ceilings (not computed from this fixture): probe pair 115.14 TFLOP/s and 195.1 GB/s from the ROADMAP Nsight row, evidence OWN30B-T3-TC-PEAK-BW-5faa0f70-20261013T2236Z. Omega docs/OMEGA.md section 5 records that pair as the measured ceiling and separately lists 207 to 237 GB/s and 237.5 TFLOP/s FP8. The 590 operations/byte ridge is 115140000000000 / 195100000000, confirmed by Wolfram in tools/prof/wolfram-constants.txt. Section 5 is the ceiling source this report cites. The 115.14/195.1 pair is probe evidence, not a section 5 number. |
| 5 | note Modes: words va slot prints the six stamp words; fix path writes the built-in fixture; sim path replays that fixture and writes the report; report path out reads a fixture and writes the report. Exit 0 ok, 2 usage, 3 swapped or equal timestamps, 4 bad fixture, 5 write failure. |
| 6 | om2 |
| 7 | const hdr ulong 537206870 |
| 8 | const flop_at ulong 16 |
| 9 | const probe_f ulong 115140000000000 |
| 10 | const probe_b ulong 195100000000 |
| 11 | const sec5_f ulong 237500000000000 |
| 12 | const sec5_lo ulong 207000000000 |
| 13 | const sec5_hi ulong 237000000000 |
| 14 | const ridge_n ulong 1151400 |
| 15 | const ridge_d ulong 1951 |
| 16 | const ridge_m ulong 590158 |
| 17 | const sec5_n ulong 237500 |
| 18 | const d237 ulong 237 |
| 19 | const d207 ulong 207 |
| 20 | const lnch_lo ulong 24 |
| 21 | const lnch_hi ulong 31 |
| 22 | const byte_cap ulong 15000000000000 |
| 23 | const flop_cap ulong 9000000000000000 |
| 24 | const time_cap ulong 18000000000 |
| 25 | const rate_cap ulong 18446744073 |
| 26 | const dec_cap ulong 1844674407370955161 |
| 27 | const u32m ulong 4294967295 |
| 28 | const u32b ulong 4294967296 |
| 29 | text prof1 "PROFI 1\n" |
| 30 | text src "source omega-mv docs/OMEGA.md section 5; probe evidence/OWN30B-T3-TC-PEAK-BW-5faa0f70-20261013T2236Z\n" |
| 31 | text pfs "probe_flops " |
| 32 | text pbs "probe_bytes " |
| 33 | text psrc "probe_source evidence/OWN30B-T3-TC-PEAK-BW-5faa0f70-20261013T2236Z\n" |
| 34 | text sfs "sec5_flops " |
| 35 | text sfk "sec5_flops_kind arithmetic\n" |
| 36 | text sblo "sec5_bytes_lo " |
| 37 | text sbhi "sec5_bytes_hi " |
| 38 | text sbk "sec5_bytes_kind measured\n" |
| 39 | text rpn "ridge_probe_n " |
| 40 | text rpd "ridge_probe_d " |
| 41 | text rpm "ridge_probe_milli " |
| 42 | text r237n "ridge_sec5_237_n " |
| 43 | text r237d "ridge_sec5_237_d " |
| 44 | text r207n "ridge_sec5_207_n " |
| 45 | text r207d "ridge_sec5_207_d " |
| 46 | text llo "launch_us_lo " |
| 47 | text lhi "launch_us_hi " |
| 48 | text lsrc "launch_source evidence/OWN30B-LAUNCH-COST-20261014T0120Z\n" |
| 49 | text ssrc "stamp_source fixture\n" |
| 50 | text nkt "nkern " |
| 51 | text kk "k " |
| 52 | text tn " time_ns " |
| 53 | text byt " bytes " |
| 54 | text flp " flops " |
| 55 | text ail " ai_milli " |
| 56 | text bpl " bound_probe " |
| 57 | text bd237 " bound_sec5_237 " |
| 58 | text bd207 " bound_sec5_207 " |
| 59 | text pmm " probe_mem_milli " |
| 60 | text pfm " probe_flop_milli " |
| 61 | text sm237 " sec5_mem_237_milli " |
| 62 | text sm207 " sec5_mem_207_milli " |
| 63 | text sfm " sec5_flop_milli " |
| 64 | text mem "mem" |
| 65 | text ridge "ridge" |
| 66 | text comp "compute" |
| 67 | text nl "\n" |
| 68 | global buf uchar 1024 |
| 69 | global nread ulong 1 |
| 70 | global nkern ulong 1 |
| 71 | global nslots ulong 1 |
| 72 | global slots ulong 8 |
| 73 | global g_bytes ulong 8 |
| 74 | global g_flops ulong 8 |
| 75 | global g_sb ulong 8 |
| 76 | global g_sa ulong 8 |
| 77 | global kid ulong 1 |
| 78 | global kt0 ulong 1 |
| 79 | global kt1 ulong 1 |
| 80 | global kbytes ulong 1 |
| 81 | global kflops ulong 1 |
| 82 | global argb uchar 64 |
| 83 | global pathb uchar 256 |
| 84 | global nb uchar 1 |
| 85 | fn putb fd int b ulong to void |
| 86 | put nb 0 uchar and b 255 |
| 87 | k = write fd nb 0 1 |
| 88 | if lt k 1 |
| 89 | exit 5 |
| 90 | end |
| 91 | end |
| 92 | fn putnum fd int n ulong to void |
| 93 | x = n |
| 94 | d = ulong 10000000000000000000 |
| 95 | started = ulong 0 |
| 96 | for i ulong 20 |
| 97 | q = div x d |
| 98 | if or gt q 0 eq started 1 |
| 99 | putb fd add 48 q |
| 100 | started = 1 |
| 101 | end |
| 102 | x = rem x d |
| 103 | d = div d 10 |
| 104 | end |
| 105 | if eq started 0 |
| 106 | putb fd 48 |
| 107 | end |
| 108 | end |
| 109 | fn wtxt fd int s view uchar * to void |
| 110 | k = write fd s 0 len s |
| 111 | if lt k 0 |
| 112 | exit 5 |
| 113 | end |
| 114 | if ne ulong k len s |
| 115 | exit 5 |
| 116 | end |
| 117 | end |
| 118 | fn b32 off ulong to ulong |
| 119 | a0 = ulong get buf off |
| 120 | a1 = ulong get buf add off 1 |
| 121 | a2 = ulong get buf add off 2 |
| 122 | a3 = ulong get buf add off 3 |
| 123 | ret add a0 add mul a1 256 add mul a2 65536 mul a3 16777216 |
| 124 | end |
| 125 | fn b64 off ulong to ulong |
| 126 | lo = b32 off |
| 127 | hi = b32 add off 4 |
| 128 | ret add lo mul hi u32b |
| 129 | end |
| 130 | fn p8 off ulong v ulong to void |
| 131 | put buf off uchar v |
| 132 | end |
| 133 | fn p32 off ulong v ulong to void |
| 134 | p8 off and v 255 |
| 135 | p8 add off 1 and shr v 8 255 |
| 136 | p8 add off 2 and shr v 16 255 |
| 137 | p8 add off 3 and shr v 24 255 |
| 138 | end |
| 139 | fn p64 off ulong v ulong to void |
| 140 | p32 off and v u32m |
| 141 | p32 add off 4 shr v 32 |
| 142 | end |
| 143 | fn tsat slots_n ulong idx ulong to ulong |
| 144 | if ge idx slots_n |
| 145 | exit 4 |
| 146 | end |
| 147 | base = get slots idx |
| 148 | ret b64 base |
| 149 | end |
| 150 | fn rate a ulong t ulong to ulong |
| 151 | if eq t 0 |
| 152 | exit 4 |
| 153 | end |
| 154 | hi = div a 1000 |
| 155 | lo = rem a 1000 |
| 156 | q = div hi t |
| 157 | r = rem hi t |
| 158 | if gt r rate_cap |
| 159 | exit 4 |
| 160 | end |
| 161 | s = mul r 1000 |
| 162 | if gt lo dec_cap |
| 163 | exit 4 |
| 164 | end |
| 165 | s = add s lo |
| 166 | q2 = div s t |
| 167 | if gt q 18446744073709 |
| 168 | exit 4 |
| 169 | end |
| 170 | outv = mul q 1000 |
| 171 | if gt outv sub 0 add q2 1 |
| 172 | exit 4 |
| 173 | end |
| 174 | ret add outv q2 |
| 175 | end |
| 176 | fn aimilli f ulong b ulong to ulong |
| 177 | if eq b 0 |
| 178 | exit 4 |
| 179 | end |
| 180 | if gt f flop_cap |
| 181 | exit 4 |
| 182 | end |
| 183 | if gt b byte_cap |
| 184 | exit 4 |
| 185 | end |
| 186 | ret div mul f 1000 b |
| 187 | end |
| 188 | fn milli v ulong c ulong to ulong |
| 189 | if eq v 0 |
| 190 | ret 0 |
| 191 | end |
| 192 | if gt v c |
| 193 | exit 4 |
| 194 | end |
| 195 | ret div mul v 1000 c |
| 196 | end |
| 197 | fn cmpf f ulong b ulong n ulong d ulong to ulong |
| 198 | if eq b 0 |
| 199 | exit 4 |
| 200 | end |
| 201 | if gt f flop_cap |
| 202 | exit 4 |
| 203 | end |
| 204 | if gt b byte_cap |
| 205 | exit 4 |
| 206 | end |
| 207 | left = mul f d |
| 208 | right = mul b n |
| 209 | if lt left right |
| 210 | ret 0 |
| 211 | end |
| 212 | if eq left right |
| 213 | ret 1 |
| 214 | end |
| 215 | ret 2 |
| 216 | end |
| 217 | fn kload i ulong to ulong |
| 218 | off = add 16 mul i 32 |
| 219 | put kid 0 b32 off |
| 220 | put kbytes 0 b64 add off 8 |
| 221 | t0 = tsat get nslots 0 b32 add off 24 |
| 222 | t1 = tsat get nslots 0 b32 add off 28 |
| 223 | put kt0 0 t0 |
| 224 | put kt1 0 t1 |
| 225 | put kflops 0 b64 add off flop_at |
| 226 | if gt get kbytes 0 byte_cap |
| 227 | exit 4 |
| 228 | end |
| 229 | if gt get kflops 0 flop_cap |
| 230 | exit 4 |
| 231 | end |
| 232 | bad = lt t1 t0 |
| 233 | if bad |
| 234 | ret 3 |
| 235 | end |
| 236 | if eq t1 t0 |
| 237 | ret 3 |
| 238 | end |
| 239 | dt = sub t1 t0 |
| 240 | if gt dt time_cap |
| 241 | exit 4 |
| 242 | end |
| 243 | ret 0 |
| 244 | end |
| 245 | fn wbound fd int code ulong to void |
| 246 | if eq code 0 |
| 247 | wtxt fd mem |
| 248 | else |
| 249 | if eq code 1 |
| 250 | wtxt fd ridge |
| 251 | else |
| 252 | wtxt fd comp |
| 253 | end |
| 254 | end |
| 255 | end |
| 256 | fn kemitb fd int to void |
| 257 | b = get kbytes 0 |
| 258 | f = get kflops 0 |
| 259 | t = sub get kt1 0 get kt0 0 |
| 260 | ai = aimilli f b |
| 261 | bp = cmpf f b ridge_n ridge_d |
| 262 | hi = cmpf f b sec5_n d237 |
| 263 | lo = cmpf f b sec5_n d207 |
| 264 | wtxt fd kk |
| 265 | putnum fd get kid 0 |
| 266 | wtxt fd tn |
| 267 | putnum fd t |
| 268 | wtxt fd byt |
| 269 | putnum fd b |
| 270 | wtxt fd flp |
| 271 | putnum fd f |
| 272 | wtxt fd ail |
| 273 | putnum fd ai |
| 274 | wtxt fd bpl |
| 275 | wbound fd bp |
| 276 | wtxt fd bd237 |
| 277 | wbound fd hi |
| 278 | wtxt fd bd207 |
| 279 | wbound fd lo |
| 280 | wtxt fd pmm |
| 281 | putnum fd milli b probe_b |
| 282 | wtxt fd pfm |
| 283 | putnum fd milli f probe_f |
| 284 | wtxt fd sm237 |
| 285 | putnum fd milli b sec5_hi |
| 286 | wtxt fd sm207 |
| 287 | putnum fd milli b sec5_lo |
| 288 | wtxt fd sfm |
| 289 | putnum fd milli f sec5_f |
| 290 | wtxt fd nl |
| 291 | end |
| 292 | fn kemit fd int to void |
| 293 | kemitb fd |
| 294 | end |
| 295 | fn emithead fd int to void |
| 296 | wtxt fd prof1 |
| 297 | wtxt fd src |
| 298 | wtxt fd pfs |
| 299 | putnum fd probe_f |
| 300 | wtxt fd nl |
| 301 | wtxt fd pbs |
| 302 | putnum fd probe_b |
| 303 | wtxt fd nl |
| 304 | wtxt fd psrc |
| 305 | wtxt fd sfs |
| 306 | putnum fd sec5_f |
| 307 | wtxt fd nl |
| 308 | wtxt fd sfk |
| 309 | wtxt fd sblo |
| 310 | putnum fd sec5_lo |
| 311 | wtxt fd nl |
| 312 | wtxt fd sbhi |
| 313 | putnum fd sec5_hi |
| 314 | wtxt fd nl |
| 315 | wtxt fd sbk |
| 316 | wtxt fd rpn |
| 317 | putnum fd ridge_n |
| 318 | wtxt fd nl |
| 319 | wtxt fd rpd |
| 320 | putnum fd ridge_d |
| 321 | wtxt fd nl |
| 322 | wtxt fd rpm |
| 323 | putnum fd ridge_m |
| 324 | wtxt fd nl |
| 325 | wtxt fd r237n |
| 326 | putnum fd sec5_n |
| 327 | wtxt fd nl |
| 328 | wtxt fd r237d |
| 329 | putnum fd d237 |
| 330 | wtxt fd nl |
| 331 | wtxt fd r207n |
| 332 | putnum fd sec5_n |
| 333 | wtxt fd nl |
| 334 | wtxt fd r207d |
| 335 | putnum fd d207 |
| 336 | wtxt fd nl |
| 337 | wtxt fd llo |
| 338 | putnum fd lnch_lo |
| 339 | wtxt fd nl |
| 340 | wtxt fd lhi |
| 341 | putnum fd lnch_hi |
| 342 | wtxt fd nl |
| 343 | wtxt fd lsrc |
| 344 | wtxt fd ssrc |
| 345 | wtxt fd nkt |
| 346 | putnum fd get nkern 0 |
| 347 | wtxt fd nl |
| 348 | end |
| 349 | fn emitall fd int to ulong |
| 350 | n = get nkern 0 |
| 351 | for i ulong n |
| 352 | c = kload i |
| 353 | if ne c 0 |
| 354 | ret c |
| 355 | end |
| 356 | kemit fd |
| 357 | end |
| 358 | ret 0 |
| 359 | end |
| 360 | fn checkfix to ulong |
| 361 | if lt get nread 0 16 |
| 362 | ret 4 |
| 363 | end |
| 364 | if ne ulong get buf 0 80 |
| 365 | ret 4 |
| 366 | end |
| 367 | if ne ulong get buf 1 82 |
| 368 | ret 4 |
| 369 | end |
| 370 | if ne ulong get buf 2 79 |
| 371 | ret 4 |
| 372 | end |
| 373 | if ne ulong get buf 3 70 |
| 374 | ret 4 |
| 375 | end |
| 376 | if ne b32 4 1 |
| 377 | ret 4 |
| 378 | end |
| 379 | kn = b32 8 |
| 380 | ns = b32 12 |
| 381 | if eq kn 0 |
| 382 | ret 4 |
| 383 | end |
| 384 | if gt kn 8 |
| 385 | ret 4 |
| 386 | end |
| 387 | if lt ns 2 |
| 388 | ret 4 |
| 389 | end |
| 390 | if gt ns 8 |
| 391 | ret 4 |
| 392 | end |
| 393 | need = add 112 mul ns 16 |
| 394 | if gt need 1024 |
| 395 | ret 4 |
| 396 | end |
| 397 | if lt get nread 0 need |
| 398 | ret 4 |
| 399 | end |
| 400 | put nkern 0 kn |
| 401 | put nslots 0 ns |
| 402 | for i ulong 8 |
| 403 | put slots i add 112 mul i 16 |
| 404 | end |
| 405 | ret 0 |
| 406 | end |
| 407 | fn pdesc i ulong to void |
| 408 | off = add 16 mul i 32 |
| 409 | p32 off i |
| 410 | p32 add off 4 0 |
| 411 | p64 add off 8 get g_bytes i |
| 412 | p64 add off 16 get g_flops i |
| 413 | p32 add off 24 get g_sb i |
| 414 | p32 add off 28 get g_sa i |
| 415 | end |
| 416 | fn pslot idx ulong ts ulong to void |
| 417 | base = get slots idx |
| 418 | p64 base ts |
| 419 | end |
| 420 | fn fillsim to void |
| 421 | p8 0 80 |
| 422 | p8 1 82 |
| 423 | p8 2 79 |
| 424 | p8 3 70 |
| 425 | p32 4 1 |
| 426 | p32 8 3 |
| 427 | p32 12 4 |
| 428 | put g_bytes 0 195100000000 |
| 429 | put g_flops 0 115140000000 |
| 430 | put g_sb 0 0 |
| 431 | put g_sa 0 1 |
| 432 | put g_bytes 1 195100000 |
| 433 | put g_flops 1 115140000000000 |
| 434 | put g_sb 1 1 |
| 435 | put g_sa 1 2 |
| 436 | put g_bytes 2 97550000000 |
| 437 | put g_flops 2 57570000000000 |
| 438 | put g_sb 2 2 |
| 439 | put g_sa 2 3 |
| 440 | pdesc 0 |
| 441 | pdesc 1 |
| 442 | pdesc 2 |
| 443 | put nkern 0 3 |
| 444 | put nslots 0 4 |
| 445 | for i ulong 8 |
| 446 | put slots i add 112 mul i 16 |
| 447 | end |
| 448 | pslot 0 1000000000000 |
| 449 | pslot 1 1001000000000 |
| 450 | pslot 2 1002000000000 |
| 451 | pslot 3 1003000000000 |
| 452 | put nread 0 176 |
| 453 | end |
| 454 | fn loadpath idx ulong to long |
| 455 | n = argread idx pathb 0 255 |
| 456 | if le n 0 |
| 457 | ret sub long 0 long 1 |
| 458 | end |
| 459 | if ge n 255 |
| 460 | ret sub long 0 long 1 |
| 461 | end |
| 462 | put pathb n 0 |
| 463 | fd = fopen pathb 0 ulong n 0 0 |
| 464 | if lt fd 0 |
| 465 | ret fd |
| 466 | end |
| 467 | k = read int fd buf 0 1024 |
| 468 | z = fclose int fd |
| 469 | if lt z 0 |
| 470 | ret sub long 0 long 1 |
| 471 | end |
| 472 | ret k |
| 473 | end |
| 474 | fn openout idx ulong to int |
| 475 | n = argread idx pathb 0 255 |
| 476 | if le n 0 |
| 477 | exit 5 |
| 478 | end |
| 479 | if ge n 255 |
| 480 | exit 5 |
| 481 | end |
| 482 | put pathb n 0 |
| 483 | fd = fopen pathb 0 ulong n 577 420 |
| 484 | if lt fd 0 |
| 485 | exit 5 |
| 486 | end |
| 487 | ret int fd |
| 488 | end |
| 489 | fn runrep out_idx ulong to int |
| 490 | c = checkfix |
| 491 | if ne c 0 |
| 492 | ret int c |
| 493 | end |
| 494 | fd = openout out_idx |
| 495 | emithead fd |
| 496 | k = emitall fd |
| 497 | z = fclose fd |
| 498 | if ne k 0 |
| 499 | ret int k |
| 500 | end |
| 501 | if lt z 0 |
| 502 | ret 5 |
| 503 | end |
| 504 | ret 0 |
| 505 | end |
| 506 | fn argis idx ulong kind ulong to bool |
| 507 | n = argread idx argb 0 63 |
| 508 | if le n 0 |
| 509 | ret false |
| 510 | end |
| 511 | if eq kind 0 |
| 512 | if ne n 5 |
| 513 | ret false |
| 514 | end |
| 515 | if ne ulong get argb 0 119 |
| 516 | ret false |
| 517 | end |
| 518 | if ne ulong get argb 1 111 |
| 519 | ret false |
| 520 | end |
| 521 | if ne ulong get argb 2 114 |
| 522 | ret false |
| 523 | end |
| 524 | if ne ulong get argb 3 100 |
| 525 | ret false |
| 526 | end |
| 527 | if ne ulong get argb 4 115 |
| 528 | ret false |
| 529 | end |
| 530 | ret true |
| 531 | end |
| 532 | if eq kind 1 |
| 533 | if ne n 6 |
| 534 | ret false |
| 535 | end |
| 536 | if ne ulong get argb 0 114 |
| 537 | ret false |
| 538 | end |
| 539 | if ne ulong get argb 1 101 |
| 540 | ret false |
| 541 | end |
| 542 | if ne ulong get argb 2 112 |
| 543 | ret false |
| 544 | end |
| 545 | if ne ulong get argb 3 111 |
| 546 | ret false |
| 547 | end |
| 548 | if ne ulong get argb 4 114 |
| 549 | ret false |
| 550 | end |
| 551 | if ne ulong get argb 5 116 |
| 552 | ret false |
| 553 | end |
| 554 | ret true |
| 555 | end |
| 556 | if eq kind 2 |
| 557 | if ne n 3 |
| 558 | ret false |
| 559 | end |
| 560 | if ne ulong get argb 0 115 |
| 561 | ret false |
| 562 | end |
| 563 | if ne ulong get argb 1 105 |
| 564 | ret false |
| 565 | end |
| 566 | if ne ulong get argb 2 109 |
| 567 | ret false |
| 568 | end |
| 569 | ret true |
| 570 | end |
| 571 | if eq kind 3 |
| 572 | if ne n 3 |
| 573 | ret false |
| 574 | end |
| 575 | if ne ulong get argb 0 102 |
| 576 | ret false |
| 577 | end |
| 578 | if ne ulong get argb 1 105 |
| 579 | ret false |
| 580 | end |
| 581 | if ne ulong get argb 2 120 |
| 582 | ret false |
| 583 | end |
| 584 | ret true |
| 585 | end |
| 586 | ret false |
| 587 | end |
| 588 | fn argnum idx ulong to ulong |
| 589 | n = argread idx argb 0 63 |
| 590 | if le n 0 |
| 591 | exit 2 |
| 592 | end |
| 593 | if gt n 20 |
| 594 | exit 2 |
| 595 | end |
| 596 | v = ulong 0 |
| 597 | for i ulong ulong n |
| 598 | c = ulong get argb i |
| 599 | if or lt c 48 gt c 57 |
| 600 | exit 2 |
| 601 | end |
| 602 | v = add mul v 10 sub c 48 |
| 603 | end |
| 604 | ret v |
| 605 | end |
| 606 | fn words va ulong slot ulong to void |
| 607 | putnum 1 hdr |
| 608 | putb 1 10 |
| 609 | putnum 1 slot |
| 610 | putb 1 10 |
| 611 | putnum 1 0 |
| 612 | putb 1 10 |
| 613 | addr = add va mul slot 16 |
| 614 | putnum 1 and addr u32m |
| 615 | putb 1 10 |
| 616 | putnum 1 shr addr 32 |
| 617 | putb 1 10 |
| 618 | putnum 1 0 |
| 619 | putb 1 10 |
| 620 | end |
| 621 | fn dofix to int |
| 622 | if ne argcnt 3 |
| 623 | ret 2 |
| 624 | end |
| 625 | fillsim |
| 626 | fd = openout 2 |
| 627 | k = write fd buf 0 176 |
| 628 | z = fclose fd |
| 629 | if lt k 176 |
| 630 | ret 5 |
| 631 | end |
| 632 | if lt z 0 |
| 633 | ret 5 |
| 634 | end |
| 635 | ret 0 |
| 636 | end |
| 637 | fn main to int |
| 638 | if lt argcnt 2 |
| 639 | ret 2 |
| 640 | end |
| 641 | if argis 1 0 |
| 642 | if ne argcnt 4 |
| 643 | ret 2 |
| 644 | end |
| 645 | words argnum 2 argnum 3 |
| 646 | ret 0 |
| 647 | end |
| 648 | if argis 1 3 |
| 649 | ret dofix |
| 650 | end |
| 651 | if argis 1 2 |
| 652 | if ne argcnt 3 |
| 653 | ret 2 |
| 654 | end |
| 655 | fillsim |
| 656 | ret runrep 2 |
| 657 | end |
| 658 | if argis 1 1 |
| 659 | if ne argcnt 4 |
| 660 | ret 2 |
| 661 | end |
| 662 | r = loadpath 2 |
| 663 | if lt r 0 |
| 664 | ret 4 |
| 665 | end |
| 666 | put nread 0 ulong r |
| 667 | ret runrep 3 |
| 668 | end |
| 669 | ret 2 |
| 670 | end |