val va_lemma_Handle_ctr32 : va_b0:va_code -> va_s0:va_state -> ctr_BE:quad32
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Handle_ctr32 ()) va_s0 /\ va_get_ok va_s0 /\
    (avx_enabled /\ sse_enabled /\ va_get_xmm 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32
    ctr_BE)))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    (va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm
    14 va_sM, va_get_xmm 1 va_sM) == xor_reverse_inc32lite_6 2 1 ctr_BE (va_get_xmm 15 va_sM) /\
    va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM
    (va_update_xmm 12 va_sM (va_update_xmm 11 va_sM (va_update_xmm 10 va_sM (va_update_xmm 6 va_sM
    (va_update_xmm 5 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_xmm 0 va_sM
    (va_update_reg64 rR11 va_sM (va_update_ok va_sM va_s0)))))))))))))))
let va_lemma_Handle_ctr32 va_b0 va_s0 ctr_BE =
  let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm
    11; va_Mod_xmm 10; va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_xmm 0;
    va_Mod_reg64 rR11; va_Mod_ok] in
  let va_qc = va_qcode_Handle_ctr32 va_mods ctr_BE in
  let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Handle_ctr32 ()) va_qc va_s0 (fun va_s0
    va_sM va_g -> let () = va_g in label va_range1
    "***** POSTCONDITION NOT MET AT line 234 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_get_ok va_sM) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 254 column 107 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    ((va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM,
    va_get_xmm 14 va_sM, va_get_xmm 1 va_sM) == xor_reverse_inc32lite_6 2 1 ctr_BE (va_get_xmm 15
    va_sM))) in
  assert_norm (va_qc.mods == va_mods);
  va_lemma_norm_mods ([va_Mod_flags; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm 11;
    va_Mod_xmm 10; va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_xmm 0;
    va_Mod_reg64 rR11; va_Mod_ok]) va_sM va_s0;
  (va_sM, va_fM)
val va_lemma_Handle_ctr32 : va_b0:va_code -> va_s0:va_state -> ctr_BE:quad32
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Handle_ctr32 ()) va_s0 /\ va_get_ok va_s0 /\
    (avx_enabled /\ sse_enabled /\ va_get_xmm 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32
    ctr_BE)))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    (va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm
    14 va_sM, va_get_xmm 1 va_sM) == xor_reverse_inc32lite_6 2 1 ctr_BE (va_get_xmm 15 va_sM) /\
    va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM
    (va_update_xmm 12 va_sM (va_update_xmm 11 va_sM (va_update_xmm 10 va_sM (va_update_xmm 6 va_sM
    (va_update_xmm 5 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_xmm 0 va_sM
    (va_update_reg64 rR11 va_sM (va_update_ok va_sM va_s0)))))))))))))))
let va_lemma_Handle_ctr32 va_b0 va_s0 ctr_BE =
let va_mods:va_mods_t =
  [
    va_Mod_flags; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm 11; va_Mod_xmm 10;
    va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_xmm 0; va_Mod_reg64 rR11;
    va_Mod_ok
  ]
in
let va_qc = va_qcode_Handle_ctr32 va_mods ctr_BE in
let va_sM, va_fM, va_g =
  va_wp_sound_code_norm (va_code_Handle_ctr32 ())
    va_qc
    va_s0
    (fun va_s0 va_sM va_g ->
        let () = va_g in
        label va_range1
          "***** POSTCONDITION NOT MET AT line 234 column 1 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
          (va_get_ok va_sM) /\
        label va_range1
          "***** POSTCONDITION NOT MET AT line 254 column 107 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
          ((va_get_xmm 10 va_sM,
              va_get_xmm 11 va_sM,
              va_get_xmm 12 va_sM,
              va_get_xmm 13 va_sM,
              va_get_xmm 14 va_sM,
              va_get_xmm 1 va_sM) ==
            xor_reverse_inc32lite_6 2 1 ctr_BE (va_get_xmm 15 va_sM)))
in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([
      va_Mod_flags; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm 11; va_Mod_xmm 10;
      va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_xmm 0; va_Mod_reg64 rR11;
      va_Mod_ok
    ])
  va_sM
  va_s0;
