// File: /workspace/github_cpp_makefile_star2_O3/Gilaverbuch[P]FD_2D_WAVE/Field.cpp
// Function: Field::print_to_file(int, int, double**, double*, double*, int)
void Field::print_to_file(int size_x, int size_y, double **A, double *pos_x, double *pos_y, int itteration){

	int ii, jj;
    std::ofstream ofile;

    std::cout << " printing results " << std::endl;

    ofile.open("wave_signal"+std::to_string(itteration)+".txt"); 


    for (ii=0; ii<size_y; ii=ii+5){
    	for (jj=0; jj<size_x; jj=jj+5){

         	// std::cout << ii << " " << jj << " " <<  pos_x[jj] << " " << pos_y[ii] << std::endl;
         	ofile << pos_x[jj] << " " << pos_y[ii] << " " << A[ii][jj] << std::endl;
       }
   }
   // j=20;
   // for (i=0; i<size_y; i++){

   //   ofile << pos_y[i] << " " << A[i][j] << std::endl;
   // }
    ofile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %r9, -0x40(%rbp)
movq %r8, -0x48(%rbp)
movq %rcx, -0x38(%rbp)
movl %edx, -0x2c(%rbp)
movl %esi, -0x30(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x2250
movq 0x30d3(%rip), %rbx      # 0x6fd8
leaq 0x1321(%rip), %rsi      # 0x522d
movl $0x12, %edx
movq %rbx, %rdi
callq 0x21b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq 0x30a1(%rip), %rdi      # 0x6fd8
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movl 0x10(%rbp), %r14d
movl %r14d, %ebx
negl %ebx
cmovsl %r14d, %ebx
movl $0x1, %r12d
cmpl $0xa, %ebx
jb 0x3fa5
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebx, %ecx
cmpl $0x63, %ecx
jbe 0x3f9c
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x3fa2
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x3fa5
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3f69
addl $-0x3, %r12d
jmp 0x3fa5
addl $-0x2, %r12d
jmp 0x3fa5
decl %r12d
shrl $0x1f, %r14d
leal (%r12,%r14), %esi
leaq -0x98(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0xa8(%rbp), %rdi
movl $0x2d, %edx
callq 0x21c0
movl %r14d, %edi
leaq -0xa8(%rbp), %r14
addq (%r14), %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0x4384
leaq 0x1259(%rip), %rcx      # 0x5240
movl $0xb, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2190
leaq -0x58(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x401d
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0x4024
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq -0x68(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x11bc(%rip), %rsi      # 0x5202
callq 0x22b0
leaq -0x78(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4072
movq %rdx, -0x88(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x78(%rbp)
jmp 0x4079
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x88(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x2a8(%rbp), %rdi
movl $0x10, %edx
callq 0x2080
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x40c0
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x40d5
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x40f0
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2180
cmpl $0x0, -0x2c(%rbp)
jle 0x41be
xorl %r15d, %r15d
leaq -0x2a8(%rbp), %r12
leaq 0x1103(%rip), %rbx      # 0x520e
cmpl $0x0, -0x30(%rbp)
jle 0x41b0
xorl %r13d, %r13d
movq -0x48(%rbp), %rax
movsd (%rax,%r13,8), %xmm0
movq %r12, %rdi
callq 0x2230
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21b0
movq -0x40(%rbp), %rax
movsd (%rax,%r15,8), %xmm0
movq %r14, %rdi
callq 0x2230
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21b0
movq -0x38(%rbp), %rax
movq (%rax,%r15,8), %rax
movsd (%rax,%r13,8), %xmm0
movq %r14, %rdi
callq 0x2230
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20d0
addq $0x5, %r13
cmpl -0x30(%rbp), %r13d
jl 0x4118
addq $0x5, %r15
cmpl -0x2c(%rbp), %r15d
jl 0x410b
leaq -0x2a8(%rbp), %rdi
callq 0x21e0
movq 0x2dff(%rip), %rax      # 0x6fd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x2a0(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x2a8(%rbp,%rcx)
callq 0x2130
leaq -0x1b0(%rbp), %rdi
callq 0x2060
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x4232
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x4232
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x424c
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x424c
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x4270
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x4270
jmp 0x426d
jmp 0x426d
movq %rax, %rbx
leaq -0x2a8(%rbp), %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x2270