/* DO NOT MODIFY - automatically generated by generate_builtins.pl */
/*
 * Copyright © 2010 Intel Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

#include <stdio.h>
#include "glsl_parser_extras.h"
#include "ir_reader.h"

void
read_builtins(_mesa_glsl_parse_state *st, exec_list *instructions,
	      const char **functions, unsigned count)
{
   if (st->error)
      return;

   for (unsigned i = 0; i < count; i++) {
      _mesa_glsl_read_ir(st, instructions, functions[i]);

      if (st->error) {
	 printf("error reading builtin: %.35s ...\n", functions[i]);
         return;
      }
   }
}

/* 110 builtins */

static const char *builtins_110_abs = {
   "((function abs\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float abs (var_ref arg0)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 abs (var_ref arg0)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 abs (var_ref arg0)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 abs (var_ref arg0)))))\n"
   "))\n"
};

static const char *builtins_110_all = {
   "((function all\n"
   "   (signature bool\n"
   "     (parameters\n"
   "       (declare (in) bvec2 arg0))\n"
   "     ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))))))\n"
   "\n"
   "   (signature bool\n"
   "     (parameters\n"
   "       (declare (in) bvec3 arg0))\n"
   "     ((return (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))))))\n"
   "\n"
   "   (signature bool\n"
   "     (parameters\n"
   "       (declare (in) bvec4 arg0))\n"
   "     ((return (expression bool && (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0))))))\n"
   "))\n"
};

static const char *builtins_110_any = {
   "((function any\n"
   "   (signature bool\n"
   "     (parameters\n"
   "       (declare (in) bvec2 arg0))\n"
   "     ((return (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))))))\n"
   "\n"
   "   (signature bool\n"
   "     (parameters\n"
   "       (declare (in) bvec3 arg0))\n"
   "     ((return (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))))))\n"
   "\n"
   "   (signature bool\n"
   "     (parameters\n"
   "       (declare (in) bvec4 arg0))\n"
   "     ((return (expression bool || (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0))))))\n"
   "))\n"
};

static const char *builtins_110_asin = {
   "((function asin\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (expression float *\n"
   "     	       (expression float -\n"
   "	        (expression float *\n"
   "		 (constant float (3.1415926))\n"
   "		 (constant float (0.5)))\n"
   "		(expression float sqrt\n"
   "		 (expression float -\n"
   "		  (constant float (1.0))\n"
   "		  (expression float abs (var_ref x)))))\n"
   "     	       (expression float +\n"
   "     	        (constant float (1.5707288))\n"
   "	        (expression float *\n"
   "     	         (expression float abs (var_ref x))\n"
   "     	         (expression float +\n"
   "	          (constant float (-0.2121144))\n"
   "     	          (expression float *\n"
   "     	           (constant float (0.0742610))\n"
   "	           (expression float abs (var_ref x))))))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 x))\n"
   "     ((return (expression vec2 *\n"
   "     	       (expression float -\n"
   "	        (expression float *\n"
   "		 (constant float (3.1415926))\n"
   "		 (constant float (0.5)))\n"
   "		(expression vec2 sqrt\n"
   "		 (expression vec2 -\n"
   "		  (constant float (1.0))\n"
   "		  (expression vec2 abs (var_ref x)))))\n"
   "     	       (expression vec2 +\n"
   "     	        (constant float (1.5707288))\n"
   "	        (expression vec2 *\n"
   "     	         (expression vec2 abs (var_ref x))\n"
   "     	         (expression vec2 +\n"
   "	          (constant float (-0.2121144))\n"
   "     	          (expression vec2 *\n"
   "     	           (constant float (0.0742610))\n"
   "	           (expression vec2 abs (var_ref x))))))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 x))\n"
   "     ((return (expression vec3 *\n"
   "     	       (expression vec3 -\n"
   "	        (expression float *\n"
   "		 (constant float (3.1415926))\n"
   "		 (constant float (0.5)))\n"
   "		(expression vec3 sqrt\n"
   "		 (expression vec3 -\n"
   "		  (constant float (1.0))\n"
   "		  (expression vec3 abs (var_ref x)))))\n"
   "     	       (expression vec3 +\n"
   "     	        (constant float (1.5707288))\n"
   "	        (expression vec3 *\n"
   "     	         (expression vec3 abs (var_ref x))\n"
   "     	         (expression vec3 +\n"
   "	          (constant float (-0.2121144))\n"
   "     	          (expression vec3 *\n"
   "     	           (constant float (0.0742610))\n"
   "	           (expression vec3 abs (var_ref x))))))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 x))\n"
   "     ((return (expression vec4 *\n"
   "     	       (expression vec4 -\n"
   "	        (expression float *\n"
   "		 (constant float (3.1415926))\n"
   "		 (constant float (0.5)))\n"
   "		(expression vec4 sqrt\n"
   "		 (expression vec4 -\n"
   "		  (constant float (1.0))\n"
   "		  (expression vec4 abs (var_ref x)))))\n"
   "     	       (expression vec4 +\n"
   "     	        (constant float (1.5707288))\n"
   "	        (expression vec4 *\n"
   "     	         (expression vec4 abs (var_ref x))\n"
   "     	         (expression vec4 +\n"
   "	          (constant float (-0.2121144))\n"
   "     	          (expression vec4 *\n"
   "     	           (constant float (0.0742610))\n"
   "	           (expression vec4 abs (var_ref x))))))))))\n"
   ")\n"
   "\n"
   " (function acos\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (expression float - (constant float (1.5707963))\n"
   "                                  (call asin ((var_ref x)))))))\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 x))\n"
   "     ((return (expression vec2 - (constant float (1.5707963))\n"
   "                                 (call asin ((var_ref x)))))))\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 x))\n"
   "     ((return (expression vec3 - (constant float (1.5707963))\n"
   "                                 (call asin ((var_ref x)))))))\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 x))\n"
   "     ((return (expression vec4 - (constant float (1.5707963))\n"
   "                                 (call asin ((var_ref x)))))))\n"
   "))\n"
};

static const char *builtins_110_atan = {
   "((function atan\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (call asin ((expression float *\n"
   "			   (var_ref x)\n"
   "			   (expression float rsq\n"
   "			    (expression float +\n"
   "			     (expression float *\n"
   "			      (var_ref x)\n"
   "			      (var_ref x))\n"
   "			     (constant float (1.0))))))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 y_over_x))\n"
   "     ((return (call asin ((expression vec2 *\n"
   "			   (var_ref y_over_x)\n"
   "			   (expression vec2 rsq\n"
   "			    (expression vec2 +\n"
   "			     (expression vec2 *\n"
   "			      (var_ref y_over_x)\n"
   "			      (var_ref y_over_x))\n"
   "			     (constant float (1.0))))))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 y_over_x))\n"
   "     ((return (call asin ((expression vec3 *\n"
   "			   (var_ref y_over_x)\n"
   "			   (expression vec3 rsq\n"
   "			    (expression vec3 +\n"
   "			     (expression vec3 *\n"
   "			      (var_ref y_over_x)\n"
   "			      (var_ref y_over_x))\n"
   "			     (constant float (1.0))))))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 y_over_x))\n"
   "     ((return (call asin ((expression vec4 *\n"
   "			   (var_ref y_over_x)\n"
   "			   (expression vec4 rsq\n"
   "			    (expression vec4 +\n"
   "			     (expression vec4 *\n"
   "			      (var_ref y_over_x)\n"
   "			      (var_ref y_over_x))\n"
   "			     (constant float (1.0))))))))))\n"
   "\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float y)\n"
   "       (declare (in) float x))\n"
   "     ((declare () float r)\n"
   "      (if (expression bool >\n"
   "	   (expression float abs (var_ref x))\n"
   "	   (constant float (.0001)))\n"
   "       ((assign (constant bool (1))\n"
   "	 (var_ref r) (call atan ((expression float /\n"
   "				  (var_ref y)\n"
   "				  (var_ref x)))))\n"
   "	(if (expression bool <\n"
   "	     (var_ref x)\n"
   "	     (constant float (0.0)))\n"
   "	 ((assign (constant bool (1))\n"
   "	   (var_ref r)\n"
   "	   (expression float +\n"
   "	    (var_ref r)\n"
   "	    (expression float *\n"
   "	     (expression int sign (var_ref y))\n"
   "	     (constant float (3.1415926))))))\n"
   "	 ()))\n"
   "       ())\n"
   "      (return (var_ref r))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 y)\n"
   "       (declare (in) vec2 x))\n"
   "     ((declare () vec2 r)\n"
   "      (if (expression bool >\n"
   "	   (expression vec2 abs (var_ref x))\n"
   "	   (constant float (.0001)))\n"
   "       ((assign (constant bool (1))\n"
   "	 (var_ref r) (call atan ((expression vec2 /\n"
   "				  (var_ref y)\n"
   "				  (var_ref x)))))\n"
   "	(if (expression bool <\n"
   "	     (var_ref x)\n"
   "	     (constant float (0.0)))\n"
   "	 ((assign (constant bool (1))\n"
   "	   (var_ref r)\n"
   "	   (expression vec2 +\n"
   "	    (var_ref r)\n"
   "	    (expression vec2 *\n"
   "	     (expression int sign (var_ref y))\n"
   "	     (constant float (3.1415926))))))\n"
   "	 ()))\n"
   "       ())\n"
   "      (return (var_ref r))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 y)\n"
   "       (declare (in) vec3 x))\n"
   "     ((declare () vec3 r)\n"
   "      (if (expression bool >\n"
   "	   (expression vec3 abs (var_ref x))\n"
   "	   (constant float (.0001)))\n"
   "       ((assign (constant bool (1))\n"
   "	 (var_ref r) (call atan ((expression vec3 /\n"
   "				  (var_ref y)\n"
   "				  (var_ref x)))))\n"
   "	(if (expression bool <\n"
   "	     (var_ref x)\n"
   "	     (constant float (0.0)))\n"
   "	 ((assign (constant bool (1))\n"
   "	   (var_ref r)\n"
   "	   (expression vec3 +\n"
   "	    (var_ref r)\n"
   "	    (expression vec3 *\n"
   "	     (expression int sign (var_ref y))\n"
   "	     (constant float (3.1415926))))))\n"
   "	 ()))\n"
   "       ())\n"
   "      (return (var_ref r))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 y)\n"
   "       (declare (in) vec4 x))\n"
   "     ((declare () vec4 r)\n"
   "      (if (expression bool >\n"
   "	   (expression vec4 abs (var_ref x))\n"
   "	   (constant float (.0001)))\n"
   "       ((assign (constant bool (1))\n"
   "	 (var_ref r) (call atan ((expression vec4 /\n"
   "				  (var_ref y)\n"
   "				  (var_ref x)))))\n"
   "	(if (expression bool <\n"
   "	     (var_ref x)\n"
   "	     (constant float (0.0)))\n"
   "	 ((assign (constant bool (1))\n"
   "	   (var_ref r)\n"
   "	   (expression vec4 +\n"
   "	    (var_ref r)\n"
   "	    (expression vec4 *\n"
   "	     (expression int sign (var_ref y))\n"
   "	     (constant float (3.1415926))))))\n"
   "	 ()))\n"
   "       ())\n"
   "      (return (var_ref r))))\n"
   "\n"
   "))\n"
};

static const char *builtins_110_ceil = {
   "((function ceil\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float ceil (var_ref arg0)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 ceil (var_ref arg0)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 ceil (var_ref arg0)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 ceil (var_ref arg0)))))\n"
   "))\n"
};

static const char *builtins_110_clamp = {
   "((function clamp\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0)\n"
   "       (declare (in) float arg1)\n"
   "       (declare (in) float arg2))\n"
   "     ((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1)\n"
   "       (declare (in) vec2 arg2))\n"
   "     ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1)\n"
   "       (declare (in) vec3 arg2))\n"
   "     ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1)\n"
   "       (declare (in) vec4 arg2))\n"
   "     ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2  arg0)\n"
   "       (declare (in) float arg1)\n"
   "       (declare (in) float arg2))\n"
   "     ((declare () vec2 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result)) (expression vec4 max (expression vec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result)) (expression vec4 max (expression vec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3  arg0)\n"
   "       (declare (in) float arg1)\n"
   "       (declare (in) float arg2))\n"
   "     ((declare () vec3 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result)) (expression vec4 max (expression vec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result)) (expression vec4 max (expression vec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result)) (expression vec4 max (expression vec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4  arg0)\n"
   "       (declare (in) float arg1)\n"
   "       (declare (in) float arg2))\n"
   "     ((declare () vec4 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result)) (expression vec4 max (expression vec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result)) (expression vec4 max (expression vec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result)) (expression vec4 max (expression vec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref result)) (expression vec4 max (expression vec4 min (swiz w (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "))\n"
};

static const char *builtins_110_cos = {
   "((function cos\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float angle))\n"
   "     ((return (expression float cos (var_ref angle)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 angle))\n"
   "     ((return (expression vec2 cos (var_ref angle)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 angle))\n"
   "     ((return (expression vec3 cos (var_ref angle)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 angle))\n"
   "     ((return (expression vec4 cos (var_ref angle)))))\n"
   "))\n"
};

static const char *builtins_110_cross = {
   "((function cross\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((declare () vec3 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t))\n"
   "              (expression float - (expression float * (swiz y (var_ref arg0)) (swiz z (var_ref arg1)))\n"
   "	                          (expression float * (swiz y (var_ref arg1)) (swiz z (var_ref arg0)))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t))\n"
   "              (expression float - (expression float * (swiz z (var_ref arg0)) (swiz x (var_ref arg1)))\n"
   "	                          (expression float * (swiz z (var_ref arg1)) (swiz x (var_ref arg0)))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t))\n"
   "              (expression float - (expression float * (swiz x (var_ref arg0)) (swiz y (var_ref arg1)))\n"
   "	                          (expression float * (swiz x (var_ref arg1)) (swiz y (var_ref arg0)))))\n"
   "      (return (var_ref t))))\n"
   "))\n"
};

static const char *builtins_110_degrees = {
   "((function degrees\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float * (var_ref arg0) (constant float (57.295780))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 * (var_ref arg0) (constant float (57.295780))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 * (var_ref arg0) (constant float (57.295780))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 * (var_ref arg0) (constant float (57.295780))))))\n"
   "))\n"
};

static const char *builtins_110_distance = {
   "((function distance\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float p0)\n"
   "       (declare (in) float p1))\n"
   "     ((declare () float p)\n"
   "      (assign (constant bool (1)) (var_ref p) (expression float - (var_ref p0) (var_ref p1)))\n"
   "      (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n"
   "\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec2 p0)\n"
   "       (declare (in) vec2 p1))\n"
   "     ((declare () vec2 p)\n"
   "      (assign (constant bool (1)) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1)))\n"
   "      (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n"
   "\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec3 p0)\n"
   "       (declare (in) vec3 p1))\n"
   "     ((declare () vec3 p)\n"
   "      (assign (constant bool (1)) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1)))\n"
   "      (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n"
   "\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec4 p0)\n"
   "       (declare (in) vec4 p1))\n"
   "     ((declare () vec4 p)\n"
   "      (assign (constant bool (1)) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1)))\n"
   "      (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n"
   "))\n"
};

static const char *builtins_110_dot = {
   "((function dot\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1))\n"
   "     ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1))\n"
   "     ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n"
   "))\n"
};

static const char *builtins_110_equal = {
   "((function equal\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2 arg0)\n"
   "       (declare (in) ivec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3 arg0)\n"
   "       (declare (in) ivec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4 arg0)\n"
   "       (declare (in) ivec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_110_exp = {
   "((function exp\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float exp (var_ref arg0)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 exp (var_ref arg0)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 exp (var_ref arg0)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 exp (var_ref arg0)))))\n"
   "))\n"
};

static const char *builtins_110_exp2 = {
   "((function exp2\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float exp2 (var_ref arg0)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 exp2 (var_ref arg0)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 exp2 (var_ref arg0)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 exp2 (var_ref arg0)))))\n"
   "))\n"
};

static const char *builtins_110_faceforward = {
   "((function faceforward\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float N)\n"
   "       (declare (in) float I)\n"
   "       (declare (in) float Nref))\n"
   "     ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n"
   "          ((return (var_ref N)))\n"
   "	  ((return (expression float neg (var_ref N)))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 N)\n"
   "       (declare (in) vec2 I)\n"
   "       (declare (in) vec2 Nref))\n"
   "     ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n"
   "          ((return (var_ref N)))\n"
   "	  ((return (expression vec2 neg (var_ref N)))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 N)\n"
   "       (declare (in) vec3 I)\n"
   "       (declare (in) vec3 Nref))\n"
   "     ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n"
   "          ((return (var_ref N)))\n"
   "	  ((return (expression vec3 neg (var_ref N)))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 N)\n"
   "       (declare (in) vec4 I)\n"
   "       (declare (in) vec4 Nref))\n"
   "     ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n"
   "          ((return (var_ref N)))\n"
   "	  ((return (expression vec4 neg (var_ref N)))))))\n"
   "))\n"
};

static const char *builtins_110_floor = {
   "((function floor\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float floor (var_ref arg0)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 floor (var_ref arg0)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 floor (var_ref arg0)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 floor (var_ref arg0)))))\n"
   "))\n"
};

static const char *builtins_110_fract = {
   "((function fract\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (expression float - (var_ref x) (expression float floor (var_ref x))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 x))\n"
   "     ((declare () vec2 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x)))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x)))))\n"
   "      (return (var_ref t))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 x))\n"
   "     ((declare () vec3 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x)))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x)))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t)) (expression float - (swiz z (var_ref x)) (expression float floor (swiz z (var_ref x)))))\n"
   "      (return (var_ref t))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 x))\n"
   "     ((declare () vec4 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x)))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x)))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t)) (expression float - (swiz z (var_ref x)) (expression float floor (swiz z (var_ref x)))))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref t)) (expression float - (swiz w (var_ref x)) (expression float floor (swiz w (var_ref x)))))\n"
   "      (return (var_ref t))))\n"
   "))\n"
   "\n"
};

static const char *builtins_110_greaterThan = {
   "((function greaterThan\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2 arg0)\n"
   "       (declare (in) ivec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3 arg0)\n"
   "       (declare (in) ivec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4 arg0)\n"
   "       (declare (in) ivec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_110_greaterThanEqual = {
   "((function greaterThanEqual\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2 arg0)\n"
   "       (declare (in) ivec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3 arg0)\n"
   "       (declare (in) ivec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4 arg0)\n"
   "       (declare (in) ivec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_110_inversesqrt = {
   "((function inversesqrt\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float rsq (var_ref arg0)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 rsq (var_ref arg0)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 rsq (var_ref arg0)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 rsq (var_ref arg0)))))\n"
   "))\n"
};

static const char *builtins_110_length = {
   "((function length\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n"
   "\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n"
   "\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n"
   "\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n"
   "))\n"
};