(va_sM, va_fM)
Vale.AES.X64.AESopt.fst.checked
Vale.X64.State.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.InsVector.fsti.checked Vale.X64.InsMem.fsti.checked Vale.X64.InsBasic.fsti.checked Vale.X64.InsAes.fsti.checked Vale.X64.Flags.fsti.checked Vale.X64.Decls.fsti.checked Vale.X64.CPU_Features_s.fst.checked Vale.Transformers.Transform.fsti.checked Vale.Math.Poly2_s.fsti.checked Vale.Math.Poly2.Bits_s.fsti.checked Vale.Math.Poly2.Bits.fsti.checked Vale.Def.Words_s.fsti.checked Vale.Def.Types_s.fst.checked Vale.Def.Prop_s.fst.checked Vale.Def.Opaque_s.fsti.checked Vale.Arch.TypesNative.fsti.checked Vale.Arch.Types.fsti.checked Vale.Arch.HeapImpl.fsti.checked Vale.AES.X64.PolyOps.fsti.checked Vale.AES.X64.AESopt2.fsti.checked Vale.AES.X64.AESGCM_expected_code.fsti.checked Vale.AES.GHash.fsti.checked Vale.AES.GF128_s.fsti.checked Vale.AES.GF128.fsti.checked Vale.AES.GCTR_s.fst.checked Vale.AES.GCTR.fsti.checked Vale.AES.GCM_helpers.fsti.checked Vale.AES.AES_s.fst.checked Vale.AES.AES_helpers.fsti.checked Vale.AES.AES_common_s.fst.checked prims.fst.checked FStar.Seq.Base.fsti.checked FStar.Seq.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked FStar.Mul.fst.checked
Vale.AES.X64.AESopt.fst
Vale.X64.Decls.va_code Vale.X64.Decls.va_state Vale.X64.Decls.quad32 Vale.X64.QuickCodes.fuel Prims.unit FStar.Pervasives.Native.Mktuple2 Vale.X64.Decls.va_fuel Vale.X64.QuickCode.va_lemma_norm_mods Prims.Cons Vale.X64.QuickCode.mod_t Vale.X64.QuickCode.va_Mod_flags Vale.X64.QuickCode.va_Mod_xmm Vale.X64.QuickCode.va_Mod_reg64 Vale.X64.Machine_s.rR11 Vale.X64.QuickCode.va_Mod_ok Prims.Nil FStar.Pervasives.assert_norm Prims.eq2 Prims.list Vale.X64.QuickCode.__proj__QProc__item__mods Vale.AES.X64.AESopt.va_code_Handle_ctr32 FStar.Pervasives.Native.tuple2 FStar.Pervasives.Native.tuple3 Vale.X64.State.vale_state Vale.X64.QuickCodes.va_wp_sound_code_norm Prims.l_and Vale.X64.QuickCodes.label Vale.X64.QuickCodes.va_range1 Prims.b2t Vale.X64.Decls.va_get_ok FStar.Pervasives.Native.tuple6 FStar.Pervasives.Native.Mktuple6 Vale.X64.Decls.va_get_xmm Vale.AES.X64.AESopt.xor_reverse_inc32lite_6 Vale.X64.QuickCode.quickCode Vale.AES.X64.AESopt.va_qcode_Handle_ctr32
module Vale.AES.X64.AESopt
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Types_s
open FStar.Seq
open Vale.Arch.Types
open Vale.Arch.HeapImpl
open Vale.AES.AES_s
open Vale.X64.Machine_s
open Vale.X64.Memory
open Vale.X64.State
open Vale.X64.Decls
open Vale.X64.InsBasic
open Vale.X64.InsMem
open Vale.X64.InsVector
open Vale.X64.InsAes
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open Vale.AES.AES_helpers
//open Vale.Poly1305.Math    // For lemma_poly_bits64()
open Vale.AES.GCM_helpers
open Vale.AES.GCTR_s
open Vale.AES.GCTR
open Vale.Arch.TypesNative
open Vale.X64.CPU_Features_s
open Vale.Math.Poly2_s
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.AES.GHash
open Vale.AES.X64.PolyOps
open Vale.AES.X64.AESopt2
open Vale.AES.X64.AESGCM_expected_code
open Vale.Transformers.Transform
open FStar.Mul
let add = Vale.Math.Poly2_s.add
#reset-options "--z3rlimit 30"
//-- finish_aes_encrypt_le


