title: scanf run twice instead of one time at assembly x86_64
body: <p>I'v tried to run this code, and that what happend -</p>
  
  <p>a. scanf want "epsilon = %lf"</p>
  
  <p>b. for some reason, the program does not continue to print epsilon, but insted it's scan again for "order = %d"</p>
  
  <p>c. print epsilon at that point</p>
  
  <p>d. scanf again for "order = %d"</p>
  
  <p>e. print the first order and exit</p>
  
  <p>I would like to know why the program entered twice to scanf, and how to fix it =]</p>
  
  <p>(there is a terminal img below, to see steps a-e in the actual program) </p>
  
  <pre><code>global main
  extern printf 
  extern scanf
  
  section .data
      epsilon_formatIN: db "epsilon = %lf",10,0
      epsilon_formatOUT: db "epsilon = %lf",10,0
      order_formatIN: db "order = %d",10,0
      order_formatOUT: db "order = %d",10,0
  
  section .bss
      epsilon: resq 1
      order: resb 1
  
  
  section .text
  
     main:
       push rbp
       mov rbp, rsp
       mov rax, 0
  
       .get_epsilon:
        mov rdi, epsilon_formatIN
        mov rsi, epsilon
        mov rax, 0
        call scanf
  
      .print_epsilon:
        mov rdi, epsilon_formatOUT
        movsd xmm0, qword [epsilon]
        mov rax, 1    
        call printf
  
  
     .get_order:
       mov rdi, order_formatIN
       mov rsi, order
       mov rax, 0
       call scanf
  
     .print_order:
       mov rdi, order_formatOUT
       mov rsi, [order]
       mov rax, 0
       call printf
  
     pop rbp
     ret
  </code></pre>
  
  <p>terminal image after compiling and run this code:</p>
  
  <p><img src="https://i.stack.imgur.com/iz6cy.png" alt="terminal image after compiling and run this code"></p>