diff --git a/crates/exex/src/serde.rs b/crates/exex/src/serde.rs index 3bd7a5e7..ff4cf3b4 100644 --- a/crates/exex/src/serde.rs +++ b/crates/exex/src/serde.rs @@ -1,7 +1,13 @@ use cairo_vm::{ serde::deserialize_program::Identifier, - vm::{runners::cairo_runner::CairoRunner, vm_memory::memory::Memory}, + types::{ + errors::math_errors::MathError, + relocatable::{MaybeRelocatable, Relocatable}, + }, + vm::{errors::memory_errors::MemoryError, runners::cairo_runner::CairoRunner}, + Felt252, }; +use std::collections::HashMap; use thiserror::Error; /// Represents errors that can occur during the serialization and deserialization processes between @@ -27,6 +33,14 @@ pub enum KakarotSerdeError { /// The number of matching identifiers found. count: usize, }, + + /// Error variant indicating a Math error in CairoVM operations + #[error(transparent)] + CairoVmMath(#[from] MathError), + + /// Error variant indicating a memory error in CairoVM operations + #[error(transparent)] + CairoVmMemory(#[from] MemoryError), } /// A structure representing the Kakarot serialization and deserialization context for Cairo @@ -35,7 +49,6 @@ pub enum KakarotSerdeError { /// This struct encapsulates the components required to serialize and deserialize /// Kakarot programs, including: /// - The Cairo runner responsible for executing the program -/// - The memory #[allow(missing_debug_implementations)] pub struct KakarotSerde { /// The Cairo runner used to execute Kakarot programs. @@ -45,12 +58,6 @@ pub struct KakarotSerde { /// It is responsible for handling program execution flow, managing state, and /// providing access to program identifiers. runner: CairoRunner, - - /// The memory used to store memory cells inside segments and relocation rules. - /// - /// This is used to have direct access to the memory cells and their values. - #[allow(dead_code)] - memory: Memory, } impl KakarotSerde { @@ -96,6 +103,49 @@ impl KakarotSerde { }), } } + + /// Serializes a pointer to a Hashmap by resolving its members from memory. + /// + /// We provide: + /// - The name of the struct whose pointer is being serialized. + /// - The memory location (pointer) of the struct. + /// + /// We expect: + /// - A map of member names to their corresponding values (or `None` if the pointer is 0). + pub fn serialize_pointers( + &self, + struct_name: &str, + ptr: Relocatable, + ) -> Result>, KakarotSerdeError> { + // Fetch the struct definition (identifier) by name. + let identifier = self.get_identifier(struct_name, Some("struct".to_string()))?; + + // Initialize the output map. + let mut output = HashMap::new(); + + // If the struct has members, iterate over them to resolve their values from memory. + if let Some(members) = identifier.members { + for (name, member) in members { + // We try to resolve the member's value from memory. + if let Some(member_ptr) = self.runner.vm.get_maybe(&(ptr + member.offset)?) { + // Check for null pointer. + if member_ptr == MaybeRelocatable::Int(Felt252::ZERO) && + member.cairo_type.ends_with('*') + { + // We insert `None` for cases such as `parent=cast(0, model.Parent*)` + // + // Null pointers are represented as `None`. + output.insert(name, None); + } else { + // Insert the resolved member pointer into the output map. + output.insert(name, Some(member_ptr)); + } + } + } + } + + Ok(output) + } } #[cfg(test)] @@ -105,7 +155,7 @@ mod tests { fn setup_kakarot_serde() -> KakarotSerde { // Load the valid program content from a JSON file - let program_content = include_bytes!("../../../cairo/programs/os.json"); + let program_content = include_bytes!("../testdata/keccak_add_uint256.json"); // Create a Program instance from the loaded bytes, specifying "main" as the entry point let program = Program::from_bytes(program_content, Some("main")).unwrap(); @@ -114,7 +164,7 @@ mod tests { let runner = CairoRunner::new(&program, LayoutName::plain, false, false).unwrap(); // Return an instance of KakarotSerde - KakarotSerde { runner, memory: Memory::new() } + KakarotSerde { runner } } #[test] @@ -126,7 +176,7 @@ mod tests { assert_eq!( kakarot_serde.get_identifier("main", Some("function".to_string())).unwrap(), Identifier { - pc: Some(3478), + pc: Some(96), type_: Some("function".to_string()), value: None, full_name: None, @@ -142,7 +192,9 @@ mod tests { pc: None, type_: Some("reference".to_string()), value: None, - full_name: Some("starkware.cairo.common.memcpy.memcpy.__temp0".to_string()), + full_name: Some( + "starkware.cairo.common.uint256.word_reverse_endian.__temp0".to_string() + ), members: None, cairo_type: Some("felt".to_string()) } @@ -218,9 +270,131 @@ mod tests { { assert_eq!(struct_name, "ImplicitArgs"); assert_eq!(expected_type, Some("struct".to_string())); - assert_eq!(count, 63); + assert_eq!(count, 6); } else { panic!("Expected KakarotSerdeError::MultipleIdentifiersFound"); } } + + #[test] + fn test_serialize_pointer_not_struct() { + // Setup the KakarotSerde instance + let mut kakarot_serde = setup_kakarot_serde(); + + // Add a new memory segment to the virtual machine (VM). + let base = kakarot_serde.runner.vm.add_memory_segment(); + + // Attempt to serialize pointer with "main", expecting an IdentifierNotFound error. + let result = kakarot_serde.serialize_pointers("main", base); + + // Assert that the result is an error with the expected struct name and type. + match result { + Err(KakarotSerdeError::IdentifierNotFound { struct_name, expected_type }) => { + assert_eq!(struct_name, "main".to_string()); + assert_eq!(expected_type, Some("struct".to_string())); + } + _ => panic!("Expected KakarotSerdeError::IdentifierNotFound, but got: {:?}", result), + } + } + + #[test] + fn test_serialize_pointer_empty() { + // Setup the KakarotSerde instance + let kakarot_serde = setup_kakarot_serde(); + + // Serialize the pointers of the "ImplicitArgs" struct but without any memory segment. + let result = kakarot_serde + .serialize_pointers("main.ImplicitArgs", Relocatable::default()) + .expect("failed to serialize pointers"); + + // The result should be an empty HashMap since there is no memory segment. + assert!(result.is_empty(),); + } + + #[test] + fn test_serialize_pointer_valid() { + // Setup the KakarotSerde instance + let mut kakarot_serde = setup_kakarot_serde(); + + // Insert relocatable values in memory + let base = kakarot_serde + .runner + .vm + .gen_arg(&vec![ + MaybeRelocatable::Int(Felt252::ZERO), + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 10, offset: 11 }), + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 10, offset: 11 }), + ]) + .unwrap() + .get_relocatable() + .unwrap(); + + // Serialize the pointers of the "ImplicitArgs" struct using the new memory segment. + let result = kakarot_serde + .serialize_pointers("main.ImplicitArgs", base) + .expect("failed to serialize pointers"); + + // Assert that the result matches the expected serialized struct members. + assert_eq!( + result, + HashMap::from_iter([ + ("output_ptr".to_string(), None), + ( + "range_check_ptr".to_string(), + Some(MaybeRelocatable::RelocatableValue(Relocatable { + segment_index: 10, + offset: 11 + })) + ), + ( + "bitwise_ptr".to_string(), + Some(MaybeRelocatable::RelocatableValue(Relocatable { + segment_index: 10, + offset: 11 + })) + ), + ]) + ); + } + + #[test] + fn test_serialize_null_no_pointer() { + // Setup the KakarotSerde instance + let mut kakarot_serde = setup_kakarot_serde(); + + // Insert relocatable values in memory + let base = kakarot_serde + .runner + .vm + .gen_arg(&vec![ + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 10, offset: 11 }), + MaybeRelocatable::Int(Felt252::ZERO), + MaybeRelocatable::Int(Felt252::from(55)), + ]) + .unwrap() + .get_relocatable() + .unwrap(); + + // Serialize the pointers of the "ImplicitArgs" struct using the new memory segment. + let result = kakarot_serde + .serialize_pointers("main.ImplicitArgs", base) + .expect("failed to serialize pointers"); + + // Assert that the result matches the expected serialized struct members. + assert_eq!( + result, + HashMap::from_iter([ + ( + "output_ptr".to_string(), + Some(MaybeRelocatable::RelocatableValue(Relocatable { + segment_index: 10, + offset: 11 + })) + ), + // Not a pointer so that we shouldn't have a `None` + ("range_check_ptr".to_string(), Some(MaybeRelocatable::Int(Felt252::ZERO))), + ("bitwise_ptr".to_string(), Some(MaybeRelocatable::Int(Felt252::from(55)))), + ]) + ); + } } diff --git a/crates/exex/testdata/keccak_add_uint256.cairo b/crates/exex/testdata/keccak_add_uint256.cairo new file mode 100644 index 00000000..196adc3f --- /dev/null +++ b/crates/exex/testdata/keccak_add_uint256.cairo @@ -0,0 +1,30 @@ +%builtins output range_check bitwise + +from starkware.cairo.common.keccak_utils.keccak_utils import keccak_add_uint256 +from starkware.cairo.common.uint256 import Uint256 +from starkware.cairo.common.cairo_builtins import BitwiseBuiltin +from starkware.cairo.common.alloc import alloc +from starkware.cairo.common.serialize import serialize_word + +func main{output_ptr: felt*, range_check_ptr, bitwise_ptr: BitwiseBuiltin*}() { + alloc_locals; + + let (inputs) = alloc(); + let inputs_start = inputs; + + let num = Uint256(34623634663146736, 598249824422424658356); + + keccak_add_uint256{inputs=inputs_start}(num=num, bigend=0); + + assert inputs[0] = 34623634663146736; + assert inputs[1] = 0; + assert inputs[2] = 7954014063719006644; + assert inputs[3] = 32; + + serialize_word(inputs[0]); + serialize_word(inputs[1]); + serialize_word(inputs[2]); + serialize_word(inputs[3]); + + return (); +} diff --git a/crates/exex/testdata/keccak_add_uint256.json b/crates/exex/testdata/keccak_add_uint256.json new file mode 100644 index 00000000..c4acf55c --- /dev/null +++ b/crates/exex/testdata/keccak_add_uint256.json @@ -0,0 +1,2369 @@ +{ + "attributes": [], + "builtins": ["output", "range_check", "bitwise"], + "compiler_version": "0.13.2", + "data": [ + "0x40780017fff7fff", + "0x3", + "0x1104800180018000", + "0x5e", + "0x10780017fff7fff", + "0x0", + "0x400380007ffc7ffd", + "0x480680017fff8000", + "0xff00ff00ff00ff00ff00ff00ff00ff", + "0x400280017ffc7fff", + "0x480680017fff8000", + "0xffff", + "0x480280027ffc8000", + "0x48507fff7ffe8000", + "0x48327fff7ffd8000", + "0x400280057ffc7fff", + "0x480680017fff8000", + "0xffff0000ffff0000ffff0000ffff00", + "0x400280067ffc7fff", + "0x480680017fff8000", + "0xffffffff", + "0x480280077ffc8000", + "0x48507fff7ffe8000", + "0x48307fff7ffb8000", + "0x4002800a7ffc7fff", + "0x480680017fff8000", + "0xffffffff00000000ffffffff000000", + "0x4002800b7ffc7fff", + "0x480680017fff8000", + "0xffffffffffffffff", + "0x4802800c7ffc8000", + "0x48507fff7ffe8000", + "0x48307fff7ffb8000", + "0x4002800f7ffc7fff", + "0x480680017fff8000", + "0xffffffffffffffff00000000000000", + "0x400280107ffc7fff", + "0x480680017fff8000", + "0xffffffffffffffffffffffffffffffff", + "0x480280117ffc8000", + "0x48507fff7ffe8000", + "0x48307fff7ffb8000", + "0x482680017ffc8000", + "0x14", + "0x484480017ffe8000", + "0x800000000000010fffffffffffffff7ffffffffffffef000000000000000001", + "0x208b7fff7fff7ffe", + "0x480a7ffb7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffd6", + "0x48127ffe7fff8000", + "0x480a7ffc7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffd2", + "0x48127ffe7fff8000", + "0x48127fe47fff8000", + "0x48127ffd7fff8000", + "0x208b7fff7fff7ffe", + "0x20780017fff7ffd", + "0x7", + "0x480a7ff97fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffb7fff8000", + "0x10780017fff7fff", + "0xa", + "0x480a7ff97fff8000", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffeb", + "0x48127ffd7fff8000", + "0x48127ffe7fff8000", + "0x48127ffc7fff8000", + "0x480280017ffa8000", + "0x484480017fff8000", + "0x10000000000000000", + "0x480280007ffa8000", + "0x40307fff7ffe7ffc", + "0x480280037ffa8000", + "0x484480017fff8000", + "0x10000000000000000", + "0x480280027ffa8000", + "0x40307fff7ffe7ff8", + "0x480a7ff87fff8000", + "0x48127ff67fff8000", + "0x482680017ffa8000", + "0x4", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x208b7fff7fff7ffe", + "0x400380007ffc7ffd", + "0x482680017ffc8000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x1104800180018000", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff8", + "0x40137fff7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x480a80007fff8000", + "0x480680017fff8000", + "0x7b020324ee04f0", + "0x480680017fff8000", + "0x206e6255a6166ec1b4", + "0x480680017fff8000", + "0x0", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffce", + "0x480680017fff8000", + "0x7b020324ee04f0", + "0x4002800080007fff", + "0x480680017fff8000", + "0x0", + "0x4002800180007fff", + "0x480680017fff8000", + "0x6e6255a6166ec1b4", + "0x4002800280007fff", + "0x480680017fff8000", + "0x20", + "0x4002800380007fff", + "0x480a7ffb7fff8000", + "0x4802800080008000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffdf", + "0x4802800180008000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffdc", + "0x4802800280008000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffd9", + "0x4802800380008000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffd6", + "0x48127fe87fff8000", + "0x48127fe87fff8000", + "0x208b7fff7fff7ffe" + ], + "debug_info": null, + "hints": { + "74": [ + { + "accessible_scopes": [ + "starkware.cairo.common.keccak_utils.keccak_utils", + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256" + ], + "code": "segments.write_arg(ids.inputs, [ids.low % 2 ** 64, ids.low // 2 ** 64])\nsegments.write_arg(ids.inputs + 2, [ids.high % 2 ** 64, ids.high // 2 ** 64])", + "flow_tracking_data": { + "ap_tracking": { + "group": 5, + "offset": 0 + }, + "reference_ids": { + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.bigend": 30, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.bitwise_ptr": 42, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.high": 43, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.inputs": 33, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.low": 44, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.num": 29, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.range_check_ptr": 31 + } + } + } + ], + "89": [ + { + "accessible_scopes": [ + "starkware.cairo.common.alloc", + "starkware.cairo.common.alloc.alloc" + ], + "code": "memory[ap] = segments.add()", + "flow_tracking_data": { + "ap_tracking": { + "group": 6, + "offset": 0 + }, + "reference_ids": {} + } + } + ] + }, + "identifiers": { + "__main__.BitwiseBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "type": "alias" + }, + "__main__.Uint256": { + "destination": "starkware.cairo.common.uint256.Uint256", + "type": "alias" + }, + "__main__.__end__": { + "pc": 4, + "type": "label" + }, + "__main__.__start__": { + "pc": 0, + "type": "label" + }, + "__main__.alloc": { + "destination": "starkware.cairo.common.alloc.alloc", + "type": "alias" + }, + "__main__.keccak_add_uint256": { + "destination": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256", + "type": "alias" + }, + "__main__.main": { + "decorators": [], + "pc": 96, + "type": "function" + }, + "__main__.main.Args": { + "full_name": "__main__.main.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "__main__.main.ImplicitArgs": { + "full_name": "__main__.main.ImplicitArgs", + "members": { + "bitwise_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin*", + "offset": 2 + }, + "output_ptr": { + "cairo_type": "felt*", + "offset": 0 + }, + "range_check_ptr": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "__main__.main.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "__main__.main.SIZEOF_LOCALS": { + "type": "const", + "value": 1 + }, + "__main__.main.__temp22": { + "cairo_type": "felt", + "full_name": "__main__.main.__temp22", + "references": [ + { + "ap_tracking_data": { + "group": 9, + "offset": 1 + }, + "pc": 114, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "__main__.main.__temp23": { + "cairo_type": "felt", + "full_name": "__main__.main.__temp23", + "references": [ + { + "ap_tracking_data": { + "group": 9, + "offset": 2 + }, + "pc": 117, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "__main__.main.__temp24": { + "cairo_type": "felt", + "full_name": "__main__.main.__temp24", + "references": [ + { + "ap_tracking_data": { + "group": 9, + "offset": 3 + }, + "pc": 120, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "__main__.main.__temp25": { + "cairo_type": "felt", + "full_name": "__main__.main.__temp25", + "references": [ + { + "ap_tracking_data": { + "group": 9, + "offset": 4 + }, + "pc": 123, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "__main__.main.bitwise_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin*", + "full_name": "__main__.main.bitwise_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 8, + "offset": 0 + }, + "pc": 96, + "value": "[cast(fp + (-3), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 0 + }, + "pc": 111, + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 0 + }, + "pc": 112, + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + } + ], + "type": "reference" + }, + "__main__.main.inputs": { + "cairo_type": "felt*", + "full_name": "__main__.main.inputs", + "references": [ + { + "ap_tracking_data": { + "group": 8, + "offset": 4 + }, + "pc": 100, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 8, + "offset": 4 + }, + "pc": 101, + "value": "[cast(fp, felt**)]" + } + ], + "type": "reference" + }, + "__main__.main.inputs_start": { + "cairo_type": "felt*", + "full_name": "__main__.main.inputs_start", + "references": [ + { + "ap_tracking_data": { + "group": 8, + "offset": 4 + }, + "pc": 101, + "value": "[cast(fp, felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 0 + }, + "pc": 112, + "value": "[cast(ap + (-1), felt**)]" + } + ], + "type": "reference" + }, + "__main__.main.num": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "full_name": "__main__.main.num", + "references": [ + { + "ap_tracking_data": { + "group": 8, + "offset": 4 + }, + "pc": 101, + "value": "cast((34623634663146736, 598249824422424658356), starkware.cairo.common.uint256.Uint256)" + } + ], + "type": "reference" + }, + "__main__.main.output_ptr": { + "cairo_type": "felt*", + "full_name": "__main__.main.output_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 8, + "offset": 0 + }, + "pc": 96, + "value": "[cast(fp + (-5), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 9 + }, + "pc": 127, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 13 + }, + "pc": 130, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 17 + }, + "pc": 133, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 21 + }, + "pc": 136, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 9 + }, + "pc": 128, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 13 + }, + "pc": 131, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 17 + }, + "pc": 134, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 21 + }, + "pc": 137, + "value": "[cast(ap + (-1), felt**)]" + } + ], + "type": "reference" + }, + "__main__.main.range_check_ptr": { + "cairo_type": "felt", + "full_name": "__main__.main.range_check_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 8, + "offset": 0 + }, + "pc": 96, + "value": "[cast(fp + (-4), felt*)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 0 + }, + "pc": 111, + "value": "[cast(ap + (-3), felt*)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 0 + }, + "pc": 112, + "value": "[cast(ap + (-3), felt*)]" + } + ], + "type": "reference" + }, + "__main__.serialize_word": { + "destination": "starkware.cairo.common.serialize.serialize_word", + "type": "alias" + }, + "starkware.cairo.common.alloc.alloc": { + "decorators": [], + "pc": 89, + "type": "function" + }, + "starkware.cairo.common.alloc.alloc.Args": { + "full_name": "starkware.cairo.common.alloc.alloc.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "starkware.cairo.common.alloc.alloc.ImplicitArgs": { + "full_name": "starkware.cairo.common.alloc.alloc.ImplicitArgs", + "members": {}, + "size": 0, + "type": "struct" + }, + "starkware.cairo.common.alloc.alloc.Return": { + "cairo_type": "(ptr: felt*)", + "type": "type_definition" + }, + "starkware.cairo.common.alloc.alloc.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "starkware.cairo.common.bitwise.ALL_ONES": { + "type": "const", + "value": -106710729501573572985208420194530329073740042555888586719234 + }, + "starkware.cairo.common.bitwise.BitwiseBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "type": "alias" + }, + "starkware.cairo.common.bool.FALSE": { + "type": "const", + "value": 0 + }, + "starkware.cairo.common.bool.TRUE": { + "type": "const", + "value": 1 + }, + "starkware.cairo.common.cairo_builtins.BitwiseBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "members": { + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "x_and_y": { + "cairo_type": "felt", + "offset": 2 + }, + "x_or_y": { + "cairo_type": "felt", + "offset": 4 + }, + "x_xor_y": { + "cairo_type": "felt", + "offset": 3 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 5, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcOpBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.EcOpBuiltin", + "members": { + "m": { + "cairo_type": "felt", + "offset": 4 + }, + "p": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 0 + }, + "q": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 2 + }, + "r": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 5 + } + }, + "size": 7, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcPoint": { + "destination": "starkware.cairo.common.ec_point.EcPoint", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.HashBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "members": { + "result": { + "cairo_type": "felt", + "offset": 2 + }, + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.KeccakBuiltin", + "members": { + "input": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "offset": 0 + }, + "output": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "offset": 8 + } + }, + "size": 16, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltinState": { + "destination": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.ModBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.ModBuiltin", + "members": { + "n": { + "cairo_type": "felt", + "offset": 6 + }, + "offsets_ptr": { + "cairo_type": "felt*", + "offset": 5 + }, + "p": { + "cairo_type": "starkware.cairo.common.cairo_builtins.UInt384", + "offset": 0 + }, + "values_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.UInt384*", + "offset": 4 + } + }, + "size": 7, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.PoseidonBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.PoseidonBuiltin", + "members": { + "input": { + "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "offset": 0 + }, + "output": { + "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "offset": 3 + } + }, + "size": 6, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.PoseidonBuiltinState": { + "destination": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.SignatureBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.SignatureBuiltin", + "members": { + "message": { + "cairo_type": "felt", + "offset": 1 + }, + "pub_key": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.UInt384": { + "full_name": "starkware.cairo.common.cairo_builtins.UInt384", + "members": { + "d0": { + "cairo_type": "felt", + "offset": 0 + }, + "d1": { + "cairo_type": "felt", + "offset": 1 + }, + "d2": { + "cairo_type": "felt", + "offset": 2 + }, + "d3": { + "cairo_type": "felt", + "offset": 3 + } + }, + "size": 4, + "type": "struct" + }, + "starkware.cairo.common.ec_point.EcPoint": { + "full_name": "starkware.cairo.common.ec_point.EcPoint", + "members": { + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.keccak_state.KeccakBuiltinState": { + "full_name": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "members": { + "s0": { + "cairo_type": "felt", + "offset": 0 + }, + "s1": { + "cairo_type": "felt", + "offset": 1 + }, + "s2": { + "cairo_type": "felt", + "offset": 2 + }, + "s3": { + "cairo_type": "felt", + "offset": 3 + }, + "s4": { + "cairo_type": "felt", + "offset": 4 + }, + "s5": { + "cairo_type": "felt", + "offset": 5 + }, + "s6": { + "cairo_type": "felt", + "offset": 6 + }, + "s7": { + "cairo_type": "felt", + "offset": 7 + } + }, + "size": 8, + "type": "struct" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.BitwiseBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "type": "alias" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.Uint256": { + "destination": "starkware.cairo.common.uint256.Uint256", + "type": "alias" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256": { + "decorators": [], + "pc": 59, + "type": "function" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.Args": { + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.Args", + "members": { + "bigend": { + "cairo_type": "felt", + "offset": 2 + }, + "num": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 0 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.ImplicitArgs": { + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.ImplicitArgs", + "members": { + "bitwise_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin*", + "offset": 1 + }, + "inputs": { + "cairo_type": "felt*", + "offset": 2 + }, + "range_check_ptr": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp16": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp16", + "references": [ + { + "ap_tracking_data": { + "group": 5, + "offset": 1 + }, + "pc": 75, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp17": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp17", + "references": [ + { + "ap_tracking_data": { + "group": 5, + "offset": 2 + }, + "pc": 77, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp18": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp18", + "references": [ + { + "ap_tracking_data": { + "group": 5, + "offset": 3 + }, + "pc": 78, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp19": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp19", + "references": [ + { + "ap_tracking_data": { + "group": 5, + "offset": 4 + }, + "pc": 80, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp20": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp20", + "references": [ + { + "ap_tracking_data": { + "group": 5, + "offset": 5 + }, + "pc": 82, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp21": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.__temp21", + "references": [ + { + "ap_tracking_data": { + "group": 5, + "offset": 6 + }, + "pc": 83, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.bigend": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.bigend", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 59, + "value": "[cast(fp + (-3), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.bitwise_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin*", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.bitwise_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 59, + "value": "[cast(fp + (-7), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 1 + }, + "pc": 62, + "value": "[cast(ap + (-1), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 60 + }, + "pc": 71, + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 61 + }, + "pc": 72, + "value": "[cast(ap + (-1), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.high": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.high", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 2 + }, + "pc": 63, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 62 + }, + "pc": 73, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.inputs": { + "cairo_type": "felt*", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.inputs", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 59, + "value": "[cast(fp + (-6), felt**)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 6 + }, + "pc": 84, + "value": "cast([fp + (-6)] + 4, felt*)" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.low": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.low", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 3 + }, + "pc": 64, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 63 + }, + "pc": 74, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.num": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.num", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 59, + "value": "[cast(fp + (-5), starkware.cairo.common.uint256.Uint256*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.num_reversed": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.num_reversed", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 60 + }, + "pc": 71, + "value": "[cast(ap + (-2), starkware.cairo.common.uint256.Uint256*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.range_check_ptr": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.keccak_utils.keccak_utils.keccak_add_uint256.range_check_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 59, + "value": "[cast(fp + (-8), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.split_felt": { + "destination": "starkware.cairo.common.math.split_felt", + "type": "alias" + }, + "starkware.cairo.common.keccak_utils.keccak_utils.uint256_reverse_endian": { + "destination": "starkware.cairo.common.uint256.uint256_reverse_endian", + "type": "alias" + }, + "starkware.cairo.common.math.FALSE": { + "destination": "starkware.cairo.common.bool.FALSE", + "type": "alias" + }, + "starkware.cairo.common.math.TRUE": { + "destination": "starkware.cairo.common.bool.TRUE", + "type": "alias" + }, + "starkware.cairo.common.math_cmp.RC_BOUND": { + "type": "const", + "value": 340282366920938463463374607431768211456 + }, + "starkware.cairo.common.math_cmp.assert_le_felt": { + "destination": "starkware.cairo.common.math.assert_le_felt", + "type": "alias" + }, + "starkware.cairo.common.math_cmp.assert_lt_felt": { + "destination": "starkware.cairo.common.math.assert_lt_felt", + "type": "alias" + }, + "starkware.cairo.common.poseidon_state.PoseidonBuiltinState": { + "full_name": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "members": { + "s0": { + "cairo_type": "felt", + "offset": 0 + }, + "s1": { + "cairo_type": "felt", + "offset": 1 + }, + "s2": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.pow.assert_le": { + "destination": "starkware.cairo.common.math.assert_le", + "type": "alias" + }, + "starkware.cairo.common.pow.get_ap": { + "destination": "starkware.cairo.common.registers.get_ap", + "type": "alias" + }, + "starkware.cairo.common.pow.get_fp_and_pc": { + "destination": "starkware.cairo.common.registers.get_fp_and_pc", + "type": "alias" + }, + "starkware.cairo.common.pow.sign": { + "destination": "starkware.cairo.common.math.sign", + "type": "alias" + }, + "starkware.cairo.common.registers.get_ap": { + "destination": "starkware.cairo.lang.compiler.lib.registers.get_ap", + "type": "alias" + }, + "starkware.cairo.common.registers.get_fp_and_pc": { + "destination": "starkware.cairo.lang.compiler.lib.registers.get_fp_and_pc", + "type": "alias" + }, + "starkware.cairo.common.serialize.serialize_word": { + "decorators": [], + "pc": 92, + "type": "function" + }, + "starkware.cairo.common.serialize.serialize_word.Args": { + "full_name": "starkware.cairo.common.serialize.serialize_word.Args", + "members": { + "word": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.cairo.common.serialize.serialize_word.ImplicitArgs": { + "full_name": "starkware.cairo.common.serialize.serialize_word.ImplicitArgs", + "members": { + "output_ptr": { + "cairo_type": "felt*", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.cairo.common.serialize.serialize_word.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "starkware.cairo.common.serialize.serialize_word.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "starkware.cairo.common.serialize.serialize_word.output_ptr": { + "cairo_type": "felt*", + "full_name": "starkware.cairo.common.serialize.serialize_word.output_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 7, + "offset": 0 + }, + "pc": 92, + "value": "[cast(fp + (-4), felt**)]" + }, + { + "ap_tracking_data": { + "group": 7, + "offset": 0 + }, + "pc": 93, + "value": "cast([fp + (-4)] + 1, felt*)" + } + ], + "type": "reference" + }, + "starkware.cairo.common.serialize.serialize_word.word": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.serialize.serialize_word.word", + "references": [ + { + "ap_tracking_data": { + "group": 7, + "offset": 0 + }, + "pc": 92, + "value": "[cast(fp + (-3), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.ALL_ONES": { + "type": "const", + "value": 340282366920938463463374607431768211455 + }, + "starkware.cairo.common.uint256.BitwiseBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "type": "alias" + }, + "starkware.cairo.common.uint256.HALF_SHIFT": { + "type": "const", + "value": 18446744073709551616 + }, + "starkware.cairo.common.uint256.SHIFT": { + "type": "const", + "value": 340282366920938463463374607431768211456 + }, + "starkware.cairo.common.uint256.Uint256": { + "full_name": "starkware.cairo.common.uint256.Uint256", + "members": { + "high": { + "cairo_type": "felt", + "offset": 1 + }, + "low": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.uint256.assert_in_range": { + "destination": "starkware.cairo.common.math.assert_in_range", + "type": "alias" + }, + "starkware.cairo.common.uint256.assert_le": { + "destination": "starkware.cairo.common.math.assert_le", + "type": "alias" + }, + "starkware.cairo.common.uint256.assert_nn_le": { + "destination": "starkware.cairo.common.math.assert_nn_le", + "type": "alias" + }, + "starkware.cairo.common.uint256.assert_not_zero": { + "destination": "starkware.cairo.common.math.assert_not_zero", + "type": "alias" + }, + "starkware.cairo.common.uint256.bitwise_and": { + "destination": "starkware.cairo.common.bitwise.bitwise_and", + "type": "alias" + }, + "starkware.cairo.common.uint256.bitwise_or": { + "destination": "starkware.cairo.common.bitwise.bitwise_or", + "type": "alias" + }, + "starkware.cairo.common.uint256.bitwise_xor": { + "destination": "starkware.cairo.common.bitwise.bitwise_xor", + "type": "alias" + }, + "starkware.cairo.common.uint256.get_ap": { + "destination": "starkware.cairo.common.registers.get_ap", + "type": "alias" + }, + "starkware.cairo.common.uint256.get_fp_and_pc": { + "destination": "starkware.cairo.common.registers.get_fp_and_pc", + "type": "alias" + }, + "starkware.cairo.common.uint256.is_le": { + "destination": "starkware.cairo.common.math_cmp.is_le", + "type": "alias" + }, + "starkware.cairo.common.uint256.pow": { + "destination": "starkware.cairo.common.pow.pow", + "type": "alias" + }, + "starkware.cairo.common.uint256.split_felt": { + "destination": "starkware.cairo.common.math.split_felt", + "type": "alias" + }, + "starkware.cairo.common.uint256.uint256_reverse_endian": { + "decorators": [], + "pc": 47, + "type": "function" + }, + "starkware.cairo.common.uint256.uint256_reverse_endian.Args": { + "full_name": "starkware.cairo.common.uint256.uint256_reverse_endian.Args", + "members": { + "num": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.uint256.uint256_reverse_endian.ImplicitArgs": { + "full_name": "starkware.cairo.common.uint256.uint256_reverse_endian.ImplicitArgs", + "members": { + "bitwise_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin*", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.cairo.common.uint256.uint256_reverse_endian.Return": { + "cairo_type": "(res: starkware.cairo.common.uint256.Uint256)", + "type": "type_definition" + }, + "starkware.cairo.common.uint256.uint256_reverse_endian.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "starkware.cairo.common.uint256.uint256_reverse_endian.bitwise_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin*", + "full_name": "starkware.cairo.common.uint256.uint256_reverse_endian.bitwise_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 47, + "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 26 + }, + "pc": 51, + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 52 + }, + "pc": 55, + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.uint256_reverse_endian.high": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.uint256_reverse_endian.high", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 26 + }, + "pc": 51, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.uint256_reverse_endian.low": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.uint256_reverse_endian.low", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 52 + }, + "pc": 55, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.uint256_reverse_endian.num": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "full_name": "starkware.cairo.common.uint256.uint256_reverse_endian.num", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 47, + "value": "[cast(fp + (-4), starkware.cairo.common.uint256.Uint256*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian": { + "decorators": [], + "pc": 6, + "type": "function" + }, + "starkware.cairo.common.uint256.word_reverse_endian.Args": { + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.Args", + "members": { + "word": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.cairo.common.uint256.word_reverse_endian.ImplicitArgs": { + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.ImplicitArgs", + "members": { + "bitwise_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin*", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.cairo.common.uint256.word_reverse_endian.Return": { + "cairo_type": "(res: felt)", + "type": "type_definition" + }, + "starkware.cairo.common.uint256.word_reverse_endian.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp0": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp0", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 1 + }, + "pc": 9, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp1": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp1", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 2 + }, + "pc": 12, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp10": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp10", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 13 + }, + "pc": 31, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp11": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp11", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 14 + }, + "pc": 32, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp12": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp12", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 16 + }, + "pc": 36, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp13": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp13", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 17 + }, + "pc": 39, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp14": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp14", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 18 + }, + "pc": 40, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp15": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp15", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 19 + }, + "pc": 41, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp2": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp2", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 3 + }, + "pc": 13, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp3": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp3", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 4 + }, + "pc": 14, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp4": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp4", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 6 + }, + "pc": 18, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp5": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp5", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 7 + }, + "pc": 21, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp6": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp6", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 8 + }, + "pc": 22, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp7": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp7", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 9 + }, + "pc": 23, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp8": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp8", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 11 + }, + "pc": 27, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.__temp9": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.__temp9", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 12 + }, + "pc": 30, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.bitwise_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin*", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.bitwise_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 20 + }, + "pc": 42, + "value": "cast([fp + (-4)] + 20, starkware.cairo.common.cairo_builtins.BitwiseBuiltin*)" + } + ], + "type": "reference" + }, + "starkware.cairo.common.uint256.word_reverse_endian.word": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.uint256.word_reverse_endian.word", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-3), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 5 + }, + "pc": 15, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 10 + }, + "pc": 24, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 15 + }, + "pc": 33, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 20 + }, + "pc": 42, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + } + }, + "main_scope": "__main__", + "prime": "0x800000000000011000000000000000000000000000000000000000000000001", + "reference_manager": { + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-3), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 1 + }, + "pc": 9, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 2 + }, + "pc": 12, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 3 + }, + "pc": 13, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 4 + }, + "pc": 14, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 5 + }, + "pc": 15, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 6 + }, + "pc": 18, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 7 + }, + "pc": 21, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 8 + }, + "pc": 22, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 9 + }, + "pc": 23, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 10 + }, + "pc": 24, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 11 + }, + "pc": 27, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 12 + }, + "pc": 30, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 13 + }, + "pc": 31, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 14 + }, + "pc": 32, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 15 + }, + "pc": 33, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 16 + }, + "pc": 36, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 17 + }, + "pc": 39, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 18 + }, + "pc": 40, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 19 + }, + "pc": 41, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 20 + }, + "pc": 42, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 20 + }, + "pc": 42, + "value": "cast([fp + (-4)] + 20, starkware.cairo.common.cairo_builtins.BitwiseBuiltin*)" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 47, + "value": "[cast(fp + (-4), starkware.cairo.common.uint256.Uint256*)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 47, + "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 26 + }, + "pc": 51, + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 26 + }, + "pc": 51, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 52 + }, + "pc": 55, + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 52 + }, + "pc": 55, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 59, + "value": "[cast(fp + (-5), starkware.cairo.common.uint256.Uint256*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 59, + "value": "[cast(fp + (-3), felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 59, + "value": "[cast(fp + (-8), felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 59, + "value": "[cast(fp + (-7), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 59, + "value": "[cast(fp + (-6), felt**)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 1 + }, + "pc": 62, + "value": "[cast(ap + (-1), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 2 + }, + "pc": 63, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 3 + }, + "pc": 64, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 60 + }, + "pc": 71, + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 60 + }, + "pc": 71, + "value": "[cast(ap + (-2), starkware.cairo.common.uint256.Uint256*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 61 + }, + "pc": 72, + "value": "[cast(ap + (-1), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 62 + }, + "pc": 73, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 63 + }, + "pc": 74, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 0 + }, + "pc": 72, + "value": "[cast(ap - 2 + (-1), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 0 + }, + "pc": 73, + "value": "[cast(ap - 1 + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 0 + }, + "pc": 74, + "value": "[cast(ap - 0 + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 1 + }, + "pc": 75, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 2 + }, + "pc": 77, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 3 + }, + "pc": 78, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 4 + }, + "pc": 80, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 5 + }, + "pc": 82, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 6 + }, + "pc": 83, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 6 + }, + "pc": 84, + "value": "cast([fp + (-6)] + 4, felt*)" + }, + { + "ap_tracking_data": { + "group": 7, + "offset": 0 + }, + "pc": 92, + "value": "[cast(fp + (-3), felt*)]" + }, + { + "ap_tracking_data": { + "group": 7, + "offset": 0 + }, + "pc": 92, + "value": "[cast(fp + (-4), felt**)]" + }, + { + "ap_tracking_data": { + "group": 7, + "offset": 0 + }, + "pc": 93, + "value": "cast([fp + (-4)] + 1, felt*)" + }, + { + "ap_tracking_data": { + "group": 8, + "offset": 0 + }, + "pc": 96, + "value": "[cast(fp + (-5), felt**)]" + }, + { + "ap_tracking_data": { + "group": 8, + "offset": 0 + }, + "pc": 96, + "value": "[cast(fp + (-4), felt*)]" + }, + { + "ap_tracking_data": { + "group": 8, + "offset": 0 + }, + "pc": 96, + "value": "[cast(fp + (-3), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 8, + "offset": 4 + }, + "pc": 100, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 8, + "offset": 4 + }, + "pc": 101, + "value": "[cast(fp, felt**)]" + }, + { + "ap_tracking_data": { + "group": 8, + "offset": 4 + }, + "pc": 101, + "value": "[cast(fp, felt**)]" + }, + { + "ap_tracking_data": { + "group": 8, + "offset": 4 + }, + "pc": 101, + "value": "cast((34623634663146736, 598249824422424658356), starkware.cairo.common.uint256.Uint256)" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 0 + }, + "pc": 112, + "value": "[cast(ap + (-3), felt*)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 0 + }, + "pc": 112, + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.BitwiseBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 0 + }, + "pc": 112, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 1 + }, + "pc": 114, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 2 + }, + "pc": 117, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 3 + }, + "pc": 120, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 4 + }, + "pc": 123, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 9 + }, + "pc": 128, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 13 + }, + "pc": 131, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 17 + }, + "pc": 134, + "value": "[cast(ap + (-1), felt**)]" + }, + { + "ap_tracking_data": { + "group": 9, + "offset": 21 + }, + "pc": 137, + "value": "[cast(ap + (-1), felt**)]" + } + ] + } +}