(define impc:ti:scm_rt_check_string
(lambda (n closure-name)
(let* ((os (make-string 0))
(n1 (substring n 1 (string-length n)))
(name-str (impc:ir:make-const-string (string-append closure-name " Scheme wrapper error: check the arg arity and types\n")))
(name (impc:ir:gname)))
(emit n "_bool = icmp ne i32 " n "_rt_check, 0\n" os)
(emit "br i1 " n "_bool, label " n "_true, label " n "_false\n" os)
(emit "\n" n1 "_true:\n" os)
(emit "br label " n "_continue\n" os)
(emit "\n" n1 "_false:\n" os)
(emit name-str os)
(emit "call i32 (i8*, ...) @printf(i8* " (car name) ")\n" os)
(emit n "_errret = call ccc i8* @mk_i64(i8* %_sc, i64 0)\n" os)
(emit "ret i8* " n "_errret\n" os)
(emit "\n" n1 "_continue:\n" os)
;;(emit n " = call ccc double @r64value(i8* " n "_val)\n" os)
(impc:ir:strip-space os))))