// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x18(%rbp)
subq $0x7, %rax
ja 0xf10b
movq -0x18(%rbp), %rax
leaq 0x13314(%rip), %rcx     # 0x220d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0x137a4(%rip), %rsi     # 0x2257c
movb $0x0, %al
callq 0x7170
movq -0x8(%rbp), %rdi
movl $0x16, %esi
callq 0xf180
movq -0x8(%rbp), %rdi
callq 0xf1d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xf8c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0xf220
jmp 0xf10b
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0x13768(%rip), %rsi     # 0x22594
movb $0x0, %al
callq 0x7170
movq -0x8(%rbp), %rdi
movl $0xe, %esi
callq 0xf180
movq -0x8(%rbp), %rdi
callq 0xf1d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xf220
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0xed90
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x40(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xeefc
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0x131bd(%rip), %rsi     # 0x2205d
movb $0x0, %al
callq 0x7170
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xf180
movq -0x8(%rbp), %rdi
callq 0xf1d0
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0x136da(%rip), %rsi     # 0x225a4
movb $0x0, %al
callq 0x7170
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0xed90
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x40(%rax)
jmp 0xf10b
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0x1369c(%rip), %rsi     # 0x225ac
movb $0x0, %al
callq 0x7170
movq -0x8(%rbp), %rdi
movl $0x11, %esi
callq 0xf180
movq -0x8(%rbp), %rdi
callq 0xf1d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xf220
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0xed90
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x40(%rax)
jmp 0xf10b
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0x13641(%rip), %rsi     # 0x225bf
movb $0x0, %al
callq 0x7170
movq -0x8(%rbp), %rdi
movl $0xf, %esi
callq 0xf180
movq -0x8(%rbp), %rdi
callq 0xf1d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0xf220
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0xed90
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x40(%rax)
jmp 0xf10b
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0x135e4(%rip), %rsi     # 0x225d0
movb $0x0, %al
callq 0x7170
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0xf180
movq -0x8(%rbp), %rdi
callq 0xf1d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xf8c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0xed90
jmp 0xf10b
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0x135a2(%rip), %rsi     # 0x225e2
movb $0x0, %al
callq 0x7170
movq -0x8(%rbp), %rdi
movl $0x1a, %esi
callq 0xf180
movq -0x8(%rbp), %rdi
callq 0xf1d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xf130
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xf08b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0xf220
jmp 0xf10b
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0x13562(%rip), %rsi     # 0x225fe
movb $0x0, %al
callq 0x7170
movq -0x8(%rbp), %rdi
movl $0x13, %esi
callq 0xf180
movq -0x8(%rbp), %rdi
callq 0xf1d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xf8c0
jmp 0xf10b
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0x13537(%rip), %rsi     # 0x22613
movb $0x0, %al
callq 0x7170
movq -0x8(%rbp), %rdi
movl $0x14, %esi
callq 0xf180
movq -0x8(%rbp), %rdi
callq 0xf1d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xf220
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xf127
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0xed90
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)