// File: AgathokakologicalBit[P]wit/src/code_generation/generators/javascript/generator.cpp
// Function: akbit::system::code_generation::js::(anonymous namespace)::cg_visit_module[abi:cxx11](std::shared_ptr<akbit::system::Node>, akbit::system::Node::module_t&, akbit::system::code_generation::js::Settings)
std::string cg_visit_module(std::shared_ptr<Node>, Node::module_t &val, Settings s)
    {
      std::string res = "/* auto-generated code */\n";

      // TODO: Handle errors
      std::fstream js_bootstrap_file;
      // TODO: Place it somewhere else
      js_bootstrap_file.open("src/code_generation/generators/javascript/bootstrap.js", std::ios::in);
      if (js_bootstrap_file)
      {
        std::string line;
        while (std::getline(js_bootstrap_file, line))
          res += line + '\n';

        js_bootstrap_file.close();
      } else { std::cerr << "Failed to read the boostrap.js file!" << std::endl; }

      for (auto d : val.data)
        res += cg_visit(d, s) + ";\n";

      return res;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x380, %rsp            # imm = 0x380
movq %rdi, -0x348(%rbp)
movb %r8b, %al
movq %rdi, %r8
movq %r8, -0x350(%rbp)
movq %rdi, -0x8(%rbp)
movq %rcx, -0x28(%rbp)
movb %al, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x10(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movb $0x0, -0x39(%rbp)
leaq -0x3a(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x4570
movq -0x348(%rbp), %rdi
movq -0x340(%rbp), %rdx
leaq 0x4e47(%rip), %rsi      # 0x36bc0
callq 0x9e70
jmp 0x31d80
leaq -0x3a(%rbp), %rdi
callq 0x4370
leaq -0x260(%rbp), %rdi
callq 0x43d0
jmp 0x31d97
leaq 0x4e3d(%rip), %rsi      # 0x36bdb
leaq -0x260(%rbp), %rdi
movl $0x8, %edx
callq 0x42c0
jmp 0x31db1
movq -0x260(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x260(%rbp,%rax), %rdi
callq 0x4400
movb %al, -0x351(%rbp)
jmp 0x31dd1
movb -0x351(%rbp), %al
testb $0x1, %al
jne 0x31de0
jmp 0x31f06
leaq -0x280(%rbp), %rdi
callq 0x4450
leaq -0x260(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x40a0
movq %rax, -0x360(%rbp)
jmp 0x31e08
movq -0x360(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4400
movb %al, -0x361(%rbp)
jmp 0x31e26
movb -0x361(%rbp), %al
testb $0x1, %al
jne 0x31e35
jmp 0x31ed9
leaq -0x2a0(%rbp), %rdi
leaq -0x280(%rbp), %rsi
movl $0xa, %edx
callq 0x34d60
jmp 0x31e4f
movq -0x348(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x4410
jmp 0x31e64
leaq -0x2a0(%rbp), %rdi
callq 0x4210
jmp 0x31dec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x3a(%rbp), %rdi
callq 0x4370
jmp 0x3212c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x32120
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x320f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x31ef5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x4210
jmp 0x31ef5
leaq -0x260(%rbp), %rdi
callq 0x4060
jmp 0x31ee7
leaq -0x280(%rbp), %rdi
callq 0x4210
jmp 0x31f39
leaq -0x280(%rbp), %rdi
callq 0x4210
jmp 0x320f6
movq 0x230e3(%rip), %rdi     # 0x54ff0
leaq 0x4cfe(%rip), %rsi      # 0x36c12
callq 0x42e0
movq %rax, -0x370(%rbp)
jmp 0x31f22
movq -0x370(%rbp), %rdi
movq 0x23078(%rip), %rsi     # 0x54fa8
callq 0x4330
jmp 0x31f37
jmp 0x31f39
movq -0x38(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq -0x2a8(%rbp), %rdi
callq 0x18160
movq %rax, -0x2b0(%rbp)
movq -0x2a8(%rbp), %rdi
callq 0x17fa0
movq %rax, -0x2b8(%rbp)
leaq -0x2b0(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x22a70
testb $0x1, %al
jne 0x31f86
jmp 0x320de
leaq -0x2b0(%rbp), %rdi
callq 0x184a0
movq %rax, %rsi
leaq -0x2c8(%rbp), %rdi
movq %rdi, -0x380(%rbp)
callq 0x9b20
movq -0x380(%rbp), %rsi
leaq -0x318(%rbp), %rdi
movq %rdi, -0x378(%rbp)
callq 0x9b20
movq -0x378(%rbp), %rsi
movl -0x10(%rbp), %eax
movl %eax, -0x320(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x328(%rbp)
movl -0x320(%rbp), %eax
movl %eax, -0x330(%rbp)
movq -0x328(%rbp), %rax
movq %rax, -0x338(%rbp)
movq -0x338(%rbp), %rdx
movl -0x330(%rbp), %ecx
leaq -0x308(%rbp), %rdi
callq 0x31180
jmp 0x32012
leaq 0x4c1e(%rip), %rdx      # 0x36c37
leaq -0x2e8(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x11a50
jmp 0x3202e
movq -0x348(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x4410
jmp 0x32043
leaq -0x2e8(%rbp), %rdi
callq 0x4210
leaq -0x308(%rbp), %rdi
callq 0x4210
leaq -0x318(%rbp), %rdi
callq 0x9b50
leaq -0x2c8(%rbp), %rdi
callq 0x9b50
leaq -0x2b0(%rbp), %rdi
callq 0x22ab0
jmp 0x31f6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x320c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x320b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x4210
leaq -0x308(%rbp), %rdi
callq 0x4210
leaq -0x318(%rbp), %rdi
callq 0x9b50
leaq -0x2c8(%rbp), %rdi
callq 0x9b50
jmp 0x320f6
movb $0x1, -0x39(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x40b0
testb $0x1, -0x39(%rbp)
jne 0x32110
jmp 0x32104
leaq -0x260(%rbp), %rdi
callq 0x40b0
jmp 0x32120
movq -0x348(%rbp), %rdi
callq 0x4210
movq -0x350(%rbp), %rax
addq $0x380, %rsp            # imm = 0x380
popq %rbp
retq
movq -0x348(%rbp), %rdi
callq 0x4210
movq -0x48(%rbp), %rdi
callq 0x4560
nopw %cs:(%rax,%rax)