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

;; definition for method 9 of type tie-fragment
(defmethod login tie-fragment ((obj tie-fragment))
  (let ((s5-0 (-> obj gif-ref))
        (s4-0 (/ (-> obj tex-count) (the-as uint 5)))
        )
    (dotimes (s3-0 (the-as int s4-0))
      (adgif-shader-login-no-remap (-> s5-0 s3-0))
      )
    )
  obj
  )

;; definition for method 3 of type drawable-inline-array-instance-tie
(defmethod inspect drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tlength: ~D~%" (-> obj length))
  (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data))
  (dotimes (s5-0 (-> obj length))
    (format #t "~T  [~D] ~A~%" s5-0 (-> obj data s5-0))
    )
  obj
  )

;; definition for method 5 of type drawable-inline-array-instance-tie
;; INFO: Return type mismatch uint vs int.
(defmethod asize-of drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie))
  (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> obj length) -1) 64)))
  )

;; definition for method 9 of type drawable-tree-instance-tie
;; INFO: this function exists in multiple non-identical object files
(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie))
  obj
  )

;; definition for method 9 of type drawable-tree-instance-tie
;; INFO: this function exists in multiple non-identical object files
;; INFO: Return type mismatch symbol vs drawable-tree-instance-tie.
(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie))
  (dotimes (s5-0 (-> obj length))
    (login (-> obj data s5-0))
    )
  (the-as drawable-tree-instance-tie #f)
  )

;; definition for method 3 of type prototype-tie
(defmethod inspect prototype-tie ((obj prototype-tie))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tlength: ~D~%" (-> obj length))
  (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data))
  (dotimes (s5-0 (-> obj length))
    (format #t "~T  [~D] ~A~%" s5-0 (-> obj data s5-0))
    )
  obj
  )

;; definition for method 9 of type prototype-tie
(defmethod login prototype-tie ((obj prototype-tie))
  (dotimes (s5-0 (-> obj length))
    (login (-> obj data s5-0))
    )
  obj
  )

;; definition for method 8 of type drawable-tree-instance-tie
(defmethod mem-usage drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int))
  (set! (-> arg0 length) (max 1 (-> arg0 length)))
  (set! (-> arg0 data 0 name) (symbol->string 'drawable-group))
  (+! (-> arg0 data 0 count) 1)
  (let ((v1-7 32))
    (+! (-> arg0 data 0 used) v1-7)
    (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))
    )
  (dotimes (s3-0 (-> obj length))
    (mem-usage (-> obj data s3-0) arg0 arg1)
    )
  (mem-usage (-> obj prototypes prototype-array-tie) arg0 (logior arg1 1))
  obj
  )

