val va_quick_Sqr2_stdcall (win: bool) (dst_b inA_b: buffer64)
    : (va_quickCode unit (va_code_Sqr2_stdcall win))
val va_quick_Sqr2_stdcall (win: bool) (dst_b inA_b: buffer64)
    : (va_quickCode unit (va_code_Sqr2_stdcall win))
let va_quick_Sqr2_stdcall (win:bool) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
  (va_code_Sqr2_stdcall win)) =
  (va_QProc (va_code_Sqr2_stdcall win) ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_heaplet 0;
    va_Mod_flags; va_Mod_reg64 rRsp; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
    va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsi;
    va_Mod_reg64 rRdi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax;
    va_Mod_mem]) (va_wp_Sqr2_stdcall win dst_b inA_b) (va_wpProof_Sqr2_stdcall win dst_b inA_b))
module Vale.Curve25519.X64.FastSqr
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.X64.Machine_s
open Vale.X64.Memory
open Vale.X64.Stack_i
open Vale.X64.State
open Vale.X64.Decls
open Vale.X64.InsBasic
open Vale.X64.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open Vale.Curve25519.Fast_defs
open Vale.X64.CPU_Features_s
//-- Fast_sqr

val va_code_Fast_sqr : offset:nat -> Tot va_code

val va_codegen_success_Fast_sqr : offset:nat -> Tot va_pbool

val va_lemma_Fast_sqr : va_b0:va_code -> va_s0:va_state -> offset:nat -> dst_b:buffer64 ->
  inA_b:buffer64
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Fast_sqr offset) va_s0 /\ va_get_ok va_s0 /\ (let
    (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset)
    (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
    inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
    Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let
    (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset)
    (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
    a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\
    Vale.X64.Decls.buffers_disjoint dst_b inA_b /\ Vale.X64.Decls.validDstAddrs64
    (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (8 + offset `op_Multiply` 2)
    (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
    (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret)))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset)
    (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
    inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
    Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let
    (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset)
    (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
    a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset `op_Multiply` 2)
    (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset
    `op_Multiply` 2) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2
    + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read
    dst_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_sM) in let d4 =
    Vale.X64.Decls.buffer64_read dst_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_sM) in
    let d5 = Vale.X64.Decls.buffer64_read dst_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0
    va_sM) in let d6 = Vale.X64.Decls.buffer64_read dst_b (6 + offset `op_Multiply` 2)
    (va_get_mem_heaplet 0 va_sM) in let d7 = Vale.X64.Decls.buffer64_read dst_b (7 + offset
    `op_Multiply` 2) (va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_eight
    d0 d1 d2 d3 d4 d5 d6 d7 in d == va_mul_nat a a /\ Vale.X64.Decls.validSrcAddrs64
    (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (8 + offset `op_Multiply` 2)
    (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer_specific dst_b
    (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset `op_Multiply` 2) (8 +
    offset `op_Multiply` 2 - 1)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet
    0 va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
    (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
    (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
    (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem
    va_sM va_s0)))))))))))))))))
[@ va_qattr]
let va_wp_Fast_sqr (offset:nat) (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state
  -> unit -> Type0)) : Type0 =
  (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 +
    offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) =
    Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let
    (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset)
    (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
    inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
    Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0
    \/ offset == 4) /\ Vale.X64.Decls.buffers_disjoint dst_b inA_b /\
    Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (8
    + offset `op_Multiply` 2) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
    (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout
    va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rbx:nat64)
    (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
    (va_x_r11:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_r15:nat64) (va_x_heap0:vale_heap)
    (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
    va_x_heap0 (va_upd_reg64 rR15 va_x_r15 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13
    (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
    rR8 va_x_r8 (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRbx va_x_rbx
    (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))))))) in va_get_ok va_sM /\ (let
    (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset)
    (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
    inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
    Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let
    (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset)
    (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
    a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset `op_Multiply` 2)
    (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset
    `op_Multiply` 2) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2
    + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read
    dst_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_sM) in let d4 =
    Vale.X64.Decls.buffer64_read dst_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_sM) in
    let d5 = Vale.X64.Decls.buffer64_read dst_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0
    va_sM) in let d6 = Vale.X64.Decls.buffer64_read dst_b (6 + offset `op_Multiply` 2)
    (va_get_mem_heaplet 0 va_sM) in let d7 = Vale.X64.Decls.buffer64_read dst_b (7 + offset
    `op_Multiply` 2) (va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_eight
    d0 d1 d2 d3 d4 d5 d6 d7 in d == va_mul_nat a a /\ Vale.X64.Decls.validSrcAddrs64
    (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (8 + offset `op_Multiply` 2)
    (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer_specific dst_b
    (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset `op_Multiply` 2) (8 +
    offset `op_Multiply` 2 - 1)) ==> va_k va_sM (())))