static const char *builtins_110_lessThan = {
   "((function lessThan\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2 arg0)\n"
   "       (declare (in) ivec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3 arg0)\n"
   "       (declare (in) ivec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4 arg0)\n"
   "       (declare (in) ivec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_110_lessThanEqual = {
   "((function lessThanEqual\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2 arg0)\n"
   "       (declare (in) ivec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3 arg0)\n"
   "       (declare (in) ivec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4 arg0)\n"
   "       (declare (in) ivec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_110_log = {
   "((function log\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float log (var_ref arg0)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 log (var_ref arg0)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 log (var_ref arg0)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 log (var_ref arg0)))))\n"
   "))\n"
};

static const char *builtins_110_log2 = {
   "((function log2\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float log2 (var_ref arg0)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 log2 (var_ref arg0)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 log2 (var_ref arg0)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 log2 (var_ref arg0)))))\n"
   "))\n"
};

static const char *builtins_110_matrixCompMult = {
   "((function matrixCompMult\n"
   "   (signature mat2\n"
   "     (parameters\n"
   "       (declare (in) mat2 x)\n"
   "       (declare (in) mat2 y))\n"
   "     ((declare () mat2 z)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0)))  (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1)))  (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
   "(return (var_ref z))))\n"
   "\n"
   "   (signature mat3\n"
   "     (parameters\n"
   "       (declare (in) mat3 x)\n"
   "       (declare (in) mat3 y))\n"
   "     ((declare () mat3 z)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0)))  (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1)))  (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2)))  (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
   "(return (var_ref z))))\n"
   "\n"
   "   (signature mat4\n"
   "     (parameters\n"
   "       (declare (in) mat4 x)\n"
   "       (declare (in) mat4 y))\n"
   "     ((declare () mat4 z)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0)))  (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1)))  (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2)))  (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3)))  (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n"
   "(return (var_ref z))))\n"
   "))\n"
   "\n"
};

static const char *builtins_110_max = {
   "((function max\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((return (expression float max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1))\n"
   "     ((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1))\n"
   "     ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2  arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((declare () vec2 result)\n"
   "      (assign (constant bool (1))   (swiz x (var_ref result))\n"
   "              (expression float max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz y (var_ref result))\n"
   "              (expression float max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3  arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((declare () vec3 result)\n"
   "      (assign (constant bool (1))   (swiz x (var_ref result))\n"
   "              (expression float max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz y (var_ref result))\n"
   "              (expression float max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz z (var_ref result))\n"
   "              (expression float max (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4  arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((declare () vec4 result)\n"
   "      (assign (constant bool (1))   (swiz x (var_ref result))\n"
   "              (expression float max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz y (var_ref result))\n"
   "              (expression float max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz z (var_ref result))\n"
   "              (expression float max (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz w (var_ref result))\n"
   "              (expression float max (swiz w (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "))\n"
};

static const char *builtins_110_min = {
   "((function min\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((return (expression float min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1))\n"
   "     ((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1))\n"
   "     ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2  arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((declare () vec2 result)\n"
   "      (assign (constant bool (1))   (swiz x (var_ref result))\n"
   "              (expression float min (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz y (var_ref result))\n"
   "              (expression float min (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3  arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((declare () vec3 result)\n"
   "      (assign (constant bool (1))   (swiz x (var_ref result))\n"
   "              (expression float min (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz y (var_ref result))\n"
   "              (expression float min (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz z (var_ref result))\n"
   "              (expression float min (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4  arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((declare () vec4 result)\n"
   "      (assign (constant bool (1))   (swiz x (var_ref result))\n"
   "              (expression float min (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz y (var_ref result))\n"
   "              (expression float min (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz z (var_ref result))\n"
   "              (expression float min (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1))   (swiz w (var_ref result))\n"
   "              (expression float min (swiz w (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "))\n"
};

static const char *builtins_110_mix = {
   "((function mix\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0)\n"
   "       (declare (in) float arg1)\n"
   "       (declare (in) float arg2))\n"
   "     ((return (expression float + (expression float * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression float * (var_ref arg1) (var_ref arg2))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1)\n"
   "       (declare (in) vec2 arg2))\n"
   "     ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1)\n"
   "       (declare (in) vec3 arg2))\n"
   "     ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1)\n"
   "       (declare (in) vec4 arg2))\n"
   "     ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1)\n"
   "       (declare (in) float arg2))\n"
   "     ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1)\n"
   "       (declare (in) float arg2))\n"
   "     ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1)\n"
   "       (declare (in) float arg2))\n"
   "     ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))\n"
   "))\n"
};

static const char *builtins_110_mod = {
   "((function mod\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((return (expression float % (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1))\n"
   "     ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1))\n"
   "     ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2  arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((declare () vec2 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression float % (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression float % (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3  arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((declare () vec3 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression float % (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression float % (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result))\n"
   "              (expression float % (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4  arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((declare () vec4 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression float % (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression float % (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result))\n"
   "              (expression float % (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref result))\n"
   "              (expression float % (swiz w (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "))\n"
};

static const char *builtins_110_noise_fake = {
   "((function noise1\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (constant float (0)))))\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec2 x))\n"
   "     ((return (constant float (0)))))\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec3 x))\n"
   "     ((return (constant float (0)))))\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) vec4 x))\n"
   "     ((return (constant float (0)))))\n"
   " )\n"
   "\n"
   " (function noise2\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (constant vec2 (0 0)))))\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 x))\n"
   "     ((return (constant vec2 (0 0)))))\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec3 x))\n"
   "     ((return (constant vec2 (0 0)))))\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec4 x))\n"
   "     ((return (constant vec2 (0 0)))))\n"
   " )\n"
   "\n"
   " (function noise3\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (constant vec3 (0 0 0)))))\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec2 x))\n"
   "     ((return (constant vec3 (0 0 0)))))\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 x))\n"
   "     ((return (constant vec3 (0 0 0)))))\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec4 x))\n"
   "     ((return (constant vec3 (0 0 0)))))\n"
   " )\n"
   "\n"
   " (function noise4\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (constant vec4 (0 0 0 0)))))\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec2 x))\n"
   "     ((return (constant vec4 (0 0 0 0)))))\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec3 x))\n"
   "     ((return (constant vec4 (0 0 0 0)))))\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 x))\n"
   "     ((return (constant vec4 (0 0 0 0)))))\n"
   " )\n"
   ")\n"
};

static const char *builtins_110_normalize = {
   "((function normalize\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n"
   "))\n"
};

static const char *builtins_110_not = {
   "((function not\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) bvec2 arg0))\n"
   "     ((return (expression bvec2 ! (var_ref arg0)))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) bvec3 arg0))\n"
   "     ((return (expression bvec3 ! (var_ref arg0)))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) bvec4 arg0))\n"
   "     ((return (expression bvec4 ! (var_ref arg0)))))\n"
   "))\n"
};

static const char *builtins_110_notEqual = {
   "((function notEqual\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2 arg0)\n"
   "       (declare (in) ivec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3 arg0)\n"
   "       (declare (in) ivec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4 arg0)\n"
   "       (declare (in) ivec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_110_pow = {
   "((function pow\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0)\n"
   "       (declare (in) float arg1))\n"
   "     ((return (expression float pow (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0)\n"
   "       (declare (in) vec2 arg1))\n"
   "     ((return (expression vec2 pow (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0)\n"
   "       (declare (in) vec3 arg1))\n"
   "     ((return (expression vec3 pow (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0)\n"
   "       (declare (in) vec4 arg1))\n"
   "     ((return (expression vec4 pow (var_ref arg0) (var_ref arg1)))))\n"
   "))\n"
};

static const char *builtins_110_radians = {
   "((function radians\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float * (var_ref arg0) (constant float (0.017453))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 * (var_ref arg0) (constant float (0.017453))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 * (var_ref arg0) (constant float (0.017453))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 * (var_ref arg0) (constant float (0.017453))))))\n"
   "))\n"
};

static const char *builtins_110_reflect = {
   "((function reflect\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float i)\n"
   "       (declare (in) float n))\n"
   "     ((return (expression float -\n"
   "	       (var_ref i)\n"
   "	       (expression float *\n"
   "		(constant float (2.0))\n"
   "		(expression float *\n"
   "		 (expression float dot\n"
   "		  (var_ref n)\n"
   "		  (var_ref i))\n"
   "		 (var_ref n)))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 i)\n"
   "       (declare (in) vec2 n))\n"
   "     ((return (expression vec2 -\n"
   "	       (var_ref i)\n"
   "	       (expression vec2 *\n"
   "		(constant float (2.0))\n"
   "		(expression vec2 *\n"
   "		 (expression float dot\n"
   "		  (var_ref n)\n"
   "		  (var_ref i))\n"
   "		 (var_ref n)))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 i)\n"
   "       (declare (in) vec3 n))\n"
   "     ((return (expression vec3 -\n"
   "	       (var_ref i)\n"
   "	       (expression vec3 *\n"
   "		(constant float (2.0))\n"
   "		(expression vec3 *\n"
   "		 (expression float dot\n"
   "		  (var_ref n)\n"
   "		  (var_ref i))\n"
   "		 (var_ref n)))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 i)\n"
   "       (declare (in) vec4 n))\n"
   "     ((return (expression vec4 -\n"
   "	       (var_ref i)\n"
   "	       (expression vec4 *\n"
   "		(constant float (2.0))\n"
   "		(expression vec4 *\n"
   "		 (expression float dot\n"
   "		  (var_ref n)\n"
   "		  (var_ref i))\n"
   "		 (var_ref n)))))))\n"
   "\n"
   "))\n"
};

