val va_lemma_Adox_64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
  src:va_operand_opr64
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Adox_64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst
    va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ adx_enabled /\ Vale.X64.Decls.valid_of
    (va_get_flags va_s0)))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    va_eval_dst_opr64 va_sM dst == Vale.Bignum.Defs.add_lo (va_eval_dst_opr64 va_s0 dst)
    (va_eval_opr64 va_s0 src) (flag_of (va_get_flags va_s0)) /\ update_of (va_get_flags va_sM)
    (Vale.Bignum.Defs.add_hi (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src) (flag_of
    (va_get_flags va_s0))) /\ maintain_cf (va_get_flags va_sM) (va_get_flags va_s0) /\ va_state_eq
    va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM
    va_s0)))))
let va_lemma_Adox_64 va_b0 va_s0 dst src =
  va_reveal_opaque (`%va_code_Adox_64) (va_code_Adox_64 dst src);
  let (va_old_s:va_state) = va_s0 in
  let (va_b1:va_codes) = va_get_block va_b0 in
  Vale.Bignum.Defs.reveal_add_hi_all ();
  Vale.Bignum.Defs.reveal_add_lo_all ();
  let (va_s4, va_fc4) = va_lemma_Adox64Wrap (va_hd va_b1) va_s0 dst src in
  let va_b4 = va_tl va_b1 in
  let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
  let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc4 va_s4 va_f4 va_sM in
  (va_sM, va_fM)
val va_lemma_Adox_64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
  src:va_operand_opr64
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Adox_64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst
    va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ adx_enabled /\ Vale.X64.Decls.valid_of
    (va_get_flags va_s0)))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    va_eval_dst_opr64 va_sM dst == Vale.Bignum.Defs.add_lo (va_eval_dst_opr64 va_s0 dst)
    (va_eval_opr64 va_s0 src) (flag_of (va_get_flags va_s0)) /\ update_of (va_get_flags va_sM)
    (Vale.Bignum.Defs.add_hi (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src) (flag_of
    (va_get_flags va_s0))) /\ maintain_cf (va_get_flags va_sM) (va_get_flags va_s0) /\ va_state_eq
    va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM
    va_s0)))))
let va_lemma_Adox_64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox_64) (va_code_Adox_64 dst src);
let va_old_s:va_state = va_s0 in
let va_b1:va_codes = va_get_block va_b0 in
Vale.Bignum.Defs.reveal_add_hi_all ();
Vale.Bignum.Defs.reveal_add_lo_all ();
let va_s4, va_fc4 = va_lemma_Adox64Wrap (va_hd va_b1) va_s0 dst src in
let va_b4 = va_tl va_b1 in
let va_sM, va_f4 = va_lemma_empty_total va_s4 va_b4 in
let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc4 va_s4 va_f4 va_sM in
(va_sM, va_fM)
Vale.Bignum.X64.fst.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.Decls.fsti.checked Vale.X64.CPU_Features_s.fst.checked Vale.Def.Words_s.fsti.checked Vale.Def.Types_s.fst.checked Vale.Bignum.Defs.fsti.checked Vale.Arch.Types.fsti.checked prims.fst.checked FStar.Seq.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked FStar.Mul.fst.checked
Vale.Bignum.X64.fst
Vale.X64.Decls.va_code Vale.X64.Decls.va_state Vale.X64.Decls.va_operand_dst_opr64 Vale.X64.Decls.va_operand_opr64 Vale.X64.Decls.va_fuel FStar.Pervasives.Native.Mktuple2 Vale.X64.Decls.va_lemma_merge_total FStar.Pervasives.Native.tuple2 Vale.X64.State.vale_state Vale.X64.Decls.va_lemma_empty_total Prims.list Vale.X64.Machine_s.precode Vale.X64.Decls.ins Vale.X64.Decls.ocmp Vale.X64.Decls.va_tl Vale.X64.InsBasic.va_lemma_Adox64Wrap Vale.X64.Decls.va_hd Prims.unit Vale.Bignum.Defs.reveal_add_lo_all Vale.Bignum.Defs.reveal_add_hi_all Vale.X64.Decls.va_get_block Vale.X64.Decls.va_reveal_opaque Vale.Bignum.X64.va_code_Adox_64
module Vale.Bignum.X64
open Vale.Def.Words_s
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.X64.CPU_Features_s
open Vale.Bignum.Defs
open FStar.Mul
open FStar.Seq
open Vale.Def.Words_s
let bool_to_nat1 (b:bool) : nat1 = if b then 1 else 0
let flag_cf f = bool_to_nat1 (cf f)
let flag_of f = bool_to_nat1 (overflow f)
//-- reveal_flags

let reveal_flags f =
  ()
//--
//-- lemma_add_hi_lo64

let lemma_add_hi_lo64 dummy =
  Vale.Bignum.Defs.reveal_add_hi_all ();
  Vale.Bignum.Defs.reveal_add_lo_all ();
  ()
//--
//-- Adcx_64

[@ "opaque_to_smt"]
let va_code_Adcx_64 dst src =
  (va_Block (va_CCons (va_code_Adcx64Wrap dst src) (va_CNil ())))

[@ "opaque_to_smt"]
let va_codegen_success_Adcx_64 dst src =
  (va_pbool_and (va_codegen_success_Adcx64Wrap dst src) (va_ttrue ()))

[@"opaque_to_smt"]
let va_lemma_Adcx_64 va_b0 va_s0 dst src =
  va_reveal_opaque (`%va_code_Adcx_64) (va_code_Adcx_64 dst src);
  let (va_old_s:va_state) = va_s0 in
  let (va_b1:va_codes) = va_get_block va_b0 in
  Vale.Bignum.Defs.reveal_add_hi_all ();
  Vale.Bignum.Defs.reveal_add_lo_all ();
  let (va_s4, va_fc4) = va_lemma_Adcx64Wrap (va_hd va_b1) va_s0 dst src in
  let va_b4 = va_tl va_b1 in
  let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
  let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc4 va_s4 va_f4 va_sM in
  (va_sM, va_fM)


