The compiled bytecode of a contract has two sections

  1. Contract initialization

Initialization bytecode is executed only once during the deployment of the contract and is not stored in the storage

600a600c600039600a6000f3602a60505260206050f3

  1. Runtime bytecode

This comprises anything (methods, events, constants, etc.) in the contract except constructor code

0x6057361d000000000000000000000000000000000000000000000000000000000000000a

object "Box" {
    code {
        // initialization code
    }

    object "runtime" {
        code {
            // runtime code within sub-object
        }
    }
}

retrieve() however, instead of returning the value upfront, stores it in memory (mstore(memloc, val))