// File: /workspace/github_c_makefile_star2_O3/neosploit[P]compiler/ast_print.c
// Function: ast_statement_print
void ast_statement_print(AstPrintState* state, Statement* statement) {

    switch (statement->tag) {
        case STATEMENT_ASSIGNMENT:
            fprintf(state->fp, "\n[STATEMENT_ASSIGNMENT]");
            ast_tag_space_print(state, strlen("[STATEMENT_ASSIGNMENT]"));
            ast_indent_space_print(state);

            ast_variable_print(state, statement->assignment.variable);
            ast_expression_print(state, statement->assignment.expression);

            break;
        case STATEMENT_IF:
            fprintf(state->fp, "\n[STATEMENT_IF]");
            ast_tag_space_print(state, strlen("[STATEMENT_IF]"));
            ast_indent_space_print(state);

            ast_expression_print(state, statement->if_.expression);

            state->indent++;
            ast_statement_print(state, statement->if_.if_statement);
            state->indent--;

            if (statement->if_.else_statement) {
                fprintf(state->fp, "\n");
                ast_tag_space_print(state, strlen(""));
                ast_indent_space_print(state);
                fprintf(state->fp, " (ELSE)");
                
                state->indent++;
                ast_statement_print(state, statement->if_.else_statement);
                state->indent--;
            }

            break;
        case STATEMENT_WHILE:
            fprintf(state->fp, "\n[STATEMENT_WHILE]");
            ast_tag_space_print(state, strlen("[STATEMENT_WHILE]"));
            ast_indent_space_print(state);

            ast_expression_print(state, statement->while_.expression);

            state->indent++;
            ast_statement_print(state, statement->while_.statement);
            state->indent--;

            break;
        case STATEMENT_FOR:
            fprintf(state->fp, "\n[STATEMENT_FOR]");
            ast_tag_space_print(state, strlen("[STATEMENT_FOR]"));
            ast_indent_space_print(state);

            ast_expression_print(state, statement->for_.iter_space);

            state->indent++;
            ast_statement_print(state, statement->for_.statement);
            state->indent--;

            break;
        case STATEMENT_WITH:
            fprintf(state->fp, "\n[STATEMENT_WITH]");
            ast_tag_space_print(state, strlen("[STATEMENT_WITH]"));
            ast_indent_space_print(state);

            ast_variable_print(state, statement->with.variable);
            ast_statement_print(state, statement->with.statement);

            break;
        case STATEMENT_PROCEDURE_CALL:
            fprintf(state->fp, "\n[STATEMENT_PROCEDURE_CALL]");
            ast_tag_space_print(state, strlen("[STATEMENT_PROCEDURE_CALL]"));
            ast_indent_space_print(state);

            ast_id_print(state, statement->procedure_call.id);
            if (statement->procedure_call.expressions) ast_expression_print(state, statement->procedure_call.expressions);

            break;
        case STATEMENT_IO_READ:
            fprintf(state->fp, "\n[STATEMENT_IO_READ]");
            ast_tag_space_print(state, strlen("[STATEMENT_IO_READ]"));
            ast_indent_space_print(state);

            ast_variable_print(state, statement->io_read.read_list);

            break;
        case STATEMENT_IO_WRITE:
            fprintf(state->fp, "\n[STATEMENT_IO_WRITE]");
            ast_tag_space_print(state, strlen("[STATEMENT_IO_WRITE]"));
            ast_indent_space_print(state);

            ast_expression_print(state, statement->io_write.write_list);
    }

    if (statement->next) ast_statement_print(state, statement->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 0xcaa4(%rip), %r12      # 0x18e14
leaq 0xcbc7(%rip), %r15      # 0x18f3e
movl 0x4(%rbx), %eax
cmpq $0x7, %rax
ja 0xc695
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq 0x48(%r14), %rcx
movl $0x17, %esi
movl $0x1, %edx
leaq 0xcf16(%rip), %rdi      # 0x192b8
callq 0x7270
movl $0x8, %r13d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r13d
jne 0xc3ad
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xcc05
movq 0x18(%rbx), %rsi
jmp 0xc644
movq 0x48(%r14), %rcx
movl $0x11, %esi
movl $0x1, %edx
leaq 0xcf1a(%rip), %rdi      # 0x1930c
callq 0x7270
movl $0xe, %r13d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r13d
jne 0xc3fd
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xcc05
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0xc355
jmp 0xc695
movq 0x48(%r14), %rcx
movl $0x12, %esi
movl $0x1, %edx
leaq 0xce9e(%rip), %rdi      # 0x192e8
callq 0x7270
movl $0xd, %r13d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r13d
jne 0xc455
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xc721
incl 0x40(%r14)
movq 0x18(%rbx), %rsi
jmp 0xc5d0
movq 0x48(%r14), %rcx
movl $0x10, %esi
movl $0x1, %edx
leaq 0xce5d(%rip), %rdi      # 0x192fb
callq 0x7270
movl $0xf, %r13d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r13d
jne 0xc4a9
movq %r14, %rdi
callq 0xc6ed
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0xc721
jmp 0xc5c8
movq 0x48(%r14), %rcx
movl $0x15, %esi
movl $0x1, %edx
leaq 0xce65(%rip), %rdi      # 0x1934f
callq 0x7270
movl $0xa, %r13d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r13d
jne 0xc4f5
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %rsi
jmp 0xc644
movq 0x48(%r14), %rcx
movl $0xf, %esi
movl $0x1, %edx
leaq 0xcda2(%rip), %rdi      # 0x192d0
callq 0x7270
movl $0x10, %r13d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r13d
jne 0xc539
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xc721
incl 0x40(%r14)
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0xc355
decl 0x40(%r14)
cmpq $0x0, 0x20(%rbx)
je 0xc695
movq 0x48(%r14), %rsi
movl $0xa, %edi
callq 0x7140
movl $0x1e, %r13d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r13d
jne 0xc593
movq %r14, %rdi
callq 0xc6ed
movq 0x48(%r14), %rcx
movl $0x7, %esi
movl $0x1, %edx
leaq 0xcd1d(%rip), %rdi      # 0x192e0
callq 0x7270
incl 0x40(%r14)
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0xc355
decl 0x40(%r14)
jmp 0xc695
movq 0x48(%r14), %rcx
movl $0x1b, %esi
movl $0x1, %edx
leaq 0xcd28(%rip), %rdi      # 0x1931e
callq 0x7270
movl $0x4, %r13d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r13d
jne 0xc601
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %r13
movq 0x48(%r14), %rdi
movq (%r13), %rdx
movq %r15, %rsi
xorl %eax, %eax
callq 0x7180
movq 0x8(%r13), %r13
testq %r13, %r13
jne 0xc620
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0xc695
movq %r14, %rdi
callq 0xc721
jmp 0xc695
movq 0x48(%r14), %rcx
movl $0x14, %esi
movl $0x1, %edx
leaq 0xccd7(%rip), %rdi      # 0x1933a
callq 0x7270
movl $0xb, %r13d
movq 0x48(%r14), %rsi
movl $0x20, %edi
callq 0x7140
decl %r13d
jne 0xc66e
movq %r14, %rdi
callq 0xc6ed
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xcc05
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0xc377
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq