// File: /workspace/github_cpp_makefile_star2_O3/sighingnow[P]compile-pascal/pl0_tac_gen.cpp
// Function: pl0_tac_write_stmt(pl0_ast_write_stmt const*)
void pl0_tac_write_stmt(pl0_ast_write_stmt const *stmt) {
    cout << __func__;
    switch (stmt->t) {
        case pl0_ast_write_stmt::type_t::ONLY_STRING:
            irb.emit("write_s", new Value(stmt->str->val, "string"), new Value(irb.makelabel(), "integer"));
            break;
        case pl0_ast_write_stmt::type_t::ONLY_EXPR:
            irb.emit("write_e", pl0_tac_expr(stmt->expr).first);
            break;
        case pl0_ast_write_stmt::type_t::STRING_AND_EXPR:
            irb.emit("write_s", new Value(stmt->str->val, "string"), new Value(irb.makelabel(), "integer"));
            irb.emit("write_e", pl0_tac_expr(stmt->expr).first);
            break;
        default: cout << "UNIMPLEMENT WRITE TYPE" << endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rdi, %rbx
movq 0x4b928(%rip), %r14     # 0xb9fd8
leaq 0x24e58(%rip), %rsi     # 0x9350f
movq %r14, %rdi
xorl %edx, %edx
callq 0x52e0
movl 0x14(%rbx), %eax
cmpl $0x2, %eax
je 0x6e8fc
cmpl $0x1, %eax
je 0x6e86f
testl %eax, %eax
jne 0x6eb19
leaq 0x168(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x244c4(%rip), %rsi     # 0x92bb6
leaq 0x244c4(%rip), %rdx     # 0x92bbd
leaq 0x158(%rsp), %rdi
callq 0x253d0
movl $0x48, %edi
callq 0x5250
movq %rax, %r13
movq 0x18(%rbx), %rax
leaq 0xa8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
movq %r13, 0x8(%rsp)
callq 0x351dc
leaq 0x88(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x24b25(%rip), %rsi     # 0x93278
leaq 0x24b24(%rip), %rdx     # 0x9327e
leaq 0x78(%rsp), %rdi
callq 0x253d0
movb $0x1, %bl
leaq 0x98(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movq %r13, %rdi
callq 0x7653e
xorl %ebx, %ebx
movl $0x48, %edi
callq 0x5250
movq %rax, %r15
leaq 0x4ce17(%rip), %rdi     # 0xbb5a8
callq 0x632aa
movl %eax, %ebx
leaq 0xe8(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x22964(%rip), %rsi     # 0x9110f
leaq 0x22964(%rip), %rdx     # 0x91116
leaq 0xd8(%rsp), %rdi
callq 0x253d0
movb $0x1, %bpl
leaq 0xd8(%rsp), %rdx
movq %r15, %rdi
movl %ebx, %esi
callq 0x75d42
xorl %ebp, %ebp
leaq 0x4cdcb(%rip), %rdi     # 0xbb5a8
leaq 0x158(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x75c2c
movq 0xd8(%rsp), %rdi
cmpq %r13, %rdi
je 0x6e812
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x6e834
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x6e851
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x158(%rsp), %rdi
cmpq %r12, %rdi
je 0x6eb07
movq 0x168(%rsp), %rsi
jmp 0x6eaff
leaq 0x148(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x24468(%rip), %rsi     # 0x92ceb
leaq 0x24468(%rip), %rdx     # 0x92cf2
leaq 0x138(%rsp), %rdi
callq 0x253d0
movq 0x20(%rbx), %rsi
leaq 0x30(%rsp), %rdi
callq 0x71f89
movq 0x30(%rsp), %rdx
leaq 0x4ccf7(%rip), %rdi     # 0xbb5a8
leaq 0x138(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x75c2c
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e8de
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x138(%rsp), %rdi
cmpq %r12, %rdi
je 0x6eb07
movq 0x148(%rsp), %rsi
jmp 0x6eaff
leaq 0x128(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x242a6(%rip), %rsi     # 0x92bb6
leaq 0x242a6(%rip), %rdx     # 0x92bbd
leaq 0x118(%rsp), %rdi
callq 0x253d0
movl $0x48, %edi
callq 0x5250
movq %rax, %r14
movq 0x18(%rbx), %rax
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
movq %r14, 0x8(%rsp)
callq 0x351dc
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x24910(%rip), %rsi     # 0x93278
leaq 0x2490f(%rip), %rdx     # 0x9327e
leaq 0x58(%rsp), %rdi
callq 0x253d0
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x58(%rsp), %rdx
movq %r14, %rdi
callq 0x7653e
xorl %ebp, %ebp
movl $0x48, %edi
callq 0x5250
movq %rax, %r15
leaq 0x4cc04(%rip), %rdi     # 0xbb5a8
callq 0x632aa
movl %eax, %ebp
leaq 0xc8(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x22751(%rip), %rsi     # 0x9110f
leaq 0x22751(%rip), %rdx     # 0x91116
leaq 0xb8(%rsp), %rdi
callq 0x253d0
movb $0x1, %r14b
leaq 0xb8(%rsp), %rdx
movq %r15, %rdi
movl %ebp, %esi
callq 0x75d42
xorl %r14d, %r14d
leaq 0x4cbb7(%rip), %rdi     # 0xbb5a8
leaq 0x118(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x75c2c
movq 0xb8(%rsp), %rdi
cmpq %r13, %rdi
je 0x6ea26
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %r14
je 0x6ea47
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x6ea5e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x118(%rsp), %rdi
cmpq %r12, %rdi
je 0x6ea7b
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x5260
leaq 0x108(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2425c(%rip), %rsi     # 0x92ceb
leaq 0x2425c(%rip), %rdx     # 0x92cf2
leaq 0xf8(%rsp), %rdi
callq 0x253d0
movq 0x20(%rbx), %rsi
leaq 0x30(%rsp), %rdi
callq 0x71f89
movq 0x30(%rsp), %rdx
leaq 0x4caeb(%rip), %rdi     # 0xbb5a8
leaq 0xf8(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x75c2c
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6eaea
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0xf8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6eb07
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x5260
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2409e(%rip), %rsi     # 0x92bbe
movl $0x16, %edx
movq %r14, %rdi
callq 0x52e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5240
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5190
movq %rax, (%rsp)
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6eb8a
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x6eb8a
movq %rax, (%rsp)
movq 0xf8(%rsp), %rdi
jmp 0x6ed77
jmp 0x6eb9b
jmp 0x6eba4
movq %rax, (%rsp)
jmp 0x6ec77
movq %rax, (%rsp)
jmp 0x6ecae
movq %rax, (%rsp)
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x6ed06
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x6ed06
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x6ed60
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x6ed60
movq %rax, (%rsp)
jmp 0x6ed06
movq %rax, (%rsp)
jmp 0x6ed60
movq %rax, (%rsp)
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6ec44
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x6ec44
movq %rax, (%rsp)
jmp 0x6ed15
movq %rax, (%rsp)
jmp 0x6ed6f
movq %rax, (%rsp)
movq 0x138(%rsp), %rdi
jmp 0x6ed77
movq %rax, (%rsp)
movq 0xd8(%rsp), %rdi
cmpq %r13, %rdi
je 0x6ec72
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5260
testb %bpl, %bpl
je 0x6ec84
movl $0x48, %esi
movq %r15, %rdi
callq 0x5260
xorl %ebx, %ebx
jmp 0x6ecc3
movq %rax, (%rsp)
movq 0xb8(%rsp), %rdi
cmpq %r13, %rdi
je 0x6eca9
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x5260
testb %r14b, %r14b
je 0x6ecbb
movl $0x48, %esi
movq %r15, %rdi
callq 0x5260
xorl %ebp, %ebp
jmp 0x6ed23
movq %rax, (%rsp)
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x6ece5
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x6ed02
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5260
testb %bl, %bl
je 0x6ed15
movl $0x48, %esi
movq 0x8(%rsp), %rdi
callq 0x5260
movq 0x158(%rsp), %rdi
jmp 0x6ed77
movq %rax, (%rsp)
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x6ed3f
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x6ed5b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5260
testb %bpl, %bpl
je 0x6ed6f
movl $0x48, %esi
movq 0x8(%rsp), %rdi
callq 0x5260
movq 0x118(%rsp), %rdi
cmpq %r12, %rdi
je 0x6ed88
movq (%r12), %rsi
incq %rsi
callq 0x5260
movq (%rsp), %rdi
callq 0x53d0