static const char *builtins_110_refract = {
   "((function refract\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float i)\n"
   "       (declare (in) float n)\n"
   "       (declare (in) float eta))\n"
   "     ((declare () float k)\n"
   "      (assign (constant bool (1)) (var_ref k)\n"
   "              (expression float - (constant float (1.0))\n"
   "	        (expression float * (var_ref eta)\n"
   "	          (expression float * (var_ref eta)\n"
   "		    (expression float - (constant float (1.0))\n"
   "		      (expression float * \n"
   "		        (expression float dot (var_ref n) (var_ref i))\n"
   "		        (expression float dot (var_ref n) (var_ref i))))))))\n"
   "      (if (expression bool < (var_ref k) (constant float (0.0)))\n"
   "          ((return (constant float (0.0))))\n"
   "	  ((return (expression float -\n"
   "	             (expression float * (var_ref eta) (var_ref i))\n"
   "		     (expression float *\n"
   "		       (expression float +\n"
   "		         (expression float * (var_ref eta)\n"
   "			   (expression float dot (var_ref n) (var_ref i)))\n"
   "		         (expression float sqrt (var_ref k)))\n"
   "		       (var_ref n))))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 i)\n"
   "       (declare (in) vec2 n)\n"
   "       (declare (in) float eta))\n"
   "     ((declare () float k)\n"
   "      (assign (constant bool (1)) (var_ref k)\n"
   "              (expression float - (constant float (1.0))\n"
   "	        (expression float * (var_ref eta)\n"
   "	          (expression float * (var_ref eta)\n"
   "		    (expression float - (constant float (1.0))\n"
   "		      (expression float * \n"
   "		        (expression float dot (var_ref n) (var_ref i))\n"
   "		        (expression float dot (var_ref n) (var_ref i))))))))\n"
   "      (if (expression bool < (var_ref k) (constant float (0.0)))\n"
   "          ((return (constant vec2 (0.0 0.0))))\n"
   "	  ((return (expression vec2 -\n"
   "	             (expression vec2 * (var_ref eta) (var_ref i))\n"
   "		     (expression vec2 *\n"
   "		       (expression float +\n"
   "		         (expression float * (var_ref eta)\n"
   "			   (expression float dot (var_ref n) (var_ref i)))\n"
   "		         (expression float sqrt (var_ref k)))\n"
   "		       (var_ref n))))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 i)\n"
   "       (declare (in) vec3 n)\n"
   "       (declare (in) float eta))\n"
   "     ((declare () float k)\n"
   "      (assign (constant bool (1)) (var_ref k)\n"
   "              (expression float - (constant float (1.0))\n"
   "	        (expression float * (var_ref eta)\n"
   "	          (expression float * (var_ref eta)\n"
   "		    (expression float - (constant float (1.0))\n"
   "		      (expression float * \n"
   "		        (expression float dot (var_ref n) (var_ref i))\n"
   "		        (expression float dot (var_ref n) (var_ref i))))))))\n"
   "      (if (expression bool < (var_ref k) (constant float (0.0)))\n"
   "          ((return (constant vec3 (0.0 0.0))))\n"
   "	  ((return (expression vec3 -\n"
   "	             (expression vec3 * (var_ref eta) (var_ref i))\n"
   "		     (expression vec3 *\n"
   "		       (expression float +\n"
   "		         (expression float * (var_ref eta)\n"
   "			   (expression float dot (var_ref n) (var_ref i)))\n"
   "		         (expression float sqrt (var_ref k)))\n"
   "		       (var_ref n))))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 i)\n"
   "       (declare (in) vec4 n)\n"
   "       (declare (in) float eta))\n"
   "     ((declare () float k)\n"
   "      (assign (constant bool (1)) (var_ref k)\n"
   "              (expression float - (constant float (1.0))\n"
   "	        (expression float * (var_ref eta)\n"
   "	          (expression float * (var_ref eta)\n"
   "		    (expression float - (constant float (1.0))\n"
   "		      (expression float * \n"
   "		        (expression float dot (var_ref n) (var_ref i))\n"
   "		        (expression float dot (var_ref n) (var_ref i))))))))\n"
   "      (if (expression bool < (var_ref k) (constant float (0.0)))\n"
   "          ((return (constant vec4 (0.0 0.0))))\n"
   "	  ((return (expression vec4 -\n"
   "	             (expression vec4 * (var_ref eta) (var_ref i))\n"
   "		     (expression vec4 *\n"
   "		       (expression float +\n"
   "		         (expression float * (var_ref eta)\n"
   "			   (expression float dot (var_ref n) (var_ref i)))\n"
   "		         (expression float sqrt (var_ref k)))\n"
   "		       (var_ref n))))))))\n"
   "\n"
   "))\n"
};

static const char *builtins_110_sign = {
   "((function sign\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (expression float sign (var_ref x)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 x))\n"
   "     ((declare () vec2 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x))))\n"
   "      (return (var_ref t))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 x))\n"
   "     ((declare () vec3 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t)) (expression float sign (swiz z (var_ref x))))\n"
   "      (return (var_ref t))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 x))\n"
   "     ((declare () vec4 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t)) (expression float sign (swiz z (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref t)) (expression float sign (swiz w (var_ref x))))\n"
   "      (return (var_ref t))))\n"
   "))\n"
   "\n"
};

static const char *builtins_110_sin = {
   "((function sin\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float angle))\n"
   "     ((return (expression float sin (var_ref angle)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 angle))\n"
   "     ((return (expression vec2 sin (var_ref angle)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 angle))\n"
   "     ((return (expression vec3 sin (var_ref angle)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 angle))\n"
   "     ((return (expression vec4 sin (var_ref angle)))))\n"
   "))\n"
};

static const char *builtins_110_smoothstep = {
   "((function smoothstep\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float edge0)\n"
   "       (declare (in) float edge1)\n"
   "       (declare (in) float x))\n"
   "     ((declare () float t)\n"
   "\n"
   "      (assign (constant bool (1)) (var_ref t)\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (var_ref t))))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) float edge0)\n"
   "       (declare (in) float edge1)\n"
   "       (declare (in) vec2 x))\n"
   "     ((declare () vec2 t)\n"
   "      (declare () vec2 retval)\n"
   "\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
   "      (return (var_ref retval))\n"
   "      ))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) float edge0)\n"
   "       (declare (in) float edge1)\n"
   "       (declare (in) vec3 x))\n"
   "     ((declare () vec3 t)\n"
   "      (declare () vec3 retval)\n"
   "\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
   "      (return (var_ref retval))\n"
   "      ))\n"
   "\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) float edge0)\n"
   "       (declare (in) float edge1)\n"
   "       (declare (in) vec4 x))\n"
   "     ((declare () vec4 t)\n"
   "      (declare () vec4 retval)\n"
   "\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz w (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref retval)) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))\n"
   "      (return (var_ref retval))\n"
   "      ))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 edge0)\n"
   "       (declare (in) vec2 edge1)\n"
   "       (declare (in) vec2 x))\n"
   "     ((declare () vec2 t)\n"
   "      (declare () vec2 retval)\n"
   "\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0))))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0))))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
   "      (return (var_ref retval))\n"
   "      ))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 edge0)\n"
   "       (declare (in) vec3 edge1)\n"
   "       (declare (in) vec3 x))\n"
   "     ((declare () vec3 t)\n"
   "      (declare () vec3 retval)\n"
   "\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0))))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0))))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz z (var_ref x)) (swiz z (var_ref edge0))) (expression float - (swiz z (var_ref edge1)) (swiz z (var_ref edge0))))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
   "      (return (var_ref retval))\n"
   "      ))\n"
   "\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 edge0)\n"
   "       (declare (in) vec4 edge1)\n"
   "       (declare (in) vec4 x))\n"
   "     ((declare () vec4 t)\n"
   "      (declare () vec4 retval)\n"
   "\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0))))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0))))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz z (var_ref x)) (swiz z (var_ref edge0))) (expression float - (swiz z (var_ref edge1)) (swiz z (var_ref edge0))))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
   "\n"
   "      (assign (constant bool (1)) (swiz w (var_ref t))\n"
   "              (expression float max\n"
   "	                  (expression float min\n"
   "	                              (expression float / (expression float - (swiz w (var_ref x)) (swiz w (var_ref edge0))) (expression float - (swiz w (var_ref edge1)) (swiz w (var_ref edge0))))\n"
   "	                              (constant float (1.0)))\n"
   "	                  (constant float (0.0))))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref retval)) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))\n"
   "      (return (var_ref retval))\n"
   "      ))\n"
   "\n"
   "))\n"
   "\n"
};

static const char *builtins_110_sqrt = {
   "((function sqrt\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float arg0))\n"
   "     ((return (expression float sqrt (var_ref arg0)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 arg0))\n"
   "     ((return (expression vec2 sqrt (var_ref arg0)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 arg0))\n"
   "     ((return (expression vec3 sqrt (var_ref arg0)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 arg0))\n"
   "     ((return (expression vec4 sqrt (var_ref arg0)))))\n"
   "))\n"
};

