// File: /workspace/github_cpp_makefile_star2_O2/npaster[P]gmsh_tools/gmshMesh.cpp
// Function: gmsh::Gmesh::readGmesh_MSHformat(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void
Gmesh::readGmesh_MSHformat(const std::string name_mesh)
{
   std::ifstream mesh_file(name_mesh.data());
   if (!mesh_file.is_open()) {
      std::cout << "Unable to open file " << name_mesh << std::endl;
      abort();
   }

   std::cout << "------------------------" << std::endl;
   std::cout << "Reading mesh " << name_mesh << std::endl;
   std::cout << "MSH Format" << std::endl;
   std::cout << "------------------------" << std::endl;

   std::string           file_line;
   size_t                nb_nodes(0), nb_elements(0);
   std::array<double, 3> coor;
   size_t                index(0), type_elem(0), nbinteger_tag(0), loop_nodes(100), loop_elem(100);

   while (!mesh_file.eof() && loop_elem) {
      getline(mesh_file, file_line);
      if ((file_line.find("$Nodes") != std::string::npos) && (loop_nodes)) {
         mesh_file >> nb_nodes;
         std::cout << "Reading nodes (" << nb_nodes << ")" << std::endl;
         for (size_t i = 0; i < nb_nodes; ++i) {
            mesh_file >> index >> coor[0] >> coor[1] >> coor[2];
            Node node(coor, index, 1);
            _nodes.push_back(node);
         }
         assert((_nodes.size() == nb_nodes) && "Problem 1 in mesh reading.");
         loop_nodes = 0;
      }
      if ((file_line.find("$Elements") != std::string::npos) && (loop_elem)) {
         mesh_file >> nb_elements;
         _number_of_elements = nb_elements;
         for (size_t i = 0; i < nb_elements; ++i) {
            std::cout << i << " / " << nb_elements - 1 << std::endl;
            mesh_file >> index >> type_elem >> nbinteger_tag;

            std::vector<size_t> integer_tag(nbinteger_tag);
            for (size_t jtag = 0; jtag < nbinteger_tag; jtag++) {
               mesh_file >> integer_tag[jtag];
            }

            std::vector<size_t> elem_nodes;
            size_t              ind_node = 0;
            if (type_elem == 1) {
               for (size_t inode = 0; inode < 2; inode++) {
                  mesh_file >> ind_node;
                  elem_nodes.push_back(ind_node);
               }
               Edge edge(elem_nodes, i + 1, integer_tag[0], integer_tag[1]);
               _edges.push_back(edge);
            } else if (type_elem == 2) {
               for (size_t inode = 0; inode < 3; inode++) {
                  mesh_file >> ind_node;
                  elem_nodes.push_back(ind_node);
               }
               Triangle tri(elem_nodes, i + 1, integer_tag[0], integer_tag[1]);
               _triangles.push_back(tri);
            } else if (type_elem == 3) {
               for (size_t inode = 0; inode < 4; inode++) {
                  mesh_file >> ind_node;
                  elem_nodes.push_back(ind_node);
               }
               Quadrangle quad(elem_nodes, i + 1, integer_tag[0], integer_tag[1]);
               _quadrangles.push_back(quad);
            } else if (type_elem == 4) {
               for (size_t inode = 0; inode < 4; inode++) {
                  mesh_file >> ind_node;
                  elem_nodes.push_back(ind_node);
               }
               Tetrahedron tetra(elem_nodes, i + 1, integer_tag[0], integer_tag[1]);
               _tetrahedra.push_back(tetra);
            } else if (type_elem == 5) {
               for (size_t inode = 0; inode < 8; inode++) {
                  mesh_file >> ind_node;
                  elem_nodes.push_back(ind_node);
               }
               Hexahedron hexa(elem_nodes, i + 1, integer_tag[0], integer_tag[1]);
               _hexahedra.push_back(hexa);
            } else if (type_elem == 6) {
               for (size_t inode = 0; inode < 6; inode++) {
                  mesh_file >> ind_node;
                  elem_nodes.push_back(ind_node);
               }
               Prism prism(elem_nodes, i + 1, integer_tag[0], integer_tag[1]);
               _prisms.push_back(prism);
            } else if (type_elem == 7) {
               for (size_t inode = 0; inode < 5; inode++) {
                  mesh_file >> ind_node;
                  elem_nodes.push_back(ind_node);
               }
               Pyramid pyra(elem_nodes, i + 1, integer_tag[0], integer_tag[1]);
               _pyramids.push_back(pyra);
            } else {
               std::cout << "Unsupported element" << std::endl;
            }
         }
         loop_elem = 0;
      }
   }

   mesh_file.close();

   if ((_tetrahedra.size() + _hexahedra.size() + _prisms.size() + _pyramids.size()) > 0) {
      _dim_topology = 3;
   } else if ((_triangles.size() + _quadrangles.size()) > 0) {
      _dim_topology = 2;
   } else if (_edges.size() > 0) {
      _dim_topology = 1;
   }

   std::cout << "------------------------" << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x338, %rsp            # imm = 0x338
movq %rsi, %rbx
movq %rdi, %r13
movq (%rsi), %rsi
leaq -0x358(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x22b0
leaq -0x2e0(%rbp), %rdi
callq 0x2050
testb %al, %al
je 0x4e7f
movq 0xf913(%rip), %rdi      # 0x13fd8
leaq 0x899f(%rip), %rsi      # 0xd06b
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
movq 0xf8f8(%rip), %rdi      # 0x13fd8
leaq 0x8fca(%rip), %rsi      # 0xd6b1
callq 0x21c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x20f0
movq 0xf8d2(%rip), %rdi      # 0x13fd8
leaq 0x9288(%rip), %rsi      # 0xd995
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
movq 0xf8b7(%rip), %rdi      # 0x13fd8
leaq 0x8943(%rip), %rsi      # 0xd06b
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
leaq -0x128(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x70(%rbp), %rax
andq $0x0, (%rax)
leaq -0x58(%rbp), %rax
andq $0x0, (%rax)
leaq -0x68(%rbp), %rax
andq $0x0, (%rax)
leaq -0x98(%rbp), %rax
andq $0x0, (%rax)
leaq -0x60(%rbp), %rax
andq $0x0, (%rax)
leaq 0x8(%r13), %rax
movq %rax, -0x110(%rbp)
leaq 0xc8(%r13), %rax
movq %rax, -0x108(%rbp)
leaq 0xb0(%r13), %rax
movq %rax, -0x100(%rbp)
leaq 0x98(%r13), %rax
movq %rax, -0xf8(%rbp)
leaq 0x80(%r13), %rax
movq %rax, -0xf0(%rbp)
leaq 0x68(%r13), %rax
movq %rax, -0xe8(%rbp)
leaq 0x50(%r13), %rax
movq %rax, -0xe0(%rbp)
leaq 0x38(%r13), %rax
movq %rax, -0xd8(%rbp)
movb $0x1, %r15b
pushq $0x64
popq %rax
movq %rax, -0x90(%rbp)
leaq -0x358(%rbp), %r12
notb %r15b
movq -0x358(%rbp), %rax
movq -0x18(%rax), %rax
movb -0x338(%rbp,%rax), %al
shrb %al
orb %r15b, %al
testb $0x1, %al
jne 0x4d66
movq %r12, %rdi
leaq -0x138(%rbp), %rsi
callq 0x2030
leaq -0x138(%rbp), %rbx
movq %rbx, %rdi
leaq 0x9173(%rip), %rsi      # 0xd9a0
xorl %edx, %edx
callq 0x22d0
cmpq $-0x1, %rax
setne %al
cmpq $0x0, -0x90(%rbp)
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x4939
movq %r12, %rdi
leaq -0x70(%rbp), %rsi
callq 0x2120
movq 0xf774(%rip), %rdi      # 0x13fd8
leaq 0x913c(%rip), %rsi      # 0xd9a7
callq 0x21c0
movq -0x70(%rbp), %rsi
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
leaq 0x944f(%rip), %rsi      # 0xdcd5
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
xorl %ebx, %ebx
movq -0x70(%rbp), %rcx
cmpq %rcx, %rbx
jae 0x490e
movq %r12, %rdi
leaq -0x68(%rbp), %rsi
callq 0x2120
movq %rax, %rdi
leaq -0x150(%rbp), %rsi
callq 0x2160
movq %rax, %rdi
leaq -0x148(%rbp), %rsi
callq 0x2160
movq %rax, %rdi
leaq -0x140(%rbp), %rsi
callq 0x2160
movq %r13, %r14
movq -0x68(%rbp), %rdx
leaq -0xd0(%rbp), %r13
movq %r13, %rdi
leaq -0x150(%rbp), %rsi
pushq $0x1
popq %rcx
callq 0x24c2
movq -0x110(%rbp), %rdi
movq %r13, %rsi
callq 0x8354
incq %rbx
movq %r14, %r13
jmp 0x4895
movq 0x10(%r13), %rax
subq 0x8(%r13), %rax
cqto
pushq $0x28
popq %rsi
idivq %rsi
cmpq %rcx, %rax
jne 0x4e60
movq $0x0, -0x90(%rbp)
leaq -0x138(%rbp), %rbx
movq %rbx, %rdi
leaq 0x90ad(%rip), %rsi      # 0xd9f0
xorl %edx, %edx
callq 0x22d0
cmpq $-0x1, %rax
je 0x47ee
movq %r12, %rdi
leaq -0x58(%rbp), %rsi
callq 0x2120
movq -0x58(%rbp), %rax
movq %rax, 0xe0(%r13)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rsi
cmpq %rax, %rsi
jae 0x4d5e
movq 0xf651(%rip), %rdi      # 0x13fd8
callq 0x2170
movq %rax, %rdi
leaq 0x9064(%rip), %rsi      # 0xd9fa
callq 0x21c0
movq -0x58(%rbp), %rsi
decq %rsi
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20f0
movq %r12, %rdi
leaq -0x68(%rbp), %rsi
callq 0x2120
movq %rax, %rdi
leaq -0x98(%rbp), %rsi
callq 0x2120
movq %rax, %rdi
leaq -0x60(%rbp), %rsi
callq 0x2120
movq -0x60(%rbp), %rsi
leaq -0x88(%rbp), %rdi
leaq -0xd0(%rbp), %rdx
callq 0x8302
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpq -0x60(%rbp), %r15
jae 0x4a16
movq -0x88(%rbp), %rsi
addq %rbx, %rsi
movq %r12, %rdi
callq 0x2120
incq %r15
addq $0x8, %rbx
jmp 0x49f5
andq $0x0, -0x40(%rbp)
andq $0x0, -0x118(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq -0x98(%rbp), %rax
decq %rax
cmpq $0x6, %rax
ja 0x4aed
leaq 0x8c3b(%rip), %rcx      # 0xd680
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
leaq -0x118(%rbp), %r14
jmpq *%rax
pushq $0x2
popq %rbx
subq $0x1, %rbx
jb 0x4c43
movq %r12, %rdi
movq %r14, %rsi
callq 0x2120
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x84b4
jmp 0x4a58
pushq $0x8
popq %rbx
subq $0x1, %rbx
jb 0x4b83
movq %r12, %rdi
movq %r14, %rsi
callq 0x2120
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x84b4
jmp 0x4a7e
pushq $0x4
popq %rbx
subq $0x1, %rbx
jb 0x4bc3
movq %r12, %rdi
movq %r14, %rsi
callq 0x2120
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x84b4
jmp 0x4aa4
pushq $0x4
popq %rbx
subq $0x1, %rbx
jb 0x4c03
movq %r12, %rdi
movq %r14, %rsi
callq 0x2120
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x84b4
jmp 0x4aca
movq 0xf4e4(%rip), %rdi      # 0x13fd8
leaq 0x8f03(%rip), %rsi      # 0xd9fe
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
incq -0x30(%rbp)
jmp 0x4d40
pushq $0x3
popq %rbx
subq $0x1, %rbx
jb 0x4c83
movq %r12, %rdi
movq %r14, %rsi
callq 0x2120
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x84b4
jmp 0x4b14
pushq $0x6
popq %rbx
subq $0x1, %rbx
jb 0x4cc0
movq %r12, %rdi
movq %r14, %rsi
callq 0x2120
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x84b4
jmp 0x4b3a
pushq $0x5
popq %rbx
subq $0x1, %rbx
jb 0x4cfd
movq %r12, %rdi
movq %r14, %rsi
callq 0x2120
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x84b4
jmp 0x4b60
movq -0x30(%rbp), %rdx
incq %rdx
movq -0x88(%rbp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %r8
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
movq %rdx, -0x30(%rbp)
callq 0x2bb2
movq -0xf8(%rbp), %rdi
movq %rbx, %rsi
callq 0x8478
jmp 0x4d38
movq -0x30(%rbp), %rdx
incq %rdx
movq -0x88(%rbp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %r8
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
movq %rdx, -0x30(%rbp)
callq 0x2aa2
movq -0xe8(%rbp), %rdi
movq %rbx, %rsi
callq 0x843c
jmp 0x4d38
movq -0x30(%rbp), %rdx
incq %rdx
movq -0x88(%rbp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %r8
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
movq %rdx, -0x30(%rbp)
callq 0x2b2a
movq -0xf0(%rbp), %rdi
movq %rbx, %rsi
callq 0x8400
jmp 0x4d38
movq -0x30(%rbp), %rdx
incq %rdx
movq -0x88(%rbp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %r8
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
movq %rdx, -0x30(%rbp)
callq 0x2992
movq -0xd8(%rbp), %rdi
movq %rbx, %rsi
callq 0x8388
jmp 0x4d38
movq -0x30(%rbp), %rdx
incq %rdx
movq -0x88(%rbp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %r8
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
movq %rdx, -0x30(%rbp)
callq 0x2a1a
movq -0xe0(%rbp), %rdi
movq %rbx, %rsi
callq 0x83c4
jmp 0x4d38
movq -0x30(%rbp), %rdx
incq %rdx
movq -0x88(%rbp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %r8
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
movq %rdx, -0x30(%rbp)
callq 0x2c3a
movq -0x100(%rbp), %rdi
movq %rbx, %rsi
callq 0x84dc
jmp 0x4d38
movq -0x30(%rbp), %rdx
incq %rdx
movq -0x88(%rbp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %r8
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
movq %rdx, -0x30(%rbp)
callq 0x2cc2
movq -0x108(%rbp), %rdi
movq %rbx, %rsi
callq 0x8518
movq %rbx, %rdi
callq 0x2e88
leaq -0x50(%rbp), %rdi
callq 0x2e88
leaq -0x88(%rbp), %rdi
callq 0x2e88
movq -0x58(%rbp), %rax
jmp 0x4973
xorl %r15d, %r15d
jmp 0x47eb
leaq -0x358(%rbp), %rdi
callq 0x2040
movq 0x88(%r13), %rax
movq 0xa0(%r13), %rcx
subq 0x80(%r13), %rax
pushq $0x38
popq %rdi
cqto
idivq %rdi
movq %rax, %rsi
subq 0x98(%r13), %rcx
movq %rcx, %rax
cqto
idivq %rdi
movq %rax, %rcx
addq %rsi, %rcx
movq 0xb8(%r13), %rax
subq 0xb0(%r13), %rax
cqto
idivq %rdi
movq %rax, %rsi
addq %rcx, %rsi
movq 0xd0(%r13), %rax
subq 0xc8(%r13), %rax
pushq $-0x38
popq %r8
cqto
idivq %r8
cmpq %rax, %rsi
jne 0x4e10
movq 0x58(%r13), %rax
subq 0x50(%r13), %rax
movq 0x70(%r13), %rcx
cqto
idivq %rdi
movq %rax, %rsi
subq 0x68(%r13), %rcx
movq %rcx, %rax
cqto
idivq %r8
cmpq %rax, %rsi
jne 0x4e14
movq 0x40(%r13), %rax
cmpq 0x38(%r13), %rax
pushq $0x1
popq %rax
jne 0x4e17
jmp 0x4e1b
pushq $0x3
jmp 0x4e16
pushq $0x2
popq %rax
movq %rax, (%r13)
movq 0xf1b6(%rip), %rdi      # 0x13fd8
leaq 0x8242(%rip), %rsi      # 0xd06b
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
leaq -0x138(%rbp), %rdi
callq 0x20d0
leaq -0x358(%rbp), %rdi
callq 0x2060
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8881(%rip), %rdi      # 0xd6e8
leaq 0x88b6(%rip), %rsi      # 0xd724
leaq 0x8b42(%rip), %rcx      # 0xd9b7
movl $0x17e, %edx            # imm = 0x17E
callq 0x2150
movq 0xf152(%rip), %rdi      # 0x13fd8
leaq 0x880f(%rip), %rsi      # 0xd69c
callq 0x21c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x20f0
callq 0x2140
jmp 0x4f13
jmp 0x4f13
jmp 0x4ef2
jmp 0x4ec8
jmp 0x4ec8
jmp 0x4ef2
jmp 0x4ef2
jmp 0x4ef2
jmp 0x4ef2
jmp 0x4ec8
jmp 0x4ef2
jmp 0x4ec8
jmp 0x4ef2
jmp 0x4ec8
jmp 0x4ec8
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x2e88
jmp 0x4ef5
jmp 0x4ef2
movq %rax, %rbx
jmp 0x4f22
jmp 0x4f13
jmp 0x4f13
jmp 0x4f13
jmp 0x4ef2
jmp 0x4ef2
jmp 0x4ef2
jmp 0x4ef2
jmp 0x4ef2
jmp 0x4ef2
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2e88
jmp 0x4f03
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x2e88
jmp 0x4f16
jmp 0x4f13
movq %rax, %rbx
leaq -0x138(%rbp), %rdi
callq 0x20d0
leaq -0x358(%rbp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x22a0