/* Generated by zi2c from enums.zi. */
#define ZIRAN_ENUMS_H_SOURCE 1
#include <stdint.h>
#include <stdio.h>
#include "enums.h"

int32_t
enums_Corners(Shape shape)
{
    switch (shape) {
    case Shape_CIRCLE:
        {
            return 0;
        }
    case Shape_SQUARE:
        {
            return 4;
        }
    case Shape_TRIANGLE:
        {
            return 3;
        }
    }
    return -1;
}

void
enums_main(void)
{
    int32_t value_0 = 0;
    {
        Shape shape = (Shape)(Shape_CIRCLE);
        switch (shape) {
        case Shape_CIRCLE:
            {
                value_0 = 0;
                goto value_1;
            }
        case Shape_SQUARE:
            {
                value_0 = 4;
                goto value_1;
            }
        case Shape_TRIANGLE:
            {
                value_0 = 3;
                goto value_1;
            }
        }
        value_0 = -1;
    value_1: ;
    }
    printf("a circle has %lld corners\n", (long long)value_0);
    int32_t value_2 = 0;
    {
        Shape shape = (Shape)(Shape_SQUARE);
        switch (shape) {
        case Shape_CIRCLE:
            {
                value_2 = 0;
                goto value_3;
            }
        case Shape_SQUARE:
            {
                value_2 = 4;
                goto value_3;
            }
        case Shape_TRIANGLE:
            {
                value_2 = 3;
                goto value_3;
            }
        }
        value_2 = -1;
    value_3: ;
    }
    printf("a square has %lld corners\n", (long long)value_2);
    int32_t value_4 = 0;
    {
        Shape shape = (Shape)(Shape_TRIANGLE);
        switch (shape) {
        case Shape_CIRCLE:
            {
                value_4 = 0;
                goto value_5;
            }
        case Shape_SQUARE:
            {
                value_4 = 4;
                goto value_5;
            }
        case Shape_TRIANGLE:
            {
                value_4 = 3;
                goto value_5;
            }
        }
        value_4 = -1;
    value_5: ;
    }
    printf("a triangle has %lld corners\n", (long long)value_4);
}