static const char *builtins_110_step = {
   "((function step\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float edge)\n"
   "       (declare (in) float x))\n"
   "     ((return (expression float b2f (expression bool < (var_ref x) (var_ref edge))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) float edge)\n"
   "       (declare (in) vec2 x))\n"
   "     ((declare () vec2 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge))))\n"
   "      (return (var_ref t))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) float edge)\n"
   "       (declare (in) vec3 x))\n"
   "     ((declare () vec3 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(var_ref edge))))\n"
   "      (return (var_ref t))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) float edge)\n"
   "       (declare (in) vec4 x))\n"
   "     ((declare () vec4 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(var_ref edge))))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool < (swiz w (var_ref x))(var_ref edge))))\n"
   "      (return (var_ref t))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 edge)\n"
   "       (declare (in) vec2 x))\n"
   "     ((declare () vec2 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
   "      (return (var_ref t))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 edge)\n"
   "       (declare (in) vec3 x))\n"
   "     ((declare () vec3 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(swiz z (var_ref edge)))))\n"
   "      (return (var_ref t))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 edge)\n"
   "       (declare (in) vec4 x))\n"
   "     ((declare () vec4 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz z (var_ref edge)))))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool < (swiz w (var_ref x))(swiz w (var_ref edge)))))\n"
   "      (return (var_ref t))))\n"
   "))\n"
   "\n"
};

static const char *builtins_110_tan = {
   "((function tan\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float angle))\n"
   "     ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 angle))\n"
   "     ((return (expression float / (expression float sin (var_ref angle)) (expression vec2 cos (var_ref angle))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 angle))\n"
   "     ((return (expression float / (expression float sin (var_ref angle)) (expression vec3 cos (var_ref angle))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 angle))\n"
   "     ((return (expression float / (expression float sin (var_ref angle)) (expression vec4 cos (var_ref angle))))))\n"
   "))\n"
};

static const char *builtins_110_textures = {
   "((function texture1D\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) float P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   ")\n"
   " (function texture1DLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) float P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function texture1DProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   ")\n"
   " (function texture1DProjLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function texture2D\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   ")\n"
   "(function texture2DLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function texture2DProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   ")\n"
   " (function texture2DProjLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function texture3D\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   ")\n"
   " (function texture3DLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function texture3DProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   ")\n"
   " (function texture3DProjLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function textureCube\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) samplerCube sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   ")\n"
   " (function textureCubeLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) samplerCube sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function shadow1D\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DShadow sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n"
   "\n"
   ")\n"
   " (function shadow1DLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DShadow sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function shadow1DProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DShadow sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) ))))\n"
   "\n"
   ")\n"
   " (function shadow1DProjLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DShadow sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function shadow2D\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DShadow sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n"
   "\n"
   ")\n"
   " (function shadow2DLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DShadow sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function shadow2DProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DShadow sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) ))))\n"
   "\n"
   ")\n"
   " (function shadow2DProjLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DShadow sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) ))))\n"
   "\n"
   "))\n"
};

static const char *functions_for_110 [] = {
   builtins_110_abs,
   builtins_110_all,
   builtins_110_any,
   builtins_110_asin,
   builtins_110_atan,
   builtins_110_ceil,
   builtins_110_clamp,
   builtins_110_cos,
   builtins_110_cross,
   builtins_110_degrees,
   builtins_110_distance,
   builtins_110_dot,
   builtins_110_equal,
   builtins_110_exp,
   builtins_110_exp2,
   builtins_110_faceforward,
   builtins_110_floor,
   builtins_110_fract,
   builtins_110_greaterThan,
   builtins_110_greaterThanEqual,
   builtins_110_inversesqrt,
   builtins_110_length,
   builtins_110_lessThan,
   builtins_110_lessThanEqual,
   builtins_110_log,
   builtins_110_log2,
   builtins_110_matrixCompMult,
   builtins_110_max,
   builtins_110_min,
   builtins_110_mix,
   builtins_110_mod,
   builtins_110_noise_fake,
   builtins_110_normalize,
   builtins_110_not,
   builtins_110_notEqual,
   builtins_110_pow,
   builtins_110_radians,
   builtins_110_reflect,
   builtins_110_refract,
   builtins_110_sign,
   builtins_110_sin,
   builtins_110_smoothstep,
   builtins_110_sqrt,
   builtins_110_step,
   builtins_110_tan,
   builtins_110_textures,
};

/* 110_fs builtins */

static const char *builtins_110_fs_derivatives = {
   "((function dFdx\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float p))\n"
   "     ((return (expression float dFdx (var_ref p)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 p))\n"
   "     ((return (expression vec2 dFdx (var_ref p)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 p))\n"
   "     ((return (expression vec3 dFdx (var_ref p)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 p))\n"
   "     ((return (expression vec4 dFdx (var_ref p)))))\n"
   " )\n"
   "\n"
   " (function dFdy\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float p))\n"
   "     ((return (expression float dFdy (var_ref p)))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 p))\n"
   "     ((return (expression vec2 dFdy (var_ref p)))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 p))\n"
   "     ((return (expression vec3 dFdy (var_ref p)))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 p))\n"
   "     ((return (expression vec4 dFdy (var_ref p)))))\n"
   " )\n"
   "\n"
   " (function fwidth\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float p))\n"
   "     ((return (expression float +\n"
   "                (expression float abs (expression float dFdx (var_ref p)))\n"
   "                (expression float abs (expression float dFdy (var_ref p)))))))\n"
   "\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 p))\n"
   "     ((return (expression vec2 +\n"
   "                (expression vec2 abs (expression vec2 dFdx (var_ref p)))\n"
   "                (expression vec2 abs (expression vec2 dFdy (var_ref p)))))))\n"
   "\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 p))\n"
   "     ((return (expression vec3 +\n"
   "                (expression vec3 abs (expression vec3 dFdx (var_ref p)))\n"
   "                (expression vec3 abs (expression vec3 dFdy (var_ref p)))))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 p))\n"
   "     ((return (expression vec4 +\n"
   "                (expression vec4 abs (expression vec4 dFdx (var_ref p)))\n"
   "                (expression vec4 abs (expression vec4 dFdy (var_ref p)))))))\n"
   "))\n"
};

static const char *builtins_110_fs_textures = {
   "((function texture1D\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) float P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function texture1DProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function texture2D\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function texture2DProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function texture3D\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function texture3DProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function textureCube\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) samplerCube sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function shadow1D\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DShadow sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function shadow1DProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DShadow sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function shadow2D\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DShadow sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function shadow2DProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DShadow sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref bias) ))))\n"
   "\n"
   "))\n"
};

static const char *functions_for_110_fs [] = {
   builtins_110_fs_derivatives,
   builtins_110_fs_textures,
};

/* 110_vs builtins */

static const char *builtins_110_vs_ftransform = {
   "((function ftransform\n"
   "   (signature vec4\n"
   "     (parameters)\n"
   "    ((return (expression vec4 *\n"
   "	      (var_ref gl_ModelViewProjectionMatrix)\n"
   "	      (var_ref gl_Vertex)))))\n"
   "))\n"
};

static const char *functions_for_110_vs [] = {
   builtins_110_vs_ftransform,
};

/* 120 builtins */

static const char *builtins_120_matrixCompMult = {
   "((function matrixCompMult\n"
   "   (signature mat2x3\n"
   "     (parameters\n"
   "       (declare (in) mat2x3 x)\n"
   "       (declare (in) mat2x3 y))\n"
   "     ((declare () mat2x3 z)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0)))  (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1)))  (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
   "(return (var_ref z))))\n"
   "\n"
   "   (signature mat3x2\n"
   "     (parameters\n"
   "       (declare (in) mat3x2 x)\n"
   "       (declare (in) mat3x2 y))\n"
   "     ((declare () mat3x2 z)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0)))  (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1)))  (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2)))  (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
   "(return (var_ref z))))\n"
   "\n"
   "   (signature mat2x4\n"
   "     (parameters\n"
   "       (declare (in) mat2x4 x)\n"
   "       (declare (in) mat2x4 y))\n"
   "     ((declare () mat2x4 z)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0)))  (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1)))  (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
   "(return (var_ref z))))\n"
   "\n"
   "   (signature mat4x2\n"
   "     (parameters\n"
   "       (declare (in) mat4x2 x)\n"
   "       (declare (in) mat4x2 y))\n"
   "     ((declare () mat4x2 z)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0)))  (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1)))  (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2)))  (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3)))  (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n"
   "(return (var_ref z))))\n"
   "\n"
   "   (signature mat3x4\n"
   "     (parameters\n"
   "       (declare (in) mat3x4 x)\n"
   "       (declare (in) mat3x4 y))\n"
   "     ((declare () mat3x4 z)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0)))  (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1)))  (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2)))  (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
   "(return (var_ref z))))\n"
   "\n"
   "   (signature mat4x3\n"
   "     (parameters\n"
   "       (declare (in) mat4x3 x)\n"
   "       (declare (in) mat4x3 y))\n"
   "     ((declare () mat4x3 z)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0)))  (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1)))  (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2)))  (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3)))  (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n"
   "(return (var_ref z))))\n"
   "))\n"
};

