From Stdlib Require Import Strings.String.
From Stdlib Require Import String Ascii.
From Stdlib Require Arith.
From stdpp Require Import base.
From stdpp Require Import fin_maps.
From stdpp Require Import gmap.
From stdpp Require Import base gmultiset.
From Stdlib Require Classical.
From Stdlib Require Import ZArith.
From stdpp.bitvector Require Import definitions tactics.
From Stdlib Require Import Sorting.Sorted.
From Stdlib Require Import Reals.Rbasic_fun.
From Stdlib Require Import Reals.Abstract.ConstructiveAbs.
From Stdlib Require Import Reals.Rdefinitions.
From stdpp Require Import list_relations.
From stdpp Require Import list_numbers.
From stdpp Require Import functions.
From Stdlib Require Import ClassicalEpsilon.
From stdpp Require Import base decidable.
From Stdlib Require Import ZArith.Zeuclid.
From Stdlib Require Import ZArith.Znumtheory.
From stdpp Require Import propset.
From Stdlib Require Import Reals.
Require Import Why3.Base.
Require Import Why3.Qed.Qed.
Require Import Why3.Memory.Memory.
Require Import Why3.Cint.Cint.
Require Import x509_parser.Compound.Compound.
Require Import Why3.Cbits.Cbits.
Open Scope Z_scope.
Lemma goal1 (a : addr) (t_9 : addr -> Z) (a_8 : addr) (t_15 : addr -> Z) (a_3 : addr) (t_12 : addr -> Z) (i_3 : Z) (t_14 : addr -> Z) (t_13 : addr -> Z) (a_7 : addr) (a_5 : addr) (i_5 : Z) (a_12 : addr) (t : Z -> Z) (i : Z) (i_1 : Z) (i_2 : Z) (i_4 : Z) (a_4 : addr) (a_6 : addr) (p : bool) (a_10 : addr) (t_8 : Z -> Z) (a_11 : addr) (a_1 : addr) (t_1 : Z -> Z) (p_1 : bool) (a_2 : addr) (t_10 : addr -> Z) (t_2 : Z -> Z) (p_2 : bool) (t_7 : Z -> Z) (a_9 : addr) (p_3 : bool) (t_4 : Z -> Z) (p_4 : bool) (t_6 : Z -> Z) (t_5 : Z -> Z) (t_11 : addr -> Z) (t_3 : Z -> Z) : let a_13 : addr := shift a 0%Z in let x : Z := t_9 a_13 in let a_14 : addr := shift a_8 1%Z in let x_1 : Z := t_15 a_14 in let a_15 : addr := shift a_3 0%Z in let x_2 : Z := t_12 a_15 in let a_16 : addr := shift a_3 3%Z in let x_3 : Z := to_uint16 (i_3 - 3%Z) in let a_17 : addr := shift a_3 1%Z in let x_4 : Z := t_14 a_17 in let x_5 : Z := land 192%Z x_4 in let a_18 : addr := shift a_3 2%Z in let x_6 : Z := land 192%Z (t_14 a_18) in let x_7 : Z := t_14 a_15 in let a_19 : addr := shift a_3 4%Z in let x_8 : Z := to_uint16 (i_3 - 4%Z) in let x_9 : Z := t_13 a_17 in let x_10 : Z := land 192%Z x_9 in let x_11 : Z := land 192%Z (t_13 a_18) in let x_12 : Z := land 192%Z (t_13 a_16) in let x_13 : Z := t_13 a_15 in let a_20 : addr := shift a_7 0%Z in let a_21 : addr := shift a_5 0%Z in ¬ i_3 = 0%Z -> ¬ i_5 = 0%Z -> ¬ Mk_addr 0%Z 0%Z = a_12 -> 0%Z ≤ i_5 -> region (base a_12) ≤ 0%Z -> linked t -> is_uint16 i -> is_uint16 i_1 -> is_uint16 i_2 -> is_uint16 i_3 -> is_uint16 i_4 -> is_uint16 i_5 -> is_uint8 x -> is_uint8 (t_13 (shift a_4 1%Z)) -> is_uint8 (t_13 (shift a_4 2%Z)) -> is_uint8 (t_13 (shift a_4 3%Z)) -> is_uint8 (t_14 (shift a_6 1%Z)) -> is_uint8 (t_14 (shift a_6 2%Z)) -> is_uint8 x_1 -> valid_rd t a_13 1%Z -> valid_rd t a_13 i_3 -> (if decide (x ≤ 127%Z) then p = true ∧ a_10 = a ∧ t_8 = t ∧ shift a_10 1%Z = a_11 ∧ to_uint16 (i_3 - 1%Z) = i_4 ∧ - 2147483647%Z ≤ i_3 else p = false ∧ a_1 = a ∧ t_1 = t ∧ (if decide (194%Z ≤ t_9 (shift a_1 0%Z)) then p_1 = true ∧ a_2 = a_1 ∧ t_10 = t_9 ∧ t_2 = t_1 ∧ (if decide (t_10 (shift a_2 0%Z) ≤ 223%Z) then p_2 = true ∧ a_8 = a_2 ∧ t_15 = t_10 ∧ t_7 = t_2 ∧ shift a_8 2%Z = a_9 ∧ to_uint16 (i_3 - 2%Z) = i_2 ∧ land 192%Z x_1 = 128%Z ∧ - 2147483646%Z ≤ i_3 ∧ 2%Z ≤ i_3 ∧ valid_rd t_7 a_14 1%Z else p_2 = false ∧ p_3 = true ∧ a_3 = a_2 ∧ t_12 = t_10 ∧ t_4 = t_2 ∧ (if decide (x_2 ≤ 239%Z) then p_4 = true ∧ a_6 = a_3 ∧ t_14 = t_12 ∧ t_6 = t_4 ∧ a_16 = a_7 ∧ x_3 = i_1 ∧ x_5 = 128%Z ∧ x_6 = 128%Z ∧ - 2147483645%Z ≤ i_3 ∧ 3%Z ≤ i_3 ∧ valid_rd t_6 a_17 1%Z ∧ valid_rd t_6 a_18 1%Z ∧ (¬ x_7 = 224%Z ∨ 160%Z ≤ x_4 ∧ x_4 ≤ 191%Z) ∧ (¬ x_7 = 237%Z ∨ 128%Z ≤ x_4 ∧ x_4 ≤ 159%Z) else p_4 = false ∧ a_4 = a_3 ∧ t_13 = t_12 ∧ t_5 = t_4 ∧ a_19 = a_5 ∧ x_8 = i ∧ x_10 = 128%Z ∧ x_11 = 128%Z ∧ x_12 = 128%Z ∧ - 2147483644%Z ≤ i_3 ∧ 4%Z ≤ i_3 ∧ 240%Z ≤ x_13 ∧ x_13 ≤ 244%Z ∧ valid_rd t_5 a_17 1%Z ∧ valid_rd t_5 a_18 1%Z ∧ valid_rd t_5 a_16 1%Z ∧ (¬ x_13 = 240%Z ∨ 144%Z ≤ x_9 ∧ x_9 ≤ 191%Z) ∧ (¬ x_13 = 244%Z ∨ 128%Z ≤ x_9 ∧ x_9 ≤ 143%Z))) else p_1 = false ∧ a_3 = a_1 ∧ t_11 = t_9 ∧ t_3 = t_1 ∧ (if decide (224%Z ≤ t_11 a_15) then p_3 = true ∧ t_12 = t_11 ∧ t_4 = t_3 ∧ (if decide (x_2 ≤ 239%Z) then p_4 = true ∧ a_6 = a_3 ∧ t_14 = t_12 ∧ t_6 = t_4 ∧ a_16 = a_7 ∧ x_3 = i_1 ∧ x_5 = 128%Z ∧ x_6 = 128%Z ∧ - 2147483645%Z ≤ i_3 ∧ 3%Z ≤ i_3 ∧ valid_rd t_6 a_17 1%Z ∧ valid_rd t_6 a_18 1%Z ∧ (¬ x_7 = 224%Z ∨ 160%Z ≤ x_4 ∧ x_4 ≤ 191%Z) ∧ (¬ x_7 = 237%Z ∨ 128%Z ≤ x_4 ∧ x_4 ≤ 159%Z) else p_4 = false ∧ a_4 = a_3 ∧ t_13 = t_12 ∧ t_5 = t_4 ∧ a_19 = a_5 ∧ x_8 = i ∧ x_10 = 128%Z ∧ x_11 = 128%Z ∧ x_12 = 128%Z ∧ - 2147483644%Z ≤ i_3 ∧ 4%Z ≤ i_3 ∧ 240%Z ≤ x_13 ∧ x_13 ≤ 244%Z ∧ valid_rd t_5 a_17 1%Z ∧ valid_rd t_5 a_18 1%Z ∧ valid_rd t_5 a_16 1%Z ∧ (¬ x_13 = 240%Z ∨ 144%Z ≤ x_9 ∧ x_9 ≤ 191%Z) ∧ (¬ x_13 = 244%Z ∨ 128%Z ≤ x_9 ∧ x_9 ≤ 143%Z)) else p_3 = false ∧ a_4 = a_3 ∧ t_13 = t_11 ∧ t_5 = t_3 ∧ a_19 = a_5 ∧ x_8 = i ∧ x_10 = 128%Z ∧ x_11 = 128%Z ∧ x_12 = 128%Z ∧ - 2147483644%Z ≤ i_3 ∧ 4%Z ≤ i_3 ∧ 240%Z ≤ x_13 ∧ x_13 ≤ 244%Z ∧ valid_rd t_5 a_17 1%Z ∧ valid_rd t_5 a_18 1%Z ∧ valid_rd t_5 a_16 1%Z ∧ (¬ x_13 = 240%Z ∨ 144%Z ≤ x_9 ∧ x_9 ≤ 191%Z) ∧ (¬ x_13 = 244%Z ∨ 128%Z ≤ x_9 ∧ x_9 ≤ 143%Z)))) -> (0%Z < i_5 -> valid_rd t (shift a_12 0%Z) i_5) -> (if decide (p = true) then valid_rd t_8 (shift a_11 0%Z) i_4 else if decide (p_1 = true) then if decide (p_2 = true) then valid_rd t_7 (shift a_9 0%Z) i_2 else if decide (p_3 = true) then if decide (p_4 = true) then valid_rd t_6 a_20 i_1 else valid_rd t_5 a_21 i else valid_rd t_5 a_21 i else if decide (p_3 = true) then if decide (p_4 = true) then valid_rd t_6 a_20 i_1 else valid_rd t_5 a_21 i else valid_rd t_5 a_21 i).
Admitted.