val finish_aes_encrypt_le : alg:algorithm -> input_LE:quad32 -> key:(seq nat32)
  -> Lemma
  (requires (Vale.AES.AES_s.is_aes_key_LE alg key))
  (ensures (Vale.AES.AES_s.aes_encrypt_LE alg key input_LE == Vale.AES.AES_s.eval_cipher alg
    input_LE (Vale.AES.AES_s.key_to_round_keys_LE alg key)))
let finish_aes_encrypt_le alg input_LE key =
  Vale.AES.AES_s.aes_encrypt_LE_reveal ();
  Vale.AES.AES_s.eval_cipher_reveal ();
  ()
//--
//-- Load_two_lsb

[@ "opaque_to_smt"]
let va_code_Load_two_lsb dst =
  (va_Block (va_CCons (va_code_ZeroXmm dst) (va_CCons (va_code_PinsrqImm dst 2 0
    (va_op_reg_opr64_reg64 rR11)) (va_CNil ()))))

[@ "opaque_to_smt"]
let va_codegen_success_Load_two_lsb dst =
  (va_pbool_and (va_codegen_success_ZeroXmm dst) (va_pbool_and (va_codegen_success_PinsrqImm dst 2
    0 (va_op_reg_opr64_reg64 rR11)) (va_ttrue ())))

[@"opaque_to_smt"]
let va_lemma_Load_two_lsb va_b0 va_s0 dst =
  va_reveal_opaque (`%va_code_Load_two_lsb) (va_code_Load_two_lsb dst);
  let (va_old_s:va_state) = va_s0 in
  let (va_b1:va_codes) = va_get_block va_b0 in
  let (va_s3, va_fc3) = va_lemma_ZeroXmm (va_hd va_b1) va_s0 dst in
  let va_b3 = va_tl va_b1 in
  Vale.Arch.Types.lemma_insert_nat64_nat32s (va_eval_xmm va_s3 dst) 2 0;
  assert (Vale.Arch.Types.two_to_nat32 (Vale.Def.Words_s.Mktwo #Vale.Def.Words_s.nat32 2 0) == 2);
  let (va_s6, va_fc6) = va_lemma_PinsrqImm (va_hd va_b3) va_s3 dst 2 0 (va_op_reg_opr64_reg64 rR11)
    in
  let va_b6 = va_tl va_b3 in
  let (va_sM, va_f6) = va_lemma_empty_total va_s6 va_b6 in
  let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc6 va_s6 va_f6 va_sM in
  let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in
  (va_sM, va_fM)


[@"opaque_to_smt"]
let va_wpProof_Load_two_lsb dst va_s0 va_k =
  let (va_sM, va_f0) = va_lemma_Load_two_lsb (va_code_Load_two_lsb dst) va_s0 dst in
  va_lemma_upd_update va_sM;
  assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_ok va_sM
    (va_update_operand_xmm dst va_sM va_s0)))));
  va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_mod_xmm dst]) va_sM va_s0;
  let va_g = () in
  (va_sM, va_f0, va_g)

//--
//-- Load_0xc2_msb

val va_code_Load_0xc2_msb : dst:va_operand_xmm -> Tot va_code
[@ "opaque_to_smt"]
let va_code_Load_0xc2_msb dst =
  (va_Block (va_CCons (va_code_ZeroXmm dst) (va_CCons (va_code_PinsrqImm dst 13979173243358019584 1
    (va_op_reg_opr64_reg64 rR11)) (va_CNil ()))))

val va_codegen_success_Load_0xc2_msb : dst:va_operand_xmm -> Tot va_pbool
[@ "opaque_to_smt"]
let va_codegen_success_Load_0xc2_msb dst =
  (va_pbool_and (va_codegen_success_ZeroXmm dst) (va_pbool_and (va_codegen_success_PinsrqImm dst
    13979173243358019584 1 (va_op_reg_opr64_reg64 rR11)) (va_ttrue ())))


val va_lemma_Load_0xc2_msb : va_b0:va_code -> va_s0:va_state -> dst:va_operand_xmm
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Load_0xc2_msb dst) va_s0 /\ va_is_dst_xmm dst va_s0 /\
    va_get_ok va_s0 /\ sse_enabled))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    va_eval_xmm va_sM dst == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 3254779904 /\
    va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_ok va_sM
    (va_update_operand_xmm dst va_sM va_s0))))))
[@"opaque_to_smt"]
let va_lemma_Load_0xc2_msb va_b0 va_s0 dst =
  va_reveal_opaque (`%va_code_Load_0xc2_msb) (va_code_Load_0xc2_msb dst);
  let (va_old_s:va_state) = va_s0 in
  let (va_b1:va_codes) = va_get_block va_b0 in
  let (va_s3, va_fc3) = va_lemma_ZeroXmm (va_hd va_b1) va_s0 dst in
  let va_b3 = va_tl va_b1 in
  assert (Vale.Arch.Types.two_to_nat32 (Vale.Def.Words_s.Mktwo #Vale.Def.Words_s.nat32 0
    3254779904) == 13979173243358019584);
  Vale.Arch.Types.lemma_insert_nat64_nat32s (va_eval_xmm va_s3 dst) 0 3254779904;
  let (va_s6, va_fc6) = va_lemma_PinsrqImm (va_hd va_b3) va_s3 dst 13979173243358019584 1
    (va_op_reg_opr64_reg64 rR11) in
  let va_b6 = va_tl va_b3 in
  let (va_sM, va_f6) = va_lemma_empty_total va_s6 va_b6 in
  let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc6 va_s6 va_f6 va_sM in
  let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in
  (va_sM, va_fM)

