/* =====================================
 * Generated by Mod-c 0.26.5
 * HEADER codegen_dbc MODULE
 * ===================================== */

#ifndef MODC_MODULE_codegen_dbc_H
#define MODC_MODULE_codegen_dbc_H

#include <stdint.h>
#include <stdbool.h>
#include <assert.h>

#define nil ((void *)0)
#define NIL nil
typedef uint8_t byte;
typedef const char* string;
typedef int integer;
typedef unsigned int cardinal;
typedef float real;

/**
 * Mod-c
 * By M. Scott Reynolds
 * Date 18 April 2026
 *
 * codegen_dbc.c - Desing By Contract routines.	
 */

/* === IMPORT === */
#include "stddef.h"

/* === IMPORT === */
#include "dynbuf.h"

/* === IMPORT === */
#include "node.h"

/* === IMPORT === */
#include "codegen_common.h"

/* === TYPE EXPORT === */
typedef Node* pNode;

/**
 * Generate REQUIRE clauses
 */

/* === PROC/FUNC EXPORT === */
void codegen_dbc_emit_requires(const Node* n, CodegenContext ctx);

/**
 * Generate ENSURE clauses
 */

/* === PROC/FUNC EXPORT === */
void codegen_dbc_emit_ensures(const Node* n, CodegenContext ctx);

/**
 * Emit Ensures to Func
 */

/* === PROC/FUNC EXPORT === */
void codegen_dbc_emit_ensures_to_func(CodegenContext ctx);

/**
 * Emit INVARIANT checks for a loop node.
 * Called at the "invariant point" inside the generated loop (before body for most loops).
 */

/* === PROC/FUNC EXPORT === */
void codegen_dbc_emit_invariants(const Node* n, CodegenContext ctx);

/**
 * Emit invariants for the loop being exited (called before BREAK/CONTINUE).
 * Mirros the structure of the defers_to_loop wlaker.
 */

/* === PROC/FUNC EXPORT === */
void codegen_dbc_emit_invariants_to_loop(CodegenContext ctx);

void codegen_dbc(void);

#endif /* MODC_MODULE_codegen_dbc_H */
