val va_quick_Fast_add1_stdcall (win: bool) (dst_b inA_b: buffer64) (inB_in: nat64)
    : (va_quickCode unit (va_code_Fast_add1_stdcall win))
let va_quick_Fast_add1_stdcall (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_in:nat64) :
  (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
  (va_QProc (va_code_Fast_add1_stdcall win) ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout;
    va_Mod_mem_heaplet 0; va_Mod_flags; 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 rRsp;
    va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx;
    va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_add1_stdcall win dst_b inA_b
    inB_in) (va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in))
val va_quick_Fast_add1_stdcall (win: bool) (dst_b inA_b: buffer64) (inB_in: nat64)
    : (va_quickCode unit (va_code_Fast_add1_stdcall win))
let va_quick_Fast_add1_stdcall (win: bool) (dst_b inA_b: buffer64) (inB_in: nat64)
    : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(va_QProc (va_code_Fast_add1_stdcall win)
    ([
        va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags;
        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 rRsp; va_Mod_reg64 rRbp;
        va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx;
        va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem
      ])
    (va_wp_Fast_add1_stdcall win dst_b inA_b inB_in)
    (va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in))
Vale.Curve25519.X64.FastUtil.fsti.checked
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 Vale.Arch.HeapImpl.fsti.checked prims.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked
Vale.Curve25519.X64.FastUtil.fsti
Prims.bool Vale.X64.Memory.buffer64 Vale.X64.Memory.nat64 Vale.X64.QuickCode.va_QProc Prims.unit Vale.Curve25519.X64.FastUtil.va_code_Fast_add1_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_layout Vale.X64.QuickCode.va_Mod_mem_heaplet Vale.X64.QuickCode.va_Mod_flags Vale.X64.QuickCode.va_Mod_reg64 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.rRsp Vale.X64.Machine_s.rRbp Vale.X64.Machine_s.rRdi Vale.X64.Machine_s.rRsi 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.FastUtil.va_wp_Fast_add1_stdcall Vale.Curve25519.X64.FastUtil.va_wpProof_Fast_add1_stdcall Vale.X64.QuickCode.va_quickCode
module Vale.Curve25519.X64.FastUtil
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.HeapImpl
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_add1

val va_code_Fast_add1 : va_dummy:unit -> Tot va_code