[@ va_qattr]
let va_wp_Load_0xc2_msb (dst:va_operand_xmm) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) :
  Type0 =
  (va_is_dst_xmm dst va_s0 /\ va_get_ok va_s0 /\ sse_enabled /\ (forall (va_x_dst:va_value_xmm)
    (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64
    rR11 va_x_r11 (va_upd_operand_xmm dst va_x_dst va_s0)) in va_get_ok va_sM /\ va_eval_xmm va_sM
    dst == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 3254779904 ==> va_k va_sM (())))


val va_wpProof_Load_0xc2_msb : dst:va_operand_xmm -> va_s0:va_state -> va_k:(va_state -> unit ->
  Type0)
  -> Ghost (va_state & va_fuel & unit)
  (requires (va_t_require va_s0 /\ va_wp_Load_0xc2_msb dst va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Load_0xc2_msb dst) ([va_Mod_flags;
    va_Mod_reg64 rR11; va_mod_xmm dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Load_0xc2_msb dst va_s0 va_k =
  let (va_sM, va_f0) = va_lemma_Load_0xc2_msb (va_code_Load_0xc2_msb dst) va_s0 dst in
  va_lemma_upd_update va_sM;
  assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_ok va_sM
    (va_update_operand_xmm dst va_sM va_s0)))));
  va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_mod_xmm dst]) va_sM va_s0;
  let va_g = () in
  (va_sM, va_f0, va_g)

[@ "opaque_to_smt" va_qattr]
let va_quick_Load_0xc2_msb (dst:va_operand_xmm) : (va_quickCode unit (va_code_Load_0xc2_msb dst)) =
  (va_QProc (va_code_Load_0xc2_msb dst) ([va_Mod_flags; va_Mod_reg64 rR11; va_mod_xmm dst])
    (va_wp_Load_0xc2_msb dst) (va_wpProof_Load_0xc2_msb dst))
//--
//-- Load_one_lsb

[@ "opaque_to_smt"]
let va_code_Load_one_lsb dst =
  (va_Block (va_CCons (va_code_ZeroXmm dst) (va_CCons (va_code_PinsrqImm dst 1 0
    (va_op_reg_opr64_reg64 rR11)) (va_CNil ()))))

[@ "opaque_to_smt"]
let va_codegen_success_Load_one_lsb dst =
  (va_pbool_and (va_codegen_success_ZeroXmm dst) (va_pbool_and (va_codegen_success_PinsrqImm dst 1
    0 (va_op_reg_opr64_reg64 rR11)) (va_ttrue ())))

