         [ param-reg-3 swap heap-size MOV ] bi
         param-reg-1 0 box-struct-field@ MOV
         param-reg-2 1 box-struct-field@ MOV
-        "box_small_struct" %vm-invoke-4th-arg
+        param-reg-4 %mov-vm-ptr
+        "box_small_struct" f %alien-invoke
     ] with-return-regs ;
 
 : struct-return@ ( n -- operand )


M: x86.64 %alien-callback ( quot -- )
    param-reg-1 swap %load-reference
    "c_to_factor" %vm-invoke-2nd-arg ;

M: x86.64 %callback-value ( ctype -- )
    ! Save top of data stack

: param-reg-1 ( -- reg ) int-regs param-regs first ; inline
: param-reg-2 ( -- reg ) int-regs param-regs second ; inline
: param-reg-3 ( -- reg ) int-regs param-regs third ; inline
: param-reg-4 ( -- reg ) int-regs param-regs fourth ; inline

M: x86.64 pic-tail-reg RBX ;

