(define impc:ir:compile:pop_zone
(lambda (ast types)
(let* ((os (make-string 0)))
(emit (impc:ir:gname "oldzone" "%mzone*") " = call %mzone* @llvm_pop_zone_stack()\n" os)
(emit (impc:ir:gname "newzone" "%mzone") " = call %mzone* @llvm_peek_zone_stack()\n" os)
(emit (impc:ir:gname "zone_ptr" "i8*") " = bitcast %mzone* " (car (impc:ir:gname "newzone")) " to i8*\n" os)
(emit "store i8* " (car (impc:ir:gname "zone_ptr")) ", i8** %_impzPtr\n" os)
(let ((zone (impc:ir:gname "oldzone")))
(impc:ir:gname "ret" (car zone) (cadr zone)))
(impc:ir:strip-space os))))