// File: /workspace/github_cpp_makefile_star2_O1/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 0xfd63
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 0xb130
leaq -0x3e8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x5fc0
movq -0x198(%rbp), %rdi
cmpq %r14, %rdi
je 0xf68e
callq 0x21e0
leaq -0x3e8(%rbp), %rdi
callq 0x9250
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 0xef2a
leaq -0x3e8(%rbp), %rdi
leaq -0x178(%rbp), %rsi
movl $0x2, %edx
callq 0x917a
movq -0x178(%rbp), %rdi
cmpq %r14, %rdi
je 0xf717
callq 0x21e0
leaq -0x300(%rbp), %rdi
leaq -0x3e8(%rbp), %rsi
callq 0xeca2
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 0xb862
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 0xef2a
leaq -0x300(%rbp), %rdi
leaq -0x158(%rbp), %rsi
movl $0x2, %edx
callq 0x917a
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 0xfa66
movl $0x1, %r13d
xorl %r12d, %r12d
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 %r13, %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 %r13, %rsi
leaq -0x68(%rbp), %rdi
movq %rbx, %rdx
callq 0xcb78
movq -0x48(%rbp), %rdi
addq %r12, %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
leaq 0x1(%r13), %rcx
addq $0x28, %r12
cmpq %rax, %r13
movq %rcx, %r13
jb 0xf8ee
leaq -0x128(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x23f3(%rip), %rsi      # 0x11e6b
leaq 0x23f7(%rip), %rdx      # 0x11e76
leaq -0x138(%rbp), %rdi
callq 0xef2a
leaq -0x218(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x300(%rbp), %rdx
callq 0xd8b0
movq -0x138(%rbp), %rdi
cmpq %r14, %rdi
je 0xfab6
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 0xfba3
xorl %r13d, %r13d
leaq -0xb0(%rbp), %rbx
leaq -0xf8(%rbp), %r12
movabsq $0x6db6db6db6db6db7, %r14 # imm = 0x6DB6DB6DB6DB6DB7
xorl %r15d, %r15d
movq %r15, %xmm0
punpckldq 0x22f4(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x22fc(%rip), %xmm0     # 0x11e20
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd 0x22c8(%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 0xfb83
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 0xfb0f
leaq -0x108(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x22c2(%rip), %rsi      # 0x11e77
leaq 0x22c6(%rip), %rdx      # 0x11e82
leaq -0x118(%rbp), %rdi
callq 0xef2a
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
leaq -0x3e8(%rbp), %rdx
callq 0xe116
movq -0x118(%rbp), %rdi
cmpq %r14, %rdi
je 0xfbf3
callq 0x21e0
leaq -0x68(%rbp), %rdi
callq 0xa7bc
leaq -0xc8(%rbp), %rbx
movq %rbx, %rdi
callq 0xee76
movq -0x20(%rbx), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0xfc20
callq 0x21e0
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xfc2e
callq 0x21e0
leaq -0x1d0(%rbp), %rdi
callq 0xff72
leaq -0x1e8(%rbp), %rbx
movq %rbx, %rdi
callq 0xee76
movq -0x20(%rbx), %rdi
leaq -0x1f8(%rbp), %rax
cmpq %rax, %rdi
je 0xfc5e
callq 0x21e0
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0xfc6c
callq 0x21e0
leaq -0x238(%rbp), %rdi
callq 0xeec2
leaq -0x250(%rbp), %rdi
callq 0xab54
leaq -0x268(%rbp), %rdi
callq 0xab9e
leaq -0x280(%rbp), %rdi
callq 0xa988
leaq -0x298(%rbp), %rdi
callq 0xa9d2
leaq -0x2b0(%rbp), %rdi
callq 0xa7bc
leaq -0x2c8(%rbp), %rdi
callq 0xa806
leaq -0x2e0(%rbp), %rbx
movq %rbx, %rdi
callq 0xa63a
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0xfcdd
callq 0x21e0
leaq -0x1a8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfcf2
callq 0x21e0
leaq -0x320(%rbp), %rdi
callq 0xeec2
leaq -0x338(%rbp), %rdi
callq 0xab54
leaq -0x350(%rbp), %rdi
callq 0xab9e
leaq -0x368(%rbp), %rdi
callq 0xa988
leaq -0x380(%rbp), %rdi
callq 0xa9d2
leaq -0x398(%rbp), %rdi
callq 0xa7bc
leaq -0x3b0(%rbp), %rdi
callq 0xa806
leaq -0x3c8(%rbp), %rbx
movq %rbx, %rdi
callq 0xa63a
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0xfd63
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 0xfe5d
jmp 0xfe62
jmp 0xfe3b
jmp 0xfd96
movq %rax, %rbx
jmp 0xfe6b
jmp 0xfe40
movq %rax, %rbx
movq -0x138(%rbp), %rdi
cmpq %r14, %rdi
jne 0xfe96
jmp 0xfe9b
jmp 0xfe40
jmp 0xfdc2
movq %rax, %rbx
jmp 0xfea9
jmp 0xfeb7
movq %rax, %rbx
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0xfeba
callq 0x21e0
jmp 0xfeba
jmp 0xfeb7
jmp 0xfeb7
movq %rax, %rbx
jmp 0xfec8
jmp 0xfe33
movq %rax, %rbx
movq -0x178(%rbp), %rdi
jmp 0xfe18
jmp 0xfe33
movq %rax, %rbx
movq -0x198(%rbp), %rdi
cmpq %r14, %rdi
je 0xfed4
callq 0x21e0
jmp 0xfed4
movq %rax, %rbx
jmp 0xfee9
movq %rax, %rbx
jmp 0xfed4
movq %rax, %rbx
jmp 0xfe62
movq %rax, %rbx
jmp 0xfe9b
jmp 0xfe47
movq %rax, %rbx
jmp 0xfe8a
jmp 0xfeb7
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0xfe62
callq 0x21e0
leaq -0x68(%rbp), %rdi
callq 0xa7bc
leaq -0xf8(%rbp), %rdi
callq 0xec02
jmp 0xfe9b
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xfe8a
callq 0x21e0
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0xfe9b
callq 0x21e0
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xfea9
callq 0x21e0
leaq -0x218(%rbp), %rdi
callq 0xff3c
jmp 0xfeba
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0xfec8
callq 0x21e0
leaq -0x300(%rbp), %rdi
callq 0xee02
leaq -0x1a8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfee9
callq 0x21e0
leaq -0x3e8(%rbp), %rdi
callq 0xee02
movq %rbx, %rdi
callq 0x22f0
nop