[@"opaque_to_smt"]
let va_wpProof_Adcx_64 dst src va_s0 va_k =
  let (va_sM, va_f0) = va_lemma_Adcx_64 (va_code_Adcx_64 dst src) va_s0 dst src in
  va_lemma_upd_update va_sM;
  assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
    dst va_sM va_s0))));
  va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
  let va_g = () in
  (va_sM, va_f0, va_g)

//--
//-- Adox_64

[@ "opaque_to_smt"]
let va_code_Adox_64 dst src =
  (va_Block (va_CCons (va_code_Adox64Wrap dst src) (va_CNil ())))

[@ "opaque_to_smt"]
let va_codegen_success_Adox_64 dst src =
  (va_pbool_and (va_codegen_success_Adox64Wrap dst src) (va_ttrue ()))

[@"opaque_to_smt"]
val va_lemma_Adox_64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
  src:va_operand_opr64
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Adox_64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst
    va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ adx_enabled /\ Vale.X64.Decls.valid_of
    (va_get_flags va_s0)))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    va_eval_dst_opr64 va_sM dst == Vale.Bignum.Defs.add_lo (va_eval_dst_opr64 va_s0 dst)
    (va_eval_opr64 va_s0 src) (flag_of (va_get_flags va_s0)) /\ update_of (va_get_flags va_sM)
    (Vale.Bignum.Defs.add_hi (va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src) (flag_of
    (va_get_flags va_s0))) /\ maintain_cf (va_get_flags va_sM) (va_get_flags va_s0) /\ va_state_eq
    va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM
    va_s0)))))

    va_b0: Vale.X64.Decls.va_code ->
    va_s0: Vale.X64.Decls.va_state ->
    dst: Vale.X64.Decls.va_operand_dst_opr64 ->
    src: Vale.X64.Decls.va_operand_opr64
  -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)