val va_wpProof_Fast_sqr : offset:nat -> dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state ->
  va_k:(va_state -> unit -> Type0)
  -> Ghost (va_state & va_fuel & unit)
  (requires (va_t_require va_s0 /\ va_wp_Fast_sqr offset dst_b inA_b va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sqr offset) ([va_Mod_flags;
    va_Mod_mem_heaplet 0; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64
    rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
    rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sqr (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
  (va_code_Fast_sqr offset)) =
  (va_QProc (va_code_Fast_sqr offset) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR15;
    va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
    va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax;
    va_Mod_mem]) (va_wp_Fast_sqr offset dst_b inA_b) (va_wpProof_Fast_sqr offset dst_b inA_b))
//--
//-- Fast_sqr_stdcall

val va_code_Fast_sqr_stdcall : win:bool -> Tot va_code

val va_codegen_success_Fast_sqr_stdcall : win:bool -> Tot va_pbool

val va_lemma_Fast_sqr_stdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> dst_b:buffer64 ->
  inA_b:buffer64
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Fast_sqr_stdcall win) va_s0 /\ va_get_ok va_s0 /\ (let
    (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else
    va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then
    va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in va_get_reg64 rRsp va_s0 ==
    Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\ (adx_enabled /\ bmi2_enabled) /\
    Vale.X64.Decls.buffers_disjoint dst_b inA_b /\ Vale.X64.Decls.validDstAddrs64
    (va_get_mem_heaplet 0 va_s0) dst_in dst_b 8 (va_get_mem_layout va_s0) Secret /\
    Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) inA_in inA_b 4 (va_get_mem_layout
    va_s0) Secret)))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else
    va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then
    va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let a0 = Vale.X64.Decls.buffer64_read
    inA_b 0 (va_get_mem_heaplet 0 va_s0) in let a1 = Vale.X64.Decls.buffer64_read inA_b 1
    (va_get_mem_heaplet 0 va_s0) in let a2 = Vale.X64.Decls.buffer64_read inA_b 2
    (va_get_mem_heaplet 0 va_s0) in let a3 = Vale.X64.Decls.buffer64_read inA_b 3
    (va_get_mem_heaplet 0 va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b 0
    (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
    (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
    (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
    (va_get_mem_heaplet 0 va_sM) in let d4 = Vale.X64.Decls.buffer64_read dst_b 4
    (va_get_mem_heaplet 0 va_sM) in let d5 = Vale.X64.Decls.buffer64_read dst_b 5
    (va_get_mem_heaplet 0 va_sM) in let d6 = Vale.X64.Decls.buffer64_read dst_b 6
    (va_get_mem_heaplet 0 va_sM) in let d7 = Vale.X64.Decls.buffer64_read dst_b 7
    (va_get_mem_heaplet 0 va_sM) in let a = a0 + va_mul_nat pow2_64 a1 + va_mul_nat pow2_128 a2 +
    va_mul_nat pow2_192 a3 in let d = d0 + va_mul_nat pow2_64 d1 + va_mul_nat pow2_128 d2 +
    va_mul_nat pow2_192 d3 + va_mul_nat pow2_256 d4 + va_mul_nat pow2_320 d5 + va_mul_nat pow2_384
    d6 + va_mul_nat pow2_448 d7 in d == va_mul_nat a a /\ Vale.X64.Decls.modifies_buffer dst_b
    (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64
    (va_get_mem_heaplet 0 va_sM) dst_in dst_b 8 (va_get_mem_layout va_sM) Secret /\ va_get_reg64
    rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0 /\
    va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0 /\ va_get_reg64 rR14 va_sM == va_get_reg64
    rR14 va_s0 /\ va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0 /\ va_get_reg64 rRsp va_sM ==
    va_get_reg64 rRsp va_s0) /\ va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack
    va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rRsp va_sM
    (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
    (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
    (va_update_reg64 rR8 va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdi va_sM
    (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM
    (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))
[@ va_qattr]
let va_wp_Fast_sqr_stdcall (win:bool) (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state)
  (va_k:(va_state -> unit -> Type0)) : Type0 =
  (va_get_ok va_s0 /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
    va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
    18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
    rRsi va_s0) in va_get_reg64 rRsp va_s0 == Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\
    (adx_enabled /\ bmi2_enabled) /\ Vale.X64.Decls.buffers_disjoint dst_b inA_b /\
    Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) dst_in dst_b 8 (va_get_mem_layout
    va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) inA_in inA_b 4
    (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
    (va_x_rbx:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rdi:nat64) (va_x_rsi:nat64)
    (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64)
    (va_x_r14:nat64) (va_x_r15:nat64) (va_x_rsp:nat64) (va_x_efl:Vale.X64.Flags.t)
    (va_x_heap0:vale_heap) (va_x_stack:vale_stack) (va_x_stackTaint:memtaint) . let va_sM =
    va_upd_stackTaint va_x_stackTaint (va_upd_stack va_x_stack (va_upd_mem_heaplet 0 va_x_heap0
    (va_upd_flags va_x_efl (va_upd_reg64 rRsp va_x_rsp (va_upd_reg64 rR15 va_x_r15 (va_upd_reg64
    rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
    va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRsi va_x_rsi
    (va_upd_reg64 rRdi va_x_rdi (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx
    (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem
    va_s0)))))))))))))))))) in va_get_ok va_sM /\ (let (dst_in:(va_int_range 0
    18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64
    rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
    va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let a0 =
    Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let a1 =
    Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let a2 =
    Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let a3 =
    Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let d0 =
    Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
    Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
    Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
    Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d4 =
    Vale.X64.Decls.buffer64_read dst_b 4 (va_get_mem_heaplet 0 va_sM) in let d5 =
    Vale.X64.Decls.buffer64_read dst_b 5 (va_get_mem_heaplet 0 va_sM) in let d6 =
    Vale.X64.Decls.buffer64_read dst_b 6 (va_get_mem_heaplet 0 va_sM) in let d7 =
    Vale.X64.Decls.buffer64_read dst_b 7 (va_get_mem_heaplet 0 va_sM) in let a = a0 + va_mul_nat
    pow2_64 a1 + va_mul_nat pow2_128 a2 + va_mul_nat pow2_192 a3 in let d = d0 + va_mul_nat pow2_64
    d1 + va_mul_nat pow2_128 d2 + va_mul_nat pow2_192 d3 + va_mul_nat pow2_256 d4 + va_mul_nat
    pow2_320 d5 + va_mul_nat pow2_384 d6 + va_mul_nat pow2_448 d7 in d == va_mul_nat a a /\
    Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)
    /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) dst_in dst_b 8
    (va_get_mem_layout va_sM) Secret /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\
    va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0 /\ va_get_reg64 rR13 va_sM == va_get_reg64
    rR13 va_s0 /\ va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0 /\ va_get_reg64 rR15 va_sM ==
    va_get_reg64 rR15 va_s0 /\ va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) ==> va_k va_sM
    (())))