;; definition for method 8 of type tie-fragment
(defmethod mem-usage tie-fragment ((obj tie-fragment) (arg0 memory-usage-block) (arg1 int))
  (when (logtest? arg1 2)
    (let ((v1-3 (* (-> obj color-count) 4))
          (a0-2 (cond
                  ((logtest? arg1 4)
                   20
                   )
                  ((logtest? arg1 8)
                   21
                   )
                  (else
                    22
                    )
                  )
                )
          )
      (+! (-> arg0 data a0-2 count) 1)
      (+! (-> arg0 data a0-2 used) v1-3)
      (+! (-> arg0 data a0-2 total) (logand -4 (+ v1-3 3)))
      )
    (set! (-> arg0 length) (max 23 (-> arg0 length)))
    (set! obj obj)
    (goto cfg-13)
    )
  (set! (-> arg0 length) (max 18 (-> arg0 length)))
  (set! (-> arg0 data 9 name) "tie-fragment")
  (set! (-> arg0 data 10 name) "tie-gif")
  (set! (-> arg0 data 11 name) "tie-points")
  (set! (-> arg0 data 12 name) "tie-colors")
  (set! (-> arg0 data 14 name) "tie-debug")
  (set! (-> arg0 data 13 name) "tie-draw-points")
  (set! (-> arg0 data 17 name) "tie-generic")
  (+! (-> arg0 data 9 count) 1)
  (let ((v1-21 (asize-of obj)))
    (+! (-> arg0 data 9 used) v1-21)
    (+! (-> arg0 data 9 total) (logand -16 (+ v1-21 15)))
    )
  (let ((v1-26 (* (-> obj gif-count) 16)))
    (+! (-> arg0 data 10 count) (-> obj tex-count))
    (+! (-> arg0 data 10 used) v1-26)
    (+! (-> arg0 data 10 total) (logand -16 (+ v1-26 15)))
    )
  (let ((v1-31 (* (-> obj vertex-count) 16)))
    (+! (-> arg0 data 11 count) (-> obj vertex-count))
    (+! (-> arg0 data 11 used) v1-31)
    (+! (-> arg0 data 11 total) (logand -16 (+ v1-31 15)))
    )
  (let ((v1-36 (* (-> obj dp-qwc) 16)))
    (+! (-> arg0 data 13 count) (* (-> obj dp-qwc) 16))
    (+! (-> arg0 data 13 used) v1-36)
    (+! (-> arg0 data 13 total) (logand -16 (+ v1-36 15)))
    )
  (let ((v1-41 (* (-> obj generic-count) 16)))
    (+! (-> arg0 data 17 count) 1)
    (+! (-> arg0 data 17 used) v1-41)
    (+! (-> arg0 data 17 total) (logand -16 (+ v1-41 15)))
    )
  (when (nonzero? (-> obj debug-lines))
    (dotimes (s4-0 (-> obj debug-lines length))
      (+! (-> arg0 data 14 count) (-> (the-as (pointer int32) (-> obj debug-lines s4-0)) 0))
      (let ((v1-52 (asize-of (the-as basic (-> obj debug-lines s4-0)))))
        (+! (-> arg0 data 12 used) v1-52)
        (+! (-> arg0 data 12 total) (logand -16 (+ v1-52 15)))
        )
      )
    )
  (label cfg-13)
  obj
  )

;; definition for method 8 of type instance-tie
(defmethod mem-usage instance-tie ((obj instance-tie) (arg0 memory-usage-block) (arg1 int))
  (set! (-> arg0 length) (max 19 (-> arg0 length)))
  (set! (-> arg0 data 18 name) "instance-tie")
  (+! (-> arg0 data 18 count) 1)
  (let ((v1-6 (asize-of obj)))
    (+! (-> arg0 data 18 used) v1-6)
    (+! (-> arg0 data 18 total) (logand -16 (+ v1-6 15)))
    )
  (when (nonzero? (-> obj error))
    (set! (-> arg0 length) (max 24 (-> arg0 length)))
    (set! (-> arg0 data 23 name) "instance-tie-colors*")
    (set! (-> arg0 data 19 name) "instance-tie-colors0")
    (set! (-> arg0 data 20 name) "instance-tie-colors1")
    (set! (-> arg0 data 21 name) "instance-tie-colors2")
    (set! (-> arg0 data 22 name) "instance-tie-colors3")
    (+! (-> arg0 data 23 count) 1)
    (let ((s3-0 (-> obj bucket-ptr)))
      (+ (-> arg0 data 19 used) (-> arg0 data 20 used) (-> arg0 data 21 used) (-> arg0 data 22 used))
      (dotimes (s2-0 4)
        (let ((a0-10 (-> s3-0 geometry-override s2-0)))
          (when (nonzero? a0-10)
            (let ((t9-1 (method-of-object a0-10 mem-usage))
                  (a1-2 arg0)
                  (v1-29 s2-0)
                  )
              (t9-1 a0-10 a1-2 (logior (logior (cond
                                                 ((= v1-29 1)
                                                  4
                                                  )
                                                 ((= v1-29 2)
                                                  8
                                                  )
                                                 ((= v1-29 3)
                                                  16
                                                  )
                                                 (else
                                                   0
                                                   )
                                                 )
                                               2
                                               )
                                       arg1
                                       )
                    )
              )
            )
          )
        )
      )
    )
  obj
  )

