diff --git a/sway-core/src/asm_generation/finalized_asm.rs b/sway-core/src/asm_generation/finalized_asm.rs index 14b0534061e..5fc5a4a2abd 100644 --- a/sway-core/src/asm_generation/finalized_asm.rs +++ b/sway-core/src/asm_generation/finalized_asm.rs @@ -1,6 +1,6 @@ use super::instruction_set::InstructionSet; use super::{ - fuel::{checks, data_section::DataSection}, + fuel::{checks, compiler_constants::TWELVE_BITS, data_section::DataSection}, ProgramABI, ProgramKind, }; use crate::asm_generation::fuel::data_section::{Datum, Entry, EntryName}; @@ -120,14 +120,41 @@ fn to_bytecode_mut( source_engine: &SourceEngine, build_config: &BuildConfig, ) -> CompiledBytecode { - fn op_size_in_bytes(data_section: &DataSection, item: &AllocatedOp) -> u64 { + // Snapshot non-configurable size before pointer pre-insertion mutates the data section. + // Pointers are appended to non_configurables, so their offsets are relative to this. + let base_non_config_size = data_section.non_configurables_size_in_bytes() as u64; + + // Count non-copy loads to compute worst-case pointer offset (last pointer inserted). + let num_non_copy_loads = ops + .iter() + .filter(|op| { + matches!(&op.opcode, AllocatedInstruction::LoadDataId(_, label) + if !data_section.has_copy_type(label).unwrap_or(true)) + }) + .count() as u64; + let worst_pointer_word_offset = + (base_non_config_size + num_non_copy_loads.saturating_sub(1) * 8) / 8; + + fn op_size_in_bytes( + data_section: &DataSection, + worst_pointer_word_offset: u64, + item: &AllocatedOp, + ) -> u64 { match &item.opcode { - AllocatedInstruction::LoadDataId(_reg, data_label) - if !data_section + AllocatedInstruction::LoadDataId(_reg, data_label) => { + let has_copy_type = data_section .has_copy_type(data_label) - .expect("data label references non existent data -- internal error") => - { - 8 + .expect("data label references non existent data -- internal error"); + if has_copy_type { + let offset_bytes = data_section.data_id_to_offset(data_label) as u64; + let is_byte = data_section.is_byte(data_label).unwrap(); + let imm_value = if is_byte { offset_bytes } else { offset_bytes / 8 }; + if imm_value > TWELVE_BITS { 12 } else { 4 } + } else { + // Use worst-case pointer offset: if any pointer might exceed 12 bits, + // all non-copy loads use the large form for consistent sizing. + if worst_pointer_word_offset > TWELVE_BITS { 16 } else { 8 } + } } AllocatedInstruction::AddrDataId(_, _data_id) => 8, AllocatedInstruction::ConfigurablesOffsetPlaceholder => 8, @@ -140,9 +167,9 @@ fn to_bytecode_mut( // Some instructions may be omitted or expanded into multiple instructions, so we compute, // using `op_size_in_bytes`, exactly how many ops will be generated to calculate the offset. - let mut offset_to_data_section_in_bytes = ops - .iter() - .fold(0, |acc, item| acc + op_size_in_bytes(data_section, item)); + let mut offset_to_data_section_in_bytes = ops.iter().fold(0, |acc, item| { + acc + op_size_in_bytes(data_section, worst_pointer_word_offset, item) + }); // A noop is inserted in ASM generation if required, to word-align the data section. let mut ops_padded = Vec::new(); @@ -160,6 +187,7 @@ fn to_bytecode_mut( &ops_padded }; + let mut num_pointers_inserted: u64 = 0; let mut offset_from_instr_start = 0; for op in ops.iter() { match &op.opcode { @@ -173,14 +201,31 @@ fn to_bytecode_mut( // so that when we take addresses of configurables, that address doesn't change // later on if a non-configurable is added to the data-section. let offset_bytes = data_section.data_id_to_offset(data_label) as u64; - // The -4 is because $pc is added in the *next* instruction. - let pointer_offset_from_current_instr = - offset_to_data_section_in_bytes - offset_from_instr_start + offset_bytes - 4; - data_section.append_pointer(pointer_offset_from_current_instr); + + // The pointer entry will be appended at the end of non_configurables. + // Predict its word offset to determine the inner load instruction count. + let pointer_word_offset = + (base_non_config_size + num_pointers_inserted * 8) / 8; + let inner_instr_bytes = + if pointer_word_offset > TWELVE_BITS { 12 } else { 4 }; + + // $pc is read by the ADD instruction that follows the inner load. + // The correction accounts for the inner load's instruction count. + let pointer_offset_from_current_instr = offset_to_data_section_in_bytes + - offset_from_instr_start + + offset_bytes + - inner_instr_bytes; + data_section.append_pointer( + pointer_offset_from_current_instr, + data_label, + offset_from_instr_start, + ); + num_pointers_inserted += 1; } _ => (), } - offset_from_instr_start += op_size_in_bytes(data_section, op); + offset_from_instr_start += + op_size_in_bytes(data_section, worst_pointer_word_offset, op); } let mut bytecode = Vec::with_capacity(offset_to_data_section_in_bytes as usize); @@ -205,7 +250,8 @@ fn to_bytecode_mut( offset_from_instr_start, data_section, ); - offset_from_instr_start += op_size_in_bytes(data_section, op); + offset_from_instr_start += + op_size_in_bytes(data_section, worst_pointer_word_offset, op); match fuel_op { FuelAsmData::DatasectionOffset(data) => { diff --git a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs b/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs index 726d4ee65e8..d59d6631981 100644 --- a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs +++ b/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs @@ -264,6 +264,7 @@ impl AllocatedAbstractInstructionSet { far_jump_sizes: &FxHashMap, ) -> Result<(RealizedAbstractInstructionSet, LabeledBlocks), crate::CompileError> { let label_offsets = self.resolve_labels(data_section); + let worst_ptr_offset = Self::worst_pointer_word_offset(&self.ops, data_section); let mut curr_offset = 0; let mut realized_ops = vec![]; @@ -271,7 +272,9 @@ impl AllocatedAbstractInstructionSet { let op_size = far_jump_sizes .get(&op_idx) .copied() - .unwrap_or_else(|| Self::instruction_size_not_far_jump(op, data_section)); + .unwrap_or_else(|| { + Self::instruction_size_not_far_jump(op, data_section, worst_ptr_offset) + }); let AllocatedAbstractOp { opcode, comment, @@ -394,10 +397,11 @@ impl AllocatedAbstractInstructionSet { match op.opcode { Either::Right(Label(_)) => 0, - // Loads from data section may take up to 2 instructions + // Loads from data section may take up to 4 instructions + // (MOVI + ADD + LW/LB for copy-type, plus ADD $pc for non-copy) Either::Left( AllocatedInstruction::LoadDataId(_, _) | AllocatedInstruction::AddrDataId(_, _), - ) => 2, + ) => 4, // cfei 0 and cfsi 0 are omitted from asm emission, don't count them for offsets Either::Left(AllocatedInstruction::CFEI(ref op)) @@ -435,24 +439,49 @@ impl AllocatedAbstractInstructionSet { } } - // Actual size of an instruction. - // Note that this return incorrect values for far jumps, they must be handled separately. - // The return value is in concrete instructions, i.e. units of 4 bytes. - fn instruction_size_not_far_jump(op: &AllocatedAbstractOp, data_section: &DataSection) -> u64 { + fn worst_pointer_word_offset( + ops: &[AllocatedAbstractOp], + data_section: &DataSection, + ) -> u64 { + let base = data_section.non_configurables_size_in_bytes() as u64; + let num_non_copy: u64 = ops + .iter() + .filter(|op| { + matches!( + &op.opcode, + either::Either::Left(AllocatedInstruction::LoadDataId(_, ref id)) + if !data_section.has_copy_type(id).unwrap_or(true) + ) + }) + .count() as u64; + (base + num_non_copy.saturating_sub(1) * 8) / 8 + } + + // Actual size of an instruction (units of 4 bytes). + // Incorrect for far jumps — those are handled separately. + // Must be called before pointer pre-insertion in to_bytecode_mut; + // non-copy size estimates depend on non_configurables_size_in_bytes() being pointer-free. + fn instruction_size_not_far_jump( + op: &AllocatedAbstractOp, + data_section: &DataSection, + worst_pointer_word_offset: u64, + ) -> u64 { use ControlFlowOp::*; match op.opcode { Either::Right(Label(_)) => 0, - // A special case for LoadDataId which may be 1 or 2 ops, depending on the source size. Either::Left(AllocatedInstruction::LoadDataId(_, ref data_id)) => { let has_copy_type = data_section.has_copy_type(data_id).expect( "Internal miscalculation in data section -- \ data id did not match up to any actual data", ); if has_copy_type { - 1 + let offset_bytes = data_section.data_id_to_offset(data_id) as u64; + let is_byte = data_section.is_byte(data_id).unwrap(); + let imm_value = if is_byte { offset_bytes } else { offset_bytes / 8 }; + if imm_value > consts::TWELVE_BITS { 3 } else { 1 } } else { - 2 + if worst_pointer_word_offset > consts::TWELVE_BITS { 4 } else { 2 } } } @@ -593,6 +622,7 @@ impl AllocatedAbstractInstructionSet { data_section: &DataSection, far_jump_sizes: &FxHashMap, ) -> LabeledBlocks { + let worst_ptr_offset = Self::worst_pointer_word_offset(&self.ops, data_section); let mut labelled_blocks = LabeledBlocks::new(); let mut cur_offset = 0; let mut cur_basic_block = None; @@ -614,7 +644,9 @@ impl AllocatedAbstractInstructionSet { let op_size = far_jump_sizes .get(&op_idx) .copied() - .unwrap_or_else(|| Self::instruction_size_not_far_jump(op, data_section)); + .unwrap_or_else(|| { + Self::instruction_size_not_far_jump(op, data_section, worst_ptr_offset) + }); cur_offset += op_size; } diff --git a/sway-core/src/asm_generation/fuel/data_section.rs b/sway-core/src/asm_generation/fuel/data_section.rs index 592d4f54238..00a2e4d8ab3 100644 --- a/sway-core/src/asm_generation/fuel/data_section.rs +++ b/sway-core/src/asm_generation/fuel/data_section.rs @@ -219,7 +219,7 @@ impl Entry { } } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] pub enum DataIdEntryKind { NonConfigurable, Configurable, @@ -235,7 +235,7 @@ impl fmt::Display for DataIdEntryKind { } /// An address which refers to a value in the data section of the asm. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] pub(crate) struct DataId { pub(crate) idx: u32, pub(crate) kind: DataIdEntryKind, @@ -252,7 +252,7 @@ impl fmt::Display for DataId { pub struct DataSection { pub non_configurables: Vec, pub configurables: Vec, - pub(crate) pointer_id: FxHashMap, + pub(crate) source_to_pointer: FxHashMap<(DataId, u64), DataId>, } impl DataSection { @@ -301,6 +301,10 @@ impl DataSection { }) } + pub(crate) fn non_configurables_size_in_bytes(&self) -> usize { + self.absolute_idx_to_offset(self.non_configurables.len()) + } + pub(crate) fn serialize_to_bytes(&self) -> Vec { // not the exact right capacity but serves as a lower bound let mut buf = Vec::with_capacity(self.num_entries()); @@ -330,21 +334,32 @@ impl DataSection { /// offsets of previous data). /// `pointer_value` is in _bytes_ and refers to the offset from instruction start or /// relative to the current (load) instruction. - pub(crate) fn append_pointer(&mut self, pointer_value: u64) -> DataId { + pub(crate) fn append_pointer( + &mut self, + pointer_value: u64, + source_data_id: &DataId, + load_site_offset: u64, + ) -> DataId { // The 'pointer' is just a literal 64 bit address. let data_id = self.insert_data_value(Entry::new_word( pointer_value, EntryName::NonConfigurable, None, )); - self.pointer_id.insert(pointer_value, data_id.clone()); + self.source_to_pointer + .insert((source_data_id.clone(), load_site_offset), data_id.clone()); data_id } - /// Get the [DataId] for a pointer, if it exists. - /// The pointer must've been inserted with append_pointer. - pub(crate) fn data_id_of_pointer(&self, pointer_value: u64) -> Option { - self.pointer_id.get(&pointer_value).cloned() + /// Get the pointer [DataId] for a non-copy load at a specific instruction offset. + pub(crate) fn pointer_for_load_site( + &self, + source_data_id: &DataId, + load_site_offset: u64, + ) -> Option { + self.source_to_pointer + .get(&(source_data_id.clone(), load_site_offset)) + .cloned() } /// Given any data in the form of a [Literal] (using this type mainly because it includes type diff --git a/sway-core/src/asm_lang/allocated_ops.rs b/sway-core/src/asm_lang/allocated_ops.rs index 6fe206f6c3e..049e57f8e4c 100644 --- a/sway-core/src/asm_lang/allocated_ops.rs +++ b/sway-core/src/asm_lang/allocated_ops.rs @@ -13,7 +13,8 @@ use super::*; use crate::{ asm_generation::fuel::{ compiler_constants::{ - DATA_SECTION_REGISTER, LOWER_ALLOCATABLE_REGISTER, UPPER_ALLOCATABLE_REGISTER, + DATA_SECTION_REGISTER, EIGHTEEN_BITS, LOWER_ALLOCATABLE_REGISTER, + UPPER_ALLOCATABLE_REGISTER, }, data_section::{DataId, DataSection}, }, @@ -21,7 +22,7 @@ use crate::{ }; use fuel_vm::fuel_asm::{ op::{ADD, MOVI}, - Imm18, + Imm12, Imm18, }; use std::fmt::{self, Write}; use sway_types::span::Span; @@ -947,6 +948,11 @@ fn addr_of( data_section: &DataSection, ) -> Vec { let offset_bytes = data_section.data_id_to_offset(data_id) as u64; + assert!( + offset_bytes <= EIGHTEEN_BITS, + "Data section offset {offset_bytes} bytes exceeds 18-bit MOVI immediate limit. \ + Data section too large." + ); vec![ fuel_asm::Instruction::MOVI(MOVI::new( dest.to_reg_id(), @@ -990,31 +996,14 @@ fn realize_load( ); let offset_words = offset_bytes / 8; - let imm = VirtualImmediate12::try_new( - if is_byte { offset_bytes } else { offset_words }, - Span::new(" ".into(), 0, 0, None).unwrap(), - ); - let offset = match imm { - Ok(value) => value, - Err(_) => panic!( - "Unable to offset into the data section more than 2^12 bits. \ - Unsupported data section length: {offset_words} words." - ), - }; - if !has_copy_type { - // load the pointer itself into the register. `offset_to_data_section` is in bytes. - // The -4 is because $pc is added in the *next* instruction. - let pointer_offset_from_current_instr = - offset_to_data_section - offset_from_instr_start + offset_bytes - 4; - - // insert the pointer as bytes as a new data section entry at the end of the data + // The pointer was pre-inserted during the pointer pre-insertion pass. let data_id_for_pointer = data_section - .data_id_of_pointer(pointer_offset_from_current_instr) - .expect("Pointer offset must be in data_section"); + .pointer_for_load_site(data_id, offset_from_instr_start) + .expect("Pointer for non-copy data must be pre-inserted"); - // now load the pointer we just created into the `dest`ination - let mut buf = Vec::with_capacity(2); + // Load the pointer value into the destination register. + let mut buf = Vec::with_capacity(4); buf.append(&mut realize_load( dest, &data_id_for_pointer, @@ -1032,19 +1021,50 @@ fn realize_load( .into(), ); buf - } else if is_byte { - vec![fuel_asm::op::LB::new( - dest.to_reg_id(), - fuel_asm::RegId::new(DATA_SECTION_REGISTER), - offset.value().into(), - ) - .into()] } else { - vec![fuel_asm::op::LW::new( - dest.to_reg_id(), - fuel_asm::RegId::new(DATA_SECTION_REGISTER), - offset.value().into(), - ) - .into()] + let imm_value = if is_byte { offset_bytes } else { offset_words }; + let imm = VirtualImmediate12::try_new(imm_value, Span::dummy()); + + if let Ok(offset) = imm { + if is_byte { + vec![fuel_asm::op::LB::new( + dest.to_reg_id(), + fuel_asm::RegId::new(DATA_SECTION_REGISTER), + offset.value().into(), + ) + .into()] + } else { + vec![fuel_asm::op::LW::new( + dest.to_reg_id(), + fuel_asm::RegId::new(DATA_SECTION_REGISTER), + offset.value().into(), + ) + .into()] + } + } else { + assert!( + offset_bytes <= EIGHTEEN_BITS, + "Data section offset {offset_bytes} bytes exceeds 18-bit MOVI immediate limit. \ + Data section too large ({offset_words} words)." + ); + vec![ + fuel_asm::Instruction::MOVI(MOVI::new( + dest.to_reg_id(), + Imm18::new(offset_bytes.try_into().unwrap()), + )), + fuel_asm::Instruction::ADD(ADD::new( + dest.to_reg_id(), + dest.to_reg_id(), + fuel_asm::RegId::new(DATA_SECTION_REGISTER), + )), + if is_byte { + fuel_asm::op::LB::new(dest.to_reg_id(), dest.to_reg_id(), Imm12::new(0)) + .into() + } else { + fuel_asm::op::LW::new(dest.to_reg_id(), dest.to_reg_id(), Imm12::new(0)) + .into() + }, + ] + } } } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/Forc.lock new file mode 100644 index 00000000000..d816ab38a64 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/Forc.lock @@ -0,0 +1,8 @@ +[[package]] +name = "large_data_section" +source = "member" +dependencies = ["std"] + +[[package]] +name = "std" +source = "path+from-root-E3854248C161EE9C" diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/Forc.toml new file mode 100644 index 00000000000..92558d7bcd2 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/Forc.toml @@ -0,0 +1,8 @@ +[project] +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" +name = "large_data_section" + +[dependencies] +std = { path = "../../../../../../../sway-lib-std" } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/src/main.sw new file mode 100644 index 00000000000..f9a6df21280 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/src/main.sw @@ -0,0 +1,90 @@ +script; + +fn main() -> u64 { + let mut sum: u64 = 0; + sum = sum + 1000000 + 1000001 + 1000002 + 1000003 + 1000004 + 1000005 + 1000006 + 1000007 + 1000008 + 1000009 + 1000010 + 1000011 + 1000012 + 1000013 + 1000014 + 1000015 + 1000016 + 1000017 + 1000018 + 1000019 + 1000020 + 1000021 + 1000022 + 1000023 + 1000024 + 1000025 + 1000026 + 1000027 + 1000028 + 1000029 + 1000030 + 1000031 + 1000032 + 1000033 + 1000034 + 1000035 + 1000036 + 1000037 + 1000038 + 1000039 + 1000040 + 1000041 + 1000042 + 1000043 + 1000044 + 1000045 + 1000046 + 1000047 + 1000048 + 1000049; + sum = sum + 1000050 + 1000051 + 1000052 + 1000053 + 1000054 + 1000055 + 1000056 + 1000057 + 1000058 + 1000059 + 1000060 + 1000061 + 1000062 + 1000063 + 1000064 + 1000065 + 1000066 + 1000067 + 1000068 + 1000069 + 1000070 + 1000071 + 1000072 + 1000073 + 1000074 + 1000075 + 1000076 + 1000077 + 1000078 + 1000079 + 1000080 + 1000081 + 1000082 + 1000083 + 1000084 + 1000085 + 1000086 + 1000087 + 1000088 + 1000089 + 1000090 + 1000091 + 1000092 + 1000093 + 1000094 + 1000095 + 1000096 + 1000097 + 1000098 + 1000099; + sum = sum + 1000100 + 1000101 + 1000102 + 1000103 + 1000104 + 1000105 + 1000106 + 1000107 + 1000108 + 1000109 + 1000110 + 1000111 + 1000112 + 1000113 + 1000114 + 1000115 + 1000116 + 1000117 + 1000118 + 1000119 + 1000120 + 1000121 + 1000122 + 1000123 + 1000124 + 1000125 + 1000126 + 1000127 + 1000128 + 1000129 + 1000130 + 1000131 + 1000132 + 1000133 + 1000134 + 1000135 + 1000136 + 1000137 + 1000138 + 1000139 + 1000140 + 1000141 + 1000142 + 1000143 + 1000144 + 1000145 + 1000146 + 1000147 + 1000148 + 1000149; + sum = sum + 1000150 + 1000151 + 1000152 + 1000153 + 1000154 + 1000155 + 1000156 + 1000157 + 1000158 + 1000159 + 1000160 + 1000161 + 1000162 + 1000163 + 1000164 + 1000165 + 1000166 + 1000167 + 1000168 + 1000169 + 1000170 + 1000171 + 1000172 + 1000173 + 1000174 + 1000175 + 1000176 + 1000177 + 1000178 + 1000179 + 1000180 + 1000181 + 1000182 + 1000183 + 1000184 + 1000185 + 1000186 + 1000187 + 1000188 + 1000189 + 1000190 + 1000191 + 1000192 + 1000193 + 1000194 + 1000195 + 1000196 + 1000197 + 1000198 + 1000199; + sum = sum + 1000200 + 1000201 + 1000202 + 1000203 + 1000204 + 1000205 + 1000206 + 1000207 + 1000208 + 1000209 + 1000210 + 1000211 + 1000212 + 1000213 + 1000214 + 1000215 + 1000216 + 1000217 + 1000218 + 1000219 + 1000220 + 1000221 + 1000222 + 1000223 + 1000224 + 1000225 + 1000226 + 1000227 + 1000228 + 1000229 + 1000230 + 1000231 + 1000232 + 1000233 + 1000234 + 1000235 + 1000236 + 1000237 + 1000238 + 1000239 + 1000240 + 1000241 + 1000242 + 1000243 + 1000244 + 1000245 + 1000246 + 1000247 + 1000248 + 1000249; + sum = sum + 1000250 + 1000251 + 1000252 + 1000253 + 1000254 + 1000255 + 1000256 + 1000257 + 1000258 + 1000259 + 1000260 + 1000261 + 1000262 + 1000263 + 1000264 + 1000265 + 1000266 + 1000267 + 1000268 + 1000269 + 1000270 + 1000271 + 1000272 + 1000273 + 1000274 + 1000275 + 1000276 + 1000277 + 1000278 + 1000279 + 1000280 + 1000281 + 1000282 + 1000283 + 1000284 + 1000285 + 1000286 + 1000287 + 1000288 + 1000289 + 1000290 + 1000291 + 1000292 + 1000293 + 1000294 + 1000295 + 1000296 + 1000297 + 1000298 + 1000299; + sum = sum + 1000300 + 1000301 + 1000302 + 1000303 + 1000304 + 1000305 + 1000306 + 1000307 + 1000308 + 1000309 + 1000310 + 1000311 + 1000312 + 1000313 + 1000314 + 1000315 + 1000316 + 1000317 + 1000318 + 1000319 + 1000320 + 1000321 + 1000322 + 1000323 + 1000324 + 1000325 + 1000326 + 1000327 + 1000328 + 1000329 + 1000330 + 1000331 + 1000332 + 1000333 + 1000334 + 1000335 + 1000336 + 1000337 + 1000338 + 1000339 + 1000340 + 1000341 + 1000342 + 1000343 + 1000344 + 1000345 + 1000346 + 1000347 + 1000348 + 1000349; + sum = sum + 1000350 + 1000351 + 1000352 + 1000353 + 1000354 + 1000355 + 1000356 + 1000357 + 1000358 + 1000359 + 1000360 + 1000361 + 1000362 + 1000363 + 1000364 + 1000365 + 1000366 + 1000367 + 1000368 + 1000369 + 1000370 + 1000371 + 1000372 + 1000373 + 1000374 + 1000375 + 1000376 + 1000377 + 1000378 + 1000379 + 1000380 + 1000381 + 1000382 + 1000383 + 1000384 + 1000385 + 1000386 + 1000387 + 1000388 + 1000389 + 1000390 + 1000391 + 1000392 + 1000393 + 1000394 + 1000395 + 1000396 + 1000397 + 1000398 + 1000399; + sum = sum + 1000400 + 1000401 + 1000402 + 1000403 + 1000404 + 1000405 + 1000406 + 1000407 + 1000408 + 1000409 + 1000410 + 1000411 + 1000412 + 1000413 + 1000414 + 1000415 + 1000416 + 1000417 + 1000418 + 1000419 + 1000420 + 1000421 + 1000422 + 1000423 + 1000424 + 1000425 + 1000426 + 1000427 + 1000428 + 1000429 + 1000430 + 1000431 + 1000432 + 1000433 + 1000434 + 1000435 + 1000436 + 1000437 + 1000438 + 1000439 + 1000440 + 1000441 + 1000442 + 1000443 + 1000444 + 1000445 + 1000446 + 1000447 + 1000448 + 1000449; + sum = sum + 1000450 + 1000451 + 1000452 + 1000453 + 1000454 + 1000455 + 1000456 + 1000457 + 1000458 + 1000459 + 1000460 + 1000461 + 1000462 + 1000463 + 1000464 + 1000465 + 1000466 + 1000467 + 1000468 + 1000469 + 1000470 + 1000471 + 1000472 + 1000473 + 1000474 + 1000475 + 1000476 + 1000477 + 1000478 + 1000479 + 1000480 + 1000481 + 1000482 + 1000483 + 1000484 + 1000485 + 1000486 + 1000487 + 1000488 + 1000489 + 1000490 + 1000491 + 1000492 + 1000493 + 1000494 + 1000495 + 1000496 + 1000497 + 1000498 + 1000499; + sum = sum + 1000500 + 1000501 + 1000502 + 1000503 + 1000504 + 1000505 + 1000506 + 1000507 + 1000508 + 1000509 + 1000510 + 1000511 + 1000512 + 1000513 + 1000514 + 1000515 + 1000516 + 1000517 + 1000518 + 1000519 + 1000520 + 1000521 + 1000522 + 1000523 + 1000524 + 1000525 + 1000526 + 1000527 + 1000528 + 1000529 + 1000530 + 1000531 + 1000532 + 1000533 + 1000534 + 1000535 + 1000536 + 1000537 + 1000538 + 1000539 + 1000540 + 1000541 + 1000542 + 1000543 + 1000544 + 1000545 + 1000546 + 1000547 + 1000548 + 1000549; + sum = sum + 1000550 + 1000551 + 1000552 + 1000553 + 1000554 + 1000555 + 1000556 + 1000557 + 1000558 + 1000559 + 1000560 + 1000561 + 1000562 + 1000563 + 1000564 + 1000565 + 1000566 + 1000567 + 1000568 + 1000569 + 1000570 + 1000571 + 1000572 + 1000573 + 1000574 + 1000575 + 1000576 + 1000577 + 1000578 + 1000579 + 1000580 + 1000581 + 1000582 + 1000583 + 1000584 + 1000585 + 1000586 + 1000587 + 1000588 + 1000589 + 1000590 + 1000591 + 1000592 + 1000593 + 1000594 + 1000595 + 1000596 + 1000597 + 1000598 + 1000599; + sum = sum + 1000600 + 1000601 + 1000602 + 1000603 + 1000604 + 1000605 + 1000606 + 1000607 + 1000608 + 1000609 + 1000610 + 1000611 + 1000612 + 1000613 + 1000614 + 1000615 + 1000616 + 1000617 + 1000618 + 1000619 + 1000620 + 1000621 + 1000622 + 1000623 + 1000624 + 1000625 + 1000626 + 1000627 + 1000628 + 1000629 + 1000630 + 1000631 + 1000632 + 1000633 + 1000634 + 1000635 + 1000636 + 1000637 + 1000638 + 1000639 + 1000640 + 1000641 + 1000642 + 1000643 + 1000644 + 1000645 + 1000646 + 1000647 + 1000648 + 1000649; + sum = sum + 1000650 + 1000651 + 1000652 + 1000653 + 1000654 + 1000655 + 1000656 + 1000657 + 1000658 + 1000659 + 1000660 + 1000661 + 1000662 + 1000663 + 1000664 + 1000665 + 1000666 + 1000667 + 1000668 + 1000669 + 1000670 + 1000671 + 1000672 + 1000673 + 1000674 + 1000675 + 1000676 + 1000677 + 1000678 + 1000679 + 1000680 + 1000681 + 1000682 + 1000683 + 1000684 + 1000685 + 1000686 + 1000687 + 1000688 + 1000689 + 1000690 + 1000691 + 1000692 + 1000693 + 1000694 + 1000695 + 1000696 + 1000697 + 1000698 + 1000699; + sum = sum + 1000700 + 1000701 + 1000702 + 1000703 + 1000704 + 1000705 + 1000706 + 1000707 + 1000708 + 1000709 + 1000710 + 1000711 + 1000712 + 1000713 + 1000714 + 1000715 + 1000716 + 1000717 + 1000718 + 1000719 + 1000720 + 1000721 + 1000722 + 1000723 + 1000724 + 1000725 + 1000726 + 1000727 + 1000728 + 1000729 + 1000730 + 1000731 + 1000732 + 1000733 + 1000734 + 1000735 + 1000736 + 1000737 + 1000738 + 1000739 + 1000740 + 1000741 + 1000742 + 1000743 + 1000744 + 1000745 + 1000746 + 1000747 + 1000748 + 1000749; + sum = sum + 1000750 + 1000751 + 1000752 + 1000753 + 1000754 + 1000755 + 1000756 + 1000757 + 1000758 + 1000759 + 1000760 + 1000761 + 1000762 + 1000763 + 1000764 + 1000765 + 1000766 + 1000767 + 1000768 + 1000769 + 1000770 + 1000771 + 1000772 + 1000773 + 1000774 + 1000775 + 1000776 + 1000777 + 1000778 + 1000779 + 1000780 + 1000781 + 1000782 + 1000783 + 1000784 + 1000785 + 1000786 + 1000787 + 1000788 + 1000789 + 1000790 + 1000791 + 1000792 + 1000793 + 1000794 + 1000795 + 1000796 + 1000797 + 1000798 + 1000799; + sum = sum + 1000800 + 1000801 + 1000802 + 1000803 + 1000804 + 1000805 + 1000806 + 1000807 + 1000808 + 1000809 + 1000810 + 1000811 + 1000812 + 1000813 + 1000814 + 1000815 + 1000816 + 1000817 + 1000818 + 1000819 + 1000820 + 1000821 + 1000822 + 1000823 + 1000824 + 1000825 + 1000826 + 1000827 + 1000828 + 1000829 + 1000830 + 1000831 + 1000832 + 1000833 + 1000834 + 1000835 + 1000836 + 1000837 + 1000838 + 1000839 + 1000840 + 1000841 + 1000842 + 1000843 + 1000844 + 1000845 + 1000846 + 1000847 + 1000848 + 1000849; + sum = sum + 1000850 + 1000851 + 1000852 + 1000853 + 1000854 + 1000855 + 1000856 + 1000857 + 1000858 + 1000859 + 1000860 + 1000861 + 1000862 + 1000863 + 1000864 + 1000865 + 1000866 + 1000867 + 1000868 + 1000869 + 1000870 + 1000871 + 1000872 + 1000873 + 1000874 + 1000875 + 1000876 + 1000877 + 1000878 + 1000879 + 1000880 + 1000881 + 1000882 + 1000883 + 1000884 + 1000885 + 1000886 + 1000887 + 1000888 + 1000889 + 1000890 + 1000891 + 1000892 + 1000893 + 1000894 + 1000895 + 1000896 + 1000897 + 1000898 + 1000899; + sum = sum + 1000900 + 1000901 + 1000902 + 1000903 + 1000904 + 1000905 + 1000906 + 1000907 + 1000908 + 1000909 + 1000910 + 1000911 + 1000912 + 1000913 + 1000914 + 1000915 + 1000916 + 1000917 + 1000918 + 1000919 + 1000920 + 1000921 + 1000922 + 1000923 + 1000924 + 1000925 + 1000926 + 1000927 + 1000928 + 1000929 + 1000930 + 1000931 + 1000932 + 1000933 + 1000934 + 1000935 + 1000936 + 1000937 + 1000938 + 1000939 + 1000940 + 1000941 + 1000942 + 1000943 + 1000944 + 1000945 + 1000946 + 1000947 + 1000948 + 1000949; + sum = sum + 1000950 + 1000951 + 1000952 + 1000953 + 1000954 + 1000955 + 1000956 + 1000957 + 1000958 + 1000959 + 1000960 + 1000961 + 1000962 + 1000963 + 1000964 + 1000965 + 1000966 + 1000967 + 1000968 + 1000969 + 1000970 + 1000971 + 1000972 + 1000973 + 1000974 + 1000975 + 1000976 + 1000977 + 1000978 + 1000979 + 1000980 + 1000981 + 1000982 + 1000983 + 1000984 + 1000985 + 1000986 + 1000987 + 1000988 + 1000989 + 1000990 + 1000991 + 1000992 + 1000993 + 1000994 + 1000995 + 1000996 + 1000997 + 1000998 + 1000999; + sum = sum + 1001000 + 1001001 + 1001002 + 1001003 + 1001004 + 1001005 + 1001006 + 1001007 + 1001008 + 1001009 + 1001010 + 1001011 + 1001012 + 1001013 + 1001014 + 1001015 + 1001016 + 1001017 + 1001018 + 1001019 + 1001020 + 1001021 + 1001022 + 1001023 + 1001024 + 1001025 + 1001026 + 1001027 + 1001028 + 1001029 + 1001030 + 1001031 + 1001032 + 1001033 + 1001034 + 1001035 + 1001036 + 1001037 + 1001038 + 1001039 + 1001040 + 1001041 + 1001042 + 1001043 + 1001044 + 1001045 + 1001046 + 1001047 + 1001048 + 1001049; + sum = sum + 1001050 + 1001051 + 1001052 + 1001053 + 1001054 + 1001055 + 1001056 + 1001057 + 1001058 + 1001059 + 1001060 + 1001061 + 1001062 + 1001063 + 1001064 + 1001065 + 1001066 + 1001067 + 1001068 + 1001069 + 1001070 + 1001071 + 1001072 + 1001073 + 1001074 + 1001075 + 1001076 + 1001077 + 1001078 + 1001079 + 1001080 + 1001081 + 1001082 + 1001083 + 1001084 + 1001085 + 1001086 + 1001087 + 1001088 + 1001089 + 1001090 + 1001091 + 1001092 + 1001093 + 1001094 + 1001095 + 1001096 + 1001097 + 1001098 + 1001099; + sum = sum + 1001100 + 1001101 + 1001102 + 1001103 + 1001104 + 1001105 + 1001106 + 1001107 + 1001108 + 1001109 + 1001110 + 1001111 + 1001112 + 1001113 + 1001114 + 1001115 + 1001116 + 1001117 + 1001118 + 1001119 + 1001120 + 1001121 + 1001122 + 1001123 + 1001124 + 1001125 + 1001126 + 1001127 + 1001128 + 1001129 + 1001130 + 1001131 + 1001132 + 1001133 + 1001134 + 1001135 + 1001136 + 1001137 + 1001138 + 1001139 + 1001140 + 1001141 + 1001142 + 1001143 + 1001144 + 1001145 + 1001146 + 1001147 + 1001148 + 1001149; + sum = sum + 1001150 + 1001151 + 1001152 + 1001153 + 1001154 + 1001155 + 1001156 + 1001157 + 1001158 + 1001159 + 1001160 + 1001161 + 1001162 + 1001163 + 1001164 + 1001165 + 1001166 + 1001167 + 1001168 + 1001169 + 1001170 + 1001171 + 1001172 + 1001173 + 1001174 + 1001175 + 1001176 + 1001177 + 1001178 + 1001179 + 1001180 + 1001181 + 1001182 + 1001183 + 1001184 + 1001185 + 1001186 + 1001187 + 1001188 + 1001189 + 1001190 + 1001191 + 1001192 + 1001193 + 1001194 + 1001195 + 1001196 + 1001197 + 1001198 + 1001199; + sum = sum + 1001200 + 1001201 + 1001202 + 1001203 + 1001204 + 1001205 + 1001206 + 1001207 + 1001208 + 1001209 + 1001210 + 1001211 + 1001212 + 1001213 + 1001214 + 1001215 + 1001216 + 1001217 + 1001218 + 1001219 + 1001220 + 1001221 + 1001222 + 1001223 + 1001224 + 1001225 + 1001226 + 1001227 + 1001228 + 1001229 + 1001230 + 1001231 + 1001232 + 1001233 + 1001234 + 1001235 + 1001236 + 1001237 + 1001238 + 1001239 + 1001240 + 1001241 + 1001242 + 1001243 + 1001244 + 1001245 + 1001246 + 1001247 + 1001248 + 1001249; + sum = sum + 1001250 + 1001251 + 1001252 + 1001253 + 1001254 + 1001255 + 1001256 + 1001257 + 1001258 + 1001259 + 1001260 + 1001261 + 1001262 + 1001263 + 1001264 + 1001265 + 1001266 + 1001267 + 1001268 + 1001269 + 1001270 + 1001271 + 1001272 + 1001273 + 1001274 + 1001275 + 1001276 + 1001277 + 1001278 + 1001279 + 1001280 + 1001281 + 1001282 + 1001283 + 1001284 + 1001285 + 1001286 + 1001287 + 1001288 + 1001289 + 1001290 + 1001291 + 1001292 + 1001293 + 1001294 + 1001295 + 1001296 + 1001297 + 1001298 + 1001299; + sum = sum + 1001300 + 1001301 + 1001302 + 1001303 + 1001304 + 1001305 + 1001306 + 1001307 + 1001308 + 1001309 + 1001310 + 1001311 + 1001312 + 1001313 + 1001314 + 1001315 + 1001316 + 1001317 + 1001318 + 1001319 + 1001320 + 1001321 + 1001322 + 1001323 + 1001324 + 1001325 + 1001326 + 1001327 + 1001328 + 1001329 + 1001330 + 1001331 + 1001332 + 1001333 + 1001334 + 1001335 + 1001336 + 1001337 + 1001338 + 1001339 + 1001340 + 1001341 + 1001342 + 1001343 + 1001344 + 1001345 + 1001346 + 1001347 + 1001348 + 1001349; + sum = sum + 1001350 + 1001351 + 1001352 + 1001353 + 1001354 + 1001355 + 1001356 + 1001357 + 1001358 + 1001359 + 1001360 + 1001361 + 1001362 + 1001363 + 1001364 + 1001365 + 1001366 + 1001367 + 1001368 + 1001369 + 1001370 + 1001371 + 1001372 + 1001373 + 1001374 + 1001375 + 1001376 + 1001377 + 1001378 + 1001379 + 1001380 + 1001381 + 1001382 + 1001383 + 1001384 + 1001385 + 1001386 + 1001387 + 1001388 + 1001389 + 1001390 + 1001391 + 1001392 + 1001393 + 1001394 + 1001395 + 1001396 + 1001397 + 1001398 + 1001399; + sum = sum + 1001400 + 1001401 + 1001402 + 1001403 + 1001404 + 1001405 + 1001406 + 1001407 + 1001408 + 1001409 + 1001410 + 1001411 + 1001412 + 1001413 + 1001414 + 1001415 + 1001416 + 1001417 + 1001418 + 1001419 + 1001420 + 1001421 + 1001422 + 1001423 + 1001424 + 1001425 + 1001426 + 1001427 + 1001428 + 1001429 + 1001430 + 1001431 + 1001432 + 1001433 + 1001434 + 1001435 + 1001436 + 1001437 + 1001438 + 1001439 + 1001440 + 1001441 + 1001442 + 1001443 + 1001444 + 1001445 + 1001446 + 1001447 + 1001448 + 1001449; + sum = sum + 1001450 + 1001451 + 1001452 + 1001453 + 1001454 + 1001455 + 1001456 + 1001457 + 1001458 + 1001459 + 1001460 + 1001461 + 1001462 + 1001463 + 1001464 + 1001465 + 1001466 + 1001467 + 1001468 + 1001469 + 1001470 + 1001471 + 1001472 + 1001473 + 1001474 + 1001475 + 1001476 + 1001477 + 1001478 + 1001479 + 1001480 + 1001481 + 1001482 + 1001483 + 1001484 + 1001485 + 1001486 + 1001487 + 1001488 + 1001489 + 1001490 + 1001491 + 1001492 + 1001493 + 1001494 + 1001495 + 1001496 + 1001497 + 1001498 + 1001499; + sum = sum + 1001500 + 1001501 + 1001502 + 1001503 + 1001504 + 1001505 + 1001506 + 1001507 + 1001508 + 1001509 + 1001510 + 1001511 + 1001512 + 1001513 + 1001514 + 1001515 + 1001516 + 1001517 + 1001518 + 1001519 + 1001520 + 1001521 + 1001522 + 1001523 + 1001524 + 1001525 + 1001526 + 1001527 + 1001528 + 1001529 + 1001530 + 1001531 + 1001532 + 1001533 + 1001534 + 1001535 + 1001536 + 1001537 + 1001538 + 1001539 + 1001540 + 1001541 + 1001542 + 1001543 + 1001544 + 1001545 + 1001546 + 1001547 + 1001548 + 1001549; + sum = sum + 1001550 + 1001551 + 1001552 + 1001553 + 1001554 + 1001555 + 1001556 + 1001557 + 1001558 + 1001559 + 1001560 + 1001561 + 1001562 + 1001563 + 1001564 + 1001565 + 1001566 + 1001567 + 1001568 + 1001569 + 1001570 + 1001571 + 1001572 + 1001573 + 1001574 + 1001575 + 1001576 + 1001577 + 1001578 + 1001579 + 1001580 + 1001581 + 1001582 + 1001583 + 1001584 + 1001585 + 1001586 + 1001587 + 1001588 + 1001589 + 1001590 + 1001591 + 1001592 + 1001593 + 1001594 + 1001595 + 1001596 + 1001597 + 1001598 + 1001599; + sum = sum + 1001600 + 1001601 + 1001602 + 1001603 + 1001604 + 1001605 + 1001606 + 1001607 + 1001608 + 1001609 + 1001610 + 1001611 + 1001612 + 1001613 + 1001614 + 1001615 + 1001616 + 1001617 + 1001618 + 1001619 + 1001620 + 1001621 + 1001622 + 1001623 + 1001624 + 1001625 + 1001626 + 1001627 + 1001628 + 1001629 + 1001630 + 1001631 + 1001632 + 1001633 + 1001634 + 1001635 + 1001636 + 1001637 + 1001638 + 1001639 + 1001640 + 1001641 + 1001642 + 1001643 + 1001644 + 1001645 + 1001646 + 1001647 + 1001648 + 1001649; + sum = sum + 1001650 + 1001651 + 1001652 + 1001653 + 1001654 + 1001655 + 1001656 + 1001657 + 1001658 + 1001659 + 1001660 + 1001661 + 1001662 + 1001663 + 1001664 + 1001665 + 1001666 + 1001667 + 1001668 + 1001669 + 1001670 + 1001671 + 1001672 + 1001673 + 1001674 + 1001675 + 1001676 + 1001677 + 1001678 + 1001679 + 1001680 + 1001681 + 1001682 + 1001683 + 1001684 + 1001685 + 1001686 + 1001687 + 1001688 + 1001689 + 1001690 + 1001691 + 1001692 + 1001693 + 1001694 + 1001695 + 1001696 + 1001697 + 1001698 + 1001699; + sum = sum + 1001700 + 1001701 + 1001702 + 1001703 + 1001704 + 1001705 + 1001706 + 1001707 + 1001708 + 1001709 + 1001710 + 1001711 + 1001712 + 1001713 + 1001714 + 1001715 + 1001716 + 1001717 + 1001718 + 1001719 + 1001720 + 1001721 + 1001722 + 1001723 + 1001724 + 1001725 + 1001726 + 1001727 + 1001728 + 1001729 + 1001730 + 1001731 + 1001732 + 1001733 + 1001734 + 1001735 + 1001736 + 1001737 + 1001738 + 1001739 + 1001740 + 1001741 + 1001742 + 1001743 + 1001744 + 1001745 + 1001746 + 1001747 + 1001748 + 1001749; + sum = sum + 1001750 + 1001751 + 1001752 + 1001753 + 1001754 + 1001755 + 1001756 + 1001757 + 1001758 + 1001759 + 1001760 + 1001761 + 1001762 + 1001763 + 1001764 + 1001765 + 1001766 + 1001767 + 1001768 + 1001769 + 1001770 + 1001771 + 1001772 + 1001773 + 1001774 + 1001775 + 1001776 + 1001777 + 1001778 + 1001779 + 1001780 + 1001781 + 1001782 + 1001783 + 1001784 + 1001785 + 1001786 + 1001787 + 1001788 + 1001789 + 1001790 + 1001791 + 1001792 + 1001793 + 1001794 + 1001795 + 1001796 + 1001797 + 1001798 + 1001799; + sum = sum + 1001800 + 1001801 + 1001802 + 1001803 + 1001804 + 1001805 + 1001806 + 1001807 + 1001808 + 1001809 + 1001810 + 1001811 + 1001812 + 1001813 + 1001814 + 1001815 + 1001816 + 1001817 + 1001818 + 1001819 + 1001820 + 1001821 + 1001822 + 1001823 + 1001824 + 1001825 + 1001826 + 1001827 + 1001828 + 1001829 + 1001830 + 1001831 + 1001832 + 1001833 + 1001834 + 1001835 + 1001836 + 1001837 + 1001838 + 1001839 + 1001840 + 1001841 + 1001842 + 1001843 + 1001844 + 1001845 + 1001846 + 1001847 + 1001848 + 1001849; + sum = sum + 1001850 + 1001851 + 1001852 + 1001853 + 1001854 + 1001855 + 1001856 + 1001857 + 1001858 + 1001859 + 1001860 + 1001861 + 1001862 + 1001863 + 1001864 + 1001865 + 1001866 + 1001867 + 1001868 + 1001869 + 1001870 + 1001871 + 1001872 + 1001873 + 1001874 + 1001875 + 1001876 + 1001877 + 1001878 + 1001879 + 1001880 + 1001881 + 1001882 + 1001883 + 1001884 + 1001885 + 1001886 + 1001887 + 1001888 + 1001889 + 1001890 + 1001891 + 1001892 + 1001893 + 1001894 + 1001895 + 1001896 + 1001897 + 1001898 + 1001899; + sum = sum + 1001900 + 1001901 + 1001902 + 1001903 + 1001904 + 1001905 + 1001906 + 1001907 + 1001908 + 1001909 + 1001910 + 1001911 + 1001912 + 1001913 + 1001914 + 1001915 + 1001916 + 1001917 + 1001918 + 1001919 + 1001920 + 1001921 + 1001922 + 1001923 + 1001924 + 1001925 + 1001926 + 1001927 + 1001928 + 1001929 + 1001930 + 1001931 + 1001932 + 1001933 + 1001934 + 1001935 + 1001936 + 1001937 + 1001938 + 1001939 + 1001940 + 1001941 + 1001942 + 1001943 + 1001944 + 1001945 + 1001946 + 1001947 + 1001948 + 1001949; + sum = sum + 1001950 + 1001951 + 1001952 + 1001953 + 1001954 + 1001955 + 1001956 + 1001957 + 1001958 + 1001959 + 1001960 + 1001961 + 1001962 + 1001963 + 1001964 + 1001965 + 1001966 + 1001967 + 1001968 + 1001969 + 1001970 + 1001971 + 1001972 + 1001973 + 1001974 + 1001975 + 1001976 + 1001977 + 1001978 + 1001979 + 1001980 + 1001981 + 1001982 + 1001983 + 1001984 + 1001985 + 1001986 + 1001987 + 1001988 + 1001989 + 1001990 + 1001991 + 1001992 + 1001993 + 1001994 + 1001995 + 1001996 + 1001997 + 1001998 + 1001999; + sum = sum + 1002000 + 1002001 + 1002002 + 1002003 + 1002004 + 1002005 + 1002006 + 1002007 + 1002008 + 1002009 + 1002010 + 1002011 + 1002012 + 1002013 + 1002014 + 1002015 + 1002016 + 1002017 + 1002018 + 1002019 + 1002020 + 1002021 + 1002022 + 1002023 + 1002024 + 1002025 + 1002026 + 1002027 + 1002028 + 1002029 + 1002030 + 1002031 + 1002032 + 1002033 + 1002034 + 1002035 + 1002036 + 1002037 + 1002038 + 1002039 + 1002040 + 1002041 + 1002042 + 1002043 + 1002044 + 1002045 + 1002046 + 1002047 + 1002048 + 1002049; + sum = sum + 1002050 + 1002051 + 1002052 + 1002053 + 1002054 + 1002055 + 1002056 + 1002057 + 1002058 + 1002059 + 1002060 + 1002061 + 1002062 + 1002063 + 1002064 + 1002065 + 1002066 + 1002067 + 1002068 + 1002069 + 1002070 + 1002071 + 1002072 + 1002073 + 1002074 + 1002075 + 1002076 + 1002077 + 1002078 + 1002079 + 1002080 + 1002081 + 1002082 + 1002083 + 1002084 + 1002085 + 1002086 + 1002087 + 1002088 + 1002089 + 1002090 + 1002091 + 1002092 + 1002093 + 1002094 + 1002095 + 1002096 + 1002097 + 1002098 + 1002099; + sum = sum + 1002100 + 1002101 + 1002102 + 1002103 + 1002104 + 1002105 + 1002106 + 1002107 + 1002108 + 1002109 + 1002110 + 1002111 + 1002112 + 1002113 + 1002114 + 1002115 + 1002116 + 1002117 + 1002118 + 1002119 + 1002120 + 1002121 + 1002122 + 1002123 + 1002124 + 1002125 + 1002126 + 1002127 + 1002128 + 1002129 + 1002130 + 1002131 + 1002132 + 1002133 + 1002134 + 1002135 + 1002136 + 1002137 + 1002138 + 1002139 + 1002140 + 1002141 + 1002142 + 1002143 + 1002144 + 1002145 + 1002146 + 1002147 + 1002148 + 1002149; + sum = sum + 1002150 + 1002151 + 1002152 + 1002153 + 1002154 + 1002155 + 1002156 + 1002157 + 1002158 + 1002159 + 1002160 + 1002161 + 1002162 + 1002163 + 1002164 + 1002165 + 1002166 + 1002167 + 1002168 + 1002169 + 1002170 + 1002171 + 1002172 + 1002173 + 1002174 + 1002175 + 1002176 + 1002177 + 1002178 + 1002179 + 1002180 + 1002181 + 1002182 + 1002183 + 1002184 + 1002185 + 1002186 + 1002187 + 1002188 + 1002189 + 1002190 + 1002191 + 1002192 + 1002193 + 1002194 + 1002195 + 1002196 + 1002197 + 1002198 + 1002199; + sum = sum + 1002200 + 1002201 + 1002202 + 1002203 + 1002204 + 1002205 + 1002206 + 1002207 + 1002208 + 1002209 + 1002210 + 1002211 + 1002212 + 1002213 + 1002214 + 1002215 + 1002216 + 1002217 + 1002218 + 1002219 + 1002220 + 1002221 + 1002222 + 1002223 + 1002224 + 1002225 + 1002226 + 1002227 + 1002228 + 1002229 + 1002230 + 1002231 + 1002232 + 1002233 + 1002234 + 1002235 + 1002236 + 1002237 + 1002238 + 1002239 + 1002240 + 1002241 + 1002242 + 1002243 + 1002244 + 1002245 + 1002246 + 1002247 + 1002248 + 1002249; + sum = sum + 1002250 + 1002251 + 1002252 + 1002253 + 1002254 + 1002255 + 1002256 + 1002257 + 1002258 + 1002259 + 1002260 + 1002261 + 1002262 + 1002263 + 1002264 + 1002265 + 1002266 + 1002267 + 1002268 + 1002269 + 1002270 + 1002271 + 1002272 + 1002273 + 1002274 + 1002275 + 1002276 + 1002277 + 1002278 + 1002279 + 1002280 + 1002281 + 1002282 + 1002283 + 1002284 + 1002285 + 1002286 + 1002287 + 1002288 + 1002289 + 1002290 + 1002291 + 1002292 + 1002293 + 1002294 + 1002295 + 1002296 + 1002297 + 1002298 + 1002299; + sum = sum + 1002300 + 1002301 + 1002302 + 1002303 + 1002304 + 1002305 + 1002306 + 1002307 + 1002308 + 1002309 + 1002310 + 1002311 + 1002312 + 1002313 + 1002314 + 1002315 + 1002316 + 1002317 + 1002318 + 1002319 + 1002320 + 1002321 + 1002322 + 1002323 + 1002324 + 1002325 + 1002326 + 1002327 + 1002328 + 1002329 + 1002330 + 1002331 + 1002332 + 1002333 + 1002334 + 1002335 + 1002336 + 1002337 + 1002338 + 1002339 + 1002340 + 1002341 + 1002342 + 1002343 + 1002344 + 1002345 + 1002346 + 1002347 + 1002348 + 1002349; + sum = sum + 1002350 + 1002351 + 1002352 + 1002353 + 1002354 + 1002355 + 1002356 + 1002357 + 1002358 + 1002359 + 1002360 + 1002361 + 1002362 + 1002363 + 1002364 + 1002365 + 1002366 + 1002367 + 1002368 + 1002369 + 1002370 + 1002371 + 1002372 + 1002373 + 1002374 + 1002375 + 1002376 + 1002377 + 1002378 + 1002379 + 1002380 + 1002381 + 1002382 + 1002383 + 1002384 + 1002385 + 1002386 + 1002387 + 1002388 + 1002389 + 1002390 + 1002391 + 1002392 + 1002393 + 1002394 + 1002395 + 1002396 + 1002397 + 1002398 + 1002399; + sum = sum + 1002400 + 1002401 + 1002402 + 1002403 + 1002404 + 1002405 + 1002406 + 1002407 + 1002408 + 1002409 + 1002410 + 1002411 + 1002412 + 1002413 + 1002414 + 1002415 + 1002416 + 1002417 + 1002418 + 1002419 + 1002420 + 1002421 + 1002422 + 1002423 + 1002424 + 1002425 + 1002426 + 1002427 + 1002428 + 1002429 + 1002430 + 1002431 + 1002432 + 1002433 + 1002434 + 1002435 + 1002436 + 1002437 + 1002438 + 1002439 + 1002440 + 1002441 + 1002442 + 1002443 + 1002444 + 1002445 + 1002446 + 1002447 + 1002448 + 1002449; + sum = sum + 1002450 + 1002451 + 1002452 + 1002453 + 1002454 + 1002455 + 1002456 + 1002457 + 1002458 + 1002459 + 1002460 + 1002461 + 1002462 + 1002463 + 1002464 + 1002465 + 1002466 + 1002467 + 1002468 + 1002469 + 1002470 + 1002471 + 1002472 + 1002473 + 1002474 + 1002475 + 1002476 + 1002477 + 1002478 + 1002479 + 1002480 + 1002481 + 1002482 + 1002483 + 1002484 + 1002485 + 1002486 + 1002487 + 1002488 + 1002489 + 1002490 + 1002491 + 1002492 + 1002493 + 1002494 + 1002495 + 1002496 + 1002497 + 1002498 + 1002499; + sum = sum + 1002500 + 1002501 + 1002502 + 1002503 + 1002504 + 1002505 + 1002506 + 1002507 + 1002508 + 1002509 + 1002510 + 1002511 + 1002512 + 1002513 + 1002514 + 1002515 + 1002516 + 1002517 + 1002518 + 1002519 + 1002520 + 1002521 + 1002522 + 1002523 + 1002524 + 1002525 + 1002526 + 1002527 + 1002528 + 1002529 + 1002530 + 1002531 + 1002532 + 1002533 + 1002534 + 1002535 + 1002536 + 1002537 + 1002538 + 1002539 + 1002540 + 1002541 + 1002542 + 1002543 + 1002544 + 1002545 + 1002546 + 1002547 + 1002548 + 1002549; + sum = sum + 1002550 + 1002551 + 1002552 + 1002553 + 1002554 + 1002555 + 1002556 + 1002557 + 1002558 + 1002559 + 1002560 + 1002561 + 1002562 + 1002563 + 1002564 + 1002565 + 1002566 + 1002567 + 1002568 + 1002569 + 1002570 + 1002571 + 1002572 + 1002573 + 1002574 + 1002575 + 1002576 + 1002577 + 1002578 + 1002579 + 1002580 + 1002581 + 1002582 + 1002583 + 1002584 + 1002585 + 1002586 + 1002587 + 1002588 + 1002589 + 1002590 + 1002591 + 1002592 + 1002593 + 1002594 + 1002595 + 1002596 + 1002597 + 1002598 + 1002599; + sum = sum + 1002600 + 1002601 + 1002602 + 1002603 + 1002604 + 1002605 + 1002606 + 1002607 + 1002608 + 1002609 + 1002610 + 1002611 + 1002612 + 1002613 + 1002614 + 1002615 + 1002616 + 1002617 + 1002618 + 1002619 + 1002620 + 1002621 + 1002622 + 1002623 + 1002624 + 1002625 + 1002626 + 1002627 + 1002628 + 1002629 + 1002630 + 1002631 + 1002632 + 1002633 + 1002634 + 1002635 + 1002636 + 1002637 + 1002638 + 1002639 + 1002640 + 1002641 + 1002642 + 1002643 + 1002644 + 1002645 + 1002646 + 1002647 + 1002648 + 1002649; + sum = sum + 1002650 + 1002651 + 1002652 + 1002653 + 1002654 + 1002655 + 1002656 + 1002657 + 1002658 + 1002659 + 1002660 + 1002661 + 1002662 + 1002663 + 1002664 + 1002665 + 1002666 + 1002667 + 1002668 + 1002669 + 1002670 + 1002671 + 1002672 + 1002673 + 1002674 + 1002675 + 1002676 + 1002677 + 1002678 + 1002679 + 1002680 + 1002681 + 1002682 + 1002683 + 1002684 + 1002685 + 1002686 + 1002687 + 1002688 + 1002689 + 1002690 + 1002691 + 1002692 + 1002693 + 1002694 + 1002695 + 1002696 + 1002697 + 1002698 + 1002699; + sum = sum + 1002700 + 1002701 + 1002702 + 1002703 + 1002704 + 1002705 + 1002706 + 1002707 + 1002708 + 1002709 + 1002710 + 1002711 + 1002712 + 1002713 + 1002714 + 1002715 + 1002716 + 1002717 + 1002718 + 1002719 + 1002720 + 1002721 + 1002722 + 1002723 + 1002724 + 1002725 + 1002726 + 1002727 + 1002728 + 1002729 + 1002730 + 1002731 + 1002732 + 1002733 + 1002734 + 1002735 + 1002736 + 1002737 + 1002738 + 1002739 + 1002740 + 1002741 + 1002742 + 1002743 + 1002744 + 1002745 + 1002746 + 1002747 + 1002748 + 1002749; + sum = sum + 1002750 + 1002751 + 1002752 + 1002753 + 1002754 + 1002755 + 1002756 + 1002757 + 1002758 + 1002759 + 1002760 + 1002761 + 1002762 + 1002763 + 1002764 + 1002765 + 1002766 + 1002767 + 1002768 + 1002769 + 1002770 + 1002771 + 1002772 + 1002773 + 1002774 + 1002775 + 1002776 + 1002777 + 1002778 + 1002779 + 1002780 + 1002781 + 1002782 + 1002783 + 1002784 + 1002785 + 1002786 + 1002787 + 1002788 + 1002789 + 1002790 + 1002791 + 1002792 + 1002793 + 1002794 + 1002795 + 1002796 + 1002797 + 1002798 + 1002799; + sum = sum + 1002800 + 1002801 + 1002802 + 1002803 + 1002804 + 1002805 + 1002806 + 1002807 + 1002808 + 1002809 + 1002810 + 1002811 + 1002812 + 1002813 + 1002814 + 1002815 + 1002816 + 1002817 + 1002818 + 1002819 + 1002820 + 1002821 + 1002822 + 1002823 + 1002824 + 1002825 + 1002826 + 1002827 + 1002828 + 1002829 + 1002830 + 1002831 + 1002832 + 1002833 + 1002834 + 1002835 + 1002836 + 1002837 + 1002838 + 1002839 + 1002840 + 1002841 + 1002842 + 1002843 + 1002844 + 1002845 + 1002846 + 1002847 + 1002848 + 1002849; + sum = sum + 1002850 + 1002851 + 1002852 + 1002853 + 1002854 + 1002855 + 1002856 + 1002857 + 1002858 + 1002859 + 1002860 + 1002861 + 1002862 + 1002863 + 1002864 + 1002865 + 1002866 + 1002867 + 1002868 + 1002869 + 1002870 + 1002871 + 1002872 + 1002873 + 1002874 + 1002875 + 1002876 + 1002877 + 1002878 + 1002879 + 1002880 + 1002881 + 1002882 + 1002883 + 1002884 + 1002885 + 1002886 + 1002887 + 1002888 + 1002889 + 1002890 + 1002891 + 1002892 + 1002893 + 1002894 + 1002895 + 1002896 + 1002897 + 1002898 + 1002899; + sum = sum + 1002900 + 1002901 + 1002902 + 1002903 + 1002904 + 1002905 + 1002906 + 1002907 + 1002908 + 1002909 + 1002910 + 1002911 + 1002912 + 1002913 + 1002914 + 1002915 + 1002916 + 1002917 + 1002918 + 1002919 + 1002920 + 1002921 + 1002922 + 1002923 + 1002924 + 1002925 + 1002926 + 1002927 + 1002928 + 1002929 + 1002930 + 1002931 + 1002932 + 1002933 + 1002934 + 1002935 + 1002936 + 1002937 + 1002938 + 1002939 + 1002940 + 1002941 + 1002942 + 1002943 + 1002944 + 1002945 + 1002946 + 1002947 + 1002948 + 1002949; + sum = sum + 1002950 + 1002951 + 1002952 + 1002953 + 1002954 + 1002955 + 1002956 + 1002957 + 1002958 + 1002959 + 1002960 + 1002961 + 1002962 + 1002963 + 1002964 + 1002965 + 1002966 + 1002967 + 1002968 + 1002969 + 1002970 + 1002971 + 1002972 + 1002973 + 1002974 + 1002975 + 1002976 + 1002977 + 1002978 + 1002979 + 1002980 + 1002981 + 1002982 + 1002983 + 1002984 + 1002985 + 1002986 + 1002987 + 1002988 + 1002989 + 1002990 + 1002991 + 1002992 + 1002993 + 1002994 + 1002995 + 1002996 + 1002997 + 1002998 + 1002999; + sum = sum + 1003000 + 1003001 + 1003002 + 1003003 + 1003004 + 1003005 + 1003006 + 1003007 + 1003008 + 1003009 + 1003010 + 1003011 + 1003012 + 1003013 + 1003014 + 1003015 + 1003016 + 1003017 + 1003018 + 1003019 + 1003020 + 1003021 + 1003022 + 1003023 + 1003024 + 1003025 + 1003026 + 1003027 + 1003028 + 1003029 + 1003030 + 1003031 + 1003032 + 1003033 + 1003034 + 1003035 + 1003036 + 1003037 + 1003038 + 1003039 + 1003040 + 1003041 + 1003042 + 1003043 + 1003044 + 1003045 + 1003046 + 1003047 + 1003048 + 1003049; + sum = sum + 1003050 + 1003051 + 1003052 + 1003053 + 1003054 + 1003055 + 1003056 + 1003057 + 1003058 + 1003059 + 1003060 + 1003061 + 1003062 + 1003063 + 1003064 + 1003065 + 1003066 + 1003067 + 1003068 + 1003069 + 1003070 + 1003071 + 1003072 + 1003073 + 1003074 + 1003075 + 1003076 + 1003077 + 1003078 + 1003079 + 1003080 + 1003081 + 1003082 + 1003083 + 1003084 + 1003085 + 1003086 + 1003087 + 1003088 + 1003089 + 1003090 + 1003091 + 1003092 + 1003093 + 1003094 + 1003095 + 1003096 + 1003097 + 1003098 + 1003099; + sum = sum + 1003100 + 1003101 + 1003102 + 1003103 + 1003104 + 1003105 + 1003106 + 1003107 + 1003108 + 1003109 + 1003110 + 1003111 + 1003112 + 1003113 + 1003114 + 1003115 + 1003116 + 1003117 + 1003118 + 1003119 + 1003120 + 1003121 + 1003122 + 1003123 + 1003124 + 1003125 + 1003126 + 1003127 + 1003128 + 1003129 + 1003130 + 1003131 + 1003132 + 1003133 + 1003134 + 1003135 + 1003136 + 1003137 + 1003138 + 1003139 + 1003140 + 1003141 + 1003142 + 1003143 + 1003144 + 1003145 + 1003146 + 1003147 + 1003148 + 1003149; + sum = sum + 1003150 + 1003151 + 1003152 + 1003153 + 1003154 + 1003155 + 1003156 + 1003157 + 1003158 + 1003159 + 1003160 + 1003161 + 1003162 + 1003163 + 1003164 + 1003165 + 1003166 + 1003167 + 1003168 + 1003169 + 1003170 + 1003171 + 1003172 + 1003173 + 1003174 + 1003175 + 1003176 + 1003177 + 1003178 + 1003179 + 1003180 + 1003181 + 1003182 + 1003183 + 1003184 + 1003185 + 1003186 + 1003187 + 1003188 + 1003189 + 1003190 + 1003191 + 1003192 + 1003193 + 1003194 + 1003195 + 1003196 + 1003197 + 1003198 + 1003199; + sum = sum + 1003200 + 1003201 + 1003202 + 1003203 + 1003204 + 1003205 + 1003206 + 1003207 + 1003208 + 1003209 + 1003210 + 1003211 + 1003212 + 1003213 + 1003214 + 1003215 + 1003216 + 1003217 + 1003218 + 1003219 + 1003220 + 1003221 + 1003222 + 1003223 + 1003224 + 1003225 + 1003226 + 1003227 + 1003228 + 1003229 + 1003230 + 1003231 + 1003232 + 1003233 + 1003234 + 1003235 + 1003236 + 1003237 + 1003238 + 1003239 + 1003240 + 1003241 + 1003242 + 1003243 + 1003244 + 1003245 + 1003246 + 1003247 + 1003248 + 1003249; + sum = sum + 1003250 + 1003251 + 1003252 + 1003253 + 1003254 + 1003255 + 1003256 + 1003257 + 1003258 + 1003259 + 1003260 + 1003261 + 1003262 + 1003263 + 1003264 + 1003265 + 1003266 + 1003267 + 1003268 + 1003269 + 1003270 + 1003271 + 1003272 + 1003273 + 1003274 + 1003275 + 1003276 + 1003277 + 1003278 + 1003279 + 1003280 + 1003281 + 1003282 + 1003283 + 1003284 + 1003285 + 1003286 + 1003287 + 1003288 + 1003289 + 1003290 + 1003291 + 1003292 + 1003293 + 1003294 + 1003295 + 1003296 + 1003297 + 1003298 + 1003299; + sum = sum + 1003300 + 1003301 + 1003302 + 1003303 + 1003304 + 1003305 + 1003306 + 1003307 + 1003308 + 1003309 + 1003310 + 1003311 + 1003312 + 1003313 + 1003314 + 1003315 + 1003316 + 1003317 + 1003318 + 1003319 + 1003320 + 1003321 + 1003322 + 1003323 + 1003324 + 1003325 + 1003326 + 1003327 + 1003328 + 1003329 + 1003330 + 1003331 + 1003332 + 1003333 + 1003334 + 1003335 + 1003336 + 1003337 + 1003338 + 1003339 + 1003340 + 1003341 + 1003342 + 1003343 + 1003344 + 1003345 + 1003346 + 1003347 + 1003348 + 1003349; + sum = sum + 1003350 + 1003351 + 1003352 + 1003353 + 1003354 + 1003355 + 1003356 + 1003357 + 1003358 + 1003359 + 1003360 + 1003361 + 1003362 + 1003363 + 1003364 + 1003365 + 1003366 + 1003367 + 1003368 + 1003369 + 1003370 + 1003371 + 1003372 + 1003373 + 1003374 + 1003375 + 1003376 + 1003377 + 1003378 + 1003379 + 1003380 + 1003381 + 1003382 + 1003383 + 1003384 + 1003385 + 1003386 + 1003387 + 1003388 + 1003389 + 1003390 + 1003391 + 1003392 + 1003393 + 1003394 + 1003395 + 1003396 + 1003397 + 1003398 + 1003399; + sum = sum + 1003400 + 1003401 + 1003402 + 1003403 + 1003404 + 1003405 + 1003406 + 1003407 + 1003408 + 1003409 + 1003410 + 1003411 + 1003412 + 1003413 + 1003414 + 1003415 + 1003416 + 1003417 + 1003418 + 1003419 + 1003420 + 1003421 + 1003422 + 1003423 + 1003424 + 1003425 + 1003426 + 1003427 + 1003428 + 1003429 + 1003430 + 1003431 + 1003432 + 1003433 + 1003434 + 1003435 + 1003436 + 1003437 + 1003438 + 1003439 + 1003440 + 1003441 + 1003442 + 1003443 + 1003444 + 1003445 + 1003446 + 1003447 + 1003448 + 1003449; + sum = sum + 1003450 + 1003451 + 1003452 + 1003453 + 1003454 + 1003455 + 1003456 + 1003457 + 1003458 + 1003459 + 1003460 + 1003461 + 1003462 + 1003463 + 1003464 + 1003465 + 1003466 + 1003467 + 1003468 + 1003469 + 1003470 + 1003471 + 1003472 + 1003473 + 1003474 + 1003475 + 1003476 + 1003477 + 1003478 + 1003479 + 1003480 + 1003481 + 1003482 + 1003483 + 1003484 + 1003485 + 1003486 + 1003487 + 1003488 + 1003489 + 1003490 + 1003491 + 1003492 + 1003493 + 1003494 + 1003495 + 1003496 + 1003497 + 1003498 + 1003499; + sum = sum + 1003500 + 1003501 + 1003502 + 1003503 + 1003504 + 1003505 + 1003506 + 1003507 + 1003508 + 1003509 + 1003510 + 1003511 + 1003512 + 1003513 + 1003514 + 1003515 + 1003516 + 1003517 + 1003518 + 1003519 + 1003520 + 1003521 + 1003522 + 1003523 + 1003524 + 1003525 + 1003526 + 1003527 + 1003528 + 1003529 + 1003530 + 1003531 + 1003532 + 1003533 + 1003534 + 1003535 + 1003536 + 1003537 + 1003538 + 1003539 + 1003540 + 1003541 + 1003542 + 1003543 + 1003544 + 1003545 + 1003546 + 1003547 + 1003548 + 1003549; + sum = sum + 1003550 + 1003551 + 1003552 + 1003553 + 1003554 + 1003555 + 1003556 + 1003557 + 1003558 + 1003559 + 1003560 + 1003561 + 1003562 + 1003563 + 1003564 + 1003565 + 1003566 + 1003567 + 1003568 + 1003569 + 1003570 + 1003571 + 1003572 + 1003573 + 1003574 + 1003575 + 1003576 + 1003577 + 1003578 + 1003579 + 1003580 + 1003581 + 1003582 + 1003583 + 1003584 + 1003585 + 1003586 + 1003587 + 1003588 + 1003589 + 1003590 + 1003591 + 1003592 + 1003593 + 1003594 + 1003595 + 1003596 + 1003597 + 1003598 + 1003599; + sum = sum + 1003600 + 1003601 + 1003602 + 1003603 + 1003604 + 1003605 + 1003606 + 1003607 + 1003608 + 1003609 + 1003610 + 1003611 + 1003612 + 1003613 + 1003614 + 1003615 + 1003616 + 1003617 + 1003618 + 1003619 + 1003620 + 1003621 + 1003622 + 1003623 + 1003624 + 1003625 + 1003626 + 1003627 + 1003628 + 1003629 + 1003630 + 1003631 + 1003632 + 1003633 + 1003634 + 1003635 + 1003636 + 1003637 + 1003638 + 1003639 + 1003640 + 1003641 + 1003642 + 1003643 + 1003644 + 1003645 + 1003646 + 1003647 + 1003648 + 1003649; + sum = sum + 1003650 + 1003651 + 1003652 + 1003653 + 1003654 + 1003655 + 1003656 + 1003657 + 1003658 + 1003659 + 1003660 + 1003661 + 1003662 + 1003663 + 1003664 + 1003665 + 1003666 + 1003667 + 1003668 + 1003669 + 1003670 + 1003671 + 1003672 + 1003673 + 1003674 + 1003675 + 1003676 + 1003677 + 1003678 + 1003679 + 1003680 + 1003681 + 1003682 + 1003683 + 1003684 + 1003685 + 1003686 + 1003687 + 1003688 + 1003689 + 1003690 + 1003691 + 1003692 + 1003693 + 1003694 + 1003695 + 1003696 + 1003697 + 1003698 + 1003699; + sum = sum + 1003700 + 1003701 + 1003702 + 1003703 + 1003704 + 1003705 + 1003706 + 1003707 + 1003708 + 1003709 + 1003710 + 1003711 + 1003712 + 1003713 + 1003714 + 1003715 + 1003716 + 1003717 + 1003718 + 1003719 + 1003720 + 1003721 + 1003722 + 1003723 + 1003724 + 1003725 + 1003726 + 1003727 + 1003728 + 1003729 + 1003730 + 1003731 + 1003732 + 1003733 + 1003734 + 1003735 + 1003736 + 1003737 + 1003738 + 1003739 + 1003740 + 1003741 + 1003742 + 1003743 + 1003744 + 1003745 + 1003746 + 1003747 + 1003748 + 1003749; + sum = sum + 1003750 + 1003751 + 1003752 + 1003753 + 1003754 + 1003755 + 1003756 + 1003757 + 1003758 + 1003759 + 1003760 + 1003761 + 1003762 + 1003763 + 1003764 + 1003765 + 1003766 + 1003767 + 1003768 + 1003769 + 1003770 + 1003771 + 1003772 + 1003773 + 1003774 + 1003775 + 1003776 + 1003777 + 1003778 + 1003779 + 1003780 + 1003781 + 1003782 + 1003783 + 1003784 + 1003785 + 1003786 + 1003787 + 1003788 + 1003789 + 1003790 + 1003791 + 1003792 + 1003793 + 1003794 + 1003795 + 1003796 + 1003797 + 1003798 + 1003799; + sum = sum + 1003800 + 1003801 + 1003802 + 1003803 + 1003804 + 1003805 + 1003806 + 1003807 + 1003808 + 1003809 + 1003810 + 1003811 + 1003812 + 1003813 + 1003814 + 1003815 + 1003816 + 1003817 + 1003818 + 1003819 + 1003820 + 1003821 + 1003822 + 1003823 + 1003824 + 1003825 + 1003826 + 1003827 + 1003828 + 1003829 + 1003830 + 1003831 + 1003832 + 1003833 + 1003834 + 1003835 + 1003836 + 1003837 + 1003838 + 1003839 + 1003840 + 1003841 + 1003842 + 1003843 + 1003844 + 1003845 + 1003846 + 1003847 + 1003848 + 1003849; + sum = sum + 1003850 + 1003851 + 1003852 + 1003853 + 1003854 + 1003855 + 1003856 + 1003857 + 1003858 + 1003859 + 1003860 + 1003861 + 1003862 + 1003863 + 1003864 + 1003865 + 1003866 + 1003867 + 1003868 + 1003869 + 1003870 + 1003871 + 1003872 + 1003873 + 1003874 + 1003875 + 1003876 + 1003877 + 1003878 + 1003879 + 1003880 + 1003881 + 1003882 + 1003883 + 1003884 + 1003885 + 1003886 + 1003887 + 1003888 + 1003889 + 1003890 + 1003891 + 1003892 + 1003893 + 1003894 + 1003895 + 1003896 + 1003897 + 1003898 + 1003899; + sum = sum + 1003900 + 1003901 + 1003902 + 1003903 + 1003904 + 1003905 + 1003906 + 1003907 + 1003908 + 1003909 + 1003910 + 1003911 + 1003912 + 1003913 + 1003914 + 1003915 + 1003916 + 1003917 + 1003918 + 1003919 + 1003920 + 1003921 + 1003922 + 1003923 + 1003924 + 1003925 + 1003926 + 1003927 + 1003928 + 1003929 + 1003930 + 1003931 + 1003932 + 1003933 + 1003934 + 1003935 + 1003936 + 1003937 + 1003938 + 1003939 + 1003940 + 1003941 + 1003942 + 1003943 + 1003944 + 1003945 + 1003946 + 1003947 + 1003948 + 1003949; + sum = sum + 1003950 + 1003951 + 1003952 + 1003953 + 1003954 + 1003955 + 1003956 + 1003957 + 1003958 + 1003959 + 1003960 + 1003961 + 1003962 + 1003963 + 1003964 + 1003965 + 1003966 + 1003967 + 1003968 + 1003969 + 1003970 + 1003971 + 1003972 + 1003973 + 1003974 + 1003975 + 1003976 + 1003977 + 1003978 + 1003979 + 1003980 + 1003981 + 1003982 + 1003983 + 1003984 + 1003985 + 1003986 + 1003987 + 1003988 + 1003989 + 1003990 + 1003991 + 1003992 + 1003993 + 1003994 + 1003995 + 1003996 + 1003997 + 1003998 + 1003999; + sum = sum + 1004000 + 1004001 + 1004002 + 1004003 + 1004004 + 1004005 + 1004006 + 1004007 + 1004008 + 1004009 + 1004010 + 1004011 + 1004012 + 1004013 + 1004014 + 1004015 + 1004016 + 1004017 + 1004018 + 1004019 + 1004020 + 1004021 + 1004022 + 1004023 + 1004024 + 1004025 + 1004026 + 1004027 + 1004028 + 1004029 + 1004030 + 1004031 + 1004032 + 1004033 + 1004034 + 1004035 + 1004036 + 1004037 + 1004038 + 1004039 + 1004040 + 1004041 + 1004042 + 1004043 + 1004044 + 1004045 + 1004046 + 1004047 + 1004048 + 1004049; + sum = sum + 1004050 + 1004051 + 1004052 + 1004053 + 1004054 + 1004055 + 1004056 + 1004057 + 1004058 + 1004059 + 1004060 + 1004061 + 1004062 + 1004063 + 1004064 + 1004065 + 1004066 + 1004067 + 1004068 + 1004069 + 1004070 + 1004071 + 1004072 + 1004073 + 1004074 + 1004075 + 1004076 + 1004077 + 1004078 + 1004079 + 1004080 + 1004081 + 1004082 + 1004083 + 1004084 + 1004085 + 1004086 + 1004087 + 1004088 + 1004089 + 1004090 + 1004091 + 1004092 + 1004093 + 1004094 + 1004095 + 1004096 + 1004097 + 1004098 + 1004099; + sum = sum + 1004100 + 1004101 + 1004102 + 1004103 + 1004104 + 1004105 + 1004106 + 1004107 + 1004108 + 1004109 + 1004110 + 1004111 + 1004112 + 1004113 + 1004114 + 1004115 + 1004116 + 1004117 + 1004118 + 1004119 + 1004120 + 1004121 + 1004122 + 1004123 + 1004124 + 1004125 + 1004126 + 1004127 + 1004128 + 1004129 + 1004130 + 1004131 + 1004132 + 1004133 + 1004134 + 1004135 + 1004136 + 1004137 + 1004138 + 1004139 + 1004140 + 1004141 + 1004142 + 1004143 + 1004144 + 1004145 + 1004146 + 1004147 + 1004148 + 1004149; + sum = sum + 1004150 + 1004151 + 1004152 + 1004153 + 1004154 + 1004155 + 1004156 + 1004157 + 1004158 + 1004159 + 1004160 + 1004161 + 1004162 + 1004163 + 1004164 + 1004165 + 1004166 + 1004167 + 1004168 + 1004169 + 1004170 + 1004171 + 1004172 + 1004173 + 1004174 + 1004175 + 1004176 + 1004177 + 1004178 + 1004179 + 1004180 + 1004181 + 1004182 + 1004183 + 1004184 + 1004185 + 1004186 + 1004187 + 1004188 + 1004189 + 1004190 + 1004191 + 1004192 + 1004193 + 1004194 + 1004195 + 1004196 + 1004197 + 1004198 + 1004199; + if sum == 4208817900 { 1 } else { 0 } +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/test.toml new file mode 100644 index 00000000000..4a2add8f53e --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/large_data_section/test.toml @@ -0,0 +1,7 @@ +# Requires data section >32KB (>4096 words) to exercise the large-offset +# codegen path in realize_load(). If constant folding or dedup optimizations +# reduce the data section below this threshold, the test becomes a no-op. +category = "run" +expected_result = { action = "return", value = 1 } +expected_result_new_encoding = { action = "return_data", value = "0000000000000001" } +validate_abi = false