// File: /workspace/github_c_makefile_star2_O3/neosploit[P]compiler/ast_print.c
// Function: ast_definition_print
void ast_definition_print(AstPrintState* state, Definition* definition) {

    switch (definition->tag) {
        case DEFINITION_PROGRAM:
            fprintf(state->fp, "[DEFINITION_PROGRAM]");
            ast_tag_space_print(state, strlen("[DEFINITION_PROGRAM]"));
            ast_indent_space_print(state);

            ast_id_print(state, definition->program.id);

            break;
        case DEFINITION_CONSTANT:
            fprintf(state->fp, "\n[DEFINITION_CONSTANT]");
            ast_tag_space_print(state, strlen("[DEFINITION_CONSTANT]"));
            ast_indent_space_print(state);

            ast_id_print(state, definition->constant.id);
            ast_expression_print(state, definition->constant.expression);

            break;
        case DEFINITION_TYPE:
            fprintf(state->fp, "\n[DEFINITION_TYPE]");
            ast_tag_space_print(state, strlen("[DEFINITION_TYPE]"));
            ast_indent_space_print(state);

            ast_id_print(state, definition->type.id);
            ast_type_print(state, definition->type.type);

            break;
        case DEFINITION_FIELD:
            fprintf(state->fp, "\n[DEFINITION_FIELD]");
            ast_tag_space_print(state, strlen("[DEFINITION_FIELD]"));
            ast_indent_space_print(state);

            ast_id_print(state, definition->field.identifiers);
            ast_type_print(state, definition->field.type);

            break;
        case DEFINITION_VARIABLE:
            fprintf(state->fp, "\n[DEFINITION_VARIABLE]");
            ast_tag_space_print(state, strlen("[DEFINITION_VARIABLE]"));
            ast_indent_space_print(state);

            ast_id_print(state, definition->variable.identifiers);
            ast_type_print(state, definition->variable.type);

            break;
        case DEFINITION_SUBPROGRAM_FORWARD:
            fprintf(state->fp, "\n[DEFINITION_SUBPROGRAM_FORWARD]");
            ast_tag_space_print(state, strlen("[DEFINITION_SUBPROGRAM_FORWARD]"));

            ast_definition_print(state, definition->subprogram_forward.sub_header);

            break;
        case DEFINITION_SUBPROGRAM:
            fprintf(state->fp, "[DEFINITION_SUBPROGRAM]");

            ast_definition_print(state, definition->subprogram.sub_header);

            state->indent++;

            ast_declaration_print(state, definition->subprogram.declarations);
            if (definition->subprogram.subprograms) ast_definition_print(state, definition->subprogram.subprograms);
            if (definition->subprogram.comp_statement) ast_statement_print(state, definition->subprogram.comp_statement);

            state->indent--;

            break;
        case DEFINITION_FUNCTION:
            fprintf(state->fp, "\n[DEFINITION_FUNCTION]");
            ast_tag_space_print(state, strlen("[DEFINITION_FUNCTION]"));
            ast_indent_space_print(state);

            ast_id_print(state, definition->function.id);
            if (definition->function.formal_parameters) ast_definition_print(state, definition->function.formal_parameters);
            if (definition->function.type) ast_type_print(state, definition->function.type);

            break;
        case DEFINITION_PROCEDURE:
            fprintf(state->fp, "\n[DEFINITION_PROCEDURE]");
            ast_tag_space_print(state, strlen("[DEFINITION_PROCEDURE]"));
            ast_indent_space_print(state);

            ast_id_print(state, definition->procedure.id);
            if (definition->procedure.formal_parameters) ast_definition_print(state, definition->procedure.formal_parameters);

            break;
        case DEFINITION_PARAMETER:
            fprintf(state->fp, "[DEFINITION_PARAMETER:");

            fprintf(state->fp, " (PASS: %s)", PassString[definition->parameter.pass]);
            ast_id_print(state, definition->parameter.identifiers);
            ast_type_print(state, definition->parameter.type);

            fprintf(state->fp, "]");
    }

    if (definition->next) ast_definition_print(state, definition->next);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xcede(%rip), %r13      # 0x18dec
leaq 0xd029(%rip), %r12      # 0x18f3e
movl 0x4(%rbx), %eax
cmpq $0x9, %rax
ja 0xc2f1
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movq 0x48(%r14), %rcx
movl $0x14, %esi
movl $0x1, %edx
leaq 0xd007(%rip), %rdi      # 0x18f48
callq 0x7270
movl $0xa, %r15d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r15d
jne 0xbf4c
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %r15
movq 0x48(%r14), %rdi
movq (%r15), %rdx
movq %r12, %rsi
xorl %eax, %eax
callq 0x7180
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0xbf6b
jmp 0xc2f1
movq 0x48(%r14), %rcx
movl $0x16, %esi
movl $0x1, %edx
leaq 0xcffc(%rip), %rdi      # 0x18f9b
callq 0x7270
movl $0x9, %r15d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r15d
jne 0xbfaa
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %r15
movq 0x48(%r14), %rdi
movq (%r15), %rdx
movq %r12, %rsi
xorl %eax, %eax
callq 0x7180
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0xbfc9
jmp 0xc113
movq 0x48(%r14), %rcx
movl $0x16, %esi
movl $0x1, %edx
leaq 0xd01d(%rip), %rdi      # 0x1901a
callq 0x7270
movq 0x48(%r14), %rdi
movl 0x10(%rbx), %eax
leaq 0x14200(%rip), %rcx     # 0x20210
movq (%rcx,%rax,8), %rdx
leaq 0xd016(%rip), %rsi      # 0x19031
xorl %eax, %eax
callq 0x7180
movq 0x18(%rbx), %r15
movq 0x48(%r14), %rdi
movq (%r15), %rdx
movq %r12, %rsi
xorl %eax, %eax
callq 0x7180
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0xc026
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0xc9db
movq 0x48(%r14), %rsi
movl $0x5d, %edi
callq 0x7140
jmp 0xc2f1
movq 0x48(%r14), %rcx
movl $0x12, %esi
movl $0x1, %edx
leaq 0xcf00(%rip), %rdi      # 0x18f74
callq 0x7270
movl $0xd, %r15d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r15d
jne 0xc07f
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %r15
movq 0x48(%r14), %rdi
movq (%r15), %rdx
movq %r12, %rsi
xorl %eax, %eax
callq 0x7180
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0xc09e
jmp 0xc113
movq 0x48(%r14), %rcx
movl $0x13, %esi
movl $0x1, %edx
leaq 0xceb8(%rip), %rdi      # 0x18f87
callq 0x7270
movl $0xc, %r15d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r15d
jne 0xc0da
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %r15
movq 0x48(%r14), %rdi
movq (%r15), %rdx
movq %r12, %rsi
xorl %eax, %eax
callq 0x7180
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0xc0f9
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0xc9db
jmp 0xc2f1
movq 0x48(%r14), %rcx
movl $0x16, %esi
movl $0x1, %edx
leaq 0xceb2(%rip), %rdi      # 0x18feb
callq 0x7270
movl $0x9, %r15d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r15d
jne 0xc144
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %r15
movq 0x48(%r14), %rdi
movq (%r15), %rdx
movq %r12, %rsi
xorl %eax, %eax
callq 0x7180
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0xc163
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0xc18e
movq %r14, %rdi
callq 0xbef3
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
jne 0xc117
jmp 0xc2f1
movq 0x48(%r14), %rcx
movl $0x16, %esi
movl $0x1, %edx
leaq 0xcdac(%rip), %rdi      # 0x18f5d
callq 0x7270
movl $0x9, %r15d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r15d
jne 0xc1bc
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %r15
movq 0x48(%r14), %rdi
movq (%r15), %rdx
movq %r12, %rsi
xorl %eax, %eax
callq 0x7180
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0xc1db
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0xc721
jmp 0xc2f1
movq 0x48(%r14), %rcx
movl $0x20, %esi
movl $0x1, %edx
leaq 0xcd97(%rip), %rdi      # 0x18fb2
callq 0x7270
movq 0x10(%rbx), %rsi
jmp 0xc2e9
movq 0x48(%r14), %rcx
movl $0x17, %esi
movl $0x1, %edx
leaq 0xcd95(%rip), %rdi      # 0x18fd3
callq 0x7270
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xbef3
incl 0x40(%r14)
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0xc30d
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0xc270
movq %r14, %rdi
callq 0xbef3
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0xc281
movq %r14, %rdi
callq 0xc355
decl 0x40(%r14)
jmp 0xc2f1
movq 0x48(%r14), %rcx
movl $0x17, %esi
movl $0x1, %edx
leaq 0xcd66(%rip), %rdi      # 0x19002
callq 0x7270
movl $0x8, %r15d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r15d
jne 0xc2a7
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %r15
movq 0x48(%r14), %rdi
movq (%r15), %rdx
movq %r12, %rsi
xorl %eax, %eax
callq 0x7180
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0xc2c6
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0xc2f1
movq %r14, %rdi
callq 0xbef3
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0xbf15
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq