;;-*-Lisp-*-
(in-package goal)

;; definition for function edge-debug-lines
;; INFO: Return type mismatch symbol vs none.
(defun edge-debug-lines ((arg0 (array vector-array)))
  (when (nonzero? arg0)
    (dotimes (s5-0 (-> arg0 length))
      (when (logtest? *display-strip-lines* (ash 1 s5-0))
        (let ((s4-0 (-> arg0 s5-0)))
          (dotimes (s3-0 (/ (-> s4-0 length) 2))
            (add-debug-line
              #t
              (bucket-id debug-no-zbuf)
              (-> s4-0 data (* s3-0 2))
              (-> s4-0 data (+ (* s3-0 2) 1))
              (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
              #f
              (the-as rgba -1)
              )
            )
          )
        )
      )
    )
  (none)
  )

;; definition for function draw-drawable-tree-tfrag
;; INFO: Return type mismatch drawable-tree-tfrag vs none.
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr0, r0]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr1, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, a0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr0, r0]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr1, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, a0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
(defun draw-drawable-tree-tfrag ((arg0 drawable-tree-tfrag))
  (local-vars (a0-20 int) (a0-22 int) (a0-38 int) (a0-40 int) (sv-16 (pointer uint8)))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag))
    (let ((s5-0 (+ (-> arg0 length) -1)))
      (when (nonzero? s5-0)
        (dotimes (s4-0 s5-0)
          (let* ((v1-7 (-> arg0 arrays s4-0))
                 (a0-4 (-> arg0 arrays (+ s4-0 1)))
                 (a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
                 (a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
                 (a1-3 (&-> (the-as terrain-context #x70000000) work background vis-list a1-1))
                 (a0-8 (&-> (the-as terrain-context #x70000000) work background vis-list a0-6))
                 )
            (draw-node-cull
              a0-8
              a1-3
              (-> (the-as drawable-inline-array-node v1-7) data)
              (-> (the-as drawable-inline-array-node v1-7) length)
              )
            )
          )
        )
      (let* ((v1-13 (the-as drawable-inline-array-tfrag (-> arg0 arrays s5-0)))
             (s4-1 (-> v1-13 data))
             (s3-0 (-> v1-13 length))
             )
        (set! sv-16 (&-> (the-as terrain-context #x70000000) work background vis-list (/ (-> s4-1 0 id) 8)))
        (let ((s5-1 (-> *display* frames (-> *display* on-screen) frame global-buf base)))
          (let* ((s1-0 (-> *display* frames (-> *display* on-screen) frame global-buf))
                 (s2-0 (-> s1-0 base))
                 )
            (set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
            (set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
            (tfrag-init-buffer
              s1-0
              (new 'static 'gs-test
                :ate #x1
                :atst (gs-atest greater-equal)
                :aref #x26
                :zte #x1
                :ztst (gs-ztest greater-equal)
                )
              0
              )
            (let* ((v1-28 (-> *perf-stats* data 5))
                   (a0-17 (-> v1-28 ctrl))
                   )
              (+! (-> v1-28 count) 1)
              (b! (zero? a0-17) cfg-8 :delay (nop!))
              (.mtc0 Perf r0)
              (.sync.l)
              (.sync.p)
              (.mtpc pcr0 r0)
              (.mtpc pcr1 r0)
              (.sync.l)
              (.sync.p)
              (.mtc0 Perf a0-17)
              )
            (.sync.l)
            (.sync.p)
            (label cfg-8)
            0
            (draw-inline-array-tfrag sv-16 (the-as drawable-inline-array s4-1) s3-0 s1-0)
            (let ((v1-31 (-> *perf-stats* data 5)))
              (b! (zero? (-> v1-31 ctrl)) cfg-10 :delay (nop!))
              (.mtc0 Perf r0)
              (.sync.l)
              (.sync.p)
              (.mfpc a0-20 pcr0)
              (+! (-> v1-31 accum0) a0-20)
              (.mfpc a0-22 pcr1)
              (+! (-> v1-31 accum1) a0-22)
              )
            (label cfg-10)
            0
            (update-wait-stats
              (-> *perf-stats* data 5)
              (the-as uint 0)
              (-> *tfrag-work* wait-to-spr)
              (-> *tfrag-work* wait-from-spr)
              )
            (tfrag-end-buffer s1-0)
            (let ((a3-3 (-> s1-0 base)))
              (let ((v1-38 (the-as object (-> s1-0 base))))
                (set! (-> (the-as dma-packet v1-38) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
                (set! (-> (the-as dma-packet v1-38) vif0) (new 'static 'vif-tag))
                (set! (-> (the-as dma-packet v1-38) vif1) (new 'static 'vif-tag))
                (set! (-> s1-0 base) (&+ (the-as pointer v1-38) 16))
                )
              (dma-bucket-insert-tag
                (-> *display* frames (-> *display* on-screen) frame bucket-group)
                (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
                                      6
                                      13
                                      )
                        )
                s2-0
                (the-as (pointer dma-tag) a3-3)
                )
              )
            )
          (let* ((s1-1 (-> *display* frames (-> *display* on-screen) frame global-buf))
                 (s2-1 (-> s1-1 base))
                 )
            (set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
            (set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
            (tfrag-near-init-buffer
              s1-1
              (new 'static 'gs-test
                :ate #x1
                :atst (gs-atest greater-equal)
                :aref #x26
                :zte #x1
                :ztst (gs-ztest greater-equal)
                )
              0
              )
            (let* ((v1-52 (-> *perf-stats* data 6))
                   (a0-35 (-> v1-52 ctrl))
                   )
              (+! (-> v1-52 count) 1)
              (b! (zero? a0-35) cfg-15 :delay (nop!))
              (.mtc0 Perf r0)
              (.sync.l)
              (.sync.p)
              (.mtpc pcr0 r0)
              (.mtpc pcr1 r0)
              (.sync.l)
              (.sync.p)
              (.mtc0 Perf a0-35)
              )
            (.sync.l)
            (.sync.p)
            (label cfg-15)
            0
            (draw-inline-array-tfrag-near sv-16 (the-as drawable-inline-array s4-1) s3-0 s1-1)
            (let ((v1-55 (-> *perf-stats* data 6)))
              (b! (zero? (-> v1-55 ctrl)) cfg-17 :delay (nop!))
              (.mtc0 Perf r0)
              (.sync.l)
              (.sync.p)
              (.mfpc a0-38 pcr0)
              (+! (-> v1-55 accum0) a0-38)
              (.mfpc a0-40 pcr1)
              (+! (-> v1-55 accum1) a0-40)
              )
            (label cfg-17)
            0
            (update-wait-stats
              (-> *perf-stats* data 6)
              (the-as uint 0)
              (-> *tfrag-work* near-wait-to-spr)
              (-> *tfrag-work* near-wait-from-spr)
              )
            (tfrag-near-end-buffer s1-1)
            (let ((a3-6 (-> s1-1 base)))
              (let ((v1-62 (the-as object (-> s1-1 base))))
                (set! (-> (the-as dma-packet v1-62) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
                (set! (-> (the-as dma-packet v1-62) vif0) (new 'static 'vif-tag))
                (set! (-> (the-as dma-packet v1-62) vif1) (new 'static 'vif-tag))
                (set! (-> s1-1 base) (&+ (the-as pointer v1-62) 16))
                )
              (dma-bucket-insert-tag
                (-> *display* frames (-> *display* on-screen) frame bucket-group)
                (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
                                      7
                                      14
                                      )
                        )
                s2-1
                (the-as (pointer dma-tag) a3-6)
                )
              )
            )
          (let ((v1-69 *dma-mem-usage*))
            (when (nonzero? v1-69)
              (set! (-> v1-69 length) (max 2 (-> v1-69 length)))
              (set! (-> v1-69 data 1 name) "tfragment")
              (+! (-> v1-69 data 1 count) 1)
              (+! (-> v1-69 data 1 used)
                  (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s5-1))
                  )
              (set! (-> v1-69 data 1 total) (-> v1-69 data 1 used))
              )
            )
          )
        )
      )
    )
  (none)
  )

;; definition for function draw-drawable-tree-trans-tfrag
;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none.
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr0, r0]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr1, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, a0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr0, r0]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr1, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, a0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
(defun draw-drawable-tree-trans-tfrag ((arg0 drawable-tree-trans-tfrag))
  (local-vars (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8)))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag))
    (let ((s5-0 (+ (-> arg0 length) -1)))
      (when (nonzero? s5-0)
        (dotimes (s4-0 s5-0)
          (let* ((v1-7 (-> arg0 arrays s4-0))
                 (a0-4 (-> arg0 arrays (+ s4-0 1)))
                 (a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
                 (a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
                 (a1-3 (&-> (the-as terrain-context #x70000000) work background vis-list a1-1))
                 (a0-8 (&-> (the-as terrain-context #x70000000) work background vis-list a0-6))
                 )
            (draw-node-cull
              a0-8
              a1-3
              (-> (the-as drawable-inline-array-node v1-7) data)
              (-> (the-as drawable-inline-array-node v1-7) length)
              )
            )
          )
        )
      (let* ((v1-13 (-> arg0 arrays s5-0))
             (s5-1 (&+ v1-13 32))
             (s4-1 (-> v1-13 length))
             )
        (set! sv-16 (&-> (the-as terrain-context #x70000000) work background vis-list (/ (-> s5-1 id) 8)))
        (let* ((s2-0 (-> *display* frames (-> *display* on-screen) frame global-buf))
               (s3-0 (-> s2-0 base))
               )
          (set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
          (set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
          (tfrag-init-buffer
            s2-0
            (new 'static 'gs-test
              :ate #x1
              :atst (gs-atest greater-equal)
              :aref #x7e
              :afail #x1
              :zte #x1
              :ztst (gs-ztest greater-equal)
              )
            1
            )
          (let* ((v1-24 (-> *perf-stats* data 5))
                 (a0-14 (-> v1-24 ctrl))
                 )
            (+! (-> v1-24 count) 1)
            (b! (zero? a0-14) cfg-8 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mtpc pcr0 r0)
            (.mtpc pcr1 r0)
            (.sync.l)
            (.sync.p)
            (.mtc0 Perf a0-14)
            )
          (.sync.l)
          (.sync.p)
          (label cfg-8)
          0
          (draw-inline-array-tfrag sv-16 s5-1 s4-1 s2-0)
          (update-wait-stats
            (-> *perf-stats* data 5)
            (the-as uint 0)
            (-> *tfrag-work* wait-to-spr)
            (-> *tfrag-work* wait-from-spr)
            )
          (let ((v1-32 (-> *perf-stats* data 5)))
            (b! (zero? (-> v1-32 ctrl)) cfg-10 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mfpc a0-18 pcr0)
            (+! (-> v1-32 accum0) a0-18)
            (.mfpc a0-20 pcr1)
            (+! (-> v1-32 accum1) a0-20)
            )
          (label cfg-10)
          0
          (tfrag-end-buffer s2-0)
          (let ((a3-3 (-> s2-0 base)))
            (let ((v1-34 (the-as object (-> s2-0 base))))
              (set! (-> (the-as dma-packet v1-34) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
              (set! (-> (the-as dma-packet v1-34) vif0) (new 'static 'vif-tag))
              (set! (-> (the-as dma-packet v1-34) vif1) (new 'static 'vif-tag))
              (set! (-> s2-0 base) (&+ (the-as pointer v1-34) 16))
              )
            (dma-bucket-insert-tag
              (-> *display* frames (-> *display* on-screen) frame bucket-group)
              (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
                                    32
                                    39
                                    )
                      )
              s3-0
              (the-as (pointer dma-tag) a3-3)
              )
            )
          )
        (let* ((s2-1 (-> *display* frames (-> *display* on-screen) frame global-buf))
               (s3-1 (-> s2-1 base))
               )
          (set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
          (set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
          (tfrag-near-init-buffer
            s2-1
            (new 'static 'gs-test
              :ate #x1
              :atst (gs-atest greater-equal)
              :aref #x7e
              :afail #x1
              :zte #x1
              :ztst (gs-ztest greater-equal)
              )
            1
            )
          (let* ((v1-48 (-> *perf-stats* data 6))
                 (a0-32 (-> v1-48 ctrl))
                 )
            (+! (-> v1-48 count) 1)
            (b! (zero? a0-32) cfg-15 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mtpc pcr0 r0)
            (.mtpc pcr1 r0)
            (.sync.l)
            (.sync.p)
            (.mtc0 Perf a0-32)
            )
          (.sync.l)
          (.sync.p)
          (label cfg-15)
          0
          (draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
          (let ((v1-51 (-> *perf-stats* data 6)))
            (b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mfpc a0-35 pcr0)
            (+! (-> v1-51 accum0) a0-35)
            (.mfpc a0-37 pcr1)
            (+! (-> v1-51 accum1) a0-37)
            )
          (label cfg-17)
          0
          (update-wait-stats
            (-> *perf-stats* data 6)
            (the-as uint 0)
            (-> *tfrag-work* near-wait-to-spr)
            (-> *tfrag-work* near-wait-from-spr)
            )
          (tfrag-near-end-buffer s2-1)
          (let ((a3-6 (-> s2-1 base)))
            (let ((v1-58 (the-as object (-> s2-1 base))))
              (set! (-> (the-as dma-packet v1-58) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
              (set! (-> (the-as dma-packet v1-58) vif0) (new 'static 'vif-tag))
              (set! (-> (the-as dma-packet v1-58) vif1) (new 'static 'vif-tag))
              (set! (-> s2-1 base) (&+ (the-as pointer v1-58) 16))
              )
            (dma-bucket-insert-tag
              (-> *display* frames (-> *display* on-screen) frame bucket-group)
              (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
                                    33
                                    40
                                    )
                      )
              s3-1
              (the-as (pointer dma-tag) a3-6)
              )
            )
          )
        )
      )
    )
  (none)
  )

;; definition for function draw-drawable-tree-dirt-tfrag
;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none.
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr0, r0]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr1, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, a0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr0, r0]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr1, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, a0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
(defun draw-drawable-tree-dirt-tfrag ((arg0 drawable-tree-dirt-tfrag))
  (local-vars (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8)))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag))
    (let ((s5-0 (+ (-> arg0 length) -1)))
      (when (nonzero? s5-0)
        (dotimes (s4-0 s5-0)
          (let* ((v1-7 (-> arg0 arrays s4-0))
                 (a0-4 (-> arg0 arrays (+ s4-0 1)))
                 (a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
                 (a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
                 (a1-3 (&-> (the-as terrain-context #x70000000) work background vis-list a1-1))
                 (a0-8 (&-> (the-as terrain-context #x70000000) work background vis-list a0-6))
                 )
            (draw-node-cull
              a0-8
              a1-3
              (-> (the-as drawable-inline-array-node v1-7) data)
              (-> (the-as drawable-inline-array-node v1-7) length)
              )
            )
          )
        )
      (let* ((v1-13 (-> arg0 arrays s5-0))
             (s5-1 (&+ v1-13 32))
             (s4-1 (-> v1-13 length))
             )
        (set! sv-16 (&-> (the-as terrain-context #x70000000) work background vis-list (/ (-> s5-1 id) 8)))
        (let* ((s2-0 (-> *display* frames (-> *display* on-screen) frame global-buf))
               (s3-0 (-> s2-0 base))
               )
          (set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
          (set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
          (tfrag-init-buffer s2-0 (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal)) 1)
          (let* ((v1-24 (-> *perf-stats* data 5))
                 (a0-14 (-> v1-24 ctrl))
                 )
            (+! (-> v1-24 count) 1)
            (b! (zero? a0-14) cfg-8 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mtpc pcr0 r0)
            (.mtpc pcr1 r0)
            (.sync.l)
            (.sync.p)
            (.mtc0 Perf a0-14)
            )
          (.sync.l)
          (.sync.p)
          (label cfg-8)
          0
          (draw-inline-array-tfrag sv-16 s5-1 s4-1 s2-0)
          (update-wait-stats
            (-> *perf-stats* data 5)
            (the-as uint 0)
            (-> *tfrag-work* wait-to-spr)
            (-> *tfrag-work* wait-from-spr)
            )
          (let ((v1-32 (-> *perf-stats* data 5)))
            (b! (zero? (-> v1-32 ctrl)) cfg-10 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mfpc a0-18 pcr0)
            (+! (-> v1-32 accum0) a0-18)
            (.mfpc a0-20 pcr1)
            (+! (-> v1-32 accum1) a0-20)
            )
          (label cfg-10)
          0
          (tfrag-end-buffer s2-0)
          (let ((a3-3 (-> s2-0 base)))
            (let ((v1-34 (the-as object (-> s2-0 base))))
              (set! (-> (the-as dma-packet v1-34) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
              (set! (-> (the-as dma-packet v1-34) vif0) (new 'static 'vif-tag))
              (set! (-> (the-as dma-packet v1-34) vif1) (new 'static 'vif-tag))
              (set! (-> s2-0 base) (&+ (the-as pointer v1-34) 16))
              )
            (dma-bucket-insert-tag
              (-> *display* frames (-> *display* on-screen) frame bucket-group)
              (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
                                    34
                                    41
                                    )
                      )
              s3-0
              (the-as (pointer dma-tag) a3-3)
              )
            )
          )
        (let* ((s2-1 (-> *display* frames (-> *display* on-screen) frame global-buf))
               (s3-1 (-> s2-1 base))
               )
          (set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
          (set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
          (tfrag-near-init-buffer
            s2-1
            (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
            1
            )
          (let* ((v1-48 (-> *perf-stats* data 6))
                 (a0-32 (-> v1-48 ctrl))
                 )
            (+! (-> v1-48 count) 1)
            (b! (zero? a0-32) cfg-15 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mtpc pcr0 r0)
            (.mtpc pcr1 r0)
            (.sync.l)
            (.sync.p)
            (.mtc0 Perf a0-32)
            )
          (.sync.l)
          (.sync.p)
          (label cfg-15)
          0
          (draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
          (let ((v1-51 (-> *perf-stats* data 6)))
            (b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mfpc a0-35 pcr0)
            (+! (-> v1-51 accum0) a0-35)
            (.mfpc a0-37 pcr1)
            (+! (-> v1-51 accum1) a0-37)
            )
          (label cfg-17)
          0
          (update-wait-stats
            (-> *perf-stats* data 6)
            (the-as uint 0)
            (-> *tfrag-work* near-wait-to-spr)
            (-> *tfrag-work* near-wait-from-spr)
            )
          (tfrag-near-end-buffer s2-1)
          (let ((a3-6 (-> s2-1 base)))
            (let ((v1-58 (the-as object (-> s2-1 base))))
              (set! (-> (the-as dma-packet v1-58) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
              (set! (-> (the-as dma-packet v1-58) vif0) (new 'static 'vif-tag))
              (set! (-> (the-as dma-packet v1-58) vif1) (new 'static 'vif-tag))
              (set! (-> s2-1 base) (&+ (the-as pointer v1-58) 16))
              )
            (dma-bucket-insert-tag
              (-> *display* frames (-> *display* on-screen) frame bucket-group)
              (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
                                    35
                                    42
                                    )
                      )
              s3-1
              (the-as (pointer dma-tag) a3-6)
              )
            )
          )
        )
      )
    )
  (none)
  )

;; definition for function draw-drawable-tree-ice-tfrag
;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none.
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr0, r0]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr1, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, a0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr0, r0]
;; WARN: Unsupported inline assembly instruction kind - [mtpc pcr1, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, a0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
(defun draw-drawable-tree-ice-tfrag ((arg0 drawable-tree-ice-tfrag))
  (local-vars (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8)))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag))
    (let ((s5-0 (+ (-> arg0 length) -1)))
      (when (nonzero? s5-0)
        (dotimes (s4-0 s5-0)
          (let* ((v1-7 (-> arg0 arrays s4-0))
                 (a0-4 (-> arg0 arrays (+ s4-0 1)))
                 (a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
                 (a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
                 (a1-3 (&-> (the-as terrain-context #x70000000) work background vis-list a1-1))
                 (a0-8 (&-> (the-as terrain-context #x70000000) work background vis-list a0-6))
                 )
            (draw-node-cull
              a0-8
              a1-3
              (-> (the-as drawable-inline-array-node v1-7) data)
              (-> (the-as drawable-inline-array-node v1-7) length)
              )
            )
          )
        )
      (let* ((v1-13 (-> arg0 arrays s5-0))
             (s5-1 (&+ v1-13 32))
             (s4-1 (-> v1-13 length))
             )
        (set! sv-16 (&-> (the-as terrain-context #x70000000) work background vis-list (/ (-> s5-1 id) 8)))
        (let* ((s2-0 (-> *display* frames (-> *display* on-screen) frame global-buf))
               (s3-0 (-> s2-0 base))
               )
          (set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
          (set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
          (tfrag-init-buffer
            s2-0
            (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
            1
            )
          (let* ((v1-24 (-> *perf-stats* data 5))
                 (a0-14 (-> v1-24 ctrl))
                 )
            (+! (-> v1-24 count) 1)
            (b! (zero? a0-14) cfg-8 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mtpc pcr0 r0)
            (.mtpc pcr1 r0)
            (.sync.l)
            (.sync.p)
            (.mtc0 Perf a0-14)
            )
          (.sync.l)
          (.sync.p)
          (label cfg-8)
          0
          (draw-inline-array-tfrag sv-16 s5-1 s4-1 s2-0)
          (update-wait-stats
            (-> *perf-stats* data 5)
            (the-as uint 0)
            (-> *tfrag-work* wait-to-spr)
            (-> *tfrag-work* wait-from-spr)
            )
          (let ((v1-32 (-> *perf-stats* data 5)))
            (b! (zero? (-> v1-32 ctrl)) cfg-10 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mfpc a0-18 pcr0)
            (+! (-> v1-32 accum0) a0-18)
            (.mfpc a0-20 pcr1)
            (+! (-> v1-32 accum1) a0-20)
            )
          (label cfg-10)
          0
          (tfrag-end-buffer s2-0)
          (let ((a3-3 (-> s2-0 base)))
            (let ((v1-34 (the-as object (-> s2-0 base))))
              (set! (-> (the-as dma-packet v1-34) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
              (set! (-> (the-as dma-packet v1-34) vif0) (new 'static 'vif-tag))
              (set! (-> (the-as dma-packet v1-34) vif1) (new 'static 'vif-tag))
              (set! (-> s2-0 base) (&+ (the-as pointer v1-34) 16))
              )
            (dma-bucket-insert-tag
              (-> *display* frames (-> *display* on-screen) frame bucket-group)
              (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
                                    36
                                    43
                                    )
                      )
              s3-0
              (the-as (pointer dma-tag) a3-3)
              )
            )
          )
        (let* ((s2-1 (-> *display* frames (-> *display* on-screen) frame global-buf))
               (s3-1 (-> s2-1 base))
               )
          (set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
          (set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
          (tfrag-near-init-buffer
            s2-1
            (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
            1
            )
          (let* ((v1-48 (-> *perf-stats* data 6))
                 (a0-32 (-> v1-48 ctrl))
                 )
            (+! (-> v1-48 count) 1)
            (b! (zero? a0-32) cfg-15 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mtpc pcr0 r0)
            (.mtpc pcr1 r0)
            (.sync.l)
            (.sync.p)
            (.mtc0 Perf a0-32)
            )
          (.sync.l)
          (.sync.p)
          (label cfg-15)
          0
          (draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
          (let ((v1-51 (-> *perf-stats* data 6)))
            (b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
            (.mtc0 Perf r0)
            (.sync.l)
            (.sync.p)
            (.mfpc a0-35 pcr0)
            (+! (-> v1-51 accum0) a0-35)
            (.mfpc a0-37 pcr1)
            (+! (-> v1-51 accum1) a0-37)
            )
          (label cfg-17)
          0
          (update-wait-stats
            (-> *perf-stats* data 6)
            (the-as uint 0)
            (-> *tfrag-work* near-wait-to-spr)
            (-> *tfrag-work* near-wait-from-spr)
            )
          (tfrag-near-end-buffer s2-1)
          (let ((a3-6 (-> s2-1 base)))
            (let ((v1-58 (the-as object (-> s2-1 base))))
              (set! (-> (the-as dma-packet v1-58) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
              (set! (-> (the-as dma-packet v1-58) vif0) (new 'static 'vif-tag))
              (set! (-> (the-as dma-packet v1-58) vif1) (new 'static 'vif-tag))
              (set! (-> s2-1 base) (&+ (the-as pointer v1-58) 16))
              )
            (dma-bucket-insert-tag
              (-> *display* frames (-> *display* on-screen) frame bucket-group)
              (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index))
                                    37
                                    44
                                    )
                      )
              s3-1
              (the-as (pointer dma-tag) a3-6)
              )
            )
          )
        )
      )
    )
  (none)
  )

;; definition for method 10 of type drawable-tree-tfrag
;; INFO: Return type mismatch drawable-tree-tfrag vs none.
(defmethod draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame))
  (let* ((v1-1 (-> *background-work* tfrag-tree-count))
         (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index))
         (a1-5 (-> *level* level a1-2))
         )
    (set! (-> *background-work* tfrag-trees v1-1) obj)
    (set! (-> *background-work* tfrag-levels v1-1) a1-5)
    )
  (+! (-> *background-work* tfrag-tree-count) 1)
  (none)
  )

;; definition for method 10 of type drawable-tree-trans-tfrag
;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none.
(defmethod draw drawable-tree-trans-tfrag ((obj drawable-tree-trans-tfrag) (arg0 drawable-tree-trans-tfrag) (arg1 display-frame))
  (let* ((v1-1 (-> *background-work* trans-tfrag-tree-count))
         (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index))
         (a1-5 (-> *level* level a1-2))
         )
    (set! (-> *background-work* trans-tfrag-trees v1-1) obj)
    (set! (-> *background-work* trans-tfrag-levels v1-1) a1-5)
    )
  (+! (-> *background-work* trans-tfrag-tree-count) 1)
  (none)
  )

;; definition for method 10 of type drawable-tree-dirt-tfrag
;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none.
(defmethod draw drawable-tree-dirt-tfrag ((obj drawable-tree-dirt-tfrag) (arg0 drawable-tree-dirt-tfrag) (arg1 display-frame))
  (let* ((v1-1 (-> *background-work* dirt-tfrag-tree-count))
         (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index))
         (a1-5 (-> *level* level a1-2))
         )
    (set! (-> *background-work* dirt-tfrag-trees v1-1) obj)
    (set! (-> *background-work* dirt-tfrag-levels v1-1) a1-5)
    )
  (+! (-> *background-work* dirt-tfrag-tree-count) 1)
  (none)
  )

;; definition for method 10 of type drawable-tree-ice-tfrag
;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none.
(defmethod draw drawable-tree-ice-tfrag ((obj drawable-tree-ice-tfrag) (arg0 drawable-tree-ice-tfrag) (arg1 display-frame))
  (let* ((v1-1 (-> *background-work* ice-tfrag-tree-count))
         (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index))
         (a1-5 (-> *level* level a1-2))
         )
    (set! (-> *background-work* ice-tfrag-trees v1-1) obj)
    (set! (-> *background-work* ice-tfrag-levels v1-1) a1-5)
    )
  (+! (-> *background-work* ice-tfrag-tree-count) 1)
  (none)
  )

;; definition for method 10 of type drawable-tree-lowres-tfrag
;; INFO: Return type mismatch drawable-tree-lowres-tfrag vs none.
(defmethod draw drawable-tree-lowres-tfrag ((obj drawable-tree-lowres-tfrag) (arg0 drawable-tree-lowres-tfrag) (arg1 display-frame))
  (let* ((v1-1 (-> *background-work* lowres-tfrag-tree-count))
         (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index))
         (a1-5 (-> *level* level a1-2))
         )
    (set! (-> *background-work* lowres-tfrag-trees v1-1) obj)
    (set! (-> *background-work* lowres-tfrag-levels v1-1) a1-5)
    )
  (+! (-> *background-work* lowres-tfrag-tree-count) 1)
  (none)
  )

;; definition for method 10 of type drawable-tree-lowres-trans-tfrag
;; INFO: Return type mismatch drawable-tree-lowres-trans-tfrag vs none.
(defmethod draw drawable-tree-lowres-trans-tfrag ((obj drawable-tree-lowres-trans-tfrag) (arg0 drawable-tree-lowres-trans-tfrag) (arg1 display-frame))
  (let* ((v1-1 (-> *background-work* lowres-trans-tfrag-tree-count))
         (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index))
         (a1-5 (-> *level* level a1-2))
         )
    (set! (-> *background-work* lowres-trans-tfrag-trees v1-1) obj)
    (set! (-> *background-work* lowres-trans-tfrag-levels v1-1) a1-5)
    )
  (+! (-> *background-work* lowres-trans-tfrag-tree-count) 1)
  (none)
  )

;; definition for method 14 of type tfragment
(defmethod collect-stats tfragment ((obj tfragment))
  (stats-tfrag-asm obj)
  (none)
  )

;; definition for method 14 of type drawable-tree-tfrag
;; INFO: Return type mismatch drawable-tree-tfrag vs none.
;; Used lq/sq
(defmethod collect-stats drawable-tree-tfrag ((obj drawable-tree-tfrag))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag))
    (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag))))
    (set! (-> *tfrag-work* vu1-enable-tfrag-near)
          (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))
          )
    (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* tfrag))
    (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* tfrag-near))
    (let ((v1-12 (-> *tfrag-work* frag-dists quad)))
      (set! (-> *tfrag-work* frag-dists quad) v1-12)
      )
    (dotimes (s5-0 (-> obj length))
      (collect-stats (-> obj arrays s5-0))
      )
    )
  (none)
  )

;; definition for method 14 of type drawable-tree-lowres-tfrag
;; INFO: Return type mismatch drawable-tree-lowres-tfrag vs none.
;; Used lq/sq
(defmethod collect-stats drawable-tree-lowres-tfrag ((obj drawable-tree-lowres-tfrag))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag))
    (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag))))
    (set! (-> *tfrag-work* vu1-enable-tfrag-near)
          (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))
          )
    (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* tfrag))
    (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* tfrag-near))
    (let ((v1-12 (-> *tfrag-work* frag-dists quad)))
      (set! (-> *tfrag-work* frag-dists quad) v1-12)
      )
    (dotimes (s5-0 (-> obj length))
      (collect-stats (-> obj arrays s5-0))
      )
    )
  (none)
  )

;; definition for method 14 of type drawable-tree-trans-tfrag
;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none.
;; Used lq/sq
(defmethod collect-stats drawable-tree-trans-tfrag ((obj drawable-tree-trans-tfrag))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag))
    (set! (-> *tfrag-work* vu1-enable-tfrag)
          (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))
          )
    (set! (-> *tfrag-work* vu1-enable-tfrag-near)
          (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))
          )
    (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag))
    (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near))
    (let ((v1-12 (-> *tfrag-work* frag-dists quad)))
      (set! (-> *tfrag-work* frag-dists quad) v1-12)
      )
    (dotimes (s5-0 (-> obj length))
      (collect-stats (-> obj arrays s5-0))
      )
    )
  (none)
  )

;; definition for method 14 of type drawable-tree-lowres-trans-tfrag
;; INFO: Return type mismatch drawable-tree-lowres-trans-tfrag vs none.
;; Used lq/sq
(defmethod collect-stats drawable-tree-lowres-trans-tfrag ((obj drawable-tree-lowres-trans-tfrag))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag))
    (set! (-> *tfrag-work* vu1-enable-tfrag)
          (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))
          )
    (set! (-> *tfrag-work* vu1-enable-tfrag-near)
          (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))
          )
    (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag))
    (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near))
    (let ((v1-12 (-> *tfrag-work* frag-dists quad)))
      (set! (-> *tfrag-work* frag-dists quad) v1-12)
      )
    (dotimes (s5-0 (-> obj length))
      (collect-stats (-> obj arrays s5-0))
      )
    )
  (none)
  )

;; definition for method 14 of type drawable-tree-dirt-tfrag
;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none.
;; Used lq/sq
(defmethod collect-stats drawable-tree-dirt-tfrag ((obj drawable-tree-dirt-tfrag))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag))
    (set! (-> *tfrag-work* vu1-enable-tfrag)
          (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))
          )
    (set! (-> *tfrag-work* vu1-enable-tfrag-near)
          (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))
          )
    (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag))
    (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near))
    (let ((v1-12 (-> *tfrag-work* frag-dists quad)))
      (set! (-> *tfrag-work* frag-dists quad) v1-12)
      )
    (dotimes (s5-0 (-> obj length))
      (collect-stats (-> obj arrays s5-0))
      )
    )
  (none)
  )

;; definition for method 14 of type drawable-tree-ice-tfrag
;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none.
;; Used lq/sq
(defmethod collect-stats drawable-tree-ice-tfrag ((obj drawable-tree-ice-tfrag))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag))
    (set! (-> *tfrag-work* vu1-enable-tfrag)
          (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))
          )
    (set! (-> *tfrag-work* vu1-enable-tfrag-near)
          (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))
          )
    (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag))
    (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near))
    (let ((v1-12 (-> *tfrag-work* frag-dists quad)))
      (set! (-> *tfrag-work* frag-dists quad) v1-12)
      )
    (dotimes (s5-0 (-> obj length))
      (collect-stats (-> obj arrays s5-0))
      )
    )
  (none)
  )