[@"opaque_to_smt"]
let va_lemma_Load_one_lsb va_b0 va_s0 dst =
  va_reveal_opaque (`%va_code_Load_one_lsb) (va_code_Load_one_lsb dst);
  let (va_old_s:va_state) = va_s0 in
  let (va_b1:va_codes) = va_get_block va_b0 in
  let (va_s3, va_fc3) = va_lemma_ZeroXmm (va_hd va_b1) va_s0 dst in
  let va_b3 = va_tl va_b1 in
  Vale.Arch.Types.lemma_insert_nat64_nat32s (va_eval_xmm va_s3 dst) 1 0;
  assert (Vale.Arch.Types.two_to_nat32 (Vale.Def.Words_s.Mktwo #Vale.Def.Words_s.nat32 1 0) == 1);
  let (va_s6, va_fc6) = va_lemma_PinsrqImm (va_hd va_b3) va_s3 dst 1 0 (va_op_reg_opr64_reg64 rR11)
    in
  let va_b6 = va_tl va_b3 in
  let (va_sM, va_f6) = va_lemma_empty_total va_s6 va_b6 in
  let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc6 va_s6 va_f6 va_sM in
  let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in
  (va_sM, va_fM)


[@"opaque_to_smt"]
let va_wpProof_Load_one_lsb dst va_s0 va_k =
  let (va_sM, va_f0) = va_lemma_Load_one_lsb (va_code_Load_one_lsb dst) va_s0 dst in
  va_lemma_upd_update va_sM;
  assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_ok va_sM
    (va_update_operand_xmm dst va_sM va_s0)))));
  va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_mod_xmm dst]) va_sM va_s0;
  let va_g = () in
  (va_sM, va_f0, va_g)

//--
//-- Handle_ctr32

val va_code_Handle_ctr32 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Handle_ctr32 () =
  (va_Block (va_CCons (va_code_InitPshufbMask (va_op_xmm_xmm 0) (va_op_reg_opr64_reg64 rR11))
    (va_CCons (va_code_VPshufb (va_op_xmm_xmm 6) (va_op_xmm_xmm 1) (va_op_xmm_xmm 0)) (va_CCons
    (va_code_Load_one_lsb (va_op_xmm_xmm 5)) (va_CCons (va_code_VPaddd (va_op_xmm_xmm 10)
    (va_op_xmm_xmm 6) (va_op_xmm_xmm 5)) (va_CCons (va_code_Load_two_lsb (va_op_xmm_xmm 5))
    (va_CCons (va_code_VPaddd (va_op_xmm_xmm 11) (va_op_xmm_xmm 6) (va_op_xmm_xmm 5)) (va_CCons
    (va_code_VPaddd (va_op_xmm_xmm 12) (va_op_xmm_xmm 10) (va_op_xmm_xmm 5)) (va_CCons
    (va_code_VPshufb (va_op_xmm_xmm 10) (va_op_xmm_xmm 10) (va_op_xmm_xmm 0)) (va_CCons
    (va_code_VPaddd (va_op_xmm_xmm 13) (va_op_xmm_xmm 11) (va_op_xmm_xmm 5)) (va_CCons
    (va_code_VPshufb (va_op_xmm_xmm 11) (va_op_xmm_xmm 11) (va_op_xmm_xmm 0)) (va_CCons
    (va_code_VPxor (va_op_xmm_xmm 10) (va_op_xmm_xmm 10) (va_op_opr128_xmm 15)) (va_CCons
    (va_code_VPaddd (va_op_xmm_xmm 14) (va_op_xmm_xmm 12) (va_op_xmm_xmm 5)) (va_CCons
    (va_code_VPshufb (va_op_xmm_xmm 12) (va_op_xmm_xmm 12) (va_op_xmm_xmm 0)) (va_CCons
    (va_code_VPxor (va_op_xmm_xmm 11) (va_op_xmm_xmm 11) (va_op_opr128_xmm 15)) (va_CCons
    (va_code_VPaddd (va_op_xmm_xmm 1) (va_op_xmm_xmm 13) (va_op_xmm_xmm 5)) (va_CCons
    (va_code_VPshufb (va_op_xmm_xmm 13) (va_op_xmm_xmm 13) (va_op_xmm_xmm 0)) (va_CCons
    (va_code_VPshufb (va_op_xmm_xmm 14) (va_op_xmm_xmm 14) (va_op_xmm_xmm 0)) (va_CCons
    (va_code_VPshufb (va_op_xmm_xmm 1) (va_op_xmm_xmm 1) (va_op_xmm_xmm 0)) (va_CNil
    ()))))))))))))))))))))

val va_codegen_success_Handle_ctr32 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Handle_ctr32 () =
  (va_pbool_and (va_codegen_success_InitPshufbMask (va_op_xmm_xmm 0) (va_op_reg_opr64_reg64 rR11))
    (va_pbool_and (va_codegen_success_VPshufb (va_op_xmm_xmm 6) (va_op_xmm_xmm 1) (va_op_xmm_xmm
    0)) (va_pbool_and (va_codegen_success_Load_one_lsb (va_op_xmm_xmm 5)) (va_pbool_and
    (va_codegen_success_VPaddd (va_op_xmm_xmm 10) (va_op_xmm_xmm 6) (va_op_xmm_xmm 5))
    (va_pbool_and (va_codegen_success_Load_two_lsb (va_op_xmm_xmm 5)) (va_pbool_and
    (va_codegen_success_VPaddd (va_op_xmm_xmm 11) (va_op_xmm_xmm 6) (va_op_xmm_xmm 5))
    (va_pbool_and (va_codegen_success_VPaddd (va_op_xmm_xmm 12) (va_op_xmm_xmm 10) (va_op_xmm_xmm
    5)) (va_pbool_and (va_codegen_success_VPshufb (va_op_xmm_xmm 10) (va_op_xmm_xmm 10)
    (va_op_xmm_xmm 0)) (va_pbool_and (va_codegen_success_VPaddd (va_op_xmm_xmm 13) (va_op_xmm_xmm
    11) (va_op_xmm_xmm 5)) (va_pbool_and (va_codegen_success_VPshufb (va_op_xmm_xmm 11)
    (va_op_xmm_xmm 11) (va_op_xmm_xmm 0)) (va_pbool_and (va_codegen_success_VPxor (va_op_xmm_xmm
    10) (va_op_xmm_xmm 10) (va_op_opr128_xmm 15)) (va_pbool_and (va_codegen_success_VPaddd
    (va_op_xmm_xmm 14) (va_op_xmm_xmm 12) (va_op_xmm_xmm 5)) (va_pbool_and
    (va_codegen_success_VPshufb (va_op_xmm_xmm 12) (va_op_xmm_xmm 12) (va_op_xmm_xmm 0))
    (va_pbool_and (va_codegen_success_VPxor (va_op_xmm_xmm 11) (va_op_xmm_xmm 11) (va_op_opr128_xmm
    15)) (va_pbool_and (va_codegen_success_VPaddd (va_op_xmm_xmm 1) (va_op_xmm_xmm 13)
    (va_op_xmm_xmm 5)) (va_pbool_and (va_codegen_success_VPshufb (va_op_xmm_xmm 13) (va_op_xmm_xmm
    13) (va_op_xmm_xmm 0)) (va_pbool_and (va_codegen_success_VPshufb (va_op_xmm_xmm 14)
    (va_op_xmm_xmm 14) (va_op_xmm_xmm 0)) (va_pbool_and (va_codegen_success_VPshufb (va_op_xmm_xmm
    1) (va_op_xmm_xmm 1) (va_op_xmm_xmm 0)) (va_ttrue ())))))))))))))))))))

[@ "opaque_to_smt" va_qattr]
let va_qcode_Handle_ctr32 (va_mods:va_mods_t) (ctr_BE:quad32) : (va_quickCode unit
  (va_code_Handle_ctr32 ())) =
  (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 256 column 19 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_InitPshufbMask (va_op_xmm_xmm 0) (va_op_reg_opr64_reg64 rR11)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 257 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPshufb (va_op_xmm_xmm 6) (va_op_xmm_xmm 1) (va_op_xmm_xmm 0)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 261 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_Load_one_lsb (va_op_xmm_xmm 5)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 262 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPaddd (va_op_xmm_xmm 10) (va_op_xmm_xmm 6) (va_op_xmm_xmm 5)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 263 column 17 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_Load_two_lsb (va_op_xmm_xmm 5)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 264 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPaddd (va_op_xmm_xmm 11) (va_op_xmm_xmm 6) (va_op_xmm_xmm 5)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 265 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPaddd (va_op_xmm_xmm 12) (va_op_xmm_xmm 10) (va_op_xmm_xmm 5)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 266 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPshufb (va_op_xmm_xmm 10) (va_op_xmm_xmm 10) (va_op_xmm_xmm 0)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 267 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPaddd (va_op_xmm_xmm 13) (va_op_xmm_xmm 11) (va_op_xmm_xmm 5)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 268 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPshufb (va_op_xmm_xmm 11) (va_op_xmm_xmm 11) (va_op_xmm_xmm 0)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 269 column 10 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPxor (va_op_xmm_xmm 10) (va_op_xmm_xmm 10) (va_op_opr128_xmm 15)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 270 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPaddd (va_op_xmm_xmm 14) (va_op_xmm_xmm 12) (va_op_xmm_xmm 5)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 271 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPshufb (va_op_xmm_xmm 12) (va_op_xmm_xmm 12) (va_op_xmm_xmm 0)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 272 column 10 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPxor (va_op_xmm_xmm 11) (va_op_xmm_xmm 11) (va_op_opr128_xmm 15)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 273 column 11 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPaddd (va_op_xmm_xmm 1) (va_op_xmm_xmm 13) (va_op_xmm_xmm 5)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 274 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPshufb (va_op_xmm_xmm 13) (va_op_xmm_xmm 13) (va_op_xmm_xmm 0)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 275 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPshufb (va_op_xmm_xmm 14) (va_op_xmm_xmm 14) (va_op_xmm_xmm 0)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 276 column 12 of file /home/gebner/everest/hacl-star/vale/code/thirdPartyPorts/OpenSSL/aes/Vale.AES.X64.AESopt.vaf *****"
    (va_quick_VPshufb (va_op_xmm_xmm 1) (va_op_xmm_xmm 1) (va_op_xmm_xmm 0)) (va_QEmpty
    (())))))))))))))))))))))


val va_lemma_Handle_ctr32 : va_b0:va_code -> va_s0:va_state -> ctr_BE:quad32
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Handle_ctr32 ()) va_s0 /\ va_get_ok va_s0 /\
    (avx_enabled /\ sse_enabled /\ va_get_xmm 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32
    ctr_BE)))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    (va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm
    14 va_sM, va_get_xmm 1 va_sM) == xor_reverse_inc32lite_6 2 1 ctr_BE (va_get_xmm 15 va_sM) /\
    va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM
    (va_update_xmm 12 va_sM (va_update_xmm 11 va_sM (va_update_xmm 10 va_sM (va_update_xmm 6 va_sM
    (va_update_xmm 5 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_xmm 0 va_sM
    (va_update_reg64 rR11 va_sM (va_update_ok va_sM va_s0)))))))))))))))
val va_lemma_Handle_ctr32 : va_b0:va_code -> va_s0:va_state -> ctr_BE:quad32
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Handle_ctr32 ()) va_s0 /\ va_get_ok va_s0 /\
    (avx_enabled /\ sse_enabled /\ va_get_xmm 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32
    ctr_BE)))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    (va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm
    14 va_sM, va_get_xmm 1 va_sM) == xor_reverse_inc32lite_6 2 1 ctr_BE (va_get_xmm 15 va_sM) /\
    va_state_eq va_sM (va_update_flags va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM
    (va_update_xmm 12 va_sM (va_update_xmm 11 va_sM (va_update_xmm 10 va_sM (va_update_xmm 6 va_sM
    (va_update_xmm 5 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_xmm 0 va_sM
    (va_update_reg64 rR11 va_sM (va_update_ok va_sM va_s0)))))))))))))))
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> ctr_BE: Vale.X64.Decls.quad32
  -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)