!version 1

[unit
  (func extern (void) abort (nil) (nil))
  (func extern (void) printf [parm (ellipsis)] (nil))
  
  (structdef jmp_buf
    [field
      (var (ptr (void)) w1)
      (var (ptr (void)) w2)
      (var (ptr (void)) w3)
      (var (ptr (void)) w4)
      (var (ptr (void)) w5)])
    
  (func public (void) jumpaway [parm (var (ptr (struct jmp_buf)) jmpbuf)]
    (bind [compound
      (builtin longjmp [parm (ref jmpbuf) (const .c_int 1)])
      (call abort (nil))]))
      
  (func public (void) main (nil)
    (bind [compound
      (var (struct jmp_buf) buf)
      (cond 
        (eq (builtin setjmp [parm (addr (ref buf))]) (const .c_int 0))
	(nop)
	(return (nop)))
      (nop)
      (call jumpaway [parm (addr (ref buf))])
      (call abort (nil))]))
]