static const char *builtins_120_outerProduct = {
   "((function outerProduct\n"
   "   (signature mat2\n"
   "     (parameters\n"
   "       (declare (in) vec2 u)\n"
   "       (declare (in) vec2 v))\n"
   "     ((declare () mat2 m)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0)))  (expression vec2 * (var_ref v) (swiz x (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1)))  (expression vec2 * (var_ref v) (swiz y (var_ref u)))) \n"
   "(return (var_ref m))))\n"
   "\n"
   "   (signature mat2x3\n"
   "     (parameters\n"
   "       (declare (in) vec2 u)\n"
   "       (declare (in) vec3 v))\n"
   "     ((declare () mat2x3 m)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0)))  (expression vec3 * (var_ref v) (swiz x (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1)))  (expression vec3 * (var_ref v) (swiz y (var_ref u)))) \n"
   "(return (var_ref m))))\n"
   "\n"
   "   (signature mat2x4\n"
   "     (parameters\n"
   "       (declare (in) vec2 u)\n"
   "       (declare (in) vec4 v))\n"
   "     ((declare () mat2x4 m)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0)))  (expression vec4 * (var_ref v) (swiz x (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1)))  (expression vec4 * (var_ref v) (swiz y (var_ref u)))) \n"
   "(return (var_ref m))))\n"
   "\n"
   "   (signature mat3x2\n"
   "     (parameters\n"
   "       (declare (in) vec3 u)\n"
   "       (declare (in) vec2 v))\n"
   "     ((declare () mat3x2 m)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0)))  (expression vec2 * (var_ref v) (swiz x (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1)))  (expression vec2 * (var_ref v) (swiz y (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2)))  (expression vec2 * (var_ref v) (swiz z (var_ref u)))) \n"
   "(return (var_ref m))))\n"
   "\n"
   "   (signature mat3\n"
   "     (parameters\n"
   "       (declare (in) vec3 u)\n"
   "       (declare (in) vec3 v))\n"
   "     ((declare () mat3 m)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0)))  (expression vec3 * (var_ref v) (swiz x (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1)))  (expression vec3 * (var_ref v) (swiz y (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2)))  (expression vec3 * (var_ref v) (swiz z (var_ref u)))) \n"
   "(return (var_ref m))))\n"
   "\n"
   "   (signature mat3x4\n"
   "     (parameters\n"
   "       (declare (in) vec3 u)\n"
   "       (declare (in) vec4 v))\n"
   "     ((declare () mat3x4 m)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0)))  (expression vec4 * (var_ref v) (swiz x (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1)))  (expression vec4 * (var_ref v) (swiz y (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2)))  (expression vec4 * (var_ref v) (swiz z (var_ref u)))) \n"
   "(return (var_ref m))))\n"
   "\n"
   "   (signature mat4x2\n"
   "     (parameters\n"
   "       (declare (in) vec4 u)\n"
   "       (declare (in) vec2 v))\n"
   "     ((declare () mat4x2 m)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0)))  (expression vec2 * (var_ref v) (swiz x (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1)))  (expression vec2 * (var_ref v) (swiz y (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2)))  (expression vec2 * (var_ref v) (swiz z (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3)))  (expression vec2 * (var_ref v) (swiz w (var_ref u)))) \n"
   "(return (var_ref m))))\n"
   "\n"
   "   (signature mat4x3\n"
   "     (parameters\n"
   "       (declare (in) vec4 u)\n"
   "       (declare (in) vec3 v))\n"
   "     ((declare () mat4x3 m)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0)))  (expression vec3 * (var_ref v) (swiz x (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1)))  (expression vec3 * (var_ref v) (swiz y (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2)))  (expression vec3 * (var_ref v) (swiz z (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3)))  (expression vec3 * (var_ref v) (swiz w (var_ref u)))) \n"
   "(return (var_ref m))))\n"
   "\n"
   "   (signature mat4\n"
   "     (parameters\n"
   "       (declare (in) vec4 u)\n"
   "       (declare (in) vec4 v))\n"
   "     ((declare () mat4 m)\n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0)))  (expression vec4 * (var_ref v) (swiz x (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1)))  (expression vec4 * (var_ref v) (swiz y (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2)))  (expression vec4 * (var_ref v) (swiz z (var_ref u)))) \n"
   "      (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3)))  (expression vec4 * (var_ref v) (swiz w (var_ref u)))) \n"
   "(return (var_ref m))))\n"
   "))\n"
   "\n"
};

static const char *builtins_120_transpose = {
   "((function transpose\n"
   "   (signature mat2\n"
   "     (parameters\n"
   "       (declare (in) mat2 m))\n"
   "     ((declare () mat2 t)\n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
   "(return (var_ref t))))\n"
   "\n"
   "   (signature mat3x2\n"
   "     (parameters\n"
   "       (declare (in) mat2x3 m))\n"
   "     ((declare () mat3x2 t)\n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
   "(return (var_ref t))))\n"
   "\n"
   "   (signature mat4x2\n"
   "     (parameters\n"
   "       (declare (in) mat2x4 m))\n"
   "     ((declare () mat4x2 t)\n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n"
   "(return (var_ref t))))\n"
   "\n"
   "   (signature mat2x3\n"
   "     (parameters\n"
   "       (declare (in) mat3x2 m))\n"
   "     ((declare () mat2x3 t)\n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
   "(return (var_ref t))))\n"
   "\n"
   "   (signature mat3\n"
   "     (parameters\n"
   "       (declare (in) mat3 m))\n"
   "     ((declare () mat3 t)\n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n"
   "(return (var_ref t))))\n"
   "\n"
   "   (signature mat4x3\n"
   "     (parameters\n"
   "       (declare (in) mat3x4 m))\n"
   "     ((declare () mat4x3 t)\n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) \n"
   "(return (var_ref t))))\n"
   "\n"
   "   (signature mat2x4\n"
   "     (parameters\n"
   "       (declare (in) mat4x2 m))\n"
   "     ((declare () mat2x4 t)\n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n"
   "      (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n"
   "(return (var_ref t))))\n"
   "\n"
   "   (signature mat3x4\n"
   "     (parameters\n"
   "       (declare (in) mat4x3 m))\n"
   "     ((declare () mat3x4 t)\n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n"
   "      (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n"
   "      (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) \n"
   "(return (var_ref t))))\n"
   "\n"
   "   (signature mat4\n"
   "     (parameters\n"
   "       (declare (in) mat4 m))\n"
   "     ((declare () mat4 t)\n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) \n"
   "      (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n"
   "      (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n"
   "      (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) \n"
   "      (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (3))))) \n"
   "(return (var_ref t))))\n"
   ")\n"
   "\n"
   ")\n"
   "\n"
};

static const char *functions_for_120 [] = {
   builtins_120_matrixCompMult,
   builtins_120_outerProduct,
   builtins_120_transpose,
};

/* 130 builtins */

static const char *builtins_130_clamp = {
   "((function clamp\n"
   "   (signature int\n"
   "     (parameters\n"
   "       (declare (in) int arg0)\n"
   "       (declare (in) int arg1)\n"
   "       (declare (in) int arg2))\n"
   "     ((return (expression int max (expression int min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2 arg0)\n"
   "       (declare (in) ivec2 arg1)\n"
   "       (declare (in) ivec2 arg2))\n"
   "     ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3 arg0)\n"
   "       (declare (in) ivec3 arg1)\n"
   "       (declare (in) ivec3 arg2))\n"
   "     ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4 arg0)\n"
   "       (declare (in) ivec4 arg1)\n"
   "       (declare (in) ivec4 arg2))\n"
   "     ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2 arg0)\n"
   "       (declare (in) int arg1)\n"
   "       (declare (in) int arg2))\n"
   "     ((declare () ivec2 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature ivec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3 arg0)\n"
   "       (declare (in) int arg1)\n"
   "       (declare (in) int arg2))\n"
   "     ((declare () ivec3 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4 arg0)\n"
   "       (declare (in) int arg1)\n"
   "       (declare (in) int arg2))\n"
   "     ((declare () ivec4 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz w (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature uint\n"
   "     (parameters\n"
   "       (declare (in) uint arg0)\n"
   "       (declare (in) uint arg1)\n"
   "       (declare (in) uint arg2))\n"
   "     ((return (expression uint max (expression uint min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2 arg0)\n"
   "       (declare (in) uvec2 arg1)\n"
   "       (declare (in) uvec2 arg2))\n"
   "     ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3 arg0)\n"
   "       (declare (in) uvec3 arg1)\n"
   "       (declare (in) uvec3 arg2))\n"
   "     ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4 arg0)\n"
   "       (declare (in) uvec4 arg1)\n"
   "       (declare (in) uvec4 arg2))\n"
   "     ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2 arg0)\n"
   "       (declare (in) uint arg1)\n"
   "       (declare (in) uint arg2))\n"
   "     ((declare () uvec2 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature uvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3 arg0)\n"
   "       (declare (in) uint arg1)\n"
   "       (declare (in) uint arg2))\n"
   "     ((declare () uvec3 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4 arg0)\n"
   "       (declare (in) uint arg1)\n"
   "       (declare (in) uint arg2))\n"
   "     ((declare () uvec4 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz w (var_ref arg0)) (var_ref arg2)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "))\n"
};

static const char *builtins_130_cosh = {
   "((function cosh\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (expression float * (constant float (0.5))\n"
   "                (expression float +\n"
   "		  (expression float exp (var_ref x))\n"
   "		  (expression float exp (expression float neg (var_ref x))))))))\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 x))\n"
   "     ((return (expression vec2 * (constant vec2 (0.5))\n"
   "                (expression vec2 +\n"
   "		  (expression vec2 exp (var_ref x))\n"
   "		  (expression vec2 exp (expression vec2 neg (var_ref x))))))))\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 x))\n"
   "     ((return (expression vec3 * (constant vec3 (0.5))\n"
   "                (expression vec3 +\n"
   "		  (expression vec3 exp (var_ref x))\n"
   "		  (expression vec3 exp (expression vec3 neg (var_ref x))))))))\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 x))\n"
   "     ((return (expression vec4 * (constant vec4 (0.5))\n"
   "                (expression vec4 +\n"
   "		  (expression vec4 exp (var_ref x))\n"
   "		  (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n"
   "))\n"
};