val va_wpProof_Fast_sqr_stdcall : win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state ->
  va_k:(va_state -> unit -> Type0)
  -> Ghost (va_state & va_fuel & unit)
  (requires (va_t_require va_s0 /\ va_wp_Fast_sqr_stdcall win dst_b inA_b va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sqr_stdcall win)
    ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rRsp;
    va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
    va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsi; va_Mod_reg64 rRdi; va_Mod_reg64 rRdx;
    va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM,
    va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sqr_stdcall (win:bool) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
  (va_code_Fast_sqr_stdcall win)) =
  (va_QProc (va_code_Fast_sqr_stdcall win) ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_heaplet 0;
    va_Mod_flags; va_Mod_reg64 rRsp; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
    va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsi;
    va_Mod_reg64 rRdi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax;
    va_Mod_mem]) (va_wp_Fast_sqr_stdcall win dst_b inA_b) (va_wpProof_Fast_sqr_stdcall win dst_b
    inA_b))
//--
//-- Sqr2_stdcall

val va_code_Sqr2_stdcall : win:bool -> Tot va_code

val va_codegen_success_Sqr2_stdcall : win:bool -> Tot va_pbool

val va_lemma_Sqr2_stdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> dst_b:buffer64 ->
  inA_b:buffer64
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Sqr2_stdcall win) va_s0 /\ va_get_ok va_s0 /\ (let
    (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else
    va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then
    va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in va_get_reg64 rRsp va_s0 ==
    Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\ (adx_enabled /\ bmi2_enabled) /\
    Vale.X64.Decls.buffers_disjoint dst_b inA_b /\ Vale.X64.Decls.validDstAddrs64
    (va_get_mem_heaplet 0 va_s0) dst_in dst_b 16 (va_get_mem_layout va_s0) Secret /\
    Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) inA_in inA_b 8 (va_get_mem_layout
    va_s0) Secret)))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else
    va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then
    va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let a0 = Vale.X64.Decls.buffer64_read
    inA_b 0 (va_get_mem_heaplet 0 va_s0) in let a1 = Vale.X64.Decls.buffer64_read inA_b 1
    (va_get_mem_heaplet 0 va_s0) in let a2 = Vale.X64.Decls.buffer64_read inA_b 2
    (va_get_mem_heaplet 0 va_s0) in let a3 = Vale.X64.Decls.buffer64_read inA_b 3
    (va_get_mem_heaplet 0 va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b 0
    (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
    (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
    (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
    (va_get_mem_heaplet 0 va_sM) in let d4 = Vale.X64.Decls.buffer64_read dst_b 4
    (va_get_mem_heaplet 0 va_sM) in let d5 = Vale.X64.Decls.buffer64_read dst_b 5
    (va_get_mem_heaplet 0 va_sM) in let d6 = Vale.X64.Decls.buffer64_read dst_b 6
    (va_get_mem_heaplet 0 va_sM) in let d7 = Vale.X64.Decls.buffer64_read dst_b 7
    (va_get_mem_heaplet 0 va_sM) in let a = a0 + va_mul_nat pow2_64 a1 + va_mul_nat pow2_128 a2 +
    va_mul_nat pow2_192 a3 in let d = d0 + va_mul_nat pow2_64 d1 + va_mul_nat pow2_128 d2 +
    va_mul_nat pow2_192 d3 + va_mul_nat pow2_256 d4 + va_mul_nat pow2_320 d5 + va_mul_nat pow2_384
    d6 + va_mul_nat pow2_448 d7 in d == va_mul_nat a a /\ Vale.X64.Decls.modifies_buffer dst_b
    (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64
    (va_get_mem_heaplet 0 va_sM) dst_in dst_b 16 (va_get_mem_layout va_sM) Secret /\ va_get_reg64
    rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0 /\
    va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0 /\ va_get_reg64 rR14 va_sM == va_get_reg64
    rR14 va_s0 /\ va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0 /\ va_get_reg64 rRsp va_sM ==
    va_get_reg64 rRsp va_s0) /\ va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack
    va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rRsp va_sM
    (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
    (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
    (va_update_reg64 rR8 va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdi va_sM
    (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM
    (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))
[@ va_qattr]
let va_wp_Sqr2_stdcall (win:bool) (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state)
  (va_k:(va_state -> unit -> Type0)) : Type0 =
  (va_get_ok va_s0 /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
    va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
    18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
    rRsi va_s0) in va_get_reg64 rRsp va_s0 == Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\
    (adx_enabled /\ bmi2_enabled) /\ Vale.X64.Decls.buffers_disjoint dst_b inA_b /\
    Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) dst_in dst_b 16 (va_get_mem_layout
    va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) inA_in inA_b 8
    (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
    (va_x_rbx:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rdi:nat64) (va_x_rsi:nat64)
    (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64)
    (va_x_r14:nat64) (va_x_r15:nat64) (va_x_rsp:nat64) (va_x_efl:Vale.X64.Flags.t)
    (va_x_heap0:vale_heap) (va_x_stack:vale_stack) (va_x_stackTaint:memtaint) . let va_sM =
    va_upd_stackTaint va_x_stackTaint (va_upd_stack va_x_stack (va_upd_mem_heaplet 0 va_x_heap0
    (va_upd_flags va_x_efl (va_upd_reg64 rRsp va_x_rsp (va_upd_reg64 rR15 va_x_r15 (va_upd_reg64
    rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
    va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRsi va_x_rsi
    (va_upd_reg64 rRdi va_x_rdi (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx
    (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem
    va_s0)))))))))))))))))) in va_get_ok va_sM /\ (let (dst_in:(va_int_range 0
    18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64
    rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
    va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let a0 =
    Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let a1 =
    Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let a2 =
    Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let a3 =
    Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let d0 =
    Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
    Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
    Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
    Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d4 =
    Vale.X64.Decls.buffer64_read dst_b 4 (va_get_mem_heaplet 0 va_sM) in let d5 =
    Vale.X64.Decls.buffer64_read dst_b 5 (va_get_mem_heaplet 0 va_sM) in let d6 =
    Vale.X64.Decls.buffer64_read dst_b 6 (va_get_mem_heaplet 0 va_sM) in let d7 =
    Vale.X64.Decls.buffer64_read dst_b 7 (va_get_mem_heaplet 0 va_sM) in let a = a0 + va_mul_nat
    pow2_64 a1 + va_mul_nat pow2_128 a2 + va_mul_nat pow2_192 a3 in let d = d0 + va_mul_nat pow2_64
    d1 + va_mul_nat pow2_128 d2 + va_mul_nat pow2_192 d3 + va_mul_nat pow2_256 d4 + va_mul_nat
    pow2_320 d5 + va_mul_nat pow2_384 d6 + va_mul_nat pow2_448 d7 in d == va_mul_nat a a /\
    Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)
    /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) dst_in dst_b 16
    (va_get_mem_layout va_sM) Secret /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\
    va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0 /\ va_get_reg64 rR13 va_sM == va_get_reg64
    rR13 va_s0 /\ va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0 /\ va_get_reg64 rR15 va_sM ==
    va_get_reg64 rR15 va_s0 /\ va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) ==> va_k va_sM
    (())))

