// File: /workspace/github_cpp_makefile_star2_O3/npaster[P]gmsh_tools/main.cc
// Function: main
int main(int argc, char** argv)
{
  if (argc < 2)
    {
      cout << "Please, enter the name of your mesh .. " << endl;
      return 0;
    }

  gmsh::Gmesh mesh;
  const string name_mesh(argv[1]);
  mesh.readGmesh(name_mesh);

  mesh.getInfo();
  cout << endl;

  mesh.writeGmesh("test.msh", 2);

  gmsh::Gmesh mesh2(mesh);

  mesh2.convertInDiscontinuousMesh();

  std::vector<gmsh::Node> newNodes;

  for(size_t i=0; i< mesh2.getNumberofNodes(); i++){
     std::array<double, 3> newcoor = {{1.0*(rand() % 10), 1.0*(rand() % 10), 0.0}};
     gmsh::Node tmpNode(newcoor, i, 0);
     newNodes.push_back(tmpNode);
 }

  mesh2.computeDeformed(newNodes);

  mesh2.writeGmesh("test2.msh", 2);

  gmsh::NodeData data;

  data.changeNbComposante(1);

  std::vector<gmsh::Node> v_node= mesh2.getNodes();

  for (size_t i = 0; i < v_node.size(); i++) {
     std::vector<double> value = {1.0 + (rand() % 10)} ;
     std::array<double, 3> coor = {{0.1*(rand() % 10), 0.1*(rand() % 10), 0.0}};
     gmsh::Node nodetmp(coor, v_node.size() +1 +i, 1 );
     gmsh::Data dat(v_node.size() +1 +i , value);
     data.addData(v_node[i].getIndex(), value );
     //data.addSubData(dat, nodetmp);
  }

  data.saveNodeData("result5.msh", mesh2);

  gmsh::ElementData data2;

  data2.changeNbComposante(1);

  std::vector<gmsh::Triangle> v= mesh.getTriangles();

  for (size_t i = 0; i < v.size(); i++) {
     std::vector<double> value = {1.0 + i} ;
     data2.addData(v[i].getIndex(), value );
  }



  data2.saveElementData("result4.msh", mesh);

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3c8, %rsp            # imm = 0x3C8
cmpl $0x1, %edi
jg 0xf61c
movq 0x79fc(%rip), %rbx      # 0x16fd8
leaq 0x284d(%rip), %rsi      # 0x11e30
movl $0x27, %edx
movq %rbx, %rdi
callq 0x2230
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
jmp 0xfd64
movq %rsi, %rbx
leaq -0x3e8(%rbp), %rdi
callq 0x35d0
movq 0x8(%rbx), %rsi
leaq -0x1b8(%rbp), %rdi
leaq -0x300(%rbp), %rdx
callq 0x20c0
leaq -0x188(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x1b8(%rbp), %rsi
movq -0x1b0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x198(%rbp), %rdi
callq 0xb17c
leaq -0x3e8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x5fc2
movq -0x198(%rbp), %rdi
cmpq %r14, %rdi
je 0xf68e
callq 0x21e0
leaq -0x3e8(%rbp), %rdi
callq 0x9252
movq 0x7937(%rip), %rdi      # 0x16fd8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq 0x791c(%rip), %rdi      # 0x16fd8
callq 0x2030
movq %rax, %rdi
callq 0x2180
leaq -0x168(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x277d(%rip), %rsi      # 0x11e58
leaq 0x277e(%rip), %rdx      # 0x11e60
leaq -0x178(%rbp), %rdi
callq 0xef70
leaq -0x3e8(%rbp), %rdi
leaq -0x178(%rbp), %rsi
movl $0x2, %edx
callq 0x917c
movq -0x178(%rbp), %rdi
cmpq %r14, %rdi
je 0xf717
callq 0x21e0
leaq -0x300(%rbp), %rdi
leaq -0x3e8(%rbp), %rsi
callq 0xecd4
leaq -0x300(%rbp), %rdi
callq 0xa37c
xorpd %xmm0, %xmm0
leaq -0x80(%rbp), %rbx
movapd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
xorl %r14d, %r14d
leaq -0x300(%rbp), %r15
leaq -0x218(%rbp), %r12
leaq -0xf8(%rbp), %r13
movq %r15, %rdi
callq 0x3e9c
cmpq %rax, %r14
jae 0xf83b
callq 0x2070
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xf8(%rbp)
callq 0x2070
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xf0(%rbp)
movq $0x0, -0xe8(%rbp)
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x28d4
movq -0x78(%rbp), %rsi
cmpq -0x70(%rbp), %rsi
je 0xf828
movq -0x1f8(%rbp), %rax
movq %rax, 0x20(%rsi)
movupd -0x218(%rbp), %xmm0
movupd -0x208(%rbp), %xmm1
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
addq $0x28, %rsi
movq %rsi, -0x78(%rbp)
jmp 0xf833
movq %rbx, %rdi
movq %r12, %rdx
callq 0xb8b2
incq %r14
jmp 0xf762
leaq -0x300(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xa3aa
leaq -0x148(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x2604(%rip), %rsi      # 0x11e61
leaq 0x2606(%rip), %rdx      # 0x11e6a
leaq -0x158(%rbp), %rdi
callq 0xef70
leaq -0x300(%rbp), %rdi
leaq -0x158(%rbp), %rsi
movl $0x2, %edx
callq 0x917c
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0xf899
callq 0x21e0
leaq -0x218(%rbp), %rdi
callq 0xcf80
leaq -0x218(%rbp), %rdi
movl $0x1, %esi
callq 0xcef4
leaq -0x48(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x3ed4
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0xfa67
movl $0x1, %r12d
xorl %r13d, %r13d
leaq -0xb0(%rbp), %rbx
movabsq $-0x3333333333333333, %r14 # imm = 0xCCCCCCCCCCCCCCCD
callq 0x2070
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
negl %ecx
addl %ecx, %eax
incl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xf8(%rbp)
movl $0x1, %edx
movq %rbx, %rdi
leaq -0xf8(%rbp), %r15
movq %r15, %rsi
leaq -0x68(%rbp), %rcx
callq 0xfefe
callq 0x2070
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x2489(%rip), %xmm1     # 0x11df8
mulsd %xmm1, %xmm0
movsd %xmm0, -0x98(%rbp)
callq 0x2070
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x244c(%rip), %xmm0     # 0x11df8
movsd %xmm0, -0x90(%rbp)
movq -0x40(%rbp), %rdx
subq -0x48(%rbp), %rdx
movq $0x0, -0x88(%rbp)
sarq $0x3, %rdx
imulq %r14, %rdx
addq %r12, %rdx
movl $0x1, %ecx
movq %r15, %rdi
leaq -0x98(%rbp), %rsi
callq 0x28d4
movq -0x40(%rbp), %rsi
subq -0x48(%rbp), %rsi
sarq $0x3, %rsi
imulq %r14, %rsi
addq %r12, %rsi
leaq -0x68(%rbp), %rdi
movq %rbx, %rdx
callq 0xcb78
movq -0x48(%rbp), %rdi
addq %r13, %rdi
callq 0x2b1c
leaq -0x218(%rbp), %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0xcf26
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xfa31
callq 0x21e0
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0xfa42
callq 0x21e0
movq -0x40(%rbp), %rax
subq -0x48(%rbp), %rax
sarq $0x3, %rax
imulq %r14, %rax
addq $0x28, %r13
leaq 0x1(%r12), %rcx
cmpq %rax, %r12
movq %rcx, %r12
jb 0xf8ee
leaq -0x128(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x23f2(%rip), %rsi      # 0x11e6b
leaq 0x23f6(%rip), %rdx      # 0x11e76
leaq -0x138(%rbp), %rdi
callq 0xef70
leaq -0x218(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x300(%rbp), %rdx
callq 0xd8c0
movq -0x138(%rbp), %rdi
cmpq %r14, %rdi
je 0xfab7
callq 0x21e0
leaq -0xf8(%rbp), %rdi
callq 0xcd7a
leaq -0xf8(%rbp), %rdi
movl $0x1, %esi
callq 0xcef4
leaq -0x68(%rbp), %rdi
leaq -0x3e8(%rbp), %rsi
callq 0x3f28
movq -0x60(%rbp), %rax
cmpq -0x68(%rbp), %rax
je 0xfba4
xorl %r13d, %r13d
leaq -0xb0(%rbp), %rbx
leaq -0xf8(%rbp), %r12
movabsq $0x6db6db6db6db6db7, %r14 # imm = 0x6DB6DB6DB6DB6DB7
xorl %r15d, %r15d
movq %r15, %xmm0
punpckldq 0x22f3(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x22fb(%rip), %xmm0     # 0x11e20
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd 0x22c7(%rip), %xmm1     # 0x11e00
movsd %xmm1, -0x98(%rbp)
movl $0x1, %edx
movq %rbx, %rdi
leaq -0x98(%rbp), %rsi
leaq -0x29(%rbp), %rcx
callq 0xfefe
movq -0x68(%rbp), %rdi
addq %r13, %rdi
callq 0x2bc4
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0xcf26
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0xfb84
callq 0x21e0
incq %r15
movq -0x60(%rbp), %rax
subq -0x68(%rbp), %rax
sarq $0x3, %rax
imulq %r14, %rax
addq $0x38, %r13
cmpq %rax, %r15
jb 0xfb10
leaq -0x108(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x22c1(%rip), %rsi      # 0x11e77
leaq 0x22c5(%rip), %rdx      # 0x11e82
leaq -0x118(%rbp), %rdi
callq 0xef70
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
leaq -0x3e8(%rbp), %rdx
callq 0xe12e
movq -0x118(%rbp), %rdi
cmpq %r14, %rdi
je 0xfbf4
callq 0x21e0
leaq -0x68(%rbp), %rdi
callq 0xa7c8
leaq -0xc8(%rbp), %rbx
movq %rbx, %rdi
callq 0xeea8
movq -0x20(%rbx), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0xfc21
callq 0x21e0
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xfc2f
callq 0x21e0
leaq -0x1d0(%rbp), %rdi
callq 0xff72
leaq -0x1e8(%rbp), %rbx
movq %rbx, %rdi
callq 0xeea8
movq -0x20(%rbx), %rdi
leaq -0x1f8(%rbp), %rax
cmpq %rax, %rdi
je 0xfc5f
callq 0x21e0
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0xfc6d
callq 0x21e0
leaq -0x238(%rbp), %rdi
callq 0xeefe
leaq -0x250(%rbp), %rdi
callq 0xab88
leaq -0x268(%rbp), %rdi
callq 0xabdc
leaq -0x280(%rbp), %rdi
callq 0xa9a8
leaq -0x298(%rbp), %rdi
callq 0xa9fc
leaq -0x2b0(%rbp), %rdi
callq 0xa7c8
leaq -0x2c8(%rbp), %rdi
callq 0xa81c
leaq -0x2e0(%rbp), %rbx
movq %rbx, %rdi
callq 0xa63c
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0xfcde
callq 0x21e0
leaq -0x1a8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfcf3
callq 0x21e0
leaq -0x320(%rbp), %rdi
callq 0xeefe
leaq -0x338(%rbp), %rdi
callq 0xab88
leaq -0x350(%rbp), %rdi
callq 0xabdc
leaq -0x368(%rbp), %rdi
callq 0xa9a8
leaq -0x380(%rbp), %rdi
callq 0xa9fc
leaq -0x398(%rbp), %rdi
callq 0xa7c8
leaq -0x3b0(%rbp), %rdi
callq 0xa81c
leaq -0x3c8(%rbp), %rbx
movq %rbx, %rdi
callq 0xa63c
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0xfd64
callq 0x21e0
xorl %eax, %eax
addq $0x3c8, %rsp            # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x118(%rbp), %rdi
cmpq %r14, %rdi
jne 0xfe5e
jmp 0xfe63
jmp 0xfe3c
jmp 0xfd97
movq %rax, %rbx
jmp 0xfe6c
jmp 0xfe41
movq %rax, %rbx
movq -0x138(%rbp), %rdi
cmpq %r14, %rdi
jne 0xfe97
jmp 0xfe9c
jmp 0xfe41
jmp 0xfdc3
movq %rax, %rbx
jmp 0xfeaa
jmp 0xfeb8
movq %rax, %rbx
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0xfebb
callq 0x21e0
jmp 0xfebb
jmp 0xfeb8
jmp 0xfeb8
movq %rax, %rbx
jmp 0xfec9
jmp 0xfe34
movq %rax, %rbx
movq -0x178(%rbp), %rdi
jmp 0xfe19
jmp 0xfe34
movq %rax, %rbx
movq -0x198(%rbp), %rdi
cmpq %r14, %rdi
je 0xfed5
callq 0x21e0
jmp 0xfed5
movq %rax, %rbx
jmp 0xfeea
movq %rax, %rbx
jmp 0xfed5
movq %rax, %rbx
jmp 0xfe63
movq %rax, %rbx
jmp 0xfe9c
jmp 0xfe48
movq %rax, %rbx
jmp 0xfe8b
jmp 0xfeb8
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0xfe63
callq 0x21e0
leaq -0x68(%rbp), %rdi
callq 0xa7c8
leaq -0xf8(%rbp), %rdi
callq 0xec34
jmp 0xfe9c
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xfe8b
callq 0x21e0
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0xfe9c
callq 0x21e0
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xfeaa
callq 0x21e0
leaq -0x218(%rbp), %rdi
callq 0xff3c
jmp 0xfebb
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0xfec9
callq 0x21e0
leaq -0x300(%rbp), %rdi
callq 0xee34
leaq -0x1a8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfeea
callq 0x21e0
leaq -0x3e8(%rbp), %rdi
callq 0xee34
movq %rbx, %rdi
callq 0x22f0