lines 1-3
Constants for the byte offsets we will read
.equ INSTRUCTION_DATA_LEN, 0x2910.equ INSTRUCTION_DATA, 0x2918.equ ACCT0_TOKEN_AMOUNT, 0x00A0Three byte offsets into the input region (the block of bytes r1 points at). Declare them up front, read them by name. No structs, no parsers.
Why ACCT0_TOKEN_AMOUNT = 0xA0 (160 decimal)? Solana's aligned loader lays account 0 out in a fixed shape: a per-account header first, then the account's data right after. The header is exactly 0x60 bytes (96 decimal). Inside that 96: dup tag + signer/writable/executable flags (8) + 32-byte pubkey + 32-byte owner + u64 lamports + u64 data_len = 96. So account 0's data block starts at byte 0x60.
An SPL Token account stores its fields in this order: mint (32 bytes) + owner (32) + amount (u64) + ... The amount we care about sits at byte 64 INSIDE the data block. Add that to the data block's start: 0x60 + 0x40 = 0xA0. That is why the constant is 0xA0. One add, no runtime work.
Why INSTRUCTION_DATA_LEN = 0x2910 and INSTRUCTION_DATA = 0x2918? After every declared account's region, the loader appends the instruction's metadata (your ix data length and bytes, the program id, signer indices). Each account region takes about 0x2868 bytes when the account has no data. Account 0 here is a real SPL Token account with 165 bytes of state, which pushes the metadata 168 bytes further along (165 rounded up to an 8-byte alignment boundary). That extra padding is why slippage's offsets are bigger than balance_floor's 0x2868. INSTRUCTION_DATA sits exactly 8 bytes past the length field because the length is a u64.