static const char *builtins_130_equal = {
   "((function equal\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2 arg0)\n"
   "       (declare (in) uvec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3 arg0)\n"
   "       (declare (in) uvec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4 arg0)\n"
   "       (declare (in) uvec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_130_greaterThan = {
   "((function greaterThan\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2 arg0)\n"
   "       (declare (in) uvec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3 arg0)\n"
   "       (declare (in) uvec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4 arg0)\n"
   "       (declare (in) uvec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_130_greaterThanEqual = {
   "((function greaterThanEqual\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2 arg0)\n"
   "       (declare (in) uvec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3 arg0)\n"
   "       (declare (in) uvec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4 arg0)\n"
   "       (declare (in) uvec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_130_lessThan = {
   "((function lessThan\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2 arg0)\n"
   "       (declare (in) uvec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3 arg0)\n"
   "       (declare (in) uvec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4 arg0)\n"
   "       (declare (in) uvec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_130_lessThanEqual = {
   "((function lessThanEqual\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2 arg0)\n"
   "       (declare (in) uvec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3 arg0)\n"
   "       (declare (in) uvec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4 arg0)\n"
   "       (declare (in) uvec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_130_max = {
   "((function max\n"
   "   (signature int\n"
   "     (parameters\n"
   "       (declare (in) int arg0)\n"
   "       (declare (in) int arg1))\n"
   "     ((return (expression int max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2 arg0)\n"
   "       (declare (in) ivec2 arg1))\n"
   "     ((return (expression ivec2 max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3 arg0)\n"
   "       (declare (in) ivec3 arg1))\n"
   "     ((return (expression ivec3 max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4 arg0)\n"
   "       (declare (in) ivec4 arg1))\n"
   "     ((return (expression ivec4 max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2  arg0)\n"
   "       (declare (in) int arg1))\n"
   "     ((declare () ivec2 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression int max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression int max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature ivec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3  arg0)\n"
   "       (declare (in) int arg1))\n"
   "     ((declare () ivec3 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression int max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression int max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result))\n"
   "              (expression int max (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4  arg0)\n"
   "       (declare (in) int arg1))\n"
   "     ((declare () ivec4 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression int max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression int max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result))\n"
   "              (expression int max (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref result))\n"
   "              (expression int max (swiz w (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature uint\n"
   "     (parameters\n"
   "       (declare (in) uint arg0)\n"
   "       (declare (in) uint arg1))\n"
   "     ((return (expression uint max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2 arg0)\n"
   "       (declare (in) uvec2 arg1))\n"
   "     ((return (expression uvec2 max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3 arg0)\n"
   "       (declare (in) uvec3 arg1))\n"
   "     ((return (expression uvec3 max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4 arg0)\n"
   "       (declare (in) uvec4 arg1))\n"
   "     ((return (expression uvec4 max (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2  arg0)\n"
   "       (declare (in) uint arg1))\n"
   "     ((declare () uvec2 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression uint max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression uint max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature uvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3  arg0)\n"
   "       (declare (in) uint arg1))\n"
   "     ((declare () uvec3 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression uint max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression uint max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result))\n"
   "              (expression uint max (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4  arg0)\n"
   "       (declare (in) uint arg1))\n"
   "     ((declare () uvec4 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression uint max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression uint max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result))\n"
   "              (expression uint max (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref result))\n"
   "              (expression uint max (swiz w (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "))\n"
};

static const char *builtins_130_min = {
   "((function min\n"
   "   (signature int\n"
   "     (parameters\n"
   "       (declare (in) int arg0)\n"
   "       (declare (in) int arg1))\n"
   "     ((return (expression int min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2 arg0)\n"
   "       (declare (in) ivec2 arg1))\n"
   "     ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3 arg0)\n"
   "       (declare (in) ivec3 arg1))\n"
   "     ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4 arg0)\n"
   "       (declare (in) ivec4 arg1))\n"
   "     ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature ivec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2  arg0)\n"
   "       (declare (in) int arg1))\n"
   "     ((declare () ivec2 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression int min (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression int min (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature ivec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3  arg0)\n"
   "       (declare (in) int arg1))\n"
   "     ((declare () ivec3 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression int min (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression int min (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result))\n"
   "              (expression int min (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4  arg0)\n"
   "       (declare (in) int arg1))\n"
   "     ((declare () ivec4 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression int min (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression int min (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result))\n"
   "              (expression int min (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref result))\n"
   "              (expression int min (swiz w (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature uint\n"
   "     (parameters\n"
   "       (declare (in) uint arg0)\n"
   "       (declare (in) uint arg1))\n"
   "     ((return (expression uint min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2 arg0)\n"
   "       (declare (in) uvec2 arg1))\n"
   "     ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3 arg0)\n"
   "       (declare (in) uvec3 arg1))\n"
   "     ((return (expression uvec3 min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4 arg0)\n"
   "       (declare (in) uvec4 arg1))\n"
   "     ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\n"
   "\n"
   "   (signature uvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2  arg0)\n"
   "       (declare (in) uint arg1))\n"
   "     ((declare () uvec2 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression uint min (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression uint min (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature uvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3  arg0)\n"
   "       (declare (in) uint arg1))\n"
   "     ((declare () uvec3 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression uint min (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression uint min (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result))\n"
   "              (expression uint min (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4  arg0)\n"
   "       (declare (in) uint arg1))\n"
   "     ((declare () uvec4 result)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref result))\n"
   "              (expression uint min (swiz x (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref result))\n"
   "              (expression uint min (swiz y (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref result))\n"
   "              (expression uint min (swiz z (var_ref arg0)) (var_ref arg1)))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref result))\n"
   "              (expression uint min (swiz w (var_ref arg0)) (var_ref arg1)))\n"
   "      (return (var_ref result))))\n"
   "))\n"
};

static const char *builtins_130_notEqual = {
   "((function notEqual\n"
   "   (signature bvec2\n"
   "     (parameters\n"
   "       (declare (in) uvec2 arg0)\n"
   "       (declare (in) uvec2 arg1))\n"
   "     ((declare () bvec2 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec3\n"
   "     (parameters\n"
   "       (declare (in) uvec3 arg0)\n"
   "       (declare (in) uvec3 arg1))\n"
   "     ((declare () bvec3 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "\n"
   "   (signature bvec4\n"
   "     (parameters\n"
   "       (declare (in) uvec4 arg0)\n"
   "       (declare (in) uvec4 arg1))\n"
   "     ((declare () bvec4 temp)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
   "      (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
   "      (return (var_ref temp))))\n"
   "))\n"
};

static const char *builtins_130_sign = {
   "((function sign\n"
   "   (signature int\n"
   "     (parameters\n"
   "       (declare (in) int x))\n"
   "     ((return (expression int / (var_ref x) (expression int abs (var_ref x))))))\n"
   "\n"
   "   (signature ivec2\n"
   "     (parameters\n"
   "       (declare (in) ivec2 x))\n"
   "     ((declare () ivec2 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x))))\n"
   "      (return (var_ref t))))\n"
   "\n"
   "   (signature ivec3\n"
   "     (parameters\n"
   "       (declare (in) ivec3 x))\n"
   "     ((declare () ivec3 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t)) (expression int sign (swiz z (var_ref x))))\n"
   "      (return (var_ref t))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) ivec4 x))\n"
   "     ((declare () ivec4 t)\n"
   "      (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz z (var_ref t)) (expression int sign (swiz z (var_ref x))))\n"
   "      (assign (constant bool (1)) (swiz w (var_ref t)) (expression int sign (swiz w (var_ref x))))\n"
   "      (return (var_ref t))))\n"
   "))\n"
   "\n"
};

static const char *builtins_130_sinh = {
   "((function sinh\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (expression float * (constant float (0.5))\n"
   "                (expression float -\n"
   "		  (expression float exp (var_ref x))\n"
   "		  (expression float exp (expression float neg (var_ref x))))))))\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 x))\n"
   "     ((return (expression vec2 * (constant vec2 (0.5))\n"
   "                (expression vec2 -\n"
   "		  (expression vec2 exp (var_ref x))\n"
   "		  (expression vec2 exp (expression vec2 neg (var_ref x))))))))\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 x))\n"
   "     ((return (expression vec3 * (constant vec3 (0.5))\n"
   "                (expression vec3 -\n"
   "		  (expression vec3 exp (var_ref x))\n"
   "		  (expression vec3 exp (expression vec3 neg (var_ref x))))))))\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 x))\n"
   "     ((return (expression vec4 * (constant vec4 (0.5))\n"
   "                (expression vec4 -\n"
   "		  (expression vec4 exp (var_ref x))\n"
   "		  (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n"
   "))\n"
};