val va_codegen_success_Fast_add1 : va_dummy:unit -> Tot va_pbool
let va_req_Fast_add1 (va_b0:va_code) (va_s0:va_state) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64)
  : prop =
  (va_require_total va_b0 (va_code_Fast_add1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
    (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let
    (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let
    (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let
    (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let
    (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled
    /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\
    (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
    Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
    (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0)
    (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ inB == va_get_reg64 rRdx
    va_s0))
let va_ens_Fast_add1 (va_b0:va_code) (va_s0:va_state) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64)
  (va_sM:va_state) (va_fM:va_fuel) : prop =
  (va_req_Fast_add1 va_b0 va_s0 dst_b inA_b inB /\ 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
    (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
    (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
    (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
    (va_get_mem 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 (va_get_mem va_sM) in let d1 =
    Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 =
    Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 =
    Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let d =
    Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a +
    va_get_reg64 rRdx va_s0 /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem
    va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
    (va_update_mem_heaplet 0 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 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))

val va_lemma_Fast_add1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
  inB:nat64
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Fast_add1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
    (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let
    (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let
    (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let
    (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let
    (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled
    /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\
    (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
    Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
    (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0)
    (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ inB == va_get_reg64 rRdx
    va_s0)))
  (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 (va_get_mem va_s0) in
    let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in
    let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in
    let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem 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 (va_get_mem va_sM) in let d1 =
    Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 =
    Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 =
    Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let d =
    Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a +
    va_get_reg64 rRdx va_s0 /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem
    va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
    (va_update_mem_heaplet 0 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 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))
[@ va_qattr]
let va_wp_Fast_add1 (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) (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
    (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
    (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
    (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
    (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
    adx_enabled /\ bmi2_enabled /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0)
    (va_get_mem va_s0) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
    Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
    (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0)
    (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ inB == va_get_reg64 rRdx
    va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_r8:nat64)
    (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
    (va_x_memLayout:vale_heap_layout) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
    va_x_efl (va_upd_mem_layout va_x_memLayout (va_upd_mem_heaplet 0 va_x_heap0 (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 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
    (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
    (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
    (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
    (va_get_mem 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 (va_get_mem va_sM) in let d1 =
    Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 =
    Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 =
    Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let d =
    Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a +
    va_get_reg64 rRdx va_s0 /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem
    va_sM)) ==> va_k va_sM (())))

val va_wpProof_Fast_add1 : dst_b:buffer64 -> inA_b:buffer64 -> inB:nat64 -> 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_add1 dst_b inA_b inB va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add1 ()) ([va_Mod_flags;
    va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
    rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; 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_add1 (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) : (va_quickCode unit
  (va_code_Fast_add1 ())) =
  (va_QProc (va_code_Fast_add1 ()) ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
    va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx;
    va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_add1 dst_b inA_b inB) (va_wpProof_Fast_add1 dst_b
    inA_b inB))
//--
//-- Fast_add1_stdcall

val va_code_Fast_add1_stdcall : win:bool -> Tot va_code

val va_codegen_success_Fast_add1_stdcall : win:bool -> Tot va_pbool
let va_req_Fast_add1_stdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (dst_b:buffer64)
  (inA_b:buffer64) (inB_in:nat64) : prop =
  (va_require_total va_b0 (va_code_Fast_add1_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) /\ Vale.X64.Memory.is_initial_heap
    (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (adx_enabled /\ bmi2_enabled) /\
    (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\ inB_in = (if win then
    va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) /\ Vale.X64.Decls.validDstAddrs64
    (va_get_mem va_s0) dst_in dst_b 4 (va_get_mem_layout va_s0) Secret /\
    Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inA_in inA_b 4 (va_get_mem_layout va_s0)
    Secret))
let va_ens_Fast_add1_stdcall (va_b0:va_code) (va_s0:va_state) (win:bool) (dst_b:buffer64)
  (inA_b:buffer64) (inB_in:nat64) (va_sM:va_state) (va_fM:va_fuel) : prop =
  (va_req_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in /\ 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 va_s0) in let a1 =
    Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let a2 =
    Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3 =
    Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let d0 =
    Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 =
    Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 =
    Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 =
    Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let a =
    Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five
    d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + inB_in /\ Vale.X64.Decls.modifies_buffer
    dst_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (win ==> va_get_reg64 rRbx va_sM == va_get_reg64
    rRbx va_s0) /\ (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (win ==>
    va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win ==> va_get_reg64 rRsi va_sM ==
    va_get_reg64 rRsi va_s0) /\ (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\
    (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (win ==> va_get_reg64 rR14
    va_sM == va_get_reg64 rR14 va_s0) /\ (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15
    va_s0) /\ (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (~win ==>
    va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (~win ==> va_get_reg64 rR13 va_sM ==
    va_get_reg64 rR13 va_s0) /\ (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\
    (~win ==> 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_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags 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 rRsp va_sM (va_update_reg64 rRbp va_sM
    (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi 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)))))))))))))))))))))))

val va_lemma_Fast_add1_stdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> dst_b:buffer64 ->
  inA_b:buffer64 -> inB_in:nat64
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Fast_add1_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) /\ Vale.X64.Memory.is_initial_heap
    (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (adx_enabled /\ bmi2_enabled) /\
    (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\ inB_in = (if win then
    va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) /\ Vale.X64.Decls.validDstAddrs64
    (va_get_mem va_s0) dst_in dst_b 4 (va_get_mem_layout va_s0) Secret /\
    Vale.X64.Decls.validSrcAddrs64 (va_get_mem 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 va_s0) in let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0)
    in let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3 =
    Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let d0 =
    Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 =
    Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 =
    Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 =
    Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let a =
    Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five
    d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + inB_in /\ Vale.X64.Decls.modifies_buffer
    dst_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (win ==> va_get_reg64 rRbx va_sM == va_get_reg64
    rRbx va_s0) /\ (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (win ==>
    va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win ==> va_get_reg64 rRsi va_sM ==
    va_get_reg64 rRsi va_s0) /\ (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\
    (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (win ==> va_get_reg64 rR14
    va_sM == va_get_reg64 rR14 va_s0) /\ (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15
    va_s0) /\ (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (~win ==>
    va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (~win ==> va_get_reg64 rR13 va_sM ==
    va_get_reg64 rR13 va_s0) /\ (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\
    (~win ==> 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_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags 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 rRsp va_sM (va_update_reg64 rRbp va_sM
    (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi 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_add1_stdcall (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_in:nat64)
  (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) /\
    Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (adx_enabled /\
    bmi2_enabled) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\ inB_in =
    va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) /\
    Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) dst_in dst_b 4 (va_get_mem_layout va_s0)
    Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem 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_rsi:nat64) (va_x_rdi:nat64) (va_x_rbp:nat64)
    (va_x_rsp: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_efl:Vale.X64.Flags.t)
    (va_x_heap0:vale_heap) (va_x_memLayout:vale_heap_layout) (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_layout va_x_memLayout (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags
    va_x_efl (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 rRsp va_x_rsp (va_upd_reg64 rRbp va_x_rbp (va_upd_reg64 rRdi va_x_rdi
    (va_upd_reg64 rRsi va_x_rsi (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 va_s0) in let a1 =
    Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let a2 =
    Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3 =
    Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let d0 =
    Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 =
    Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 =
    Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 =
    Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let a =
    Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five
    d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + inB_in /\ Vale.X64.Decls.modifies_buffer
    dst_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (win ==> va_get_reg64 rRbx va_sM == va_get_reg64
    rRbx va_s0) /\ (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (win ==>
    va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win ==> va_get_reg64 rRsi va_sM ==
    va_get_reg64 rRsi va_s0) /\ (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\
    (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (win ==> va_get_reg64 rR14
    va_sM == va_get_reg64 rR14 va_s0) /\ (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15
    va_s0) /\ (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (~win ==>
    va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (~win ==> va_get_reg64 rR13 va_sM ==
    va_get_reg64 rR13 va_s0) /\ (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\
    (~win ==> 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_add1_stdcall : win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_in:nat64 ->
  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_add1_stdcall win dst_b inA_b inB_in va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add1_stdcall win)
    ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags;
    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 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi;
    va_Mod_reg64 rRsi; 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_add1_stdcall (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_in:nat64) :
val va_quick_Fast_add1_stdcall (win: bool) (dst_b inA_b: buffer64) (inB_in: nat64)
    : (va_quickCode unit (va_code_Fast_add1_stdcall win))

    win: Prims.bool ->
    dst_b: Vale.X64.Memory.buffer64 ->
    inA_b: Vale.X64.Memory.buffer64 ->
    inB_in: Vale.X64.Memory.nat64
  -> Vale.X64.QuickCode.va_quickCode Prims.unit
      (Vale.Curve25519.X64.FastUtil.va_code_Fast_add1_stdcall win)