;; definition for method 14 of type drawable-inline-array-tfrag
;; INFO: Return type mismatch drawable-inline-array-tfrag vs none.
(defmethod collect-stats drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag))
    (dotimes (s5-0 (-> obj length))
      (let ((s4-0 (-> obj data s5-0)))
        (if (vis-cull (-> s4-0 id))
            (collect-stats s4-0)
            )
        )
      )
    )
  (none)
  )

;; definition for method 14 of type drawable-inline-array-trans-tfrag
;; INFO: Return type mismatch drawable-inline-array-trans-tfrag vs none.
(defmethod collect-stats drawable-inline-array-trans-tfrag ((obj drawable-inline-array-trans-tfrag))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag))
    (dotimes (s5-0 (-> obj length))
      (let ((s4-0 (-> obj data s5-0)))
        (if (vis-cull (-> s4-0 id))
            (collect-stats s4-0)
            )
        )
      )
    )
  (none)
  )

;; definition for method 15 of type drawable-tree-tfrag
;; INFO: Return type mismatch drawable-tree-tfrag vs none.
(defmethod debug-draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag))
    (dotimes (s4-0 (-> obj length))
      (let ((a1-1 (-> obj arrays s4-0)))
        (debug-draw a1-1 a1-1 arg1)
        )
      )
    )
  (none)
  )

;; definition for method 15 of type drawable-tree-trans-tfrag
;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none.
(defmethod debug-draw drawable-tree-trans-tfrag ((obj drawable-tree-trans-tfrag) (arg0 drawable) (arg1 display-frame))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag))
    (dotimes (s4-0 (-> obj length))
      (let ((a1-1 (-> obj arrays s4-0)))
        (debug-draw a1-1 a1-1 arg1)
        )
      )
    )
  (none)
  )

;; definition for method 15 of type drawable-inline-array-tfrag
;; INFO: Return type mismatch drawable-inline-array-tfrag vs none.
(defmethod debug-draw drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame))
  (dotimes (s4-0 (-> obj length))
    (let ((s3-0 (-> obj data s4-0)))
      (if (vis-cull (-> s3-0 id))
          (debug-draw s3-0 s3-0 arg1)
          )
      )
    )
  (none)
  )

;; definition for method 15 of type tfragment
(defmethod debug-draw tfragment ((obj tfragment) (arg0 drawable) (arg1 display-frame))
  (-> arg1 global-buf)
  (edge-debug-lines (-> obj debug-data debug-lines))
  (none)
  )