static const char *builtins_130_tanh = {
   "((function tanh\n"
   "   (signature float\n"
   "     (parameters\n"
   "       (declare (in) float x))\n"
   "     ((return (expression float /\n"
   "                (expression float -\n"
   "		  (expression float exp (var_ref x))\n"
   "		  (expression float exp (expression float neg (var_ref x))))\n"
   "                (expression float +\n"
   "		  (expression float exp (var_ref x))\n"
   "		  (expression float exp (expression float neg (var_ref x))))))))\n"
   "   (signature vec2\n"
   "     (parameters\n"
   "       (declare (in) vec2 x))\n"
   "     ((return (expression vec2 /\n"
   "                (expression vec2 -\n"
   "		  (expression vec2 exp (var_ref x))\n"
   "		  (expression vec2 exp (expression vec2 neg (var_ref x))))\n"
   "                (expression vec2 +\n"
   "		  (expression vec2 exp (var_ref x))\n"
   "		  (expression vec2 exp (expression vec2 neg (var_ref x))))))))\n"
   "   (signature vec3\n"
   "     (parameters\n"
   "       (declare (in) vec3 x))\n"
   "     ((return (expression vec3 /\n"
   "                (expression vec3 -\n"
   "		  (expression vec3 exp (var_ref x))\n"
   "		  (expression vec3 exp (expression vec3 neg (var_ref x))))\n"
   "                (expression vec3 +\n"
   "		  (expression vec3 exp (var_ref x))\n"
   "		  (expression vec3 exp (expression vec3 neg (var_ref x))))))))\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) vec4 x))\n"
   "     ((return (expression vec4 /\n"
   "                (expression vec4 -\n"
   "		  (expression vec4 exp (var_ref x))\n"
   "		  (expression vec4 exp (expression vec4 neg (var_ref x))))\n"
   "                (expression vec4 +\n"
   "		  (expression vec4 exp (var_ref x))\n"
   "		  (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n"
   "))\n"
};

static const char *builtins_130_texelFetch = {
   "((function texelFetch\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) int P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) int P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) int P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) ivec2 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) ivec2 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) ivec2 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) ivec3 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler3D sampler)\n"
   "       (declare (in) ivec3 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler3D sampler)\n"
   "       (declare (in) ivec3 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DArray sampler)\n"
   "       (declare (in) ivec2 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1DArray sampler)\n"
   "       (declare (in) ivec2 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1DArray sampler)\n"
   "       (declare (in) ivec2 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DArray sampler)\n"
   "       (declare (in) ivec3 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2DArray sampler)\n"
   "       (declare (in) ivec3 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2DArray sampler)\n"
   "       (declare (in) ivec3 P) \n"
   "       (declare (in) int lod) )\n"
   "     ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n"
   "\n"
   "))\n"
};

static const char *builtins_130_texture = {
   "((function texture\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) float P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) float P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) float P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler3D sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler3D sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) samplerCube sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isamplerCube sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usamplerCube sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DArray sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1DArray sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1DArray sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DArray sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2DArray sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2DArray sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   "))\n"
};

static const char *builtins_130_textureGrad = {
   "((function textureGrad\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) float P) \n"
   "       (declare (in) float dPdx) \n"
   "       (declare (in) float dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) float P) \n"
   "       (declare (in) float dPdx) \n"
   "       (declare (in) float dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) float P) \n"
   "       (declare (in) float dPdx) \n"
   "       (declare (in) float dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler3D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler3D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) samplerCube sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isamplerCube sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usamplerCube sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DArray sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1DArray sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1DArray sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DArray sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2DArray sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2DArray sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   ")\n"
   ")\n"
};

static const char *builtins_130_textureLod = {
   "((function textureLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) float P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) float P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) float P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler3D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler3D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) samplerCube sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isamplerCube sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usamplerCube sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DArray sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1DArray sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1DArray sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DArray sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2DArray sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2DArray sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   "))\n"
};

static const char *builtins_130_textureProj = {
   "((function textureProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler3D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler3D sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n"
   "\n"
   "))\n"
};

static const char *builtins_130_textureProjGrad = {
   "((function textureLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float dPdx) \n"
   "       (declare (in) float dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float dPdx) \n"
   "       (declare (in) float dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float dPdx) \n"
   "       (declare (in) float dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float dPdx) \n"
   "       (declare (in) float dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float dPdx) \n"
   "       (declare (in) float dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float dPdx) \n"
   "       (declare (in) float dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) vec2 dPdx) \n"
   "       (declare (in) vec2 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler3D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler3D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) vec3 dPdx) \n"
   "       (declare (in) vec3 dPdy) )\n"
   "     ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n"
   "\n"
   "))\n"
};

static const char *builtins_130_textureProjLod = {
   "((function textureLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler3D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler3D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n"
   "\n"
   "))\n"
};

static const char *functions_for_130 [] = {
   builtins_130_clamp,
   builtins_130_cosh,
   builtins_130_equal,
   builtins_130_greaterThan,
   builtins_130_greaterThanEqual,
   builtins_130_lessThan,
   builtins_130_lessThanEqual,
   builtins_130_max,
   builtins_130_min,
   builtins_130_notEqual,
   builtins_130_sign,
   builtins_130_sinh,
   builtins_130_tanh,
   builtins_130_texelFetch,
   builtins_130_texture,
   builtins_130_textureGrad,
   builtins_130_textureLod,
   builtins_130_textureProj,
   builtins_130_textureProjGrad,
   builtins_130_textureProjLod,
};

/* 130_fs builtins */

static const char *builtins_130_fs_texture = {
   "((function texture\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) float P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) float P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) float P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler3D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler3D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) samplerCube sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isamplerCube sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usamplerCube sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DArray sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1DArray sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1DArray sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DArray sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2DArray sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2DArray sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   "))\n"
};

static const char *builtins_130_fs_textureProj = {
   "((function textureProj\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler1D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler1D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler2D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler2D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler3D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature ivec4\n"
   "     (parameters\n"
   "       (declare (in) isampler3D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "   (signature uvec4\n"
   "     (parameters\n"
   "       (declare (in) usampler3D sampler)\n"
   "       (declare (in) vec4 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n"
   "\n"
   "))\n"
};

static const char *functions_for_130_fs [] = {
   builtins_130_fs_texture,
   builtins_130_fs_textureProj,
};

/* ARB_texture_rectangle builtins */

static const char *builtins_ARB_texture_rectangle_textures = {
   "((function texture2DRect\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DRect sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   ")\n"
   " (function shadow2DRect\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DRectShadow sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n"
   "\n"
   "))\n"
};

static const char *functions_for_ARB_texture_rectangle [] = {
   builtins_ARB_texture_rectangle_textures,
};

/* EXT_texture_array builtins */

static const char *builtins_EXT_texture_array_textures = {
   "((function texture1DArray\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DArray sampler)\n"
   "       (declare (in) vec2 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   ")\n"
   " (function texture1DArrayLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DArray sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function texture2DArray\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DArray sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n"
   "\n"
   ")\n"
   " (function texture2DArrayLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DArray sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function shadow1DArray\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DArrayShadow sampler)\n"
   "       (declare (in) vec3 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n"
   "\n"
   ")\n"
   " (function shadow1DArrayLod\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DArrayShadow sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float lod) )\n"
   "     ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))\n"
   "\n"
   ")\n"
   " (function shadow2DArray\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DArrayShadow sampler)\n"
   "       (declare (in) vec4 P) )\n"
   "     ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) 1 (swiz w (var_ref P)) ))))\n"
   "\n"
   "))\n"
};

static const char *functions_for_EXT_texture_array [] = {
   builtins_EXT_texture_array_textures,
};

/* EXT_texture_array_fs builtins */

static const char *builtins_EXT_texture_array_fs_textures = {
   "((function texture1DArray\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DArray sampler)\n"
   "       (declare (in) vec2 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function texture2DArray\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler2DArray sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n"
   "\n"
   ")\n"
   " (function shadow1DArray\n"
   "   (signature vec4\n"
   "     (parameters\n"
   "       (declare (in) sampler1DArrayShadow sampler)\n"
   "       (declare (in) vec3 P) \n"
   "       (declare (in) float bias) )\n"
   "     ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))\n"
   "\n"
   "))\n"
};

static const char *functions_for_EXT_texture_array_fs [] = {
   builtins_EXT_texture_array_fs_textures,
};

void
_mesa_glsl_initialize_functions(exec_list *instructions,
			        struct _mesa_glsl_parse_state *state)
{
   if (state->language_version >= 110)
      read_builtins(state, instructions,
                    functions_for_110,
                    sizeof(functions_for_110) / sizeof(const char *));

   if (state->target == fragment_shader && state->language_version >= 110)
      read_builtins(state, instructions,
                    functions_for_110_fs,
                    sizeof(functions_for_110_fs) / sizeof(const char *));

   if (state->target == vertex_shader && state->language_version >= 110)
      read_builtins(state, instructions,
                    functions_for_110_vs,
                    sizeof(functions_for_110_vs) / sizeof(const char *));

   if (state->language_version >= 120)
      read_builtins(state, instructions,
                    functions_for_120,
                    sizeof(functions_for_120) / sizeof(const char *));

   if (state->language_version >= 130)
      read_builtins(state, instructions,
                    functions_for_130,
                    sizeof(functions_for_130) / sizeof(const char *));

   if (state->target == fragment_shader && state->language_version >= 130)
      read_builtins(state, instructions,
                    functions_for_130_fs,
                    sizeof(functions_for_130_fs) / sizeof(const char *));

   if (state->ARB_texture_rectangle_enable)
      read_builtins(state, instructions,
                    functions_for_ARB_texture_rectangle,
                    sizeof(functions_for_ARB_texture_rectangle) / sizeof(const char *));

   if (state->EXT_texture_array_enable)
      read_builtins(state, instructions,
                    functions_for_EXT_texture_array,
                    sizeof(functions_for_EXT_texture_array) / sizeof(const char *));

   if (state->target == fragment_shader && state->EXT_texture_array_enable)
      read_builtins(state, instructions,
                    functions_for_EXT_texture_array_fs,
                    sizeof(functions_for_EXT_texture_array_fs) / sizeof(const char *));

}