;; definition for method 8 of type drawable-inline-array-instance-tie
(defmethod mem-usage drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int))
  (set! (-> arg0 length) (max 1 (-> arg0 length)))
  (set! (-> arg0 data 0 name) (symbol->string 'drawable-group))
  (+! (-> arg0 data 0 count) 1)
  (let ((v1-7 32))
    (+! (-> arg0 data 0 used) v1-7)
    (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))
    )
  (dotimes (s3-0 (-> obj length))
    (mem-usage (-> obj data s3-0) arg0 arg1)
    )
  obj
  )

;; definition for method 8 of type prototype-tie
(defmethod mem-usage prototype-tie ((obj prototype-tie) (arg0 memory-usage-block) (arg1 int))
  (set! (-> arg0 length) (max 1 (-> arg0 length)))
  (set! (-> arg0 data 0 name) (symbol->string 'drawable-group))
  (+! (-> arg0 data 0 count) 1)
  (let ((v1-7 32))
    (+! (-> arg0 data 0 used) v1-7)
    (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))
    )
  (dotimes (s3-0 (-> obj length))
    (mem-usage (-> obj data s3-0) arg0 arg1)
    )
  obj
  )

;; definition for method 5 of type prototype-tie
;; INFO: Return type mismatch uint vs int.
(defmethod asize-of prototype-tie ((obj prototype-tie))
  (the-as int (+ (-> prototype-tie size) (* (+ (-> obj length) -1) 64)))
  )

;; definition of type tie-consts
(deftype tie-consts (structure)
  ((data      uint32     24        :offset-assert   0)
   (vector    vector     6 :inline :offset          0)
   (quads     uint128    6         :offset          0)
   (adgif     gs-gif-tag :inline   :offset          0)
   (strgif    gs-gif-tag :inline   :offset         16)
   (extra     vector     :inline   :offset         32)
   (gifbufs   vector     :inline   :offset         48)
   (clrbufs   qword      :inline   :offset         64)
   (misc      qword      :inline   :offset         80)
   (atestgif  gs-gif-tag :inline   :offset         96)
   (atest     ad-cmd     2 :inline :offset        112)
   (atest-tra ad-cmd     :inline   :offset        112)
   (atest-def ad-cmd     :inline   :offset        128)
   )
  :method-count-assert 9
  :size-assert         #x90
  :flag-assert         #x900000090
  )

;; definition for method 3 of type tie-consts
(defmethod inspect tie-consts ((obj tie-consts))
  (format #t "[~8x] ~A~%" obj 'tie-consts)
  (format #t "~Tdata[24] @ #x~X~%" (-> obj data))
  (format #t "~Tvector[6] @ #x~X~%" (-> obj data))
  (format #t "~Tquads[6] @ #x~X~%" (-> obj data))
  (format #t "~Tadgif: #<qword @ #x~X>~%" (-> obj data))
  (format #t "~Tstrgif: #<qword @ #x~X>~%" (-> obj strgif))
  (format #t "~Textra: #<qword @ #x~X>~%" (-> obj extra))
  (format #t "~Tgifbufs: #<qword @ #x~X>~%" (-> obj gifbufs))
  (format #t "~Tclrbufs: #<qword @ #x~X>~%" (-> obj clrbufs))
  (format #t "~Tmisc: #<qword @ #x~X>~%" (-> obj misc))
  (format #t "~Tatestgif: #<qword @ #x~X>~%" (-> obj atestgif))
  (format #t "~Tatest[2] @ #x~X~%" (-> obj atest))
  (format #t "~Tatest-tra: #<ad-cmd @ #x~X>~%" (-> obj atest))
  (format #t "~Tatest-def: #<ad-cmd @ #x~X>~%" (-> obj atest-def))
  obj
  )

;; definition for symbol tie-vu1-block, type vu-function
(define tie-vu1-block (new 'static 'vu-function :length #x3e1 :qlength #x1f1))

;; definition for function tie-init-consts
;; INFO: Return type mismatch int vs none.
(defun tie-init-consts ((arg0 tie-consts) (arg1 int))
  (set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1))
  (set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
  (cond
    ((zero? *subdivide-draw-mode*)
     (set! (-> arg0 strgif tag)
           (new 'static 'gif-tag64
             :pre #x1
             :nreg #x3
             :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
             )
           )
     )
    ((= *subdivide-draw-mode* 3)
     (set! (-> arg0 strgif tag)
           (new 'static 'gif-tag64
             :pre #x1
             :nreg #x3
             :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
             )
           )
     )
    ((= *subdivide-draw-mode* 1)
     (set! (-> arg0 strgif tag)
           (new 'static 'gif-tag64
             :pre #x1
             :nreg #x3
             :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :fge #x1 :abe arg1)
             )
           )
     )
    ((= *subdivide-draw-mode* 2)
     (set! (-> arg0 strgif tag)
           (new 'static 'gif-tag64
             :pre #x1
             :nreg #x3
             :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe arg1)
             )
           )
     )
    )
  (set! (-> arg0 strgif regs)
        (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
        )
  (let ((f1-0 8388894.0)
        (f2-0 8389078.0)
        (f0-0 8389262.0)
        )
    (set! (-> arg0 gifbufs x) f0-0)
    (set! (-> arg0 gifbufs y) f2-0)
    (set! (-> arg0 gifbufs z) f0-0)
    (set! (-> arg0 gifbufs w) f2-0)
    (set! (-> arg0 extra x) (+ f1-0 f2-0 f0-0))
    (set! (-> arg0 extra y) 0.0)
    (set! (-> arg0 extra z) (+ f1-0 f2-0 f0-0))
    )
  (set! (-> arg0 clrbufs vector4w x) 198)
  (set! (-> arg0 clrbufs vector4w y) 242)
  (set! (-> arg0 clrbufs vector4w z) 198)
  (set! (-> arg0 clrbufs vector4w w) 242)
  (set! (-> arg0 atestgif tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1))
  (set! (-> arg0 atestgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
  (set! (-> arg0 atest-tra cmd) (gs-reg test-1))
  (set! (-> arg0 atest-tra data) (the-as uint #x5026b))
  (set! (-> arg0 atest-def cmd) (gs-reg test-1))
  (set! (-> arg0 atest-def data) (the-as uint #x5000e))
  (set! (-> arg0 misc vector4w x) 0)
  (set! (-> arg0 misc vector4w y) -1)
  (none)
  )

;; definition for function tie-init-engine
;; INFO: Return type mismatch int vs none.
(defun tie-init-engine ((arg0 dma-buffer) (arg1 gs-test) (arg2 int))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask tie))
    (dma-buffer-add-vu-function arg0 tie-vu1-block 1)
    (let* ((v1-3 arg0)
           (a0-2 (the-as object (-> v1-3 base)))
           )
      (set! (-> (the-as dma-packet a0-2) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
      (set! (-> (the-as dma-packet a0-2) vif0) (new 'static 'vif-tag))
      (set! (-> (the-as dma-packet a0-2) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1))
      (set! (-> v1-3 base) (&+ (the-as pointer a0-2) 16))
      )
    (let* ((v1-4 arg0)
           (a0-4 (the-as object (-> v1-4 base)))
           )
      (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1))
      (set! (-> (the-as gs-gif-tag a0-4) regs)
            (new 'static 'gif-tag-regs
              :regs0 (gif-reg-id a+d)
              :regs1 (gif-reg-id a+d)
              :regs2 (gif-reg-id a+d)
              :regs3 (gif-reg-id a+d)
              :regs4 (gif-reg-id a+d)
              :regs5 (gif-reg-id a+d)
              :regs6 (gif-reg-id a+d)
              :regs7 (gif-reg-id a+d)
              :regs8 (gif-reg-id a+d)
              :regs9 (gif-reg-id a+d)
              :regs10 (gif-reg-id a+d)
              :regs11 (gif-reg-id a+d)
              :regs12 (gif-reg-id a+d)
              :regs13 (gif-reg-id a+d)
              :regs14 (gif-reg-id a+d)
              :regs15 (gif-reg-id a+d)
              )
            )
      (set! (-> v1-4 base) (the-as pointer (&+ (the-as gs-gif-tag a0-4) 16)))
      )
    (let* ((v1-5 arg0)
           (a0-6 (-> v1-5 base))
           )
      (set! (-> (the-as (pointer gs-test) a0-6) 0) arg1)
      (set! (-> (the-as (pointer gs-reg64) a0-6) 1) (gs-reg64 test-1))
      (set! (-> v1-5 base) (&+ a0-6 16))
      )
    (let ((s4-1 9))
      (let* ((v1-6 arg0)
             (a0-8 (the-as object (-> v1-6 base)))
             )
        (set! (-> (the-as dma-packet a0-8) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc s4-1))
        (set! (-> (the-as dma-packet a0-8) vif0) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
        (set! (-> (the-as dma-packet a0-8) vif1)
              (new 'static 'vif-tag :imm #x3c6 :cmd (vif-cmd unpack-v4-32) :num s4-1)
              )
        (set! (-> v1-6 base) (&+ (the-as pointer a0-8) 16))
        )
      (tie-init-consts (the-as tie-consts (-> arg0 base)) arg2)
      (&+! (-> arg0 base) (* s4-1 16))
      )
    (let* ((v1-9 arg0)
           (a0-12 (the-as object (-> v1-9 base)))
           )
      (set! (-> (the-as dma-packet a0-12) dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
      (set! (-> (the-as dma-packet a0-12) vif0) (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd mscalf) :msk #x1))
      (set! (-> (the-as dma-packet a0-12) vif1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
      (set! (-> v1-9 base) (&+ (the-as pointer a0-12) 16))
      )
    (let* ((v1-10 arg0)
           (a0-14 (the-as object (-> v1-10 base)))
           )
      (set! (-> (the-as dma-packet a0-14) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
      (set! (-> (the-as dma-packet a0-14) vif0) (new 'static 'vif-tag))
      (set! (-> (the-as dma-packet a0-14) vif1) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
      (set! (-> v1-10 base) (&+ (the-as pointer a0-14) 16))
      )
    (let ((v1-11 (the-as object (-> arg0 base))))
      (set! (-> (the-as (inline-array vector4w) v1-11) 0 x) #x4b000000)
      (set! (-> (the-as (inline-array vector4w) v1-11) 0 y) #x4b000000)
      (set! (-> (the-as (inline-array vector4w) v1-11) 0 z) #x4b000000)
      (set! (-> (the-as (inline-array vector4w) v1-11) 0 w) #x4b000000)
      (set! (-> (the-as (pointer vif-tag) v1-11) 4) (new 'static 'vif-tag :cmd (vif-cmd base)))
      (set! (-> (the-as (pointer vif-tag) v1-11) 5) (new 'static 'vif-tag :imm #x2c :cmd (vif-cmd offset)))
      (set! (-> (the-as (pointer vif-tag) v1-11) 6) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
      (set! (-> (the-as (pointer vif-tag) v1-11) 7) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
      (set! (-> arg0 base) (&+ (the-as pointer v1-11) 32))
      )
    0
    )
  0
  (none)
  )

;; definition for function tie-end-buffer
;; INFO: Return type mismatch int vs none.
(defun tie-end-buffer ((arg0 dma-buffer))
  (when (logtest? *vu1-enable-user* (vu1-renderer-mask tie))
    (let* ((v1-3 arg0)
           (a1-0 (the-as object (-> v1-3 base)))
           )
      (set! (-> (the-as dma-packet a1-0) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
      (set! (-> (the-as dma-packet a1-0) vif0) (new 'static 'vif-tag))
      (set! (-> (the-as dma-packet a1-0) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1))
      (set! (-> v1-3 base) (&+ (the-as pointer a1-0) 16))
      )
    (let* ((v1-4 arg0)
           (a1-2 (the-as object (-> v1-4 base)))
           )
      (set! (-> (the-as gs-gif-tag a1-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1))
      (set! (-> (the-as gs-gif-tag a1-2) regs)
            (new 'static 'gif-tag-regs
              :regs0 (gif-reg-id a+d)
              :regs1 (gif-reg-id a+d)
              :regs2 (gif-reg-id a+d)
              :regs3 (gif-reg-id a+d)
              :regs4 (gif-reg-id a+d)
              :regs5 (gif-reg-id a+d)
              :regs6 (gif-reg-id a+d)
              :regs7 (gif-reg-id a+d)
              :regs8 (gif-reg-id a+d)
              :regs9 (gif-reg-id a+d)
              :regs10 (gif-reg-id a+d)
              :regs11 (gif-reg-id a+d)
              :regs12 (gif-reg-id a+d)
              :regs13 (gif-reg-id a+d)
              :regs14 (gif-reg-id a+d)
              :regs15 (gif-reg-id a+d)
              )
            )
      (set! (-> v1-4 base) (&+ (the-as pointer a1-2) 16))
      )
    (let* ((v1-5 arg0)
           (a1-4 (-> v1-5 base))
           )
      (set! (-> (the-as (pointer gs-test) a1-4) 0)
            (new 'static 'gs-test :atst (gs-atest not-equal) :zte #x1 :ztst (gs-ztest greater-equal))
            )
      (set! (-> (the-as (pointer gs-reg64) a1-4) 1) (gs-reg64 test-1))
      (set! (-> v1-5 base) (&+ a1-4 16))
      )
    (let* ((v1-6 arg0)
           (a1-6 (the-as object (-> v1-6 base)))
           )
      (set! (-> (the-as dma-packet a1-6) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
      (set! (-> (the-as dma-packet a1-6) vif0) (new 'static 'vif-tag :cmd (vif-cmd stmask)))
      (set! (-> (the-as dma-packet a1-6) vif1) (new 'static 'vif-tag))
      (set! (-> v1-6 base) (&+ (the-as pointer a1-6) 16))
      )
    (let* ((v1-7 arg0)
           (a0-1 (-> v1-7 base))
           )
      (set! (-> (the-as (pointer vif-tag) a0-1) 0) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd mscalf) :msk #x1))
      (set! (-> (the-as (pointer vif-tag) a0-1) 1) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
      (set! (-> (the-as (pointer vif-tag) a0-1) 2) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
      (set! (-> (the-as (pointer vif-tag) a0-1) 3) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
      (set! (-> (the-as (pointer vif-tag) a0-1) 4) (new 'static 'vif-tag))
      (set! (-> (the-as (pointer vif-tag) a0-1) 5) (new 'static 'vif-tag))
      (set! (-> (the-as (pointer vif-tag) a0-1) 6) (new 'static 'vif-tag))
      (set! (-> (the-as (pointer vif-tag) a0-1) 7) (new 'static 'vif-tag))
      (set! (-> v1-7 base) (&+ a0-1 32))
      )
    0
    )
  0
  (none)
  )

;; definition (debug) for function tie-int-reg
(defun-debug tie-int-reg ((arg0 int))
  (let ((v1-0 arg0))
    (cond
      ((zero? v1-0)
       "zero"
       )
      ((= v1-0 1)
       "itemp"
       )
      ((= v1-0 2)
       "point-ptr"
       )
      ((= v1-0 3)
       "clr-ptr"
       )
      ((= v1-0 4)
       "target-bp1-ptr"
       )
      ((= v1-0 5)
       "skip-bp2"
       )
      ((= v1-0 6)
       "target-bp2-ptr"
       )
      ((= v1-0 7)
       "target-ip1-ptr"
       )
      ((= v1-0 8)
       "target-ip2-ptr"
       )
      ((= v1-0 9)
       "ind/ind0"
       )
      ((= v1-0 10)
       "    ind1"
       )
      ((= v1-0 11)
       "    ind2"
       )
      ((= v1-0 12)
       "dest-ptr"
       )
      ((= v1-0 13)
       "dest2-ptr"
       )
      ((= v1-0 14)
       "skip-ips"
       )
      ((= v1-0 15)
       "kick-addr"
       )
      )
    )
  )

;; definition (debug) for function tie-float-reg
(defun-debug tie-float-reg ((arg0 int))
  (let ((v1-0 arg0))
    (cond
      ((zero? v1-0)
       "zero"
       )
      ((= v1-0 1)
       "t-mtx0"
       )
      ((= v1-0 2)
       "t-mtx1"
       )
      ((= v1-0 3)
       "t-mtx2"
       )
      ((= v1-0 4)
       "t-mtx3"
       )
      ((= v1-0 5)
       "vtx-0"
       )
      ((= v1-0 6)
       "vtx-1"
       )
      ((= v1-0 7)
       "vtx-2"
       )
      ((= v1-0 8)
       "vtx-3"
       )
      ((= v1-0 9)
       "pos-0/2"
       )
      ((= v1-0 10)
       "pos-1/3"
       )
      ((= v1-0 11)
       "clr-0"
       )
      ((= v1-0 12)
       "clr-1"
       )
      ((= v1-0 13)
       "clr-2"
       )
      ((= v1-0 14)
       "clr-3"
       )
      ((= v1-0 15)
       "tex-0"
       )
      ((= v1-0 16)
       "tex-1"
       )
      ((= v1-0 17)
       "tex-2"
       )
      ((= v1-0 18)
       "tex-3"
       )
      ((= v1-0 19)
       "res-0/2"
       )
      ((= v1-0 20)
       "res-1/3"
       )
      ((= v1-0 21)
       "gifbuf"
       )
      ((= v1-0 22)
       "clrbuf"
       )
      ((= v1-0 23)
       "extra"
       )
      ((= v1-0 24)
       "inds"
       )
      ((= v1-0 25)
       "--"
       )
      ((= v1-0 26)
       "--"
       )
      ((= v1-0 27)
       "morph"
       )
      ((= v1-0 28)
       "xyzofs"
       )
      ((= v1-0 29)
       "clr1"
       )
      ((= v1-0 30)
       "clr2"
       )
      ((= v1-0 31)
       "--"
       )
      )
    )
  )

;; definition (debug) for function tie-ints
;; INFO: Used lq/sq
;; INFO: Return type mismatch symbol vs none.
(defun-debug tie-ints ()
  (local-vars (sv-16 uint))
  (let ((gp-0 (the-as (pointer uint32) (+ #x3fa0 #x1100c000))))
    (dotimes (s5-0 16)
      (if (< s5-0 10)
          (format 0 " ")
          )
      (let ((s4-0 format)
            (s3-0 0)
            (s2-0 "vi~d: ~6d #x~4,'0X ~s~%")
            (s1-0 s5-0)
            (s0-0 (-> gp-0 (* s5-0 4)))
            )
        (set! sv-16 (-> gp-0 (* s5-0 4)))
        (let ((t1-0 (tie-int-reg s5-0)))
          (s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0)
          )
        )
      )
    )
  (none)
  )

;; definition (debug) for function tie-floats
;; INFO: Used lq/sq
;; INFO: Return type mismatch symbol vs none.
(defun-debug tie-floats ()
  (local-vars (sv-16 uint) (sv-32 uint))
  (let ((gp-0 (the-as (pointer uint32) (+ #x3da0 #x1100c000))))
    (dotimes (s5-0 32)
      (if (< s5-0 10)
          (format 0 " ")
          )
      (format
        0
        "vf~d: #x~8,'0X #x~8,'0X #x~8,'0X #x~8,'0X "
        s5-0
        (-> gp-0 (* s5-0 4))
        (-> gp-0 (+ (* s5-0 4) 1))
        (-> gp-0 (+ (* s5-0 4) 2))
        (-> gp-0 (+ (* s5-0 4) 3))
        )
      (let ((s4-0 format)
            (s3-0 0)
            (s2-0 "~F ~F ~F ~F ~s~%")
            (s1-0 (-> gp-0 (* s5-0 4)))
            (s0-0 (-> gp-0 (+ (* s5-0 4) 1)))
            )
        (set! sv-16 (-> gp-0 (+ (* s5-0 4) 2)))
        (set! sv-32 (-> gp-0 (+ (* s5-0 4) 3)))
        (let ((t2-1 (tie-float-reg s5-0)))
          (s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 sv-32 t2-1)
          )
        )
      )
    )
  (none)
  )
