IT LIVES!!!

Stubs, compiles, and executes the first two function calls in Advent.
Then it asserts with "UNIMPLEMENTED: copy". That's the next milestone!

Here's the current output:

$ ./gift.lua
* Indirect call: 0000003c
* Stubbing: 0000003c
* Compiling: 0000003c
* Stubbing: 00000048
	sandbox = ...
	function sandbox.glulx_0000003c(vm)
	  vm:push(12)
	  vm:push(12)
	  vm:push(0x4000000)
	  ::label_00000040::
	  print("* 00000040 call const 48 const 0 -> const 0")
	  do
	    local L1 = 72
	    local L2 = 0
	    local S1
	    local args = {}
	    for i = 1,L2 do
	      args[#args] = vm:pop()
	    end
	    S1 = sandbox.glulx_00000048(vm, unpack(args))
	  end
	  ::label_00000047::
	  print("* 00000047 return const 0")
	  do
	    local L1 = 0
	    return L1
	  end
	end

* 00000040 call const 48 const 0 -> const 0
* Compiling: 00000048
* Stubbing: 000104b0
	sandbox = ...
	function sandbox.glulx_00000048(vm)
	  vm:push(12)
	  vm:push(12)
	  vm:push(0x4000000)
	  ::label_0000004c::
	  print("* 0000004c copy const 109 -> stack 0")
	  do
	    local L1 = 265
	    local S1
	    assert(false, "UNIMPLEMENTED: copy")
	    vm:push(S1)
	  end
	  ::label_00000052::
	  print("* 00000052 copy const 1dcf5 -> stack 0")
	  do
	    local L1 = 122101
	    local S1
	    assert(false, "UNIMPLEMENTED: copy")
	    vm:push(S1)
	  end
	  ::label_00000058::
	  print("* 00000058 call const 104b0 const 2 -> const 0")
	  do
	    local L1 = 66736
	    local L2 = 2
	    local S1
	    local args = {}
	    for i = 1,L2 do
	      args[#args] = vm:pop()
	    end
	    S1 = sandbox.glulx_000104b0(vm, unpack(args))
	  end
	  ::label_00000060::
	  print("* 00000060 return const 1")
	  do
	    local L1 = 1
	    return L1
	  end
	end

* 0000004c copy const 109 -> stack 0
luajit: [string "..."]:11: UNIMPLEMENTED: copy
stack traceback:
	[C]: in function 'assert'
	[string "..."]:11: in function 'glulx_00000048'
	[string "..."]:16: in function 'call'
	./gift.lua:22: in main chunk
	[C]: at 0x0100001310

And look at that, it even did a tail call -- 'glulx_0000003c' isn't
on the call stack any more. Unfortunately we need to push a Glulx call
stub which will probably break that, but that can be elided for well-
behaved functions.