val va_wpProof_Sqr2_stdcall : win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state ->
  va_k:(va_state -> unit -> Type0)
  -> Ghost (va_state & va_fuel & unit)
  (requires (va_t_require va_s0 /\ va_wp_Sqr2_stdcall win dst_b inA_b va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sqr2_stdcall win) ([va_Mod_stackTaint;
    va_Mod_stack; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rRsp; va_Mod_reg64 rR15;
    va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
    va_Mod_reg64 rR8; va_Mod_reg64 rRsi; va_Mod_reg64 rRdi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx;
    va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
/
Vale.X64.State.fsti.checked Vale.X64.Stack_i.fsti.checked Vale.X64.QuickCodes.fsti.checked Vale.X64.QuickCode.fst.checked Vale.X64.Memory.fsti.checked Vale.X64.Machine_s.fst.checked Vale.X64.InsStack.fsti.checked Vale.X64.InsMem.fsti.checked Vale.X64.InsBasic.fsti.checked Vale.X64.Flags.fsti.checked Vale.X64.Decls.fsti.checked Vale.X64.CPU_Features_s.fst.checked Vale.Def.Types_s.fst.checked Vale.Curve25519.Fast_defs.fst.checked Vale.Arch.Types.fsti.checked prims.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked
Vale.Curve25519.X64.FastSqr.fsti
win: Prims.bool -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64
  -> Vale.X64.QuickCode.va_quickCode Prims.unit
      (Vale.Curve25519.X64.FastSqr.va_code_Sqr2_stdcall win)
Prims.bool Vale.X64.Memory.buffer64 Vale.X64.QuickCode.va_QProc Prims.unit Vale.Curve25519.X64.FastSqr.va_code_Sqr2_stdcall Prims.Cons Vale.X64.QuickCode.mod_t Vale.X64.QuickCode.va_Mod_stackTaint Vale.X64.QuickCode.va_Mod_stack Vale.X64.QuickCode.va_Mod_mem_heaplet Vale.X64.QuickCode.va_Mod_flags Vale.X64.QuickCode.va_Mod_reg64 Vale.X64.Machine_s.rRsp Vale.X64.Machine_s.rR15 Vale.X64.Machine_s.rR14 Vale.X64.Machine_s.rR13 Vale.X64.Machine_s.rR11 Vale.X64.Machine_s.rR10 Vale.X64.Machine_s.rR9 Vale.X64.Machine_s.rR8 Vale.X64.Machine_s.rRsi Vale.X64.Machine_s.rRdi Vale.X64.Machine_s.rRdx Vale.X64.Machine_s.rRcx Vale.X64.Machine_s.rRbx Vale.X64.Machine_s.rRax Vale.X64.QuickCode.va_Mod_mem Prims.Nil Vale.Curve25519.X64.FastSqr.va_wp_Sqr2_stdcall Vale.Curve25519.X64.FastSqr.va_wpProof_Sqr2_stdcall Vale.X64.QuickCode.va_quickCode
let va_quick_Sqr2_stdcall (win: bool) (dst_b inA_b: buffer64)
    : (va_quickCode unit (va_code_Sqr2_stdcall win)) =
  
(va_QProc (va_code_Sqr2_stdcall win)
    ([
        va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rRsp;
        va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
        va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsi; va_Mod_reg64 rRdi;
        va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem
      ])
    (va_wp_Sqr2_stdcall win dst_b inA_b)
    (va_wpProof_Sqr2_stdcall win dst_b inA_b))