.pcc_sub _main prototyped
    .param var argv
    .sym int argc
    argc = argv
    .sym int N
    N = 24
    if argc <= 1 goto noarg
    $S0 = argv[1]
    N = $S0
noarg:
    .sym float start
    .sym var fib
    fib = newsub _fib
    time start
    .pcc_begin prototyped
    .arg N
    .pcc_call fib
    .sym int r
    .result r
    .pcc_end
    .sym float fin
    time fin
    print "fib("
    print N
    print ") = "
    print r
    print " "
    sub fin, start
    print fin
    print "s\n"
    end
.end

.pcc_sub _fib prototyped
    .param int n
    if n >= 2 goto rec
    .pcc_begin_return
    .return n
    .pcc_end_return
rec:
    .sym int n1
    .sym int n2
    .sym int r1
    .sym int r2
    .sym var fib
    fib = P0
    n1 = n - 1
    n2 = n - 2
    .pcc_begin prototyped
    .arg n1
    .pcc_call fib
    .result r1
    .pcc_end
    .pcc_begin prototyped
    .arg n2
    .pcc_call fib
    .result r2
    .pcc_end
    n = r1 + r2
    .pcc_begin_return
    .return n
    .pcc_end_return
.end

